Friday, August 11, 2006

More around Port Mapping and STUN

A little bit more background knowledge to have deeper understanding around port mapping and STUN.

Let's start from the router. The router that you use at home, normally would manage a port mapping table dynamically. It basically map an internal IP from the LAN to an external address:port, thus the internet can see. I am not sure if the mapping is actually between IP address and IP address:port, or more like IP address:port and IP address:port, meaning that different application program on an intranet computer will get its own entry. But that's detail can be resolved if necessary later on.

Applications like messenger, and other P2P software on your home computer, in order for them running properly, the outside world needs to know its public IP (and port) to contact them. Usually, a STUN like implementation will take care of that. The STUN server will help discover the public IP address, and use that to communicate to the application at any given time.

With WAN side protocol TR-111, or TR-069, theoretically, it can skip the STUN implementation, and directly managed the Port Mapping table on the router to initiate connection if they need to. But there are several down sides of this approach.

First, it requires a TR-069 compatible gateway so that the ACS can manage the PMT. Since the protocol is supposed to manage device behind a NAT that's not tr-069 compatible, this implementation will be too restrictive.

Second, sometimes, you cannot set the port mapping entry on the router.

And last, since the devices's IP address might change, from DHCP expiration, or from rebooting, this table needs to be maintained consistently, which itself will be a huge amount of work. Thus, this isn't going to be the way to go.

Hopefully this "discussion" help to understand these concepts a little better.

Thursday, August 10, 2006

Port Forwarding

Read a pretty good article about "Port forwarding", which also contains basic information about firewall. Didn't spend a lot of time on this, but i wonder who created such sites...

http://www.portforward.com/help.htm
http://www.firewalling.com/concepts.htm

Wikipedia also has an entry for this:
http://en.wikipedia.org/wiki/Port_forwarding