Ch09-Wireless Embedded Internet
-
Upload
nguyen-ngoc-thai -
Category
Documents
-
view
26 -
download
0
description
Transcript of Ch09-Wireless Embedded Internet
-
1Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
WirelessSensorNetworks
Dr.Ing.VoQueSonEmail:[email protected]
-
2Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
Chapter9:WirelessEmbeddedInternet ICMPv6AutoconfigurationNeighborDiscovery IProutinginWSNs:RPLEmbeddedweb REST/CoAP
Chapter10:Lab/DemoProgrammingwithTinyOS/ContikiRoutinginWSNsDataCollectionIPv6/6LoWPAN
Content
-
3Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
IPv6review IPv4andIPv6comparison 6LoWPAN:IPv6Header
Compression:supportL3routing(RouteOver)
6LoWPANNeighborDiscovery
-
4Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
ICMPv6 InternetControlMessage
Protocolv6 ModificationfromICMPfor
IPv4 NeighborDiscovery(ND)
ReplaceARP,ICMP ReachabilityofNeighbors Hostsusetodiscoveryrouters,
autoconfigurationofaddresses
DuplicateAddressDetection(DAD)
5NDmessages: RouterSolicitation(type133) RouterAdvertisement(type134) NeighborSolicitation(type135) NeighborAdvertisement(type
136) Redirect(type137)
-
5Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
Autoconfiguration
-
6Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
IPRoutinginWSNs LowpowerandLossyNetwork(LLN)consistsofanedge
router(alsocalledasLLNBorderRouterLBR),Router(R)andHost(H): Hchoosesonlythedefaultrouter Rforwardstraffic ROLLoperatesonlywithinLoWPAN andterminatesatLBR
-
7Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
RPL:newtrendinWSNRoutingProtocolforLowpowerandLossy Network(LLNs)LLN:LowpowerandLossy networks(LLNs)aretypically
composedofmanyembeddeddeviceswithlimitedpower,memory,andprocessingresourcesinterconnectedbyavarietyoflinks,suchasIEEE802.15.4orLowPowerWiFi.ThereisawidescopeofapplicationareasforLLNs,includingindustrialmonitoring,buildingautomation(HVAC,lighting,accesscontrol,fire),connectedhome,healthcare,environmentalmonitoring,urbansensornetworks,energymanagement,assetstrackingandrefrigeration
-
8Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
LLNs:Fact LLNshavenottobeconfusedwithWirelessSensorNetworks
AWSNisanLLN,butnottheopposite! LLNsarenotnecessarilywireless.
Industrialautomationnetworksarewired. LLNswilluseIPv6.Nodiscussionsaboutthis.
IPv4isadeadhorse. LLNnodescannotbeeasilyconfigured.
Typicallytheyrecheap,smallandwithverylimitedmemory/CPU
-
9Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
LLNs:OpenIssues Transmissionefficiency(6lowpan)
Nodesrunonbattery.Savingenergyisapremium.IPv6Headersmustbecompressed.
Nodebootstrap(6lowpannd) Configurationisanightmare,andnormalIPv6autoconfigurationis
toochatty,NS/NAaswell,etc,.
Routing(ROLL) Routingrequirementsarescenariobased.Mainly:
onetoone(configuration,datareading) manytoone(datagathering) onetomany(datadissemination)
-
10Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
DAGandDODAG DAG:DirectedAcyclicGraph(Fig.B)DAGroot:anodewithintheDAGthathasnooutgoingedgeAllpathsterminatedataDAGrootAlledgesareorientedinsuchawaythatnocyclesexist(Fig.Ais
notaDAG) DODAG:DestinationOrientedDAG(Fig.C)DefinesaDAGthatformspathstoasinglelogicalroot
-
11Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
WhyDODAGforRPL?TrafficinLLNMainlyforP2MPandMP2Ptrafficflows
Asopposedtoatreetopology,DODAGenables(re)routearoundloss/interferenceandeasilyadaptstransientchanges
RPLorganizesatopologyasaDirectedAcyclicGraph(DAG)thatispartitionedintooneormoreDestinationOrientedDAGs(DODAGs)TherootinDAGactsasasinkP2MPandMP2Ptraffic
DODAGroot>LBR Informationstoredandprocessingatothernodescanbereduced
-
12Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
UpwardandDownwardRoutes Upward:thedirectionfromleafnodes
towardstheDODAGroot DataflowtowardstheDAGrootMP2P
trafficflows
Downward:thedirectionfromtheDODAGroottowardsleafnodes DataflowawayfromtheDAGroot
P2MPtrafficflows
Pointtopointdataflowviaupanddownroute
UpwardRoute
-
13Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
RankvsOF Rank:node'sindividualpositionrelativetoothernodeswith
respecttoaDODAGroot IncreasesintheDowndirectionanddecreasesintheUpdirection RankcomputeddependsontheObjectiveFunction (OF)e.g.
calculatedasasimpletopologicaldistance(hopcounts)ormayalsobecalculatedasafunctionoflinkmetrics
ObjectiveFunction(OF):DefinestheoptimizationobjectivestocomputetheRank Optimizationobjectives:minimizingenergy,minimizinglatency,or
satisfyingsomeconstraints,etc Dictateshowrouters(parents)insidetheDODAGareselected
-
14Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
RPLInstance RPLInstance:ComposedofoneormoredisjointDODAGs,eachof
whichhasanuniqueDODAGID AllDODAGsinthesameRPLInstance usethesameOF(Objective
Function)
RPLInstanceID:identifiesasetofoneormoreDestinationOrientedDAGs(DODAGs) RPLinstanceID canbeusedtoidentifydifferentOFs
RPLInstanceID andDODAGID uniquelyidentifiesasingleDODAGinthenetwork differentDODAGID=differentrootnode
-
15Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
DAGConstruction DistanceVector
advertisepathcost(routingmetric)
chooseaparent(defaultrouter/nexthop)thatminimizepathcost
Avoidsloops&counttoinfinity Assigneverynodearank
NodeRank:RelativepositionwithinaDODAG
Rankstrictlydecreasingtowardstheroot
Parents&Siblings Parentsnodeswithlowerranks Siblingsnodeswithsameranks
-
16Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
DataPathValidation&LoopDetection PPLpacketinformation(Up/Downroute)is
transportedwithadatapacket Ondemandloopdetectionusingdata
packetsmaintainingauptodateroutingtopologycan
wasteenergyforLLNswithinfrequentdata Aninconsistencybetweentherouting
decisionforapacket(upwardordownward)andtheRankrelationshipbetweenthetwonodesindicatesapossibleloop E.g.ifS3receivesapacketflaggedasmoving
intheupwarddirection,andifthatpacketrecordsthatthetransmitter(S2)isofalowerRank thanthereceivingnode(S3)
S3shouldinitiatealocalrepairRPLdoesnotguaranteetheabsenceofloopsbutrathertriestoavoidthemandspecifiesmechanismstodetectloopsviadatapathvalidation
-
17Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
CreationofUpwardroutes DIOmessages SomenodesareconfiguredtobeDODAG
roots DODAGrootsadvertisetheirpresence
(affiliationwithaDODAG,routingcost,andrelatedmetrics)bysendinglinklocalmulticast DIOmessagestoallRPLnodes
NodeslistenforDIOs tojoinanewDODAG(thusselectingDODAG
parents),ortomaintainanexistingDODAG,according
tothespecifiedObjectiveFunctionNodesupdateroutingtableentries,forthe
destinationsspecifiedbytheDIOmessageNodescandecidetojoinoneormoreDODAG
parentsasthenexthopforthedefaultroute
-
18Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
CreationofDownwardRoutes:DAOMessages RPLusesDestinationAdvertisementObject
(DAO)messagestoestablishdownwardroutes
DAOmessagesareanoptionalfeatureforapplicationsthatrequireP2MPorP2Ptraffic
RPLsupportstwomodesofdownwardtraffic Storing(fullystateful) Nonstoring(fullysourcerouted)
-
19Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
StoringModevsNonStoringmode Storingmode
Creationofroutes DAOpropagatestowardstherootvia
therouters Eachroutermaintainsroutestoeach
routerinWSNs Datagoeshopbyhop(eachrouter
forwardsthepackettotherightnexthop)
Nonsoringmode Onlytherootstoresroutestotheall
routersinWSNs Calculatesroutestoalldestinationby
piecingtogethertheinfo(addressoftherouters)collectedfromDAOmessages
Dataforwardsusingsourcerouting
-
20Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
StoringModevsNonStoringmode Storingmode:
Requiresmorestoragecapacitiesandmemoryoneachrouter Efficientcommunications Extramechanismtoavoidloops(e.g.useofRPLpacketinformation)
Nonstoringmode: Doesnotrequireadditionalstateontherouters,butincreasesthe
messageoverhead Trafficthroughtherootnodeincreasesforinternaltraffic(e.g.P2P
trafficwithina6LoWPAN) Loopcanbeavoidedbycheckingheaders?
Thedatapackettravelsuptoacommonancestoratwhichpointitisforwardedinthedowndirectiontothedestination
-
21Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
RouteConstructionandForwarding Uproutestowardsnodesofdecreasing
rank ViaDAGparents(alwaysforwardtolower
rankwhenpossible)mayforwardtosiblingifnolowerrank
exists
Downroutestowardsnodesofincreasingrank Nodesinformparentsoftheirpresenceand
reachability Forwardhopbyhop(storingmode)orusing
sourcerouting(nonstoringmode)
-
22Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
Summary:BuildingDODAG RouterssendsDIO(DODAGInformationObject)messagesUseslinklocalmulticasting Indicatesarespectiverank(=position),accordingtoametric
(e.g.hopcount)w.r.t.therootUpwardroutes(pathstowardstheroot)arecreatedDefinestheoptimizationobjectivewhenformingupwardroute
Linkproperties:(Reliability,Latency),Nodeproperties:(Poweredornot)
Objective:optimizepathsbasedononeormoremetricsNodeissuesDAO(DestinationAdvertisementObject)
messagesPropagatesviaDAOparentsdiscoveredduringDIOpropagationDAOcanbeacknowledgedDownwardroutesarecreate
-
23Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
DAGConstruction LLNlinksaredepicted LBRisconfiguredbythe
systemadministrator(TherecouldbeseveralLBR)
Linksareannotatedw/ETX RPLusesnewCMPv6
messages DIO:DODAGInformationObject DAO:DestinationAdvertisement
Object DIS:DODAGInformation
Solicitation
A B C
EDF
G H I
1
3
2
11
11
1
4
1
1
1 11
1
LBR1
-
24Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
DAGConstruction ObjectiveCodePointfor
exampleMetric:ETX Objective:MinimizeETX Depthcomputation:Depth~ETX
Notethatapracticalcomputationmaybemorecoarse
A B C
EDF
G H I
1
3
2
11
11
1
4
1
1
1 11
1
LBR1
-
25Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
DAGConstruction LBR1multicastsRADIO NodesA,B,Creceiveand
processRADIO NodesA,B,Cconsiderlink
metricstoLBR1andtheoptimizationobjective
TheoptimizationobjectivecanbesatisfiedbyjoiningtheDAGrootedatLBR1
NodesA,B,CaddLBR1asaDAGparentandjointheDAG
A B C
EDF
G H I
1
3
2
11
11
1
4
1
1
1 11
1
LBR1
RA:RouteAdvertisement
-
26Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
DAGConstruction NodeAisatDepth1inthe
DAG,ascalculatedbytheroutineindicatedbytheexampleOCP(Depth~ETX)
NodeBisatDepth3,NodeCisatDepth2
NodesA,B,Chaveinstalleddefaultroutes(::/0)withLBR1assuccessor
A B C
EDF
G H I
1
3
2
11
LBR1
11
1
4
1
1
1 11
1
-
27Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
C
DAGConstruction TheRAtimeronNodeC
expires NodeCmulticastsRADIO LBR1ignoresRADIOfrom
deepernode NodeBcanaddNodeCas
alternateDAGParent,remainingatDepth3
NodeEjoinstheDAGatDepth3byaddingNodeCasDAGParent
A B
EDF
G H I
1
3
2
11
LBR1
11
1
4
1
1
1 11
1
Ifanodeisconfiguredtoactasarouter,itstartsadvertisingthegraphinformationtoitsneighborsAleafnode,itsimplyjoinsthegraphanddoesnotsendanyDIOmessage
-
28Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
DAGConstruction LBR1multicastsDIO NodeAisatDepth1,andcan
reach::/0viaLBR1withETX1
NodeBisatDepth3,withDAGParentsLBR1,andcanreach::/0viaLBR1orCwithETX3
NodeCisatDepth2,::/0viaLBR1withETX2
NodeEisatDepth3,::/0viaCwithETX3
A B C
EDF
G H I
1
3
2
11
LBR1
11
1
4
1
1
1 11
1
-
29Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
DAGConstruction
C
TheRAtimeronNodeAexpires NodeAmulticastsRADIO LBR1ignoresRADIOfrom
deepernode NodeBaddsNodeA NodeBcanimprovetoamore
optimumpositionintheDAG NodeBremoves LBR1,NodeC
asDAGParents NodeBremoves (keepsas
backup) ::/0viaLBR1withETX3 ::/0viaCwithETX3
Adds: ::/0viaAwithETX2
A B
EDF
G H I
1
3
2
11
LBR1
11
1
4
1
1
1 11
1
-
30Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
DAGConstruction NodeAisatDepth1,::/0via
LBR1withETX2 NodeBisatDepth2,::/0via
AwithETX2 NodeCisatDepth2,::/0via
LBR1withETX2 NodeEisatDepth3,::/0via
CwithETX3
A B C
EDF
G H I
1
3
2
11
LBR1
11
1
4
1
1
1 11
1
-
31Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
DAGConstruction DAGConstruction
continues Andiscontinuously
maintained Thisripplingeffectbuildsthe
graphedgesoutfromtheroottotheleafnodeswheretheprocessterminates
Eachnodeofthegraphhasaroutingentrytowardsitsparentinahopbyhopfashion
Theleafnodecansendapacketallthewaytorootofthegraphbyjustforwardingthepackettoitsimmediateparent
A B C
EDF
G H I
1
3
2
11
LBR1
11
1
4
1
1
1 11
1
-
32Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
A
EDF
G H
MP2PTraffic viaUpwardRouteMP2Ptrafficflowsinwards
alongDAG,towardDAGRoot DAGRootmayalsoextend
connectivitytootherprefixesbeyondtheDAGroot,asspecifiedintheDIO
NodesmayjoinmultipleDAGsasnecessarytosatisfyapplicationconstraints
1
3
2
11
LBR1
11
1
4
1
1
1 11
1I
B C
-
33Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
DownwardRouteandDestinationAdvertisements
DestinationAdvertisementsbuilduproutingstateinsupportofP2MPtrafficflowsoutward,fromthesinktoothernodes
DAusesthesameDAG Forsimplicity,wewillfocusona
subsetofDAintheexample Nodesinformparentsoftheir
presenceandreachabilitytodescendantsbysendingaDAOmessage
Nodecapableofmaintainingroutingstate>Aggregateroutes
Nodeincapableofmaintainingroutingstate>attachanexthopaddresstothereverseroutestackcontainedwithintheDAOmessage
A B C
EDF
G H I
1
3
2
11
LBR1
11
1
4
1
1
1 11
1
-
34Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
DestinationAdvertisements Somenodesmaybeableto
storeroutingstateforoutwardflows(LBR1,A,F)
Somenodesmaynot(B,D) Somenodesmayhavea
limitedability;DAsmayindicateapriorityforstorage
A B
DF
G H
1
LBR1
1
1
1
1
1
1
-
35Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
DestinationAdvertisements DAsmaybetriggeredbyDAG
rootornodewhodetectsachange
DAtimersconfiguredsuchthatDAsstartatgreaterdepth,andmayaggregateastheymoveup
A B
DF
G H
1
LBR1
1
1
1
1
1
1
-
36Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
DestinationAdvertisements LBR1triggersDestination
AdvertisementmechanisminDIO GemitsNAtoFwithDAO
indicatingreachabilitytodestinationprefixG::
FstoresG::viaG HemitsNAtoFfordestination
prefixH:: FstoresH::viaH
1
LBR1
1
1
1
1
1
1H
A B
DF
G
NA:NeighborAdvertisement
-
37Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
G
DestinationAdvertisements SupposeinthisexampleFhasa
prefixF*::capableofaggregating{F::,G::,H::} Themethodtoprovisionsuchaprefixis
beyondthescopeofRPL
FemitsNAtoDwithDAOindicatingreachabilitytodestinationprefixF*::
Dcannotstore
(continued)
A B
DF
H
1
LBR1
1
1
1
1
1
1
-
38Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
F
G
A
H
DestinationAdvertisements DaddsFtotheReverseRouteStack
intheDAO,andpassesDAOontoBforF*::[F]
DalsoemitsaDAOindicatingprefixD::toB
Bcannotstoreroutingstate
(continued)
1
LBR1
1
1
1
1
1
1
B
D
-
39Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
DestinationAdvertisements BaddsDtotheReverseRoute
StackintheDAOforD::,andpassesDAOD::[D]ontoA
AstoresD::viaB,withthepiecewisesourceroute[D]
BalsoemitsaDAOindicatingprefixB::toA
AstoresB::viaB
(continued)
1
LBR1
1
1
1
1
1
1
DF
G H
BA
-
40Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
DestinationAdvertisements AemitsDAOstoLBR1for
destinationprefixesA::,B::,D::,andF*
LBR1storesA::viaA,B::viaA,D::viaA,andF*::viaA
AstoredB::viaB,D::viaB[D],F*viaB[D,F]
B,Dstorednothing FstoredG::viaG,H::viaH
1
1
1
1
1
1
1
B
LBR1
DF
G H
A
-
41Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
P2MPTraffic Theroutingstatesetupby
DestinationAdvertisementisusedtodirectP2MPtrafficoutward
LBR1directstrafficforG(F*::)toA Aaddssourceroutingdirective,[D,
F],andforwardstoB Busessourceroutingdirectiveto
forwardtoD...
1
1
1
1
1
1
1
F
G H
A B
LBR1
D
-
42Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
P2MPTraffic Dusessourceroutingdirectiveto
forwardtoF FusesroutingstatetoforwardtoG Notetheuseofsourceroutingto
traversethestatelessregionoftheLLN Thedetailsofthesourcerouting
mechanismarestilltobedefined
1
1
1
1
1
1
1
DF
G H
A B
LBR1
-
43Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
Bydefault,P2Ptrafficfollowsthedefaultrouteuntilanodeisencounteredwhohasamoreexplicitroute
P2PtrafficflowsinwardsalongtheDAGuntilacommonnodeisreachedtodirectthetrafficoutwards
P2PTraffic
1
3
2
11
11
1
4
1
1
1 11
1
A
EDF
G H
LBR1
I
B C
-
44Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
ThedefaultschemeallowsP2Ptrafficwithminimalstaterequiredofnodes butisnotappropriateinallcases
MoreoptimalP2Proutesmaybecomputedandinstallediftheapplicationrequires RPLdoesnotspecifynor
precludesuchamechanismatthistime
P2PTraffic
1
3
2
11
11
1
4
1
1
1 11
1
A
EDF
G H
LBR1
I
B C
-
45Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
ConsiderthecasewherethelinkBDgoesbad
NodeDwillremoveBfromitsDAGparentset
NodeDnolongerhasanyDAGparentsinthegroundedDAG,soitwillbecometherootofitsownfloatingDAG
DAGMaintenance:FloatingDAG
1
3
2
11
11
1
4
1
1
1 11
1
A
EDF
G H
LBR1
I
B C
-
46Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
NodeDmulticastsanRADIOtoinformitssubDAGofthechange
NodeIhasanalternateDAGParent,E,anddoesnothavetoleavetheDAGrootedatLBR1.
NodeIremovesNodeDasaDAGParent
DAGMaintenance:FloatingDAG
1
3
2
11
11
1
4
1
1
1 11
1
A
E
G H
LBR1
B C
F
I
D
-
47Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
NodeFdoesnothaveanoptiontostayintheDAGrootedatLBR1(noalternateDAGParents),soNodeFfollowsNodeDintothefloatingDAG
NodeFmulticastsanRADIO NodesGandHfollowNodeF
intothefloatingDAG
DAGMaintenance:LocalRepair
1
3
2
11
11
1
4
1
1
1 11
1
A
E
LBR1
B C
IG H
F D
-
48Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
ThesubDAGofnodeDhasnowbeenfrozen
NodescontainedinthesubDAGhavebeenidentified,andbyfollowingnodeDintothefloatingDAG,alloldroutestoLBR1havebeenpurged
ThefloatingDAGseekstorejoinagroundedDAG
DAGMaintenance:LocalRepair
1
3
2
11
11
1
4
1
1
1 11
1
A
E
LBR1
B C
IG H
F D
-
49Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
NodeImulticastsanRADIO NodeDseesachanceto
rejoingroundedDAGatdepth5throughNodeI
NodeDstartsaDAGHoptimerofduration 4associatedwithNodeI
DAGMaintenance
1
3
2
11
11
1
4
1
1
1 11
1
A
LBR1
G H
F E
B C
D
I
-
50Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
SupposealinkAFbecomesviable
NodeAmulticastsanRADIO NodeFseesachanceto
rejoingroundedDAGatdepth2throughNodeA
NodeFstartsaDAGHoptimerofduration 1associatedwithNodeA
DAGMaintenance
1
3
2
11
11
1
4
1
1
1 11
1
1
I
A
LBR1
G H
F E
B C
D
-
51Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
NodeFsDAGHopTimerexpires
NodeFjoinstothegroundedDAGatdepth2byaddingAasaDAGparent,andremovingD
NodeFmulticastsanRADIO NodesGandHfollowNodeF
tothegroundedDAG
DAGMaintenance:LoopAvoidance
1
3
2
11
11
1
4
1
1
1 11
1
1
I
LBR1
E
B CA
G H
F D
-
52Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
NodeDseesachancetorejoinDAGLBR1atdepth3throughNodeF
NodeDstartsaDAGHoptimerofduration 2associatedwithNodeF,inadditiontheDAGHoptimeralreadyrunningwithduration 4associatedwithNodeI
DAGMaintenance:LoopAvoidance
1
3
2
11
11
1
4
1
1
1 11
1
1
I
LBR1
E
B CA
G H
F D
-
53Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
NodeDsDAGHoptimerofduration 2tendstoexpirefirst
NodeDjoinsthegroundedDAGatdepth3byaddingNodeFasaDAGParent
ThebreakingoffandrejoiningofthebrokensubDAGisthuscoordinatedwithloopavoidance
DAGMaintenance:LoopAvoidance
1
3
2
11
11
1
4
1
1
1 11
1
1
I
LBR1
E
B CA
G H
F D
-
54Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
Twomechanismstoavoidcounttoinfinity
FloatingDAGLeaveDAG,colorsubDAG,thenlookfornewroutesOperationlocaltonodesthatmustincreasetheirdepthDoesnotguaranteeloopfreedom
SequencenumberchangeLoopfreedom,butexpensivenetworkwideoperationUsedinfrequentlyifpossible
Loop Avoidance
-
55Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
RPL:summaryWorkingwith6LoWPAN SupportIPbasedApplication SupportP2MP,MP2Ptraffic Routingstateisminimized:statelessnodeshavetostoreonly
instance(s)configurationparametersandalistofparentnodes
Takesintoaccountbothlinkandnodepropertieswhenchoosingpaths
Linkfailuresdoesnottriggerglobalnetworkreoptimization
-
56Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
ProtocolStackforWSNsWhatdoesmissingintheprotocolstack?
PHY/MAC802.15.4 Adaptation:6LoWPAN Routing:RPL Transport:UDP ApplicationProtocol?
IPprovidespacketnetworkingoverheterogeneouslinks UDP:Besteffort(packetsmaybesilentlydropped,duplicatedor
delayedandmayarriveoutoforder) thefastestandmostsimplewayoftransmittingdata
TCP:Reliableconnectionoriented IPusesSocketCommunication:endpointsaredefinedby16bit
sourceanddestinationportsandsourceanddestinationIPaddresses
-
57Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
IPbasedApplicationProtocols Widelyusedinternetprotocols(TCP,HTTP,FTP;SIPand
SOAP) Considerableworkhastobedoneforadaptingto6LoWPAN
ExistingprotocolsforWSNs(mainlybasedonUDP)MQTT:MessageQueueTelemetryTransportisdevelopedby
IBM CAP:ZigBeeCompactapplicationProtocol SLP:simpleServiceLocationProtocol Etc..
-
58Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
IPbasedApplicationProtocolsIPbasedapplicationprotocolsover6LoWPAN6LoWPANsupportsthecompressionofUDPportsdowntoarangeof16
shouldbeenoughforlimitednumberofapplicationsthatcanberun
TCPheaderisnoteasytocompressTCPisnotefficientoverlossywirelessmultihopnetworks
WhyUDPfor6LoWPAN?Simple,compressibleandsuitsmostapplicationprotocolsneeds
MulticastsupportReliability?
-
59Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
ApplicationProtocolsforWSNsMQTT(MessageQueueTelemetryTransport)byIBM Lightweightpublish/subscribeprotocoloverTCP/IP
Fixedlengthheader(2bytes)Onetomanymessagedistribution3QoS formessagedelivery(Atmostonce,atleastonce,exactly
once)Applications,e.g.FacebookMessenger
XMLbasedprotocols(SOAP)M2MXML
MessagesarestrictASCII Devicesareidentifiedby128bitUUID BiTXml
RESTful protocolsHTTPCoAP
-
60Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
DesignIssues LinkLayer
Payloadsize,limitedbandwidth,lossy
Multicastsupport Networking
LimitedcompressedUDPport Hostissues
Sleepingcycles Identification(64bit,16bit
addresses) Compression
Headerandpayloadcompression
Endtoendorbyanintermediatenode
Security Applicationlayersecurity Firewallingattheedgerouter
-
61Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
WebServiceDefactoforinterservercommunications
AllInternetserversspeakHTTP/XMLSOAPorRESTarchitectureAdvantagesFormalmessagesequencesInternetwidesupportMostInternetapplicationsusewebservices,whichdependonthebasicRepresentationalStateTransfer(REST)architecture
DisadvantagesforembeddedservicesInefficient,complex
-
62Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
RESTArchitecture RepresentationalStateTransfer(REST)
Describesclientserverandcacheablecommunicationsprotocol,suchasHTTP,tomakesimplecallsbetweennetworkdevices
RESTstylearchitecturesconsistofclientsandservers Clientsinitiaterequeststoservers Serversprocessrequestsandreturnappropriateresponses Requestsandresponsesarebuiltaroundthetransferof
representationsofresources Resources:mostlyidentifiedbyitsURI(Uniform
ResourcesIdentifier) Resourcesmaybewebaddress,aphysicalresourceorsimply
adocumentlocatedsomewhereonaserver Representations:tomanipulateresources
Representationdefinestheformatoftheresource TypicalrepresentationsareHTML,XMLorJSON, butmaybealsobinary,plaintext,MIMEtypes,etc
Methods:allowsclientstoretrieve,modifyordeleteresourcesbyuseoftheirrepresentations Thebasicoperations/methodsonaresourceareGET,PUT,
POSTandDELETE
-
63Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
Resource Protocols(e.g.HTTP,CoAP)
Sourcesofspecificinformation(e.g.sensors,webcontent)
IdentifiedbyanUniformResourceIdentifier(URI)
ManipulationthroughMethods(e.g.GET,PUT)
Representedasjpg,plaintext,etc
-
64Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
WebServicesforWSNs TodayswebservicesarenogoodforembeddedsystemsFTP,HTTP,XML,SOAP
WebservicesforembeddeddevicesRESTful architectureforgoodwebintegrationUDPbasedtransportwithmulticastsupportOverheadsuitableforconstrainednetworksComplexitysuitableforconstrainednodesBuiltinwebdiscoveryandsecurity
TheConstrainedRESTful Environments(CoRE)workinggroupaimsatrealizingtheRESTarchitectureforconstrainednodesandnetworkse.g.8bitmicrocontrollerswithlimitedRAMandROMnetworks(e.g.6LoWPAN)
-
65Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
CoAP:ConstrainedApplicationProtocol Aspecializedwebtransferprotocolforusewithconstrained
networksandnodes M2Mapplications(smartenergy,buildingautomation,etc) Tomonitorsimplesensors(e.g.temperaturesensors,lightswitches,and
powermeters) Tocontrolactuators(e.g.lightswitches,heatingcontrollers,anddoor
locks) Tomanagedevices
Embeddedwebtransferprotocol(coap://) Asynchronoustransactionmodel UDPbindingwithreliabilityandmulticastsupport GET,POST,PUT,DELETEmethods URIsupport Small,simpleheader
-
66Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
WhatisCoAP (andisnot)?CoAP isARESTful protocolBothsynchronousandasynchronousForconstraineddevicesandnetworksSpecializedforM2MapplicationsEasytoproxyto/fromHTTP
CoAP isnotAreplacementforHTTPGeneralHTTPcompressionSeparatefromtheweb
-
67Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
COREArchitecture UseofwebservicesontheInternet
dependsontheRepresentationalStateTransfer(REST)architecture
RESTful protocoltocaterthespecialrequirementsofaconstrainedenvironment SimpleRESTful protocoltransport Create,Read,Update,Delete,Notify
Small,simpleheader 4bytebaseheader TLVoptions,typically1270bytesper
option URIsupport:e.g.
coap://fec0::1:5683/temp Subsetofcontenttypes SubsetofHTTPcompatibleresponse
codes UDPbindings defaultport=5683
C:Constrainednode sensornodesNonconstrainednodes server,proxy,node,etc
-
68Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
CoAP Requirements
-
69Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
TheTransactionModelTransportCoAP isdefinedforUDP
MessagingSimplemessageexchangebetweenendpointsCON,NON,ACK,RST
RESTRequest/ResponsepiggybackedonmessagesMethod,ResponseCodeandOptions(URI,contenttypeetc.
-
70Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
MethodsofCoAP GET:retrievestheinformationoftheresourceidentifiedby
therequestURI PUT:requeststhatthefile/resourceidentifiedbytherequest
URItobeupdatedwiththeenclosedmessagebody.Ifdoesnotexsist,itcreatesanewresource
POST:Submitsdatatobeprocessedtotheidentifiedresource.Thedataisincludedinthebodyoftherequest.Thismayresultinthecreationofanewresourceortheupdatesofexistingresourcesorboth
DELETE:requeststhattheresourceidentifiedbytherequestURItobedeleted
-
71Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
CoAP MessageFormat Ver:Version, T:TransactionType
(CON,NON,ACK) OC:Numberofoptions Code:Methodor
ResponseCode MessageID:AuniqueID
assignedbytheoriginator
OptionDelta Differencebetweenthisoptiontypeandtheprevious!
Length Lengthoftheoptionvalue(0270)!
Value ThevalueofLengthbytesimmediatelyfollowsLength
MessageFormat
OptionHeader
-
72Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
CoAP Code Structureofthe8bit
Responsecode:
3classes: 2 Success 4 Clienterror 5 Servererror
Example:"NotFound"iswrittenas4.04 indicatingavalueofdecimal132
-
73Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
ExampleofCoAP Message
-
74Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
TransactionMessagesofCoAP Confirmable(CON)
Toknowitdidarriveortodeliverthereply
ReturnmessagetypeACK/RST Acknowledgment(ACK)
ACKtotheCONmessage(identifiedbyamessageID)
Payloadcarriesmoredata Reset(RST)
TolettheclientknowtheCONmessageisreceived,butprocessingfailed
E.g.nodehasrebooted NonConfirmable(NON)
DonotrequireanACK E.g.repeatedreadingsfroma
sensor
-
75Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
CoAP OperationCoAP interactionissimilartotheclient/servermodel(CoAP endpoints)URIandContenttypesupport(likeinHTTP)
MessageexchangeissimilartoHTTPRequestactionisoriginatedbyaclient(usingaMethodcode)
RequestisforaResource(identifiedbyaURI)onaserverResponseissentwithaResponseCode
-
76Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
CoAP OperationUnlikeHTTP,CoAP dealsOperatesoverUDP,withreliableunicastandmulticastsupport
Retransmission(=reliableunicast)ACoAP endpointkeepstrackofopenConfirmablemessagesitsentthatarewaitingforaresponse
SimpleCongestionControl exponentialbackoffmechanism
Dealswithmessageinterchangesseperately
Servermightneedlongertimetoobtaintherepresentationofresource.Thisresultsintheclientretransmittingtherequest
-
77Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
CoAP Operation OperatesoverUDP,with
reliableunicastandbesteffortmulticastsupport
CONvsNONmessages? IfCON/NONmessages
cannotbeprocessed,ServersendsRSTmessage
WhyMID&Token?
-
78Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
CoAP Options ContentType:SpecifiestheformatoftheapplicationpayloadMaxAge:Maximumageforamessagetobecached ProxyUri:DefinesanabsoluteURItoaproxy Token:Matchesaseparateresponsetoarequest UriHost:SpecifiestheInternethostofaresource(onlyadded
ifnotrepresentingthedestinationIPaddressoftherequest) UriPath:Specifiestheresourceofthehost UriPort:Specifiestheportofthehost(onlyaddedifdiffers
fromthedestinationUDPportrequest) UriQuery:Indicatesadditionaloptionsfortherequest Etc..
-
79Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
RequestExampleRequestandResponseCONmessage
NONmessage
Dealingwithpacketloss
-
80Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
RequestExampleNormalresponse
-
81Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
Caching CoAP includesasimplecaching
model Cacheability determinedby
responsecode Freshnessmodel
MaxAgeoptionindicatescachelifetime
Validationmodel ValiditycheckedusingtheEtag
Option Aproxyoftensupportscaching
Usuallyonbehalfofasleepingnode,
andtoreducenetworkload
-
82Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
Observation TheObserveOption,when
present,modifiestheGETmethodsoitdoesnotonlyretrievearepresentationofthecurrentstateoftheresourceidentifiedbytherequestURI,butalsorequeststheservertoaddtheclienttothelistofobserversoftheresource.
Inaresponse,theObserveOptionidentifiesthemessageasanotification,whichimpliesthattheclienthasbeenaddedtothelistofobserversandthattheserverwillnotifytheclientoffurtherchangestotheresourcestate
-
83Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
BlockTransfer Transferslargerthancanbeaccommodatedinconstrainednetworklink
layerpacketscanbeperformedinsmallerblocks. Nohardtomanageconversationstateiscreatedattheadaptationlayer
orIPlayerforfragmentation.
-
84Telecomm.Dept.FacultyofEEEWSN2013
HCMUT
ResourceDiscovery ResourceDiscoverywithCoRE
LinkFormat WeblinkingasperRFC5988 Discoveringthelinkshostedby
CoAP servers GET/.wellknown/core Returnsalinkheaderstyle
format URL,relation,type,interface,
contenttypeetc.