University Institute of Engineering
CSE - AIT
Bachelor of Engineering (Computer Science & Engineering)
WIRELESS SENSOR NETWORKS AND IOT STANDARDS - CSD-334
Lecture – 3.2-3.3-3.4
Delivered by
Er. Nikhil Aggarwal
Assistant Professor, ECE
Topic – Perimeter monitoring, CoAP & DISCOVER . LEARN . EMPOWER
Its message format.
WIRELESS SENSOR NETWORKS
AND IOT STANDARDS
Course Outcome
CO Title Level
Number
CO1 Acquire the knowledge about characteristics and Understand This will be covered in this
challenges faced in wireless sensor networks.
lecture
CO2 Apply the concepts of Layered and Clustered Apply
Architecture to design WSNs to achieve optimization
goals.
CO3 Analyze
Analyze and design routing protocols used for unicast,
multicast and/or data centric routing.
CO4 Ability to select WSN Communication Protocols using Evaluate
the fundamentals of Physical layer and MAC
protocols.
CO5 Design the energy management schemes and quality Create
of service solutions in wireless sensor networks for a
particular application.
2
PERIMETER MONITORING
• It is used for safety purpose
• Track and monitor intruders within the network.
• Both camera sensors and motion sensors are used.
• Motion sensors are deployed in the whole area we are interested.
• Camera sensors are only deployed in the security area.
3
PERIMETER MONITORING
Flow of Event:
• The interested area is divided into layers for the sake of energy efficiency
• Sensors in the outmost layer are always in the “ON” mode, while other sensors are in the
low-power mode.
• When an intruder enters the outmost layer, sensors in this layer will begin to track him/her.
Before the intruder enters the inner layer, sensors around his/her location in the inner
layer are notified to wake up, by the sensors in the outer layer.
• Then sensors in the outer layer will enter the low-power mode. The case is similar if the
intruder moves from a inner layer to an outer layer.
4
PERIMETER MONITORING
Flow of Event:
• When the intruder enters the unauthorized area, everything inside the dark
red square, the near by camera sensor will be woken up.
• The unauthorized area is determined by the distance the camera sensors
can take a clear picture of the Person.
• The camera sensors are responsible for taking pictures of the Person
• When the intruder moves to another sub-area, another camera sensor will
be woken up and this one will enter the low-power mode
5
Constrained Application Protocol (CoAP)
• Constrained Application Protocol (CoAP) is a specialized web transfer
protocol for constrained nodes (Low Power) and constrained networks
(Low Bandwidth)
• It is generally used for machine-to-machine (M2M) applications.
• The protocol was designed by the Internet Engineering Task Force (IETF)
6
Constrained Application Protocol (CoAP)
7
Constrained Application Protocol (CoAP)
THE MAIN FEATURES OF COAP PROTOCOLS ARE:
• Web protocol used in M2M with constrained requirements
• Asynchronous message exchange - The system puts a message in
a message queue and does not require an immediate response
• Low overhead bits (4 Byte Header)
• URI support- A uniform resource identifier (URI) is a strings of characters used to
identify names or resources on the Internet
• Supports UDP – UDP is much simpler and faster than TCP
• Datagram TLS security over UDP
• Proxy and caching capabilities- works as firewall, stores content on
the proxy server itself, allowing web services to share those resource on behalf of
actual server.
8
Constrained Application Protocol (CoAP)
COAP Layers:
• The Messages layer deals with UDP and with asynchronous messages.
• The Request/Response layer manages request/response
9
Constrained Application Protocol (CoAP)
CoAP supports four different message types:
• Confirmable
• Non-confirmable
• Acknowledgment
• Reset
10
Constrained Application Protocol (CoAP)
Confirmable Message
• In CoAP, a reliable message is obtained using a Confirmable message
(CON).
• Using this kind of message, the client can be sure that the message
will arrive at the server.
• A Confirmable message is sent again and again until the other party
sends an acknowledge message (ACK).
• The ACK message contains the same ID of the confirmable message
(CON).
11
Constrained Application Protocol (CoAP)
Confirmable Message
12
Constrained Application Protocol (CoAP)
Confirmable Message
If the server has trouble in managing the incoming request, it can send back
a Reset message (RST) instead of the Acknowledge message (ACK):
13
Constrained Application Protocol (CoAP)
Non-Confirmable Message
• These are messages that don’t require any acknowledge by the server.
• They are unreliable messages and do not contain critical information that
must be delivered to the server.
• Even if these messages are
unreliable, they have a unique ID
14
Constrained Application Protocol (CoAP)
CoAP Request/Response Model
• The CoAP Request/Response is the second layer in the CoAP abstraction
layer.
• The request is sent using a Confirmable (CON) or Non-Confirmable (NON)
message.
• There are several scenarios depending on if the server can answer
immediately to the client request or the answer if not available.
15
Constrained Application Protocol (CoAP)
CoAP Request/Response Model
• If the server can answer immediately to the client request, then if the
request is carried using a Confirmable message (CON), the server sends
back to the client an Acknowledge message containing the response or
the error code:
Tokens are used to match the request
and the response.
16
Constrained Application Protocol (CoAP)
CoAP Request/Response Model
• If the server can’t answer to the request coming from the client
immediately, then it sends an Acknowledge message with an empty
response.
• As soon as the response is available, then the server sends a new
Confirmable message to the client containing the response.
• At this point, the client sends back an Acknowledge message:
17
Constrained Application Protocol (CoAP)
CoAP Request/Response Model
If the request coming from the client is carried using a NON-confirmable message, then the server
answer using a NON-confirmable message.
18
Constrained Application Protocol (CoAP)
CoAP Message Format
19
Constrained Application Protocol (CoAP)
CoAp Message Format
• Version (VER) (2 bits) - Indicates the CoAP version number.
• Type (2 bits) - Indicates if this message is of type Confirmable (0), Non-
confirmable (1), Acknowledgement (2), or Reset (3)
• Token Length (4 bits) - Indicates the length of the variable-length Token field,
which may be 0-8 bytes in length.
• CoAP Request/Response Code (8 bits) - Split into a 3-bit class (most significant
bits) and a 5-bit detail (least significant bits), documented as "c.dd“. The class
can indicate a request (0), a success response (2), a client error response (4), or
a server error response (5). (All other class values are reserved.) As a special
case, Code 0.00 indicates an Empty message.
• Message ID (16 bits) - Used to detect message duplication and to match
messages of type Acknowledgement/Reset to messages of type
Confirmable/Non- confirmable.
20
References
[1] https://www.intechopen.com/chapters/71586
[2] Principles of Wireless Sensor Networks by
Mohammad S.Obaidat, Sudip Misra ,Cambridge
University Press 2014.
[3] https://datatracker.ietf.org/doc/html/rfc7252
[4] https://dzone.com/articles/coap-protocol-step-
by-step-guide
15
THANK YOU
For queries
Email: nikhil.e9191@cumail.in