Hello. I need help developing a C or C++ program that 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" indicates a broadcast frame.  Thank you!   ********************PLEASE YOUR CODE MUST BE COMPLETE, COMPILE AND EXECUTE****************   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 P7: F1 F2 F5 P8: F1 F2 F5 The input file is as follows: F1 P1 A--G F2 P1 B--H F3 P1 C--I F4 P2 D--E F5 P2 D--F F6 P7 G--A F7 P8 H--B F8 P8 I--C F9 P4 E--D F10 P4 F--D F11 P7 G--X F12 P1 B--G F13 P2 D--G F14 P4 E--G F15 P8 H--G F16 P1 A--D F17 P1 B--E F18 P1 C--F F19 P2 D--H F20 P8 H--I

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Hello. I need help developing a C or C++ program that 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" indicates a broadcast frame.  Thank you!

 

********************PLEASE YOUR CODE MUST BE COMPLETE, COMPILE AND EXECUTE****************

 

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
P7: F1 F2 F5
P8: F1 F2 F5

The input file is as follows:

F1 P1 A--G
F2 P1 B--H
F3 P1 C--I
F4 P2 D--E
F5 P2 D--F
F6 P7 G--A
F7 P8 H--B
F8 P8 I--C
F9 P4 E--D
F10 P4 F--D
F11 P7 G--X
F12 P1 B--G
F13 P2 D--G
F14 P4 E--G
F15 P8 H--G
F16 P1 A--D
F17 P1 B--E
F18 P1 C--F
F19 P2 D--H
F20 P8 H--I

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Types of Protocols
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-engineering and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY