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

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

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

Master Course Computer Networks IN2097

CSC 401 Data and Computer Communications Networks

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

Chapter 4: Network Layer

Network Layer: Control/data plane, addressing, routers

Network Layer: Internet Protocol

internet technologies and standards

Router Architecture Overview

CS 3516: Advanced Computer Networks

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

Network layer: Overview. Network Layer Functions

Chapter 4: network layer

COMP211 Chapter 4 Network Layer: The Data Plane

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

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

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

Computer Networking Introduction

CMPE 80N: Introduction to Networking and the Internet

The Network Layer Forwarding Tables and Switching Fabric

RSC Part II: Network Layer 3. IP addressing (2nd part)

CSCE 463/612 Networks and Distributed Processing Spring 2018

Communication Networks ( ) / Fall 2013 The Blavatnik School of Computer Science, Tel-Aviv University. Allon Wagner

Chapter 4 Network Layer: The Data Plane

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

internet technologies and standards

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

Network Layer: Router Architecture, IP Addressing

CSCI Computer Networks Fall 2016

Chapter 4 Network Layer: The Data Plane

CSC 4900 Computer Networks: Network Layer

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

Network Layer PREPARED BY AHMED ABDEL-RAOUF

Chapter 4 Network Layer

Chapter 4 Network Layer: The Data Plane

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

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

IPv4. Christian Grothoff.

Chapter 4 Network Layer: The Data Plane

TDTS06: computer Networks

Network Layer: Data Plane 4-2

Computer Network Fundamentals Spring Week 4 Network Layer Andreas Terzis

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

CSC358 Week 6. Adapted from slides by J.F. Kurose and K. W. Ross. All material copyright J.F Kurose and K.W. Ross, All Rights Reserved

Chapter 4 Network Layer

CS 3516: Advanced Computer Networks

Lecture 4 The Network Layer. Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it

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

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

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

Last time. Wireless link-layer. Introduction. Characteristics of wireless links wireless LANs networking. Cellular Internet access

HY 335 Φροντιστήριο 8 ο

ECE 158A: Lecture 7. Fall 2015

Chapter 4 Network Layer

Routers. Session 12 INST 346 Technologies, Infrastructure and Architecture

Network Layer: Chapter 4. The Data Plane. Computer Networking: A Top Down Approach

Course on Computer Communication and Networks. Lecture 6 Network Layer part 1: Data Plane Chapter 4 (7/e) (6/e Ch4-first part)

Chapter 4 Network Layer: The Data Plane

CS 3516: Computer Networks

3.7 TCP congestion. reliable data transfer. sliding window. Lecture 4: Transport layer III: flow control and congestion control & Network layer I: IP

Chapter 4 Network Layer: The Data Plane

Chapter 4 Network Layer: The Data Plane

Chapter 4 Network Layer

Chapter 4 Network Layer: The Data Plane

Distributed Systems. 7. Network Layer. Werner Nutt

Lecture 16: Network Layer Overview, Internet Protocol

Network layer. Network Layer 4-1. application transport network data link physical. network data link physical. network data link physical

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

Lecture 12: Addressing. CSE 123: Computer Networks Alex C. Snoeren

Lecture 17: Network Layer Addressing, Control Plane, and Routing

Network Layer: DHCP, ICMP, NAT, IPv6

Networking Potpourri: Plug-n-Play, Next Gen

Lecture 12: Aggregation. CSE 123: Computer Networks Alex C. Snoeren

CSC 401 Data and Computer Communications Networks

Δίκτυα Υπολογιστών ΙΙ. Κώστας Μαγκούτης Επίκουρος Καθηγητής Τμήμα Μηχανικών Η/Υ και Πληροφορικής Πανεπιστήμιο Ιωαννίνων

Information Network Systems The network layer. Stephan Sigg

ECE 4450:427/527 - Computer Networks Spring 2017

NETWORK LAYER DATA PLANE

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

CSCD58 WINTER 2018 WEEK 6 - NETWORK LAYER PART 1. Brian Harrington. February 13, University of Toronto Scarborough

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

