Theory
Same hostel, drawn twice
Last lesson drew SmartHostel physically: this sensor, that cable, those protocols.
Now erase the brand names and draw it again by what each part DOES: something senses, something carries, something serves, something guards. That second drawing is the logical design: the blueprint that stays true even if every physical part is swapped tomorrow.
It has 2 halves the exam loves: the 6 functional blocks, and the 4 shapes a conversation between machines can take.
At a glance
The 6 functional blocks
| Block | Job | SmartHostel face |
|---|---|---|
| Device | Sense, actuate, monitor | Tank float, gas detector, gate motor |
| Communication | Carry data between blocks | The WiFi + MQTT machinery |
| Services | Monitoring, control, data publishing, discovery | The read-tank-level service; the start-pump control |
| Management | Govern and configure the system | Setting the 20% threshold; adding room 214's sensor |
| Security | Authentication, authorization, data protection | Only the warden's login may open the gate |
| Application | The user-facing interface | The dashboard and its red tank icon |
Theory
Four shapes of machine conversation
Devices and servers talk in 4 standard patterns, and picking the right one is a design decision the syllabus tests directly:
- Request-Response: client asks, server answers, done: each exchange is independent (stateless)
- Publish-Subscribe: senders publish to topics on a broker; anyone interested subscribes: sender and receivers never meet
- Push-Pull: producers push messages into queues; consumers pull at their own pace: the queue absorbs speed differences
- Exclusive Pair: ONE persistent, full-duplex, stateful connection between exactly 2 parties, open until deliberately closed
Theory
Four ways the hostel already talks
Request-response is knocking on the warden's door with one question: answered, door shut.
Publish-subscribe is the notice board: the mess pins the menu (publishes to the topic "mess"); whoever cares reads it: the cook never knows who looked.
Push-pull is the dhobi's basket: residents drop clothes in (push); the dhobi empties it at his own pace (pull): the basket absorbs Monday's pile-up.
Exclusive pair is 2 friends on a phone call: line held open, both talking, until someone hangs up.
At a glance
The 4 communication models, technically
| Model | Middleman | State | SmartHostel use |
|---|---|---|---|
| Request-Response | None: direct ask-answer | Stateless per exchange | App asks the server: current tank level? |
| Publish-Subscribe | BROKER with topics | Broker tracks subscriptions | Sensors publish hostel/tank; dashboard + logger both subscribe |
| Push-Pull | QUEUE buffering messages | Queue holds the backlog | Meter readings pushed each minute; analytics pulls hourly |
| Exclusive Pair | None: one held line | Fully stateful connection | Live gate camera feed to the guard's screen |
Quiz
The tank sensor's readings must reach the dashboard, the data logger AND a new leak-detection service, without the sensor knowing any of them exist. Which communication model?
- Request-Response: each service asks the sensor directly
- Publish-Subscribe: the sensor publishes to a topic; all 3 subscribe at the broker
- Exclusive Pair: the sensor holds 3 permanent connections
- Push-Pull: the 3 services take turns pulling
Show the answer
Publish-Subscribe: the sensor publishes to a topic; all 3 subscribe at the broker
One source, many independent listeners, mutual anonymity: that is publish-subscribe's exact shape: the sensor publishes hostel/tank/level to the broker and sleeps; the broker fans it out to every subscriber, and adding a fourth listener next month changes NOTHING at the sensor. Option A forces a tiny device to serve 3 clients (and each must poll). Option C spends 3 held lines where none is needed: exclusive pair is for continuous 2-party streams. Option D's queue delivers each message to ONE consumer (workers sharing jobs), not copies to all: the pub-sub vs push-pull distinction exams probe.
Think first
Which model is the odd one out on state?
Of the 4 models, one is defined by being STATEFUL end to end: the connection itself remembers. Name it, explain what stateful buys there, and connect it to a protocol from the physical-design lesson. Then tap.
Show the answer
Exclusive pair: the single held connection is the state: both ends know the line is open, who is on it, and what has flowed: which is what buys instant, no-handshake, full-duplex messaging in BOTH directions: perfect for the live camera feed or a real-time gate console. Its physical-design twin is WebSocket, exactly as MQTT embodies publish-subscribe: logical models are the shapes, protocols are their implementations. Request-response, by contrast, is deliberately STATELESS: every exchange stands alone: cheap, simple, and forgetful by design.
Watch out
Logical-design slips
Blocks vs layers: the 6 functional blocks are not the 4 architecture layers: blocks slice by FUNCTION, layers by the data's JOURNEY: two different diagrams, both examinable.
Pub-sub vs push-pull: topics fan copies out to ALL subscribers; queues hand each message to ONE puller: broadcast vs work-sharing.
Security as a block you mention last: it spans ALL blocks (device to application): say cross-cutting and mean it.
Theory
Unit 1 closes: the frame is built
Four lessons in, you hold the whole frame: what IoT is (definition + 5 characteristics), how a reading travels (4 layers), what the parts are and speak (things + 3 protocol families), and how conversations are shaped (6 blocks, 4 models). Every remaining unit hangs details on this frame. Unit 2 starts by meeting IoT's older sibling: M2M: and asking the exam's favourite comparison: what exactly did the internet add?
Summary
Key takeaways
- Logical design describes the system by function, independent of hardware choices.
- Six functional blocks: device, communication, services, management, security (cross-cutting), application.
- Request-Response: stateless ask-answer, no middleman: the web's shape.
- Publish-Subscribe: broker + topics; publisher and subscribers never meet: MQTT's shape: copies to ALL subscribers.
- Push-Pull: queues buffer between producer and consumer rates: each message to ONE puller.
- Exclusive Pair: one persistent, stateful, full-duplex line: WebSocket's shape.
- Memory hook: knock, notice board, dhobi basket, phone call.