0% found this document useful (0 votes)
28 views65 pages

Lec 01-03

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views65 pages

Lec 01-03

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

IoT and Embedded Systems

Course Instructor: Dr. Dev Narayan Yadav


Department of CSE, NIT Rourkela
Email: yadavd@nitrkl.ac.in
Room – CS231

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
Syllabus (for midterm)
 Network Reference Model: OSI TCP/IP
 MAC protocol: IEEE 802.2/4/5/11, RTS, ETS, Hidden/Exposed
Terminal
 IPv4/IPv6: IP Classes, IP Design, Addressing, Routing
 Introduction to IoT: Application, Challenges, Enabling
Technologies.
 Books:
• Internet of Things :Principles and Paradigms by Rajkumar Buyaa and Amir
Vahid Dastjerdi, Elsevier.
• Internet of Things: A Hands-on approach by A Bahga and V Madisetti,
University press.
• The Internet of Things: Enabling Technologies, Platforms, and Use cases by
P Raj and A C Raman, CRC Press.

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
IoT vs Embedded System
 Embedded Systems: A special-purpose computer system designed
to perform a specific task.
• It typically consists of a microcontroller/microprocessor, along with
memory and input/output peripherals.
• Example:

 Internet of Things (IoT): Network of interconnected computing


devices that are embedded with sensors and software's with
communication capabilities.
• Collect, exchange, and act on data over the internet or other
networks, often without direct human intervention.
• Examples:

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
IoT vs Embedded System
Feature Embedded System IoT System
Connectivity Standalone/local connection WiFi, LTE

Focus Real time control Remote access, data monitoring


Communication Often no communication TCP/IP, MQTT, CoAP, HTTP
Data Handling Local data Send and receive data from cloud
Power and Resources Low-power, battery operated More memory and more power
Security Basic Encryption, Authentication
Example Microwave Oven, ABS break Fitness band, Smart bulb

 IoT System  Embedded System + Internet + Cloud Integration


+ Data Driven Intelligence + Remote Access.
 All IoT devices are embedded systems, but not all embedded
systems are IoT.

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
OSI Reference Model

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
Why Do We Need a Network Model?
 In a digital world, communication involves many steps and
components  applications, operating systems, networks, routers,
and more.
• When something goes wrong, i.e. you send an email... but it does not
arrives; website loads halfway and then freezes.
• How do you know where the issue is?
• Is it your device, Wi-Fi, ISP, or the remote server?
• Without a structured model like OSI, it would be extremely difficult
to pinpoint errors, design protocols, or ensure different systems can
talk to each other.
• A layered model gives us a way to break down the problem and
debug systematically.

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
ISO OSI Reference Model
 OSI: Open Systems Interconnection
 Developed by ISO (International Organization for
Standardization) in 1984
 It provides a conceptual framework to understand and design how
data is transmitted from one device to another in a network.
 It has 7 layers, each with a specific function, working together to
support communication.
 An Analogy (Postal System):
• Writing  Packaging  Sorting  Transport  Delivery
• Each stage is well defined and follow some specific rules.
• In OSI model also each layer preforms a focused task, making the
overall process modular and easier to manage.

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
Application

Presentation

Session
• Each layer adds headers to the data
Transport • Each layer serves an specific role in
delivering data from app to wire.
Network

Data Link

Physical

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
Application Application Layer
• Function: Interface for end-user applications.
Presentation • Example:
• Standard Protocols: HTTP, HTTPS, FTP,
TFTP, SNMP, DNS.
Session
• IoT Specific Protocols:
• MQTT (Message Queuing Telemetry
Transport Transport): lightweight model for sensor
communication.
Network • CoAP (Constrained Application
Protocol): Optimized for constrained
device
Data Link • AMQP (Advanced Message Queuing
Protocol): reliable queuing, used in
Physical cloud-IoT systems

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
Application Presentation Layer
• Function: Data translation, Encryption and
Presentation Decryption, Compression/Decompression.
• Standard Protocols: SSL/TLS, JPEG, MP4,
ASCII.
Session
• IoT Specific Protocols:
• JSON/XML: widely used for structured
Transport IoT payloads.
• EXI: Compact representation of XML.
Network • CBOR: Binary JSON alternative.

