Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a router with three computers connected to it via Wi-Fi. One day, computer A requests the file "index.php" from a server with IP address XYZ. Then the second computer, B, requests the file "home.html" from the same server, and computer C requests "picture.jpg" from the same server. If all these requests are made at the exact same time, how does the router know which file to send to which computer? Could these simultaneous requests cause problems such as sending "home.html" to computer C instead of B?

share|improve this question

closed as not a real question by CharlieRB, BBlake, Dave M, Simon Sheehan, Keltari Jan 28 '13 at 15:46

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.

Is there an actual problem you are having? If so, please edit your question with what is actually happening? This is not a site for hypothetical situations to be pondered and discussed. – CharlieRB Jan 28 '13 at 12:43
It would take a great deal of effort to make all three computers have the same private LAN ip address. One has to ask why you are asking about this ridiculous example one that wouldn't about in the real world(and if it did then the configuration is still ridiculous). Unless you clarify an ACTUAL problem I have to downvote this question. – Ramhound Jan 28 '13 at 14:09
@Ramhound: I fear you may have misread the question, although the title is indeed confusing. This is not about multiple machines trying to obtain the same address from a DHCP server, but about how requests made to the same IP are distinguished when they originate from the same network. That's a very 'real world' scenario. – Marcks Thomas Jan 28 '13 at 15:23
@MarcksThomas - I would argue that router must be the DHCP server in this question otherwise it the question makes no sense. In any case the question need to be clarified and the title updated once that is done – Ramhound Jan 28 '13 at 15:28

Sender's IP address is stored in its messages, so that the receiver can send back a response to the appropriate computer. In that case, the router just routes packets.

When the computers on a private LAN behind a single IP address, the router also performs Network Address Translation. In that case, the router maintains a translation table for routing the packets to the appropriate computer.

share|improve this answer

Whenever a client visits a website, it attempts to open a TCP connection between itself and the server. This connection is uniquely identified by its destination IP address, destination port, source IP and source port. For a client behind IP visiting, the connection could appear as: -

Web servers generally run on port 80, the default port for HTTP traffic, so clients would send their requests to view a web page to that port. If the server would use the same port to send its reply, browsing the web would interfere with the operation of a web server the client might be running himself. Fortunately, the client initiating the connection can use whatever source port is available. This port will be reserved as temporarily in use until both machines agree on closing the connection. The IANA suggests to use the range 49152 to 65535 for these so-called 'ephemeral ports', a recommendation most operating systems adhere to nowadays.

Below is a screenshot of a server showing one SSH and two HTTP connections, as well as the ephemeral ports the machine is responding to.


While the operating system ensures no connections are opened on source ports already in use, it cannot reserve them for the entire local area network. However, the router can. Though not technically required, in the most common NAT setup, the router rewrites both the source address and port of all outgoing packets, hence 'network address (port) translation', maintaining a table of all open connections. Some routers even allow you to view this table directly, for instance using telnet:


By reassigning port numbers, the router can keep track of every connection individually and forward replies to the appropriate host. For example, this is what happens when machines A and B simultaneously try to access from the same network, accidentally using the same ephemeral port.

  • Host A opens a TCP connection to src:, dest:
  • The router rewrites this to src:, dest: and notes the translation in the connection table.
  • Host B also opens a TCP connection to src:, dest:
  • The router notices the source port is in use and rewrites to src:, dest:
  • The web server reponds to both and
  • The router matches incoming traffic against its connection table and forwards packets to the appropriate machine, e.g. for B: src:, dest:

In conclusion, as long as your NAT is working correctly, simultaneous requests from different computers on your network that risk being mixed up are rewritten by the router to be easily distinguishable, making sure the right web page ends up at the right browser.

share|improve this answer
+1 for such a complete answer. His question may be closed, but you answered mine. – Praesagus May 1 '14 at 1:57

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