SlideShare a Scribd company logo
1 of 35
ContikiMAC Radio Duty 
Cycling Protocol 
presented by 
Salah AmeanAhmmed Saeed 
Author 
Adam Dunkels
Introduction 
 Several MAC duty-cycle protocols have been proposed during the last decade 
to 
 address specific WSNs requirements and constraints such as a 
 low energy consumption linked to battery operated nodes 
 Radio Duty-Cycle (RDC) MAC protocols try to reduce the energy consumption 
by allowing a node to keep its radio-transceiver off most of the time. 
 This allow a node to avoid to keep the radio on unnecessarily, i.e when not involved in any 
transmission 
 Idle listening is used to solve such problem in which RDC MAC forces node to switch its 
transceiver between short active(listen) periods and long inactive (sleep) periods
ContikiMAC 
 ContikiMAC is a radio duty cycling protocol that uses periodical wake-ups to 
listen for packet transmissions from neighbors. 
 If a packet transmission is detected during a wake-up, 
 the receiver is kept on to be able to receive the packet. 
 When the packet is successfully received, the receiver sends a link layer 
acknowledgment. 
 To transmit a packet, a sender repeatedly sends its packet until it receives a link 
layer acknowledgment from the receiver Figure 1 
 Packets that are sent a broadcasts do not result in link layer acknowledgments. 
 Instead, the sender repeatedly sends the packet during the full wake-up interval 
 to ensure that all neighbors have received it. Figure 2 
3
ContikiMAC- Figure 1 
4 
A 
D 
A 
D D D D 
D A 
Radio on 
Data frame 
ACK frame 
Sender 
Receiver 
Transmission detected 
Channel check
ContikiMAC broadcast-Figure 2 
5
ContikiMAC Timing 
 ContikiMAC has a power-efficient wake-up mechanism that relies on precise 
timing between transmissions. 
 ContikiMAC wake-ups use CCA that uses RSSI of the radio transceiver to give 
an indication of radio activity on the channel. 
 If the RSSI is below a given threshold, 
 the CCA returns positive, indicating that the channel is clear. 
 If the RSSI is above the 
threshold, the CCA returns negative, indicating that the channel is in use. 
6
Timing Constraints 
 ContikiMAC to work,the timing must satisfy the following constraints 
 When a CCA has detected a packet transmission, ContikiMAC keeps the radio 
on to be able to receive the full packet. 
 When a full packet has been received, a linklayer acknowledgment is 
transmitted. 
7
Timing variables 
8
9 
Figure 3: The ContikiMAC transmission and CCA timing. 
Figure 4: A packet transmission must be long enough so 
that it does not fall between to subsequent CCAs.
Packet Detection and Fast Sleep 
 ContikiMAC must be able to distinguish between transmissions 
 If a neighbor is transmitting a packet to the receiver, 
 the receiver should stay awake to receive the full packet and transmit a link layer 
acknowledgment. 
 Other nodes, which detect the packet, could quickly go to sleep again. 
 Potential receivers cannot go to sleep to quickly, however, 
as they must be able to receive the full packet 
 The simple way to determine how long to be awake when a CCA has 
detected radio activity is to stay awake for tl + ti + tl 
 tl is the transmission time of the longest possible packet 
 To make sure that sleeping till the longest packets have been sent 
10
Packet Detection and Fast Sleep 
 The fast sleep optimization lets potential receivers go to sleep earlier if the CCA 
woke up due to spurious radio noise. 
 The fast sleep optimization leverages knowledge of the specific pattern of 
ContikiMAC transmissions as follows. 
 First, if the CCA detects radio activity, but the radio activity has a duration that is 
longer than the maximum packet length t l, 
 the CCA has detected noise and can go back to sleep. I.e., if the activity period 
is not followed by a silence period. 
 Second, if the radio activity is followed by a silence period that is longer than the 
interval between two successive transmissions, 
 t i, the receiver can go back to sleep. 
 Third, if the activity period is followed by a silence period of the correct length, 
followed by activity, but no start of packet could be detected, the receiver can 
go back to sleep. 
11
12
Phase awareness 
 Phase awareness in the Contiki X-MAC is simple. 
 Every time a node sends a packet to its neighbor, the sender records the time at 
which the receiver was awake. 
 The sender knows the time at which the neighbor was awake, 
 because the receiver sent a strobe acknowledgment packet then. 
 When the sender is aware of the time at which the neighbor was awake, the 
sender then knows the phase of the neighbor. 
13
Phase Usage 
 When a sender is about to send a packet to a neighbor for which the sender is 
aware of its phase, 
 the sender does not start to send its strobes until the neighbor is awake. 
 If the sender misses the awake period of the neighbor, 
 the sender will simply continue to send strobes for an entire period. 
 Thus the mechanism is correct regardless if the phase is correctly recorded or 
not. 
 With correct phase information, the mechanism is more efficient, however. 
 If perfectly tuned, the sender will only need to send a single strobe packet when 
it knows the phase of the neighbor. 
14
ContikiMAC Implementation 
 Contiki real-time timers (rtimer) 
 to schedule its periodic wake-ups to ensure a stable behavior even if many underlying 
