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

Similar documents
Lecture 5 The Network Layer part II. Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it

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

Network layer: Overview. Network Layer Functions

Network Layer: Internet Protocol

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

Master Course Computer Networks IN2097

Router Architecture Overview

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

Chapter 4: Network Layer

internet technologies and standards

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

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

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

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

Chapter 4 Network Layer

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

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

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

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

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

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

CSCI Computer Networks Fall 2016

Network Layer PREPARED BY AHMED ABDEL-RAOUF

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

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

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

Chapter 4 Network Layer. Network Layer 4-1

CMPE 80N: Introduction to Networking and the Internet

Chapter 4: Network Layer

internet technologies and standards

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

Module 3 Network Layer CS755! 3-1!

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

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

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

Chapter 4: Network Layer

Computer Networking Introduction

Network layer functions

CSCE 463/612 Networks and Distributed Processing Spring 2017

Topics for This Week

TDTS06: computer Networks

Chapter 4: network layer

Network layer Network Layer 4-1

CSC 401 Data and Computer Communications Networks

IPv4. Christian Grothoff.

Internet Protocol: Routing Algorithms. Srinidhi Varadarajan

Why dynamic route? (1)

Network Layer: Control/data plane, addressing, routers

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

CS118 Discussion 1A, Week 6. Zengwen Yuan Dodd Hall 78, Friday 10:00 10:50 a.m.

CSCD 330 Network Programming Spring 2018

CSCE 463/612 Networks and Distributed Processing Spring 2018

CSCD 330 Network Programming Spring 2017

Chapter 4: Network Layer

COMP211 Chapter 4 Network Layer: The Data Plane

CS 3516: Advanced Computer Networks

Announcement. Project 2 extended to 2/20 midnight Project 3 available this weekend Homework 3 available today, will put it online

Chapter 4: Network Layer. Chapter 4 Network Layer. Chapter 4: Network Layer. Network layer. Chapter goals:

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

Network Layer: Routing. Routing. Routing protocol. Graph abstraction for routing algorithms: graph nodes are routers graph edges are physical links

Lecture 19: Network Layer Routing in the Internet

Different Layers Lecture 20

Antonio Cianfrani. Routing Protocols

Summary Chapter 4. Smith College, CSC 249 March 2, q IP Addressing. q DHCP dynamic addressing

CSC 401 Data and Computer Communications Networks

Chapter 4 Network Layer: The Data Plane

Announcements. CS 5565 Network Architecture and Protocols. Project 2B. Project 2B. Project 2B: Under the hood. Routing Algorithms

Network Routing. Packet Routing, Routing Algorithms, Routers, Router Architecture

Telematics I. Chapter 7 Network Layer

CS 3516: Computer Networks

Department of Computer Science Southern Illinois University Carbondale

EE 122: Intra-domain routing

Network Layer. CMPS 4750/6750: Computer Networks

UNIT III THE NETWORK LAYER

Chapter 4: Network Layer, partb

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

Chapter 4 Network Layer: The Data Plane

Network layer: Overview. Network layer functions Routing IP Forwarding

Announcements. CS 5565 Network Architecture and Protocols. Count-To-Infinity. Poisoned Reverse. Distance Vector: Link Cost Changes.

Chapter 4 Network Layer

Lecture 16: Network Layer Overview, Internet Protocol

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

5.1 introduction 5.5 The SDN control 5.2 routing protocols plane. Control Message 5.3 intra-as routing in Protocol the Internet

Chapter 4 Network Layer

The Interconnection Structure of. The Internet. EECC694 - Shaaban

CSC 4900 Computer Networks: Network Layer

CSC 4900 Computer Networks: Routing Algorithms

Chapter 4: Network Layer

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

Exercise Sheet 4. Exercise 1 (Routers, Layer-3-Switches, Gateways)

Network Technology 1 5th - Network Layer. Mario Lombardo -

CSC 4900 Computer Networks: Routing Protocols

Internetworking Part 2

Chapter 5 Network Layer: The Control Plane

Computer Networks ICS 651. IP Routing RIP OSPF BGP MPLS Internet Control Message Protocol IP Path MTU Discovery

CS4/MSc Computer Networking. Lecture 4 The network layer: Forwarding, Routing, IP and Internet routing protocols

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

CSc 450/550 Computer Networks Internet Routing

Information Network Systems The network layer. Stephan Sigg

Transcription:

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

Network layer functions Transport packet from sending to receiving hosts Network layer protocols in every host, router three important functions: Addressing: association to each device of a unique ID application transport network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical Path determination: route taken by packets from source to dest. Routing algorithms Fragmentation: splitting of network layer packets (and successive merging) due to Link Layer protocol constraint. network data link physical network data link physical network data link physical application transport network data link physical

The Internet Network layer Host, router network layer functions: Transport layer: TCP, UDP Network layer Routing protocols path selection RIP, OSPF, BGP routing table IP protocol addressing conventions datagram format IP fragmentation ICMP protocol error reporting router signaling Link layer physical layer

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

