ECE 4450:427/527 - Computer Networks Spring 2017

Similar documents
CS 457 Networking and the Internet. Problems. Mechanisms 9/21/16. Fall 2016 Indrajit Ray

Chapter 4: Network Layer

CMPE 150/L : Introduction to Computer Networks. Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 12

EC441 Fall 2018 Introduction to Computer Networking Chapter4: Network Layer Data Plane

Network layer: Overview. Network layer functions IP Routing and forwarding NAT ARP IPv6 Routing

Network layer: Overview. Network Layer Functions

Quiz. Segment structure and fields Flow control (rwnd) Timeout interval. Phases transition ssthresh setting Cwnd setting

Subnets. IP datagram format. The Internet Network layer. IP Fragmentation and Reassembly. IP Fragmentation & Reassembly. IP Addressing: introduction

Last time. Network layer. Introduction. Virtual circuit vs. datagram details. IP: the Internet Protocol. forwarding vs. routing

Router Architecture Overview

Network Layer: Internet Protocol

Link Layer and LANs. CMPS 4750/6750: Computer Networks

1-1. Switching Networks (Fall 2010) EE 586 Communication and. October 25, Lecture 24

Data Communication & Networks G Session 7 - Main Theme Networks: Part I Circuit Switching, Packet Switching, The Network Layer

CPSC 826 Internetworking. The Network Layer: Routing & Addressing Outline. The Network Layer

Recap. Recap. Internetworking. First mile problem. Internet. End Users. Last mile problem. Direct link networks Packet switching.

Lecture 4 - Network Layer. Transport Layer. Outline. Introduction. Notes. Notes. Notes. Notes. Networks and Security. Jacob Aae Mikkelsen

L10: Simple Internetworking. Hui Chen, Ph.D. Department of Engineering & Computer Science Virginia State University Petersburg, VA 23806

CSC 4900 Computer Networks: Network Layer

Lecture 8. Basic Internetworking (IP) Outline. Basic Internetworking (IP) Basic Internetworking (IP) Service Model

Network Layer PREPARED BY AHMED ABDEL-RAOUF

Lecture 8. Reminder: Homework 3, Programming Project 2 due on Thursday. Questions? Tuesday, September 20 CS 475 Networks - Lecture 8 1

Chapter 4: network layer. Network service model. Two key network-layer functions. Network layer. Input port functions. Router architecture overview

CSC 401 Data and Computer Communications Networks

CS 43: Computer Networks Switches and LANs. Kevin Webb Swarthmore College December 5, 2017

CS475 Networks Lecture 8 Chapter 3 Internetworking. Ethernet or Wi-Fi).

Network Layer: Router Architecture, IP Addressing

Lecture 8. Network Layer (cont d) Network Layer 1-1

ECE 158A: Lecture 7. Fall 2015

Department of Computer and IT Engineering University of Kurdistan. Network Layer. By: Dr. Alireza Abdollahpouri

CS 457 Lecture 11 More IP Networking. Fall 2011

CSCI-1680 Network Layer: IP & Forwarding Rodrigo Fonseca

Chapter 4 Network Layer: The Data Plane

CS 3516: Advanced Computer Networks

Internetworking Part 2

Computer Networking Introduction

CMPE 80N: Introduction to Networking and the Internet

Internet Protocol (IP)

Master Course Computer Networks IN2097

CSEN 503 Introduction to Communication Networks. Mervat AbuElkheir Hana Medhat Ayman Dayf. **Slides are attributed to J. F. Kurose

C14a: Internetworks and The Internet

CH. 3 IP FORWARDING AND ROUTING

Chapter 5 Link Layer. Computer Networking: A Top Down Approach. 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012

IP - The Internet Protocol. Based on the slides of Dr. Jorg Liebeherr, University of Virginia

internet technologies and standards

Computer Network Fundamentals Spring Week 4 Network Layer Andreas Terzis

Lecture 3. The Network Layer (cont d) Network Layer 1-1

Link layer: introduction

Network Layer: Control/data plane, addressing, routers

