Chapter 4 Network Layer A note on the use of these ppt slides:

Slides:



Advertisements
Similar presentations
CPSC Network Layer4-1 IP addresses: how to get one? Q: How does a host get IP address? r hard-coded by system admin in a file m Windows: control-panel->network->configuration-
Advertisements

CS 457 – Lecture 16 Global Internet - BGP Spring 2012.
4: Network Layer4a-1 IP Addressing: introduction r IP address: 32-bit identifier for host, router interface r interface: connection between host, router.
8-1 Last time □ Network layer ♦ Introduction forwarding vs. routing ♦ Virtual circuit vs. datagram details connection setup, teardown VC# switching forwarding.
Introduction 1-1 1DT066 Distributed Information System Chapter 4 Network Layer.
Announcement r Recitation tomorrow on Project 2 r Midterm Survey at the end of this class.
Week 5: Internet Protocol Continue to discuss Ethernet and ARP –MTU –Ethernet and ARP packet format IP: Internet Protocol –Datagram format –IPv4 addressing.
Network Layer introduction 4.2 virtual circuit and datagram networks 4.3 what’s inside a router 4.4 IP: Internet Protocol  datagram format  IPv4.
Network Layer4-1 Computer Networking (Datakom) Chapter 4: Network Layer Chapter goals: r understand principles behind network layer services: m routing.
Announcement r Project 2 due Fri. midnight r Homework 3 out m Due 2/29 Sun. r Advertisement for my CS395/495 course next quarter: Computer Network Security:
Chapter 5 The Network Layer.
N/W Layer Addressing1 Instructor: Anirban Mahanti Office: ICT Class Location: ICT 121 Lectures: MWF 12:00 – 12:50 Notes.
Rensselaer Polytechnic Institute © Shivkumar Kalvanaraman & © Biplab Sikdar 1 ECSE-4670: Computer Communication Networks (CCN) Network Layer Shivkumar.
Network Layer Overview and IP
11- IP Network Layer4-1. Network Layer4-2 The Internet Network layer forwarding table Host, router network layer functions: Routing protocols path selection.
Network Layer4-1 IP: Internet Protocol r Datagram format r IPv4 addressing r DHCP: Dynamic Host Configuration Protocol r NAT: Network Address Translation.
Network Layer4-1 Chapter 4 Network Layer Computer Networking: A Top Down Approach Featuring the Internet, 3 rd edition. Jim Kurose, Keith Ross Addison-Wesley,
Network Layer4-1 Chapter 4 Network Layer A note on the use of these ppt slides: We’re making these slides freely available to all (faculty, students, readers).
Network Layer session 1 TELE3118: Network Technologies Week 4: Network Layer Basics, Addressing Some slides have been taken from: r Computer Networking:
Network Layer4-1 Network layer r transport segment from sending to receiving host r on sending side encapsulates segments into datagrams r on rcving side,
Network Layer4-1 Network layer r transport segment from sending to receiving host r on sending side encapsulates segments into datagrams r on rcving side,
12 – NAT, ICMP, IPv6 Network Layer4-1. Network Layer4-2 Chapter 4 Network Layer Computer Networking: A Top Down Approach Featuring the Internet, 3 rd.
Computer Networks The Network Layer
4: Network Layer4a-1 IP datagram format ver length 32 bits data (variable length, typically a TCP or UDP segment) 16-bit identifier Internet checksum time.
Network Layer4-1 NAT: Network Address Translation local network (e.g., home network) /24 rest of.
Chapter 4 Network Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 A note on the use of these.
Network LayerII-1 RSC Part II: Network Layer 3. IP addressing (2nd part) Redes y Servicios de Comunicaciones Universidad Carlos III de Madrid These slides.
Adapted from: Computer Networking, Kurose/Ross 1DT066 Distributed Information Systems Chapter 4 Network Layer.
Network Layer Lecture # 2 MAHS. 4: Network Layer 4b-2 Hierarchical Routing scale: with 200 million destinations: r can’t store all dest’s in routing tables!
Datagram Networks: Internet Protocol (IPv4)
CS 1652 The slides are adapted from the publisher’s material All material copyright J.F Kurose and K.W. Ross, All Rights Reserved Jack Lange.
12 – IP, NAT, ICMP, IPv6 Network Layer.
Chapter 4 Network Layer slides are modified from J. Kurose & K. Ross CPE 400 / 600 Computer Communication Networks Lecture 16.
Network Layer4-1 DHCP: Dynamic Host Configuration Protocol Goal: allow host to dynamically obtain its IP address from network server when it joins network.
1DT066 Distributed Information System Chapter 4 Network Layer.
Network Layer4-1 Chapter 4 Network Layer A note on the use of these ppt slides: We’re making these slides freely available to all (faculty, students, readers).
Transport Layer 3-1 Chapter 4 Network Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012  CPSC.
CIS 3360: Internet: Network Layer Introduction Cliff Zou Spring 2012.
1 Chapter 4: Network Layer r 4.4 IP: Internet Protocol m Datagram format m IPv4 addressing m ICMP m IPv6 r 4.5 Routing algorithms m Hierarchical routing.
Network Layer4-1 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.3 What’s inside a router r 4.4 IP: Internet.
Chapter 4 Network Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 A note on the use of these.
1 Network Layer Lecture 15 Imran Ahmed University of Management & Technology.
Network Layer4-1 IP: Internet Protocol r Datagram format r IPv4 addressing r DHCP: Dynamic Host Configuration Protocol r NAT: Network Address Translation.
Network Layer4-1 Chapter 4 roadmap 4.1 Introduction and Network Service Models 4.2 Routing Principles 4.3 Hierarchical Routing 4.4 The Internet (IP) Protocol.
Network Layer4-1 The Internet Network layer forwarding table Host, router network layer functions: Routing protocols path selection RIP, OSPF, BGP IP protocol.
Lectu re 1 Recap: “Operational” view of Internet r Internet: “network of networks” m Requires sending, receiving of messages r protocols control sending,
Sharif University of Technology, Kish Island Campus Internet Protocol (IP) by Behzad Akbari.
Transport Layer3-1 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.3 What’s inside a router r 4.4 IP: Internet.
Network Layer4-1 Datagram networks r no call setup at network layer r routers: no state about end-to-end connections m no network-level concept of “connection”
Network Layer4-1 Chapter 4: Network Layer Chapter goals: r Understand principles behind network layer services: m Routing (path selection) m dealing with.
Chapter 4 Network Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 A note on the use of these.
The Internet Network layer
Data Communications and Computer Networks Chapter 4 CS 3830 Lecture 19 Omar Meqdadi Department of Computer Science and Software Engineering University.
Network Layer4-1 Chapter 4 Network Layer All material copyright J.F Kurose and K.W. Ross, All Rights Reserved Computer Networking: A Top Down.
Network Layer4-1 Chapter 4: Network Layer Chapter goals: r understand principles behind network layer services: m network layer service models m forwarding.
@Yuan Xue A special acknowledge goes to J.F Kurose and K.W. Ross Some of the slides used in this lecture are adapted from their.
1 COMP 431 Internet Services & Protocols The IP Internet Protocol Jasleen Kaur April 21, 2016.
CSE 421 Computer Networks. Network Layer 4-2 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.3 What’s inside.
Network Layer 4-1 Chapter 4 Network Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 A note.
Introduction to Networks
12 – IP, NAT, ICMP, IPv6 Network Layer.
Computer Communication Networks
Chapter 4: Network Layer
Chapter 4: Network Layer
CS 1652 Jack Lange University of Pittsburgh
Wide Area Networks and Internet CT1403
Overview The Internet (IP) Protocol Datagram format IP fragmentation
DHCP and NAT.
DHCP: Dynamic Host Configuration Protocol
Presentation transcript:

Chapter 4 Network Layer A note on the use of these ppt slides: We’re making these slides freely available to all (faculty, students, readers). They’re in PowerPoint form so you can add, modify, and delete slides (including this one) and slide content to suit your needs. They obviously represent a lot of work on our part. In return for use, we only ask the following: If you use these slides (e.g., in a class) in substantially unaltered form, that you mention their source (after all, we’d like people to use our book!) If you post any slides in substantially unaltered form on a www site, that you note that they are adapted from (or perhaps identical to) our slides, and note our copyright of this material. Modified by Melissa, Brigitte, and Amy Thanks and enjoy! JFK/KWR All material copyright 1996-2002 J.F Kurose and K.W. Ross, All Rights Reserved Computer Networking: A Top Down Approach Featuring the Internet, 2nd edition. Jim Kurose, Keith Ross Addison-Wesley, July 2002. Network Layer

Chapter 4 roadmap 4.1 Introduction and Network Service Models 4.2 Routing Principles 4.3 Hierarchical Routing 4.4 The Internet (IP) Protocol 4.4.1 IPv4 addressing 4.4.2 Moving a datagram from source to destination 4.4.3 Datagram format 4.4.4 IP fragmentation 4.4.5 ICMP: Internet Control Message Protocol 4.4.6 DHCP: Dynamic Host Configuration Protocol 4.4.7 NAT: Network Address Translation 4.5 Routing in the Internet 4.6 What’s Inside a Router 4.7 IPv6 4.8 Multicast Routing 4.9 Mobility Network Layer