processes are running. 
 The real-time timers preempt any Contiki process at the exact time at which they are 
scheduled. 
 The ContikiMAC wake-up mechanism runs as a protothread 
 that is scheduled by a periodic real-time 
timer. 
 This protothread performs the periodic wake-ups 
and implements the fast sleep optimization. 
15
ContikiMAC Implementation-cont’ 
 Transmissions are driven by an ordinary Contiki process: 
 If a wake-up is scheduled to occur when the radio is busy during a 
transmission, 
 the wake-up timer schedules a new wake-up after another wake-up interval 
without performing the wake-up. 
 phase-lock mechanism is implemented as a separate module from ContikiMAC 
 To allow other duty cycle like X-MAC to use it . 
 The phase-lock mechanism maintains a list of neighbors and their wake-up 
phases 
16
ContikiMAC Implementation-cont’ 
 ContikiMAC transmission logic records the time of each packet transmission. 
 When a link layer acknowledgment is received, 
 it notifies the phase-lock module with the transmission time of the last packet. 
 this time is used as an approximation of the wake-up phase of the receiver 
 Before starting a transmission, 
 the ContikiMAC transmission logic calls the phase-lock module to check if it has a recorded 
wake-up phase of the intended receiver. 
 If so, 
 the phase-lock code queues the packet to be transmitted and 
 sets a callback timer (ctimer) at the time of the expected wake-up of the receiver. 
 ContikiMAC will then resume the transmission when the callback occurs. 
17
ContikiMAC Implementation-cont’ 
 The transmission will then be significantly shorter than 
a normal transmission, 
 because it occurs just before the neighbor is expected to be awake. 
 Reducing the length of the transmission thus reduces radio congestion. 
18
Implementation-Drifting neighbors 
 Transmission to neighbor will fail if 
 If a neighbor whose phase is known has rebooted, 
 or if its clock has drifted far enough away from its previous wake-up phase 
 to protect from this, ContikiMAC maintains a count of failed transmissions for 
each known neighbor. 
 After a fixed number of failed transmission (16 in Contiki 2.5), the neighbor is evicted from the 
list of known neighbors. 
 Likewise, if no link layer acknowledgment is received within a fixed time (30 seconds in 
Contiki 2.5), 
 Regardless of the number of transmissions, the neighbor is evicted. 
19
Reliable Packet Transmissions 
 The Contiki X-MAC allows the higher layers to set a flag that tells the MAC layer 
that a packet is expected to be acknowledged. 
 Contiki X-MAC does not switch off its radio after sending the packet 
 The acknowledgment can be sent without anystrobes since the radio is still on 
20
802.15.4 Compatibility 
 it possible to interoperate between an always-on 802.15.4 network and a 
Contiki X-MAC network. 
 Contiki X-MAC provides compatibility with the 802.15.4 link layer standard 
 by forming its messages according to the 802.15.4 specification. 
 All messages, both strobes and data messages, use the 802.15.4 frame and addressing 
format 
21
Implementation -XMAC 
 Different requirements enforces the choice of MAC protocol 
 Radio driver when incoming packets, and by the network layer for outgoing 
packets. 
 X-MAC uses Contiki real-time timer module, in order to provide an exact timing 
behavior. 
 In X-MAC implementation is a function called powercycle(). 
22
Powercycle() 
 Switches the radio on and off as part of the X-MAC idle listening 
 Use rtimer in order to provide an exact timing behavior. 
 this function is scheduled by an rtimer to be called at the exact moment at which is it 
scheduled 
 It is implemented as a protothread 
 When sending or receiving packets, 
 the idle listening is temporarily disabled by a flag being set. 
 The powercycle() function is still called, 
 but it does not switch the radio on and off when the flag is set. 
 This ensures that the phase of the duty cycle is stable after sending or receiving 
packets. 
23
Implementation -LPP 
 The LPP implementation has lower requirements on exactness of timing. 
Therefore, the LPP implementation uses the less exact ctimer module for its 
timing. 
 The ctimer does not provide any guarantees for when a function will be called, 
but it is significantly simpler to use than the rtimer module because ctimers will 
never preempt other code. 
 The LPP function uses a central duty cycling protothread called dutycycle() to 
send probes and to turn the radio on and off. This function is periodically 
scheduled with a ctimer. 
24
Dutycycle() 
 dutycycle 
25
 platformz1 contiki.confi.h 
