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

Similar documents
CS4/MSc Computer Networking. Lectures 6-8 The network layer: Forwarding, Routing, IP and Internet routing protocols

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

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

Router Architecture Overview

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

Last time. Transitioning to IPv6. Routing. Tunneling. Gateways. Graph abstraction. Link-state routing. Distance-vector routing. Dijkstra's Algorithm

Chapter 4: Network Layer

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

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

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

internet technologies and standards

Networking: Network layer

EEC-684/584 Computer Networks

Network Layer PREPARED BY AHMED ABDEL-RAOUF

Internet Routing Protocols, DHCP, and NAT

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

Chapter 4: network layer

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

Basic Idea. Routing. Example. Routing by the Network

Network layer: Overview. Network Layer Functions

Routing by the Network

CSCE 463/612 Networks and Distributed Processing Spring 2018

UNIT III THE NETWORK LAYER

CSCE 463/612 Networks and Distributed Processing Spring 2018

Initial motivation: 32-bit address space soon to be completely allocated. Additional motivation:

Chapter 4 Network Layer. Network Layer 4-1

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

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

COMP211 Chapter 4 Network Layer: The Data Plane

CSc 450/550 Computer Networks Internet Routing

Chapter 4: Network Layer, partb

Master Course Computer Networks IN2097

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

Routing Unicast routing protocols

ETSF05/ETSF10 Internet Protocols. Routing on the Internet

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

Topics for This Week

ETSF05/ETSF10 Internet Protocols Routing on the Internet

Chapter 4: Network Layer

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

Routing. Jens A Andersson Communication Systems

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

Network Layer: Control/data plane, addressing, routers

EEC-484/584 Computer Networks

Internetworking Part 2

internet technologies and standards

Network Layer: Internet Protocol

TDTS06: computer Networks

Unit 3: Dynamic Routing

Chapter 4 Network Layer

The Interconnection Structure of. The Internet. EECC694 - Shaaban

Internet Technology 3/23/2016

CS118 Discussion Week 7. Taqi

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

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

CS 457 Networking and the Internet. Shortest-Path Problem. Dijkstra s Shortest-Path Algorithm 9/29/16. Fall 2016

Chapter 4: outline. Network Layer 4-1

EECS 122, Lecture 16. Link Costs and Metrics. Traffic-Sensitive Metrics. Traffic-Sensitive Metrics. Static Cost Metrics.

Chapter 4: Network Layer

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

Chapter 4: Advanced Internetworking. Networking CS 3470, Section 1

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

CSCI-1680 Network Layer: IP & Forwarding John Jannotti

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

CSCI-1680 Network Layer: IP & Forwarding Rodrigo Fonseca

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

Computer Network Fundamentals Spring Week 4 Network Layer Andreas Terzis

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

Review for Chapter 4 R1,R2,R3,R7,R10,R11,R16,R17,R19,R22,R24, R26,R30 P1,P2,P4,P7,P10,P11,P12,P14,P15,P16,P17,P22,P24,P29,P30

Network layer: Overview. Network layer functions Routing IP Forwarding

Chapter 4 Network Layer

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

To contain/reduce broadcast traffic, we need to reduce the size of the network (i.e., LAN).

The Network Layer Forwarding Tables and Switching Fabric

Computer Networking Introduction

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

Lecture 19: Network Layer Routing in the Internet

Routing. Advanced Computer Networks: Routing 1

Internet Routing Protocols Tuba Saltürk

Network Layer: Router Architecture, IP Addressing

Chapter 4: Network Layer. Lecture 12 Internet Routing Protocols. Chapter goals: understand principles behind network layer services:

CSC 4900 Computer Networks: Routing Protocols

Routing. Outline. Algorithms Scalability

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

Information Network Systems The network layer. Stephan Sigg

Inter-AS routing. Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley

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

ECE 428 Internet Protocols (Network Layer: Layer 3)

CSC 4900 Computer Networks: Network Layer

CMPE 80N: Introduction to Networking and the Internet

Lecture 16: Network Layer Overview, Internet Protocol

CS555, Spring /5/2005. April 12, 2005 No classes attend Senior Design Projects conference. Chapter 4 roadmap. Internet AS Hierarchy

CS 43: Computer Networks Internet Routing. Kevin Webb Swarthmore College November 16, 2017

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

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

COMPUTER NETWORK. Homework #3. Due Date: May 22, 2017 in class

CSC 401 Data and Computer Communications Networks

Open Shortest Path First (OSPF)

Computer Networking Introduction