4.4.1 IPv4 Addressing Roadmap Definition of an IP Address Definition of a Network from the IP perspective Address Assignment ISPs Networks Hosts Classful Addressing Masking Subnetting Classful Addressing Alternative Hierarchial Addressing Quiz Network-layer service models Routing algorithms commonly used to determine paths between source and destination Use of hierarchy to address the problem of scale. Explore the network layer of the Internet Pieces of which are often collectively referred to as the IP layer named after the IP protocol which is actually only one piece of the network layer. Network Layer Network Layer 4-3 3

What is an IP Address? IP address: 32-bit identifier for host, router interface interface: connection between host/router and physical link router’s typically have multiple interfaces host may have multiple interfaces IP addresses associated with each interface 223.1.1.1 223.1.2.1 223.1.1.2 223.1.1.4 223.1.2.9 223.1.2.2 223.1.1.3 223.1.3.27 223.1.3.1 223.1.3.2 223.1.1.1 = 11011111 00000001 00000001 00000001 223 1 Network Layer Network Layer 4-4 5

IP Addressing IP address: network part (high order bits) host part (low order bits) What’s a network ? (from IP address perspective) device interfaces with same network 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.2.2 223.1.1.3 223.1.3.27 LAN 223.1.3.1 223.1.3.2 network consisting of 3 IP networks (for IP addresses starting with 223, first 24 bits are network address) Network Layer Network Layer 4-5 6

IP Addressing How to find the networks? 223.1.1.2 How to find the networks? Detach each interface from router, host create “islands of isolated networks 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.7.1 223.1.8.1 223.1.8.0 223.1.2.6 223.1.3.27 Interconnected system consisting of six networks 223.1.2.1 223.1.2.2 223.1.3.1 223.1.3.2 Network Layer Network Layer 4-6 7

IP Addresses given notion of “network”, let’s re-examine IP addresses: “class-full” addressing: 2^32 addresses = 4 billion addresses 32 bits network host A class 126 (27-2) 16,777,214 1.0.0.0 to 127.255.255.255 10 network host B 16,384 (214) 65,534 128.0.0.0 to 191.255.255.255 110 network host C 2,097,151 (221-1) 254 192.0.0.0 to 223.255.255.255 1110 multicast address D 224.0.0.0 to 239.255.255.255 Network Layer Network Layer 4-7 8