Data Link

Physical

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
Application Session Layer
• Function: Session Establishment,
Presentation Maintenance and Termination,
• Standard Protocols: RPC, PPTP, NetBIOS.
• IoT Specific Protocols:
Session
• LwM2M: device management protocol
managing session state for firmware
Transport updates.
• WebSockets: used for real-time bi-
Network directional communication in web-based
IoT dashboards.
Data Link

Physical

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
Application Transport Layer
• Function: Segmentation and Reassembly,
Presentation Flow control, Congestion Control, Error
Recovery, Retransmission.
• Standard Protocols: TCP, UDP.
Session
• IoT Specific Protocols:
• UDP: preferred in low constrained IoT
Transport device.
• QUIC: encrypted low-latency transport
Network built on UDP.

Data Link

Physical

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
Application Network Layer
• Function: Logical addressing, routing, packet
Presentation fragmentation.
• Standard Protocols: IP, ICMP, IGMP IPSec.
• IoT Specific Protocols:
Session
• LoWPAN: IPv6 over low-power WPAN)
• RPL: routing protocol for low-power and
Transport lossy network.
• IPv6: necessary for IoT scalability.
Network

Data Link

Physical

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
Application Data-Link Layer
• Function: Framing, MAC addressing, Error
Presentation detection and Correction.
• Standard Protocols: Ethernet, ARP, PPP
• IoT Specific Protocols:
Session
• IEEE 802.15.4: ZigBee
• BLE: Bluetooth for low energy
Transport • LoRaWAN MAC: long range MAC over
LoRa modulation.
Network • Wi-SUN: mesh networking for smart
cities
Data Link

Physical

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
Application Physical Layer
• Function: Physical transmission, voltage
Presentation levels, signal types, data rate, connector etc.
• Standard Protocols: Ethernet, Fiber, WiFi
(802.11), Bluetooth
Session
• IoT Specific Protocols:
• LoRa: sub-GHz long range low power
Transport communication.
• ZigBee: mess wireless PAN
Network • NB-IoT: cellular based narrowband IoT.
• 802.11ah (WiFi HaLow): low power
WiFi for IoT.
Data Link

Physical

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
Why Layered Architecture
 Modularity & Simplicity:
• Each layer specific task.
• Easier to design, debug and update.
• i.e. updating encryption protocol will not effect routing.

 Interoperability:
• Systems of different vendors can communicate until the follow standard
protocols.
• i.e. A Samsung phone can talk to Apple server using TCP/IP.

 Abstraction:
• Each layer hides details of how services are implemented.
• Independent development of technology at each layer.
• i.e. Application developer need not worry about how bits are transmitted.

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
Why Layered Architecture
 Scalability & Flexibility:
• Easier to add new protocols
• Change hardware and software at any level.
• i.e. Switching from WiFi to Ethernet doesn't effect how HTTP works.

 Troubleshooting Ease:
• Problems can be isolated layer by layer.
• i.e. if ping works but browser doesn't load (the problem is at application
layer.

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
Layer Device & Protocols Function
Layer 1: Physical Cables, Repeater, Modem, USB, Transmission of raw
Bluetooth, IEEE 802.15.4, BLE bits (electrical/optical
(IoT) signals)
Layer 2: Data Link Switch, Bridge, Ethernet, ARP, Frame creation, MAC
PPP, WiFi, MAC addressing, error
detection, flow control
Layer 3: Network Router, Ipv, IPv6, ICMP, IGMP, Addressing (IP),
IPSec routing
Layer 4: Transport TCP, UDP, VoIP Reliable transmission,
segmentation, port
addressing
Layer 5: Session NetBIOS, RPC, PPTP Session establishment
and termination
Layer 6: Presentation SSL/TSL, JPEG, MP4, ASCII, Data transmission,
GZIP encryption, decryption
Layer 7: Application End-user devices, HTTP, HTTPS, User interface,
FTP, DNS, MQTT (for IoT) network service
Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
OSI Model in IoT Smart Home
OSI Layer What Happens Here?
Layer 7: Application Your app communicates with cloud via MQTT/HTTP.
. User adjusts temperature via smartphone.
Layer 6: Presentation Data (e.g., temperature value) may be encrypted using TLS
or formatted in JSON
Layer 3: Session Session is maintained between device and cloud server using
persistent MQTT connection.
Layer 4: Transport Data sent reliably using TCP (or UDP for fast telemetry).