26
MAC driver -core/net/mac.h 
27
About MAC Drivers 
https://github.com/contiki-os/contiki/wiki/Change-mac-or-radio- 
duty-cycling-protocols#About_MAC_Drivers 
28
MAC Drivers 
• Contiki provides two MAC drivers, CSMA and NullMAC 
• CSMA is the default mechanism. 
• MAC layer receives incoming packets from the RDC layer and uses the RDC layer 
to transmit packets 
• If the RDC layer or the radio layer detects a radio collision 
• The mac will retry later 
• CSMA mechanism is currently the only MAC layer that retransmits packets if a 
collision is detected.
About RDC drivers
Introduction 
• Contiki has several RDC drivers. 
• The most commonly used are 
• ContikiMAC, 
• X-MAC 
• CX-MAC 
• LPP 
• NullRDC 
• ContikiMAC provides a very good power efficiency but is somewhat tailored for the 
802.15.4 radio and the CC2420 radio transceiver
Introduction-types 
• X-MAC 
• is an older mechanism that does not provide the same power-efficiency as 
ContikiMAC but has less stringent timing requirements 
• CX-MAC (Compatibility X-MAC) 
• is an implementation of X-MAC that has more relaxed timing than the default X-MAC 
and therefore works on a broader set of radios. 
• LPP (Low-Power Probing) 
• as a receiver-initiated RDC protocol. 
• NullRDC 
• is a "null" RDC layer that never switches the radio off and that therefore can be used 
for testing or for comparison with the other RDC drivers.
Introduction 
• RDC drivers jobs 
• keep the radio off as much as possible and 
• periodically check the radio medium for radio activity. 
• When activity is detected, 
• the radio is kept on to receive the packet. 
• The transmitted packet must generally be repeated or "strobed" until the 
receiver turns on to detect it. 
• This increases the power usage of the transmitting node as well as 
• adding radio traffic which will interfere with the communication among other nodes. 
• Some protocols solve this by phase optimization
phase optimization 
• Some RDCs allow for "phase optimization" to delay strobing the tx packet until just 
before the receiver is expected to wake. 
• This requires a good time sync between the two nodes; 
• if the clocks differ by 1% the rx wake time will shift through the entire tx phase 
window every 100 cycles, e.g. 12 seconds at 8 Hz. 
• This would make phase optimization useless when there are more than a few 
seconds between packets, as the transmitter would have to start sending well in 
advance of the predicted receiver wake. 
• A clock drift correction might fix this.
MAC folder 
• corenetmac 
• All MAC modules

More Related Content

What's hot

Inter process communication
Inter process communicationInter process communication
Inter process communication
Mohd Tousif
 
Thread scheduling in Operating Systems
Thread scheduling in Operating SystemsThread scheduling in Operating Systems
Thread scheduling in Operating Systems
Nitish Gulati
 
Routing Information Protocol
Routing Information ProtocolRouting Information Protocol
Routing Information Protocol
Kashif Latif
 

What's hot (20)

Sliding window protocol
Sliding window protocolSliding window protocol
Sliding window protocol
 
Leach
Leach Leach
Leach
 
Sliding window protocol(ARQ technique)
Sliding window protocol(ARQ technique)Sliding window protocol(ARQ technique)
Sliding window protocol(ARQ technique)
 
Multiple Access Methods
Multiple Access MethodsMultiple Access Methods
Multiple Access Methods
 
Mac sub layer
Mac sub layerMac sub layer
Mac sub layer
 
Protocols for wireless sensor networks
Protocols for wireless sensor networks Protocols for wireless sensor networks
Protocols for wireless sensor networks
 
Packet radio protocol
Packet radio protocolPacket radio protocol
Packet radio protocol
 
Distance Vector & Link state Routing Algorithm
Distance Vector & Link state Routing AlgorithmDistance Vector & Link state Routing Algorithm
Distance Vector & Link state Routing Algorithm
 
Data link layer
Data link layer Data link layer
Data link layer
 
Network tunneling techniques
Network tunneling techniquesNetwork tunneling techniques
Network tunneling techniques
 
Wsn unit-1-ppt
Wsn unit-1-pptWsn unit-1-ppt
Wsn unit-1-ppt
 
Inter process communication
Inter process communicationInter process communication
Inter process communication
 
Amqp Basic
Amqp BasicAmqp Basic
Amqp Basic
 
Thread scheduling in Operating Systems
Thread scheduling in Operating SystemsThread scheduling in Operating Systems
Thread scheduling in Operating Systems
 
Congestion control in TCP
Congestion control in TCPCongestion control in TCP
Congestion control in TCP
 
RARP, BOOTP, DHCP and PXE Protocols
RARP, BOOTP, DHCP and PXE ProtocolsRARP, BOOTP, DHCP and PXE Protocols
RARP, BOOTP, DHCP and PXE Protocols
 
Routing Information Protocol
Routing Information ProtocolRouting Information Protocol
Routing Information Protocol
 
Link state routing protocol
Link state routing protocolLink state routing protocol
Link state routing protocol
 
Go back-n protocol
Go back-n protocolGo back-n protocol
Go back-n protocol
 
X.25 and frame relay
X.25 and frame relayX.25 and frame relay
X.25 and frame relay
 

Viewers also liked

RSA криптосистем
RSA криптосистемRSA криптосистем
RSA криптосистем
sodhero
 

Viewers also liked (20)

Contiki os timer tutorial
Contiki os timer tutorialContiki os timer tutorial
Contiki os timer tutorial
 
Building the Internet of Things with Thingsquare and Contiki - day 1, part 1
Building the Internet of Things with Thingsquare and Contiki - day 1, part 1Building the Internet of Things with Thingsquare and Contiki - day 1, part 1
Building the Internet of Things with Thingsquare and Contiki - day 1, part 1
 