Chapter 4 Network Layer: The Data Plane

Transcription:

CS4/MSc Computer Networking Lecture 4 The network layer: Forwarding, Routing, IP and Internet routing protocols Computer Networking, Copyright University of Edinburgh 2005

Network layer services External view: services the network provides to the transport layer Connection-oriented with quality of service guarantees Connectionless Note that there is no choice; it s one or the other Internal view: the physical interconnection topology of the network How are packets transferred datagrams or virtual circuits Congestion control and flow control (topic of future lecture) Addressing and routing procedures Two major functions Forwarding (or switching) move packet to the right out-port of router Routing determine the correct/best next router for each destination 2

The Switching Function Dynamic interconnection of inputs to outputs Enables dynamic sharing of transmission resources Two fundamental approaches: Connectionless Connection-Oriented: Call setup control, Connection control 3

Message Switching Message Message Message Source Message Switches Destination Entire messages multiplexed onto shared lines, relayed from switch to switch in store-and-forward fashion Headers for source & destination addresses 4

Message Switching Delay Source T Switch 1 τ Switch 2 t t t Destination Delay High utilisation of the transmission line Delay over multiple hops can be long: Whole message has to be received before it can be transmitted on Minimum delay = 3τ + 3T, assuming equal speed lines and no queueing delay Probability of transmission error also increases with length of the block More retransmissions required for correct delivery (for each link) t 5

Packet Switching (datagram) Messages broken into smaller units (packets) Source & destination addresses in each packet header Connectionless, packets routed independently (datagram) Packets may arrive out of order and may follow different routes Pipelining of packets across network can reduce delay, increase throughput Packet 2 Packet 1 Packet 2 Packet 1 Packet 2 Lower delay than message switching, suitable for interactive traffic 6

Packet-Switching Delay Source Switch 1 Switch 2 τ 1 2 3 1 2 3 1 2 3 Destination 3 hops L hops 3τ + 2(T/3) first bit received Lτ + (L-1)P first bit received t t t t 3τ + 3(T/3) first bit released Lτ + LP first bit released 3τ + 5 (T/3) last bit released Lτ + LP + (k-1)p last bit released where T = k P 7

Packet-Size Eventually the delay due to the transmission of the header in each packet will reverse the speed-up gained by using ever-smaller packet sizes figure from Stallings, Data & computer communications 7e 8

Switching operation in connectionless networks At each switch the (final) destination address is extracted from the header and used in a look-up table to determine the forwarding output port Routing table has an entry for each destination Size of table becomes impractical for very large number of destinations Hierarchical addressing scheme used Routing tables updated dynamically when network failures occur Adjacent routers periodically share link status information Therefore datagram switching is robust 9

Connection-Oriented Packet Switching: Virtual Circuits Packet Packet Packet Packet Virtual circuit Call set-up phase sets ups routers in fixed path along network All packets for a connection follow the same path Variable bit rates possible, negotiated during call set-up Delays variable, cannot be less than circuit switching A release procedure required to terminate the session 10

Connection Setup Connect request Connect confirm SW 1 Connect request Connect confirm SW 2 SW n Connect request Connect confirm Signaling messages propagate as route is selected Signaling messages identify connection and setup tables in switches Typically a connection is identified by a local tag, Virtual Circuit Identifier (VCI) Each switch only needs to know how to relate an incoming tag in one input to an outgoing tag in the corresponding output Once tables are setup, packets can flow along path Data packet headers are shorter than with datagram switching 11

Virtual-Circuit Packet-Switching Delay Connect request CR CR CC CC Connect confirm 1 2 3 1 2 3 1 2 3 Release t t t t Connection setup delay is incurred before any packet can be transferred Delay is acceptable for sustained transfer of large number of packets This delay may be unacceptably high if only a few packets are being transferred 12

Cut-Through Switching Source Switch 1 Switch 2 Destination 1 2 3 1 2 3 1 2 3 Minimum delay = 3τ + T t t t t Some networks perform error checking on header only, so packet can be forwarded as soon as header is received & processed Delays reduced further with cut-through switching Error control for the payload is left for higher layer protocols To be successful, header needs to be processed quickly. Mostly used in VC switching 13

Router Architecture Overview 14

Input Port Functions Physical layer: bit-level reception Data link layer: e.g., Ethernet Decentralized switching: given datagram dest., lookup output port using forwarding table in input port memory goal: complete input port processing at line speed queuing: if datagrams arrive faster than forwarding rate into switch fabric 15

Three types of switching fabrics 16

