Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 540 Computer Networks II Sandy Wang

Similar presentations


Presentation on theme: "CS 540 Computer Networks II Sandy Wang"— Presentation transcript:

1 CS 540 Computer Networks II Sandy Wang chwang_98@yahoo.com

2 11. NETWORK ADDRESS TRANSLATION – NAT

3 Topics 1.Overview 2.LAN Switching 3.IPv4 4.IPv6 5.Routing Protocols -- RIP, RIPng, OSPF 6.Routing Protocols -- ISIS, BGP 7.MPLS 8.Midterm Exam 9.Transport Layer -- TCP/UDP 10.Congestion Control & Quality of Service (QoS) 11.Access Control List (ACL) 12.Application Layer Protocols 13.Application Layer Protocols continue 14.Others – Multicast, SDN 15.Final Exam

4 Reference Books Cisco CCNA Routing and Switching ICND2 200-101 Official Cert Guide, Academic Edition by Wendel Odom -- July 10, 2013. ISBN-13: 978-1587144882 The TCP/IP Guide: A Comprehensive, Illustrated Internet Protocols Reference by Charles M. Kozierok – October 1, 2005. ISBN-13: 978-1593270476 Data and Computer Communications (10th Edition) (William Stallings Books on Computer and Data Communications) by Williams Stallings – September 23, 2013. ISBN-13: 978-0133506488 http://class.svuca.edu/~sandy/class/CS540/

5 Agenda Basic Concept of Network Address Translation (NAT) Port Address Translation (PAT) Definition, Benefits, Availability and Application Support NAT Concepts and Terminology Port Address Translation (PAT) NAT Technical Information

6 6 Private Network Private IP network is an IP network that is not directly connected to the Internet IP addresses in a private network can be assigned arbitrarily. Not registered and not guaranteed to be globally unique Generally, private networks use addresses from the following experimental address ranges (non-routable addresses): 10.0.0.0 – 10.255.255.255 172.16.0.0 – 172.31.255.255 192.168.0.0 – 192.168.255.255

7 7 Private Addresses

8 Network Address Translation (NAT) RFC 1631 A short term solution to the problem of the depletion of IP addresses Long term solution is IPv6 CIDR (Classless InterDomain Routing ) is a possible short term solution NAT is another NAT is a way to conserve IP addresses Can be used to hide a number of hosts behind a single IP address Uses private addresses: 10.0.0.0-10.255.255.255, 172.16.0.0-172.32.255.255 or 192.168.0.0-192.168.255.255 8

9 9 Network Address Translation (NAT) NAT is a router function where IP addresses (and possibly port numbers) of IP datagrams are replaced at the boundary of a private network NAT is a method that enables hosts on private networks to communicate with hosts on the Internet NAT is run on routers that connect private networks to the public Internet, to replace the IP address-port pair of an IP packet with another IP address-port pair.

10 10 Basic Operation of NAT NAT device has address translation table One to one address translation

11 11 Pooling of IP Addresses Scenario: Corporate network has many hosts but only a small number of public IP addresses NAT solution: Corporate network is managed with a private address space NAT device, located at the boundary between the corporate network and the public Internet, manages a pool of public IP addresses When a host from the corporate network sends an IP datagram to a host in the public Internet, the NAT device picks a public IP address from the address pool, and binds this address to the private address of the host

12 12 Pooling of IP Addresses

13 13 Supporting Migration between Network Service Providers Scenario: In CIDR, the IP addresses in a corporate network are obtained from the service provider. Changing the service provider requires changing all IP addresses in the network. NAT solution: Assign private addresses to the hosts of the corporate network NAT device has static address translation entries which bind the private address of a host to the public address. Migration to a new network service provider merely requires an update of the NAT device. The migration is not noticeable to the hosts on the network. Note: The difference to the use of NAT with IP address pooling is that the mapping of public and private IP addresses is static.

14 Benefits Problem: Merging corporations with conflicting private IP address space need connectivity to each other and/or the Internet Solution: NAT provides transparent, scalable, and bi-directional connectivity between corporate headquarters and acquisitions CorporateAcquisition 10.6.1.2010.6.1.51 NAT Before NAT Outbound Packet Before NAT Outbound Packet Src Addr 10.6.1.20 Src Addr 10.6.1.20 Dest Addr Acquisition Dest Addr Acquisition After NAT Outbound Packet After NAT Outbound Packet Src Addr 192.168.7.10 Src Addr 192.168.7.10 Dest Addr Acquisition Dest Addr Acquisition After NAT Outbound Packet After NAT Outbound Packet Src Addr 172.21.58.10 Src Addr 172.21.58.10 Dest Addr Corporate Dest Addr Corporate Before NAT Outbound Packet Before NAT Outbound Packet Src Addr 10.6.1.51 Src Addr 10.6.1.51 Dest Addr Corporate Dest Addr Corporate X

