 | |
05-29-2002, 02:58 PM
|
#1 (permalink)
| | Registered User
Join Date: Oct 2001 Location: Houston
Posts: 307
| » 
How does this work ?
Could someone explain to me how this works.
I have 2 PCs at home connected to a linksys router, which is connected to a cable modem.
The I/P addresses of the PCs are 192.168.2.1 and 192.168.2.2, and the I/P address of the cable modem is something like
24.xx.yy.zz. I know that the address get translated when going out but how does it work with incoming.
So my question is, how does the router keep the incoming packets straight ?
For the sake of illustration say that one PC is doing Google searches and one is playing Everquest.
The packets coming back will need to be routed to the correct PC. We can't have Google searches
popping up in the middle of a dungeon raid, now can we .
thanks
|
| |
05-29-2002, 03:19 PM
|
#3 (permalink)
| | Registered User
Join Date: Oct 2001 Location: Ohio
Posts: 5,577
|
The key part from Imanage's excellent link... Quote:
Here's how dynamic NAT works:
*An internal network (stub domain) has been set up with IP addresses that were not specifically allocated to that company by IANA (Internet Assigned Numbers Authority), the global authority that hands out IP addresses. These addresses should be considered non-routable since they are not unique.
* The company sets up a NAT-enabled router. The router has a range of unique IP addresses given to the company by IANA.
* A computer on the stub domain attempts to connect to a computer outside the network, such as a Web server.
* The router receives the packet from the computer on the stub domain.
* The router saves the computer's non-routable IP address to an address translation table. The router replaces the sending computer's non-routable IP address with the first available IP address out of the range of unique IP addresses. The translation table now has a mapping of the computer's non-routable IP address matched with the one of the unique IP addresses.
* When a packet comes back from the destination computer, the router checks the destination address on the packet. It then looks in the address translation table to see which computer on the stub domain the packet belongs to. It changes the destination address to the one saved in the address translation table and sends it to that computer. If it doesn't find a match in the table, it drops the packet.
* The computer receives the packet from the router. The process repeats as long as the computer is communicating with the external system.
| |
| |
05-29-2002, 03:24 PM
|
#4 (permalink)
| | Registered User
Join Date: Mar 2002 Location: South Brunswick, NJ, USA
Posts: 783
|
Its magic. |
| |
05-29-2002, 03:49 PM
|
#5 (permalink)
| | Registered User
Join Date: Oct 2001 Location: New York, New York
Posts: 254
|
For us geniuses, a picture is worth a thousand words...
|
| |
05-29-2002, 04:56 PM
|
#6 (permalink)
| | |
the router uses the 192.168.1.* numbers to direct the information to the right computers using NAT technology like Imanage link explains
simple stuff
| |
| |
05-30-2002, 07:03 AM
|
#7 (permalink)
| | Registered User
Join Date: Oct 2001 Location: Houston
Posts: 307
|
So that's how it works.
I understand fully how the router keeps a cross reference of
"stub" I/P addresses to "real" I/P addresses.
My initial confusion was because I thought my ISP was only issuing me one I/P address, hence the router would not know which way to redirect it.
My ISP must be issuing multiple I/P addresses for this scheme to work.
*gulps*, that means they have a means to see that I am in fact using more than one I/P address, yet am only paying for one.
Should I worry ?
|
| |
05-30-2002, 07:18 AM
|
#8 (permalink)
| | Registered User
Join Date: Oct 2001 Location: Ohio
Posts: 5,577
|
If you only use a typical broadband router and it is connected directly to the cable modem then you are only using one IP address.
I say typical broadband router because those do not work with more than one public IP address. Router that will usually cost more money than just a couple hundred dollars (USD).
The router does know where to direct traffic because of port mapping and the cross reference table it keeps.
|
| |
05-30-2002, 07:27 AM
|
#9 (permalink)
| | Registered User
Join Date: Oct 2001 Location: Houston
Posts: 307
|
Hmmmm,
that shoots my understanding in the head then.
If I follow it correctly, within the router, there is a translation table that goes something like this.
All numbers are fictious
ISP only assigns one I/P address
192.168.2.1(PC1) equates to 24.25.26.27 (ISP assigned)
192.168.2.2(PC2) equates to 24.25.26.27 (ISP assigned)
So on the return trip, how does the router send the packet to the
correct PC given that 24.25.26.27 might have multiple
equivalences ?
If the ISP were to assign multiple I/P address like this,
192.168.2.1(PC1) equates to 24.25.26.27 (ISP assigned)
192.168.2.2(PC2) equates to 24.25.26.28 (ISP assigned)
then I could see how it works.
I love computers.
|
| |
05-30-2002, 07:40 AM
|
#10 (permalink)
| | Registered User
Join Date: Oct 2001 Location: Ohio
Posts: 5,577
|
Re: Hmmmm,
Quote: Originally posted by Armadel ...ISP only assigns one I/P address
192.168.2.1(PC1) equates to 24.25.26.27 (ISP assigned)
192.168.2.2(PC2) equates to 24.25.26.27 (ISP assigned)
If the ISP were to assign multiple I/P address like this,
192.168.2.1(PC1) equates to 24.25.26.27 (ISP assigned)
192.168.2.2(PC2) equates to 24.25.26.28 (ISP assigned) |
Your first example is called "dynamic" NAT. The second is called "static" NAT.
How dynamic NAT works, is pointed out in my first reply. You may need to re-read it a few times because it may initially sound like Static NAT which you already understand. |
| | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | | | Thread Tools | Search this Thread | | | | | Display Modes | Linear Mode |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | | Most Active Discussions  | | | | | Recent Discussions  | | | | | |