Description
Implement the core logic for the Terminal class as defined in the header file. The terminal acts as an end-node in the network simulation, responsible for page fragmentation into packets, packet reassembly, and bandwidth management.
Key Requirements
- Constructor: Initialize buffers, IP, and bandwidth parameters.
- Page Fragmentation (
sendPage): Logic to split Page objects into multiple Packet objects and enqueue them in the outputBuffer.
- Packet Reception (
receivePacket): Safely buffer incoming packets.
- Buffer Processing:
processOutputBuffer: Send packets to the connected Router limited by externalBW.
processInputBuffer: Dequeue packets and route them to the correct PageReassembler limited by internalBW.
- Reassembly Management: Implement
findOrCreateReassembler and handleCompletedPage to track incoming data streams.
- Monitoring: Implement
toString and the ostream friend operator for simulation logging.
Todo List
Description
Implement the core logic for the
Terminalclass as defined in the header file. The terminal acts as an end-node in the network simulation, responsible for page fragmentation into packets, packet reassembly, and bandwidth management.Key Requirements
sendPage): Logic to splitPageobjects into multiplePacketobjects and enqueue them in theoutputBuffer.receivePacket): Safely buffer incoming packets.processOutputBuffer: Send packets to the connectedRouterlimited byexternalBW.processInputBuffer: Dequeue packets and route them to the correctPageReassemblerlimited byinternalBW.findOrCreateReassemblerandhandleCompletedPageto track incoming data streams.toStringand theostreamfriend operator for simulation logging.Todo List
Terminal.cpp.PageReassemblerpointers within theList.