Internet Technology 3/23/2016

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

EPL606. Internetworking. Part 2a. 1Network Layer

Chapter 4 Network Layer

CSCD 330 Network Programming Spring 2017

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

CS 457 Lecture 11 More IP Networking. Fall 2011

Chapter 4 Network Layer: The Data Plane

CSCI-1680 Network Layer: IP & Forwarding Rodrigo Fonseca

The Network Layer Forwarding Tables and Switching Fabric

Internet Protocol (IP)

CSCI-1680 Network Layer: IP & Forwarding John Jannotti

Introduction to Internetworking

CSCD 330 Network Programming Spring 2018

Lecture 11: IPv6. CSE 123: Computer Networks Alex C. Snoeren. HW 2 due NOW

IP Addresses. IP Addresses

Chapter 4 Network Layer: The Data Plane. Part A. Computer Networking: A Top Down Approach

EP2120 Internetworking/Internetteknik IK2218 Internets Protokoll och Principer

Transcription:

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

The Network Layer! Application: the application (e.g., the Web, Email) Transport: end-to-end connections, reliability Network: routing Link (data-link): framing, error detection Physical: 1 s and 0 s/bits across a medium (copper, the air, fiber) Lecture 21 - Slide 2

Last Class: Network Layer On the Internet, best-effort packet switching is the norm Forwarding: move packets from router s input to appropriate router output: Look up in a table Routing: determine route taken by packets from source to destination: Populating the table Hardware helps with quick forwarding using longest prefix matching. Lecture 21 - Slide 3

Today IP header format Subnets and IP addressing CIDR Route aggregation DHCP: Assigning an IP address to an interface Fragmentation Lecture 21 - Slide 4

IP datagram format IP protocol version number header length (in 32-bit words) type of data max number remaining hops (decremented at each router) upper layer protocol to deliver payload to how much overhead? 20 bytes of TCP 20 bytes of IP = 40 bytes + app layer overhead ver head. len 16-bit identifier time to live type of service upper layer 32 bits flgs length 32 bit source IP address data (variable length, typically a TCP or UDP segment) fragment offset header checksum 32 bit destination IP address options (if any) total datagram length (bytes) for fragmentation/ reassembly e.g. timestamp, record route taken, specify list of routers to visit. Lecture 21 - Slide 5

IP datagram format 32 bits Source endpoint. Final destination endpoint. Addresses must be unique on the network! ver head. len 16-bit identifier time to live type of service upper layer flgs length 32 bit source IP address data (variable length, typically a TCP or UDP segment) fragment offset header checksum 32 bit destination IP address options (if any) Lecture 21 - Slide 6

IP Address (IPv4) A unique 32-bit unsigned integer value Identifies an interface (on a host, on a router, ) Represented in dotted-quad/octet notation 12 34 158 5 00001100 00100010 10011110 00000101 7 Lecture 21 - Slide 7

IP Addresses 2 32 => 4,294,967,296 possible addresses. In the early 80 s, that s a lot! Population was ~4.5 billion. Now not so much. Population > 7 billion. Lecture 21 - Slide 8

IP address: 32-bit identifier for host, router interface interface: connection between host/router and physical link router s typically have multiple interfaces host typically has one or two interfaces (e.g., wired Ethernet, wireless 802.11) IP addresses associated with each interface Network Interfaces 223.1.1.2 223.1.1.1 223.1.1.3 223.1.1.4 223.1.2.9 223.1.3.27 223.1.3.1 223.1.2.1 223.1.2.2 223.1.3.2 223.1.1.1 = 11011111 00000001 00000001 00000001 223 1 1 1 Lecture 21 - Slide 9

Subnets IP address: subnet part - high order bits host part - low order bits 223.1.1.1 223.1.1.2 223.1.1.4 223.1.2.9 223.1.2.1 what s a subnet? device interfaces with same subnet part of IP address can physically reach each other without intervening router On the same link layer 223.1.1.3 223.1.3.27 223.1.3.1 223.1.2.2 subnet 223.1.3.2 network consisting of 3 subnets Lecture 21 - Slide 10

