720 likes | 904 Views
Adhoc Networks Routing Tutorial - Part I -. Internet Computing Laboratory @ KUT ( http://icl.kut.ac.kr ) Youn-Hee Han. It is licensed under a Creative Commons Attribution 2.5 License. Adhoc Routing Protocol 101. Layer 2 Routing (1).
E N D
Adhoc Networks Routing Tutorial- Part I - Internet Computing Laboratory @ KUT (http://icl.kut.ac.kr) Youn-Hee Han It is licensed under a Creative Commons Attribution 2.5 License
Adhoc Routing Protocol 101 Computer Network
Layer 2 Routing (1) • The source determines that the destination interface is in the same IP subnet • This necessarily implies that the source and destination are directly connected by a Layer 2 network • ARP allows the source to determine the Layer 2 (MAC) address of the destination • The source encapsulates the IP datagram in a Layer 2 frame, addresses the frame appropriately, and transmits the frame • Layer 2 “interworking units” (e.g., Ethernet bridges, 802.11 APs) may need to perform some forwarding or routing functions Computer Network
Layer 2 Routing (2) Dest IP = 10.0.1.9 (Dest Net = 10.0.1.X) Local IP: 10.0.1.4 Subnet Mask: 255.255.255.0 Local Network: 10.0.1.X Src ARP Request for 10.0.1.9 ARP Reply IP MAC AP 10.0.1.9 Dest … … Local IP: 10.0.1.9 Dest Computer Network
Layer 2 Routing (3) Dest IP = 10.0.1.9 (Dest Net = 10.0.1.X) Local IP: 10.0.1.4 Subnet Mask: 255.255.255.0 Local Network: 10.0.1.X S IP Dest = 10.0.1.9 DA = D BSSID = AP AP IP Dest = 10.0.1.9 Dest = D D Computer Network
Need for Layer 3 Routing • Of course, nodes may not be connected via Layer 2 • Nodes that are in a different IP subnet, i.e., the destination IP network is different than the local IP network • Nodes that are out of radio range in an ad hoc wireless network • Layer 3, or IP, routing is needed in this case 10.0.3.6 10.4.6.9 10.0.1.1 10.4.6.1 10.0.1.3 10.0.3.3 Computer Network
Routing • Routing consists of two fundamental steps • Forwarding packets to the next hop (from an input interface to an output interface in a traditional wired network) • Determining how to forward packets (building a routing table or specifying a route) • Forwarding packets is easy, but knowing where to forward packets (especially efficiently) is hard • Reach the destination • Minimize the number of hops (path length) • Minimize delay • Minimize packet loss • Minimize cost Computer Network
Routing Decision Point • Source routing • Sender determines a route and specifies it in the packet header • Supported in IP, although not the typical routing scheme • Hop-by-hop (datagram) routing • A routing decision is made at each forwarding point (at each router) • Standard routing scheme for IP • Virtual circuit routing • Determine and configure a path prior to sending first packet • Used in ATM (and analogous to voice telephone system) Computer Network
Routing Table • A routing table contains information to determine how to forward packets • Source routing: Routing table is used to determine route to the destination to be specified in the packet • Hop-by-hop routing: Routing table is used to determine the next hop for a given destination • Virtual circuit routing: Routing table used to determine path to configure through the network • A distributed algorithm is required to build the routing table • Distance vector algorithms • Link state algorithms Computer Network
Distance Vector Algorithms (1) • “Distance” of each link in the network is a metric that is to be minimized • Each link may have “distance” 1 to minimize hop count • Algorithm attempts to minimize distance • The routing table at each node… • Specifies the next hop for each destination • Specifies the distance to that destination • Neighbors can exchange routing table information to find a route (or a better route) to a destination Computer Network
Dest Dest Dest Dest Next Next Next Next Metric Metric Metric Metric B A A A B C A B 3 2 1 1 C B B C C C B B 1 1 2 2 D D C D D B C C 1 3 2 1 Distance Vector Algorithms (2) A C D B Computer Network
Dest Dest Next Next Metric Metric A B A B 1 1 C B B C 1 1 D D C D 1 2 Distance Vector Algorithms (3) • Node A will learn of Node C’s shorter path to Node D and update its routing table A C D B Computer Network
Link-State Algorithms (1) • Each node shares its link information so that all nodes can build a map of the full network topology • Each node periodically floods status of its links • Each node re-broadcasts link state information received from its neighbour • 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 Computer Network
Link Link Link Link A-B A-B A-B A-B B-C B-C B-C B-C C-D C-D C-D C-D Link-State Algorithms (2) • Assuming the topology is stable for a sufficiently long period, all nodes will have the same topology information A C D B Computer Network
Link Link Link Link A-B A-B A-B A-B A-C A-C A-C A-C B-C B-C B-C B-C C-D C-D C-D C-D Link-State Algorithms (3) • Nodes A and C propagate the existence of link A-C to their neighbors and, eventually, to the entire network A-C A-C A C D A-C B Computer Network
MANETs • A mobile ad hoc network (MANET) is characterized by… • Multi-hop routing so that nodes not directly connected at Layer 2 can communicate through Layer 3 routing • Wireless links • Mobile nodes Logical Topology S S D D Computer Network
MANET vs. Traditional Routing (1) • Every node is potentially a router in a MANET, while most nodes in traditional wired networks do not route packets • Nodes transmit and receive their own packets and, also, forward packets for other nodes • Topologies are dynamic in MANETs due to mobile nodes, but are relatively static in traditional networks • Routing in MANETs must consider both Layer 3 and Layer 2 information, while traditional protocols rely on Layer 3 information only • Link layer information can indicate connectivity and interference Computer Network
MANET vs. Traditional Routing (2) • MANET topologies tend to have many more redundant links than traditional networks • A MANET “router” typically has a single interface, while a traditional router has an interface for each network to which it connects • Routed packet sent forward when transmitted, but also sent to previous transmitter • Channel properties, including capacity and error rates, are relatively static in traditional networks, but may vary in MANETs Computer Network
MANET vs. Traditional Routing (3) • Interference is an issue in MANETs, but not in traditional networks • For example, a forwarded packet from B-to-C competes with new packets sent from A-to-B • Channels can be asymmetric with some Layer 2 technologies • Note that the IEEE 802.11 MAC assumes symmetric channels • Power efficiency is an issue in MANETs, while it is normally not an issue in traditional networks • MANETs may have gateways to fixed network, but are typically “stub networks,” while traditional networks can be stub networks or transit networks Computer Network
MANET vs. Traditional Routing (4) • There is limited physical security in a MANET compared to a traditional network • Increased possibility of eavesdropping, spoofing, and denial-of-security attacks • Traditional routing protocols for wired networks do not work well in most MANETs • MANETs are too dynamic • Wireless links present problems of interference, limited capacity, etc. Computer Network
MANET Routing • Nodes must determine how to forward packets • Source routing: Routing decision is made at the sender • Hop-by-hop routing: Routing decision is made at each intermediate node • Difficult to achieve good performance • Routes change over time due to node mobility • Best to avoid long delays when first sending packets • Best to reduce overhead of route discovery and maintenance • Want to involve as many nodes as possible – to find better paths and reduce likelihood of partitions Computer Network
MANET Routing Approaches • Decision time • Proactive or table-driven – maintain routing tables • Reactive or on-demand – determine routing on an as-needed basis • Network structure • Hierarchical – impose a hierarchy on a collection of nodes and reflect this hierarchy in the routing algorithm • May use a proactive protocol for routing within a cluster or zone • May use a reactive protocol for routing between distinguished “cluster heads” • Non-hierarchical – make decisions among all nodes Computer Network
Types of MANET Routing Unicast-Routing Protocol for MANET Table-Driven/ Proactive Hybrid On-Demand-driven/Reactive Clusterbased/ Hierarchical Distance- Vector Link- State ZRP DSR AODV TORA LANMAR CEDAR DSDV OLSR TBRPF FSR STAR MANET: Mobile Ad hoc Network (IETF working group) Computer Network
Common Features • MANET routing protocols must… • Discover a path from source to destination • Maintain that path (e.g., if an intermediate node moves and breaks the path) • Define mechanisms to exchange routing information • Proactive protocols • Find paths, in advance, for all source-pair destinations • Periodically exchange routing information to maintain paths • (-) Larger signalling traffic and power consumption. • Reactive protocols • Discover a path when a packet needs to be transmitted and no known path exists • Attempt to alter the path when a routing failure occurs • (-) A long delay for application when no route to the destination available Computer Network
Basic Classifications • Proactive protocols • Maintaining route map of all nodes • Example protocols: DSDV[1], OLSR[2], FSR[3] • Reactive protocols • Adapting to the traffic pattern on a demand or need basis • Example protocols: DSR[4], AODV[5], TORA[6] • Hybrid protocols • Proactive for nearby nodes while reactive for distant nodes • Example protocols: ZRP[7] Computer Network
Basic Classifications • [1] C. E. Perkins, P. Bhagwat, “Highly Dynamic Destination-Sequenced Distance Vector (DSDV) for Mobile Computers”, Proc. of the SIGCOMM 1994 Conference on Communications Architectures, Protocols and Applications, Aug 1994, pp 234-244. • [2] T. Clausen, P. Jacquet “Optimized Link State Routing Protocol”, RFC 3626 • [3] M. Gerla, G. Pei, X. Hong, Ts. Chen“Fisheye State Routing Protocol (FSR) for Ad Hoc Networks”, Internet Draft, draft-ietf-manet-fsr-00.txt, work in progress, June 2001. • [4] David B. Johnson, David A. Maltz, Yih-Chun Hu, “The Dynamic Source Routing Protocol for Mobile Ad Hoc Networks (DSR)”, <draft-ietf-manet-dsr-10.txt> • [5] C. Perkins, E. Belding-Royer, S. Das, “Ad hoc On-Demand Distance Vector (AODV) Routing”, RFC 3561 • [6] V. Park and S. Corson, “Temporally-Ordered Routing Algorithm (TORA) Version 1 Functional Specification,” IETF I-D draft-ietf-manet-tora-spec-04.txt • [7] Nicklas Beijar, “Zone Routing Protocol (ZRP)” Computer Network
Quantitative Metrics • End-to-end data throughput and delay • Route Acquisition Time (on-demand routing) • Percentage Out-of-Order Delivery • Efficiency • Control Overhead • Power consumption and network lifetime Computer Network
Proactive Routing Protocols Computer Network
Proactive Approach - Principle • Routing Table • Each terminal has its own routing table Computer Network
Proactive Approach - Principle • Control Packet • Used to make and update the Routing Table • Broadcasted in a limited area • Format of Typical Control Packet Computer Network
Proactive Approach • Example of Control Packet Exchange A B D C A A B A C A B B C C t =3 t =1 t =2 t =4 Computer Network
Proactive Approach Routing Table in D G B E C To F D I A F Computer Network H
Proactive Approach Routing Table in I G B E C To F D I A F Computer Network H
Proactive Approach Routing Table in H G B E C To F D I A F Computer Network H
Destination-Sequenced Distance Vector • Design goals: • Keep it simple! • Routes are chosen by a metric (hop count, least delay, best signal strength, etc..) • Avoid the looping problem • Tag each routing table entry with a Destination sequence number • Allow fast reaction to topology changes • Make immediate route advertisement on significant changes in routing table • Both periodic and triggered routing updates to maintain table • DSDV is Proactive • Each node maintains routing information for all known destinations • Routing information must be updated periodically • Traffic overhead even if there is no change in network topology • Maintains routes which are never used Computer Network
DSDV - Table entries • Sequence number originated from destination. • Ensures loop freedom and route freshness • Format = Dest_NNN • Install Time when entry was made • used to delete stale entries from table Computer Network
DSDV - Transmitting Route Information • Routing information is transmitted by broadcast • Updates are transmitted periodically or immediately when any significant topology change is available Rules to set sequence number information • On each advertisement increase own destination sequence number (use only even numbers) • If a node is no more reachable (timeout) increase sequence number of this node by 1 (odd sequence number) and set metric = . • Full dump: all information from the transmitting node • Incremental dump: all information that has changed since the last full dump Computer Network
DSDV - Route Selection • Update information is compared to own routing table • 1. Select route with higher destination sequence number (This ensure to use always newest information from destination) • 2. Select the route with better metric when sequence numbers are equal. • Tables A B C Computer Network
DSDV - Route Advertisement B increases Seq.Nr from 100 to 102 B broadcasts routing information to Neighbors A and C including the destination sequence numbers (A, 1, A-550) (B, 0, B-102) (C, 1, C-588) (A, 1, A-550) (B, 0, B-102) (C, 1, C-588) A B C Computer Network
DSDV - New Node 1. D broadcast for first timeSend Sequence number D-000 (D, 0, D-000) A B C D 2. Insert entry for D with sequence number D-000 A B C D Computer Network
DSDV - New Node 3. C increases its sequence number to C-592 then Immediately broadcasts! its new 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 Computer Network
DSDV - New Node 4. B gets this new information and updates its table……. D gets routing table from C and create its own table. A B C D Computer Network
DSDV - no loops, no count to infinity 2. B does its broadcast-> no effect on C (C knows that B has stale information because C has higher seq. number for destination D)-> no loop! 1. Node C detects broken Link: Increase Seq. Nr. by 1(no reachable -> odd number) (D, 2, D-100) (D, 2, D-100) D A B C Loop made withoutsequence number (D, 2) (D, 2) Computer Network
DSDV - Immediate Advertisement 3. Immediate propagationC to B:(update information has higher Seq. Nr. replace table entry) 4. Immediate propagation B to A:(update information has higher Seq. Nr. replace table entry) (D, , D-101) (D, , D-101) D A B C Computer Network
DSDV - Limitation • DSDV generally requires a full dump update periodically DSDV is not efficient in route updating • DSDV limits the number of nodes that can join the network • Topology changes are slowly propagated • Whenever topology of a network changes, DSDV is unstable until update packets propagate through the network • Table exchange eats bandwidth • DSDV is effective for creating ad-hoc networks for small populations of mobile nodes • DSDV is a fairly brute force approach, because connectivity information needs periodical update througout the whole network • DSDV can no longer find a route reliably when there is high mobility Computer Network
A A 1 10 B B 0 20 A B C C 1 30 A A 0 10 D C 2 40 B B 1 20 A C 3 10 C B 2 30 B C 2 20 D B 3 40 C C 1 30 D D 0 40 A B 2 10 C D B B 1 20 C C 0 30 D D 1 40 DSDV –one more example Computer Network
A A 1 12 B B 0 20 A B C C 1 32 A A 0 12 D C 2 40 B B 1 20 A C 3 10 C B 2 30 B C 2 20 D B 3 40 C C 1 32 D D 0 40 A B 2 10 C D B B 1 20 A & C perform a broadcast C C 0 32 D D 1 40 DSDV –one more example Computer Network
A - ∞ 13 B B 0 20 A B C C 1 32 A A 0 13 D C 2 40 B - ∞ 21 A C 3 10 C - ∞ 31 B C 2 20 D - ∞ 41 C C 1 32 D D 0 40 A B 2 10 C D A move out of range of all other nodes B B 1 20 C C 0 32 D D 1 40 DSDV –one more example B detects A’s movement Odd number Odd numbers for all destinations Computer Network
A - ∞ 13 B B 0 22 A B C C 1 32 A A 0 13 D C 2 40 B - ∞ 21 A C 3 10 C - ∞ 31 B C 2 20 D - ∞ 41 C C 1 32 D D 0 40 A - ∞ 13 C D B broadcasts its modified route table B B 1 22 C C 0 32 D D 1 40 DSDV –one more example Computer Network
DSDV –one more example A - ∞ 13 B B 0 22 A B C C 1 34 A A 0 12 D C 2 40 B - ∞ 21 A - ∞ 13 C - ∞ 31 B C 2 22 D - ∞ 41 C C 1 34 C broadcasts its modified route table D D 0 40 A - ∞ 13 C D B B 1 22 As a result contents of all tables are same exception for A C C 0 34 D D 1 40 Computer Network