Presentation is loading. Please wait.

Presentation is loading. Please wait.

Malathi Veeraraghavan (originals by Jörg Liebeherr) 1 Link State Routing Algorithm Use a routing protocol to collect the whole network topology Obtain.

Similar presentations


Presentation on theme: "Malathi Veeraraghavan (originals by Jörg Liebeherr) 1 Link State Routing Algorithm Use a routing protocol to collect the whole network topology Obtain."— Presentation transcript:

1 Malathi Veeraraghavan (originals by Jörg Liebeherr) 1 Link State Routing Algorithm Use a routing protocol to collect the whole network topology Obtain destination reachability information as well as link weights/states Compute shortest paths using Dijkstra’s algorithm from a node to all other nodes Construct routing tables that show the destination addresses and the next hop addresses Note that while Dijkstra’s algorithm gives you end-to-end routes, the routing tables may only store the next hop address.

2 Malathi Veeraraghavan (originals by Jörg Liebeherr) 2 Shortest path calculations Calculate shortest paths for node s to all other nodes Dijkstra’s Algorithm: s source node. D n cost of the least-cost path from node s to node n M = {s}; for each n  M D n = d sn ; while (M  all nodes) do Find w  M for which D w = min{D j ; j  M}; Add w to M; for each n  M D n = min w [ D n, D w + d wn ]; Update route; enddo

3 Malathi Veeraraghavan (originals by Jörg Liebeherr) 3 Example Assume node 1 has obtained the entire network topology using some link state routing protocol Construct the routing table at node 1 using Dijkstra’s algorithm to determine shortest paths from node 1 to all other nodes in the network

4 Malathi Veeraraghavan (originals by Jörg Liebeherr) 4 Example (at node 1) IterationMD 1 D 2 D 3 D 4 D 5 D 6 Init

5 Malathi Veeraraghavan (originals by Jörg Liebeherr) 5 Solution Use Dijkstra’s algorithm described in slide 2 Start with M consisting of only node 1.

6 Malathi Veeraraghavan (originals by Jörg Liebeherr) 6 Resulting Routing Tree The tree is translated into a routing table at node 1: Destination Next Hop 22 34 44 54 64

7 Malathi Veeraraghavan (originals by Jörg Liebeherr) 7 Link State Discussion Each node requires complete topology information. Link state Information must be flooded to all nodes. Guaranteed to converge. Each node must maintain a global database. Convergence of the algorithm is guaranteed.

8 Malathi Veeraraghavan (originals by Jörg Liebeherr) 8 IP Routing IP Forwarding is performed by IP (in OS kernel) IP Routing is performed by a user-level process In Unix, by the daemon processes routed and gated

9 Malathi Veeraraghavan (originals by Jörg Liebeherr) 9 IP Routing

10 Malathi Veeraraghavan (originals by Jörg Liebeherr) 10 Routing Table Lookup For each IP packet, there is one routing table lookup. 1. Find matching host address 2. Find matching network address 3. Find default entry Routing table printout with netstat -rn Example: DestinationGateway Flags RefcntUse Interface 140.252.23.32 140.252.23.1UGH 325000 emd0 127.0.0.1 127.0.0.1UH 10 lo0 default 140.252.13.33UG 00 emd0

11 Malathi Veeraraghavan (originals by Jörg Liebeherr) 11 Explanation of the printout Flags: –U: route is up –G: route is to a gateway (router); if flag is not set, destination is directly connected –H: route is to a host, I.e., destination address is the complete host address; if flag is not set, route is to a network and destination address is netID or subnetID –D: route created by redirect –M: route modified by redirect Refcnt: reference count: number of active uses of each route; for each TCP connection passing through route, this is increased by 1 Use: number of packets sent on route Interface: local interface

12 Malathi Veeraraghavan (originals by Jörg Liebeherr) 12 Statically Setting IP Routing Tables There are several ways for setting IP routing tables without a routing protocol (=Static Routing) 1. Automatic creation of entry during initialization of a local interface (with ifconfig ) 2. During bootstrap with route command 3. Via ICMP redirect messages 4. Via ICMP router advertisement/router discovery messages

13 Malathi Veeraraghavan (originals by Jörg Liebeherr) 13 Route Command Route commands are put in a system file that is read during system bootstrap System file is: /etc/rc2.d/S69inet in Solaris, /etc/netstart in FreeBSD. Example: “default:” destination “sun:” gateway or router 1: metric route add default sun 1 route add slip bsdi 1

14 Malathi Veeraraghavan (originals by Jörg Liebeherr) 14 ICMP Redirect Based on routing data in host, it does an arp for router 1 and sends packet to router 1 When router 1 detects that an IP datagram should have gone to a different router, the router: forwards the IP datagram to the correct router sends an ICMP redirect message to the host Host uses ICMP message to update its routing table

15 Malathi Veeraraghavan (originals by Jörg Liebeherr) 15 ICMP Router Solicitation ICMP Router Advertisement Specified in RFC 1256 (1991) After bootstrapping a host broadcasts an ICMP router solicitation message. In response, routers send an ICMP router advertisement message Also, routers periodically broadcast ICMP router advertisement