Address Assignment: To ISPs Q: How does an ISP get block of addresses? A: ICANN: Internet Corporation for Assigned Names and Numbers allocates addresses manages DNS assigns domain names, resolves disputes Network Layer Network Layer 4-8 9

Address Assignment: To Networks Q: How does network get network part of IP addr? A: gets allocated portion of its provider ISP’s address space ISP's block 11001000 00010111 00010000 00000000 200.23.16.0/20 Organization 0 11001000 00010111 00010000 00000000 200.23.16.0/23 Organization 1 11001000 00010111 00010010 00000000 200.23.18.0/23 Organization 2 11001000 00010111 00010100 00000000 200.23.20.0/23 ... ….. …. …. Organization 7 11001000 00010111 00011110 00000000 200.23.30.0/23 Network Layer Network Layer 4-9 10

Address Assignment: To Hosts Q: How does host get IP address? hard-coded by system admin in a file Wintel: control-panel->network->configuration->tcp/ip->properties DHCP: Dynamic Host Configuration Protocol: dynamically get address from as server “plug-and-play” Network Layer Network Layer 4-10 11

Masking the Network Portion 131.229.157.11 = Class B 10000011 11100101 01100111 00001011 11111111 11111111 00000000 00000000 10000011 11100111 00000000 00000000 Smith College = 131.229.0.0 Network Layer Network Layer 4-11 12

Class B Sub-Netting: 2 bits Original Mask 128 64 32 16 8 4 2 1 New Mask 255.255. 1 1 0 0 0 0 0 0 255.255.192 192 2 Bits Address Range Valid New Nets # Hosts per Net 0 0 0-Invalid 0-63 None 0 0 0 1 64 64-127 65-126 1 62 1 0 128 128-191 129-190 1 62 1 1 192-Invalid 192-255 None 0 0 TOTAL = 2 nets 124 hosts Source: NetCom Systems <www.netliban.com/download/tcpip%20address.doc> Network Layer Network Layer 4-12 13

Class B Sub-Netting: 3 bits Original Mask 128 64 32 16 8 4 2 1 New Mask 255.255. 1 1 1 0 0 0 0 0 255.255.224 224 2 Bits Address Range Valid New Nets # Hosts per Net 000 0-Invalid 0-31 None 0 0 001 32 32-63 33-62 1 30 010 64 64-95 65-94 1 30 111 96 96-127 97-126 1 30 100 128 128-159 129-158 1 30 101 160 160-191 161-190 1 30 110 192 192-223 193-222 1 30 111 224-Invalid 224-255 None 0 0 TOTAL = 6 nets 180 hosts Source: NetCom Systems <www.netliban.com/download/tcpip%20address.doc> Network Layer Network Layer 4-13 14

Class “B” Sub-Netting A Network or Host Address cannot contain all 0’s or all 1’s. Source: NetCom Systems <www.netliban.com/download/tcpip%20address.doc> Network Layer Network Layer 4-14 15

The “Classful” Alternative: CIDR Classful addressing: inefficient use of address space, address space exhaustion e.g., class B net allocated enough addresses for 65K hosts, even if only 2K hosts in that network CIDR: Classless InterDomain Routing network portion of address of arbitrary length address format: a.b.c.d/x, where x is # bits in network portion of address 11001000 00010111 00010000 00000000 network part host 200.23.16.0/23 Network Layer Network Layer 4-15 16

Hierarchical addressing: route aggregation Hierarchical addressing allows efficient advertisement of routing information: Organization 0 200.23.16.0/23 “Send me anything with addresses beginning 200.23.16.0/20” Organization 1 200.23.18.0/23 Organization 2 200.23.20.0/23 . Fly-By-Night-ISP . Internet Organization 7 200.23.30.0/23 “Send me anything with addresses beginning 199.31.0.0/16” ISPs-R-Us Network Layer Network Layer 4-16 17

