Share via


Firewalls and NATs

RTC client applications may encounter a Network Address Translator (NAT) or a firewall in the call path. The firewall and NAT are applications placed on the gateway to the Internet and are designed to protect devices located on an internal network. The NAT provides mappings to one or more internal devices with internal IP addresses, to an external IP address and port on the NAT. In situations where a non-UPnP-enabled NAT or firewall is in the path of an RTC client call, the media stream and the SIP traffic will not be transmitted and the call cannot be completed unless the application provides a means to traverse the firewall or NAT.

On Windows XP SP1 and earlier, the RTC Client API attempts to map a port through Windows Firewall (Windows Firewall was previously called Internet Connection Firewall or ICF) to use for SIP traffic by default. An application can specify the RTCIF_ENABLE_SERVER_CLASS when calling IRTCClient2::InitializeEx to prevent the RTC Client API from attempting to map the port through Windows Firewall for SIP traffic. On Windows XP SP2 and later, the application setup or the user must add the application to the exceptions list of Windows Firewall to enable SIP traffic for the application to go through the Windows Firewall.

The RTC Client API will automatically map IP addresses and ports of UPnP-enabled NATs. If the client is located behind a UPnP-enabled NAT, the client API will be able to determine the relevant IP address and port mapping on the NAT or firewall to allow for audio/video streaming or SIP traffic. If the client is located behind a NAT that is not UPnP enabled, the RTC Client API is not able to automatically determine the relevant IP address and port mapping. It is therefore the responsibility of the client application to determine these mappings and supply them to the RTC Client API. Without the IP address and port mappings, media streaming and the SIP traffic within a call will fail when the client is behind a NAT or firewall.

The following sections give more information on traversing UPnP-enabled and non-UPnP-enabled NATs.

Topic Description
Traversal of UPnP-Enabled NATS Provides detailed information on the behavior of the RTC Client API when the application is behind a NAT that supports UPnP functionality.
Address Mapping Provides detailed information on the procedures to follow when the application is located behind a non-UPnP-enabled NAT.