Introduction to Internetworking

EPL606. Internetworking. Part 2a. 1Network Layer

CS4450. Computer Networks: Architecture and Protocols. Lecture 13 THE Internet Protocol. Spring 2018 Rachit Agarwal

Chapter 4 Network Layer: The Data Plane

ARP, IP. Chong-Kwon Kim. Each station (or network interface) should be uniquely identified Use 6 byte long address

IPv4 Lecture 10a. COMPSCI 726 Network Defence and Countermeasures. Muhammad Rizwan Asghar. August 14, 2017

CSCI-1680 Network Layer: IP & Forwarding John Jannotti

2/22/2008. Outline Computer Networking Lecture 9 IP Protocol. Hop-by-Hop Packet Forwarding in the Internet. Internetworking.

CIS-331 Final Exam Fall 2015 Total of 120 Points. Version 1

Chapter 4 Network Layer

Outline. IP Address. IP Address. The Internet Protocol. o Hostname & IP Address. o The Address

TDTS06: computer Networks

Chapter 4: network layer

Internetworking Part 2

CSCI Computer Networks Fall 2016

CSCI-1680 Network Layer: IP & Forwarding Rodrigo Fonseca

CS 348 Computer Networks. IP and Routing. Indian Institute of Technology, Bombay

Chapter 4 Network Layer: The Data Plane

Data Communication & Computer Networks Week # 13

Hierarchical Routing. Our routing study thus far - idealization all routers identical network flat no true in practice. administrative autonomy

End-to-End Communication

Internetworking - We are heterogeneity to our network (variable network technologies, bandwidth, MTU, latency, etc. etc.)

internet technologies and standards

Lecture 20: Link Layer

CS 43: Computer Networks. 21: The Network Layer & IP November 7, 2018

Introduction to Internetworking

NETWORK LAYER DATA PLANE

Introduction to Computer Networking. Guy Leduc. Chapter 4 Network Layer: The Data Plane. Chapter 4: Network Layer Data Plane

CS 3516: Advanced Computer Networks

EITF25 Internet Techniques and Applications L7: Internet. Stefan Höst

The Link Layer and LANs: Ethernet and Swiches

IPv4. Christian Grothoff.

Network Layer: Data Plane 4-2

OSI Network Layer. Network Fundamentals Chapter 5. Version Cisco Systems, Inc. All rights reserved. Cisco Public 1

IPv4 addressing, NAT. Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley.

CMPE 150/L : Introduction to Computer Networks. Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 18

CSCI-1680 Network Layer: IP & Forwarding Rodrigo Fonseca Instructor: Nicholas DeMarinis

Communications Software. CSE 123b. CSE 123b. Spring Lecture 2: Internet architecture and. Internetworking. Stefan Savage

Data Communications & Networks. Session 7 Main Theme Networks: Part I Circuit Switching, Packet Switching, The Network Layer

CompSci 356: Computer Network Architectures. Lecture 8: Spanning Tree Algorithm and Basic Internetworking Ch & 3.2. Xiaowei Yang

CIS 551 / TCOM 401 Computer and Network Security. Spring 2006 Lecture 16

Internet Protocol. Outline Introduction to Internet Protocol Header and address formats ICMP Tools CS 640 1

Outline. Routing. Introduction to Wide Area Routing. Classification of Routing Algorithms. Introduction. Broadcasting and Multicasting

CSE/EE 461 The Network Layer. Application Presentation Session Transport Network Data Link Physical

IP/MAC Address Translation

The Internet Protocol. IP Addresses Address Resolution Protocol: IP datagram format and forwarding: IP fragmentation and reassembly

TSIN02 - Internetworking

Lecture 9 The Data Link Layer part II. Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it

IP - The Internet Protocol

RMIT University. Data Communication and Net-Centric Computing COSC 1111/2061. Lecture 2. Internetworking IPv4, IPv6

Inter-networking. Problem. 3&4-Internetworking.key - September 20, LAN s are great but. We want to connect them together. ...

Transcription:

