Saturday, July 14, 2007

Similar to standard port forwarding, port triggering allows a client to connect to a host behind a NAT router on a specific port. In layman's terms port triggering opens an incoming port when your computer is using a specified outgoing port for specific traffic.


Description

Port triggering is a specialized form of port forwarding in which outbound traffic on predetermined ports ("triggering ports") causes inbound traffic to specific incoming ports to be dynamically forwarded to the initiating host while the outbound ports are in use. This allows computers behind a NAT-enabled router on a local network to provide services which would normally require the computer to have a fixed address on the local network. Port triggering triggers an open incoming port when a client on the local network makes an outgoing connection to a predetermined port or port-range on an external server.


Example

As an example of how port triggering operates, when connecting to IRC it's common to authenticate your username with the Ident protocol via port 113.

When connecting to IRC the client computer typically makes an outgoing connection on port 6667 (or any port in the range 6660-7000), causing the IRC server to attempt to verify the username given by making a new connection back to the client computer on port 113. When the computer is behind a NAT the NAT silently drops this connection because it does not know which computer behind the NAT to send the request to connect.

In the case of port triggering, you tell the router that when you make a connection out on any port 6660-7000 then it should allow connections in to that particular computer. This gives it more flexibility than static port forwarding because you do not need to set it up for a specific address on your network. You also gain security in a sense that that port is not left open when not actively in use.


Disadvantages

The disadvantage of port triggering is that it only allows one client on the network to supply a particular service that uses a particular incoming port. Port triggering is unsuitable for putting servers behind a NAT router because it relies on the computer to make an outgoing connection before it can receive incoming ones; servers should use port forwarding.