Building the Internet of Things with Thingsquare and Contiki - day 1, part 3
Building the Internet of Things with Thingsquare and Contiki - day 1, part 3Building the Internet of Things with Thingsquare and Contiki - day 1, part 3
Building the Internet of Things with Thingsquare and Contiki - day 1, part 3
 
Building the Internet of Things with Thingsquare and Contiki - day 1, part 2
Building the Internet of Things with Thingsquare and Contiki - day 1, part 2Building the Internet of Things with Thingsquare and Contiki - day 1, part 2
Building the Internet of Things with Thingsquare and Contiki - day 1, part 2
 
Introduction to CoAP the REST protocol for M2M
Introduction to CoAP the REST protocol for M2MIntroduction to CoAP the REST protocol for M2M
Introduction to CoAP the REST protocol for M2M
 
Rsa Crptosystem
Rsa CrptosystemRsa Crptosystem
Rsa Crptosystem
 
Contiki Presentation
Contiki PresentationContiki Presentation
Contiki Presentation
 
Optimization Analysis
Optimization AnalysisOptimization Analysis
Optimization Analysis
 
RSA криптосистем
RSA криптосистемRSA криптосистем
RSA криптосистем
 
Data Mining: Concepts and Techniques (3rd ed.) — Chapter 5
Data Mining:  Concepts and Techniques (3rd ed.)— Chapter 5 Data Mining:  Concepts and Techniques (3rd ed.)— Chapter 5
Data Mining: Concepts and Techniques (3rd ed.) — Chapter 5
 
Cryptography using rsa cryptosystem
Cryptography using rsa cryptosystemCryptography using rsa cryptosystem
Cryptography using rsa cryptosystem
 
ICT role in Yemen
ICT role in Yemen ICT role in Yemen
ICT role in Yemen
 
Rsa algorithm key generation
Rsa algorithm key generation Rsa algorithm key generation
Rsa algorithm key generation
 
Verkenning internet of things
Verkenning internet of thingsVerkenning internet of things
Verkenning internet of things
 
Data Mining: Concepts and Techniques chapter 07 : Advanced Frequent Pattern M...
Data Mining: Concepts and Techniques chapter 07 : Advanced Frequent Pattern M...Data Mining: Concepts and Techniques chapter 07 : Advanced Frequent Pattern M...
Data Mining: Concepts and Techniques chapter 07 : Advanced Frequent Pattern M...
 
Data Mining: Concepts and Techniques (3rd ed.) — Chapter _04 olap
Data Mining:  Concepts and Techniques (3rd ed.)— Chapter _04 olapData Mining:  Concepts and Techniques (3rd ed.)— Chapter _04 olap
Data Mining: Concepts and Techniques (3rd ed.) — Chapter _04 olap
 
Data Mining: Concepts and Techniques — Chapter 2 —
Data Mining:  Concepts and Techniques — Chapter 2 —Data Mining:  Concepts and Techniques — Chapter 2 —
Data Mining: Concepts and Techniques — Chapter 2 —
 
Adaptive GPS Duty Cycling and Radio Ranging for Energy-efficient Localization
Adaptive GPS Duty Cycling and Radio Ranging for Energy-efficient LocalizationAdaptive GPS Duty Cycling and Radio Ranging for Energy-efficient Localization
Adaptive GPS Duty Cycling and Radio Ranging for Energy-efficient Localization
 
RSA - ALGORITHM by Muthugomathy and Meenakshi Shetti of GIT COLLEGE
RSA - ALGORITHM by Muthugomathy and Meenakshi Shetti of GIT COLLEGE RSA - ALGORITHM by Muthugomathy and Meenakshi Shetti of GIT COLLEGE
RSA - ALGORITHM by Muthugomathy and Meenakshi Shetti of GIT COLLEGE
 
Projet de Conception et de développement
Projet de Conception et de développement Projet de Conception et de développement
Projet de Conception et de développement
 

Similar to ContikiMAC : Radio Duty Cycling Protocol

Lecture 19 22. transport protocol for ad-hoc
Lecture 19 22. transport protocol for ad-hoc Lecture 19 22. transport protocol for ad-hoc
Lecture 19 22. transport protocol for ad-hoc
Chandra Meena
 
Congestion control avoidance
Congestion control avoidanceCongestion control avoidance
Congestion control avoidance
Anthony-Claret Onwutalobi
 

Similar to ContikiMAC : Radio Duty Cycling Protocol (20)

[IJET-V1I3P12] Authors :Inchara K, Shreenath K N,Dr.Srinivasa K G
[IJET-V1I3P12] Authors :Inchara K, Shreenath K N,Dr.Srinivasa K G[IJET-V1I3P12] Authors :Inchara K, Shreenath K N,Dr.Srinivasa K G
[IJET-V1I3P12] Authors :Inchara K, Shreenath K N,Dr.Srinivasa K G
 
Mac protocol for wmn
Mac protocol for wmnMac protocol for wmn
Mac protocol for wmn
 
