CSCI-1680 Network Layer: IP & Forwarding Rodrigo Fonseca

Similar documents
CSCI-1680 Network Layer: IP & Forwarding John Jannotti

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

CSCI-1680 Network Layer: IP & Forwarding Rodrigo Fonseca

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

Vorlesung Kommunikationsnetze

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

Network Layer: Internet Protocol

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

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

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

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

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

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

Network layer: Overview. Network Layer Functions

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

Internet Technology 3/23/2016

CSEP 561 Internetworking. David Wetherall

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

ECE 4450:427/527 - Computer Networks Spring 2017

Where we are in the Course

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

IPv4. Christian Grothoff.

CS 457 Lecture 11 More IP Networking. Fall 2011

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

Introduction to Internetworking

Chapter 4: Network Layer

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

ECE 158A: Lecture 7. Fall 2015

Master Course Computer Networks IN2097

Computer Network Fundamentals Spring Week 4 Network Layer Andreas Terzis

Router Architecture Overview

CS519: Computer Networks. Lecture 2: Feb 2, 2004 IP (Internet Protocol)

ICS 451: Today's plan

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

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

ELEC / COMP 177 Fall Some slides from Kurose and Ross, Computer Networking, 5 th Edition

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

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

Chapter 4 Network Layer

Lecture 11: Fragmentation & Addressing. CSE 123: Computer Networks Stefan Savage

internet technologies and standards

CSCI-1680 Network Layer:

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

CS 356: Computer Network Architectures. Lecture 10: IP Fragmentation, ARP, and ICMP. Xiaowei Yang

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

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

Lecture 17 Overview. Last Lecture. Wide Area Networking (2) This Lecture. Internet Protocol (1) Source: chapters 2.2, 2.3,18.4, 19.1, 9.

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

EP2120 Internetworking/Internetteknik IK2218 Internets Protokoll och Principer

Address Translation. Map IP addresses into physical addresses destination host next hop router

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

Internetworking Part 2

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

Position of IP and other network-layer protocols in TCP/IP protocol suite

Lecture 2: Basic routing, ARP, and basic IP

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

Networking Fundamentals

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

CSC 401 Data and Computer Communications Networks

The Internet Protocol (IP)

Aside: Interaction with Link Layer Computer Networking. Caching ARP Entries. ARP Cache Example

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

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

ELEC / COMP 177 Fall Some slides from Kurose and Ross, Computer Networking, 5 th Edition

Lecture 9: Internetworking

TDTS06: computer Networks

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

IP - The Internet Protocol

CC231 Introduction to Networks Dr. Ayman A. Abdel-Hamid. Internet Protocol Suite

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

IP : Internet Protocol

C14a: Internetworks and The Internet

Network Layer. The Network Layer. Contents Connection-Oriented and Connectionless Service. Recall:

Network Layer. Recall: The network layer is responsible for the routing of packets The network layer is responsible for congestion control

CMPE 80N: Introduction to Networking and the Internet

CSCE 463/612 Networks and Distributed Processing Spring 2018

Chapter 4: outline. 4.5 routing algorithms link state distance vector hierarchical routing. 4.6 routing in the Internet RIP OSPF BGP

End-to-End Communication

COMP/ELEC 429/556 Introduction to Computer Networks

internet technologies and standards

ICS 351: Networking Protocols

The Network Layer Forwarding Tables and Switching Fabric

Network Layer PREPARED BY AHMED ABDEL-RAOUF

Dongsoo S. Kim Electrical and Computer Engineering Indiana U. Purdue U. Indianapolis

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

IP Protocols. ALTTC/Oct

Addressing and Routing

TCP/IP Protocol Suite

Lecture Computer Networks

Prof. Shervin Shirmohammadi SITE, University of Ottawa. Internet Protocol (IP) Lecture 2: Prof. Shervin Shirmohammadi CEG

Internetwork Protocols

Chapter 7. Local Area Network Communications Protocols

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

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

Network and Security: Introduction

Information Network Systems The network layer. Stephan Sigg

Internet Control Message Protocol (ICMP)

The Interconnection Structure of. The Internet. EECC694 - Shaaban

Computer Networking Introduction

TCP /IP Fundamentals Mr. Cantu

Transcription:

CSCI-1680 Network Layer: IP & Forwarding Rodrigo Fonseca Based partly on lecture notes by David Mazières, Phil Levis, John Jannotti

Today Network layer: Internet Protocol (v4) Forwarding Next 2 classes: Routing

Internet Protocol Goal How to connect everybody? New global network or connect existing networks? Glue lower-level networks together: allow packets to be sent between any pair or hosts Wasn t this the goal of switching? Network 1 (Ethernet) H1 H2 H3 H7 R3 H8 Network 2 (Ethernet) R1 Network 4 (point-to-point) R2 H4 Network 3 (FDDI) H5 H6

Inter-networking Challenges Heterogeneity Different addresses Different service models Different allowable packet sizes Scaling Congestion control