15 15 Supporting Migration between network service Providers

16 16 IP Masquerading Also called: Network address and port translation (NAPT), port address translation (PAT). Scenario: Single public IP address is mapped to multiple hosts in a private network. NAT solution: Assign private addresses to the hosts of the corporate network NAT device modifies the port numbers for outgoing traffic

17 17 IP Masquerading

18 18 Load Balancing of Servers Scenario: Balance the load on a set of identical servers, which are accessible from a single IP address NAT solution: Here, the servers are assigned private addresses NAT device acts as a proxy for requests to the server from the public network The NAT device changes the destination IP address of arriving packets to one of the private addresses for a server A sensible strategy for balancing the load of the servers is to assign the addresses of the servers in a round-robin fashion.

19 19 Load Balancing of Servers

20 20 Concerns about NAT Performance: Modifying the IP header by changing the IP address requires that NAT boxes recalculate the IP header checksum Modifying port number requires that NAT boxes recalculate TCP checksum Fragmentation Care must be taken that a datagram that is fragmented before it reaches the NAT device, is not assigned a different IP address or different port numbers for each of the fragments.

21 21 Concerns about NAT End-to-end connectivity: NAT destroys universal end-to-end reachability of hosts on the Internet. A host in the public Internet often cannot initiate communication to a host in a private network. The problem is worse, when two hosts that are in a private network need to communicate with each other.

22 22 Concerns about NAT IP address in application data: Applications that carry IP addresses in the payload of the application data generally do not work across a private-public network boundary. Some NAT devices inspect the payload of widely used application layer protocols and, if an IP address is detected in the application-layer header or the application payload, translate the address according to the address translation table.

23 Agenda Basic Concept of NAT and PAT Definition, Benefits, Availability and Application Support NAT Concepts and Terminology PAT NAT Technical Information

24 NAT Concepts An interface on the router can be defined as inside or outside Translations occur only from inside to outside interfaces or vice versa—never between the same type of interface NAT Inside Interface Inside Network Outside Network ip nat inside ip nat outside Inside HostOutside Host Outside Interface

25 NAT Concepts NAT translations are static or dynamic Static translation are entered directly into the configuration and are always in the translation table ip nat inside source static 10.6.1.20 171.69.68.10 Dynamic translations use access lists to identify IP addresses that NAT should create translations for ip nat inside source list 1 pool nat-pool access-list 1 permit 10.0.0.0 0.255.255.255

26 Static vs. Dynamic Translations Static translations When you need to be able to initiate a connection from both the inside and outside interfaces (e.g. SMTP, Web) Or you want a specific host to be translated to a specific IP address Dynamic translations When you want to initiate a connection from only the inside or only the outside

27 NAT Concepts An IP address is either local or global Local IP addresses are seen in the inside network Global IP addresses are seen in the Outside network My Network Internet Inside HostOutside Host NAT Before NAT Outbound Packet Before NAT Outbound Packet Src Addr Inside Local Src Addr Inside Local Dest Addr Outside Host Dest Addr Outside Host After NAT Outbound Packet After NAT Outbound Packet Src Addr Inside Global Src Addr Inside Global Dest Addr Outside Host Dest Addr Outside Host After NAT Inbound Packet After NAT Inbound Packet Src Addr Outside Local Src Addr Outside Local Dest Addr Inside Host Dest Addr Inside Host Before NAT Inbound Packet Before NAT Inbound Packet Src Addr Outside Global Src Addr Outside Global Dest Addr Inside Host Dest Addr Inside Host

28 Inside Local/Inside Global Example NAT Address Pool 171.69.68.11 171.69.68.12 171.69.68.13 For Outbound Packets an Address Is Dynamically Allocated from the NAT Address Pool 10.6.1.20Outside Host NAT Before NAT Outbound Packet Src Addr 10.6.1.20 Dest Addr Outside Host After NAT Outbound Packet Src Addr 171.69.68.10 Dest Addr Outside Host Pro Inside Local Outside Local Outside Global Inside Global --- 171.69.68.10 10.6.1.20 171.69.68.10 NAT Address Pool - - - 171.69.68.11 171.69.68.12 171.69.68.13 My Network Internet

