Answered You can hire a professional tutor to get the answer.
In the field of networking, information is packed into a single entity called a packet.
In the field of networking, information is packed into a single entity called a packet. A packet contains the sender's information, and also extra overhead bits that describes certain properties of the packet. Some of these bits are used to determine the path it takes to maneuver through the network. Packets travel through routers across the network, until they have arrived to their specified destination.
Imitate a simple network of routers by writing a simulator, similar to the CarSimulator discussed in lecture. Note, this is a simple representation of the actual network implemented today.
BRIEF:
The router topology implemented in today's world is far too complicated to model in a small assignment. Therefore, we will simplify this model for our simulation. Assume we have 3 levels of routers:
Level 1: Dispatcher Router
All packets in our simulation will arrive at this router. The job of this router is to send off the queued packets to one of the available routers in the second level. Write a simple algorithm that determines which Level 2 routers a packet should jump to. (Discussed later.)
Level 2: Intermediate Hop Routers
These routers will accept a packet from the dispatcher router. There will be a user-determined amount of these routers. Depending the size of the packet, it takes a variable amount of time to process the packet. Once the arrived packets have been processed, the router can send those packets to their destination.
Level 3: Destination Router
To simplify our simulation, we assume all packets have the same destination. The job of this router is to accept incoming packets after they have been sent from the second level. However, due to a limited bandwidth (bottleneck in the network), this router can only accept a limited amount of packets at a given moment. This router will not be used in our simulation, but note its purpose.
Here is a picture of our network topology:
BACKGROUND:
Packets first arrive at the Dispatcher router. Each packet can arrive at a probability, prob, that is determined by the user. For each simulation time unit, a maximum of 3 packets can arrive at the Dispatcher. When a Packet arrives at the Dispatcher, a new Packet object should be created, and its data fields will be determined systematically based on rules we will describe later in the Packet class. On the same time unit, the Dispatcher will decide which Intermediate router a specified packet should be forwarded to. You are expected to write a simple algorithm that determines the routing table. (Algorithm specified later in the specs.)
When a Packet arrives at an Intermediate router, it is placed onto its corresponding queue. Only the first packet in the queue will be processed, while the others remain in the queue. However, if the queue is full at the time a packet comes in, we consider that as a buffer overflow, and the network will drop this packet. Once the router finds that a packet is ready to be sent, it will forward it to its final destination.
The final destination receives all incoming packets from the Intermediate routers. However, due to limited bandwidth, the destination router can only accept a limited amount of packets, limit, which is determined by the user. For example, if 3 packets have been finished processing by the Intermediate routers, but the limit is 2, only 2 packets can arrive at the destination in a simulation unit. The third packet must arrive in the next simulation unit.
NOTE:
Your implementation must consider fairness. That is, Intermediate routers must take turns to send packets. For example, if Intermediate routers 1, 2, 4, and 5 can send a packet at a given simulation unit, and the bandwidth is 2, routers 1 and 2 can send their packet. If, in the next simulation unit, Intermediate router 3 can also send a packet, routers 4 and 5 should send, not 3.
To summarize, for each simulation unit, implement the cases in the following order:
Decide whether packets have arrived at the Dispatcher. A maximum of 3 can arrive at a given time.
If the Dispatcher contains unsent packets, send them off to one of the Intermediate routers. You will write the method sendPacketTo(Collection intRouters) to decide which router the packet should be forwarded to.
Decrement all packets counters in the beginning of the queue at each Intermediate router.
If any packets are ready to be forwarded to the Destination router, do so.
Once a packet has arrived at the Destination router, take note of its arrival by recording the total time in the network. (Be careful of the bandwidth.)
NOTE: Unlike the CarSimulator discussed in lecture (at most 1 car can arrive at a given time), a maximum of 3 packets can arrive per time unit. Create and use the variable public static final int MAX_PACKETS = 3. You can use the following code to simulate random packet arrival:
for