Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
578 views
in Technique[技术] by (71.8m points)

networking - How to calculate packet time from latency and bandwidth

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)

Latency & Bandwidth

Note: I just want to calculate it manually for these values, I want to know the principles/laws of calculating these problems.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Propagation time = (Frame Serialization Time) 
                  + (Link Media Delay) 
                  + (Queueing Delay) 
                  + (Node Processing Delay - if known)

Formulas:

  • Frame Serialization Time = S/R
  • Link Media Delay = D/p
  • Queueing Delay = Q / R
  • Node processing delay is normally specified or measured

Variable decoder:

  • R: link data rate (bits/second)
  • S: Packet size (bits)
  • D: Link distance (meters)
  • P Processing Delay (seconds)
  • p: medium propagation speed (meters/second)
    • speed in copper is 210*10**6
    • speed in fiber is 300*10**6
  • Q: Queue depth (bits); note: if the link is not congested, there is no Queue depth

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...