IRJET- QOS Based Bandwidth Satisfaction for Multicast Network Coding in M...
IRJET-  	  QOS Based Bandwidth Satisfaction for Multicast Network Coding in M...IRJET-  	  QOS Based Bandwidth Satisfaction for Multicast Network Coding in M...
IRJET- QOS Based Bandwidth Satisfaction for Multicast Network Coding in M...
 
Lecture 19 22. transport protocol for ad-hoc
Lecture 19 22. transport protocol for ad-hoc Lecture 19 22. transport protocol for ad-hoc
Lecture 19 22. transport protocol for ad-hoc
 
Thesis Presentation on Renewal theory based 802.15.6 latest.pptx
Thesis Presentation on Renewal theory based 802.15.6 latest.pptxThesis Presentation on Renewal theory based 802.15.6 latest.pptx
Thesis Presentation on Renewal theory based 802.15.6 latest.pptx
 
LTE RACH Procedure
LTE RACH ProcedureLTE RACH Procedure
LTE RACH Procedure
 
Congestion control avoidance
Congestion control avoidanceCongestion control avoidance
Congestion control avoidance
 
Comparison of TCP congestion control mechanisms Tahoe, Newreno and Vegas
Comparison of TCP congestion control mechanisms Tahoe, Newreno and VegasComparison of TCP congestion control mechanisms Tahoe, Newreno and Vegas
Comparison of TCP congestion control mechanisms Tahoe, Newreno and Vegas
 
Comparison of TCP congestion control mechanisms Tahoe, Newreno and Vegas
Comparison of TCP congestion control mechanisms Tahoe, Newreno and VegasComparison of TCP congestion control mechanisms Tahoe, Newreno and Vegas
Comparison of TCP congestion control mechanisms Tahoe, Newreno and Vegas
 
Tcp performance simulationsusingns2
Tcp performance simulationsusingns2Tcp performance simulationsusingns2
Tcp performance simulationsusingns2
 
Mobile transport layer
 Mobile transport layer Mobile transport layer
Mobile transport layer
 
MAC
MACMAC
MAC
 
A Performance Comparison of TCP Protocols
A Performance Comparison of TCP Protocols A Performance Comparison of TCP Protocols
A Performance Comparison of TCP Protocols
 
Mcseminar
McseminarMcseminar
Mcseminar
 
Lecture 10
Lecture 10Lecture 10
Lecture 10
 
Mobile Transpot Layer
Mobile Transpot LayerMobile Transpot Layer
Mobile Transpot Layer
 
WHAT IS MAC-1 presentation for information .pptx
WHAT IS MAC-1 presentation for information  .pptxWHAT IS MAC-1 presentation for information  .pptx
WHAT IS MAC-1 presentation for information .pptx
 
09 Data Link LayerFlow Control.ppt
09 Data Link LayerFlow Control.ppt09 Data Link LayerFlow Control.ppt
09 Data Link LayerFlow Control.ppt
 
14653128.ppt
14653128.ppt14653128.ppt
14653128.ppt
 
Tcp Congestion Avoidance
Tcp Congestion AvoidanceTcp Congestion Avoidance
Tcp Congestion Avoidance
 

More from Salah Amean

More from Salah Amean (20)

WSN protocol 802.15.4 together with cc2420 seminars
WSN protocol 802.15.4 together with cc2420 seminars WSN protocol 802.15.4 together with cc2420 seminars
WSN protocol 802.15.4 together with cc2420 seminars
 
protothread and its usage in contiki OS
protothread and its usage in contiki OSprotothread and its usage in contiki OS
protothread and its usage in contiki OS
 
Location in ubiquitous computing, LOCATION SYSTEMS
Location in ubiquitous computing, LOCATION SYSTEMSLocation in ubiquitous computing, LOCATION SYSTEMS
Location in ubiquitous computing, LOCATION SYSTEMS
 
Bonjour protocol
Bonjour protocolBonjour protocol
Bonjour protocol
 
Mobile apps-user interaction measurement & Apps ecosystem
Mobile apps-user interaction measurement & Apps ecosystemMobile apps-user interaction measurement & Apps ecosystem
Mobile apps-user interaction measurement & Apps ecosystem
 
ict culturing conference presentation _presented 2013_12_07
 ict culturing conference presentation _presented 2013_12_07 ict culturing conference presentation _presented 2013_12_07
ict culturing conference presentation _presented 2013_12_07
 
Data Mining: Concepts and Techniques_ Chapter 6: Mining Frequent Patterns, ...
Data Mining:  Concepts and Techniques_ Chapter 6: Mining Frequent Patterns, ...Data Mining:  Concepts and Techniques_ Chapter 6: Mining Frequent Patterns, ...
Data Mining: Concepts and Techniques_ Chapter 6: Mining Frequent Patterns, ...
 
Data mining :Concepts and Techniques Chapter 2, data
Data mining :Concepts and Techniques Chapter 2, dataData mining :Concepts and Techniques Chapter 2, data
Data mining :Concepts and Techniques Chapter 2, data
 
