Task 1

(a) 1. since it still require to function during time where internet connection is not possible and a non-IP radio protocol sensors, edge-based would be optimal. 2. its mentioned that the sensors are short-ranged andcloud service is still used for storage and reporting, so the gateway would function as the intermediaries, between the sensor and internet sending the sensor data. 3. since we need the gateway as coordinator and central operation, it is a single point of failure, if there’s error or malfunction in the gateway, the sensor reading couldn’t be send to the cloud

(b) 1. NB-IoT would be preferred, not only a utility company would have the budget for a cell subscription but also the requirement of basement/underground penetration which is one of NB-IoT strengths compare to 802.15.4 2. eDRX would be more appropriate, there’s a paging window where device could receive downlink, in line with the requirement of ocasional update 3. with eDRX my assesment is that it might not be as energy sufficient as PSM where it can sleep indefinitely, but the convenience and ease of use for the engineer. with eDRX there’s latency due to the paging window but won’t be as long as PSM.

Task 2

(a) 1. slotted CSMA/CA, by many we would assume hundreds, since warehouse is relatively large and contains thousands of assets. the requirement for coordinated sleeps and regular intervals make slotted suitable. despite some radio being closer to gateway, some might not be, this would where the synchronization of slotted also come in handy. 2. CSMA/CA would solve the problem of managing multiple signal, frequency hopping would solve the throughput 3. scheduling

(b) 1. 5 x 64 = 320 , 320 / 8 = 40 2. datagram tag 3. because its only the link-local between this packet, before handing it over to the higher layet

Task

(a) 1. the broker must maintain the mapping that topic alias: 4 is for topic: factory/building-2/line-4/motor-17/vibration 2. because the broker is the central messanger that knows who’s publishing and who’s subscribing each client doesn’t need to know that or does not have the capabilities 3. it would kept that mapping and match who’s subscribing or the later subscriber

(b) 1. yes becaus it uses + the 1 or single level wildcard that matches the topic 2. yes becuase dashboard subscribed to a multilevel , catch-all wildcard 3. factory/building-2/motor/motor-17/vibration and if they have mutiple building and motor number

Task 4

(a) 1. if its for a simple monitoring dashboard or reporting over time that doesn’t require connection to other parameters, a key value like {“temp”: “1 C”, “time”: “14:01”} would be suffice and simple enough 2. ON temp_rise (room, increase > 5celcius) AND smokeDetected(room) WITHIN (30 seconds) IF BOTH events refer to same room DO emit FireAlarm(room) activateSprinklers(room) notify_security(room) callFireDepartment(room)

  1. it allows for a more nuance data connection, that could answer more questions. we’re not only given a parameter with number result, but also additional metadata about what could be the cause if we know the room, what time it occur, etc.

(b) CONTINOUS QUERY room_temperature ON temperature_reading WINDOW SLIDING 10 minutes, SLIDE 2 minutes SELECT room, AVG(value) as avg_temp GROUP BY room EMIT every 2 minute

similar to task 4 perhaps could be wrong

(c)

  1. dead reckoning, which could predict with given data send to extrapolation model
  2. it would need to recalculate over and over and sending data mutiple times to recalculate the predicition, since slippery ground could make the robot faster or slower despite having control
  3. reducing number of updates is not sending or activating the radio signal to send or receive data, numbers of on and off. compressing bytes is reducing the size of data being sent, if a data is small enough it wouldn neet to be fragmented, into smaller pieces. imagine like a train, if the train carriage can fit 150 people it would just need 1 for 100 people but if the carriage can only fit 50 then we would need 2. this could also help reduce the number of radio updates

Task 5

(a) 1. a tiny model to detect dangerous rhythm could perhaps fit in the memory of MCU, and with a FPGA accelerator this would allow for this model to atleast sent warning or signal nearby. to then would trigger or sent emergency data to internet or healthcare service. it also mentioned that model will be retrained in cloud and for data management

  • speed, no need for request-response from cloud/server
  • privacy, data isn’t being send or stored in a 3rd party
  • harder to update, if we want to update the model we would need to be in the proximity of the device hosting the model
  • accuracy, might not be as accurate as larger model, since local inference in embedded device are considered constraint

(b)

  1. it is pruning method (removing unecessary weight or the one close to 0 from the neural network) where a threshold is defined to filter our which of the weight to remove. an increase in lost is possible since the algorithm didn’t considered the possibilities that a weight that is removed might have meaningful connection to the next layer/neurons
  2. the numbers use on the NN is usually computed on FP32-bit but quantization would decrease that to using smaller discrete levels like 8 or 4 bit integer. reducing the precision that tooks memory and compute. binarization is taking this to the extreme with only 1-bit +1 or -1 value. which in turns reducing the precision up to 32x , since working with bits its now become possible for bitwise operator like XNOR to do this. and thsi would allow the hardware to calculate in parallel in the multitude level using less compute and memory, it take less space to store +1 or -1 than 0x0000000

