Routers and the IP Addressing Principle

Slides:



Advertisements
Similar presentations
Network Layer – Routing 2 Dr. Sanjay P. Ahuja, Ph.D. Fidelity National Financial Distinguished Professor of CIS School of Computing, UNF.
Advertisements

Computer Networks with Internet Technology William Stallings
CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 22 Introduction to Computer Networks.
CCNA 2 v3.1 Module 6.
CSEE W4140 Networking Laboratory Lecture 4: IP Routing (RIP) Jong Yul Kim
Network Layer Design Isues Store-and-Forward Packet Switching Services Provided to the Transport Layer The service should be independent of the router.
Routing.
Routing Algorithms (Ch5 of Computer Network by A. Tanenbaum)
Interior Gateway Protocols: RIP & OSPF
SAvPS – úvod Genči 2009 (bsaed on Tanenbaum’s slides.
1 Pertemuan 20 Teknik Routing Matakuliah: H0174/Jaringan Komputer Tahun: 2006 Versi: 1/0.
1 Computer Communication & Networks Lecture 22 Network Layer: Delivery, Forwarding, Routing (contd.)
Routing and Routing Protocols Routing Protocols Overview.
M.Menelaou CCNA2 ROUTING. M.Menelaou ROUTING Routing is the process that a router uses to forward packets toward the destination network. A router makes.
Routing -2 Dynamic Routing
1 Routing. 2 Routing is the act of deciding how each individual datagram finds its way through the multiple different paths to its destination. Routing.
 A packet does not know how to get to its destination  Must rely on the routers to send it in the right direction  So how do the routers do that?
Network Layer4-1 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.3 What’s inside a router r 4.4 IP: Internet.
Chi-Cheng Lin, Winona State University CS 313 Introduction to Computer Networking & Telecommunication Chapter 5 Network Layer.
1 Internet Routing. 2 Terminology Forwarding –Refers to datagram transfer –Performed by host or router –Uses routing table Routing –Refers to propagation.
TCOM 509 – Internet Protocols (TCP/IP) Lecture 06_a Routing Protocols: RIP, OSPF, BGP Instructor: Dr. Li-Chuan Chen Date: 10/06/2003 Based in part upon.
CCNA 2 Week 6 Routing Protocols. Copyright © 2005 University of Bolton Topics Static Routing Dynamic Routing Routing Protocols Overview.
1 Computer Communication & Networks Lecture 21 Network Layer: Delivery, Forwarding, Routing Waleed.
ICS 156: Networking Lab Magda El Zarki Professor, ICS UC, Irvine.
1 Version 3.1 Module 6 Routed & Routing Protocols.
Teknik Routing Pertemuan 10 Matakuliah: H0524/Jaringan Komputer Tahun: 2009.
1 7-Jan-16 S Ward Abingdon and Witney College Dynamic Routing CCNA Exploration Semester 2 Chapter 3.
ITI-510 Computer Networks ITI 510 – Computer Networks Meeting 3 Rutgers University Internet Institute Instructor: Chris Uriarte.
Routing Algorithms and IP Addressing Routing Algorithms must be ▪ Correctness ▪ Simplicity ▪ Robustness ▪ Stability ▪ Fairness ▪ Optimality.
Routing Protocols Brandon Wagner.
1 © 2004, Cisco Systems, Inc. All rights reserved. CCNA 1 Module 10 Routing Fundamentals and Subnets.
Spring 2000CS 4611 Routing Outline Algorithms Scalability.
1 © 2004, Cisco Systems, Inc. All rights reserved. CCNA 2 v3.1 Module 8 TCP/IP Suite Error and Control Messages.
Assignment 1  Chapter 1:  Question 11  Question 13  Question 14  Question 33  Question 34  Chapter 2:  Question 6  Question 39  Chapter 3: 
Routing and Routing Protocols CCNA 2 v3 – Module 6.
+ Dynamic Routing Protocols 2 nd semester
Dynamic routing Routing Algorithm (Dijkstra / Bellman-Ford) – idealization All routers are identical Network is flat. Not true in Practice Hierarchical.
Network Layer Routing Networks: Routing.
Network Layer COMPUTER NETWORKS Networking Standards (Network LAYER)
Network Layer.
Kapitel 19: Routing. Kapitel 21: Routing Protocols
Working at a Small-to-Medium Business or ISP – Chapter 6
Dynamic Routing Protocols II OSPF
Semester 3, Chapter 5 Allan Johnson
CMPT 371 Data Communications and Networking Routing in the Internet
(How the routers’ tables are filled in)
21-2 ICMP(Internet control message protocol)
Routing and Routing Protocols: Routing Static
Dynamic routing Routing Algorithm (Dijkstra / Bellman-Ford) – idealization All routers are identical Network is flat. Not true in Practice Hierarchical.
ICMP ICMP – Internet Control Message Protocol
COMP 3270 Computer Networks
Chapter 6 Delivery & Forwarding of IP Packets
Network Layer.
CCNA 2 v3.1 Module 6 Routing and Routing Protocols
THE NETWORK LAYER.
Intra-Domain Routing Jacob Strauss September 14, 2006.
Dynamic routing Routing Algorithm (Dijkstra / Bellman-Ford) – idealization All routers are identical Network is flat. Not true in Practice Hierarchical.
Routing.
Routing and Routing Protocols: Routing Static
Dynamic Routing Protocols II OSPF
Kuliah 5 ROUTING.
Dynamic Routing and OSPF
PRESENTATION COMPUTER NETWORKS
Network Layer Routing Networks: Routing.
Delivery, Forwarding, and Routing
Working at a Small-to-Medium Business or ISP – Chapter 6
Routing and the Network Layer (ref: Interconnections by Perlman
Network Layer.
Routing.
Dynamic routing Routing Algorithm (Dijkstra / Bellman-Ford) – idealization All routers are identical Network is flat. Not true in Practice Hierarchical.
Presentation transcript:

Routers and the IP Addressing Principle Each router is assigned two or more IP addresses one address for each network to which the router attaches To understand why, recall two facts: A router has connections to multiple physical networks Each IP address contains a prefix that specifies a physical network A single IP address does not suffice for a router because each router connects to multiple networks and each network has a unique prefix The IP scheme can be explained by a principle: An IP address does not identify a specific computer each address identifies a connection between a computer and a network A computer with multiple network connections (e.g., a router) must be assigned one IP address for each connection 1 1

Multi-homed Hosts: Routers and the IP Addressing Principle 2 2

The Internet Control Message Protocol (ICMP) Provides control messaging among the routers to monitor the operation of the Internet Messages are encapsulated in IP packets DESTINATION UNREACHABLE TIME EXCEEDED PARAMETER PROBLEM SOURCE QUENCH (reduce speed) REDIRECT ECHO REQUEST ECHO REPLY TIMESTAMP REQUEST TIMESTAMP REPLY 3

Internet Control Message Protocol The principal ICMP message types. 5-61 4

IP Routing A packet does not know how to get to its destination Must rely on the routers to send it in the right direction So how do the routers do that?

Routing Information Exchange A router can't possibly know where everything in the world is: it is only connected to a handful of neighbour routers How can a router in Izmir know that to send a packet to Tokyo it might have to forward it to America first? Routers exchange information with each other to find the best possible route to a destination

Complexity of Routing Architecture Two types of routing structures Autonomous System (AS): Local routing within an organisation (requiring an interior gateway protocol)‏ Global (non-local) routing between organisations (AS’s) (requiring an exterior gateway protocol)‏

Autonomous Network Architecture

Static Routing within an AS Interior Gateway Protocols Requires static route added by hand, e.g., the route command route add default gw 213.121.147.69 adds a default route to a gateway with IP address 213.121.147.69 Routing tables on most non-routers are trivial and set up manually by the operating system at boot time

Problem with static route entry ICMP Redirect Sometimes routing tables are not perfectly set up H1 wants to send to H2 but H1's routing table tells it to route via R2

ICMP Redirect cont’d When the packet reaches R2, it sees it should be routed out on the interface it came in on: so R2 knows H1's table need improving R2 forwards the packet and send an ICMP redirect to H1

ICMP Redirect cont’d H1 gets the redirect and uses it to update its routing table. Next time H1 will be able to route directly to R1

Dynamic Routing Protocols ICMP redirects are OK for small fixes, but in general routers need something more substantial Could let administrators to set up the tables? Better to get the routers to do it themselves Dynamic routing is the passing of routing information between routers

Implemented Protocols Several protocols are used Routing Information Protocol (RIP)‏ Open Shortest Path First (OSPF)‏ Border Gateway Protocol (BGP)‏ Many more Each protocol is suited to a certain purpose, no single protocol fits all

Dynamic Routing Protocols Internet is managed as a collection of Autonomous Systems (AS), each administered by a single entity, e.g., a University or company Each AS chooses a routing protocol to direct packets within the AS: these are interior gateway protocols (IGP), e.g., RIP or OSPF Between ASs run exterior gateway protocols (EGP), e.g., BGP

Router Structure

Distance-Vector and Link-State Routing Algorithms Distance-Vector and Link-State Routers can collect all kinds of information about who is connected to whom and in what manner: this must be condensed down to something that can be put in a routing table Two main algorithms are used: distance-vector protocols link-state protocols

Routing Algorithms Distance-vector gathers collections (vectors) of hop counts (distances) from its neighbouring routers to selected destinations. From this it computes its own vector of distances. RIP is an example Link-state gathers maps of connectivity from all the routers in the AS (or some subset) and uses this to compute its own map. OSPF is an example

Distance-Vector vs Link-State Routing Algorithms Distance-Vector vs Link-State Distance-vector is simple, but has problems Link-state is more complex, but has advantages

Routing Information Protocol: RIP When a router starts it broadcasts a RIP request on all its interfaces with address family 0 and metric 16: this is a “send me all your routes” request A router receiving such a request replies with its vector of distances

RIP Otherwise a request is for a route to a particular address or addresses A reply is a metric for a route, or 16 to indicate infinity or “no route” Given a reply we can update our routing table: our metric is the received metric plus 1 for the hop to the router that replied

RIP If a new route with a smaller metric than an existing route we can update our table to use the new route: RIP always deems shorter paths to be better RIP also sends a chunk of the routing table every 30 seconds to its neighbours: routes are timed out if they are not confirmed within x minutes

RIP A timed-out route is set to metric 16, but not deleted for 60 seconds: this ensures the invalidation is propagated

RIP R3 knows a route to H with metric 1 R3 sends a RIP message to R2, R2 learns a route to H via R3 with metric 2 R2 sends a message to R1, R1 learns a route to H via R2 with metric 3

RIP Note that R2 sends a message to R3, too, so R3 learns there is a route to H via R2 with metric 3 But R3 can ignore this as it already knows a better route

Updating of Vector Distance tables

RIP Problems RIP has problems, in particular the long time (several minutes) it takes to readjust after a route is added or removed somewhere: the slow convergence, or count to infinity problem

Link up Propagation A is initially down and comes up. The good news spreads relatively quickly. A is down

The count-to-infinity problem: Link Down Propagation A is up Bad news spread slowly.

RIP Problems Cont’d Another problem is that RIP is not suitable for use between ASs as it is ignorant of subnetting and possibly discloses too much about the internal structure of the AS As RIP uses broadcast a router only gets information from its immediate neighbours and this makes getting a global view of the network difficult

RIP Problems Cont’d The metric limit of 15 is not big enough for larger networks: making it bigger only makes the count to infinity worse The only criterion for choice of route is the metric: this is much too simplistic. Other considerations including network speed, bandwidth and cost should be taken into account

Open Shortest Path First:OSPF The Open Shortest Path First protocol is mainly based on the Dijkstra's shortest path first Algorithm

Dijkstra’s Algorithm This is a method for finding best paths through a network, where “best” means “shortest” or “lowest cost” or whatever you want to measure It is used in several routing protocols

Dijkstra's Algorithm We want to find the shortest/cheapest path between V and Z, where costs are as given We make a table of paths, containing a predecessor to a node and a cost to get to that node. Also mark each node determined or undetermined

Dijkstra's Algorithm Initialise all costs to ∞, predecessors to blank and all nodes undetermined Initialise the cost of the starting node V to 0 While there are any undetermined nodes: pick an undetermined node of lowest cost; call it C mark C determined for each undetermined neighbour N of C if cost to C + cost N to C < cost to N we have found a shorter path to N via C; make the cost of N be cost to C + cost N to C and the predecessor of N to be C

Dijkstra's Algorithm Determined nodes are those for which we definitely know the best route; Undetermined nodes are those for which we need to find a better (shorter/cheaper) route

Dijkstra's Algorithm Pick cheapest undetermined node: V Make it determined and consider its neighbours W, X and Z All have infinite cost, so make their predecessors V and adjust their costs

Dijkstra's Algorithm Pick cheapest undetermined node: W Make it determined, and consider its undetermined neighbours X and Y Cost to X via W is 2+1<4, so revalue X; cost to Y via W is 2+1<∞, so revalue Y

Dijkstra's Algorithm Pick cheapest undetermined node: X (or Y)‏ Make it determined and consider its undetermined neighbour Z Cost to Z via X is 3+2<7 so revalue Z

Dijkstra's Algorithm Pick cheapest undetermined node: Y Make it determined and consider its undetermined neighbour Z Cost to Z via Y is 3+3>5 so don't revalue Z

Dijkstra's Algorithm Pick cheapest undetermined node: Z Make it determined. It has no undetermined neighbours so we are done

Dijkstra's Algorithm Final costs: So cheapest path from V to Z is of cost 5 Also have computed cheapest paths from V to every other node

ROUTING ALGORITHMS Software responsible for deciding which output line an incoming packet should be transmitted on Datagram Routing decision at every node VC Routing decision at the setup phase Computer Networks 1 TANENBAUM

Routing Algorithms The Optimality Principle Shortest Path Routing Flooding Distance Vector Routing Link State Routing Hierarchical Routing Broadcast Routing Multicast Routing Routing for Mobile Hosts Routing in Ad Hoc Networks Computer Networks 1 TANENBAUM

Routing Algorithm Properties Correctness Simplicity Robustness What happens if the topology changes? Stability Must converge to an equilibrium Fairness Optimality Minimize mean packet delay Maximize total network throughput Computer Networks 1 TANENBAUM

Classes of Routing Algorithms Nonadaptive algorithms Route is computed in advance and stored in the router This is called static routing Adaptive algorithms Base their decision on current measurement of traffic and topology Computer Networks 1 TANENBAUM

Shortest Path Routing Treat routers as nodes Assign weights to links E.g. Fix all weight to 1 to minimize the number of hops crossed Use distance in kilometers as weight to minimize delay Use Dijkstra’s algorithm to determine the shortest path Computer Networks 1 TANENBAUM

Dijkstra’s Algorithm 1 Computer Networks 1 TANENBAUM

Dijkstra’s Algorithm 2 Update least cost paths Initialize T = {s} set of nodes incorporated (s source) L(n)=w(i,j) for ns initial path costs to neighbors Get next node Add the neighbor x not in T that has least cost L(x) to s. Add the edge from this neighbor to old T that contributes to the path Update least cost paths For all nT, update costs by L(n)=min[L(n),L(x)+w(x,n)] Computer Networks 1 TANENBAUM

Dijkstra’s Algorithm 1 5-8 top Computer Networks 1 TANENBAUM

Dijkstra’s Algorithm 2 5-8 bottom Computer Networks 1 TANENBAUM

Flow-Based Routing Takes load into account Needs Topology Load on the lines Capacity of the lines Given the load and capacity, delay of the line can be computed via queueing theory T = 1 / (C - ) where 1/ is mean packet size in bits C is line capacity in bps  mean flow in packets per second Computer Networks 1 TANENBAUM

Link State Routing Distance vector routing Did not take line bandwidth into account Took too long to converge Link state routing: Each router Discovers its neighbors. Measures the delay or cost to each of its neighbors. Constructs a packet telling all it has just learned. Sends this packet to all other routers in the vicinity. Computes the shortest path to every other router.

Learning about the Neighbors When a rooter is booted, it sends HELLO packet to all of its neighbors Neighbors reply by sending their globally unique names.

Measuring Line Cost Each router should know an estimate of delay to each of its neighbors To estimate the delay, a router can send an echo packet to its neighbor and measure the time when it receives it back While measuring time, it is possible to include or exclude the time the echo packet spends on the queues which corresponds to consider load on the line Including load may cause oscillations in the algorithm

A subnet in which the East and West parts are connected by two lines. Measuring Line Cost A subnet in which the East and West parts are connected by two lines. Computer Networks 1 TANENBAUM

Building Link State Packets Packets contain Identity of the sender Sequence number Age List of neighbors and delays delays to them Packets canbe issued Periodically or When a significant event occurs

Building Link State Packets 2 (a) A subnet. (b) The link state packets for this subnet. Computer Networks 1 TANENBAUM

Distributing the Link State Packets Flooding is used Packet sequence numbers are used to discard duplicates or old packets by holding packets for a short while before flooding them 32-bit sequence numbers are used to prevent wrap-arounds For each packet, in addition to sequence number, age is used and decremented every second to solve Router crash problem Corrupted sequence number problem

Flooding Every incoming packet is sent out on every outgoing line except the one it arrived on Generates vast number of duplicate packets Solutions Put a hop counter to every packet Avoid flooding the same packet second time Needs packet sequence numbers Use selective flooding Do not put the packet to every outgoing line, instead put the packet to certain outgoing lines

Distributing the Link State Packets 2 The packet buffer for router B shown in slide 58

Computing the New Routes When a router accumulates a full set of link state packets, it can construct the entire network graph It then runs Dijkstra’s algorithm to construct shortest paths to all possible destinations Even for a large subnet, the memory requirements are reasonable Protocols using link state routing OSPF and IS-IS

Link-state Data Structure // Link-state packet header: The basic data structure of link-state // routing algo rithm // ACK of sender is set, SEND of receiver flag is set! typedef struct lsp { char ip[15]; char in_ip[15]; char out_ip[15]; bool SEND, ACK; long seqNo; int age; int dist; struct lsp* next; struct lsp* komsu; } linkState;

Link-state Append Incoming Packet // Needed for building link-state packet tables void appendNewcomer(linkState *ls){ if(inList == NULL){ inList = ls; ls_tail = ls; }else{ ls_tail->next = ls; } ls_tail->next = NULL;

Handle Incoming Packet void newComer(linkState *nc) { linkState *p = inList; // inList points head of the incoming packets while (p != NULL ) { // First handle duplicated link state packets: discrad the older one // keep the younger packets in the newcomer list. if (strcmp(nc->ip,p->ip) && (nc->seqNo == p->seqNo)) { // Age near zero is considered older and will be discarded if (nc->age >= p->age); // The greater the age the younger the packet! p->age = nc->age; // copy the new comer's age and keep the older. } else appendNewcomer(nc); // The new comer is added to the incoming list p = p->next;

Flooding Algorithm void flood(linkState *new_comer){ // inList-> head of the incoming packets linkState *inList, *np; inList = ls_major; removeOldies(); // Delete aged packets if (inList !=NULL) { // If list is not empty np = inList->komsu; while (np != NULL) { //Incoming packet is from neighbor's source if (checkFlooder(new_comer, np) == false) { // Sender is not the same as the np! if (isUp(np->ip) == true) { // Neighbor is up, now set the SEND flag for it // before flooding to it np->SEND=true; forward(new_comer,np); // Forward) this packet to neighbor } np = np->next;

Removing Old Links State Packets void removeOldies(){ linkState *tp; linkState *p = inList; // Age zero is considered old and packets with zero age will be discarded while (p !=NULL) { if (p->age <= 0) { tp = p; p = p->next; // Goto next PACKET to check delete (tp); // delete the old packet } else p = p->next;

Is the floder One of the Neighbor? /************************************************************* * Before flooding to neighbors we need to make sure * not to send the same packet back to its sender ************************************************************/ bool checkFlooder(linkState *new_comer, linkState *that) { // that points to the neighbor of the sender. // new_comer is the packet just arrived if (strcmp(new_comer->ip,that->ip)) { new_comer->ACK = true; Acknowledge(new_comer->ip) // Ack the sender return true; } return false;