Hierarchical addressing: more specific routes ISPs-R-Us has a more specific route to Organization 1 Organization 0 200.23.16.0/23 “Send me anything with addresses beginning 200.23.16.0/20” Organization 2 200.23.20.0/23 . Fly-By-Night-ISP . Internet Organization 7 200.23.30.0/23 “Send me anything with addresses beginning 199.31.0.0/16 or 200.23.18.0/23” ISPs-R-Us Organization 1 200.23.18.0/23 Network Layer Network Layer 4-17 18

IP Address Quiz What IP address is contained in 11/8? 15.31.184.254 14.50.97.103 8.85.29.189 11.150.208.105 What IP address matches 7.74.34.159/32? 7.74.39/24 7.74.34.52/32 7.74.34/24 Network Layer Network Layer 4-18 19

IP Address Quiz What IP address is contained in 86.32/12? 86.33.224.123 86.79.65.216 86.58.119.74 86.68.206.154 What IP address contains 152.7.77.159 and 152.31.47.252? 152.0/11 152.40/13 153.0/9 152.64.12 Network Layer Network Layer 4-19 20

Web Resources “whois” demo General info + Quizzes www.iana.org/ipaddress/ip-addresses.htm General info + Quizzes www.freesoft.org/CIE/Course/Subnet/index.htm Network Layer Network Layer 4-20 21

Chapter 4 roadmap 4.1 Introduction and Network Service Models 4.2 Routing Principles 4.3 Hierarchical Routing 4.4 The Internet (IP) Protocol 4.4.1 IPv4 addressing 4.4.2 Moving a datagram from source to destination 4.4.3 Datagram format 4.4.4 IP fragmentation 4.4.5 ICMP: Internet Control Message Protocol 4.4.6 DHCP: Dynamic Host Configuration Protocol 4.4.7 NAT: Network Address Translation 4.5 Routing in the Internet 4.6 What’s Inside a Router 4.7 IPv6 4.8 Multicast Routing 4.9 Mobility Network Layer

Getting a datagram from source to dest. forwarding table in A Dest. Net. next router Nhops 223.1.1 1 223.1.2 223.1.1.4 2 223.1.3 223.1.1.4 2 IP datagram: misc fields source IP addr dest data A 223.1.1.1 * datagram remains unchanged 223.1.2.1 223.1.1.2 223.1.1.4 223.1.2.9 E 223.1.2.2 223.1.1.3 223.1.3.27 223.1.3.1 223.1.3.2 Network Layer

Getting a datagram from source to dest. Amelia’s Forwarding Table misc fields Dest. Net. next router Nhops 223.1.1 1 223.1.2 223.1.1.4 2 223.1.3 223.1.1.4 2 223.1.1.1 223.1.1.3 data Starting at Amelia, send IP datagram addressed to Marga: Amelia 223.1.1.1 look up net. address of Marga in forwarding table 223.1.2.1 223.1.1.2 223.1.1.4 223.1.2.9 Marga is on same net. as Amelia Marga 223.1.2.2 link layer will send datagram directly to Marga inside link-layer frame 223.1.1.3 223.1.3.27 223.1.3.1 223.1.3.2 Network Layer

Getting a datagram from source to dest. Amelia’s Forwarding Table misc fields Dest. Net. next router Nhops 223.1.1 1 223.1.2 223.1.1.4 2 223.1.3 223.1.1.4 2 223.1.1.1 223.1.2.2 data Starting at Amelia, dest. to Sonya : look up network address of Sonya in forwarding table Amelia 223.1.1.1 Sonya on different network i.e. not directly attached 223.1.2.1 223.1.1.2 223.1.1.4 223.1.2.9 routing table: next hop router to Sonya is 223.1.1.4 Sonya 223.1.2.2 223.1.1.3 223.1.3.27 link layer sends datagram to router 223.1.1.4 inside link-layer frame 223.1.3.1 223.1.3.2 datagram arrives at 223.1.1.4 continued….. Network Layer