IP Addressing: introduction 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 interface, not host, 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.3.27 223.1.2.2 223.1.3.2 223.1.1.1 = 11011111 00000001 00000001 00000001 223 1 1 1

IP Addressing: the structure 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.1.3 223.1.3.1 223.1.3.27 223.1.2.2 Network (LAN) 223.1.3.2 network consisting of 3 IP networks (for IP addresses starting with 223, first 24 bits are network address)

IP Addressing: the netmask The network mask (netmask) is a 32 bits string used to identify the network part of an IP address. The netmask also defines the number of IP addresses available for a given network IP_Address= Net_Id. Host_Id Netmask = 1111.11. 00.000 Example: first 24 bits are network address Netmask = 1111111.11111111.11111111.00000000 255.255.255.0 /24 n of IP addresses = 2 8 = 256

IP Addresses: classfull classfull addressing: class A B C 0 network host 10 network host 110 network host 1.0.0.0 to 127.255.255.255 128.0.0.0 to 191.255.255.255 192.0.0.0 to 223.255.255.255 D 1110 multicast address 32 bits 224.0.0.0 to 239.255.255.255 The netmask information is coded into the first byte of the IP address

IP addressing: CIDR classfull 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: the netmask information must be specified! address format: a.b.c.d/x, where x is # bits in network portion of address network part 11001000 00010111 00010000 00000000 200.23.16.0/23 host part

IP addresses: host configuration Hosts (host portion): hard-coded by system admin in a file (manual configuration) DHCP: Dynamic Host Configuration Protocol: dynamically get address: plug-and-play host broadcasts DHCP discover msg DHCP server responds with DHCP offer msg host requests IP address: DHCP request msg DHCP server sends address: DHCP ack msg

IP addressing: assignment Network portion: get allocated portion of ISP s address space: How does an ISP get block of addresses? ICANN: Internet Corporation for Assigned Names and Numbers 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

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

IP Fragmentation & Reassembly network links have MTU (max.transfer unit) - 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

IP Fragmentation and Reassembly MTU = 1500 Byte Offset: The fragments are numbered on the basis of the position of their first data byte in the original packet Counted in blocks of 8 bytes ( fragment length must be a multiple of 8) Three fragments: - 1480 Byte (offset=0) - 1480 Byte (offset= 1480/8) - 1020 Byte (offset= 2960/8) length =4000 ID =x length =1500 length =1500 length =1040 fragflag =0 ID =x ID =x ID =x offset =0 fragflag =1 fragflag =1 fragflag =0 offset =0 offset =185 offset =370

Private IP addresses Problem: there are not enough IP addresses to be assigned to all Internet devices Introduction of private IP addresses: to be used only in the private networks (RFC 1918)

Private IP addresses Advantages No need to request public IP addresses for many devices (not all!) Reduction of public IP addresses Security improvement: real devices IP addresses hidden Drawbacks: Extra-load for access routers Breaking of the layers separation rule NAT: Network Address Translation protocol IPv6: IP addresses of 128 bit

NAT NAT router: a local interface and a public interface. The public interface has a public IP address (assigned by an ISP). The single public IP address will allow all hosts of the private network to connect to Internet. NAT operation: modifying IP header (source or destination IP address) and using port numbers. Private Network Public Network 192.168.10.0/24 NAT Router 192.168.10.2 192.168.10.254 209.235.168.3 Internet 192.168.10.3

NAT Private Network Public Network 192.168.1.2 SP 1024 SA 192.168.1.2 NAT SP 55001 SA 209.235.168.3 Internet 192.168.1.3 SA = Source IP Address SP = Source Port Inside Local IP Address & port NAT Table Inside Global IP Address & port 151.100.37.12:80 SERVER HTTP 192.168.1.2:1024 192.168.1.3:1723 209.235.168.3:55001 209.235.168.3:55002

IP packet forwarding IP router actions to be performed for each incoming packet: reading the IP destination field of the incoming packet; looking at the IP routing table to find the longest prefix matching for the IP destination address; detecting the next-hop router toward the destination; forwarding the packet toward the proper outgoing interface; 1 2 3 IP IP

The IP routing table is present in all network routers and hosts Routing information about known destination networks Each row is dedicated to a specific destination network and contains the following fields: IP routing table N, the IP destination network M, the destination netmask NH, the IP address of the first router (the next-hop router) in the path toward the destination I, the outgoing interface to reach the destination The Longest Prefix Matching rule is used: Given D as the IP destination address, for each row i the following operation is performed: If [D AND M(i)] = N then Matching(i)=M(i) The rule having the greatest Matching(i) value is used to forward the packet