29 Inside Local/Inside Global Example The NAT Address Translation Entry in the Translation Table Is Used to Translate Return Packets 10.6.1.20Outside Host NAT After NAT Return Packet After NAT Return Packet Src Addr 10.6.1.20 Src Addr 10.6.1.20 Dest Addr Outside Host Dest Addr Outside Host Before NAT Return Packet Before NAT Return Packet Src Addr 171.69.68.10 Src Addr 171.69.68.10 Dest Addr Outside Host Dest Addr Outside Host Pro Inside Local Outside Local Outside Global Inside Global --- 171.69.68.1 0 10.6.1.20 Pro Inside Local Outside Local Outside Global Inside Global --- My Network Internet NAT Address Pool - - - 171.69.68.11 171.69.68.12 171.69.68.13 NAT Address Pool 171.69.68.10 171.69.68.11 171.69.68.12 171.69.68.13

30 NAT Terminology Inside local Configured IP address assigned to a host on the inside network; address may be globally unique, allocated out of the private address space defined in RFC 1918, or may be officially allocated to some other organization Inside global The IP address of an inside host as it appears to the outside host and network, “Translated IP Address”; addresses can be allocated from a globally unique address space, typically provided by the ISP (if the enterprise is connected to the global Internet)

31 NAT Concepts Local IP addresses are seen on the inside network while global IP addresses are seen on the outside network My Network Inside HostOutside Host NAT After NAT Outbound Packet After NAT Outbound Packet Dest Addr Outside Global Dest Addr Outside Global Src Addr Inside Global Src Addr Inside Global Internet Before NAT Outbound Packet Before NAT Outbound Packet Src Addr Outside Local Src Addr Outside Local Src Addr Inside Local Src Addr Inside Local

32 --- Pro Inside Local Outside Local Outside Global Inside Global --- Pro Inside Local Outside Local Outside Global Inside Global --- 171.69.70.15 192.168.1.80 NAT Concepts Router# show ip nat translations A NAT translation is 1 to 1 or many to 1 1 to 1 translations (NAT) assign a different IP address for each translation Many to 1 (PAT) translations can assign the same IP address for each translation --- Pro Inside Local Outside Local Outside Global Inside Global --- 171.69.70.15 192.168.1.80 171.69.68.10:1202 10.6.15.2:1202 204.71.200.67:80 171.69.68.10:1460 10.8.20.25:146 0 204.71.200.69:80 tcp

33 PAT PAT (Port Address Translation) includes ports in addition to IP addresses Many-to-one translation Maps multiple IP addresses to 1 or a few IP addresses Unique source port number identifies each session Conserves registered IP addresses Also called NAPT in IETF documents Router# show ip nat translations Pro Inside Local Outside Local Outside Global Inside Global 171.69.68.5:1405 10.6.15.2:1405 204.71.200.69:80 tcp 204.71.200.69:80

34 NAT vs. PAT NAT When there is sufficient number of IP addresses for 1 to 1 translations PAT When there are an insufficient number of IP addresses available to translate all of the inside addresses

35 NAT Order of Operation NAT always checks translation table for entry before access lists For a full NAT order of operation see http://www.cisco.com/warp/public/556/5.html After NAT Outbound Packet After NAT Outbound Packet Dest Addr Outside Global Dest Addr Outside Global Src Addr Inside Global Src Addr Inside Global Before NAT Outbound Packet Before NAT Outbound Packet Dst Addr Outside Local Dst Addr Outside Local Src Addr Inside Local Src Addr Inside Local After NAT Inbound Packet After NAT Inbound Packet Src Addr Outside Local Src Addr Outside Local Dest Addr Inside Local Dest Addr Inside Local Before NAT Inbound Packet Before NAT Inbound Packet Src Addr Outside Global Src Addr Outside Global Dest Addr Inside Global Dest Addr Inside Global Inside Interface Outside Interface Routing NAT

36 Summary NAT provides transparent and bi-directional connectivity between networks having arbitrary addressing schemes NAT eliminates costs associated with host renumbering NAT eases IP address management NAT enhances network privacy


Download ppt "CS 540 Computer Networks II Sandy Wang"

Similar presentations


Ads by Google