Question
Develop a simulation program to simulate an 8-port Ethernet switch. The switch initially has no knowledge about the hosts connected to each port. It learns
Develop a simulation program to simulate an 8-port Ethernet switch. The switch initially has no knowledge about the hosts connected to each port. It learns frame addresses and stores-and-forwards the frames. The input text file "in.txt" contains information of the incoming frames, one frame per line. There are 4 pieces of data per line: frame ID, arrival port, frame source address, and frame destination address. The frames arrive at the switch in the order of which they appear in the input file. Destination address "X" indicate a broadcast frame. The output text file "out.txt" has 8 lines. Each line lists all the frames departing from each port, Here is an example: "in.txt" contains 5 incoming frames: F1 P2 B--A F2 P6 D--C F3 P5 E--B F4 P7 F--D F5 P6 D--X "out.txt" should list the departing frames on each port: P1: F1 F2 F5 P2: F2 F3 F5 P3: F1 F2 F5 P4: F1 F2 F5 P5: F1 F2 F5 P6: F1 F4 F5 P7: F1 F2 F5 P8: F1 F2 F5
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started