IP routing table Rete 11.0.0.0/8 11.0.0.5 20.0.0.5 20.0.0.6 Tabella di instradamento di R2 130.11.0.6 213.2.97.7 eth0 Rete Rete R1 20.0.0.0/8 R2 R3 130.11.0.0/16 eth1 130.11.0.7 213.2.98.12 Rete 213.2.97.0/24 INTERNET Rete 213.2.98.0/24 Destinazione N Maschera M Next hop NH Interfaccia I 20.0.0.0 255.0.0.0 d.c. (20.0.0.6) eth0 130.11.0.0 255.255.0.0 d.c. (130.11.0.6) eth1 11.0.0.0 255.0.0.0 20.0.0.5 eth0 213.2.97.0 255.255.255.0 130.11.0.7 eth1 213.2.98.0 255.255.255.0 130.11.0.7 eth1 0.0.0.0 0.0.0.0 130.11.0.7 eth1

Static and dynamic routing Routing tables are computed/configured on the basis of network paths: Static Routing (configuration performed by network administrator); Dynamic Routing (exchange of control packets among routers Routing Protocols). Static Routing: manual configuration; not scalable; (very) slow to react to network changes.

Autonomous System An Autonomous System (AS) is a portion of Internet (routers and networks) managed by a single administrative entity An AS is identified by means of a 16 bit string (AS number) A routing protocol in each AS (chosen by the network administrator) A single routing protocol for the path computation among ASes (agreement) Routing protocol classification: 1) Distance Vector vs Link State 2) Intra-AS vs Inter-AS

Intra-AS and Inter-AS routing a Host h1 C.b AS13 b a d c b Intra-AS routing within AS 3 AS 3 A.a Inter-AS routing between AS3 and AS 88 A.c B.a Host c h2 a b AS 88 Intra-AS routing within AS 88

Routing Routing protocol Goal: determine good path (sequence of routers) thru network from source to dest. Graph abstraction for routing algorithms: graph nodes are routers graph edges are physical links link cost: delay, $ cost, or congestion level A 1 2 5 B D 2 3 1 3 good path: C E 1 5 2 F typically means minimum cost path other def s possible

Routing Algorithm classification Global or local network knowledge? Global: all routers have complete topology, link cost info Link State algorithm Local: router knows physically-connected neighbors, link costs to neighbors iterative process of computation, exchange of info with neighbors Distance Vector algorithms

A Link-State Routing Algorithm Dijkstra s algorithm network topology, link costs known to all nodes Flooding mechanism All nodes have same info computes least cost paths from one node ( source ) to all other nodes gives routing table for that node iterative: after k iterations, know least cost path to k dest. s Notation: c(i,j): link cost from node i to j. cost infinite if not direct neighbors D(v): current value of cost of path from source to dest. V p(v): predecessor node along path from source to v, that is next v N: set of nodes whose least cost path definitively known

Dijsktra s Algorithm 1 Initialization: 2 N = {A} 3 for all nodes v 4 if v adjacent to A 5 then D(v) = c(a,v) 6 else D(v) = infty 7 8 Loop 9 find w not in N such that D(w) is a minimum 10 add w to N 11 update D(v) for all v adjacent to w and not in N: 12 D(v) = min( D(v), D(w) + c(w,v) ) 13 /* new cost to v is either old cost to v or known 14 shortest path cost to w plus cost from w to v */ 15 until all nodes in N

Dijkstra s algorithm, discussion Algorithm complexity: n nodes O(n**2) more efficient implementations possible: O(nlogn) Re-computation: The whole algorithm must be executed if a network change happens: Link cost change Link failure/insertion Node failure/insertion

Distance Vector Routing Algorithm distributed: each node communicates only with directly-attached neighbors iterative: continues until no nodes exchange info. self-terminating: no signal to stop asynchronous: nodes need not exchange info/iterate in lock step! Distance Table data structure each node has its own row for each possible destination column for each directlyattached neighbor to node example: in node X, for dest. Y via neighbor Z: X D (Y,Z) = = distance from X to Y, via Z as next hop Z c(x,z) + min {D (Y,w)} w

Internet Routing Protocols Intra-AS, also known as Interior Gateway Protocols (IGP) RIP: Routing Information Protocol Distance Vector Link cost equal to 1 hop count OSPF: Open Shortest Path First Link State Link cost inversely proportional to its bandwidth Inter-AS, also known as Exterior Gateway Protocols (EGP) BGP: Border Gateway Protocol Path Vector protocol (the entire path is notified) Path: list of ASes crossed

ICMP: Internet Control Message Protocol used by hosts, routers, gateways to communication network-level information error reporting: unreachable host, network, port, protocol echo request/reply (used by ping and traceroute) network-layer above IP: ICMP msgs carried in IP datagrams ICMP message: type, code plus first 8 bytes of IP datagram causing error 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

Exercise Subnetting from 192.168.0.0/24 Routing table of B pc-net 100 host A x-net-1 20 host B Link-1 Link-3 ws-net 50 host Link-2 INTERNET C