This project was developed as part of the Object-Oriented Programming Laboratory course at Escola PolitΓ©cnica da Universidade de SΓ£o Paulo (USP).
It implements a simplified computer network simulator in C++, applying object-oriented programming principles.
The simulator models a small-scale computer network composed of:
- Routers and QoS-enabled routers (with priority queues)
- Hosts (end devices capable of running chat processes)
- Chats (processes that exchange messages through the network)
- Datagrams and Segments (representing packets and transport-layer messages)
- Scheduler (to simulate the passage of time and event processing)
- Persistence (loading network configurations from a file)
This project builds upon a first version (EP1) by introducing end-to-end communication between processes, support for hosts, and priority-based message forwarding.
- Object-oriented C++ design with:
- Classes:
Rede,No,Roteador,RoteadorComQoS,Hospedeiro,Chat,Datagrama,Segmento,Fila,FilaComPrioridade,Agendador,TabelaDeRepasse,Evento,PersistenciaDeRede, etc.
- Classes:
- Simulates message transmission between processes (chats) in different hosts.
- Routing and forwarding of packets with configurable delays.
- Priority queue support to simulate Quality of Service (QoS).
- Console-based interface for:
- Loading a network from a configuration file
- Sending messages between chats
- Advancing simulation time
The code is organized with one header (.h) and one implementation (.cpp) file for each class.
Key files include:
main.cppβ console interface to run the simulatorRede.*β network managementNo.*,Roteador.*,RoteadorComQoS.*,Hospedeiro.*β network nodesChat.*β process for message exchangeDatagrama.*,Segmento.*β packet and transport-layer segmentFila.*,FilaComPrioridade.*β queues for packetsTabelaDeRepasse.*β routing tableEvento.*,Agendador.*β event scheduling and time simulationPersistenciaDeRede.*β loading network configuration from files
This project was part of PCS3111 - Object-Oriented Programming Laboratory for Electrical Engineering at USP.
It was designed to practice:
- Object-oriented concepts (encapsulation, inheritance, polymorphism, abstract classes)
- Exception handling in C++
- Modular program design
- Simulation of distributed systems