Table Of ContentUNIVERSITY OF OSLO
Department of Informatics
Impementing and
extending the
Optimized Link
State Routing
Protocol
Andreas Tłnnesen
UniK University Graduate Center
University of Oslo
[email protected]
Abstract
AMANETisamulti-hopad-hocwirelessnetworkwherenodescanmovearbitraryinthetopology.The
networkhasnogiveninfrastructureandcanbesetupquicklyinanyenvironment. TheOptimizedLink
StateRouting(OLSR)protocolisaroutemanagementprotocolforsuchmobileadhocnetworks.
ThisstudypresentstheworkofimplementingtheOLSRroutingprotocol. Theimplementationisdone
inamodularfashion,allowingfortheuseofexternalplugins.
Also, this study analyzes certain extensions to the protocol done in relation to the implementation, in-
cludingInternetconnectivity,securityandauto-configuration. Moretechnicalimplementationdesigns
arealsocovered.
i
Preface
ThisthesisiswrittenasapartofmymasterdegreeinComputerScienceattheUniversityofOslo,Institute
ofInformatics.ThethesisiswrittenatUniKUniversityGraduationCenter.
Ihavealwayshada deepinterestforhowstuffworksunderthehood,andthisespeciallyappliestocom-
puternetworks.Implementing,extendingandexperimentingwithaMANETroutingprotocolhasbeenthe
perfectassignmentforme. Ithasbeenalotofchallenging,hardwork,butatthesametimeithasbeenvery
rewardingandfun.
Throughmyworkonthismaster,Ihavelearnedalotaboutroutingprotocolsandlow-levelnetworkpro-
grammingontheGNU/Linuxplatform. IhavebeenallowedtoworkfreelyandtopursuitanynewideaI
havecomeupwith. Forgivingmesuchfreedominmywork,andforhisguidance,Iwouldliketothank
AndreasHafslund. IwouldalsoliketothankPaalEngelstad,JonE.AnderssonandRoarB.RotvikwhoI
havebeenworkingwithontheextensionsofOLSR.MythanksalsogoestoProf. ØyvindKureandKnut
Øvsthus.
Also a special thanks to my wife Margareth, for her patience with me spending endless hours hacking
computers.
AndreasTønnesen,
Oslo,August1st,2004
ii
Contents
1 Introduction 2
1.1 Implementationwork . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Chapteroverview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2 Mobilead-hocnetworks 4
2.1 Ad-hocnetworks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.1.1 Wirelesscommunication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.1.2 TraditionalIProuting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.1.3 TheMANETIETFworkinggroup . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.1.4 MANETandMobileIP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2 MANETroutingprotocols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2.1 Reactiveprotocols-AODV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2.2 Proactiveprotocols-OLSR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.2.3 Hybrids-ZRP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.2.4 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3 OLSR-corefunctionality 11
3.1 Nodeaddressing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.2 Informationrepositories. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.2.1 Timeouts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.3 Controltraffic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.3.1 Packetformat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.3.2 Messagetypes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.4 MultipointRelaying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.4.1 Multipointrelaying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.4.2 ForwardingOLSRtraffic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.4.3 Linksetoptimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.5 Usingmultipleinterfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.6 Neighbordiscovery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.6.1 Linksensing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.6.2 Neighbordetection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.6.3 Twohopneighbordetection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.6.4 MPRSelectordetection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.7 Linkstatedeclaration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.7.1 AdvertisedNeighborSequenceNumber . . . . . . . . . . . . . . . . . . . . . . . 21
3.7.2 Populatingthetopologyset. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.8 RouteCalculation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.9 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
iii
4 Auxiliaryfunctionality 24
4.1 Externalaccess-HNA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.1.1 HNA-messageformat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.1.2 HNA-messageprocessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.1.3 HNA-routecalculation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
4.2 Link-layernotifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.3 Linkhysteresis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.4 TCredundancy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
4.5 MPRredundancy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
5 Implementationbackground 29
5.1 Technical . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
5.2 History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
5.2.1 olsr.org . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
5.3 Implementationoverview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
5.4 Aboutthesource-code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
5.5 Portability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
5.6 Toolsused . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
5.7 Reallifeusage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
5.7.1 TheWizardsofOsexperiment . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
5.7.2 Otherusage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
5.8 Relatedwork . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
5.8.1 Otherprotocols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
6 Implementingcorefunctionality 34
6.1 Generalimplementationissues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
6.1.1 Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
6.1.2 Configurationfile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
6.1.3 PacketsandOLSRdefinitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
6.1.4 Communicatingwiththekernel . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
6.1.5 Configuringnetworkinterfaces. . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
6.1.6 Updatingthekernelroutingtable . . . . . . . . . . . . . . . . . . . . . . . . . . 36
6.2 Controltraffic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
6.2.1 BroadcastingOLSRpackets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
6.2.2 IPaddressfiltering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
6.2.3 Directingoutgoingtraffic. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
6.3 IPv6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
6.3.1 OlsrdIPdata-type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
6.3.2 ConfiguringinterfacesusingIPv6 . . . . . . . . . . . . . . . . . . . . . . . . . . 39
6.3.3 IPv6multicast . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
6.3.4 IPv6sockets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
6.3.5 Routingtableupdate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
6.4 Thesocketparser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
6.5 Thepacketparser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
6.6 Informationrepositories. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
6.6.1 Timers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
6.6.2 Liststructures. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
6.6.3 Detectingchanges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
6.7 Thescheduler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
6.7.1 Dataintegrity-mutexes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
6.8 Maintainingstate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
6.8.1 Sequencenumbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
6.8.2 Duplicateset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
6.8.3 Linksensing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
iv
6.8.4 One-andtwo-hopneighborsensing . . . . . . . . . . . . . . . . . . . . . . . . . 49
6.8.5 MPRregistrationandcalculation. . . . . . . . . . . . . . . . . . . . . . . . . . . 50
6.8.6 Topologyset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
6.8.7 MIDset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
6.8.8 Routecalculation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
6.9 Declaringstate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
6.9.1 GeneratingHELLO. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
6.9.2 GeneratingTC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
6.9.3 GeneratingMID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
6.10 Forwardingtraffic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
6.11 Futurework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
7 Implementingauxiliaryfunctionality 56
7.1 HNA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
7.1.1 GeneratingHNA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
7.1.2 HNAset. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
7.1.3 HNAroutecalculation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
7.1.4 HNAandIPv6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
7.2 Linkhysteresis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
7.2.1 Alongperiodofsilence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
7.2.2 Missingsequencenumber . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
7.2.3 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
7.3 MPRredundancy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
7.4 TCredundancy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
7.5 Linklayernotification. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
7.6 Futurework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
8 Olsrdplug-ins 62
8.1 Plugins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
8.1.1 Olsrdplugins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
8.2 Theplugininterface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
8.3 Twoexampleplugins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
8.3.1 Thepower-statusplugin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
8.3.2 ThedynamicInternetgatewayplugin . . . . . . . . . . . . . . . . . . . . . . . . 67
8.4 Futurework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
9 AGUIfront-end 69
9.1 AGraphicalUserInterface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
9.1.1 Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
9.1.2 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
9.1.3 Communicatingwitholsrd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
9.2 Futurework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
10 Usageanalysis 74
10.1 Localresourceusage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
10.1.1 CPUusage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
10.1.2 Memoryusage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
10.1.3 Optimizingcode-profilingexecution . . . . . . . . . . . . . . . . . . . . . . . . 76
10.2 Networkresourceusage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
10.2.1 Controltrafficoverhead . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
10.3 Reallifetesting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
v
11 SecuringOLSR 81
11.1 Computernetworksecurity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
11.1.1 SecurityinWLAN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
11.1.2 OLSRandsecurity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
11.1.3 Relatedwork . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
11.2 Areallifeexample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
11.2.1 Thescenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
11.2.2 Implementationoftheattack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
11.3 SecureOLSR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
11.3.1 Signatures. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
11.3.2 Keymanagement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
11.3.3 Timestampsandfreshness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
11.3.4 Timestampexchange . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
11.3.5 Workingontimestamps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
11.3.6 Robustness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
11.4 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
11.4.1 Interceptingincomingtraffic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
11.4.2 Interceptingoutgoingtraffic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
11.4.3 Timestampexchange . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
11.5 Futurework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
12 Self-configuringnetworks 91
12.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
12.2 Duplicateaddressdetection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
12.3 Pro-ActiveAuto-config . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
12.3.1 Basicoperation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
12.4 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
12.4.1 PAAclient . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
12.4.2 PAAserver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
12.4.3 PAAOLSR-plugin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
12.5 Futurework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
13 Gatewaytunneling 100
13.0.1 RoutingInternettraffic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
13.1 HNAproblems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
13.1.1 HNAandheterogeneousnodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
13.1.2 NetworkAddressTranslation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
13.2 Gatewaytunneling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
13.3 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
13.3.1 Basicoperation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
13.3.2 Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
13.4 Futurework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
14 Conclusions 107
14.1 Combiningtheextensions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
14.2 SuggestionsforRFC3626updates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
14.2.1 Linkhysteresis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
14.2.2 HNAmessageformat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
14.2.3 HNAandheterogeneousnodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
14.2.4 Multiplegateways . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
14.2.5 MIDprocessing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
14.2.6 Suggestedintervals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
14.3 Futurework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
14.4 Finalconclusionsfromtheauthor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
vi
Appendices 116
A olsrdconfigurationfile 117
B olsrdmanualpage 121
C olsr_protocol.h 124
D TheUniK-OLSRpluginlibrary 132
E SecureextensiontotheOLSRprotocol 137
F IPAddressAutoconfigurationForMobileAd-HocNetworks 142
G InternetConnectivityforMulti-HomedProactiveAdHocNetworks 150
vii
List of Figures
2.1 Atraditionalbasestationschemecomparedtoanah-hocmulti-hopnetwork. . . . . . . . . . . . . 5
2.2 Ascenariothatcanleadtothe“countingtoinfinity” problem. . . . . . . . . . . . . . . . . . . . 7
2.3 ApossiblepathforaroutereplyifAwishestofind aroutetoJ. . . . . . . . . . . . . . . . . . . 8
2.4 AZRPscenarioshowing thezonesofnodeAandnodeJusingarvalueof2. Withinthezonesa
pro-activeroutingprotocolisusedwhileare-activeprotocolisusedbetweenzones. . . . . . . . . 9
2.5 ThedifferentcomponentsoftheZoneRoutingProtocol. . . . . . . . . . . . . . . . . . . . . . 9
3.1 ThegenericOLSRpacket. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.2 Floodingapacketinawirelessmulti-hopnetwork.Thearrowsshowalltransmissions. . . . . . . . 14
3.3 Flooding a packet in a wireless multi-hop network from the center node using MPRs(black). The
arrowsshowalltransmissions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.4 Floodingapacketinawirelessmultihopnetwork. Thearrowsshowthewayinformationispassed,
notalltransmissions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.5 Flooding a packet in a wireless multihop network from the center node using MPRs(black). The
arrowsshowthewayinformationispassed,notalltransmissions. . . . . . . . . . . . . . . . . . 15
3.6 NodeAhasselectedtheblacknodesaritsMPRs.. . . . . . . . . . . . . . . . . . . . . . . . . 16
3.7 AnOLSRroutednetwork.ThegraynodesarechosenasMPRsbyoneormoreneighbor. . . . . . . 17
3.8 TheOLSRMIDmessage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.9 AtypicalneighbordiscoverysessionusingHELLOmessages. . . . . . . . . . . . . . . . . . . 18
3.10 TheOLSRHELLOmessage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.11 the8bitLinkCodefield. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.12 NodesAandBrunsOLSRonmultipleinterfaces.Busestheaddressofb1asitsmainaddress.Nodes
DandCrunsonsingleinterfaces(d1andc1). . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.13 theOLSRTopologyControlmessageformat. . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.14 OLSRinformationrepositoriesrelationoverview. . . . . . . . . . . . . . . . . . . . . . . . . . 23
4.1 AnodeintheMANETannouncesitselfasagatewaytoInternetforthenodesintheMANET.Thisis
donebyHNAmessaging. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
4.2 TheHostandNetworkAssociationmessage. . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
4.3 AwouldaddBasitsInternetgateway. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.4 ThelinkissettosymmetricattimeAandsettoasymmetricattimeB.. . . . . . . . . . . . . . . 27
4.5 ThecenternodehaschosentheblacknodesasMPRsusingaMPR_COVERAGEparameterof1. . . 28
4.6 ThecenternodehaschosentheblacknodesasMPRsusingaMPR_COVERAGEparameterof2.Not
alltwohopneighborsarecoveredbytwoMPRssincetheyareonlyreachablethroughoneonehop
neighbor. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
5.1 olsrdmainoverview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
6.1 Thesocketparser. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
6.2 ThesocketparserinitsinitialstatepassingallOLSRtraffic tothepacketparser. . . . . . . . . . . 41
6.3 Overviewofthepacket-parser. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
6.4 Alinkedlist. Itcanbeone-waylinkedonlyfollowingthefulllinesordouble-linked followingthe
dashedlinesaswell.Thelastelementmaypointtothefirst orsomepredefined valuelikeNULL. . . 43
viii
6.5 Aexampleofabalancedbinary-tree. Asearchwillneverexceedthedepthofthetreeinnumberof
seeks.Inthisexample,alookupwillneverresultinmorethan5seeks. . . . . . . . . . . . . . . 44
6.6 PartofaB-tree.Alldataisactuallystoredintheleafnodes. . . . . . . . . . . . . . . . . . . . . 44
6.7 Theolsrdgenericdataindex. Astaticlistofindexesthatisusedforhashing,whereeachentryisthe
rootelementinadouble-linkedlist. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
6.8 Overview of the olsrd scheduler. When the scheduler polls it records a timestamp t . When all
1
operations for that poll is done, a second timestampt is recorded. The scheduler then sleeps for
2
pollinterval(cid:0)(t2(cid:0)t1). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
6.9 Thepartsofthecodeprotectedbythemutex. . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
6.10 Theconnectionbetweentheone-andtwo-hopneighborsets. Alllistsaredoublelinkedwithstatic
rootelements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
6.11 Asituationwhereallnodeswillregisterredundanttwohopneighbors. . . . . . . . . . . . . . . . 50
6.12 AsituationwhereBregisterstheaddressesofAastwoseparatenodesbeforereceivingaMIDfrom
AifAusesinterface1saddressasitsmainaddress. . . . . . . . . . . . . . . . . . . . . . . . . 52
6.13 Node Ais runningolsrd on twonetwork interfaces. Interface 1is wirelesswhileinterface 2 is an
Ethernetinterface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
7.1 AsituationwherenodeAshouldkeepastableInternetgatewaybyeitherusingG1orG2,andnot
alterbetweenthem. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
7.2 AIPv6HNApacketcontainingonenetworkannouncementcontaininganetmaskcomparedtoone
containingtheprefix length.Thisprefix approachcouldalsobeusedonIPv4HNAmessages. . . . 58
7.3 TheIWspyregistrationbasedonanIPaddress.. . . . . . . . . . . . . . . . . . . . . . . . . . 61
8.1 Exampleofhowaplugininterceptsanapplicationandaddsitsownprogramflow. . . . . . . . . . 63
8.2 AnexampleofhowaplugincanenabletheOLSRdaemontoworkasarelayforbroadcasting. The
Localapplicationandtheplugincommunicateusinginterprocesscommunication. . . . . . . . . . 64
8.3 Aplugincanmanipulatevirtuallyeverypartoftheolsrdaemon. . . . . . . . . . . . . . . . . . . 64
8.4 Theplugininitializationprocess. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
8.5 Themessageformatusedbythepower-statusplugin. Thisdataissentasthedatapartofaregular
OLSRmessage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
9.1 Themainscreendisplaysalistofknownnodesandinformationaboutthem. . . . . . . . . . . . . 70
9.2 ThepacketscreenoffersOLSRpacketsniffing. . . . . . . . . . . . . . . . . . . . . . . . . . . 70
9.3 TheroutescreendisplaysallactiveOLSRroutes. . . . . . . . . . . . . . . . . . . . . . . . . . 71
9.4 Thesettingsscreendisplaysinformationaboutthelocalnodessettings. . . . . . . . . . . . . . . 72
9.5 TheinternaldesignoftheolsrdGUIclient. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
10.1 Thetestsetupusedforlocalusagetesting. ThelinksfromAtoBandCarealtering(thelinkalters
betweenA->BandA->Cevery45seconds).NodeGannouncesInternetconnectivity. . . . . . . . 75
10.2 AtopologysetupusedforOLSRoverheadregistration. . . . . . . . . . . . . . . . . . . . . . . 79
10.3 OverheadofOLSRcontroltraffic atthetestnetworksetupatWoS3. . . . . . . . . . . . . . . . 80
11.1 Thescenariousedforthereallifeimplementationoftheattackdescribedinsection11.2.1. NodeB
hasInternetconnectivityanddeclaresitselfasaHNAgatewaytotheInternet. . . . . . . . . . . . 84
11.2 What node B in the scenario from figure 11.1 sees when requesting http://www.slashdot.org in its
localwebbrowser.Thisisobviouslyaforgedversionoftherealslashdotpage.Notethehostnamein
theaddressbar. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
11.3 Thebasicsignaturemessageasusedintheimplementation. Thisissentasthemessagebodyofan
olsrmessage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
11.4 Thetimestampexchangechallengemessage.Thisissentasthemessagebodyofanolsrmessage. . 85
11.5 Thetimestampexchangechallenge-responsemessage. Thisissentasthemessagebodyofanolsr
message. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
11.6 The timestamp exchange response-responsemessage. This is sent as the message body of an olsr
message. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
ix
Description:State Routing(OLSR) protocol is a route management protocol for such mobile ad hoc networks. This study presents the work The fundamental design issues are that the wireless link interfaces services designed for wired network environments rely on net-wide broadcasts. Services that needs to.