Output Ports Buffering required when datagrams arrive from fabric faster than the transmission rate Scheduling discipline chooses among queued datagrams for transmission 17

Input Port Queuing Fabric slower than input ports combined -> queueing may occur at input queues Head-of-the-Line (HOL) blocking: queued datagram at front of queue prevents others in queue from moving forward Queueing delay and loss due to input buffer overflow! 18

Inter-networking IP packets transfer information across internet Host A IP router router router Host B IP IP layer in each router determines next hop (router) Network interfaces transfer IP packets across networks Host A Transport Layer Internet Layer Network Interface Router Internet Layer Network Interface Net Net 51 Router Internet Layer Net Net 54 Network Net Net 52 Net Net 53 Interface Router Internet Layer Network Interface Host B Transport Layer Internet Layer Network Interface 19

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 data (variable length, typically a TCP or UDP segment) length fragment offset Internet checksum 32 bit source IP address 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. 20

Fragmentation and Reassembly Each physical link imposes a maximum size of transmission unit (MTU) e.g. ethernet 1500 bytes, FDDI 4464 bytes IP may have to break a large packet into smaller fragments Each fragment is sent independently, as though it were an IP packet Any router may need to fragment packets to smaller sizes again IP Source Router Destination IP Network Network The destination IP is the only entity that reassembles fragments into the original packet 21

Fragmentation and Reassembly Operation To reassemble a packet Destination waits until all the fragments have been received If any fragment is lost, the whole original packet is abandoned» Lost fragments detected by using a time-out following arrival of first fragment Identification field in IP header shows which packet a fragment belongs to» Source must not reuse an identification value for a sufficiently long period Flag bits :» DF : don t fragment - if packet is longer than MTU for next hop, discard and send error message» MF : more fragments follow this one Offset field : measures the offset in the packet of this fragment in units of eight bytes (all fragments must be multiples of 8, except the last) Performance: fragment loss means retransmission of all packet fragments again Could be done more efficiently with selective retransmission 22

IP Addresses Each host is assigned a unique 32-bit IP address : Network ID + Host ID or multiple IP addresses for hosts with multiple interfaces Host ID allocated locally by network administrator or DHCP Network IDs allocated by RIPE (Réseaux IP Européens) NCC (Network Coordination Centre) in Amsterdam for Europe, Middle East & North Africa One of three Regional Internet Registries: ARIN (Americas), APNIC (Asia Pacific)» Allocation of blocks of IP addresses to Local Internet Registries e.g. ISPs - who further allocate them to their users Routers only need to route packets on basis of the Network ID part» reduces size of routing tables Five address classes : A to E with distinct prefixes» Class D used for multicast services to a group of hosts simultaneously» Class E reserved for experiments 23