Feedback and fuller model answers

Overall feedback

You completed the mock within the intended time and have the broad concepts. Your strongest areas were Task 1, the 6LoWPAN offset calculation, the basic MQTT alias flow, the continuous-query syntax, dead reckoning, and the basic pruning/quantization distinction.

The main lost keywords were:

  • 802.15.4: TSCH was the stronger choice for dense traffic plus interference; frequency hopping addresses interference, not throughput; multi-hop needs routing/forwarding and network formation above the basic MAC.
  • 6LoWPAN: fragmentation uses datagram size, tag, and offset; it is link-specific and does not replace IPv6 fragmentation.
  • MQTT: shared subscriptions deliver to one member of the group, not all members; topic aliases are per client connection.
  • Graphs: you gave a CEP rule instead of a graph query. The answer needs an explicit relationship traversal.
  • Stream/CEP: your continuous query was mostly correct, but the CEP rule should be clearly separated and its atomic/complex events identified.
  • Embedded ML: the missing major point was the hardware accelerator explanation and the saliency/Optimal Brain Damage answer.

These are mostly keyword-retrieval gaps, not a lack of overall understanding.

Task 1 — Architecture and NB-IoT

(a) Model answer

  1. Use an edge-based architecture. The gateway can execute the local humidity-alarm logic, so the alarm continues to work when the Internet or cloud is unavailable. A mesh architecture is not required merely because the sensors use a short-range radio; the gateway still provides the local edge function.
  2. A gateway is appropriate because the sensors use a non-IP protocol. It can translate the sensor protocol to IP/cloud protocols, buffer readings during an outage, perform local filtering or alarm processing, and provide security isolation. The local alarm function should not depend on a successful cloud round trip.
  3. The gateway adds cost and operational complexity and can become a bottleneck or single point of failure. Redundancy or local fallback logic can reduce that risk.

(b) Model answer

  1. Choose NB-IoT. The meters are geographically dispersed across a city, and a local 802.15.4 PAN/gateway would be difficult to deploy and maintain. NB-IoT provides cellular coverage and is appropriate for small, infrequent messages, including difficult indoor or basement locations.
  2. Choose eDRX, because the meter must remain reachable for a downlink command without first sending an uplink. It sleeps between scheduled paging opportunities and checks for a paging message. The network buffers downlink data until the device can be paged. PSM would save more energy, but the UE cannot be paged while it is in PSM.
  3. Longer eDRX sleep reduces energy consumption but increases downlink latency. PSM gives even lower energy use but removes downlink reachability during the sleep period.

Task 2 — IEEE 802.15.4 and 6LoWPAN

(a) Model answer

  1. Choose TSCH. The warehouse has dense periodic traffic, coordinated sleep requirements, and narrow-band interference. TSCH assigns time cells, reducing collisions and allowing devices to sleep between transmissions. Its channel hopping improves robustness against interference. Slotted CSMA/CA would be simpler, but it still relies on contention and is less deterministic. GTS could reserve limited slots, but it is less suitable for a dense scheduled network.
  2. CSMA/CA decides when to transmit: a device senses the channel and uses random backoff when the channel is busy. Frequency hopping changes which carrier channel is used, improving reliability when one channel is interfered with. They solve different problems and can be combined in TSCH.
  3. A higher-layer mesh/routing protocol must provide route discovery, forwarding, network formation, and topology management. IEEE 802.15.4 does not define a complete multi-hop routing system. TSCH also requires a schedule, but the standard does not define the algorithm that creates that schedule.

(b) Model answer

  1. The sixth fragment starts after five complete fragments:
start = 5 × 64 = 320 bytes
offset = 320 / 8 = 40

Therefore, the datagram offset is 40.

  1. The fragmentation information includes the original datagram size, a datagram tag identifying fragments belonging to the same datagram, and the fragment offset. The offset is measured in 8-byte units. The first fragment and later fragments use the appropriate 6LoWPAN fragmentation headers.

  2. 6LoWPAN fragmentation is an adaptation/link-specific mechanism that splits one IPv6 datagram across several tiny 802.15.4 frames and reassembles it at the 6LoWPAN endpoint. IPv6 fragmentation is a separate network-layer mechanism for an IPv6 packet that exceeds the path MTU. IPv6 routers do not fragment packets; the IPv6 source performs fragmentation when needed. Therefore, 6LoWPAN fragmentation does not eliminate or replace IPv6 fragmentation.

Task 3 — MQTT

(a) Model answer

  1. The broker must store this mapping for the publisher connection:
Topic Alias 4 → factory/building-2/line-4/motor-17/vibration
  1. The mapping is connection-specific because alias number 4 may represent a different topic on another client connection. It is not a global topic definition. The mapping also has to be recreated after a new connection if the client reconnects.
  2. The broker resolves the empty-topic PUBLISH using alias 4, obtains the concrete topic, and routes the message as if it had been published directly to that topic. It sends copies to normal matching subscribers and, for each matching shared-subscription group, selects one group member.

