Pinging personal IP versus pinging loopback
Think of it as a different interface. A different network card.
When you ping the loopback, you are pinging yourself, and there is somewhere (where varies from system to system, slightly) something representing a network interface on yourself.
When you ping your IP address, you ping yourself, but it goes through those drivers for that network card first, or at least can.
Implementations of this behavior do in fact vary from system to system, but that's conceptually how it works.
Also, you won't notice a time difference, as both of them are extremely fast.
Jon Phenow
Web Developer. I tend to work on Backend Web Technologies
Updated on June 05, 2022Comments
-
Jon Phenow almost 2 years
What's the conceptual difference? Yes I realize they're both supposed to produce similar results but I thought the idea with the loopback was that it doesn't actually reach the transmission step of the stack. If that's true then why does pinging your own ip work as fast? Does pinging your own address treat it as a loopback? I thought there was a fundamental difference to how the two were treated.
Thanks in advance for any help!
-
Jon Phenow about 13 yearsHmm okay I see what you mean - so does the computer technically think it should be sending the packet outward or does the network card basically just send it right back through the stack? This, in my mind, makes the two seem pretty similar but the loopback, as you've said, has less crap to go through. That's how I'm understanding it anyways, am I getting this right?
-
Brad about 13 yearsThat's correct. However, typically packets sent to your own IP will be returned by the driver, and not the card itself. It is my understanding that in some IP implementations, the OS or something else will have this same behavior before the card's driver even sees it.
-
Jon Phenow about 13 yearsInteresting, thanks a lot! I'm currently in a Networking class and our professor left the differentiation of the two kind of ambiguous and this is exactly what I was hoping for, thanks much!
-
Sumit Trehan almost 11 years@Brad If i ping myself on eth1 IP (suppose 192.168.1.2). In the routing table, the route will say it is a local route. So will the ping packet be sent to the switch and then back to me?
-
Brad about 10 years@SumitTrehan If you ping yourself on your Ethernet IP, the packet will not leave your computer. Even if it did, the switch doesn't operate on the IP layer (unless of course you have a layer 3 switch, which is really just a beefy router at that point).