Ora

What is endpoint independent?

Published in NAT Behaviors 5 mins read

Endpoint Independent Mapping (EIM) is a key Network Address Translation (NAT) behavior where a NAT device assigns a consistent public IP address and port to a private source endpoint for all outgoing connections, regardless of the external destination.

Understanding Endpoint Independent Mapping (EIM)

At its core, Endpoint Independent Mapping (EIM) dictates that once a NAT device establishes a translation for an internal host's private IP address and port to a specific public IP address and port, this same public mapping will be used for all subsequent connections originating from that same internal IP and port, irrespective of the external destination IP address or port.

This behavior is particularly significant in environments utilizing Carrier-Grade NAT (CGNAT). When CGNAT is configured for EIM, it preserves the translation address and port of a subscriber's connection, ensuring that the assigned external endpoint (public IP and port) can be reliably reused for all subsequent connections from that subscriber. This consistency simplifies network operations and enhances compatibility for various applications.

Key Characteristics of EIM:

  • Consistent Public Mapping: For a given internal source (IP address and port), the NAT device always uses the same external (public) IP address and port.
  • Destination Agnostic: The choice of external destination IP address or port does not influence the public source mapping assigned by the NAT device.
  • Reusability: The established public endpoint can be reused across multiple connections to different external destinations.

Why EIM Matters: Benefits and Use Cases

EIM plays a critical role in modern networking, especially for applications that require predictable and consistent NAT behavior.

Benefits:

  • Facilitates NAT Traversal: Many peer-to-peer (P2P) applications, such as Voice over IP (VoIP), online gaming, and video conferencing, rely on the ability for external peers to initiate connections back to an internal client. EIM makes this significantly easier by providing a stable public endpoint that can be shared with other peers.
  • Improved Application Compatibility: Certain older or more complex applications may expect a consistent source IP/port when communicating with multiple external servers. EIM ensures this consistency.
  • Enhanced Reliability: For applications that maintain persistent connections or frequently re-establish them, EIM reduces the overhead and potential issues associated with changing source ports.

Practical Examples:

  • Online Gaming: A gamer behind a NAT device uses EIM. When they connect to a game server, the NAT assigns a specific public IP:port. If the game client then needs to communicate with other players' consoles (peers) or a different game service, it will use the same public IP:port as its source, simplifying direct peer-to-peer communication.
  • VoIP Calls: A user making a VoIP call to different people. With EIM, their phone's private IP and port are mapped to a single, consistent public IP and port, facilitating communication with various call recipients and STUN/TURN servers.
  • File Sharing: In P2P file-sharing networks, EIM allows other peers to more easily connect to a client behind NAT, as its public endpoint remains stable.

EIM vs. Other NAT Mapping Behaviors

To fully appreciate EIM, it's helpful to understand how it differs from other common NAT mapping behaviors defined in standards like RFC 4787 (NAT Behavioral Requirements for Unicast UDP):

Mapping Behavior Description Impact on External Endpoint
Endpoint Independent Mapping (EIM) The NAT device assigns a public IP address and port to a private internal IP:port. This same public IP:port is used for all outgoing connections from that internal IP:port, regardless of the external destination IP or port. A single, consistent public source (IP:port) is used for all connections originating from the same internal source, making it predictable for external peers.
Address Dependent Mapping (ADM) The NAT device assigns a public IP address and port to a private internal IP:port. However, if the internal client initiates a connection to a different external IP address, the NAT might assign a new public port (or even IP if multiple are available). The public source port (and potentially IP) might change if the internal client connects to a different external IP address, even if the internal source port remains the same.
Address and Port Dependent Mapping (APDM) The NAT device assigns a public IP address and port to a private internal IP:port. If the internal client initiates a connection to a different external IP address or port, the NAT will likely assign a new public port. This is the most restrictive mapping type. The public source port (and potentially IP) is likely to change if the internal client connects to a different external IP address OR port. Each new external destination IP:port pair might result in a new public source IP:port, making NAT traversal challenging.

Note: The choice of NAT behavior significantly impacts the design and functionality of applications requiring NAT traversal.

How CGNAT Leverages EIM

In large-scale service provider networks, CGNAT is used to share a limited pool of public IPv4 addresses among many subscribers. By enabling Endpoint Independent Mapping, CGNAT can:

  • Optimize Resource Usage: While EIM requires a public endpoint to be preserved for an internal subscriber, it can simplify the mapping tables for the CGNAT device by linking an internal subscriber endpoint to one external endpoint consistently.
  • Enhance Subscriber Experience: EIM improves the compatibility of various online services and applications for subscribers, ensuring a smoother and more reliable internet experience without encountering common NAT-related issues.
  • Support Legacy Applications: Many existing internet applications were designed with the expectation of predictable, stable public IP addresses. EIM helps bridge the gap for these applications operating behind CGNAT.

By providing this consistent translation, CGNAT implementations with EIM ensure that subscriber connections can reliably communicate with various external services and peers, making it a cornerstone of modern network infrastructure.