Data Mining:Concepts and Techniques, Chapter 8. Classification: Basic Concepts
Data Mining:Concepts and Techniques, Chapter 8. Classification: Basic ConceptsData Mining:Concepts and Techniques, Chapter 8. Classification: Basic Concepts
Data Mining:Concepts and Techniques, Chapter 8. Classification: Basic Concepts
 
Data mining: Concepts and Techniques, Chapter12 outlier Analysis
Data mining: Concepts and Techniques, Chapter12 outlier Analysis Data mining: Concepts and Techniques, Chapter12 outlier Analysis
Data mining: Concepts and Techniques, Chapter12 outlier Analysis
 
Data Mining: Concepts and techniques classification _chapter 9 :advanced methods
Data Mining: Concepts and techniques classification _chapter 9 :advanced methodsData Mining: Concepts and techniques classification _chapter 9 :advanced methods
Data Mining: Concepts and techniques classification _chapter 9 :advanced methods
 
Data Mining: Concepts and techniques: Chapter 13 trend
Data Mining: Concepts and techniques: Chapter 13 trendData Mining: Concepts and techniques: Chapter 13 trend
Data Mining: Concepts and techniques: Chapter 13 trend
 
Data Mining: Concepts and techniques: Chapter 11,Review: Basic Cluster Analys...
Data Mining: Concepts and techniques: Chapter 11,Review: Basic Cluster Analys...Data Mining: Concepts and techniques: Chapter 11,Review: Basic Cluster Analys...
Data Mining: Concepts and techniques: Chapter 11,Review: Basic Cluster Analys...
 
Data Mining Concepts and Techniques, Chapter 10. Cluster Analysis: Basic Conc...
Data Mining Concepts and Techniques, Chapter 10. Cluster Analysis: Basic Conc...Data Mining Concepts and Techniques, Chapter 10. Cluster Analysis: Basic Conc...
Data Mining Concepts and Techniques, Chapter 10. Cluster Analysis: Basic Conc...
 
Data Mining: Concepts and Techniques (3rd ed.) - Chapter 3 preprocessing
Data Mining:  Concepts and Techniques (3rd ed.)- Chapter 3 preprocessingData Mining:  Concepts and Techniques (3rd ed.)- Chapter 3 preprocessing
Data Mining: Concepts and Techniques (3rd ed.) - Chapter 3 preprocessing
 
introduction to data mining tutorial
introduction to data mining tutorial introduction to data mining tutorial
introduction to data mining tutorial
 
Characterizing wi fi-link_in_open_outdoor_netwo
Characterizing wi fi-link_in_open_outdoor_netwoCharacterizing wi fi-link_in_open_outdoor_netwo
Characterizing wi fi-link_in_open_outdoor_netwo
 
Tutorial on dhcp
Tutorial on dhcp Tutorial on dhcp
Tutorial on dhcp
 
Contiki Operating system tutorial
Contiki Operating system tutorialContiki Operating system tutorial
Contiki Operating system tutorial
 
Ns3 implementation wifi
Ns3 implementation wifiNs3 implementation wifi
Ns3 implementation wifi
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 

