122: CS2 --- Extra Credit Assignment

Due Friday, June 9

Problem Description: Create a class called PacketNetwork for simulating a communication network that sends and receives packets. This class should be derived from the Network class that was implemented in Assignment 3. A PacketNetwork object stores at each node of the network a queue of packets. For simplicity let us implement a packet as a single character. Use your queue template class to implement packet queues at each node. Here is a sample header file: packetnetwork.h

You will write a menu driven client program to test your new class. In addition to the inherited behaviors you should add the capability of enqueuing new packets and dequeue existing packets on the queue of any node of the network. You should also implement a "transmitpacket" function which dequeues a packet at one end of a link and enqueues the same packet at the other end of the same link.

As in Assignment 3, your client program will begin by prompting the user for the name of the file where the network data is stored. The rest of the program will be menu driven simulation of a dynamically changing packet network with the following menu:

1. Add a new link
2. Remove a link
3. Add a new node
4. Remove a node
5. Display network
6. Enqueue a packet
7. Dequeue a packet
8. Transmit a packet
9.. Display current packet queue
10. Exit program