16 Malathi Veeraraghavan (originals by Jörg Liebeherr) 16 Dynamic IP Routing Protocols In Unix systems, the dynamic setting of routing tables is done by the routed or gated daemons The routing daemons execute the following intradomain and interdomain routing protocols intradomain interdomain

17 Malathi Veeraraghavan (originals by Jörg Liebeherr) 17 RIP - Routing Information Protocol A simple intradomain protocol Straightforward implementation of Distance Vector Routing Each router advertises its minimum distances to destinations every 30 seconds (or whenever its routing table changes) RIP always uses the hop-count as link metric. Maximum hop count is 15, with “16” equal to “  ”. Routes timeout after 3 minutes if they are not updated. Route metric is set to  (16) and marked for deletion

18 Malathi Veeraraghavan (originals by Jörg Liebeherr) 18 RIP Packet Format

19 Malathi Veeraraghavan (originals by Jörg Liebeherr) 19 Routing with RIP This is the operation of RIP in routed. Dedicated port for RIP is UDP port 520. Initialization: Broadcast a request packet (command = 1, metric=16; address family=0, metric=16) on the interfaces requesting current routing tables from routers. Request received: Routers that receive above request send their entire routing table. Response received: Update the routing table (see distance vector algorithm). Regular routing updates: Every 30 seconds, send all or part of the routing tables to every neighbor. Triggered Updates: Whenever the metric for a route changes, send data that has changed.

20 Malathi Veeraraghavan (originals by Jörg Liebeherr) 20 RIPv2 RIPv2 also supports multicast and provides authentication

21 Malathi Veeraraghavan (originals by Jörg Liebeherr) 21 OSPF OSPF = Open Shortest Path First RFC 1247 from 1991 Alternative solution to RIP as interior gateway protocol OSPF is a link state protocol, i.e., each node has complete topology information OSPF messages are sent directly in IP (and not as payload of UDP packets) Hellos and Link State Advertisements (LSAs) –To get the topology of the network Shortest-path algorithm, e.g., Dijkstra’s to precompute routing tables.

22 Malathi Veeraraghavan (originals by Jörg Liebeherr) 22 Features of OSPF Provides authentication of routing messages Enables load balancing by allowing traffic to be split evenly across routes with equal cost Supports subnetting Supports multicasting

23 Malathi Veeraraghavan (originals by Jörg Liebeherr) 23 BGP BGP = Border Gateway Protocol Currently in version 4 Note: In the context of BGP, a gateway is nothing else but an IP router that connects autonomous systems. Interdomain routing protocol for routing between autonomous systems Uses TCP to send routing messages BGP is a distance vector protocol, but unlike in RIP, routing messages in BGP contain complete routes. Network administrators can specify routing policies

24 Malathi Veeraraghavan (originals by Jörg Liebeherr) 24 BGP BGP’s goal is to find any path (not an optimal one). Since the internals of the AS are never revealed, finding an optimal path is not feasible. For each autonomous system (AS), BGP distinguishes: local traffic = traffic with source or destination in AS transit traffic = traffic that passes through the AS Stub AS = has connection to only one AS, only carry local traffic Multihomed AS = has connection to >1 AS, but does not carry transit traffic Transit AS = has connection to >1 AS and carries transit traffic

25 Malathi Veeraraghavan (originals by Jörg Liebeherr) 25 BGP

26 Malathi Veeraraghavan (originals by Jörg Liebeherr) 26 Exercise R1 R2 161.6.5 190.4.6 11.4.6 135.60.81 180.11.22 Assume route commands in the bootstrap sequence in both routers allows them to immediately recognize their directly connected subnets Show the routing tables at nodes R1 and R2 initially before they exchange RIP messages and after. See Page 131 of your textbook for guidance..1.4.1.2

27 Malathi Veeraraghavan (originals by Jörg Liebeherr) 27 Exercise solution Table created by route commands executed during boot-up procedure - directly-connected interfaces have a route command metric of 0 (pg. 116) but a RIP metric of 1 (pg. 131) See page 116, 114 - it states that the metric is 0 if the G flag is not set, which means a direct route. The gateway column has the IP address of the outgoing interface.

28 Malathi Veeraraghavan (originals by Jörg Liebeherr) 28 Exercise solution contd. Same as on previous slide

29 Malathi Veeraraghavan (originals by Jörg Liebeherr) 29 Exercise solution contd. RIP messages sent. As per fig. 10.4 on page 131 of your text book each router advertises routes to each subnet on all other subnets with a hop count of 1. Thus, each router listens to the broadcasts about the other router’s subnets. Updated routing tables are shown on the next two slides.

30 Malathi Veeraraghavan (originals by Jörg Liebeherr) 30 Exercise solution contd. See page 131 of your textbook for RIP metrics for subnets on adjacent routers

31 Malathi Veeraraghavan (originals by Jörg Liebeherr) 31 Exercise solution contd.


Download ppt "Malathi Veeraraghavan (originals by Jörg Liebeherr) 1 Link State Routing Algorithm Use a routing protocol to collect the whole network topology Obtain."

Similar presentations


Ads by Google