-1

Routers manage data connections between the internet and computers or connections between computers on a LAN. It makes sense that when, for example, a computer requests music from Pandora, that packets containing music data from Pandora are routed from the internet connection to the computer that requested it.

What if two computers are requesting music from Pandora at the same time? How does the router manage the two incoming data streams? Does it complete one request and move on to the next, similar to a stack, or does it jump between requests, similar to threads, or does it do something totally different?

  • 2
    This question appears to be off-topic because a this question does not relate to professional system administration. – pauska Jul 14 '13 at 01:19
  • http://en.wikipedia.org/wiki/Network_socket#Socket_pairs – Chris S Jul 14 '13 at 01:36
  • Short answer: The same way every computer can manage multiple incoming data streams, such as if two different browsers are doing Google searches at the same time. – David Schwartz Jul 14 '13 at 07:38

1 Answers1

2

It's pretty easy:

A unique connection, or flow, is identified by four numbers:

  1. The source IP address.
  2. The source port.
  3. The destination IP address.
  4. The destination port.

Thus in the general case it's trivial to disambiguate between your Pandora stream and your coworker's.

Packets coming in to a router are generally processed in the order they're received, unless the router is instructed to handle them differently (e.g. to provide traffic shaping/quality of service). But a full discussion of that is rather too broad for an answer here.

Michael Hampton
  • 244,070
  • 43
  • 506
  • 972