ArticleslgStudy

computer science

NAT traversal

NAT traversal is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand NAT traversal rather than just read about it. In short: Network address translator traversal is a computer networking technique of establishing and maintaining Internet Protocol connections across gateways that implement network address translation (NAT). NAT traversal techniques are required for many network applications, such as peer-to-peer file sharing and voice over IP.

Key takeaways

  • NAT traversal belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect NAT traversal to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of NAT traversal from memory before moving on to harder problems.

Reference excerpt

Network address translator traversal is a computer networking technique of establishing and maintaining Internet Protocol connections across gateways that implement network address translation (NAT). NAT traversal techniques are required for many network applications, such as peer-to-peer file sharing and voice over IP.

Network address translation

Network address translation typically uses private IP addresses on private networks with a single public IP address for the router facing the Internet. The network address translator changes the source address in network protocols for outgoing requests from that of an internal device to its external address, so that internal devices can communicate with hosts on the external network, while relaying replies back to the originating device. This leaves the internal network ill-suited for hosting services, as the NAT device has no automatic method for determining the internal host to which incoming packets from the external network are destined. This is not a problem for general web access and email. However, applications such as peer-to-peer file sharing, VoIP services, and video game consoles require clients to be servers as well. Incoming requests cannot be easily correlated to the proper internal host. Furthermore, many of these types of services carry IP address and port number information in the application data, potentially requiring substitution with deep packet inspection. Network address translation technologies are not standardized. As a result, the methods used for NAT traversal are often proprietary and poorly documented. Many traversal techniques require assistance from servers outside of the masqueraded network. Some methods use the server only when establishing the connection, while others are based on relaying all data through it, which increases the bandwidth requirements and latency, detrimental to real-time voice and video communications. NAT traversal techniques usually bypass enterprise security policies. Enterprise security experts prefer techniques that explicitly cooperate with NAT and firewalls, allowing NAT traversal while still enabling marshalling at the NAT to enforce enterprise security policies. Internet Engineering Task Force (IETF) standards based on this security model are Realm-Specific IP (RSIP) and middlebox communications (MIDCOM).

Techniques and protocols Various NAT traversal techniques have been developed:

UPnP Internet Gateway Device Protocol (UPnP IGD) is supported by many small NAT gateways in home or small office settings. It allows a device on a network to ask the router to open a port. NAT Port Mapping Protocol (NAT-PMP) is a protocol introduced by Apple as an alternative to UPnP IGD. Port Control Protocol (PCP) is a successor of NAT-PMP. Session Traversal Utilities for NAT (STUN) is a standardized set of methods and a network protocol for NAT hole punching. It was designed for UDP but was also extended to TCP. Traversal Using Relays around NAT (TURN) is a relay protocol designed specifically for NAT traversal. Interactive Connectivity Establishment (ICE) is a complete protocol for using STUN and/or TURN to do NAT traversal while picking the best network route available. It fills in some of the missing pieces and deficiencies that were not mentioned in the STUN specification. NAT hole punching is a general technique that exploits how NATs handle some protocols (for example, UDP, TCP, or ICMP) to allow previously blocked packets through the NAT. UDP hole punching TCP hole punching ICMP hole punching Socket Secure (SOCKS) is a technology created in the early 1990s that uses proxy servers to relay traffic between networks or systems. Application-level gateway (ALG) techniques are a component of a firewall or NAT that provides configurable NAT traversal filters. It is claimed that this technique creates more problems than it solves.

Address and port-dependent NAT, symmetric NAT The proliferation of symmetric NATs has reduced NAT traversal success rates in many practical situations, such as for mobile and public Wi-Fi connections. Hole-punching techniques, such as STUN and ICE, fail in traversing symmetric NATs without the help of a relay server, as is practiced in TURN. Techniques that traverse symmetric NATs by attempting to predict the next port to be opened by each NAT device were discovered in 2003 by Yutaka Takeda at Panasonic Communications Research Laboratory and in 2008 by researchers at Waseda University. Port prediction techniques are only effective with NAT devices that use known deterministic algorithms for port selection. This predictable yet non-static port allocation scheme is uncommon in large-scale NATs such as those used in 4G LTE networks, and therefore, port prediction is largely ineffective on those mobile broadband networks.

IPsec IPsec virtual private network clients use NAT traversal in order to have Encapsulating Security Payload packets traverse NAT. IPsec uses several protocols in its operation, which must be enabled to traverse firewalls and network address translators:

Internet Key Exchange (IKE) – User Datagram Protocol (UDP) port 500 Encapsulating Security Payload (ESP) – IP protocol number 50 Authentication Header (AH) – IP protocol number 51 IPsec NAT traversal – UDP port 4500, if and only if NAT traversal is in use Many routers provide explicit features, often called IPsec Passthrough. NAT traversal and IPsec may be used to enable opportunistic encryption of traffic between systems. NAT traversal allows systems behind NATs to request and establish secure connections on demand.

Hosted NAT traversal Hosted NAT traversal (HNT) is a set of mechanisms, including media relaying and latching, that is widely used by communications providers for historical and practical reasons. The IETF advises against using latching over the Internet and recommends ICE for security reasons.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with NAT traversal

Start with the simplest possible case. Write down what NAT traversal claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to NAT traversal before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about NAT traversal ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of NAT traversal

In research
NAT traversal appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses NAT traversal in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
NAT traversal is common in secondary-school and first-year university syllabi. It links to neighbouring topics Computer network security, Network address translation, Network protocols, so understanding it makes those chapters shorter.
In everyday life
Look for NAT traversal outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study NAT traversal in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what NAT traversal means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain NAT traversal out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is NAT traversal in simple terms?

Network address translator traversal is a computer networking technique of establishing and maintaining Internet Protocol connections across gateways that implement network address translation (NAT). NAT traversal techniques are required for many network applications, such as peer-to-peer file shar…

Why does NAT traversal matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study NAT traversal?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on NAT traversal.

Tags

  • Computer network security
  • Network address translation
  • Network protocols

Keep exploring