+ All Categories
Home > Documents > Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty:...

Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty:...

Date post: 28-Sep-2020
Category:
Upload: others
View: 0 times
Download: 0 times
Share this document with a friend
54
Distributed Systems Ad hoc and sensor networks Rik Sarkar University of Edinburgh Fall 2018 Distributed Systems, Edinburgh, 2018
Transcript
Page 1: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

DistributedSystems

AdhocandsensornetworksRikSarkar

UniversityofEdinburgh

Fall2018

Distributed Systems, Edinburgh, 2018

Page 2: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

MobileandUbiquitouscompuEng

•  Devices(computers)arecarriedbypeople(mobile)–  Laptops,phones,watches…

•  Theyareeverywhere–  Carriedbypeople(mobile)–  Embeddedintheenvironment

•  Coffeemachines,cameras,sensorsforlightcontrol,elevators…

–  Producelargeamountsofdata•  Usage,sensing…

Distributed Systems, Edinburgh, 2018

Page 3: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

Ubiquitous•  Advantages:

–  Therearecomputerseverywhere–  Everythingis“smart”–  PotenEallyusecomputaEonsonthesetomakethemevensmarter

•  Challenges:–  Therearemorethingstogowrong–  Noteasytomakethingsworkwellcoherently–  ConsistentplaSormsformanagingubiquitousdevicesdonotexist(yet)

–  Devicesdonotinteroperateeasily

Distributed Systems, Edinburgh, 2018

Page 4: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

Mobile

•  Advantages:–  Thesamedeviceiscarriedbytheperson–easytogiveconsistentservice

–  InformaEonwhenever,wherevertheyneed–  Deviceshavesensors–potenEalforsensingtheenvironmentandadapEng

•  Disadvantages:–  ConnecEvityischallenge:dataiscostly;networkdoesnotworkthesameway;mobilityinterfereswithcomunicaEon

–  LimitedbaXery:can’tdotoomuchcommunicaEon–  Howtomakeuseofsensors,notsowellunderstood

Distributed Systems, Edinburgh, 2018

Page 5: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

ContextawarecompuEng

•  AdaptcomputaEonstothecircumstances– Timeofday–  Istheuserpresent?–  Isthephoneinhandorinpocket– Scanforwifionlywhenindoors– Turnoffringwhenincinema,mee-ng…– RecognizeacEvityandbringuprelevantinformaEon

– …

Distributed Systems, Edinburgh, 2018

Page 6: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

ContextawarecompuEng

•  AdaptcomputaEonstothecircumstances•  BasiccontextsareeasytoidenEfy,butitisnotalwaysclearhowtoadapt– Turndownvolumeatnight…butwhatifitisanimportantcall?

•  Manycontextsareveryhardtodetectreliably

Distributed Systems, Edinburgh, 2018

Page 7: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

OthercontextdetecEonexamples

•  Indoor/outdoor•  UsesoundtodetectuserinameeEng•  Detecttransportmode(walking,car,bus,tram..)– Usingaccelerometer

•  DetectpresenceofotherusersnearbyfromwifiacEvity

Distributed Systems, Edinburgh, 2018

Page 8: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

ContextdetecEon

•  Generallyhard•  Concernsaboutprivacy:youdonotwanttosendcontextinformaEontoaserver

•  PerhapsdistributedcomputaEoncanhelp– Usedatafrommanyphonestodetectcontext– Butagain,donotwanttosendalldatatoserver– Doasmuchofitaspossibleondevice–filter/processdataatsource

Distributed Systems, Edinburgh, 2018

Page 9: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

Networkinginmobilesystems

•  Difficulty:–  Thenetworkgraphchanges– Anodeisnotalwaysconnectedtothesamerouter

•  Examplesystem:Mobilead-hocnetworks– Ad-hoc:Unplanned– Devicessimplyconnecttonearbydevicesandroutepackets

– Alsoappliestosensornetworks

Distributed Systems, Edinburgh, 2018

Page 10: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

RouEnginadhocwirelessnetworks

•  Findroutebetweenpairsofnodeswishingtocommunicate.

•  ProacEveprotocols:maintainrouEngtablesateachnodethatisupdatedaschangesinthenetworktopologyaredetected.

