Solved

Dufference in pinging 127.0.0.1 and your machine IP number

Posted on 2003-10-28
7
610 Views
Last Modified: 2011-09-20
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.
0
Comment
Question by:howei
7 Comments
 
LVL 13

Expert Comment

by:td_miles
Comment Utility
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.
0
 

Author Comment

by:howei
Comment Utility
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?
0
 
LVL 13

Expert Comment

by:td_miles
Comment Utility
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.
0
 
LVL 1

Expert Comment

by:sTaTic
Comment Utility
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 =)
0
 
LVL 16

Accepted Solution

by:
SteveJ earned 50 total points
Comment Utility
"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
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

It happens many times that access list (ACL) have to be applied to outgoing router interface in order to limit some traffic.This article is about how to test ACL from the router which is not very intuitive for everyone. Below scenario shows simple s…
This article is a guide to configure bridging on Cisco Routers.  This is something I never knew was possible until after making a few phone calls to Cisco.  Using bridging saved our company money by not requiring us to purchase a new switch.  Bridgi…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now