ContikiMAC : Radio Duty Cycling Protocol

  • 1. ContikiMAC Radio Duty Cycling Protocol presented by Salah AmeanAhmmed Saeed Author Adam Dunkels
  • 2. Introduction  Several MAC duty-cycle protocols have been proposed during the last decade to  address specific WSNs requirements and constraints such as a  low energy consumption linked to battery operated nodes  Radio Duty-Cycle (RDC) MAC protocols try to reduce the energy consumption by allowing a node to keep its radio-transceiver off most of the time.  This allow a node to avoid to keep the radio on unnecessarily, i.e when not involved in any transmission  Idle listening is used to solve such problem in which RDC MAC forces node to switch its transceiver between short active(listen) periods and long inactive (sleep) periods
  • 3. ContikiMAC  ContikiMAC is a radio duty cycling protocol that uses periodical wake-ups to listen for packet transmissions from neighbors.  If a packet transmission is detected during a wake-up,  the receiver is kept on to be able to receive the packet.  When the packet is successfully received, the receiver sends a link layer acknowledgment.  To transmit a packet, a sender repeatedly sends its packet until it receives a link layer acknowledgment from the receiver Figure 1  Packets that are sent a broadcasts do not result in link layer acknowledgments.  Instead, the sender repeatedly sends the packet during the full wake-up interval  to ensure that all neighbors have received it. Figure 2 3
  • 4. ContikiMAC- Figure 1 4 A D A D D D D D A Radio on Data frame ACK frame Sender Receiver Transmission detected Channel check
  • 6. ContikiMAC Timing  ContikiMAC has a power-efficient wake-up mechanism that relies on precise timing between transmissions.  ContikiMAC wake-ups use CCA that uses RSSI of the radio transceiver to give an indication of radio activity on the channel.  If the RSSI is below a given threshold,  the CCA returns positive, indicating that the channel is clear.  If the RSSI is above the threshold, the CCA returns negative, indicating that the channel is in use. 6
  • 7. Timing Constraints  ContikiMAC to work,the timing must satisfy the following constraints  When a CCA has detected a packet transmission, ContikiMAC keeps the radio on to be able to receive the full packet.  When a full packet has been received, a linklayer acknowledgment is transmitted. 7
  • 9. 9 Figure 3: The ContikiMAC transmission and CCA timing. Figure 4: A packet transmission must be long enough so that it does not fall between to subsequent CCAs.
  • 10. Packet Detection and Fast Sleep  ContikiMAC must be able to distinguish between transmissions  If a neighbor is transmitting a packet to the receiver,  the receiver should stay awake to receive the full packet and transmit a link layer acknowledgment.  Other nodes, which detect the packet, could quickly go to sleep again.  Potential receivers cannot go to sleep to quickly, however, as they must be able to receive the full packet  The simple way to determine how long to be awake when a CCA has detected radio activity is to stay awake for tl + ti + tl  tl is the transmission time of the longest possible packet  To make sure that sleeping till the longest packets have been sent 10
  • 11. Packet Detection and Fast Sleep  The fast sleep optimization lets potential receivers go to sleep earlier if the CCA woke up due to spurious radio noise.  The fast sleep optimization leverages knowledge of the specific pattern of ContikiMAC transmissions as follows.  First, if the CCA detects radio activity, but the radio activity has a duration that is longer than the maximum packet length t l,  the CCA has detected noise and can go back to sleep. I.e., if the activity period is not followed by a silence period.  Second, if the radio activity is followed by a silence period that is longer than the interval between two successive transmissions,  t i, the receiver can go back to sleep.  Third, if the activity period is followed by a silence period of the correct length, followed by activity, but no start of packet could be detected, the receiver can go back to sleep. 11
  • 12. 12
  • 13. Phase awareness  Phase awareness in the Contiki X-MAC is simple.  Every time a node sends a packet to its neighbor, the sender records the time at which the receiver was awake.  The sender knows the time at which the neighbor was awake,  because the receiver sent a strobe acknowledgment packet then.  When the sender is aware of the time at which the neighbor was awake, the sender then knows the phase of the neighbor. 13
  • 14. Phase Usage  When a sender is about to send a packet to a neighbor for which the sender is aware of its phase,  the sender does not start to send its strobes until the neighbor is awake.  If the sender misses the awake period of the neighbor,  the sender will simply continue to send strobes for an entire period.  Thus the mechanism is correct regardless if the phase is correctly recorded or not.  With correct phase information, the mechanism is more efficient, however.  If perfectly tuned, the sender will only need to send a single strobe packet when it knows the phase of the neighbor. 14
  • 15. ContikiMAC Implementation  Contiki real-time timers (rtimer)  to schedule its periodic wake-ups to ensure a stable behavior even if many underlying processes are running.  The real-time timers preempt any Contiki process at the exact time at which they are scheduled.  The ContikiMAC wake-up mechanism runs as a protothread  that is scheduled by a periodic real-time timer.  This protothread performs the periodic wake-ups and implements the fast sleep optimization. 15
  • 16. ContikiMAC Implementation-cont’  Transmissions are driven by an ordinary Contiki process:  If a wake-up is scheduled to occur when the radio is busy during a transmission,  the wake-up timer schedules a new wake-up after another wake-up interval without performing the wake-up.  phase-lock mechanism is implemented as a separate module from ContikiMAC  To allow other duty cycle like X-MAC to use it .  The phase-lock mechanism maintains a list of neighbors and their wake-up phases 16
  • 17. ContikiMAC Implementation-cont’  ContikiMAC transmission logic records the time of each packet transmission.  When a link layer acknowledgment is received,  it notifies the phase-lock module with the transmission time of the last packet.  this time is used as an approximation of the wake-up phase of the receiver  Before starting a transmission,  the ContikiMAC transmission logic calls the phase-lock module to check if it has a recorded wake-up phase of the intended receiver.  If so,  the phase-lock code queues the packet to be transmitted and  sets a callback timer (ctimer) at the time of the expected wake-up of the receiver.  ContikiMAC will then resume the transmission when the callback occurs. 17
  • 18. ContikiMAC Implementation-cont’  The transmission will then be significantly shorter than a normal transmission,  because it occurs just before the neighbor is expected to be awake.  Reducing the length of the transmission thus reduces radio congestion. 18
  • 19. Implementation-Drifting neighbors  Transmission to neighbor will fail if  If a neighbor whose phase is known has rebooted,  or if its clock has drifted far enough away from its previous wake-up phase  to protect from this, ContikiMAC maintains a count of failed transmissions for each known neighbor.  After a fixed number of failed transmission (16 in Contiki 2.5), the neighbor is evicted from the list of known neighbors.  Likewise, if no link layer acknowledgment is received within a fixed time (30 seconds in Contiki 2.5),  Regardless of the number of transmissions, the neighbor is evicted. 19
  • 20. Reliable Packet Transmissions  The Contiki X-MAC allows the higher layers to set a flag that tells the MAC layer that a packet is expected to be acknowledged.  Contiki X-MAC does not switch off its radio after sending the packet  The acknowledgment can be sent without anystrobes since the radio is still on 20
  • 21. 802.15.4 Compatibility  it possible to interoperate between an always-on 802.15.4 network and a Contiki X-MAC network.  Contiki X-MAC provides compatibility with the 802.15.4 link layer standard  by forming its messages according to the 802.15.4 specification.  All messages, both strobes and data messages, use the 802.15.4 frame and addressing format 21
  • 22. Implementation -XMAC  Different requirements enforces the choice of MAC protocol  Radio driver when incoming packets, and by the network layer for outgoing packets.  X-MAC uses Contiki real-time timer module, in order to provide an exact timing behavior.  In X-MAC implementation is a function called powercycle(). 22
  • 23. Powercycle()  Switches the radio on and off as part of the X-MAC idle listening  Use rtimer in order to provide an exact timing behavior.  this function is scheduled by an rtimer to be called at the exact moment at which is it scheduled  It is implemented as a protothread  When sending or receiving packets,  the idle listening is temporarily disabled by a flag being set.  The powercycle() function is still called,  but it does not switch the radio on and off when the flag is set.  This ensures that the phase of the duty cycle is stable after sending or receiving packets. 23
  • 24. Implementation -LPP  The LPP implementation has lower requirements on exactness of timing. Therefore, the LPP implementation uses the less exact ctimer module for its timing.  The ctimer does not provide any guarantees for when a function will be called, but it is significantly simpler to use than the rtimer module because ctimers will never preempt other code.  The LPP function uses a central duty cycling protothread called dutycycle() to send probes and to turn the radio on and off. This function is periodically scheduled with a ctimer. 24
  • 28. About MAC Drivers https://github.com/contiki-os/contiki/wiki/Change-mac-or-radio- duty-cycling-protocols#About_MAC_Drivers 28
  • 29. MAC Drivers • Contiki provides two MAC drivers, CSMA and NullMAC • CSMA is the default mechanism. • MAC layer receives incoming packets from the RDC layer and uses the RDC layer to transmit packets • If the RDC layer or the radio layer detects a radio collision • The mac will retry later • CSMA mechanism is currently the only MAC layer that retransmits packets if a collision is detected.
  • 31. Introduction • Contiki has several RDC drivers. • The most commonly used are • ContikiMAC, • X-MAC • CX-MAC • LPP • NullRDC • ContikiMAC provides a very good power efficiency but is somewhat tailored for the 802.15.4 radio and the CC2420 radio transceiver
  • 32. Introduction-types • X-MAC • is an older mechanism that does not provide the same power-efficiency as ContikiMAC but has less stringent timing requirements • CX-MAC (Compatibility X-MAC) • is an implementation of X-MAC that has more relaxed timing than the default X-MAC and therefore works on a broader set of radios. • LPP (Low-Power Probing) • as a receiver-initiated RDC protocol. • NullRDC • is a "null" RDC layer that never switches the radio off and that therefore can be used for testing or for comparison with the other RDC drivers.
  • 33. Introduction • RDC drivers jobs • keep the radio off as much as possible and • periodically check the radio medium for radio activity. • When activity is detected, • the radio is kept on to receive the packet. • The transmitted packet must generally be repeated or "strobed" until the receiver turns on to detect it. • This increases the power usage of the transmitting node as well as • adding radio traffic which will interfere with the communication among other nodes. • Some protocols solve this by phase optimization
  • 34. phase optimization • Some RDCs allow for "phase optimization" to delay strobing the tx packet until just before the receiver is expected to wake. • This requires a good time sync between the two nodes; • if the clocks differ by 1% the rx wake time will shift through the entire tx phase window every 100 cycles, e.g. 12 seconds at 8 Hz. • This would make phase optimization useless when there are more than a few seconds between packets, as the transmitter would have to start sending well in advance of the predicted receiver wake. • A clock drift correction might fix this.
  • 35. MAC folder • corenetmac • All MAC modules

