【问题标题】:Calculating time of a packet through a network cable通过网线计算数据包的时间
【发布时间】:2012-12-05 15:26:36
【问题描述】:

我正在准备网络考试。

在之前的一次考试中给出了这个问题:

Assume you're sending a packet of length 4000 bit
through a cable of length 1000 km.
The signal in the cable is moving at 200000 km/s.
The signal bandwidth is 10 Mbit/s.
Calculate how much time it would take for the packet to arrive.

考虑到道路长度和车速,如果我用汽车来做这件事, 这可能需要 200 秒。虽然我不确定如何在计算中应用 mbit/s 和 bits。

这是正确的做法吗?

(10 mbit/s / 4000 bit) * (200000 km/s / 1000 km) = seconds packet needs to arrive

【问题讨论】:

    标签: math networking distance data-transfer


    【解决方案1】:

    传输时间等于SEND_TIME + EXPANSION_TIME

    (为简单起见,我使用Mbit作为10^6位而不是2^20,原理相同)

    SEND_TIME = #bits / #bits_per_sec = 4000 / 10*10^6 = 4*10^-4
    EXPANSION_TIME = length / expansion_speed = 1000 / 200000 = 5 * 10^-3
    

    total 为 0.0054


    奖励:

    一个好的做法是查看单位并确保最后得到正确的单位,所以上面的实际上是:

    SEND_TIME = #bits / #bits_per_sec = 4000[bit] / 10*10^6[bit/sec] = 4*10^-4 [bit/bit * sec] = 0.0004 [sec]
    EXPANSION_TIME = length / speed = 1000 [km] / 200000 [km/sec] = 5 * 10^-3 [km / km * sec] = 0.005 [sec]
    

    【讨论】:

    • 非常感谢!这比我最初的想法更有意义。
    猜你喜欢
    • 2014-03-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-11
    • 2023-04-07
    相关资源
    最近更新 更多