<p> hi</p>
<p><br>I have been working on a project in which PC send/receive ethernet<br>frame to/from a FPGA board.<br>The connection via a 1 Gb switcher.</p>
<p>In order to test the limitation of the switcher, I send a big file<br>(about 2.6GB) from PC TO PC via the switcher by an application like<br>IM. The rate is about 30 MB/s.</p>
<p>I programmed a software based on winpcap, but the rate of sending<br>seems not so fast as what it is supposed to be. The rate is about<br>4MB/S.</p>
<p>In order to figure out the bottleneck, I made a simplest program<br>which only sends Ethernet frame in loop. Each frame 's size is<br>about 1460 bytes. And I captured the frame by Wireshark. I noticed<br>that the period time between each frames is about 0.0002<br>
seconds. According to that , I can calculate the rate like : 1460<br>bytes/ 0.0002= 6.9 MB/S. And I runed the program on PCs with 100M<br>Ethernet cards and on 1G Ethernet cards. There is no difference no<br>matter that the netcard is 100M or 1G.</p>
<p>The question is how could I improve Is there any parameters that I<br>need to configure to improve the period time between the frames so<br>that I can increase the rate of sending Ethernet frame ?</p>
<p> </p>
<p>void CWndDown::OnBtnTst()<br>{<br>// TODO: Add your control notification handler code here</p>
<p>//<br>int iAmount= sizeof (FrameHead ) + sizeof(FrameHead2 )+1440*sizeof<br>(char);//length of the frame<br>unsigned char *pData2=new unsigned char [iAmount ];//<br>FrameHead * pfHead=(FrameHead *)pData2; //<br>FrameHead2 * pfHead2=(FrameHead2 *)( pData2+sizeof (FrameHead ));//<br>
unsigned char *pData=(unsigned char *)( pData2+sizeof (FrameHead ) +<br>sizeof(FrameHead2 ));//<br>CString tmp; //<br>unsigned char pp[6];//<br>unsigned long i;<br>//get the destination'S MAC<br>for(i=0;i<6;i++)<br>
{<br> tmp.Format("0x%c%c",m_MacAddrSel.macAddrFpgaA.GetAt(i*3),<br> m_MacAddrSel.macAddrFpgaA.GetAt(i*3+1));<br> pp[i]=_tcstoul(tmp,0,16);</p>
<p> }</p>
<p>pfHead->DesAddr.addr0=pp[0];<br> pfHead->DesAddr.addr1=pp[1];<br> pfHead->DesAddr.addr2=pp[2];<br> pfHead->DesAddr.addr3=pp[3];<br> pfHead->DesAddr.addr4=pp[4];<br> pfHead->DesAddr.addr5=pp[5];</p>
<p><br>//get the SOURCE'S MAC<br>for(i=0;i<6;i++)<br> {<br> tmp.Format("0x%c%c",m_MacAddrSel.macAddrPc.GetAt(i*3),<br>m_MacAddrSel.macAddrPc.GetAt(i*3+1));<br> pp[i]=_tcstoul(tmp,0,16);//</p>
<p> }</p>
<p><br>pfHead->SrcAddr.addr0=pp[0];<br> pfHead->SrcAddr.addr1=pp[1];<br> pfHead->SrcAddr.addr2=pp[2];<br> pfHead->SrcAddr.addr3=pp[3];<br> pfHead->SrcAddr.addr4=pp[4];<br> pfHead->SrcAddr.addr5=pp[5];</p>
<p>pfHead->FrmLgth=htons(0x002e);//</p>
<p><br>pfHead->FrmTyp=htons(FRAME_DATA);</p>
<p><br> pfHead2->len= 1;</p>
<p>memset(pData, 0x55, 1440);<br>pfHead2->seq=htonl(i);</p>
<p>int iLoopTime=1;</p>
<p>while(iLoopTime)<br>{<br>/* SEND PACKETS */<br>if (pcap_sendpacket(m_gadhandle,pData2, iAmount ) != 0)<br>{<br>MessageBox("\nError sending the packet: \n","ΜαΚΎ",MB_OK|<br>MB_ICONINFORMATION);<br>}<br>
}</p>
<p>delete []pData2;</p>