Layer 5: Network Device uses IP (IPv4/6) to route data to remote cloud server.

Layer 6: Data-Link Wi-Fi module handles MAC addressing and frame


construction
Layer 7: Physical Wi-Fi/Bluetooth/LoRa sends electrical/radio signals over
airwaves or cable

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
Which Layer Should be Checked If?
 No Signal.
 Port blocked by firewall.
 Session timeout.
 App not loading.
 Format mismatch.
 IP misconfiguration.
 MAC address conflict.

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
TCP/IP Reference Model

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
TCP/IP Reference Model
 OSI was just a reference model (but was the ideal blueprint),
which was designed to describe the function of communication
system.
 TCP/IP became the real-world implementation.
 TCP/IP was developed by DoD (Department of Defense)
 Main Goal: Transfer data from one device with the condition:
• Reliable
• Accurate
 TCP: Send/Receive data.
 IP: help to find destination.

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
Application

Presentation

Session
} Application

Transport Transport

Network Internet

}
Data Link
Link
Physical

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
Application Application + Session + Presentation Layer
TELNET, FTP, SMPT, DNS, HPPT

Exchange data: TCP, UDP


Transport

Internet Logical Addressing, routing: IP, ICMP, IPSec

Link Physical addressing, describe link: ARP,


Ethernet, WiFi

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
Layer to Device Mapping
OSI Layer What Happens Here?
Application . Sensor data, MQTT publish

Transport TCP/UDP Socket Communication.

Internet IP addressing (Ipv6 for IoT).

Link LoRa, BLE, 802.15.4

Physical Modulation, antenna, connector choice.

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
Data-Link Layer Protocols

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
Data-Link Layer (DLL)
 The DLL is responsible for node-to-node communication, error
detection, and framing. It is divided into two sublayers:
• Media Access Control (MAC)
• Logical Link Control (LLC)

Network LLC Interfaces with network layer and


manages flow and error control
Data Link
Controls how devices access the
MAC
physical medium
Physical

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
Logical Link Control (LLC)
 LLC is a upper sublayer that generally provides the logic for the
data link as it controls the synchronization, multiplexing, flow
control, and even error-checking functions of DLL.
 LLC provides interface between network layer and MAC. Ensure
reliability when multiple protocols run over same MAC.

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
Key Functions of LLC
 Multiplexing: Supports multiple network layer protocols over
same MAC (IP, ARP).
 Error Detection: Uses error detection codes (CRC, Hamming
Code).
 Flow Control: Control speed of data to prevent data overflow.
 Acknowledgement: Can provide Automatic Repeat Request
(ARQ) if using reliable mode.
 Connection Modes: Connectionless and Connection-oriented.
 DSAP/SSAP: identify which protocol to pass above.

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
Media Access Control (MAC)
 MAC is lower sublayer of the Data Link Layer. It defines how
multiple devices share access to a common communication
medium.
 i.e. In a smart farm, 50 sensors try to send soil data wirelessly.
How do we avoid collision?
 i.e. Imagine 10 people trying to talk on a walkie-talkie. Only one
can talk at a time. The MAC protocol decides who speaks next,
and prevents overlap (collision).

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
Importance of MAC in IoT
 MAC is critical in wireless, shared, and resource-constrained
environments like IoT.
 It determines who gets to transmit, and how conflicts are avoided.
 Without MAC protocols, IoT networks would suffer collisions,
