Protocol Selection Criteria: Bandwidth, Power, and Latency
📖 Scenario: You are working on a small IoT device project. You need to choose the best communication protocol based on three important factors: bandwidth, power consumption, and latency. Each protocol has different values for these factors.Imagine you have a list of protocols with their bandwidth (in kbps), power consumption (in mW), and latency (in ms). Your task is to filter and select protocols that meet certain criteria.
🎯 Goal: Build a simple program that stores protocol data, sets selection criteria, filters protocols based on these criteria, and then displays the selected protocols.
📋 What You'll Learn
Create a dictionary named protocols with exact entries for three protocols and their bandwidth, power, and latency values.
Create three variables named max_bandwidth, max_power, and max_latency with exact integer values for selection criteria.
Use a dictionary comprehension named selected_protocols to filter protocols that have bandwidth less than or equal to max_bandwidth, power less than or equal to max_power, and latency less than or equal to max_latency.
Print the selected_protocols dictionary.
💡 Why This Matters
🌍 Real World
IoT devices often need to choose communication protocols that balance speed, power use, and delay to work well in their environment.
💼 Career
Understanding how to filter and select protocols based on technical criteria is important for IoT engineers and DevOps professionals managing connected devices.
Progress0 / 4 steps
1
Create the protocols dictionary
Create a dictionary called protocols with these exact entries: 'Zigbee': {'bandwidth': 250, 'power': 60, 'latency': 15}, 'Bluetooth': {'bandwidth': 1000, 'power': 100, 'latency': 30}, 'LoRa': {'bandwidth': 50, 'power': 10, 'latency': 300}.
IOT Protocols
Hint
Use a dictionary with protocol names as keys and another dictionary as values holding bandwidth, power, and latency.
2
Set selection criteria variables
Create three variables called max_bandwidth, max_power, and max_latency with values 300, 70, and 50 respectively.
IOT Protocols
Hint
Assign the exact integer values to each variable as given.
3
Filter protocols using dictionary comprehension
Create a dictionary comprehension called selected_protocols that includes only protocols from protocols where bandwidth is less than or equal to max_bandwidth, power is less than or equal to max_power, and latency is less than or equal to max_latency.
IOT Protocols
Hint
Use a dictionary comprehension with for name, specs in protocols.items() and filter with if conditions.
4
Print the selected protocols
Write a print statement to display the selected_protocols dictionary.
IOT Protocols
Hint
Use print(selected_protocols) to show the filtered dictionary.
Practice
(1/5)
1. Which factor is most important when choosing a protocol for a device that must run on a small battery for months without recharging?
easy
A. Strong encryption
B. High bandwidth
C. Low latency
D. Low power consumption
Solution
Step 1: Understand the device's main need
The device must run for months on a small battery, so saving power is critical.
Step 2: Match protocol criteria to the need
Low power consumption protocols help extend battery life, making them the best choice.
Final Answer:
Low power consumption -> Option D
Quick Check:
Battery life needs low power [OK]
Hint: Battery life? Pick low power protocols [OK]
Common Mistakes:
Choosing high bandwidth which drains battery fast
Confusing low latency with power saving
Ignoring power needs for battery devices
2. Which protocol characteristic best fits a real-time alarm system that must alert instantly?
easy
A. Low power
B. High bandwidth
C. Low latency
D. High security
Solution
Step 1: Identify the system requirement
A real-time alarm system needs to send alerts instantly without delay.
Step 2: Select the protocol feature that supports instant alerts
Low latency means minimal delay, ideal for quick alert delivery.
Final Answer:
Low latency -> Option C
Quick Check:
Instant alerts need low latency [OK]
Hint: Instant alerts? Choose low latency [OK]
Common Mistakes:
Picking high bandwidth which is not critical here
Choosing low power which may delay alerts
Confusing security with speed
3. A sensor network uses a protocol with 250 kbps bandwidth, low power, and moderate latency. Which application fits best?
medium
A. Streaming HD video
B. Periodic temperature updates
C. Real-time gaming
D. Large file transfers
Solution
Step 1: Analyze protocol features
250 kbps bandwidth is low, power is low, latency is moderate.
Step 2: Match features to application needs
Periodic temperature updates need low power and low bandwidth, moderate latency is acceptable.
Final Answer:
Periodic temperature updates -> Option B
Quick Check:
Low bandwidth suits small periodic data [OK]
Hint: Low bandwidth + low power = small periodic data [OK]
Common Mistakes:
Choosing streaming video needing high bandwidth
Picking real-time gaming needing low latency
Selecting large file transfers needing high bandwidth
4. You selected a protocol with high bandwidth but the device battery drains quickly. What is the likely cause?
medium
A. Protocol uses too much power due to high bandwidth
B. Latency is too low causing overload
C. Device hardware is incompatible
D. Encryption slows down data transfer
Solution
Step 1: Understand the problem
High bandwidth protocols often consume more power, draining battery faster.
Step 2: Identify cause of battery drain
The high bandwidth causes increased power use, leading to quick battery drain.
Final Answer:
Protocol uses too much power due to high bandwidth -> Option A
Quick Check:
High bandwidth = more power use [OK]
Hint: High bandwidth often means high power use [OK]
Common Mistakes:
Blaming low latency which doesn't cause power drain
Assuming hardware incompatibility without evidence
Confusing encryption impact with power consumption
5. A smart city project needs to monitor thousands of sensors sending small data packets infrequently. Which protocol selection is best considering bandwidth, power, and latency?
hard
A. Low bandwidth, low power, moderate latency
B. High bandwidth, low power, high latency
C. High bandwidth, high power, low latency
D. Low bandwidth, high power, low latency
Solution
Step 1: Analyze project needs
Thousands of sensors send small data infrequently, so bandwidth and power must be low to save resources.
Step 2: Consider latency tolerance
Moderate latency is acceptable since data is not urgent real-time.
Step 3: Match protocol features
Low bandwidth and low power with moderate latency fits best for this use case.
Final Answer:
Low bandwidth, low power, moderate latency -> Option A
Quick Check:
Small infrequent data needs low bandwidth and power [OK]
Hint: Small, infrequent data? Pick low bandwidth & power [OK]
Common Mistakes:
Choosing high bandwidth wasting resources
Selecting high power draining batteries quickly
Expecting low latency for non-urgent data
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.