Assigning Addresses IANA Internet Assigned Numbers Authority (Run by Jon Postel until 1988) Now a part of ICANN ARIN: North America RIPE: Europe ICANN: Internet Corporation for Assigned Names and Numbers Manages IP addresses, DNS, resolves disputes Lecture 21 - Slide 11

Who gets an address? How many? Back in the old days, you called up Jon Postel How many addresses do you need? Here you go! I may have rounded a bit. Lecture 21 - Slide 12

Who gets an address? How many? Classful Addressing Class A: 8-bit prefix, 24 bits for hosts (16,777,216) Class B: 16-bit prefix, 16 bits for hosts (65,536) Class C: 24-bit prefix, 8 bits for hosts (256) 00001100 00100010 10011110 00000101 Class A Class B Class C Lecture 21 - Slide 13

CIDR Classless Interdomain Routing Prefix (subnet) length is no longer fixed (Can be division of bits rather than just 8/24, 16/16, and 24/8) Lecture 21 - Slide 14

Why do we give out addresses in CIDR blocks? How many of these statements are true? (Which ones?) It requires fewer resources at routers. It requires fewer resources at end hosts. It reduces the number of block allocations that need to be managed. It better utilizes the IP address space. A 0, B 1, C 2, D 3, E 4 Lecture 21 - Slide 15

Why do we give out addresses in CIDR blocks? How many of these statements are true? (Which ones?) It requires fewer resources at routers (F): requires more resources! It requires fewer resources at end hosts (F): negligible increased state It reduces the number of block allocations that need to be managed (F): increases the number of block allocations It better utilizes the IP address space (T) A 0, B 1, C 2, D 3, E 4 Lecture 21 - Slide 16

CIDR Classless Interdomain Routing Prefix (subnet) length is no longer fixed Address blocks come with a subnet mask Subnet mask written in two ways: Dotted decimal: 255.255.240.0 /20 Both mean: 11111111 11111111 11110000 00000000 /20 Lecture 21 - Slide 17

CIDR Addresses divided into two pieces: Prefix portion (network address) Host portion Given an IP address and mask, we can determine: The prefix (network address) by ANDing The broadcast address by ORing inverted mask Lecture 21 - Slide 18

Network Address (Subnet Address) E.g., 230.8.1.3/18 /18 => mask is 255.255.192.0 11100110 00001000 00000001 00000011 11111111 11111111 11000000 00000000 IP address /18 Subnet mask Lecture 21 - Slide 19

Network Address (Subnet Address) E.g., 230.8.1.3/18 /18 => mask is 255.255.192.0 11100110 00001000 00000001 00000011 11111111 11111111 11000000 00000000 11100110 00001000 00000000 00000000 IP address /18 Subnet mask and the two Network address advertised by router: 230.8.0.0 Lecture 21 - Slide 20

Why might a device care about its Network Address? Answers the question: is the destination on the same subnet as me? Address + subnet mask -> Network address If destination is on same network: Send directly to them Else: Send to gateway router Lecture 21 - Slide 21

Broadcast Address E.g., 230.8.1.3/18 11100110 00001000 00000001 00000011 11111111 11111111 11000000 00000000 00000000 00000000 00111111 11111111 IP address /18 Subnet mask complement of the subnet mask Lecture 21 - Slide 22

Broadcast Address E.g., 230.8.1.3/18 11100110 00001000 00000001 00000011 00000000 00000000 00111111 11111111 IP address complement of the subnet mask Lecture 21 - Slide 23

Broadcast Address E.g., 230.8.1.3/18 11100110 00001000 00000001 00000011 00000000 00000000 00111111 11111111 11100110 00001000 00111111 11111111 IP address complement of the subnet mask OR of the IP address and the complement of the subnet mask Broadcast address: 230.8.63.255 Lecture 21 - Slide 24

