ECE 526 – Network Processing Systems Design Network Address Translator
Ning WengECE 5262 Overview What is Network Address Translation (NAT) Conceptually Implementation ─ Complexity and simplifying assumptions ─ TCP/UDP packet processing ─ ARP packet processing ─ NAT table creation and management ─ Head lookup and field changes IXP Implementation ─ Software components and structure ─ NAT microblock implementation ─ Header caching, alignment
Ning WengECE 5263 What is NAT? System allowing multiple computers share single global IP address Changing packet header: address, port number, IDs and etc Located between a set of computers at a site and rest of the Internet
Ning WengECE 5264 NAT Example ISP Router Local Area Network: ─ /8: net 10 prefix ─ Nonroutable ─ each computer has unique IP address NAT ─ Global IP ─ Local IP: ─ Router for Local Area Network
Ning WengECE 5265 How does NAT Work Rewrite packet header as packet pass through Questions ─ 1. Which fields should be changed ─ 2. Are these change independent of packet types, packet flow direction ─ 3. How should they be changed ─ 4. What is the complexity
Ning WengECE 5266 Packet Type TCP/UDP ─ IP address: global unique identify of IP network, looked by router Source and destination ─ Port number: application dependent Source Destination ARP (address resolution protocol) ─ IP address ─ MAC address Any other fields?
Ning WengECE 5267 Packet Flow Direction Outgoing: to the internet ─ SIP, DIP ─ Sport, Dport ─ IP Proto filed Incoming: from internet ─ Is same as outgoing?
Ning WengECE 5268 Packet Field Change Cross NAT
Ning WengECE 5269 NAT Table Example *.2 and *.3 access web server at *.4 ping
Ning WengECE NAT Table Lookup Incoming and outgoing different Two independent hash tables used
Ning WengECE NAT Table Implementation Packet direction: f_nat or r_nat Extract fields, computer hash value and bucket value
Ning WengECE NAT Complexity Fragmentation causes header of encapsulated protocol are only present in first fragment ─ E.g., no port number available for later fragments IP datagram with options Memory requirement for NAT table
Ning WengECE NAT Table Management Creation ─ Automatically ─ Add one entry when it is first packet for new flow Table entry lifetime ─ Based on packet header E.g., Fin or reset for TCP ─ Aging Counter down timer –Reset to maximum value once used –Decrease one every cycle Table entry update ─ Least recent used ─ Priority heuristic TCP > UDP > ARP >others
Ning WengECE NAT IXP Implementation
Ning WengECE NAT Overall Structure What are implementation ideas to improve throughput?
Ning WengECE NAT Microblock Organization
Ning WengECE Reminder Example System on IXP2400 II: chapter 25 Example of other commercial NPs: chapter 15