Dufference in pinging 127.0.0.1 and your machine IP number

My machine’s ip is: 172.16.10.50

What is the difference between pinging 127.0.0.1 and 172.16.10.50 from my PC from troubleshooting point of view?

Is 127.0.0.1 reaching my NIC to loop back or what is doing? How does it know that my TCP/IP is working just fine?

When I ping myself eg. machine ip = 172.16.10.50, does it ever leave the machine/touch the media and than returns back or not?

Could you explain what is happening in steps for each?

Thank you.
howeiAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

td_milesCommented:
It might depend on your OS, but typically the loopback interface is a "virtual" interface that isn't connected to an actual physical interface. As an example of this, on my Linux box, I can shutdown interface eth0 but still ping 127.0.0.1 with a response. Pinging 127.0.0.1 allows you to determine if networking/ TCP/IP is working OK. If it is, but you can't ping the IP of your adapter, then you can look at problems with the actual adapter (drivers, settings, etc).
 
When you ping your own IP address (172.16.10.5), I don't think it gets to the physical media. Again I test this on my Linux box, I unplug interface eth0 from the network, then bring the interface up. If I ping the IP address of the interface I still get a response even though it is not connected to any media. This would indicate that the ping to the IP address of the adapater is not going past the adapter. This also makes sense if you think about it a bit more, as if the request went out onto the media, there would not be a response, as no other machine would respond (it's not their IP address), so you would never get a response from the media if you sent the request out to your own IP address.
howeiAuthor Commented:
When I unplug cable from my WIN XP machine and ping myself I get "unreachable"?

Is it possible that when you ping your own IP, ping request is going to the switch MAC table, finds your info there and returns back to you?

Still not sure is it ever leaving my machine and touching the cable when I ping my own IP.
I would also thing that it shouldn't have to leave.
Anyone knows for sure?
td_milesCommented:
This could well be an OS specific thing. When you unplug the cable, XP disables the interface (I know it does this) and so ther interface can't answer pings to its IP address.

If you wanted to be really sure, plug the machine into a HUB (yes a hub, not a switch) and then on another PC run etherpeek (or some other sniffer). On the other PC, ping its own IP address and see if the sniffer sees the PING traffic. If it does, then the traffic is going onto the media, if it doesn't then traffic is staying local to the card.
sTaTicCommented:
Go to a command prompt and type in the command "route print"

You'll notice that the gateway and interface for your nic's IP is listed as the loopback.  Given that fact, I would guess that pinging your own IP and the Loopback would give you identical results, neither of which would reach your card.

So to answer your questions. . .

"What is the difference between pinging 127.0.0.1 and 172.16.10.50 from my PC from troubleshooting point of view?"
->There is no difference.

Is 127.0.0.1 reaching my NIC to loop back or what is doing?
->No.  It's testing the TCP/IP protocol installed on the machine.

How does it know that my TCP/IP is working just fine?
->It just tests the TCP/IP stack. . .not any of the hardware.

When I ping myself eg. machine ip = 172.16.10.50, does it ever leave the machine/touch the media and than returns back or not?
->Does not leave the machine.

Could you explain what is happening in steps for each?
->I hope I did =)
Steve JenningsSr Manager Cloud Networking OpsCommented:
"What is the difference between pinging 127.0.0.1 and 172.16.10.50 from my PC from troubleshooting point of view?"
->There is no difference.

Not quite true . . . when your cable is unplugged, you wont be able to ping your actual IP address, but you will be able to ping the loopback address. Essentially, when your cable is unplugged the carrier goes away and the routing table gets flushed of all external routes . . . so you get a "destination unreachable" error when you try to ping your own address.

So . . . successfully
a) pinging the loopback tests the IP stack
b) pinging your own IP address tests the IP stack and the presence of a carrier signal on your NIC.
c) pinging another machines IP address means all's well.

Good luck,
Steve

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Routers

From novice to tech pro — start learning today.