Re: avoid port forward over NAT
From: CheshireCat (blah_at_balh.com)
Date: 12/08/03
- Next message: Wolfgang Ewert: "Re: Do i need a FW?"
- Previous message: Big Will: "Re: Do i need a FW?"
- In reply to: Bob: "Re: avoid port forward over NAT"
- Next in thread: Bob: "Re: avoid port forward over NAT"
- Reply: Bob: "Re: avoid port forward over NAT"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Mon, 8 Dec 2003 09:50:00 -0000
> if computer A and computer B are going to have a permanent (Stream socket)
> connection and they are both on different intranets, getting access to the
> interent each though a router using NAT, how are they able to do this?
>
> It seems to me that computer A would have to make a request to B, and in
> order to recieve this request, and therefore start a Stream socket for
> bidirectional communication, B's router would have to have the port on
which
> the request was recieved forwarded to B, otherwise the request would be
> dropped at B's router.
>
> so how do A and B get connected?
Real world example:
Suppose A want's to connect to B to play a network game. B is going to run
the game server on his own pc.
"A" makes a phone call to "B" to discover Bs internet IP address. B's pc
only has a local IP so he has to connect to the configuration screen of the
router (usually via his web browser) to find out his Internet IP address,
x.x.x.x. He gives A this information.
B then needs to find out which server port number(s) the game uses. After a
search on the internet he discovers the game needs port 23454 to act as a
server. He then reopens the configuration screen of the router. He adds a
new rule "Forward Port 23454 from any WAN user to LAN address 192.168.0.2".
If the game needed more than 1 port he would also add these.
He then runs his game on his PC and waits. B's router is now listening onto
the internet at IP x.x.x.x port 23454.
A's game now attempts to connect to the game server on B and sends out a
connection request to x.x.x.x at port number 23454. This request hits A's
router and stops there and the router takes over. A's router attempts to
make a connection between itself and x.x.x.x:23454.
B's router receives a connection request to port 23454 from A's router, it
accepts the connection because it was configured to do so earlier. It then
opens an internal network connection to Bs machine 192.168.0.2 port number
23454.
So the route is A <-- LAN --> RouterA <--www--> RouterB <-- LAN --> B
> I had heard that there was a 3rd party server that had to have the ports
> fwded, and it some how arranges from A & B to connect...
You shouldnt need this with a hardware router as it should be inbuilt. You
can find freeware port forwarding software yes (eg portmapper), but you'd
use this if you were using Internet Connection Sharing. ICS also has it's
own port forwarding faciliy but it's not easy to use.
but even if this is
> the case, I don't understand how the 2 computers behind a routers on
> different intranets using NAT can connect.
NAT is just something that allows several users to share a single internet
address. Inside the router NAT records information in tables so it knows
which internal network router ports are associated with which external
ports. In this way the router knows where to send packets between internal
and external networks.
A connection address is made up of 2 parts, IP address PLUS port number
together. A port number can never be shared between open sockets, each newly
opened socket must have its own individual port number. IP addresses can be
shared. So the IP/port combination is always individual to a connection.
That's how the router/NAT knows where to route packets.
- Next message: Wolfgang Ewert: "Re: Do i need a FW?"
- Previous message: Big Will: "Re: Do i need a FW?"
- In reply to: Bob: "Re: avoid port forward over NAT"
- Next in thread: Bob: "Re: avoid port forward over NAT"
- Reply: Bob: "Re: avoid port forward over NAT"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|