–  Heavyoverheadwithhighnetworkdynamics(causedbylink/nodefailuresornodemovement).

–  NotpracEcalfornetworksthatchangefrequently

Distributed Systems, Edinburgh, 2018

Page 11: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

RouEnginadhocwirelessnetworks

•  ReacEveprotocols:routesareconstructedondemand.NoglobalrouEngtableismaintained.

•  Moreappropriatefornetworkswithhighrateofchanges

–  AdhocondemanddistancevectorrouEng(AODV)–  DynamicsourcerouEng(DSR)

Distributed Systems, Edinburgh, 2018

Page 12: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

DynamicSourceRouEng(DSR)

•  NodeSwantstosendamessagetonodeD•  SiniEatesaaroutediscovery•  Sfloodsthenetworkwithrouterequest(RREQ)message

•  Eachnodeappendsitsownidtothemessage

Distributed Systems, Edinburgh, 2018

Page 13: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

RouteDiscovery:RREQ

Distributed Systems, Edinburgh, 2018

Page 14: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

RouteDiscovery:RREQ

Distributed Systems, Edinburgh, 2018

Page 15: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

RouteDiscovery:RREQ

Distributed Systems, Edinburgh, 2018

Page 16: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

RouteDiscovery:RREQ

Distributed Systems, Edinburgh, 2018

Page 17: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

RouteDiscovery:RREQ

Distributed Systems, Edinburgh, 2018

Page 18: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

RouteDiscovery:RREQ

Distributed Systems, Edinburgh, 2018

Page 19: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

RouteDiscoveryinDSR

•  DesEnaEonDonreceivingthefirstRREQsendsaroutereply(RREP)

•  RREPissentonarouteobtainedbyreversingtherouteinreceivedRREQ

Distributed Systems, Edinburgh, 2018

Page 20: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

RouteDiscovery:RREQ

Distributed Systems, Edinburgh, 2018

Page 21: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

RouteDiscovery:RREQ

Distributed Systems, Edinburgh, 2018

Page 22: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

When

•  Whenalinkfails,anerrormessagewiththelinknameissentbacktoS.

•  Sdeletesanyrouteusingthatlinkandstartsdiscovery.

Distributed Systems, Edinburgh, 2018

Page 23: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

Routecaching

•  Whenanodereceivesorforwardsamessage,itlearnsroutestoallnodesonthepath

•  Advantage:–  SmaynotneedtosendRREQ–  IntermediatenodeonreceivingRREQ,canrespondwithcompleteroute

•  Disadvantage:–  Cachesmaybestale:StriesmanycachedroutesbeforestarEngadiscovery.Or,intermediatenodesreturnoutdatedinformaEon.

Distributed Systems, Edinburgh, 2018

Page 24: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

DSR:SummaryAdvantages:•  Routescomputedonlywhenneeded–goodforchanging

networks•  Cachingcanmakethingsefficient•  DoesnotcreateloopsDisadvantages•  EnEreroutemustbecontainedinmessage:canbelongfor

largenetworks•  FloodingcausescommunicaEontomanynodes•  Stalecachescanbeaproblem•  Notsuitablefornetworkswherechangesaretoofrequent

Distributed Systems, Edinburgh, 2018

Page 25: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

AdhocOn-DemandDistanceVectorRouEng(AODV)

•  MaintainsrouEngtablesatnodessothattherouteneednotbestoredinthemessage

•  NoCaches:OnlyonerouteperdesEnaEon

Distributed Systems, Edinburgh, 2018

Page 26: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

AODVRouteDiscovery

•  SourcefloodsthenetworkDistributed Systems, Edinburgh, 2018

Page 27: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

AODVRouteDiscovery

•  Othernodescreateparentpointer•  AnodeforwardsaRREQonlyonce

Dst NxtHp Dist

S S 1

Dst NxtHp Dist

S S 1 Dst NxtHp Dist

S S 1

Distributed Systems, Edinburgh, 2018

Page 28: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

AODVRouteDiscovery

•  Othernodescreateparentpointer•  AnodeforwardsaRREQonlyonce

Dst NxtHp Dist

S S 1

Dst NxtHp Dist