Subnets portion of a network sharing a particular subnet address subnet 223.1.1.0/24 subnet 223.1.2.0/24 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 Subnet mask (a 32-bit combination which describes which portion of address refers to the subnet and which to the host Masks out the hostid part of the address e.g. 255.255.255.0 223.1.1.1 223.1.1.2 223.1.2.1 223.1.1.4 223.1.2.9 223.1.1.3 223.1.3.27 223.1.2.2 223.1.3.1 223.1.3.2 subnet 223.1.3.0/24 24

Classless Inter-Domain Routing (CIDR) Essentially applies the idea of subnetting to the network ID part of the address An arbitrary prefix length indicates the network number Address format: a.b.c.d/x, where x is # bits in subnet portion of address e.g. 205.100.0.0/22 indicates a prefix of 22 bits 172.16.0.0.255.255.0.0 represented as 172.16.0.0/16, i.e. the number of left-most contiguous mask bits that are set to one. Allows aggregation of a number of contiguous network addresses into a single entry in a routing table (supernetting) Assuming the next hop router is common Requires that a longest prefix match search scheme be used IP addresses have to be allocated using policies to capitalise on this capability e.g. reflecting the physical hierarchical topology of the network continents use a short prefix, countries slightly longer etc. 25

Classless Inter-Domain Routing (CIDR) Each domain takes its IP address from a higher level hierarchical internet architecture This allows for the summarisation of the domains to be done at higher level ISP owns network 172.16.0.0/16 ISP can offer 172.16.1.0/24, 172.16.2.0/24 and so on. To customers When advertising to other providers, ISP need only advertise 172.16.0.0/16 26

Network Address Translation IP addresses can be re-used in separate internal sub-internetworks Each internal sub-network lives behind a NAT-enabled gateway/router Registered IP addresses used outside the gateway to connect to public network» assigned by the usual authorities as normal A set of unregistered IP addresses is used in the private local network» a range of addresses are set aside for this re-use by the authority Hosts on the local network communicate using local unregistered addresses Packets outgoing to the public network have their local IP addresses translated to registered external IP addresses by the gateway and vice versa 27

Dynamic NAT example 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 28

NAT limitations 16-bit port-number field: 60,000 simultaneous connections with a single LAN-side address. Not bad! 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 29

Dynamic Host Configuration Protocol (DHCP) Provides a method for dynamically assigning temporary IP addresses Also allows clients to acquire IP configuration parameters they need» e.g. subnet mask, broadcast IP address, default router etc. Based on BOOTP protocol, runs on top of UDP (client port 67, server 68) How can you use UDP if you don t know your own IP address? Temporarily use 0.0.0.0; host identified by network (e.g. ethernet) address An ISP allocates IP addresses from its assigned set on a per-use basis IP addresses leased for a time from a limited pool Address can be re-used for another client at a later time 30

DHCP Operation Host broadcasts DHCP Discover message on its physical network Server replies with Offer message (IP address + configuration information) Host selects one offer and broadcasts DHCP Request message Server allocates IP address for lease time T Sends DHCP ACK message with T, and threshold times T1 (=1/2 T) and T2 (=.875T) At T1, host attempts to renew lease by sending DHCP Request message to original server If no reply by T2, host broadcasts DHCP Request to any server If no reply by T, host must relinquish IP address and start from the beginning 31

IP version 6 Introduced to address shortcomings of IPv4 and emerging applications Designed to interoperate with IPv4 during transition period Main features: Longer addresses 128 bits Simpler header format e.g. no header length or fragmentation fields Options provided by more flexible extension headers Flow label capability to identify a packet flow that needs certain QoS Security : supports authentication Large packets : jumbo packets longer than 64Kb Fragmentation at source only: intermediate routers not allowed to fragment No checksum field» Typically physical layers perform error detection» higher layers too 32

IPv6 Header Format 0 4 12 16 24 31 Version Traffic Class Flow Label Payload Length Next Header Version : 6 for IPv6 Traffic class : priority of packet; zero means best-effort intended to support differentiated services still experimental Flow label : source desires special handling of this flow of packets assigned by the source pseudo-randomly flow requirements specified by a control protocol or within the packets also still experimental Source Address Destination Address Payload length : length of data excluding the header; larger packet though extension header option Next header : Type of next header: extension or payload Hop limit : replaces TTL field in IPv4; now means what it says! Source and destination addresses : 128 bits Hop Limit 33

IPv6 Addressing Address Types Unicast : denote a single host the normal understanding of IP address Multicast : a multicast enabled host can join a multicast address group Anycast : like multicast with groups of hosts but only one host gets the packet typically the closest host» Share the same address space as multicast addresses Hexadecimal notation Groups of 16 bits represented by 4 hex digits, separated by colons: 4BF5:AA12:0216:FEBC:BA5F:039A:BE9A:2176 Hierarchical provider-based i.e. ISP, unicast addresses : n bits m bits o bits p bits (125-m-n-o-p) bits 010 Registry ID Provider ID Subscriber ID Subnet ID Interface ID IPv6 must be backwards compatible with IPv4 to be interoperable e.g. IPv4-compatible IPv6 addresses:» 96 bits of zeroes followed by 32 bits of IPv4 address 34

IPv6 Extension Headers An arbitrary number of daisy-chained headers to provide extra options Each header has a type field describing what the next header is for Extension headers processed in order of appearance Basic header Next header = routing Routing header Next header = fragment Fragment header Next header = authentication Authentication header Next header = TCP TCP segment Basic header Next header = TCP TCP segment Extension header types: Large jumbo packets» Packet size declared in basic header is replaced with this Fragmentation header» Fragmentation ID, fragment offset, etc Routing header» source routing i.e. the sequence of routers to be visited by each packet 35

Migration from IPv4 to IPv6 Gradual transition from IPv4 to IPv6 Dual IP stacks: routers run both IPv4 & IPv6 Type field used to direct packet to IP version IPv6 islands can tunnel across IPv4 networks Encapsulate user packet inside IPv4 packet Tunnel endpoint at source host, intermediate router, or destination host Tunneling can be recursive Source Tunnel head-end Tunnel tail-end Destination Tunnel (a) IPv6 network IPv6 header IPv4 network IPv4 header IPv6 network 36

37

Routing in Packet Networks An objective function needed to determine the best route e.g. minimum number of hops, minimum end-to-end delay, path with greatest available bandwidth etc. Algorithms should seek certain goals: Rapid and accurate routing Adaptability to network topology changes» due to switch or link failures» must be able to quickly reconfigure routing tables Adaptability to varying loads» must be able to reconfigure best according to the current loads Ability to route packets away from temporarily congested links» load balancing over links desirable Ability to determine connectivity of the network Low overhead of control message interchange between routers 38

Classification of routing strategies Centralised routing Single special host calculates shortest paths between all pairs of hosts Distributed routing Each router does a part of the job Static routing Dynamic (or adaptive) routing Routes change as a result of changes in the network 39

Shortest-Path Algorithms Each link is associated with a cost value calculated using a cost function Packet delay, congestion, link capacity, Distance vector routing (e.g. Bellman-Ford algorithm) Neighbouring routers exchange list of distances to destinations Routers process this to find better routes through the neighbour and adapt to changes in the network topology as information percolates through the network Link state routing (e.g. Dijkstra algorithm) Each router broadcasts information about the state of its links to neighbours and other routers pass this information on further Each router can therefore construct a map of the entire network and derive a routing table 40

Dijkstra s Algorithm Input: the network graph with edges annotated with costs Iteratively find the next closest node from the source let D i be the current minimum cost from source to node i let C ij be the cost of the path from node i to node j Initialisation: N = {s} Find next closest node: Update minimum costs: D j = C sj j s ( = if no direct connection) D s = 0 find node i N such that D i = min D j, j N add i to N if N contains all nodes, stop for each node j N, D j = min { D j, D i + C ij } 41

Bellman-Ford Algorithm Initially, distance to self is 0, to all other destinations Each node i periodically broadcasts its vector of costs { D i1, D i2, D i3 } to its neighbours When an update is received, a node compares the minimum cost to each destination and selects the corresponding neighbour as the next hop: D ij = min { C ik + D kj } k i +Good news travel fast - Bad news don t (count to infinity problem) 42

Comparison of LS and DV algorithms Message complexity LS: with n nodes, E links, O(nE) msgs sent DV: exchange between neighbors only convergence time varies Speed of Convergence LS: O(n 2 ) algorithm requires O(nE) msgs may have oscillations DV: convergence time varies may be routing loops count-to-infinity problem Robustness: what happens if router malfunctions? LS: DV: node can advertise incorrect link cost each node computes only its own table DV node can advertise incorrect path cost each node s table used by others» error propagate thru network 43

Specialised Routing - Flooding Each switch forwards incoming packets to all ports except the one the packet was received from Packet reaches the destination with minimum number of hops Unfortunately flooding may swamp the network with an exponentially increasing number of packets Useful when routing information not available or when survivability is required (e.g. MANETS: mobile ad-hoc networks) Effective when source needs to broadcast to all hosts in the network Flood control: A time-to-live field set to some small number, decremented at each switch and the packet discarded when the count reaches zero Each switch adds its identifier to the packet header before it floods When a switch receives a packet, it records the source address and the sequence number 44

Hierarchical routing in the Internet The Internet is a collection of Autonomous Systems (AS) Sets of routers and networks each administered by a single organisation Stub AS : single connection to outside world Transit AS : has connections to more than one other AS Allows itself to be used for transit traffic and needs its own ASN Most large ISP s are transit AS s Multihomed AS : has multiple AS connections but does not allow through traffic Routing protocols Interior Gateway Protocol (IGP)» within an AS Exterior Gateway Protocol (EGP)» communication among ASs Intra-AS Routing algorithm Forwarding table Inter-AS Routing algorithm 45

Routing Information Protocol (RIP) IGP protocol based on the distance-vector Bellman-Ford algorithm With split-horizon poisoned reverse Runs on top of UDP port number 520 Distance metric is the number of hops Maximum number of hops limited to 15 i.e. the diameter of the network must be no greater than 15 16 is regarded as infinity Small infinity number limits the count to infinity problem RIP is not flexible in choice of metric e.g. cannot take account of network load conditions RIP-2 offers improvements: Packets carry a variable-length subnet mask allows CIDR to work and an authentication procedure for trusting distance vectors from other routers 46

RIP (v1) Operation RIP router sends an update message to its neighbours every 30 seconds The neighbours can then recalculate their shortest paths Router expects to receive an update message from each of its neighbours at least once every 180 seconds Allows more than 30 seconds since UDP is unreliable If a router does not receive an update within the time limit, it assumes the link to its neighbour has failed Sets the corresponding cost to 16 (infinity) This can be replaced with a correct value if the neighbour eventually responds or another route to it is found Convergence of shortest paths can be slow when topology changes Triggered updates can improve this» update its neighbours immediately rather than wait for next update time 47

Open Shortest Path First (OSPF) Specification in RFC 2328 IGP protocol based on link-state methods, using Dijkstra s algorithm Link-state is monitored and flooded to other routers Routers learn the complete network topology: each has an identical link-state database They can apply a shortest path algorithm locally to find optimal routes Link-state database is kept up to date when changes occur and periodically (30min) Designed to be better and much more flexible than RIP Converges to a stable state faster Allows different optimal routes to be calculated for different types of service Allows load balancing over paths of equal cost 48

Hierarchical OSPF Two-level hierarchy: local area, backbone Link-state advertisements only in area each node has detailed area topology; only know direction (shortest path) to nets in other areas Area border routers: summarize distances to nets in own area, advertise to other Area Border routers Backbone routers: run OSPF routing limited to backbone. Boundary routers: connect to other AS s 49

OSPF Operation Phase 1 : neighbours are discovered using the Hello protocol Router periodically broadcasts a hello packet onto each of its interfaces When a router receives a hello packet, it replies with a hello packet containing the ID of each neighbouring router it knows about Originating router sees a hello packet with its own ID, it knows there is a working bidirectional link between it and the sending router Hello protocol also elects designated routers and backup designated routers for multiaccess networks Phase 2 : Establishment of adjacencies and database synchronisation Routers are chosen to become adjacent=keep link-state data synchronised Link State Advertisement (LSA) headers are exchanged using database description packets A neighbour can then request the full LSA database entry if it does not have it or it is out-of-date 50

OSPF Operation (cont) Phase 3 : Maintenance and updating the database A router wanting to update its link state database can send a link state request to its neighbour When a router has a change to propagate, it can update its neighbours with a link state update packet containing (full) LSAs When a router receives an update packet» It sends an acknowledgment» Updates its database» Propagates the information by flooding: forwards the LSAs to all its neighbours except the one it came from OSPF routers are obliged to refresh their LSAs every 30 minutes 51

Border Gateway Protocol BGP Pairs of routers (BGP peers) exchange routing info over TCP connections BGP sessions do not correspond to physical links. When AS2 advertises a prefix to AS1, AS2 is promising it will forward any datagrams destined to that prefix towards the prefix. AS2 can aggregate prefixes in its advertisement An internal BGP distributes the new info to AS s routers 3c 3a 3b AS3 1a AS1 1c 1d 1b 2a 2c 2b AS2 ebgp session ibgp session 52

Distributing reachability info With ebgp session between 3a and 1c, AS3 sends prefix reachability info to AS1. 1c can then use ibgp do distribute this new prefix reach info to all routers in AS1 1b can then re-advertise the new reach info to AS2 over the 1b-to-2a ebgp session When router learns about a new prefix, it creates an entry for the prefix in its forwarding table. 3c 3a 3b AS3 1a AS1 1c 1d 1b 2a 2c 2b AS2 ebgp session ibgp session 53

Path attributes & BGP routes When advertising a prefix, advert includes BGP attributes prefix + attributes = route advert Two important attributes: AS-PATH: contains the ASs through which the advert for the prefix passed: AS 67 AS 17 NEXT-HOP: Indicates the specific internal-as router to next-hop AS. (There may be multiple links from current AS to next-hop-as) Only path changes (new, withdrawn) are exchanged When gateway router receives route advert, uses import policy to accept/decline 54

Why different Intra- and Inter-AS routing? Policy: Inter-AS: admin wants control over how its traffic routed, who routes through its net. Intra-AS: single admin, so no policy decisions needed Scale: Hierarchical routing saves table size, reduced update traffic Performance: Intra-AS: can focus on performance Inter-AS: policy may dominate over performance 55

Reading list LGW 7 7.5 Tanenbaum 5 5.2.6 Stallings 10.6, 12 56

EGP routing tasks Suppose router in AS1 receives datagram for which dest is outside of AS1 Router should forward packet towards one of the gateway routers, but which one? 3c 3a 3b AS3 1a 1c 1d 1b AS1 needs: 1. to learn which dests are reachable through AS2 and which through AS3 2. to propagate this reachability info to all routers in AS1 Job of inter-as routing! AS1 2a 2c AS2 2b 57