M2M: one device → one server, closed, one job. IoT: many things → cloud → many apps, open.
Question 2
Name the three layers, bottom to top.
Answer
Perception → Network → Application.
Question 3
Which two layers does the five-layer model add?
Answer
Processing and Business (network is renamed transport). "Please Take Pizza And Biryani".
Ask a student to answer aloud, then click the card to check.
Today's plan
By the end of today, you can…
1️⃣ Tell physical design from logical design
2️⃣ Draw the blocks of a generic IoT device
3️⃣ Place IoT protocols in their layers
4️⃣ List the six functional blocks of an IoT system
5️⃣ Explain four communication models and two APIs
🎯 Course outcome OC 1: design and architecture of IoT systems
Syllabus link: Module 1 → Introduction to IoT: Physical & Logical Design of IoT Systems.
Hook story
Two engineers open the same smart doorbell
🔧 Hardware engineer sees parts: a camera, a motion sensor, a chip, a Wi-Fi radio, a memory card, a speaker, a battery.
💻 Software engineer sees jobs: detect a visitor, send an alert, store the video, check who is logged in, show it in the app.
🤔 Think: who is right about what the doorbell "is"?
Both. Parts and protocols = physical design. Jobs and how they talk = logical design. Today we learn to describe any IoT system both ways.
Part A · Two views of design
Physical design is the body; logical design is the mind
Physical design = the things and protocols. Logical design = the functions and how they communicate, without naming exact parts.
Physical: devices, their blocks, and protocols used.
Logical: functional blocks, communication models, APIs.
Physical answers "what is it made of?"
Logical answers "what does it do, and how?"
Cricket team: the physical view lists players, bats and pads; the logical view lists roles — opener, bowler, keeper — and the signals between them.
🧱 Physical design
IoT devices ("things")
Blocks inside a device
IoT protocols by layer
🧠 Logical design
Functional blocks
Communication models
Communication APIs
Today's map: Part A = physical (slides 5–12) · Part B = logical (slides 14–24)
The physical design of an IoT system describes the actual things (devices) — what blocks they contain and which protocols they use to communicate.
The logical design is an abstract view. It describes functional blocks (what jobs the system does), communication models (patterns of who talks to whom) and communication APIs (the interfaces programs use), without saying which chip or sensor is used.
The same logical design can be built with different hardware — for example with an Arduino or a Raspberry Pi.
Q1. "The system uses a publish–subscribe model." Physical or logical design?
Logical — a communication model describes how parts talk, not what they are made of.
Q2. "The node uses an 802.15.4 radio." Physical or logical?
Physical — it names an actual protocol and radio hardware.
Part A · Physical design
Inside a generic IoT device: six building blocks
Every IoT device has a brain (processor) joined to blocks that sense, act, connect, store and handle audio/video.
Processor: runs the program and makes decisions.
I/O interfaces: sensors in, actuators out.
Connectivity: Wi-Fi, Bluetooth, mobile, Ethernet.
Memory/storage and audio/video interfaces.
Smart doorbell: motion sensor (input), chime and lock (output), Wi-Fi (connectivity), memory card (storage), camera and speaker (audio/video).
A "thing" in IoT is a device with a unique identity that can sense, act and communicate. Inside, it usually has a processor (a microcontroller or a small CPU) connected to several interfaces.
I/O interfaces connect sensors (inputs) and actuators (outputs). Interfaces for internet connectivity link the device to a network. Memory and storage interfaces hold the program and data. Audio/video interfaces connect cameras, microphones and speakers. Some books also add a power block (battery or adapter).
Not every device needs every block — a soil sensor has no camera — but the processor and connectivity are always there.
Q1. Which blocks does a simple soil-moisture sensor node need?
Processor, sensor input, connectivity, a little memory (and power). It needs no audio/video and may have no actuator.
Q2. Why is the processor drawn in the centre?
Every other block connects to it: it reads inputs, decides, drives outputs, stores data and sends it over the network.
Activity · Match it
Smart doorbell: match each part to its block
Click a part on the left, then its block on the right. Correct pairs turn green.
Part A · IoT protocols
IoT protocols work in four layers, like sending a parcel
A protocol is an agreed set of rules for talking. IoT uses four layers of protocols, each doing one part of delivery.
Sending a courier parcel: the road or rail used (link), the address on the box (network), tracked or untracked service (transport), the language of the letter inside (application).
Link — the road: 802.3 Ethernet · 802.11 Wi-Fi · 802.15.4 · 802.16 WiMAX · 2G/3G/4G
This four-layer view of IoT protocols follows the internet's TCP/IP model. Data from an application is wrapped by each lower layer before it is sent, and unwrapped on the other side.
Link layer: how bits travel over a physical medium (cable, radio). Network layer: addressing and routing packets from source to destination. Transport layer: end-to-end delivery — reliable (TCP) or fast and simple (UDP). Application layer: the format and meaning of messages the applications exchange.
Do not confuse these with the three-layer and five-layer architectures from Lecture 2: those describe a whole IoT system; this stack describes how one message is delivered.
Q1. In which layer is IPv6?
The network layer — it gives addresses and routes packets.
Q2. MQTT and HTTP are in which layer?
The application layer.
Part A · Link layer
Link layer: the physical road your data travels on
The link layer decides how bits move over a wire or radio between nearby devices.
802.3 Ethernet: wired, fast, reliable.
802.11 Wi-Fi: wireless LAN for homes and colleges.
802.15.4: low-power, low-rate radio (Zigbee uses it).
802.16 WiMAX and 2G/3G/4G: wide-area wireless.
Your college: lab PCs use Ethernet cables, your phone uses Wi-Fi in the canteen and 4G on the train home.
🗼 WiMAX (802.16) — wireless broadband over long distances
📱 2G / 3G / 4G (mobile) — anywhere with a tower
Trade-off: more range or speed usually costs more power.
The numbers like 802.3 and 802.11 are IEEE standard numbers. IEEE is the engineering body that publishes these standards.
802.15.4 defines low-rate wireless personal area networks (LR-WPAN). It is designed for small, battery-powered devices that send small amounts of data; Zigbee is built on top of it. Mobile networks (2G/3G/4G, now also 5G) give wide coverage for devices on the move, such as vehicle trackers.
Q1. A battery-powered sensor must last a year and sends one small reading every few minutes. Wi-Fi or 802.15.4?
802.15.4 — it is built for low power and low data rates; Wi-Fi uses more power.
Q2. Which link-layer option suits a GPS tracker on a truck?
A mobile network (2G/3G/4G) — the truck moves far beyond any Wi-Fi range.
Part A · Network & transport layers
Network gives the address; transport delivers it
IP puts an address on every packet. TCP delivers carefully; UDP delivers quickly with no promise.
IPv4/IPv6: addresses and routes packets across networks.
6LoWPAN: squeezes IPv6 into tiny low-power radio packets.
📦 TCP ✔ acknowledged ✔ in order ✔ resends lost data ✖ slower, heavier
📢 UDP ✔ fast, light ✔ good for small sensors ✖ no guarantee ✖ no order
Bank payment → TCP · live sensor reading every second → UDP is often fine
IPv4 uses 32-bit addresses and IPv6 uses 128-bit addresses, which gives enough addresses for billions of things. Small 802.15.4 radios carry very short frames, so 6LoWPAN (IPv6 over Low-power Wireless Personal Area Networks) compresses the IPv6 header so it fits.
TCP (Transmission Control Protocol) sets up a connection, numbers the data, waits for acknowledgements and resends lost pieces. UDP (User Datagram Protocol) just sends each message on its own — less work for small devices, but no guarantee. CoAP (application layer) runs on UDP; HTTP and MQTT normally run on TCP.
Q1. Why might a temperature sensor that sends a reading every second use UDP?
UDP is lighter and faster. If one reading is lost, the next one arrives a second later, so guaranteed delivery is not worth the extra cost.
Q2. What does 6LoWPAN do?
It adapts (compresses) IPv6 packets so they can travel over low-power 802.15.4 radios with very small frames.
Part A · Application layer
Application protocols: the languages IoT apps speak
Application protocols set the format and meaning of messages. Each suits a different job.
Web-style: HTTP, CoAP, WebSocket.
Messaging: MQTT, XMPP, AMQP, DDS.
Details come in Lectures 10–11.
Smart home: your app asks the bulb's status with HTTP; the motion sensor broadcasts "movement!" with MQTT to everyone who subscribed.
🌐 HTTP — the web's request–response protocol; runs on TCP
🪶 CoAP — "light HTTP" for tiny devices; runs on UDP
🔁 WebSocket — one open two-way connection
📨 MQTT — lightweight publish–subscribe via a broker
💬 XMPP — real-time messaging and presence (from chat)
🏦 AMQP — reliable business messaging with queues
⚡ DDS — data-centric publish–subscribe for real-time machine systems
HTTP is the protocol behind every website. CoAP (Constrained Application Protocol) keeps HTTP's request–response style but is much lighter and runs over UDP. WebSocket keeps one connection open so both sides can send at any time.
MQTT (Message Queue Telemetry Transport) is a lightweight publish–subscribe protocol using a broker. XMPP (Extensible Messaging and Presence Protocol) came from instant messaging. AMQP (Advanced Message Queuing Protocol) is used for reliable business messaging. DDS (Data Distribution Service) is a publish–subscribe standard for real-time, machine-to-machine systems.
Q1. Which application protocol is like "HTTP for tiny devices"?
CoAP — request–response like HTTP, but lightweight and over UDP.
📊 Poll · Quick check
Which protocol solves this problem?
🐝 A tiny battery sensor uses an 802.15.4 radio. Its frames are very small, but it still needs an IPv6 address to join the internet.
Think for 20 seconds, vote with fingers (1–4), then click an option.
☕ Interactive break
Myth or fact? Vote with your hands, then flip
Myth or fact?
"TCP is always better than UDP."
Myth ❌
TCP is more reliable, but UDP is lighter and faster — often better for small, frequent sensor readings.
Myth or fact?
"Wi-Fi and 802.15.4 work at the same protocol layer."
Fact ✅
Both are link-layer standards: different roads, same job of moving bits nearby.
Myth or fact?
"MQTT replaces IP, so MQTT devices need no IP address."
Myth ❌
MQTT is an application protocol that normally runs on top of TCP/IP.
Click a card to flip it. Who got all three right?
Part B · Logical design
Six functional blocks: the jobs every IoT system does
Logical design splits a system into jobs: sense, communicate, offer services, show apps — with management and security watching everything.
Device: sensing, actuation, monitoring, control.
Communication and services: move data; discovery, control, analytics.
Application: the interface users see.
Management and security cover all layers.
Smart irrigation: soil sensor (device), 4G link (communication), "pump control" service (services), farmer's app (application), remote updates (management), login and encryption (security).
⚙️ Management
📟 Device sensing · actuation · monitoring · control
📡 Communication IoT protocols carry data
🛎️ Services device discovery · control · data publishing · analytics
📱 Application interface for users to view and control
🔒 Security
Device: provides sensing, actuation, monitoring and control. Communication: handles communication using IoT protocols. Services: device monitoring, device control, data publishing and device discovery. Management: functions to govern the system — configuring devices, updating software, checking health. Security: authentication, authorisation, message and content integrity, data security. Application: the interface users use to view status and control the system.
Management and security are drawn as side bars because they apply to every block, not just one.
Q1. Why are management and security drawn as vertical side bars?
Because they apply across all the other blocks — every device, link, service and app must be managed and secured.
Q2. "Find all smart plugs on this network." Which functional block?
Services — device discovery is a service.
Activity · Sort it
Smart irrigation: which block does each job?
Click a job, then its functional block (or drag it).
🌱 Read soil moisture
📡 Send data over 4G
🔍 Discover new sensors on the farm
📱 Farmer's dashboard
🔄 Update sensor software remotely
🔑 Check the farmer's login
⚙️ Switch the pump relay
🔐 Encrypt readings
📟 Device
📡 Communication
🛎️ Services
📱 Application
⚙️ Management
🔒 Security
Part B · Communication models
Four patterns for who talks to whom
A communication model is the pattern of a conversation: who starts, who answers, and whether the line stays open.
College life: asking a teacher a doubt, a class WhatsApp group, a canteen token queue, a phone call — four different patterns.
🙋 Request–response Client asks, server answers. Asking a doubt.
📢 Publish–subscribe Publish to a topic; subscribers receive. WhatsApp group.
📥 Push–pull Producers push into a queue; consumers pull. Token queue.
🔁 Exclusive pair One open two-way line. Phone call.
The same data can be exchanged in different patterns. Choosing the right model affects speed, server load and battery life. The next four slides show each model step by step — these are favourite exam questions, usually asked with a diagram.
Q1. Which model keeps a connection open the whole time?
Exclusive pair.
Part B · Model 1
Request–response: the client asks, the server answers
The client sends a request; the server sends back a response. Each pair is separate.
Client starts; server waits and replies.
Stateless: server keeps no memory between requests.
Simple, but client must keep asking for updates.
Used by HTTP and CoAP; REST APIs.
Weather app: you pull down to refresh; the app requests "current temperature" and the server responds "28 °C".
In the request–response model the client sends a request to the server, the server works out the answer (for example by reading a sensor or a database), and sends a response back.
It is stateless: each request is handled independently, and the server does not need to remember earlier requests. This makes servers simple and easy to scale. The weakness: if the client wants live updates it must keep asking ("polling"), which wastes data and battery.
Q1. What does "stateless" mean here?
The server does not keep information about earlier requests; every request carries what is needed to answer it.
Q2. Why is request–response poor for a live cricket score?
The app would have to keep sending requests every few seconds ("polling"), wasting data and loading the server, and still might be a little late.
Part B · Model 2
Publish–subscribe: send once, all subscribers receive
Publishers send to a topic on a broker; the broker forwards it to every subscriber of that topic.
Publisher: source of data, e.g. a sensor.
Broker: manages topics and forwards messages.
Subscriber: receives topics it signed up for.
Publishers and subscribers don't know each other.
YouTube: a creator uploads once; every subscriber is notified. MQTT works this way for IoT.
The publish–subscribe model has three parts. Publishers are the sources of data; they send data to topics managed by a broker. Subscribers tell the broker which topics they want. When a publisher sends data on a topic, the broker forwards it to all subscribers of that topic.
Publishers do not need to know who the subscribers are, and new subscribers can join any time. This decoupling makes it ideal for IoT, where one sensor's data may feed many apps. MQTT is the best-known IoT protocol using this model.
Q1. A new energy-saving app wants the temperature data too. What must change on the sensor?
Nothing. The app simply subscribes to the "room/temp" topic on the broker; the sensor keeps publishing as before.
Q2. In the diagram, which subscribers get a humidity reading?
Only the dashboard, because it is the only one subscribed to "room/humid".
Part B · Model 3
Push–pull: producers fill a queue, consumers take when ready
Producers push data into a queue; consumers pull it out at their own pace. The queue absorbs the difference.
Producers and consumers don't know each other.
The queue is a buffer in the middle.
Useful when sending and processing speeds differ.
Producers don't wait for consumers.
Canteen at lunch break: students push orders as tokens; the kitchen pulls the next token when a cook is free. The token rack is the queue.
In the push–pull model, data producers push data into queues, and consumers pull data from the queues. Producers do not need to know about consumers.
Queues act as buffers. This helps when the rate at which producers push data differs from the rate at which consumers can process it — for example, lakhs of meters sending readings at midnight while the billing server works through them steadily.
Q1. What problem does the queue solve?
It buffers data when producers send faster than consumers can process, so nothing is lost and producers don't have to wait.
Q2. How is push–pull different from publish–subscribe?
In push–pull, each message in the queue is pulled by a consumer when it is ready; in publish–subscribe, the broker pushes every message to all subscribers of the topic.
Part B · Model 4
Exclusive pair: one open two-way line between client and server
Client and server open one connection and keep it open; both can send any time until one side closes it.
Bidirectional, full-duplex: both talk at once.
Persistent: stays open until closed.
Stateful: server remembers all open connections.
Used by the WebSocket protocol.
Video call: once connected, both people talk and see each other continuously until someone hangs up.
Exclusive pair is a bidirectional, fully duplex communication model that uses a persistent connection between the client and the server. Once the connection is set up, it remains open until the client sends a request to close it. Client and server can send messages to each other at any time after setup.
It is stateful: the server knows about all open connections. That costs server memory, but avoids the overhead of setting up a new connection for every message — great for real-time apps. The WebSocket protocol is based on this model.
Q1. Why is exclusive pair called "stateful"?
The server must remember (keep state for) every open connection, unlike request–response where each request stands alone.
Q2. Give one drawback of exclusive pair.
Each open connection uses server resources, so serving a very large number of clients needs more memory and capacity.
Activity · Which model fits?
Sort each scenario into its communication model
Ask: does one side ask and wait? Is it send once, many receive? Is there a queue? Does a line stay open?
🌐 Browser opens a sensor's web page
📢 Fire alarm alerts every phone in the building
📥 Lakhs of meter readings wait for the billing server
🎮 Live game controller ↔ server
🔄 App refreshes to ask today's rainfall
🌡️ Sensor posts to "room/temp"; three apps listening
🍽️ Orders pile up; kitchen takes the next when free
📹 Live CCTV stream with two-way talk
🙋 Request–response
📢 Publish–subscribe
📥 Push–pull
🔁 Exclusive pair
☕ Interactive break · What would you do?
Your cricket score app has lakhs of fans. Which model?
You run a live-score service for a college sports app. During a final, lakhs of fans want every ball's update within seconds. Pick a model, then click it.
Part B · Communication APIs
Two APIs: REST asks each time; WebSocket keeps a line open
An API (application programming interface) is how one program talks to another. IoT mainly uses REST and WebSocket APIs.
Basis
REST-based API
WebSocket-based API
Model
Request–response
Exclusive pair
Connection
New request each time
One persistent connection
State
Stateless
Stateful
Direction
Client asks, server answers
Both sides send any time (full-duplex)
Overhead
Headers sent with every request
Low after the first handshake
Best for
Reading status, occasional commands
Real-time streams, live control
Smart home: checking the AC's set temperature → REST. Watching the door camera live and talking to a visitor → WebSocket.
REST (Representational State Transfer) treats everything as a resource with an address (URI), such as /temperature or /led. Clients use HTTP methods on resources: GET (read), POST (create), PUT (update), DELETE (remove). REST is stateless and follows request–response.
WebSocket APIs start with one handshake and then keep a full-duplex connection open, so the server can push data the moment it changes. They follow the exclusive-pair model and suit real-time applications.
Q1. Which HTTP method would switch an LED on through a REST API?
PUT (update the LED resource's state), for example PUT /led {"state":"on"}. Some APIs use POST for this.
Q2. Why does WebSocket have lower overhead for frequent messages?
The connection is opened once; later messages don't repeat the full connection setup and headers that each REST request needs.
Part B · Try a REST API
Click a request and watch the device answer
In REST, every thing is a resource with an address. You use GET to read and PUT to change it.
Real life: smart plugs, cloud dashboards and services like ThingSpeak offer REST APIs that work like this.
// Click a request on the left.
// The device's reply appears here.
Sample device and values for practice. 200 = OK · 404 = resource not found.
Each request names a method and a resource. The device answers with a status code and a body, usually in JSON (a simple text format of names and values).
Status codes you will meet often: 200 OK (success), 201 Created, 400 Bad Request, 401 Unauthorized, 404 Not Found, 500 Internal Server Error. You will build a small web server like this in Lecture 12 and in the practical.
Q1. Why did GET /api/room/fan return 404?
The device has no resource called "fan", so the server answers 404 Not Found.
Q2. Write the request to switch the LED off.
PUT /api/room/led with body {"led":"off"}.
☕ Interactive break · 1-minute brain teaser
How does a chat app show "typing…" instantly?
💬 Your friend starts typing and, within a moment, your screen shows "typing…" — you never refreshed. Would a REST API with request–response do this well? What model fits better, and why?
A persistent two-way connection (the exclusive-pair idea, as in WebSocket). The server can push "typing…" the moment it happens; with REST, your app would have to keep asking.
Discussion timer
1:00
Common mistakes
Four mistakes students make in this topic
❌ Mixing the protocol stack with the 3/5-layer architecture. ✅ Stack = how one message travels; architecture = the whole system.
❌ "Publish–subscribe and push–pull are the same." ✅ Pub-sub: broker sends to all subscribers. Push–pull: consumers pull from a queue.
❌ Calling REST stateful. ✅ REST is stateless; WebSocket (exclusive pair) is stateful.
❌ Diagrams without labels. ✅ Label client/server, broker, topics, queue and arrow directions.
Group activity · 12 minutes
Design a smart doorbell on paper, both ways
Form groups of 4.
Physical: draw the device's blocks and name one part for each.
Pick a link and an application protocol; justify.
Logical: write one job for each of the six functional blocks.
Choose a communication model for "visitor alert" and for "live video".
🪜 Stuck? Climb the ladder
Link: Wi-Fi (home has it, video needs speed). Application: MQTT for alerts, WebSocket for live video.
Visitor alert → publish–subscribe (phone and smartwatch both subscribe). Live video and talk-back → exclusive pair.
Activity timer
12:00
Cheat sheet
Lecture 3 on one page
Physical vs logical Physical = things + protocols. Logical = functional blocks + communication models + APIs.
Next class: enabling technologies, identifiers and frameworks
🔜 Lecture 4 • Cloud, big data, AI, embedded systems in IoT • How things get unique identifiers • IoT frameworks: AWS, Azure, Google
📝 Homework 1. Draw labelled diagrams of all four communication models. 2. List the protocols of each layer from memory. 3. Read your textbook's sections on physical and logical design.
Exit question · exam style
Explain publish–subscribe and request–response with diagrams.
✍️ Two labelled diagrams + a short explanation of each. Write for 6 minutes.(5 marks)
Request–response (2½ marks): diagram with client, server, request and response arrows (1). Explanation: client sends request, server processes and responds; each pair independent; stateless; e.g. HTTP/REST (1½).
Publish–subscribe (2½ marks): diagram with publishers, broker with topics, subscribers (1). Explanation: publishers send to topics; broker forwards to all subscribers; publishers and subscribers don't know each other; e.g. MQTT (1½).
Marker's note: unlabelled diagrams get half marks. One IoT example per model is expected.
IoT Technologies · Lecture 3
Thank you! Questions?
Remember: ask · publish · queue · pair — the four ways things talk
Room code IOT3 · Next: enabling technologies, identifiers and frameworks