ECE 4450:427/527 - Computer Networks Spring 2017 Dr. Nghi Tran Department of Electrical & Computer Engineering Lecture 6.2: IP Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 1

Internetworking: Discussions For Internetworking, we shall look at few subproblems: Interconnect links of the same type: Switches We consider an important of class switch: Bridges to interconnect Ethernet segments. We also look a way to interconnect disparate networks and links: Gateways, or now mostly known as routers. We shall focus on the IP Once we are able to interconnect a whole lot of links and networks with switches and routers, we will look at a way to find a suitable path, or route through a new working: Paths that are efficient, loop free, etc.: Routing Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 2

Internetworking What is internetwork An arbitrary collection of networks interconnected to provide some sort of host-host to packet delivery service A simple internetwork where H represents hosts and R represents routers Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 3

IP: Internet Protocol What is IP IP stands for Internet Protocol Key tool used today to build scalable, heterogeneous internetworks It runs on all the nodes in a collection of networks and defines the infrastructure that allows these nodes and networks to function as a single logical internetwork A simple internetwork showing the protocol layers A simple internetwork showing the protocol layers Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 4

IP: Best Effort Service IP is a datagram connectionless protocol Does not provide any type of guarantee about packet delivery Out of order packet deliveries, duplicate packets, no error correction If packets are lost, IP does not try to recover or retransmit (though lower or higher layer functionalities may do so) Global addressing scheme Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 5

IPv4: Packet Format 4-bit Version 4-bit Header Length 8-bit Type of Service (TOS) 16-bit Total Length (Bytes) 16-bit Identification 3-bit Flags 13-bit Fragment Offset 8-bit Time to Live (TTL) 8-bit Protocol 16-bit Header Checksum 32-bit Source IP Address 32-bit Destination IP Address Options (if any) Payload Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 6

IP Packet Format Version number (4 bits) Indicates the version of the IP protocol Necessary to know what other fields to expect Typically 4 (for IPv4), and sometimes 6 (for IPv6) Header length (4 bits) Number of 32-bit words in the header Typically 5 (for a 20-byte IPv4 header) Can be more when IP options are used Type-of-Service (8 bits) Allow packets to be treated differently based on needs E.g., low delay for audio, high bandwidth for bulk transfer Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 7

IP Packet Format Total length (16 bits) Number of bytes in the packet Maximum size is 63,535 bytes (2 16-1) though underlying links may impose harder limits Fragmentation information (32 bits) Packet identifier, flags, and fragment offset Supports dividing a large IP packet into fragments in case a link cannot handle a large IP packet Time-To-Live (8 bits) Used to identify packets stuck in forwarding loops and eventually discard them from the network Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 8

Time-to-Live (TTL) Potential robustness problem Forwarding loops can cause packets to cycle forever Confusing if the packet arrives much later Time-to-live field in packet header TTL field decremented by each router on the path Packet is discarded when TTL field reaches 0 and time exceeded message is sent to the source Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 9

Protocol Field Protocol (8 bits) Identifies the higher-level protocol E.g., 6 for the Transmission Control Protocol (TCP) E.g., 17 for the User Datagram Protocol (UDP) Important for demultiplexing at receiving host Indicates what kind of header to expect next protocol=6 IP header TCP header protocol=17 IP header UDP header Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 10

Two IP addresses IP Addresses Field Source IP address (32 bits) Destination IP address (32 bits) Destination address Unique identifier for the receiving host Allows each node/router to make forwarding decisions Source address Unique identifier for the sending host Recipient can decide whether to accept packet Enables recipient to send a reply back to source Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 11

IP Fragmentation and Reassembly Each network has some MTU (Maximum Transmission Unit): largest IP datagram it can carry in a frame Ethernet (1500 bytes), FDDI (4500 bytes) Strategy Fragmentation occurs in a router when it receives a datagram that it wants to forward over a network which has (MTU < received datagram) Reassembly is done at the receiving host All the fragments carry the same identifier in the Ident field Fragments are self-contained datagrams IP does not recover from missing fragments Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 12

IP Fragmentation and Reassembly IP datagrams traversing the sequence of physical networks Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 13