delays, and battery drain.
• Dozens or thousands of low-power devices are used in IoT, which
mostly uses wireless medium for communication like – WiFi,
ZigBee, BLE etc.
• Without MAC coordination, there would be constant collisions,
power waste, and data loss.

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
Key Functions of MAC
 Access Control: Determines who transmits data and when (i.e.
CSMA/CA (Wi-Fi), CSMA/CD (Ethernet), TDMA (ZigBee),
FDMA/CDMA (LoRaWAN).
 Collision Handling: Minimize or handle overlapping
transmissions.
 MAC Addressing: Embeds device MAC address into each frame
(unique identifier)
 Frame Formatting: Adds headers (source, destination) and CRC
for error-checking.
 Retransmissions: Ensures reliable delivery when needed (if
acknowledged by protocols).

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
IEEE 802 Standards

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
IEEE 802 Standards
 IEEE 802 is a set of networking standards developed by the
Institute of Electrical and Electronics Engineers (IEEE).
 It defines physical (Layer 1) and data link layer (Layer 2)
technologies for LANs, WANs, and PANs (Personal Area
Networks).
 Each substandard targets a different communication technology:
i.e. Ethernet, Wi-Fi, ZigBee.

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
IEEE Description Uses IoT Role
Standards
802.2 Logical Link ZigBee, Thread Frame structure, protocol
Control (LLC) IDs
802.3 Ethernet Wired LAN, IoT Backbone connectivity
(CSAM/CD) Gateway
802.4 Token Bus Industrial Rarely used in IoT
networks
802.5 Token Ring IBM Networks Rarely used in IoT

802.11 WiFi (CSAM/CA) Smart cameras, Local wireless connectivity


plugs
802.15.1 Low Power BLE Short range communication
Bluetooth
802.15.4 Low-Rate ZigBee, Thread, Wireless connectivity used
Wireless PAN LoWPAN often with IoT

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
IEEE 802. 2 (LLC Standards)
 Provide services like multiplexing, flow control, and error
control, independent of the underlying MAC and physical layer.
DSAP SSAP Control Information
(1B) (1B) (1-2B) (Payload)

 DSAP (Destination Service Access Point): Identifies upper layer


protocol at receiver.
 SSAP (Source Service Access Point): Identifies upper-layer
protocol at sender.
• This values help rout packets to correct network layer protocol at
each node.
• SAP: IP, SNAP, NetBIOS, IPX
• If DSAP = IP, the LLC will pass the payload to the IP protocol on the
destination device.

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
DSAP SSAP Control Information
(1B) (1B) (1-2B) (Payload)

 Control: It defines service type (Type 1, 2 or 3)


 Service Types:
• Type 1: Unacknowledged Connectionless: No ACK, No Seq. (used when
upper layer handles reliability) (1B)
• Type2: Connection-oriented: Establish logical connection between nodes,
uses ACK, retransmission and flow control. (2B): I-Frame (i.e. Seq numb, S-Frame-
:ACK, U-Frame: setup and management)
• Type 3: Acknowledged Connectionless: sends individual frames with
ack, ensures reliability.
 Information: the actual data from upper layer (i.e. network layer)
 Flow control mechanism: Sliding window, (Go-Back-N, Selective
Repeat), Seq. Num.

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
IEEE 802. 3 (Ethernet CSMA/CD)
 IEEE 802.3 defines the MAC and Physical layer standards for
Ethernet. It governs framing, collision detection and data
transmission.

Preamble SFD DA SA Length Data CRC


(7B) (1B) (6B) (6B) (2B) (46-1500B) (4B)

 Frame Size: Max 1518 Bytes (excluding Preamble and SFD),


Min  64 Bytes.
 Preamble + SFD (Start Frame Delimiter) : 10101010… …
10101011, it is used for synchronization/timing control (added by
physical layer)

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
Preamble SFD DA SA Length Data CRC
(7B) (1B) (6B) (6B) (2B) (46-1500B) (4B)

 DA/SA: Destination/Source MAC Address (48-bit)


• First 3byte: Organizational Unique Identifier (OUI), Last 3 Byte:
NIC specific.
• Types:
• Unicast 48-bit one to one.
• Multicast: Starts with 01 one-to-many
• Broadcast: FF:FF:FF:FF:FF:FF to all on LAN
 Length: Length of the data field (excluding preamble).
 Data: Payload (the actual data)
 CRC: 32 bit Cyclic Redundancy Check.

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
Preamble SFD DA SA Length Data CRC
(7B) (1B) (6B) (6B) (2B) (46-1500B) (4B)

 Why Max Size?


• A single system can block all other system.
 Why Min Size?
• Useful for collision detection.

 Sometime Padding bits are added to maintain minimum size.


 Flow control method: CSMA/CD (Carrier Sense Multiple Access with
Collision Detection)  We will discuss in further lecture.

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
IEEE 802. 4 (Token Bus)
Preamble SD FC DA SA Data CRC ED FS

 Combines bus topology with token passing protocol


 SD/ED: Start/End Delimiter.
 FC: Frame Control
 FS: Frame Status
 rarely used in todays IoT devices.

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
IEEE 802. 5 (Token Ring)
SD AC FC DA SA Data FCS ED FS

 Uses a ring topology with a circulating token (one station


transmits at a time)
 AC: Access control (priority bits).
 FCS: Frame Check Sequence
 Speed 4, 16 Mbps, Max 4KB frame, rarely used in todays IoT
nodes

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
IEEE 802.11 Wireless LAN (Wi-Fi)
 IEEE 802.11 defines a set of physical (PHY) and media access
control (MAC) standards for wireless local area networks
(WLANs). It is the most widely used protocol for Wi-Fi, 802.11
uses a shared wireless medium that is more prone to interference,
collision, and mobility issues.
FC Duration Addr1 Addr 2 Addr 3 Seq. Addr 4 Data FCS
ID Control (optional)

 Medium: Wireless (2.4GHz/5GHz)


 Flow control method: CSMA/CA (carrier sense multiple access
with collision avoidance)
 Hidden Node Problem: will discuss in further lecture.

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
FC Duration Addr1 Addr 2 Addr 3 Seq. Addr 4 Data FCS
ID Control (optional)

 Frame Control: Protocol version, Type/Subtype, retry, power


management.
 Duration: Time needed to transmit the frame.
 Addr1,2,3: Source, Destination and Access Point address.
 Seq. Control: Fragmentation and Ordering.
 Data: Payload.
 FCS: 32-bit CRC
 Frame Size: 2034 Bytes
 Security Mechanism: WEP, WPA, WPA2, WPA3.

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
FC Duration Addr1 Addr 2 Addr 3 Seq. Addr 4 Data FCS
ID Control (optional)

 Frame Control:
• 0-1: protocol version
• 2-3 type: mgmt. (00), ctrl (01), data (10)
• 4-7: subtype: frame subtype i.e. ACK
• 8: To DS Destination to distributed system.
• 9: From DS: Source from DS
• 10: More fragments
• 11: Retry (retransmission)
• 12: power save mode
• 13: more buffered data
• 14: encrypted frame.
• 15: order, strict ordering.

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
IEEE 802.15.1 Bluetooth
Access Code Header Payload CRC
54b 0-274b 16b

 IEEE 802.15.1 is the standard for Wireless Personal Area


Networks (WPANs) using Bluetooth technology. It is designed for
short-range, low-power, low-cost wireless communication
between fixed and mobile devices.
 Frequency Band 2.402 – 2.480 GHz (ISM Band – license-free)
 Modulation Techniques GFSK (Gaussian Frequency Shift
Keying)
 Range Typically 10 meters.

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
Access Code Header Payload CRC
54b 0-274b 16b

 Piconet: A master and up to 7 active slave devices.


 Scatternet: Multiple piconets interconnected; devices can act as
bridge nodes between piconets.
 Example in IoT: Bluetooth sensors in a smart home (thermostat,
light bulbs, etc.) form a piconet controlled by a smartphone.

 Access Code: 72-bit, identifies connection. (Synchronization word


+ preamble + Trailer)
 Header: Packet type, Flow, ARQN, SEQN, HEC
 Payload: User Data
 CRC: Error Checking

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
IEEE 802.15.4 Low-Rate WPAN
Frame Control Seq. Addr PAN ID Payload FCS
Numebr Fields

 ZigBee, LoWPAN
 Designed for low-data-rate, low-power IoT devices.
 We will discuss in detail in further lecture.

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
Thank You!

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
Questions
 At which layer do routers operate?
 Which layer handles port number?
 Can encryption be part of application layer too?
 Which protocol is commonly used by IoT sensors for
communication?
 Which layers are mostly software based?
 Which layer is responsible for IP addressing and routing?
 Which OSI layer breaks data into frames?
 Name protocols of each layer?
 Which layer ensures that the data is presented in a readable format
for the application layer?

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
Wired and Wireless Data Transmission
CSMA/CD, CSMA/CA, RTS/CTS

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
Why MAC?
 Must avoid collision, save power and ensure fairness.
 It helps to achieve low latency, low packet loss and energy
efficiency.
 The most commonly used protocols are CSMA/CD and
CSMA/CA.
 IoT perspective:
• Nodes are energy constrained.
• Operates on noisy congested spectrum
• Need collision avoidance not only detection.
• Have varying sleep cycles

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
Data Transmission in Wired Network
 Data Transmission using physical mediums like copper wires or
fiber-optic cables.
 Efficiency: Typically 50-60%

BData
Host A Host B
AData

Host C

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
CSMA/CD
 Media access control protocol used in wired Ethernet (IEEE 802.3)
 Used in wired Ethernet IoT gateways.

Sense Channel

No
Idle Wait
Yes
Transmit Data

Yes
Collision Jam Signal Backoff Retry
No
Transmission ✓

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
Data Transmission in Wired Network
 Collision

Host A Host B

 Once collision  send jam signal (stop transmission); try after


Backoff time.

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
Exponential Backoff
 Attempt 1: 0-1 slot
 Attempt 2: 0-3 slot
 Attempt 3: 0 – 7 slots ...

 Slot time (a fixed time duration generally in microsecond)


 Example: if slot time is 51.2 Microsecond, Max Backoff time in
3rd attempt  7*51.2 = 358 microseconds.

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
CSMA/CD in Wireless?
 Can we use it in wireless network?
• Wireless signals are too weak
• Cant listen while transmitting
• High power consumption from retransmissions

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
Data Transmission in Wireless Network
 Data Transmission using wireless medium i.e. radio waves.
 Efficiency: Typically 30-50%

AData AData

AData
Host A AData

AData AData
Host C Host B

Host D

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
CSMA/CA
 Used in wireless networks (IEEE 802.11/WiFI), ZigBee (802.15.4),
BLE.
 Avoid collision by waiting and reserving the channel before
transmitting.
 Cant transmit and listen simultaneously (hence cant detect  avoid)
Sense Channel

No
Idle Wait
Yes
Wait IFS + Backoff

No
Idle Pause Backoff
Yes
Transmit
Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
Data Transmission in Wireless Network
 First sense channel if idle then transmit data.

AData Host A

Host C Host B

Host D

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
Hidden Terminal Problem
 Occurs when two nodes are out of range of each other but both
communicate with a common node.

AData BData

Host C Host B
Host A

 Wireless device have limited range and thus CSMA/CA fails in


this condition (can effect sensor-to-gateway communication)

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
Exposed Terminal Problem
 Occurs when a node unnecessarily defers transmission due to
sensing nearby communication that wouldn't actually interfere.

AData

Host A Host B Host C Host D

 Why this happed: CSMA/CA is too conservative, can’t distinguish


actual interference risk.

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
Request to Send/Clear to Send (RTS/CTS)
 A handshaking mechanism used in Wi-Fi to solve hidden and
exposed terminal problem.

RST BData
CST

Host C CST Host B


Host A AData
CST

 Sender Sends RTS to Receiver


 Receiver replies with CTS
 All other stations hearing CTS stay silent for that duration (NAV).
 RTS/CTS approach reserve the channel.

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
RST/CST Packet Format
 RST:
• Frame Control – 16bit.
• Duration: 16 bit (time for data + ACK)
• RA/TA: Receiver and Transmitter address (MAC address)
• FCS: Frame check sequence.
• 20 Byte

 CST:
• Frame Control – 16bit.
• Duration: 16 bit (time for data + ACK)
• RA: Receiver address (MAC address)
• FCS: Frame check sequence.
• 14 Bytes

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
 Collision Possible?
• If many devices skip RTS/CTS or cant here CTS due to range issue;
multiple transmission will take place thus collision at AP.
 Optimization:
• Disable in low traffic period
• Enable only if payload>256byte (used in ZigBee Pro, LoRa)

Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela

You might also like