Re: avoid port forward over NAT
From: CheshireCat (blah_at_balh.com)
Date: 12/07/03
- Next message: CheshireCat: "Re: Which router to buy? Need FTP Server support.."
- Previous message: harry wong: "Re: Have firewall/internal network, but still receiving probes from AOL user -- how?"
- In reply to: Bob: "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: Sun, 7 Dec 2003 11:45:59 -0000
"Bob" <rbonham@rREMOVETHISaustin.rr.com> wrote in message
news:rm1Ab.5954$HH.1761@fe1.texas.rr.com...
> Hi, I thought you all would be the best group to ask this question to.
>
> How does a program like messenger allow 2 machines using nat to talk to
each
> other over the internet?
>
> and...
>
> how does it work with peer to peer downloading???
>
> (if it is not the same)
>
> I know the nat'd computer can make a request out, but where is it getting
> the data from back, I was under the assumption the data had to come back
> through a port...right..and if the port is not forwarded to that
> machine...how does it work?
>
> Thanks so much for you time, I couldn't search google on this...it was
> comming up with how to use nat on a router.
>
> Bob
>
>
I'm assuming, if you're talking about NAT, that you mean there's a
router/firewall between the pcs and the internet.
It's really very simple. You've 2 major different types of connection,
stream and datagram.
a)Stream sockets are bidirectional and permanent until the connection's
dropped. Data is read/written along the same pathway.
1) Outgoing connections - your pc is a client attempting to connect to
another machine
The connection request hits your router from inside the lan. This request
automatically contains info about your pcs IP address and port and also info
about the destination . The router stores this info.
The router then opens its own connection, using a free port number, to the
remote IP address on your pcs behalf . The router acts as a proxy, using the
NAT info to forward packets back and forth between the LAN and WAN sockets.
External servers will only ever see your single internet IP address, even if
you have 10 pcs connecting to the same one. But those 10 pcs will each have
an individual IP/port number combination.
2) Incoming connections - your pc is running a server socket, listening for
connections
As your PC is only able to listen to it's local area network, it won't be
able to get connected to from the www because the router is "in the way".
The router should allow you to overcome this problem by mapping/port
forwarding.
In this case, the router is configured to open a listening port onto the
WAN. A connection request arrives, so the router opens its own internal
network connection to the socket listening on your pc. Again it forwards
packets between its LAN and WAN connections.
b)UDP is unidirectional and temporary. It uses datagrams which are discreet
packets that are posted to the remote machine. There's no permanent
connection and you can't guarantee the data ever arrives.
UDP is often used to keep resources to a minimum (tcp stream sockets consume
more) but it is unreliable.
The router does similar as with stream sockets, but it doesn't maintain the
connection. The UDP NAT information is retained for a period of time, UDP
replies will return to the same port from which they left, so NAT will know
where to forward the response.
Messenger requires that your router supports uPnP.
- Next message: CheshireCat: "Re: Which router to buy? Need FTP Server support.."
- Previous message: harry wong: "Re: Have firewall/internal network, but still receiving probes from AOL user -- how?"
- In reply to: Bob: "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
|