I have a link between a host and a switch.
The link has a bandwidth & a latency. How to calculate the time of 2 packets(with size 1KB) to be transferred from Host A to Switch 1?
Here's the diagram(I am talking about the first link)
Note: I just want to calculate it manually for these values, I want to know the principles/laws of calculating these problems.
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
Applying to your question:
I will only calculate information for the link between Host A and Switch 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
Quite roughly, the formula is:
LATENCY + SIZE / THROUGHPUT<br>
In your example:<br>
LATENCY = 40ms = 0.04<br>
SIZE = 1000*2<br>
THGOUGHPUT = 2Mbps = 250,000 Bytes/second<br>
Bottom line:
0.04 + 2000 / 250000 = 0.048 = 48ms<br>
Notice that I converted all units to bytes and seconds, so calculations are meaningful.
This is more accurate for large packets. For small packets, real numbers are larger.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With