eagertoLearn
eagertoLearn

Reputation: 10132

why my IP address is public but not private?

In my work, I have a desktop that is connected to internet with ethernet. It does not have a private IP address but a public one: 172.16.30.208. My laptop which is connected wireless has IP address which is again NOT private: 128.208.138.125.

when I ping my laptop from the desktop (packets received)

ping 128.208.138.125, 
PING 128.208.138.125 (128.208.138.125): 56 data bytes
64 bytes from 128.208.138.125: icmp_seq=0 ttl=59 time=83.788 ms
64 bytes from 128.208.138.125: icmp_seq=1 ttl=59 time=24.384 ms
64 bytes from 128.208.138.125: icmp_seq=2 ttl=59 time=120.292 ms

but when I ping my desktop from laptop (no response)

ping 172.16.30.208
PING 172.16.30.208 (172.16.30.208): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2

The questions are: why the IP address on both the computers are not private? (anything starting with 192.X.X.X and 10.X.X.X are private I suppose)

why I was able to ping from desktop to laptop but not other way?

I understand that both desktop and laptop are in different network.

Upvotes: 0

Views: 2216

Answers (1)

iwolf
iwolf

Reputation: 1062

Addresses in the range 172.16.0.0 to 172.31.255.255 are also reserved, like 192.168.x.x and 10.x.x.x, and are not routed externally. http://en.wikipedia.org/wiki/Reserved_IP_addresses. So the DHCP settings on the ethernet router in question don't match the more common 192.168.x.x or 10.x.x.x defaults, but the router isn't handing out public addresses.

Edit - because the comments are getting long:

The desktop can successfully ping the laptop because of NAT (http://en.wikipedia.org/wiki/Network_address_translation). This is how any machine with an internal IP is able to get data from outside the local network. Continuing with the example from this question: The desktop assembles a ping request packet with the laptop's public IP as the destination. When the local router sees that the destination is external but the source is internal, it swaps the source address for the router's own public address before sending. That means the laptop just replies directly to the router. However, when the router gets the response, it remembers which local device actually requested the ping and swaps the destination address on the response from the router public address to the correct internal address before passing it through to the internal network.

Edit - Elaborating on the laptop side

Quick disclaimer: The public/private question of the laptop IP is pretty specific to the UW network setup, which I haven't actually worked with, so much of the following is conjecture based on my links from the comments.

The short answer: 128.208.135.125 is a public IP address that is owned by UW. It will only be assigned to one device at a time (i.e. your laptop right now).

The long answer: The UW network runs a different type of NAT that they call "Masquerading". Each NAT setup comes with its own lists of pros and cons; I will only be highlighting a few considerations. The key difference here lies in this step from my previous NAT overview, "[the router] remembers which local device actually requested[...]". Normally, the router "remembers" by keeping a table of local addresses and the recent requests made by the associated devices so it knows which replies go to whom. With this setup, the address translation must always be done to route data between internal and external devices. In the masquerading version, each device has both a public and private address and the table no longer has to track requests; it just maps between the public and private addresses. This means the address translation can be optional depending on the context, and hosts connected to the UW network in this fashion can communicate among themselves using either private or public addresses depending on how the host would like the packets to be treated by the router(s) and firewall(s). However, any device outside the masquerading section of the network needs to use the public address. This also allows an optimization, that UW has taken advantage of, where the table can be implied by convention. In this case, the address translation will always be changing the leading "128" in the address to "10" or vice-versa, so the table doesn't need to be stored anywhere. Your laptop's private address will be 10.208.135.125.

Upvotes: 1

Related Questions