Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I went to the site http://www.whatismyip.com . It showed a ip that is not my system's ip and it also showed the proxy server's ip address. So I assumed that the nat router is providing a public ip for my system.
But when I went to the same site from another pc in the same lan. It showed the same ip address again.
              So it must be overloading nat right? But overloading nat assigns a unique port number to your machine(since the ip address is the same for all the machines in that lan). But http://www.whatismyip.com does not show the port number. Why is that so?

share|improve this question

closed as not a real question by Shane Madden, Zoredache, Kenny Rasschaert, Sven, Khaled Apr 30 '12 at 7:05

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

    
That is the source port of the TCP connection your router makes to their web server. It won't mean anything though. The router will use a different source port each time regardless of which client initiated the connection. (And it will, of course, eventually reuse them.) –  David Schwartz May 1 '12 at 11:45
    
@JDavidSchwartz : Still it is using that port number to identify machine and forward the reply to my machine right? A unique port is assigned for each unique connection, not per host behind the NAT.Even though the port changes for each connection but for that particular connection that port number uniquely identifies my machine right? –  Ashwin May 2 '12 at 1:03

2 Answers 2

up vote 6 down vote accepted

But whatismyip.com does not show the port number. Why is that so?

A unique port is assigned for each unique connection, not per host behind the NAT.

A NAT must be able to figure out not only what IP address to return a packet to, but also what port.

The NAT table has to have more information to re-write packets in both directions

  • destination IP
  • destination port
  • external source IP (assigned by NAT)
  • external source port (assigned by NAT)
  • internal source IP
  • internal source port

When a reply returns from an external host, the NAT will lookup the correct internal source IP and port based on the external source IP and Port that was assigned to the connection.

The port used by the actual host behind the NAT has nothing to do with the port selected and used by the NAT.

share|improve this answer
    
Thanks for that(A unique port is assigned for each unique connection, not per host behind the NAT ). But still the nat router should forward the port number to the server right? Otherwise how will the server reply(the server only has the ip address and in overloading nat all the internal systems have the same ip address and are differentiated by the port number.) –  Ashwin Apr 30 '12 at 6:25
    
Sorry, but you are using the word 'server' here, what are you referring to? The external host that is accessed? The socket has to have all 4 elements IPs and ports for the external host to be able to reply. –  Zoredache Apr 30 '12 at 6:39
    
yes the external host that is accessed. The server replies to the "external source ip" and the "external source port" right? That means it has the "external source port" with it. Then why is whatismyip.com (server) not showing the that port. –  Ashwin Apr 30 '12 at 6:41
2  
@Ashwin: Neither. The NAT router has a public IP and most likely, it's the only device that has a public IP. Every connection it makes uses that same IP address as its source and from the outside, there is no way to tell which machine inside the LAN it came from. The NAT router is the only device that knows that, or needs to know it. –  David Schwartz Apr 30 '12 at 8:03
1  
@Ashwin: You obviously don't understand how NAT works. Please read something about it, maybe starting with en.wikipedia.org/wiki/Network_address_translation –  Sven Apr 30 '12 at 8:04

So it must be overloading nat right? But overloading nat assigns a unique port number to your machine(since the ip address is the same for all the machines in that lan). But http://www.whatismyip.com does not show the port number. Why is that so?

Simple. Because the web application at http://www.whatismyip.com does not keep track of ports. It sends the communication back on the outbound port that the original communication came in on, and your firewall manages that NATing. I'm sure the http://www.whatismyip.com app could be told to display the port if the developers wanted it to, but they did not implement that as a feature.

share|improve this answer
    
are you sure about that. I am asking this because I have a proxy server which has a local ipaddress. So I also have a doubt that the nat router is providing a public ip address to the proxy and no to my machine. Can this happen? –  Ashwin Apr 30 '12 at 6:55
5  
@Ashwin I'm sure of a few things in this life, and one of them is that you need to spend much more time learning TCP/IP networking. –  Wesley Apr 30 '12 at 7:18
    
WOW!!! What a man!! –  Ashwin Apr 30 '12 at 7:41

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