Getting a datagram from source to dest. forwarding table in router Dest. Net router Nhops interface 223.1.1 - 1 223.1.1.4 223.1.2 - 1 223.1.2.9 223.1.3 - 1 223.1.3.27 misc fields 223.1.1.1 223.1.2.2 data Arriving at 223.1.4, destined for 223.1.2.2 Amelia look up network address of Sonya in forwarding table 223.1.1.1 223.1.2.1 223.1.1.2 Sonya on same network as router’s interface 223.1.2.9 router, Sonya directly attached 223.1.1.4 223.1.2.9 Sonya 223.1.2.2 223.1.1.3 223.1.3.27 link layer sends datagram to 223.1.2.2 inside link-layer frame via interface 223.1.2.9 223.1.3.1 223.1.3.2 Sonya receives datagram Network Layer

Smith Routers Quad Cutter Science Center Neilson Stoddard Seelye UMass MHC Network Layer

32 bit destination IP address IP datagram format IP protocol version number 32 bits total datagram length header length head. len type of service ver length fragmentation “type” of data fragment offset 16-bit identifier flgs max number remaining hops (decremented at each router) time to live upper layer Internet checksum 32 bit source IP address 32 bit destination IP address upper layer protocol Options (if any) E.g. record route taken, specify list of routers to visit. data (variable length, typically a TCP or UDP segment) Network Layer

Recall IP datagram format head. len type of service ver length fragment offset 16-bit identifier flgs time to live upper layer Internet checksum misc fields source IP addr dest data source IP address destination IP address Options (if any) data (variable length, typically a TCP or UDP segment) Network Layer

How Much Overhead with TCP? Consider All overhead up till now: application transport network link physical • Application Layer • Transport Layer • Network Layer *Consider application layer at end, start with transport layer Network Layer

acknowledgement number Transport Layer source port # dest port # 32 bits data (variable length) sequence number acknowledgement number Receive window Urg data pnter checksum F S R P A U head len not used Options (none) 20 bytes of TCP, no options included Network Layer

destination IP address Network Layer head. len type of service ver 20 bytes minimum for IP Datagram Also, no Options Note: our TCP segment header information follows our IP datagram header information length fragment offset 16-bit identifier flgs time to live upper layer Internet checksum source IP address destination IP address Options (none) data (our TCP segment) Network Layer

Total TCP Overhead application 20 bytes of TCP header transport network link physical 20 bytes of TCP header 20 bytes IP Datagram header = 40 bytes + application layer overhead Network Layer

IP Fragmentation & Reassembly network links have MTU (max.transfer size) different link types, different MTUs fragmentation: in: one large datagram out: 3 smaller datagrams large IP datagram divided (“fragmented”) data header one datagram becomes several datagrams “reassembled” only at final destination IP header bits used to identify, the order of fragments reassembly Network Layer

IP Fragmentation and Reassembly Recall the IP Datagram included: ID, Flag, and offset information for fragmentation. ID =7 offset =0 fragflag length =4000 =1 =1500 =1480 =2960 =1040 One large datagram becomes several smaller datagrams Example 4000 byte datagram MTU = 1500 bytes Applet:http://wps.aw.com/wps/media/objects/221/227091/applets/ip/ipfragmentation.html Network Layer

Quiz: Four Questions Q:   Suppose an application generates chunks of 60 bytes of data every second, and each chunk gets encapsulated in a TCP segment and then an IP datagram. What percentage of each datagram will contain application data?  A. 40% B. 20% C. 80% D. 60% Ans: D or 60%, this because we will gain 40bytes more from TCP and IP datagram segments, thus our whole chunk of information is 100bytes, therefore the application we started with or 60bytes is 60/100 or 60%. Network Layer

Are you Challenged Yet? Q: Consider sending a 1300 byte datagram into a link that has an MTU of 500 bytes.  Three fragments are created with offsets 0, 500 1000 Three fragments are created, with offsets 0, 460 and 920. Three fragments are created with offsets 0, 480 and 960.   None of the above ANS: C Network Layer

