0
0
IOT Protocolsdevops~30 mins

Protocol selection criteria (bandwidth, power, latency) in IOT Protocols - Mini Project: Build & Apply

Choose your learning style9 modes available
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
Need a 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
Need a 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
Need a 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
Need a hint?

Use print(selected_protocols) to show the filtered dictionary.