How would you design such a protocol? Circuits or packets? Predictability Service model Reliability, timing, bandwidth guarantees Any-to-any Finding nodes: naming, routing Maintenance (join, leave, add/remove links, ) Forwarding: message formats

IP s Decisions Packet switched Unpredictability, statistical multiplexing Service model Lowest common denominator: best effort, connectionless datagram Any-to-any Common message format Separated routing from forwarding Naming: uniform addresses, hierarchical organization Routing: hierarchical, prefix-based (longest prefix matching) Maintenance: delegated, hierarchical

A Bit of History Packet switched networks: Arpanet s IMPs Late 1960 s RFC 1, 1969! Segmentation, framing, routing, reliability, reassembly, primitive flow control Network Control Program (NCP) Provided connections, flow control Assumed reliable network: IMPs Used by programs like telnet, mail, file transfer Wanted to connect multiple networks Not all reliable, different formats, etc

TCP/IP Introduced Vint Cerf, Robert Kahn Replace NCP Initial design: single protocol providing a unified reliable pipe Could support any application Different requirements soon emerged, and the two were separated IP: basic datagram service among hosts TCP: reliable transport UDP: unreliable multiplexed datagram service

An excellent read David D. Clark, The design Philosophy of the DARPA Internet Protocols, 1988 Primary goal: multiplexed utilization of existing interconnected networks Other goals: Communication continues despite loss of networks or gateways Support a variety of communication services Accommodate a variety of networks Permit distributed management of its resources Be cost effective Low effort for host attachment Resources must be accountable

Internet Protocol IP Protocol running on all hosts and routers Routers are present in all networks they join Uniform addressing Forwarding/Fragmentation Complementary: Routing, Error Reporting, Address Translation H1 H8 TCP R1 R2 R3 TCP IP IP IP IP IP ETH ETH FDDI FDDI PPP PPP ETH ETH

IP Protocol Provides addressing and forwarding Addressing is a set of conventions for naming nodes in an IP network Forwarding is a local action by a router: passing a packet from input to output port IP forwarding finds output port based on destination address Also defines certain conventions on how to handle packets (e.g., fragmentation, time to live) Contrast with routing Routing is the process of determining how to map packets to output ports (topic of next two lectures)

Service Model Connectionless (datagram-based) Best-effort delivery (unreliable service) packets may be lost packets may be delivered out of order duplicate copies of packets may be delivered packets may be delayed for a long time It s the lowest common denominator A network that delivers no packets fits the bill! All these can be dealt with above IP (if probability of delivery is non-zero )

IP v4 packet format 0 1 2 3 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 vers hdr len TOS Total Length Identification 0 DM F F Fragment offset TTL Protocol hdr checksum Source IP address Destination IP address Options Data Padding

IP header details Forwarding based on destination address TTL (time-to-live) decremented at each hop Originally was in seconds (no longer) Mostly prevents forwarding loops Other cool uses Fragmentation possible for large packets Fragmented in network if crossing link w/ small frame MF: more fragments for this IP packet DF: don t fragment (returns error to sender) Following IP header is payload data Typically beginning with TCP or UDP header

Other fields Version: 4 (IPv4) for most packets, there s also 6 Header length: in 32-bit units (>5 implies options) 4 bits * 4 bytes = 64KiB max Type of service (won t go into this) Protocol identifier (TCP: 6, UDP: 17, ICMP: 1, ) Checksum over the header

Format of IP addresses Globally unique (or made seem that way) 32-bit integers, read in groups of 8-bits: 128.148.32.110 Hierarchical organization: Assign blocks of contiguous addresses to the same parts of the network All hosts in the same network share the same prefix Networks can have different sizes (different prefix sizes) Addresses have network and host parts

Prefix Notation Significant bits + mask E.g. all nodes which share prefix 128.148.0.0: 16 MSB matter Mask is: 11111111 11111111 00000000 00000000 Or 255.255.0.0 Or /16 Could say 128.148 128.148/16 128.148.0.0/16 128.148.0.0 netmask 255.255.0.0

Obtaining IP Addresses Blocks of IP addresses allocated hierarchically ISP obtains an address block, may subdivide ISP: 128.35.16/20 10000000 00100011 00010000 00000000 Client 1: 128.35.16/22 10000000 00100011 00010000 00000000 Client 2: 128.35.20/22 10000000 00100011 00010100 00000000 Client 3: 128.35.24/21 10000000 00100011 00011000 00000000 Blocks restricted to powers of 2 Global allocation: ICANN, /8 s (ran out!) Regional registries: ARIN, RIPE, APNIC, LACNIC, AFRINIC

Forwarding Tables Exploit hierarchical structure of addresses: need to know how to reach networks, not hosts Network Next Address 212.31.32.* 0.0.0.0 18.*.*.* 212.31.32.5 128.148.*.* 212.31.32.4 Default 212.31.32.1 Keyed by network portion, not entire address Next address should be local: router knows how to reach it directly* (we ll see how soon)

