Download presentation
1
Routing Protocols Lecture # 6 Obaid Khan
2
Routed Protocol Definition
Routed Protocol – used to transmit user data (packets) through an internetwork. Routed protocols are assigned to an interface and determine the method of packet delivery. Examples: IP, IPX, AppleTalk, DECNet, Banyan Vines, SNMP.
3
Routing Protocol Definition:
Defines Logical Addressing. Routing protocol – any protocol that defines algorithms to be used for updating routing tables between routers. Basically, a routing protocol determines the path of a packet through an internetwork. Examples: RIP, RIPv2, IGRP, EIGRP, OSPF, IS-IS, BGP
4
Approaches to Routing Distance Vector Routing protocol.
Link State Routing Protocol.
5
Distance-vector Also known as Distributed Bellman-Ford or RIP (Routing Information Protocol) Each node (router or host) exchange information with neighboring nodes Neighbors are both directly connected to same network Node maintains vector of link costs for each directly attached network and distance and next-hop vectors for each destination Requires transmission of lots of information by each router Distance vector to all neighbors Contains estimated path cost to all networks in configuration Changes take long time to propagate
6
Distance Vector Algorithms (1)
Dest Next Metric B 2 1 D A C D B Dest Next Metric 1 C 2 D 3 A Dest Next Metric C 3 B 2 1 B A Dest Next Metric 1 C D 2
7
Distance Vector Algorithms (2)
Node A will learn of Node C’s shorter path to Node D and update its routing table A Dest Next Metric 1 B D A C D B Dest Next Metric 1 C D 2 B
8
Link-State Algorithms
Used Dijkstra’s Algorithm for shortest path. Each node shares its link information so that all nodes can build a map of the full network topology Link information is updated when a link changes state (goes up or down) Link state determined by sending small “hello” packets to neighbors Given full topology information, a node can determine the next best hop or a route from the source
9
Link-State Algorithms (1)
A-B Link B-C C-D A-B Link B-C C-D A-B Link B-C C-D A C D Assuming the topology is stable for a sufficiently long period, all nodes will have the same topology information B A-B Link B-C C-D
10
Link-State Algorithms (2)
A-B Link B-C C-D A-C A-B Link B-C C-D A-C A-C A-C A-B Link B-C C-D A-C A C D A-C B A-B Link B-C C-D A-C Nodes A and C propagate the existence of link A-C to their neighbors and, eventually, to the entire network
11
Comparison of Distance Vector & Link State Routing Protocols
• Entire routing table is sent as an update • Distance vector protocol send periodic update at every 30 or 90 second • Update are broadcasted • Updates are sent to directly connected neighbor only • Routers don't have end to end visibility of entire network. •Routing Loops. Link state • Updates are incremental & entire routing table is not sent as update • Updates are triggered not periodic • Updates are multicast • Update are sent to entire network & to just directly connected neighbor • Routers have visibility of entire network. • No routing loops • Convergence is fast because of triggered updates.
12
Static Routing Typically used in hosts
Enter subnet mask, router (gateway), IP address Perfect for cases with few connections, doesn’t change much E.g. host with a single router connecting to the rest of the Internet Internet R1 IP: H1 H2 H3 For H1 Next Hop:
13
Dynamic Routing Most routers use dynamic routing
Automatically build the routing tables As we saw previously, there are two major approaches Link State Algorithms Distance Vector Algorithms First some terminology AS = Autonomous System Contiguous set of networks under one administrative authority Common routing protocol A connected network There is at least one route between any pair of nodes
14
Application of IRP and ERP
15
Intra-AS Routing Also known as Interior Router Protocols (IRP) or Interior Gateway Protocols (IGP) Most common: RIP: Routing Information Protocol OSPF: Open Shortest Path First IGRP: Interior Gateway Routing Protocol (Cisco proprietary)
16
Shortest Path Algorithm
Dijkstra’s Algorithm Shortest Path Algorithm Weighted Graphs
17
Shortest Path Algorithm Negative Weighted Graphs
Bellman-Ford’s Algorithm Shortest Path Algorithm Negative Weighted Graphs 6 7 s z y 8 -3 2 9 -2 x t -4 5 5 s z y 6 7 8 -3 2 9 -2 x t -4 6 7 s z y 8 -3 2 9 -2 x t -4 5 6 4 7 2 s z y 8 -3 9 -2 x t -4 5
18
………….Bellman-Ford’s Algorithm
6 4 7 2 s z y 8 -3 9 -2 x t -4 5 2 4 7 s z y 6 8 -3 9 -2 x t -4 5 2 4 7 s z y 6 8 -3 9 -2 x t -4 5 2 4 7 -2 s z y 6 8 -3 9 x t -4
19
Types Of Routing Protocol
Reactive (On-demand) protocols Discover routes when needed Source-initiated route discovery Example: Ad-hoc on demand distance vector (AODV), Dynamic Source Routing (DSR). Proactive protocols (Table Driven) Traditional distributed shortest-path protocols Based on periodic updates. High routing overhead Example : Highly Dynamic Destination-Sequenced Distance Vector routing protocol (DSDV), Optimized Link State Routing Protocol (OLSR), Open Shortest path first (OSPF), RIP.
20
Routing Types Nodes must determine how to forward packets
Source routing Routing decision is made at the sender. In source routing complete route information from source to destination is included in the data packets . Not feasible to the large scale network Hop-by-hop routing: Routing decision is made at each intermediate node. Hop-by-hop Routing: In hop-by-hop routing each data packet contains next hop address and destination address. Routing decision is made at each intermediate node.
21
Proactive Routing Protocol
Table driven routing protocol
22
RIP ( Routing Information Protocol)
Distance vector algorithm Proactive Routing Protocol Distance vectors: exchanged every 30 sec via Response Message (also called advertisement) Each advertisement: route to up to 25 destination nets
23
RIP (Routing Information Protocol)
z w x y A D B C Destination Network Next Router Num. of hops to dest. w A 2 y B 2 z B 7 x …. … Routing table in D
24
RIP: Link Failure and Recovery
If no advertisement heard after 180 sec neighbor/link declared dead routes via neighbor invalidated new advertisements sent to neighbors neighbors in turn send out new advertisements (if tables changed) link failure info quickly propagates to entire net
25
OSPF (Open Shortest Path First)
Uses Link State algorithm LS packet dissemination Topology map at each node Route computation using Dijkstra’s algorithm OSPF advertisement carries one entry per neighbor router Advertisements disseminated to entire AS (via flooding) Conceived as a successor to RIP
26
Destination Sequence Distance Vector Routing (DSDV)
DSDV is Proactive (Table Driven) DSDV is Destination Based Each node maintains routing information for all known destinations Routing information must be updated periodically Maintains routes which are never used Traffic overhead even if there is no change in network topology
27
DSDV FUNCTIONALITY Route Advertisements Route Selection
Advertise to each neighbor own routing information which consist of : Destination Address Metric = Number of Hops to Destination Destination Sequence Number Rules to set sequence number information On each advertisement increase own destination sequence number If a node is no more reachable (timeout) increase sequence number of this node by 1 and set metric = Route Selection Update information is compared to own routing table Select route with higher destination sequence number (This ensure to use always newest information from destination) Select the route with better metric when sequence numbers are equal. Respond to Topology Changes Immediate advertisements Information on new Routes, broken Links, metric change is immediately propagated to neighbors. Full/Incremental Update: Full Update: Send all routing information from own table. Incremental Update: Send only entries that have changed. (Make it fit into one single packet)
28
DSDV (Tables) A B C 1 2 Dest. Next Metric Seq A A-550 B 1 B-100 C 3
A-550 B 1 B-100 C 3 C-586 Dest. Next Metric Seq A 1 A-550 B B-100 C 2 C-588 Dest. Next Metric Seq. A B 1 A-550 2 B-100 C C-588
29
DSDV (Route Advertisement)
B increases Seq.Nr from 100 -> 102 B broadcasts routing information to Neighbors A, C including destination sequence numbers (A, 1, A-500) (B, 0, B-102) (C, 1, C-588) (A, 1, A-500) (B, 0, B-102) (C, 1, C-588) 1 1 A B C Dest. Next Metric Seq A A-550 B 1 B-102 C 2 C-588 Dest. Next Metric Seq A 1 A-550 B B-102 C C-588 Dest. Next Metric Seq. A B 2 A-550 1 B-102 C C-588
30
DSDV (New Node) 2. Insert entry for D with sequence number D-000 Then immediately broadcast own table 1. D broadcast for first time Send Sequence number D-000 (D, 0, D-000) A B C D Dest. Next Metric Seq. A A-550 B 1 B-104 C 2 C-590 Dest. Next Metric Seq. A 1 A-550 B B-104 C C-590 Dest. Next Metric Seq. A B 2 A-550 1 B-104 C C-590 D D-000
31
DSDV (New Node cont.) A B C D
3. C increases its sequence number to C-592 then broadcasts its new table. 4. B gets this new information and updates its table……. (A, 2, A-550) (B, 1, B-102) (C, 0, C-592) (D, 1, D-000) (A, 2, A-550) (B, 1, B-102) (C, 0, C-592) (D, 1, D-000) ……… A B C D Dest. Next Metric Seq. A A-550 B 1 B-104 C 2 C-590 Dest. Next Metric Seq. A 1 A-550 B B-102 C C-592 D 2 D-000 Dest. Next Metric Seq. A B 2 A-550 1 B-102 C C-592 D D-000
32
DSDV (no loops, no count to infinity)
2. B does its broadcast -> no affect on C (C knows that B has stale information because C has higher seq. number for destination D) -> no loop -> no count to infinity 1. Node C detects broken Link: -> Increase Seq. Nr. by 1 (only case where not the destination sets the sequence number -> odd number) (D, 2, D-100) (D, 2, D-100) D A B C Dest. Next Metric Seq. … D B 3 D-100 Dest.c Next Metric Seq. … D C 2 D-100 Dest. Next Metric Seq. … D D-101
33
DSDV (Immediate Advertisement)
3. Immediate propagation B to A: (update information has higher Seq. Nr. -> replace table entry) 2. Immediate propagation C to B: (update information has higher Seq. Nr. -> replace table entry) 1. Node C detects broken Link: -> Increase Seq. Nr. by 1 (only case where not the destination sets the sequence number -> odd number) (D, , D-101) (D, , D-101) D A B C Dest. Next Metric Seq. … ... D B 3 D-100 D-101 Dest. Next Metric Seq. … D B 4 D-100 Dest.c Next Metric Seq. … ... D C 2 D-100 D-101 Dest.c Next Metric Seq. … D C 3 D-100 Dest. Next Metric Seq. … D B 1 D-100 Dest. Next Metric Seq. … D 1 D-100 D-101
34
Reactive Routing Protocol
On-Demand routing protocol
35
AODV Concepts (1) AODV: Ad hoc On-demand Distance Vector routing protocol Pure on-demand routing protocol A node does not perform route discovery or maintenance until it needs a route to another node or it offers its services as an intermediate node Nodes that are not on active paths do not maintain routing information and do not participate in routing table exchanges Uses a broadcast route discovery mechanism Uses hop-by-hop routing Routes are based on dynamic table entries maintained at intermediate nodes Similar to Dynamic Source Routing (DSR), but DSR uses source routing
36
AODV Concepts (2) Local HELLO messages are used to determine local connectivity Can reduce response time to routing requests Can trigger updates when necessary Sequence numbers are assigned to routes and routing table entries Used to maintain freshness of route Every node maintains two counters Node sequence number Broadcast ID
37
AODV Route Request (1) Initiated when a node wants to communicate with another node, but does not have a route to that node Source node broadcasts a route request (RREQ) packet to its neighbors broadcast_id dest_addr type flags hopcnt resvd dest_sequence_# source_addr source_sequence_#
38
AODV Route Request (2) Sequence numbers
Source sequence indicates “freshness” of reverse route to the source Destination sequence number indicates freshness of route to the destination Every neighbor receives the RREQ and either … Returns a route reply (RREP) packet, or Forwards the RREQ to its neighbors (source_addr, broadcast_id) uniquely identifies the RREQ broadcast_id is incremented for every RREQ packet sent Receivers can identify and discard duplicate RREQ packets
39
AODV Route Request (3) If a node cannot respond to the RREQ
The node increments the hop count The node saves information to implement a reverse path set up (AODV assumes symmetrical links) Neighbor that sent this RREQ packet Destination IP address Source IP address Broadcast ID Source node’s sequence number Expiration time for reverse path entry (to enable garbage collection)
40
AODV Example (1) Node 1 needs to send a data packet to Node 7
4 6 1 7 5 3 2 Node 1 needs to send a data packet to Node 7 Assume Node 6 knows a current route to Node 7 Assume that no other route information exists in the network (related to Node 7)
41
AODV Example (2) Node 1 sends a RREQ packet to its neighbors
4 6 1 7 5 3 2 Node 1 sends a RREQ packet to its neighbors source_addr = 1 dest_addr = 7 broadcast_id = broadcast_id + 1 source_sequence_# = source_sequence_# + 1 dest_sequence_# = last dest_sequence_# for Node 7
42
AODV Example (3) 4 6 1 7 5 3 2 Nodes 2 and 4 verify that this is a new RREQ and that the source_sequence_# is not stale with respect to the reverse route to Node 1 Nodes 2 and 4 forward the RREQ Update source_sequence_# for Node 1 Increment hop_cnt in the RREQ packet
43
AODV Example (4) RREQ reaches Node 6, which knows a route to 7
1 7 5 3 2 RREQ reaches Node 6, which knows a route to 7 Node 6 must verify that the destination sequence number is less than or equal to the destination sequence number it has recorded for Node 7 Nodes 3 and 5 will forward the RREQ packet, but the receivers recognize the packets as duplicates
44
AODV Route Reply (1) If a node receives an RREQ packet and it has a current route to the target destination, then it unicasts a route reply packet (RREP) to the neighbor that sent the RREQ packet dest_addr type flags hopcnt rsvd dest_sequence_# source_addr lifetime prsz
45
AODV Route Reply (2) Intermediate nodes propagate the first RREP for the source towards the source using cached reverse route entries Other RREP packets are discarded unless… dest_sequence_# number is higher than the previous, or destination_sequence_# is the same, but hop_cnt is smaller (i.e., there’s a better path) RREP eventually makes it to the source, which can use the neighbor sending the RREP as its next hop for sending to the destination Cached reverse routes will timeout in nodes not seeing a RREP packet
46
AODV Example (5) 4 6 1 7 5 3 2 Node 6 knows a route to Node 7 and sends an RREP to Node 4 source_addr = 1 dest_addr = 7 dest_sequence_# = maximum(own sequence number, dest_sequence_# in RREQ) hop_cnt = 1
47
AODV Example (6) 4 6 1 7 5 3 2 Node 4 verifies that this is a new route reply (the case here) or one that has a lower hop count and, if so, propagates the RREP packet to Node 1 Increments hop_cnt in the RREP packet
48
AODV Example (7) 4 Dest Next Hops 7 4 3 6 1 7 5 3 2 Node 1 now has a route to Node 7 in three hops and can use it immediately to send data packets Note that the first data packet that prompted path discovery has been delayed until the first RREP was returned
49
AODV Route Maintenance
Route changes can be detected by… Failure of periodic HELLO packets Failure or disconnect indication from the link level Failure of transmission of a packet to the next hop (can detect by listening for the retransmission if it is not the final destination) The upstream (toward the source) node detecting a failure propagates an route error (RERR) packet with a new destination sequence number and a hop count of infinity (unreachable) The source (or another node on the path) can rebuild a path by sending a RREQ packet
50
AODV Example (8) Assume that Node 7 moves and link 6-7 breaks
4 6 1 7 5 3 2 7 Assume that Node 7 moves and link 6-7 breaks Node 6 issues an RERR packet indicating the broken path The RERR propagates back to Node 1 Node 1 can discover a new route
51
Dynamic Source Routing (DSR)
52
Hierarchical Algorithms (1)
Scalability – MANET protocols often do not perform well for large networks (especially if not dense) Global topology is based on the connectivity of each mobile node Clusters can be used to provide scalability Clusters are formed (dynamically, of course) to provide hierarchy Global routing is done to clusters Local routing is done to nodes within a cluster Clusters of clusters (super-clusters) can be formed to extend hierarchy Similar in principle to IP subnets
53
Hierarchical Algorithms (2)
A special node, called the cluster-head, is designated in each cluster Responsible for routing data to or from other clusters May be a special node, or may be designated through a clustering algorithm Algorithms Clustering -- form clusters Cluster-head identification -- may be an integral part of the clustering algorithm Routing -- some routing algorithm is still needed Applied at each level of the hierarchy
54
Hierarchical Algorithm Example
Cluster 2 Cluster 1 Cluster 3
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.