Editor's Notes

  1. Why /??? Low-power wireless devices must keep their radio transceivers off as much as possible to reach a low power consumption, but must wake up often enough to be able to receive communication from their neighbors.
  2. 1- ContikiMAC: nodes sleep most of the time and periodically wake up to check for radio activity. 2-If a packet transmission is detected, the receiver stays awake to receive the next packet and sends a link layer acknowledgment. To send a packet, the sender repeatedly sends the same packet until a link layer acknowledgment is received
  3. 1-Packets that are sent a broadcasts do not result in linklayer acknowledgments 2- the sender repeatedly sends the packet during the full wake-up interval to ensure that all neighbors have received it.
  4. When a CCA has detected a packet transmission, ContikiMAC keeps the radio on to be able to receive the full packet. When a full packet has been received, a linklayer acknowledgment is transmitted. The time it takes for an acknowledgment packet to be transmitted, t a, and the time it takes for an acknowledgment packet to be detected, td, establishes the lower bound for the check interval tc.
  5. tc: the interval between each CCA.
  6. This is to ensure that either the first or the second CCA is able to see the packet transmission. If t c would be smallerthan t i, two CCAs would not be able to reliably detect a transmission
  7. In no ipv6 contikimac_driver is defined in (net/mac/contikimac.h) extern const struct rdc_driver contikimac_driver;