IP Forwarding Table Network Next Address 212.31.32/24 0.0.0.0 18/8 212.31.32.5 128.148/16 212.31.32.4 128.148.128/17 212.31.32.8 0/0 212.31.32.1 Forwarding is done by longest prefix matching More on this later

How does this really work? IP Addresses tell you how to get to a network That is what routers do How to you actually get to a host? You have to use the underlying L2 network!

How does this really work? Subnet mask: 255.255.255.128 Subnet number: 128.96.34.0 128.96.34.15 H1 128.96.34.1 R1 128.96.34.130 Subnet mask: 255.255.255.128 Subnet number: 128.96.34.128 H3 128.96.33.14 128.96.34.129 R2 128.96.33.1 H2 128.96.34.139 Subnet mask: 255.255.255.0 Subnet number: 128.96.33.0 H1-> H2: H2.ip & H1.mask!= H1.subnet => no direct path

Network Subnet Mask Next Address R1 s Forwarding Table 128.96.34.0 255.255.255.128 128.96.34.1 128.96.34.128 255.255.255.128 128.96.34.130 128.96.33.0 255.255.255.0 128.96.34.129 Subnet mask: 255.255.255.128 Subnet number: 128.96.34.0 128.96.34.15 H1 128.96.34.1 R1 128.96.34.130 Subnet mask: 255.255.255.128 Subnet number: 128.96.34.128 H3 128.96.33.14 128.96.34.129 R2 128.96.33.1 H2 128.96.34.139 Subnet mask: 255.255.255.0 Subnet number: 128.96.33.0

Translating IP to lower level addresses or How to reach these local addresses? Map IP addresses into physical addresses E.g., Ethernet address of destination host or Ethernet address of next hop router Techniques Encode physical address in host part of IP address (IPv6) Each network node maintains lookup table (IP->phys)

ARP address resolution protocol Dynamically builds table of IP to physical address bindings for a local network Broadcast request if IP address not in table All learn IP address of requesting node (broadcast) Target machine responds with its physical address Table entries are discarded if not refreshed

ARP Ethernet frame format 0 8 16 31 Hardware type = 1 ProtocolType = 0x0800 HLen = 48 PLen = 32 Operation SourceHardwareAddr (bytes 0 3) SourceHardwareAddr (bytes 4 5) SourceProtocolAddr (bytes 2 3) SourceProtocolAddr (bytes 0 1) TargetHardwareAddr (bytes 0 1) TargetHardwareAddr (bytes 2 5) TargetProtocolAddr (bytes 0 3) Why include source hardware address?

Obtaining Host IP Addresses - DHCP Networks are free to assign addresses within block to hosts Tedious and error-prone: e.g., laptop going from CIT to library to coffee shop Solution: Dynamic Host Configuration Protocol Client: DHCP Discover to 255.255.255.255 (broadcast) Server(s): DHCP Offer to 255.255.255.255 (why broadcast?) Client: choose offer, DHCP Request (broadcast, why?) Server: DHCP ACK (again broadcast) Result: address, gateway, netmask, DNS server

Network Address Translation (NAT) Despite CIDR, it s still difficult to allocate addresses (2 32 is only 4 billion) We ll talk about IPv6 later NAT hides entire network behind one address Hosts are given private addresses Routers map outgoing packets to a free address/port Router reverse maps incoming packets Problems?

Internet Control Message Protocol (ICMP) Echo (ping) Redirect Destination unreachable (protocol, port, or host) TTL exceeded Checksum failed Reassembly failed Can t fragment Many ICMP messages include part of packet that triggered them See http://www.iana.org/assignments/icmpparameters

ICMP message format 0 1 2 3 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 20-byte IP header (protocol = 1 ICMP) Type Code depends on type/code Checksum

Example: Time Exceeded 0 1 2 3 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 20-byte IP header (protocol = 1 ICMP) Type = 11 Code unused Checksum IP header + first 8 payload bytes of packet that caused ICMP to be generated Code usually 0 (TTL exceeded in transit) Discussion: traceroute

Example: Can t Fragment Sent if DF=1 and packet length > MTU What can you use this for? Path MTU Discovery Can do binary search on packet sizes But better: base algorithm on most common MTUs

Coming Up Routing: how do we fill the routing tables? Intra-domain routing: Tuesday, 10/4 Inter-domain routing: Thursday, 10/6

Example # arp -n Address HWtype HWaddress Flags Mask Iface 172.17.44.1 ether 00:12:80:01:34:55 C eth0 172.17.44.25 ether 10:dd:b1:89:d5:f3 C eth0 172.17.44.6 ether b8:27:eb:55:c3:45 C eth0 172.17.44.5 ether 00:1b:21:22:e0:22 C eth0 # ip route 127.0.0.0/8 via 127.0.0.1 dev lo 172.17.44.0/24 dev enp7s0 proto kernel scope link src 172.17.44.22 metric 204 default via 172.17.44.1 dev eth0 src 172.17.44.22 metric 204