You have a 50% Chance! Q: With a datagram network layer, each packet    Q: With a datagram network layer, each packet carries the address of the destination host.  (Note: If your answer is incorrect we will have to redo the entire lecture) True False Ans: True Network Layer

Don’t Forget Brigitte’s Lecture Q:The network portion of an IP address is the same for all the hosts on the same IP network.  True False Ans: True Network Layer

Chapter 4 roadmap 4.1 Introduction and Network Service Models 4.2 Routing Principles 4.3 Hierarchical Routing 4.4 The Internet (IP) Protocol 4.4.1 IPv4 addressing 4.4.2 Moving a datagram from source to destination 4.4.3 Datagram format 4.4.4 IP fragmentation 4.4.5 ICMP: Internet Control Message Protocol 4.4.6 DHCP: Dynamic Host Configuration Protocol 4.4.7 NAT: Network Address Translation 4.5 Routing in the Internet 4.6 What’s Inside a Router 4.7 IPv6 4.8 Multicast Routing 4.9 Mobility Network Layer

The Internet Network layer (recap) Host, router network layer functions: Transport layer: TCP, UDP IP protocol addressing conventions datagram format packet handling conventions Routing protocols path selection RIP, OSPF, BGP Network layer forwarding table ICMP protocol error reporting router “signaling” Network layer protocol, commonly known as IP. Network-layer addressing Fields in the datagram Actions taken by routers and end systems on a datagram based on values in these fields. There are 2 versions of Internet Protocol which we will be studying in this class: v4 (today) v6 (chapter 4.7) Path determination component that determines the route a datagram follows from source to destination. In sec 4.2 we saw that routing protocols compute the forwarding tables that are used to route packets through the network. Path determination component in 4.5 Facility to report errors in datagrams Respond to requests for certain network-layer information. Internet Control Message Protocol (ICMP) at the end of this section Link layer physical layer Network Layer Network Layer 4-30 4

ICMP: Internet Control Message Protocol ICMP is used by the following for communication in the network-layer: Hosts Routers Gateways RFC 792 Typically used for error reporting Unreachable host, network, port protocol Echo request/reply (in ping) telnet server IP router telnet client telnet client TCP software Network Layer

32 bit destination IP address IP datagram format 32 bits head. len type of service ver length fragment offset 16-bit identifier flgs time to live upper layer Internet checksum 32 bit source IP address 32 bit destination IP address Options (if any) how much overhead with TCP? 20 bytes of TCP 20 bytes of IP = 40 bytes + app layer overhead data (variable length, typically a TCP or UDP segment) Network Layer

ICMP: Internet Control Message Protocol ICMP messages are carried in IP datagrams, so they are architecturally below IP. ICMP message contain: Type and code field First eight bytes of IP datagram that caused the ICMP message generation Not only for error messaging ping traceroute Type Code description 0 0 echo reply (ping) 3 0 dest. network unreachable 3 1 dest host unreachable 3 2 dest protocol unreachable 3 3 dest port unreachable 3 6 dest network unknown 3 7 dest host unknown 4 0 source quench (congestion control - not used) 8 0 echo request (ping) 9 0 route advertisement 10 0 router discovery 11 0 TTL expired 12 0 bad IP header Network Layer

DHCP: Dynamic Host Configuration Protocol DHCP assigns IP addresses to hosts dynamically. client-server protocol client = newly arriving host wanting to obtain network config info (including IP address) If DHCP server exists, all is good If DHCP server does not exist, DHCP relay agent (typically router) is needed. DHCP relay agent knows address of a DHCP server for that network Client-server protocol (cont) Renew its lease time Allows reuse of addresses Support for mobile users who want to join networks (continued later) Network Layer

DHCP client-server scenario 223.1.2.1 223.1.1.1 server 223.1.1.2 223.1.1.4 223.1.2.9 B 223.1.2.2 arriving DHCP client needs address in this network E 223.1.1.3 223.1.3.27 223.1.3.1 223.1.3.2 Network Layer

