Application example: Port triggering for Internet Relay Chat

Some application servers, such as FTP and IRC servers, send replies to multiple port numbers. Using port triggering, you can tell the security gateway to open more incoming ports when a particular outgoing port starts a session.

An example is Internet Relay Chat (IRC), an old protocol that is still in use. Your computer connects to an IRC server at destination port 6667. The IRC server not only responds to your originating source port but also sends an “identify” message to your computer on port 113. Using port triggering, you can tell the security gateway, “When you initiate a session with destination port 6667, you must also allow incoming traffic on port 113 to reach the originating computer.”

The following sequence shows the effects of this port triggering rule:

  1. You open an IRC client program to start a chat session on your computer.
  2. Your IRC client composes a request message to an IRC server using a destination port number of 6667, the standard port number for an IRC server process. Your computer then sends this request message to your security gateway.
  3. Your security gateway creates an entry in its internal session table describing this communication session between your computer and the IRC server. Your security gateway stores the original information, performs Network Address Translation (NAT) on the source address and port, and sends this request message through the Internet to the IRC server.
  4. Noting your port triggering rule and observing the destination port number of 6667, your security gateway creates another session entry to send any incoming port 113 traffic to your computer.
  5. The IRC server sends a return message to your security gateway using the NAT-assigned source port (for example, port 33333) as the destination port and also sends an “identify” message to your security gateway with destination port 113.
  6. When your security gateway receives the incoming message to destination port 33333, it checks its session table to see if a session is active for port number 33333. Finding an active session, the security gateway restores the original address information replaced by NAT and sends this reply message to your computer.
  7. When your security gateway receives the incoming message to destination port 113, it checks its session table and finds an active session for port 113 associated with your computer. The security gateway replaces the message’s destination IP address with your computer’s IP address and forwards the message to your computer.
  8. When you finish your chat session, your security gateway eventually senses a period of inactivity in the communications. The security gateway then removes the session information from its session table, and incoming traffic is no longer accepted on port numbers 33333 and 113.