Application Layer Gateway (ALG)

ALGs are frequently used with NATs to handle cases where peer addresses or ports are embedded in application-layer payloads. Packets with such payloads require special treatment. The ALG modifies the content of the packet and may adjust the header information to reflect address translations required in a router. In the example, we offer just one well-known special case—namely, the processing of an FTP PORT command. For an active FTP connection, the FTP PORT command from a client on the home network requests the server to send FTP data back to the port specified in the payload of the client’s PORT command. Therefore, the ALG needs to correct the IP and port mapping of this basic network address port translation (NAPT).

An ALG should treat several other application considerations—for example, DNA and SIP, where packets carry the addresses for sessions to be established, IPv4/IPv6 translation, or security considerations where end-to-end encryption may encrypt IP addresses or the router may be required to filter for exposed IP addresses.

Get Intel Threading Building Blocks now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.