0

Using mtr to gather some statistics, if I run sudo mtr 10.0.1.1 to ping my router, it looks terrible:

                              My traceroute  [v0.85]
Johns-MacBook-Air.local (0.0.0.0)                         Tue Feb 11 10:11:32 2014
Keys:  Help   Display mode   Restart statistics   Order of fields   quit
                                          Packets               Pings
 Host                                   Loss%   Snt   Last   Avg  Best  Wrst StDev
 1. 10.0.1.1                             0.0%    52   17.1  79.0   1.0 298.9 103.1

But if I run sudo mtr google.com, and look at just the first hop, it looks fine:

                              My traceroute  [v0.85]
Johns-MacBook-Air.local (0.0.0.0)                         Tue Feb 11 10:12:55 2014
Keys:  Help   Display mode   Restart statistics   Order of fields   quit
                                          Packets               Pings
 Host                                   Loss%   Snt   Last   Avg  Best  Wrst StDev
 1. 10.0.1.1                             0.0%    40    1.4   1.7   1.4   4.1   0.5
 2. mosca-lan207.gw.monkeybrains.net     0.0%    39   13.7  23.8   5.6 111.4  22.9
 3. grillo.grillo-mosca-10GB.core.monke  0.0%    39    6.0  10.0   5.5  21.7   3.6
 [snip]

Why would this happen?

7

You have a router, it's very good at routing packets. It's not a ping responder, so it's not so good at responding to pings.

The router has to do a lot more work to respond to a ping than to forward a packet, and it's all work it's not optimized for. Forwarding a packet typically takes place entirely at interrupt level, using all hardware and software that's been heavily optimized to do that as quickly as possible. Responding to a ping requires receiving the packet, discovering that it's local, scheduling some higher level code to run at process level, waiting for that code to run (as it competes with other long-running, process-level functions), forming a reply packet, queuing that reply packet, and dispatching the code to run that queue.

Basically, a router has a fast path and a slow path. The fast path handles routing. The slow path handles everything else.

1

Not the answer you're looking for? Browse other questions tagged or ask your own question.