Lec 01-03
Lec 01-03
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:
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
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.
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
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
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)
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
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)
Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
DSAP SSAP Control Information
(1B) (1B) (1-2B) (Payload)
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.
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)
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)
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
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
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)
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)
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
Dr. Dev Narayan Yadav Department of CSE, National Institute of Technology Rourkela
Access Code Header Payload CRC
54b 0-274b 16b
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
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 ...
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
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
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
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