IP Fragmentation and Reassembly Header fields used in IP fragmentation. (a) Unfragmented packet; (b) fragmented packets. Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 14

IP Datagram Forwarding Strategy every datagram contains destination's address if directly connected to destination network, then forward to host if not directly connected to destination network, then forward to some router forwarding table maps network number into next hop each host has a default router each router maintains a forwarding table Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 15

Forwarding Table Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 16

IPv4 Addressing A unique 32-bit number Identifies an interface (on a host, on a router, ) Represented in dotted-quad notation 12 34 158 5 00001100 00100010 10011110 00000101 Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 17

IPv4 Addressing A host usually has a single link into network: When IP in host wants to send datagram, it does so over the link -> Boundary between host and link: interface. IP address: technically associated with an interface, rather with the host How about a router? Receive datagram on a link and forward to on some other link. How many interfaces? How many IP addresses? Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 18

IPv4: Early Addressing Properties globally unique hierarchical: network + host 4 Billion IP address, half are A type, ¼ is B type, and 1/8 is C type Format Dot notation 10.3.2.4 128.96.33.81 192.12.69.77 Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 19

IP Addressing: CIDR CIDR: Classless InterDomain Routing subnet portion of address of arbitrary length address format: a.b.c.d/x, where x is # bits in subnet portion of address subnet part 11001000 00010111 00010000 00000000 200.23.16.0/23 host part Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 20

Subnets IP address: subnet part (high order bits) host part (low order bits) What s a subnet? device interfaces with same subnet part of IP address can physically reach each other without intervening router 223.1.1.1 223.1.2.1 223.1.1.2 223.1.1.4 223.1.2.9 223.1.1.3 223.1.3.1 223.1.2.2 223.1.3.27 subnet 223.1.3.2 network consisting of 3 subnets Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 21

Subnet and Subnet Mask 223.1.1.0/24 223.1.2.0/24 Recipe to determine the subnets, detach each interface from its host or router, creating islands of isolated networks each isolated network is called a subnet. 223.1.3.0/24 Subnet mask: /24 Or 255.255.255.000 Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 22

Subnets 223.1.1.2 How many? 223.1.1.1 223.1.1.4 223.1.1.3 223.1.9.2 223.1.7.0 223.1.9.1 223.1.8.1 223.1.8.0 223.1.7.1 223.1.2.6 223.1.3.27 223.1.2.1 223.1.2.2 223.1.3.1 223.1.3.2 Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 23

ARP: Address Resolution Protocol Question: how to determine MAC address of B knowing B s IP address? 137.196.7.23 71-65-F7-2B-08-53 LAN 137.196.7.78 1A-2F-BB-76-09-AD 137.196.7.14 58-23-D7-FA-20-B0 Each IP node (host, router) on LAN has ARP table in ARP module ARP table: IP/MAC address mappings for some LAN nodes < IP address; MAC address; TTL> TTL (Time To Live): time after which address mapping will be forgotten (typically 20 min) 137.196.7.88 0C-C4-11-6F-E3-98 Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 24

ARP: Same LAN A wants to send datagram to B, and B s MAC address not in A s ARP table. A broadcasts ARP query packet, containing B's IP address dest MAC address = FF-FF- FF-FF-FF-FF all machines on LAN receive ARP query B receives ARP packet, replies to A with its (B's) MAC address frame sent to A s MAC address (unicast) A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) ARP is plug-and-play : nodes create their ARP tables without intervention from net administrator Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 25

ARP: Packet Format HardwareType: type of physical network (e.g., Ethernet) ProtocolType: type of higher layer protocol (e.g., IP) HLEN & PLEN: length of physical and protocol addresses Operation: request or response Source/Target Physical/Protocol addresses Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 26