S E 2

Distributed Systems, Edinburgh, 2018

Page 29: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

AODVRouteDiscovery

•  RREPisforwardedviareversepath

Dst NxtHp Dist

S E 2

Dst NxtHp Dist

S S 1

Dst NxtHp Dist

S F 3

Distributed Systems, Edinburgh, 2018

Page 30: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

AODVRouteDiscovery

•  RREPisforwardedviareversepath•  Createsaforwardpath

Dst NxtHp Dist

S E 2

D D 1

Dst NxtHp Dist

S S 1

D F 2

Dst NxtHp Dist

S F 3

D D 0

Dst NxtHp Dist

S S 0

D E 3

Distributed Systems, Edinburgh, 2018

Page 31: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

Routeexpiry

•  ApathexpiresifnotusedforacertainEme.•  IfanodeseesthatarouEngtableentryhasnotbeenusedbythisEme,itremovesthisentry

•  Evenifthepathitselfisvalid•  Goodfornetworkswithfrequentchanges•  BadforstaEcandstablenetworks

Distributed Systems, Edinburgh, 2018

Page 32: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

Cancreateloops

•  AssumeC->Dlinkhasfailed,butAdoesnotknowbecausetheERRmessagewaslost

•  CisnowtryingtofindpathtoD•  ArespondssinceAthinksithasapath•  Createsloop:C-E-A-B-C

Distributed Systems, Edinburgh, 2018

Page 33: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

SequencenumbersinAODV

•  IfAhasaroutetoD,Akeepsasequencenumber.

•  Aincrementsthisnumberperiodically:tellshowoldtheinformaEonis

Distributed Systems, Edinburgh, 2018

Page 34: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

Usingsequencenumbers

•  Rule:sequencenumbermustincreasealonganyroute

Distributed Systems, Edinburgh, 2018

Page 35: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

Sequencenumberruleavoidsloop

•  Adoesnotreply,sinceitssequenceno.islessthanthatofC

Distributed Systems, Edinburgh, 2018

Page 36: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

AODV

•  RouEngtables,messagedoesnotcontainroute

•  Freshroutespreferred•  Oldunusedroutesexpire•  StalerouteslessproblemaEc•  Needssequencenumberstopreventloops•  BeXerformoredynamic,changingenvironments

Distributed Systems, Edinburgh, 2018

Page 37: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

RouEnginadhocnetworks

•  ReacEveprotocols:routesareconstructedondemand.NoglobalrouEngtableismaintained.

•  Moreappropriatefornetworkswithhighrateofchanges

–  AdhocondemanddistancevectorrouEng(AODV)–  DynamicsourcerouEng(DSR)

•  Needflooding–  Inefficientinlargenetworks

Distributed Systems, Edinburgh, 2018

Page 38: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

GeographicalrouEng:UsinglocaEon

•  GeographicalrouEngusesanode’slocaEontodiscoverpathtothatnode.

Distributed Systems, Edinburgh, 2018

x

y

Greedy Routing: Forward to the neighbor that is nearest to the destination

Page 39: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

GeographicalrouEng

•  AssumpEons:–  NodesknowtheirowngeographicallocaEon–  Nodesknowtheir1-hopneighbors–  RouEngdesEnaEonsarespecified

geographically(alocaEon,orageographicalregion)

–  EachpacketcanholdasmallamountofrouEnginformaEon.

Distributed Systems, Edinburgh, 2018

Page 40: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

Sensornetwork

•  Sensorsenabledwithwireless– Cancommunicatewithnearbysensors– CommunicaEontoserverrelaEvelycostly

•  Lowpower,butlotsofdata– Notworthsendingeverythingtoserver

•  Tryusethedatadirectlyinsidethenetwork–  In-networkdistributedcompuEng

Distributed Systems, Edinburgh, 2018

Page 41: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

Problem:Howtofindtherelevantdata?

•  Atouristinaparkasks•  “Whereistheelephant?”•  Outofallthesensors/cameraswhichoneisclosetoanelephant?

Distributed Systems, Edinburgh, 2018

Page 42: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

DatacentricrouEng•  TradiEonalnetworkstrytoroutetoanIPaddress•  FindpathtothenodewithaparEcularID•  Butwhatifwetrytofinddata,notspecificnodes?

