Internet Service Sharing behind a DSL Router?

Hi Everyone,

Quick question for any network protocol gurus who don't mind coaching a newb. I'm struggling trying to understand the routing of packet traffic when two or more computers share one ISP through a DSL router. Allow me to explain:

1. Hypothetical situation: two computers on a DSL router, both sharing one Internet connection. The router has IP address (I don't know if this is a legal IP, and it doesn't matter. Please bear with me.). The first computer has IP address, and the second computer has IP address

2. When sends packets to a server (let's say, they are recoded by the router as coming from source IP The server receiving the packets then responds to with its own packets.

3. The router receives packets emerging from source, targeted for How does the router software determine where to send the packets? It can send them to, or What gives?

If anyone can point out what I'm missing here, it will be sincerely appreciated.

<A HREF="" target="_new"> PS 17 </A>
6 answers Last reply
More about internet service sharing router
  1. From my understanding, there is something like a turnaround key field somewhere in the IP header. This allows the ROuter to insert the source IP when it sends the packet out to the server, and the server will re-insert whatever was in that field back into that field when it sends packets back out to the source. Then the DSl router simply examines that turnaround field to see who it originally came from.

    <i>It's always the one thing you never suspected.</i>
  2. Okay, from the top...

    What you are trying to describe is overload NAT (Network Address Translation).

    It allows many hosts to share a single address to talk to downstream devices. In your case the public IP address of the router serves to 'hide' the two private addresses of the actual PCs.

    The mechanism used is via TCP and UDP socket numbers. As you may or may not know, above IP there are additional protocols that cover more detail of the network packet. If you are surfing the web, for instance, the majority of hosts you connect to you do so by sending requests to UDP port 80 (HTTP). When your PC does this, the end server has to know how to talk back to your PC. Therefore your PC assigns an arbitary socket for the server to talk back on. The socket will be above 1023.

    So, you pc defines this socket in its outbound communication, and then the server returns your information - aimed <b>at</b> the socket number your PC gave it.

    Now in an overload NAT device, the router will substitue two components, the source IP address (your inside, private IP) <b>AND</b> the source socket number. It substitutes the IP address to its own - and assigns its own arbitary source socket port. Now the external server thinks the router has made the request, not your PC!

    The router maintains a table of thost socket numbers as a conversation table. It knows that if it receives an IP packet itself, but on the socket port that it substituted, it must forward that packet onto the original host, again translating the now destination IP address to that of the original PC.

    In this way we can see that under a basic configuration it would never be possible for a PC behind the NAT router to be contacted, unless it had first established communication. Packets would be aimed at the router on ports that had no meaning to it and would be dropped. Good security, but bad if you want to make a server!

    -* This Space For Rent *-
    email for application details
  3. Hi J,

    I found an interesting article that explains the NAT in excellent detail.


    <A HREF="" target="_new"> PS 17 </A>
  4. thanks pete - I see I was wrong. So it uses discreet socket ID number as a reverse lookup for returning packets. That makes sense. Thanks for clearing that up.


    <i>It's always the one thing you never suspected.</i>
  5. How do you find out what your socket is? Because I want to run a FTP server on my computer that is behind my router... I can't get people to connect to be because I cant get past the router. pleast help. thanks.

    AMD for Life!
  6. thats different.....NAT (OR PAT, port address translation, which is really what we're talkin about) keeps track of internal address and ports for outgoing packets so that it knows where to send the responce. If you are going to allow people to request information directly from one of your pcs which is behind the NAT router you must instruct the router (in the interface program) to forward port xyz (where xyz is the port number....heh heh). for ftp, the common port to forward is 21. so, in the router program you would tell the router to forward all port 21 requests to

    ignore everything i say
Ask a new question

Read More

Routers DSL Internet Service Providers IP Address Networking