Addressing: Routing to another LAN walkthrough: send datagram from A to B via R. focus on addressing - at both IP (datagram) and MAC layer (frame) assume A knows B s IP address How can A know whether B is in the same subnet/network? assume A knows B s MAC address (how?) assume A knows IP address of first hop router, R (how?) assume A knows MAC address of first hop router interface (how?) How many MAC addresses? A 111.111.111.111 74-29-9C-E8-FF-55 R 222.222.222.220 1A-23-F9-CD-06-9B B 222.222.222.222 49-BD-D2-C7-56-2A 111.111.111.112 CC-49-DE-D0-AB-7D 111.111.111.110 E6-E9-00-17-BB-4B 222.222.222.221 88-B2-2F-54-1A-0F Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 27

Addressing: Routing to another LAN A creates IP datagram with IP source A, destination B A creates link-layer frame with R's MAC address as dest, frame contains A-to-B IP datagram MAC src: 74-29-9C-E8-FF-55 MAC dest: E6-E9-00-17-BB-4B IP src: 111.111.111.111 IP dest: 222.222.222.222 IP Eth Phy A 111.111.111.111 74-29-9C-E8-FF-55 R 222.222.222.220 1A-23-F9-CD-06-9B B 222.222.222.222 49-BD-D2-C7-56-2A 111.111.111.112 CC-49-DE-D0-AB-7D 111.111.111.110 E6-E9-00-17-BB-4B 222.222.222.221 88-B2-2F-54-1A-0F Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 28

Addressing: Routing to another LAN frame sent from A to R frame received at R, datagram removed, passed up to IP IP Eth Phy A 111.111.111.111 74-29-9C-E8-FF-55 MAC src: 74-29-9C-E8-FF-55 MAC dest: E6-E9-00-17-BB-4B IP src: 111.111.111.111 IP dest: 222.222.222.222 IP Eth Phy R 222.222.222.220 1A-23-F9-CD-06-9B B 222.222.222.222 49-BD-D2-C7-56-2A 111.111.111.112 CC-49-DE-D0-AB-7D 111.111.111.110 E6-E9-00-17-BB-4B 222.222.222.221 88-B2-2F-54-1A-0F Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 29

Addressing: Routing to another LAN R forwards datagram with IP source A, destination B R creates link-layer frame with B's MAC address as dest, frame contains A-to-B IP datagram A 111.111.111.111 74-29-9C-E8-FF-55 IP Eth Phy R 222.222.222.220 1A-23-F9-CD-06-9B MAC src: 1A-23-F9-CD-06-9B MAC dest: 49-BD-D2-C7-56-2A IP src: 111.111.111.111 IP dest: 222.222.222.222 IP Eth Phy B 222.222.222.222 49-BD-D2-C7-56-2A 111.111.111.112 CC-49-DE-D0-AB-7D 111.111.111.110 E6-E9-00-17-BB-4B 222.222.222.221 88-B2-2F-54-1A-0F Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 30

Addressing: Routing to another LAN R forwards datagram with IP source A, destination B R creates link-layer frame with B's MAC address as dest, frame contains A-to-B IP datagram A 111.111.111.111 74-29-9C-E8-FF-55 IP Eth Phy R 222.222.222.220 1A-23-F9-CD-06-9B MAC src: 1A-23-F9-CD-06-9B MAC dest: 49-BD-D2-C7-56-2A IP src: 111.111.111.111 IP dest: 222.222.222.222 IP Eth Phy B 222.222.222.222 49-BD-D2-C7-56-2A 111.111.111.112 CC-49-DE-D0-AB-7D 111.111.111.110 E6-E9-00-17-BB-4B 222.222.222.221 88-B2-2F-54-1A-0F Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 31

Addressing: Routing to another LAN R forwards datagram with IP source A, destination B R creates link-layer frame with B's MAC address as dest, frame contains A-to-B IP datagram MAC src: 1A-23-F9-CD-06-9B MAC dest: 49-BD-D2-C7-56-2A IP src: 111.111.111.111 IP dest: 222.222.222.222 IP Eth Phy A 111.111.111.111 74-29-9C-E8-FF-55 111.111.111.112 CC-49-DE-D0-AB-7D R 111.111.111.110 E6-E9-00-17-BB-4B 222.222.222.220 1A-23-F9-CD-06-9B B 222.222.222.222 49-BD-D2-C7-56-2A 222.222.222.221 88-B2-2F-54-1A-0F Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 32

