我需要公式来准确计算 1 Gig Nic 卡的带宽。我正在做的是以 1Gbps 的速度发送第 2 层数据包,但我的软件显示 6oo Mbps。
整个实验是背靠背的。没有交换机没有路由器。
这就是我所做的。
// LinkSpeed = 1Gb
UINT nBandwidth = LinkSpeed/100;//Mbps
nBandwidth = nBandwidth/8; //Bytes/sec
nBandwidth = nBandwidth/FrameLength;
//Frames/Sec. Frame Length = 1518
UINT FramesPerBurst = (nBandwidth*Sleeptime)/1000;
//Frames/Burst
UINT nBufferSpaceNeededPerFrame = FrameLength-4 + sizeof(dump_bpf_hdr));
UINT nTxBufferSize = FramesPerBurst * nBufferSpaceNeededPerFrame;
unsigned char* pTxBuffer = new
unsigned char[m_nTxBufferSize];