If you're using a router to access the Internet, then, maybe, you have noticed that your computer IP address is not the same seen from a computer or server outside your local network. Your router is hiding your local adress and permit the sharing of one single access to the Internet.
How is it working?
The router uses a technique named NAPT (Network Address Port Translator).
NAP ... What?
Typically, several computers are linked to one router in a Small or Home Office (SOHO). This router has only one IP address and is providing this single access to the SOHO computers.
Let's say that, in fact, SOHO is Pr. John Doe's local network. Pr. John Doe has one nice black and silver brand new laptop featuring a huge hard drive disk and the latest processor. He owns as well, one slow and an old dusty computer he uses from time to time to browse the net. Let call the first computer, computer B like Brilliant and the second one, computer C like Crappy.
A is the name of the router. Computers B and C are linked to the router A. A,B,C constitute a local network. In this network, Pr. Doe's choose the following addresses:
A: 255.168.1.1
B: 255.168.1.2
C: 255.168.1.3
The address seen by an external device: 23.45.67.86. This address has been given by John Doe's ISP (Internet Service Provider).
John Doe is now connecting to the Internet using his powerful laptop. His home page is google.com (IP : 64.233.169.99).
The router A has already assigned "identification numbers" to B and C, named ports.
So, every communication initiated by B will be stamped "port 1".
And as well, every communication initiated by C will be stamped "port 2".
B requests a connection to google.com (IP : 64.233.169.99).
IP datagram contains (unit of information on the Internet)
the message
{src: 255.168.1.2 : 80 | dest: 64.233.169.99 : 80 | HTTP/1.0 GET} is sent to the router A.
Then, router A replaces the IP address source and the Port source by his external adress. And, in order to trace the communication, A replaces the source port by 1. The message emitted is then:
{src: 23.45.67.86 : 1 | dest: 64.233.169.99 : 80 | HTTP/1.0 GET}
When the reply comes from google, the router knows that the response must be sent to A because the message contains destination port 1.
This is how Pr. Doe's brand new computer communication is not mixed up with old and crappy computer's messages. This is how we are all able to share only one IP adress with a router.
source : http://www.faqs.org/rfcs/rfc3022.html
How is it working?
The router uses a technique named NAPT (Network Address Port Translator).
NAP ... What?
Typically, several computers are linked to one router in a Small or Home Office (SOHO). This router has only one IP address and is providing this single access to the SOHO computers.
Let's say that, in fact, SOHO is Pr. John Doe's local network. Pr. John Doe has one nice black and silver brand new laptop featuring a huge hard drive disk and the latest processor. He owns as well, one slow and an old dusty computer he uses from time to time to browse the net. Let call the first computer, computer B like Brilliant and the second one, computer C like Crappy.
A is the name of the router. Computers B and C are linked to the router A. A,B,C constitute a local network. In this network, Pr. Doe's choose the following addresses:
A: 255.168.1.1
B: 255.168.1.2
C: 255.168.1.3
The address seen by an external device: 23.45.67.86. This address has been given by John Doe's ISP (Internet Service Provider).
John Doe is now connecting to the Internet using his powerful laptop. His home page is google.com (IP : 64.233.169.99).
The router A has already assigned "identification numbers" to B and C, named ports.
So, every communication initiated by B will be stamped "port 1".
And as well, every communication initiated by C will be stamped "port 2".
B requests a connection to google.com (IP : 64.233.169.99).
IP datagram contains (unit of information on the Internet)
- IP address source
- Port source (after the colon in the example)
- IP address destination
- Port destination (after the colon in the example)
the message
{src: 255.168.1.2 : 80 | dest: 64.233.169.99 : 80 | HTTP/1.0 GET} is sent to the router A.
Then, router A replaces the IP address source and the Port source by his external adress. And, in order to trace the communication, A replaces the source port by 1. The message emitted is then:
{src: 23.45.67.86 : 1 | dest: 64.233.169.99 : 80 | HTTP/1.0 GET}
When the reply comes from google, the router knows that the response must be sent to A because the message contains destination port 1.
This is how Pr. Doe's brand new computer communication is not mixed up with old and crappy computer's messages. This is how we are all able to share only one IP adress with a router.
source : http://www.faqs.org/rfcs/rfc3022.html
Commentaires