Re: avoid port forward over NAT

From: CheshireCat (blah_at_balh.com)
Date: 12/07/03


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.



Relevant Pages

  • Re: Establish external trust over a NAT device
    ... suggesting hardware over Windows built-in functionality for a VPN solution. ... even a fairly cheap router will likely have much better throughput ... L2TP and routing over it with or without NAT on that connection. ...
    (microsoft.public.win2000.active_directory)
  • Re: Urgent! New router and big disaster
    ... by CEICW for any type of connection other than full time broadband was ... exists - is completely transparent to the SBS. ... "local router with an IP address" is the setup that matches her network. ... between the server and my cable modem. ...
    (microsoft.public.windows.server.sbs)
  • Re: Urgent! New router and big disaster
    ... connected to is; what type of connection; or even whether a connection ... exists - is completely transparent to the SBS. ... "local router with an IP address" is the setup that matches her network. ... between the server and my cable modem. ...
    (microsoft.public.windows.server.sbs)
  • RE: Norton Antivirus 2005 blocks Nortel Contivity IPsec VPN client - workaround
    ... The connection attempt proceeds normally, but stalls at the "looking for banner text" message before giving up 15-20 seconds later with a message that the secure connection was lost. ... The connection attempt succeeds if the router is bypassed, and the computer is connected directly to the cable or DSL modem using its public IP address. ... The problem occurs because Contivity uses UDP NAT traversal to establish IPsec connections for one or more users sitting behind a NAT router. ... The problem can be temporarily worked-around by disabling protection against internet worms. ...
    (alt.comp.anti-virus)
  • Re: TV service query ? ? ?
    ... a wireless router. ... a router with extended coverage. ... cable and a wireless connection that you can not see. ... is to have users downloading r/t video, large video files, or other ...
    (alt.home.repair)