Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Simulate a Local Area Network. You have computers that are threads and produce messages. Each computer is defined by a MAC. The message has a

image text in transcribed
Simulate a Local Area Network. You have computers that are threads and produce messages. Each computer is defined by a MAC. The message has a content ( a string), the destination MAC and the origin MAC (of the computer that produced it). When a computer produces a message, it sends it to the waiting queue inside the switch which is also a thread. The switch maintains a Map which it completes each time it receives a message from a computer not in the map. When the switch receives a message it consumes it from the waitingQueue and has two possibilities: The Destination MAC is in the switch's map. Then the message is sent to the computer with the corresponding MAC. The Destination MAC is not in the switch's map. Then the message is sent to all the computers When a computer receives a message it prints it on the screen. Each Computer creates a new message each 20 ms with a random Destination MAC to a total of 10 messages. Implement the classes and create a Main class in which you will instantiate 5 computers and 1 switch

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Temple Of Django Database Performance

Authors: Andrew Brookins

1st Edition

1734303700, 978-1734303704

More Books

Students also viewed these Databases questions

Question

What is the difference between Needs and GAP Analyses?

Answered: 1 week ago

Question

What are ERP suites? Are HCMSs part of ERPs?

Answered: 1 week ago