•  Akerall,deliveringdataistheulEmategoalofrouEngandnetworks

•  Datacentricstorage–  Storagedependsonthedata(elephant,giraffe,song…)

•  DatacentricrouEng(search)–  Routetothedata

Distributed Systems, Edinburgh, 2018

Page 43: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

DistributedDatabase

•  InformaEonProducer– Canbeanywhereinthenetwork– Maybemobile– Manyproducersmaygeneratedataofthesametype

•  UserorInformaEonConsumer– Canbeanywhere– Maybemany

Distributed Systems, Edinburgh, 2018

Page 44: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

DistributedDatabase:Challenges

•  Consumerdoesnotknowwheretheproduceris,andviceversa

•  Needtosearch:Mustbefast,efficient

Basicmethods(e.g.usingfloods):•  Push:Producerdisseminatesdata•  Pull:Consumerlooksforthedata•  Push-pull:Bothproducer,consumersearchforeach-other

Distributed Systems, Edinburgh, 2018

Page 45: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

Distributedhashtables

•  Useahashonthedata:h(song1.mp3)=node#26

•  Anyonethathassong1.mp3informsnode#26•  AnyonethatneedsSong1.mp3checkswithnode#26

•  UsedinpeertopeersystemslikeChord,pastryetc

Distributed Systems, Edinburgh, 2018

Page 46: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

GeographicHashTables•  Contentbasedhashgivescoordinates:–  h(lion)=(12,07)

•  Producersendsmsgto(12,07)bygeographicrouEngandstoresdata

•  Consumersendsmsgto(12,07)bygeographicrouEngandgetsdata

Distributed Systems, Edinburgh, 2018

Page 47: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

GHT

•  Whatifthereisnosensorat(12,07)?

•  Usethesensornearesttoit

Distributed Systems, Edinburgh, 2018

Page 48: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

Faulthandling•  Whatifhomenodeadies?•  Replicas(nodessurroundingahashlocaEon)haveaEmerthattriggersanewcheck

•  Anewnodebecomeshome

Distributed Systems, Edinburgh, 2018

Page 49: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

GHT

•  Advantages– Simple– Handlesloadbalancingandfaults

•  Disadvantages– NotdistancesensiEve:everyonehastogotohashnodeevenifproducerandconsumerareclose

–  Ifadataisqueriedorupdatedoken,thatnodehasalotoftraffic–boXleneck

Distributed Systems, Edinburgh, 2018

Page 50: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

RumorRouEng

•  Producer:Senddataalongacurveorrandomwalk,leavedataorpointersonnodes

•  Consumer:Routealonganothercurveorrandomwalk,hopetomeetdataorpointer

Distributed Systems, Edinburgh, 2018

Page 51: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

RumorrouEng

•  Eachnodemaintainsalistofevents•  Addseventsastheyhappen

•  Agents:Packetsthatcarryeventsinthenetwork– Aggregateeventsofeachnodetheypassthrough

•  Agentsmoveinrandomwalk.From1-hopneighborsselectonethathasnotbeenvisitedrecently

Distributed Systems, Edinburgh, 2018

Page 52: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

•  D

Distributed Systems, Edinburgh, 2018

Page 53: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

Mobile,Ad-hocandSensornetwork

•  Adifficultmodel–leastinfrastructure,lowpowernodes,communicaEon/computaEonexpensive

•  NotenErelyrealisEc•  However,itmakesleastnumberofassumptons

–  usefulasabasisfordevelopingdistributedprotocols/algorithms

– Whichcanthenbeenhancedusingavailableinfrastructureinspecificcases

Distributed Systems, Edinburgh, 2018

Page 54: Distributed Systems Ad hoc and sensor networks€¦ · Networking in mobile systems • Difficulty: – The network graph changes – A node is not always connected to the same router

Emergingtechnologies

•  IoT:localcomputaEonandcommunicaEonisimportant– Efficiency– Privacy

•  DevicetodevicecommunicaEon– Comingin5G– Ad-hocnetworkstosupplementcellnetworks

Distributed Systems, Edinburgh, 2018


Recommended