Netexpert FAQ 网络分析专家学习建议入口 @netexpert成员申请指南
网络分析时代 netexpert积分规则的说明 Netis招贤纳士(2008年11月22日更新)
发新话题
打印

怎么理解丢包率?

怎么理解丢包率?

我现在正在编程实现读取ethereal文件计算丢包率,可是不太清楚丢包率的准确定义。
我的理解:丢包率应该是(源端发送的包数与接收端接收到的包数的差值除以源端发送的包数),即假设时间间隔T取为1秒,我想的是这一秒内直接算出来发送的包数与接收到的包数,将其差值除以发送的包数。如此,计算出每一秒所得到的丢包率,然后可得丢包率的变化图(因为我是用matlab进行处理,所以得到的都是离散值)。
而我师姐说,应该先读取ethereal发送和接收所抓的包文件,得出每个包收到的时间或丢失时间,做出一张时间表,根据这张表计算丢包率。即假设第一秒内发送10个包,收到8个包,而另2个包并未丢失,只是在下一秒收到,所以第一秒的丢包率仍为0。而若按我的理解,第一秒的丢包率应为20%。
综上,请问丢包率所指的确定丢失的包吗?
而若我师姐的理解正确,我应如何判定一个包的丢失时间?貌似需要通过ack包来判断,但ack确认包与其对应的数据包的联系是什么?
汗,俺是菜鸟,很多概念都很模糊,请高手指教。

TOP

RFC2544中有一个丢包率的概念,各种测试仪表厂商测试丢包率的实现都是依据这个RFC来做的。具体实现如下:

首先,以一定的速率发送数据包,在发送的数据包中特定字段打上特定的标记,比如数据结尾部分全部都是x1x1,然后发送这个数据包,在接收端查看收到的这些数据包的数量,这样,通过对比发送的特定数据包的数量和接收到的特定数据包的数量就可以算出丢包率了。理论上是一个平均值的概念。例如在1秒内发送1000个数据包,收到500个,那么丢包率应该是(1000-500)/1000=50%,发送仪表会自己计算一秒内发送的数据包。(当然,测试仪表会等待几秒,确认所有没有丢掉的数据包都到达了,这个可以自己定义,如果一个数据包过了100秒才到达,和丢了也没什么区别了哈)

另外,需要提醒你的是,现有测试丢包率的概念都是2层包或3层包,貌似没有去做更高层的包的丢包率,你说的按照ACK包来判断丢包,好像很不现实。而且你也应该知道,如果数据包存在ACK机制,肯定会涉及到重传,重传的数据包又怎么计算呢?

下面是RFC定义的原文,你可以看看

Frame loss rate

Objective: To determine the frame loss rate, as defined in RFC1242,
of a DUT throughout the entire range of input data rates and frame
sizes.

Procedure: Send a specific number of frames at a specific rate
through the DUT to be tested and count the frames that are
transmitted by the DUT. The frame loss rate at each point is
calculated using the following equation:

( ( input_count - output_count ) * 100 ) / input_count

The first trial SHOULD be run for the frame rate that corresponds to
100% of the maximum rate for the frame size on the input media.
Repeat the procedure for the rate that corresponds to 90% of the
maximum rate used and then for 80% of this rate. This sequence
SHOULD be continued (at reducing 10% intervals) until there are two
successive trials in which no frames are lost. The maximum
granularity of the trials MUST be 10% of the maximum rate, a finer
granularity is encouraged.

Reporting format: The results of the frame loss rate test SHOULD be
plotted as a graph. If this is done then the X axis MUST be the
input frame rate as a percent of the theoretical rate for the media
at the specific frame size. The Y axis MUST be the percent loss at
the particular input rate. The left end of the X axis and the bottom
of the Y axis MUST be 0 percent; the right end of the X axis and the
top of the Y axis MUST be 100 percent. Multiple lines on the graph
MAY used to report the frame loss rate for different frame sizes,
protocols, and types of data streams.

Note: See section 18 for the maximum frame rates that SHOULD be used.

TOP

每层应该分开来看,第2层,第3层也该分开理解

TOP

现在学习了~原来没认真去想过

TOP

唉,得好好学习学习基本概念了

TOP

发新话题
版块跳转