我在主机和交换机之间有一个链接。
该链接具有带宽&延迟。如何计算从 Host A 传输到 Switch 1 的2个数据包(大小为1KB)的时间?
这是图表(我说的是第一个链接)
注意:我只想手动计算这些值,我想知道计算这些问题的原则/规律。
答案 0 :(得分:15)
Propagation time = (Frame Serialization Time)
+ (Link Media Delay)
+ (Queueing Delay)
+ (Node Processing Delay - if known)
Frame Serialization Time = S/R
Link Media Delay = D/p
Queueing Delay = Q / R
适用于您的问题:
我只计算主机A和交换机1 之间的链接的信息:
Frame Serialization Time = Packet_size_bits / Link_data_rate_bps
= 2*1024*8 / (2*10**6)
= 0.00819 [seconds]
Link Media Delay = 0.04 seconds [from diagram: 40ms]
Queueing Delay = 0.0 [assume no congestion]
Node Processing Delay = 0.0 [Host A had nothing specified for delay]
-----------------------------------------------------------------------
Total = 0.00819 + 0.04 + 0.0 + 0.0
= 0.04819 seconds
= 48.2 milliseconds for two 1KB packets to go from
Host A to Switch 1
答案 1 :(得分:6)
相当粗略,公式是:
LATENCY + SIZE / THROUGHPUT<br>
In your example:<br>
LATENCY = 40ms = 0.04<br>
SIZE = 1000*2<br>
THGOUGHPUT = 2Mbps = 250,000 Bytes/second<br>
底线:
0.04 + 2000 / 250000 = 0.048 = 48ms<br>
请注意,我将所有单位转换为字节和秒,因此计算是有意义的
这对于大型数据包更准确。对于小包,实数更大。