Hierarchical Addressing: Route Aggregation Hierarchical addressing allows efficient advertisement of routing information: Organization 0 200.23.16.0/23 Organization 1 200.23.18.0/23 Organization 2 200.23.20.0/23 Organization 7.... Fly-By-Night-ISP Send me anything with addresses beginning 200.23.16.0/20 Internet 200.23.30.0/23 ISPs-R-Us Send me anything with addresses beginning 199.31.0.0/16 Lecture 21 - Slide 25

Hierarchical Addressing: Route Aggregation Send me anything with addresses beginning 200.23.16.0/20 translates to the following: 200 23 16 0 200.23.16.0/20 = 11001000 00010111 00010000 00000000 /20 prefix 200.23.16.0 = 11001000 00010111 00010000 00000000 200.23.31.255 = 11001000 00010111 00011111 11111111 /20 prefix contains the range of IP addresses that match the the first 20 bits, and can have any value for the remaining 12 bits in the range of : [first 20 bits] 0000 00000000 [first 20 bits] 1111 11111111 A total of 2^12 = 4,096 IP addresses /20 Prefix Range represented by the /20 prefix Lecture 21 - Slide 26

What should we do if organization 1 decides to switch to ISPs-R-Us? Organization 0 200.23.16.0/23 Organization 1 200.23.18.0/23 Organization 2 200.23.20.0/23 Organization 7.... Fly-By-Night-ISP Send me anything with addresses beginning 200.23.16.0/20 Internet 200.23.30.0/23 ISPs-R-Us Send me anything with addresses beginning 199.31.0.0/16 Lecture 21 - Slide 27

Route aggregation in Fly-By-Night ISP Fly-By-Night-ISP 200.23.16.0/20 = 11001000 00010111 00010000 00000000 Individual Organizations: All of these organizations IP addresses lie withinfly-by-night s /20 prefix (first 20 bits are the same) they more specifically match on the three more bits to form a /23 prefix (first 23 bits of all IP addresses within their organization are the same). The last 9 (32-23) bits provide 2^9 = 512 unique IP addresses within each organization. /23 prefixes 200.23.16.0/23 = 11001000 00010111 00010000 00000000 200.23.18.0/23 = 11001000 00010111 00010010 00000000 200.23.20.0/23 = 11001000 00010111 00010100 00000000 200.23.30.0/23 = 11001000 00010111 00011110 00000000 Lecture 21 - Slide 28

What should we do if organization 1 decides to switch to ISPs-R-Us? Organization 0 200.23.16.0/23 Organization 1 200.23.18.0/23 Organization 2 200.23.20.0/23 Organization 7.... Fly-By-Night-ISP Send me anything with addresses beginning 200.23.16.0/20 Internet 200.23.30.0/23 ISPs-R-Us Send me anything with addresses beginning 199.31.0.0/16 A. Move 200.23.18.0/23 to ISPs-R-Us (and break up Fly-By-Night s /20 block). B. Give new addresses to Organization 1 (and force them to change all their addresses). C. Some other solution. Lecture 21 - Slide 29

Hierarchical addressing: More Specific Routes ISPs-R-Us has a more specific route to Organization 1 Organization 0 200.23.16.0/23 Organization 2 200.23.20.0/23 Organization 7.... Fly-By-Night-ISP Send me anything with addresses beginning 200.23.16.0/20 Internet 200.23.30.0/23 Organization 1 200.23.18.0/23 ISPs-R-Us Send me anything with addresses beginning 199.31.0.0/16 or 200.23.18.0/23 Lecture 21 - Slide 30

Hierarchical addressing: More Specific Routes ISPs-R-Us has a more specific route to Organization 1 Organization 0 200.23.16.0/23 Longest prefix matching! Organization 2 200.23.20.0/23 Organization 7.... Fly-By-Night-ISP Send me anything with addresses beginning 200.23.16.0/20 Internet 200.23.30.0/23 Organization 1 200.23.18.0/23 ISPs-R-Us Send me anything with addresses beginning 199.31.0.0/16 or 200.23.18.0/23 Router 1 Lecture 21 - Slide 31