DHCP: Dynamic Host Configuration Protocol Overview of DHCP protocol steps DHCP server discovery First task = find DHCP server Send DHCP discover message DHCP server offer(s) DHCP offer message sent back to client address lease time – valid time of IP address (may be renewed) Overview of DHCP protocol steps DHCP request New client will choose among offers and respond with a request message New client echoes config parameters to server it chooses DHCP ACK Server responds with an acknowledgement, confirming configuration parameters Network Layer

DHCP: Dynamic Host Configuration Protocol Network Layer

DHCP client-server scenario DHCP server: 131.229.64.27 arriving client DHCP discover src : 0.0.0.0, 68 dest.: 255.255.255.255,67 yiaddr: 0.0.0.0 transaction ID: 654 DHCP offer src: 131.229.64.27, 67 dest: 255.255.255.255, 68 yiaddrr: 131.229.183.50 transaction ID: 654 Lifetime: 3600 secs DHCP request src: 0.0.0.0, 68 dest:: 255.255.255.255, 67 yiaddrr: 131.229.183.50 transaction ID: 655 Lifetime: 3600 secs time DHCP ACK src: 131.229.64.27, 67 dest: 255.255.255.255, 68 yiaddrr: 131.229.183.50 transaction ID: 655 Lifetime: 3600 secs Network Layer

DHCP: Dynamic Host Configuration Protocol Network Layer

NAT: Network Address Translation rest of Internet local network (e.g., home network) 192.168.0/24 192.168.0.108 192.168.0.1 192.168.0.109 12.222.208.63 192.168.0.110 All datagrams leaving local network have same single source NAT IP address: 12.222.208.63, different source port numbers Datagrams with source or destination in this network have 192.168.0/24 address for source, destination (as usual) Network Layer

NAT: Network Address Translation Motivation: local network uses just one IP address as far as outside word is concerned: no need to be allocated range of addresses from ISP: - just one IP address is used for all devices can change addresses of devices in local network without notifying outside world can change ISP without changing addresses of devices in local network devices inside local net not explicitly addressable, visible by outside world (a security plus). Network Layer

NAT: Network Address Translation 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 Network Layer

NAT: Network Address Translation NAT translation table WAN side addr LAN side addr 1: host 192.168.0.108 sends datagram to www.yahoo.com, 80 2: NAT router changes datagram source addr from 192.168.0.108, 3345 to 12.222.208.63, 5001, updates table 12.222.208.63, 5001 192.168.0.108, 3345 …… …… S: 192.168.0.108, 3345 D: www.yahoo.com, 80 1 192.168.0.108 S: www.yahoo.com, 80 D: 192.168.0.108, 3345 4 S: 12.222.208.63, 5001 D: www.yahoo.com, 80 2 192.168.0.109 10.0.0.4 138.76.29.7 S: www.yahoo.com, 80 D: 12.222.208.63, 5001 3 4: NAT router changes datagram dest addr from 12.222.208.63, 5001 to 192.168.0.108, 3345 3: Reply arrives dest. address: 12.222.208.63, 5001 192.168.0.110 Network Layer

NAT: Network Address Translation 16-bit port-number field: 60,000 simultaneous connections with a single LAN-side address! NAT is controversial: routers should only process up to layer 3 violates end-to-end argument NAT possibility must be taken into account by app designers, eg, P2P applications address shortage should instead be solved by IPv6 Network Layer

NAT Manipulation in the IP datagram translation original head. len type of service head. len type of service ver ver length length fragment offset fragment offset 16-bit identifier flgs 16-bit identifier flgs time to live upper layer Internet checksum time to live upper layer Internet checksum 192.168.0.108:3345 12.222.208.63:5001 www.yahoo.com:80 www.yahoo.com:80 Options (if any) Options (if any) data (variable length, typically a TCP or UDP segment) data (variable length, typically a TCP or UDP segment) Network Layer