📖 Scenario: You are working with a SCADA system network that uses a ring topology to ensure network redundancy. This means each device is connected to two other devices, forming a closed loop. If one connection fails, data can still travel the other way around the ring.Your task is to represent this network in code and simulate checking the network's redundancy status.
🎯 Goal: Build a simple program that models a ring network of devices and checks if the network is redundant by verifying each device has exactly two connections.
📋 What You'll Learn
Create a dictionary called network with device names as keys and lists of connected devices as values.
Add a variable called expected_connections set to 2 to represent the ring topology requirement.
Write a loop to check each device's connections against expected_connections and store the results in a dictionary called redundancy_status.
Print the redundancy_status dictionary to show which devices have proper redundancy.
💡 Why This Matters
🌍 Real World
Ring topologies are common in SCADA systems to ensure continuous operation even if one connection fails.
💼 Career
Understanding network redundancy helps in maintaining reliable industrial control systems and troubleshooting network issues.
Progress0 / 4 steps
1
Create the network dictionary
Create a dictionary called network with these exact entries: 'DeviceA': ['DeviceB', 'DeviceE'], 'DeviceB': ['DeviceA', 'DeviceC'], 'DeviceC': ['DeviceB', 'DeviceD'], 'DeviceD': ['DeviceC', 'DeviceE'], 'DeviceE': ['DeviceD', 'DeviceA'].
SCADA systems
Hint
Think of each device as a key and its connected devices as a list of values.
2
Set expected connections variable
Add a variable called expected_connections and set it to 2 to represent the number of connections each device should have in a ring topology.
SCADA systems
Hint
Use a simple variable assignment to store the number 2.
3
Check redundancy for each device
Write a for loop using variables device and connections to iterate over network.items(). Inside the loop, create a dictionary called redundancy_status (before the loop) and add an entry for each device with value true if the length of connections equals expected_connections, otherwise false.
SCADA systems
Hint
Initialize the dictionary before the loop. Use len(connections) to count connections.
4
Print the redundancy status
Write a print statement to display the redundancy_status dictionary.
SCADA systems
Hint
Use print(redundancy_status) to show the results.
Practice
(1/5)
1. What is the main advantage of using a ring topology in SCADA network redundancy?
easy
A. It provides a closed loop that allows data to travel in both directions for fault tolerance.
B. It reduces the number of cables needed compared to a star topology.
C. It eliminates the need for switches or routers in the network.
D. It ensures that only one device controls the entire network.
Solution
Step 1: Understand ring topology structure
A ring topology connects devices in a closed loop, allowing data to flow in both directions.
Step 2: Identify redundancy benefit
This loop allows the network to continue operating even if one connection breaks, providing fault tolerance.
Final Answer:
It provides a closed loop that allows data to travel in both directions for fault tolerance. -> Option A
Quick Check:
Ring topology = fault tolerance loop [OK]
Hint: Ring means loop for backup path [OK]
Common Mistakes:
Thinking ring topology reduces cables more than star
Believing ring removes need for switches
Assuming one device controls whole network
2. Which of the following is the correct description of RSTP in a ring topology?
easy
A. RSTP disables all redundant links permanently to avoid loops.
B. RSTP requires manual configuration of backup routes in the ring.
C. RSTP quickly blocks and unblocks links to prevent loops and maintain redundancy.
D. RSTP only works in star topologies, not ring topologies.
Solution
Step 1: Understand RSTP function
Rapid Spanning Tree Protocol (RSTP) manages network loops by blocking and unblocking links dynamically.
Step 2: Apply to ring topology
In ring topology, RSTP prevents loops while keeping backup paths ready for fast recovery.
Final Answer:
RSTP quickly blocks and unblocks links to prevent loops and maintain redundancy. -> Option C