(b) Model answer

  1. No. The three processing clients are members of the same shared group. For each matching publication, the broker delivers one copy to one eligible member, not a copy to all three clients.
  2. Yes. factory/# is a normal subscription filter matching factory/building-2/motor/motor-17/vibration. The dashboard receives its own matching copy.
  3. The publisher sends to the ordinary topic:
factory/building-2/motor/motor-17/vibration

The publisher never publishes to the $share/... string; that syntax is only for subscribers.

Task 4 — Connected data

(a) Model answer

  1. A key-value model is preferable for a known sensor’s latest reading because the application can perform a simple direct lookup, such as:
GET device:temperature-101

It is simple and efficient when relationships are not needed. 2. A graph query could be:

Which sensors in Building A can measure temperature
and have a maintenance event in the last 30 days?

A simplified graph pattern is:

Sensor --locatedAt--> Room --partOf--> BuildingA
Sensor --observes--> Temperature
Sensor --hadMaintenanceEvent--> Event
  1. The graph makes these relationships first-class and allows the query to traverse them. A key-value model could store the same fields inside JSON, but the application would usually need to scan, parse, and join records itself. The graph is better for changing many-to-many relationships, topology, capabilities, and cross-domain links; key-value remains better for direct latest-state lookups.

(b) Model answer

A continuous query could be:

CONTINUOUS QUERY room_temperature
ON TemperatureReadings
WINDOW SLIDING 10 minutes, SLIDE 2 minutes
SELECT room, AVG(value) AS average_temperature
GROUP BY room
EMIT EVERY 2 minutes

This query remains registered and produces updated aggregate results as new readings arrive. The sliding window always represents the most recent 10 minutes and advances every 2 minutes.

A CEP/ECA rule could be:

ON TemperatureRise(room, increase > 5°C)
AND SmokeDetected(room)
WITHIN 30 seconds
IF both events refer to the same room
DO emit PossibleFire(room)
   activate_sprinklers(room)
   notify_security(room)

TemperatureRise and SmokeDetected are atomic events. PossibleFire is the complex event derived from their temporal and spatial relationship. The continuous query computes an aggregate over a data stream; CEP detects a meaningful event pattern and can trigger an action.

(c) Model answer

  1. Dead reckoning is efficient during predictable constant-velocity motion. The robot sends an initial position, velocity/direction, and timestamp; the receiver extrapolates later positions without requiring a transmission for every position.
  2. Wheel slip violates the motion model. The receiver’s predicted position diverges from the robot’s true position, so correction messages are needed. Frequent corrections can remove the energy advantage of dead reckoning.
  3. An update protocol reduces the number of application-level messages, for example by sending only a correction when prediction error exceeds a threshold. Stream compression reduces the number of bytes used to encode messages. They are different optimizations and can be combined.

Task 5 — Embedded Machine Learning

(a) Model answer

  1. Run the latency-critical ECG inference locally on the MCU/FPGA. The device can produce an immediate warning without a cloud round trip and can continue operating during connectivity loss. Send selected ECG features, detected events, or summaries to the cloud for long-term analysis and model retraining.
  2. Benefits include low latency, reduced bandwidth, improved privacy, and greater reliability/offline independence. Challenges include limited compute and memory, energy consumption, difficult model updates, and possible accuracy loss when the model is compressed or simplified.
  3. An FPGA accelerator can execute neural-network operations in parallel using hardware specialized for convolution, fixed-point arithmetic, or other repeated operations. This can reduce inference latency and energy compared with running all operations on a general-purpose MCU. The trade-off is additional hardware/design complexity and possible reconfiguration cost.

(b) Model answer

  1. Magnitude-based pruning usually starts with a trained dense network. It ranks weights by absolute value, chooses a threshold or percentage, sets the smallest weights to zero using a mask, and fine-tunes the remaining network. It can increase the loss because a small-magnitude weight may still be part of a critical path. Magnitude alone ignores activations, interactions, and the effect of removing a connection on later neurons.
  2. Optimal Brain Damage uses a saliency estimate based on the weight’s impact on the training loss, including higher-order derivative information. It removes weights with low estimated loss impact rather than blindly removing all small-magnitude weights, then fine-tunes and repeats the process.
  3. Quantization reduces the numerical precision, for example from FP32 to INT8 or fixed-point values. The network is usually still dense, but values use less memory and integer arithmetic can be cheaper and faster. Binarization is an extreme form using approximately one-bit values such as +1 and -1 for weights and/or activations. Binary dot products can replace multiplication with XNOR and population-count operations, which are efficient in FPGA or specialized hardware. Binarization has a larger accuracy and training challenge; the theoretical storage reduction from FP32 to one bit is 32× before metadata and implementation overhead.