IP Addresses: How to get one? MAC address: configured in adapter, globally unique IP address: Not only be unique on a given internetwork, but needs to reflect the structure of the internetwork Not possible to be configured once into host; Hosts might change to another network: IP needs to be reconfigurable Usually, automatic configuration methods are required: Dynamic Host Configuration Protocol (): Textbook, 3.2.7 Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 33

A day in the life: Connecting to Internet browser DNS server Comcast network 68.80.0.0/13 school network 68.80.2.0/24 web page web server 64.233.169.105 Google s network 64.233.160.0/19 Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 34

A day in the life: Connecting to Internet UDP IP Eth Phy connecting laptop needs to get its own IP address, addr of first-hop router, addr of DNS server: use UDP IP Eth Phy router (runs ) request encapsulated in UDP, encapsulated in IP, encapsulated in 802. 1 Ethernet Ethernet frame broadcast (dest: FFFFFFFFFFFF) on LAN, received at router running server Ethernet demuxed to IP demuxed, UDP demuxed to Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 35

A day in the life: Connecting to Internet UDP IP Eth Phy server formulates ACK containing client s IP address, IP address of first-hop router for client, name & IP address of DNS server UDP IP Eth Phy router (runs ) encapsulation at server, frame forwarded (switch learning) through LAN, demultiplexing at client client receives ACK reply Client now has IP address, knows name & addr of DNS server, IP address of its first-hop router Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 36

A day in the life: ARP (before DNS, HTTP) DNS DNS DNS ARP query DNS UDP IP Eth Phy ARP ARP reply ARP Eth Phy before sending HTTP request, need IP address of www.google.com: DNS DNS query created, encapsulated in UDP, encapsulated in IP, encapsulated in Eth. In order to send frame to router, need MAC address of router interface: ARP ARP query broadcast, received by router, which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router, so can now send frame containing DNS query Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 37

NAT rest of Internet 138.76.29.7 10.0.0.4 local network (e.g., home network) 10.0.0/24 10.0.0.1 10.0.0.2 10.0.0.3 All datagrams leaving local network have same single source NAT IP address: 138.76.29.7, different source port numbers Datagrams with source or destination in this network have 10.0.0/24 address for source, destination (as usual) Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 38

NAT Implementation: NAT router must: outgoing datagrams: replace (source IP address, port #) of every outgoing datagram to (NAT IP address, new port #)... remote clients/servers will respond using (NAT IP address, new port #) as destination addr. remember (in NAT translation table) every (source IP address, port #) to (NAT IP address, new port #) translation pair incoming datagrams: replace (NAT IP address, new port #) in dest fields of every incoming datagram with corresponding (source IP address, port #) stored in NAT table Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 39

NAT 2: NAT router changes datagram source addr from 10.0.0.1, 3345 to 138.76.29.7, 5001, updates table 2 NAT translation table WAN side addr LAN side addr 138.76.29.7, 5001 10.0.0.1, 3345 S: 138.76.29.7, 5001 D: 128.119.40.186, 80 10.0.0.4 S: 10.0.0.1, 3345 D: 128.119.40.186, 80 1 1: host 10.0.0.1 sends datagram to 128.119.40.186, 80 10.0.0.1 10.0.0.2 138.76.29.7 S: 128.119.40.186, 80 D: 138.76.29.7, 5001 3 3: Reply arrives dest. address: 138.76.29.7, 5001 S: 128.119.40.186, 80 D: 10.0.0.1, 3345 4 4: NAT router changes datagram dest addr from 138.76.29.7, 5001 to 10.0.0.1, 3345 10.0.0.3 Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 40

NAT: Network Address Translation NAT is controversial: routers should only process up to layer 3 violates end-to-end argument: Hosts should be talking directly with each other, without interfereing nodes modifying IP addresses and port numbers Address shortage should instead be solved by IPv6 But like it or not, NAT becomes an important component of the Internet Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527 Computer Networks 41