Optimized Link State Routing Proactive link-state protocol Periodic exchange of messages: Neighborhood discovering Topology information dissemination Optimized for MANETs Compacts the size of the information in the messages Reduces the number of retransmission to flood these messages
Proactive route discovery Periodic exchange of control messages Some messages are sent locally to enable a router to discover its neighborhood Some messages are sent in entire network to distribute the knowledge of topology The routes are immediately available when needed (no delay is caused by route discovery)
Link state protocol Each node discover all the links with its neighbor nodes Each node periodically floods a message containing all its afferent links (Link State Message) Each node constructs a topology map of the network, in the form of a graph Each node then independently calculates the best next hop for every other nodes in the network using a shortest-path algorithm
Flooding optimizations (1) Each node selects a subset of nodes in its neighborhood, which retransmits its messages These selected nodes are named Multi Point Relays (MPRs) of that node The selection condition is the following: each two hop neighbor node must have at least one bidirectional link toward a node inside the MPR set So the MPR nodes must permit to reach all the two hop neighbors
Flooding optimizations (2) A node retransmits a received message only if it's part of the MPRs set of the neighbor node that has transmitted the message So each node maintain a list of the nodes from which has been selected as MPR. This set is called MPR Selectors Each node retransmits only the messages received from the nodes inside its MPR Selectors set
Flooding optimizations (3) Classical flooding MPR flooding
Classical flooding (4.1)
Classical flooding (4.2)
Classical flooding (4.3)
Classical flooding (4.4)
Classical flooding (4.5)
Classical flooding (4.6)
Classical flooding (4.7) 12 transmitted messages
MPR flooding (5.1)
MPR flooding (5.2)
MPR flooding (5.3)
MPR flooding (5.4) R4 is not MPR of R2, so it doesn't retransmit the msg received from R2
MPR flooding (5.5)
MPR flooding (5.6) R6 is not MPR of R5, so it doesn't retransmit the msg received from R5
MPR flooding (5.7) 9 transmitted messagess
OLSR Packet Format (1) Broadcast UDP packets with port 698 Each router is identified by its main address Each OLSR packet contains one or more OLSR messages There are 4 kind of messages: HELLO (Hello) TC (Topology Control) MID (Multiple Interface Declaration) HNA (Host or Network Announcment)
OLSR Packet Format (2)
OLSR Message Format Message Type (HELLO, TC, MID, HNA) Validity Time (in seconds, expressed by its mantissa and exponents) Message Size (in bytes) Originator address (the main address of the node which has originated this message) Time To Live Hop Count Message Sequence Number Message Paylod
HELLO message (1)
HELLO message (2) Htime (Hello emission interva in seconds expressed by its mantissa and its exponent) Willingness Link Code Bits 0:1 Link Type (UNSPEC, SYM, ASYM, LOST) Bits 2:4 Neighbor Type (SYM, MPR, NOT_NEIG) Link Message Size (counted in bytes) One or more Neighbor Interfacess Address (the address of an interface of a neighbor node)
TC message ANSN Advertised Neighbor Sequence Number (Every time a node detects a change in its advertised neighbor set, it increments this sequence number) One or more Advertised Neighbor Main Address (basically only the list of its MPR selectors, not all the neighbors)
MID message Each node flood a message with the list of the addresses of its interfaces
HNA message Each node flood a message with the list of its associated networks and/or hosts (hosts are network with mask 255.255.255.255)
OLSR for Linux There exists several Linux implementations of the OLSR routing protocols In this course we use olsrd from olsr.org project Implements RFC 3626 Multiplatform Support LQ extension Support multiple interfaces Plug-in design Available at http://www.olsr.org/
Netkit Lab (olsr.tar.gz) host r3 r1 r2 r5 r6 r4
Network Topology IP addresses 192.168.X.Y/16 where: X is the router number Y is the interface number For example, r2 has the following addresses: Eth0 192.168.2.0/24 (main address) Eth1 192.168.2.1/24 Eth2 192.168.2.2/24 Add a static route on the host machine: sudo ip route add 192.168.0.0/16 via 192.168.168.1
Run and monitor olsrd Run olsrd: olsrd -f /tmp/olsrd.conf -d 0 Access to the statistic by txtinfo plugin: nc 127.0.0.1 2006 Access to the statistic by httpinfo plugin: http://192.168.168.1:1978
Run Olsrd in RFC3626 mode By default olsrd use the Link Quality extension which breaks the RFC3626 compatibility. To force the RFC3626 compatibility, set the variables below: LinkQualityLevel 0 MprCoverage 1 TcRedundancy 0
MPR flooding Check what is the MPR of router r2 Make a tcpdump on eth1 of r3 and eth1 of r4 (tcpdump -npi eth1 -s 4096 -w /hosthome/olsr-mprflood-rx-eth1.pcap udp and port 698) Analyze the dump with wireshark using the following filter: olsr.origin_addr == 192.168.1.0 On eth1-r3 there are packets sent both from 192.168.3.1 and from 192.168.5.0 On eht1-r4 there are packets sent only from 192.168.5.1 So the MPR of r2 is r3!!!
Olsrd ETX metric Olsrd measure the packet loss of each link getting the statistic of received broadcast HELLO messages from its neighbors (LQ) and it receives the same measures from its neighbors (they put them inside the HELLO messages) Then computes the Expected Transmissions (ETX) for each link: ETX = 1 / (LQ x NLQ)
Run Olsrd with ETX metric Change the olsrd configuration setting the variables below: LinkQualityLevel 2 MprCoverage 1 TcRedundancy 2 To force a link quality degradation on a link run a command like the one below: iptables t mangle A PREROUTING p udp dport 698 s 192.168.X.0/24 m statistic mode random probability 0.5 j DROP
Run Olsrd with ETX metric From host machine run: traceroute n 192.168.3.0 Then run on r2: iptables t mangle A PREROUTING p udp dport 698 s 192.168.3.0/24 m statistic mode random probability 0.5 j DROP And run on r3: iptables t mangle A PREROUTING p udp dport 698 s 192.168.2.0/24 m statistic mode random probability 0.5 j DROP Wait some seconds and on the host machine run again: traceroute n 192.168.3.0