Longest Prefix Matching at Router 1 routing algorithm local forwarding table dest address 200.23.16.0/20 = 11001000 00010111 00010000 00000000 199.31.0.0/16 = 11000111 00011111 00000000 00000000 200.23.18.0/23 = 11001000 00010111 00010010 00000000 output link (to Fly-by-Night ISP) (to ISPs-R-Us) (to ISPs-R-Us) Now, when an incoming packet addressed with destination address 200.23.18.5 arrives this address belongs to Organization 1 and the packet will be matched using longest prefix matching and will be routed to ISPs-R-Us rather than the Fly-by-Night ISP. Router 1 Internet Lecture 21 - Slide 32

How does an end host get an IP address? Static IP: hard-coded Windows: control-panel->network->configuration- >tcp/ip->properties UNIX: /etc/rc.config DHCP: Dynamic Host Configuration Protocol: dynamically get address from as server plug-and-play Lecture 21 - Slide 33

DHCP: Dynamic Host Configuration Protocol Goal: allow host to dynamically obtain its IP address from network server when it joins network can renew its lease on address in use allows reuse of addresses support for mobile users who want to join network DHCP overview: host broadcasts DHCP discover msg [optional] DHCP server responds with DHCP offer msg [optional] host requests IP address: DHCP request msg DHCP server sends address: DHCP ack msg Lecture 21 - Slide 34

DHCP client-server scenario DHCP server: 223.1.2.5 DHCP discover src : 0.0.0.0, 68 dest.: 255.255.255.255,67 yiaddr: 0.0.0.0 transaction ID: 654 arriving client DHCP request src: 0.0.0.0, 68 dest:: 255.255.255.255, 67 yiaddrr: 223.1.2.4 transaction ID: 655 lifetime: 3600 secs DHCP offer src: 223.1.2.5, 67 dest: 255.255.255.255, 68 yiaddrr: 223.1.2.4 transaction ID: 654 lifetime: 3600 secs DHCP ACK src: 223.1.2.5, 67 dest: 255.255.255.255, 68 yiaddrr: 223.1.2.4 transaction ID: 655 lifetime: 3600 secs Lecture 21 - Slide 35

DHCP: More than IP Addresses DHCP can return more than just allocated IP address on subnet: address of first-hop router for client (default GW) name and IP address of DNS server(s) subnet mask Lecture 21 - Slide 36

IP Fragmentation, Reassembly Network links have MTU (max transfer size) - largest possible link-level frame Different link types, different MTUs large IP datagram divided ( fragmented ) within net One datagram becomes several datagrams Reassembled only at final destination IP header bits used to identify, order related fragments reassembly fragmentation: in: one large datagram out: 3 smaller datagrams Lecture 21 - Slide 37

IP datagram format 32 bits ver head. len 16-bit identifier time to live type of service upper layer flgs length 32 bit source IP address fragment offset header checksum for fragmentation/ reassembly 32 bit destination IP address options (if any) data (variable length, typically a TCP or UDP segment) Lecture 21 - Slide 38

IP Fragmentation, Reassembly Example: 4000 byte datagram MTU = 1500 bytes length =4000 ID =x fragflag =0 offset =0 one large datagram becomes several smaller datagrams 1480 bytes in data field length =1500 ID =x fragflag =1 offset =0 offset = 1480/8 length =1500 ID =x fragflag =1 offset =185 length =1040 ID =x fragflag =0 offset =370 Lecture 21 - Slide 39

How can we use this for evil? A. Send fragments that overlap. B. Send many tiny fragments, none of which have offset 0. C. Send fragments that, when assembled, are bigger than the maximum IP datagram. D. More than one of the above. E. Nah, networks (and operating systems) are too robust for this to cause problems. Lecture 21 - Slide 40

IP Fragmentation Attacks Lecture 21 - Slide 41

Summary 2 32 addresses is not that many CIDR helps give out finer granularity Divide bits among network and host Longest prefix matching allows blocks to be divded IP supports fragmentation usually bad news These days, most links have common MTU Lecture 21 - Slide 42