Skip to content

Feat/network#21

Merged
David-A-T-M merged 30 commits into
masterfrom
feat/network
Feb 28, 2026
Merged

Feat/network#21
David-A-T-M merged 30 commits into
masterfrom
feat/network

Conversation

@David-A-T-M
Copy link
Copy Markdown
Owner

This pull request introduces significant improvements to code documentation, formatting, and project configuration, as well as a major new class for network simulation. The most impactful changes include the addition of a comprehensive Network class, enhanced documentation and formatting for the IPAddress class, improvements to code style enforcement, and the integration of automatic documentation generation. These changes collectively improve code clarity, maintainability, and ease of use for future development and simulation tasks.

Major Feature Addition

Network Simulation:

  • Added a new Network class (include/core/Network.h) that manages routers, terminals, network topology generation, traffic simulation, and routing table recalculation. This class provides a flexible configuration structure and encapsulates all network simulation logic.

Documentation and Code Clarity

Enhanced IPAddress Documentation & Formatting:

  • Improved and expanded documentation for the IPAddress class, clarifying its structure, usage, and methods. Updated string formatting for IP addresses to use zero-padded "RRR.TTT" format for consistency and readability. Added a specialization for std::hash<IPAddress> to support hashing in containers. [1] [2] [3] [4]

Dijkstra Algorithm Interface Improvements:

  • Updated method signatures in the DijkstraAlgorithm class for clarity and added [[nodiscard]] attributes, along with improved documentation comments for parameters and return values. [1] [2] [3]

Project Configuration & Tooling

Automatic Documentation Generation:

  • Integrated Doxygen into the build process via CMakeLists.txt, enabling automatic generation of code documentation and warning checks, with fallback messaging if Doxygen is not found.

Code Style Enforcement:

  • Updated .clang-format settings to reduce the column limit to 100 and enable comment reflowing for improved code readability and consistency. [1] [2]

- Added missing documentation
- toString() method formatted for fixed size IPs
- Added PACKET_TTL constexpr
- Changed names to fit the standard
- Added missing documentation
- Removed routerPriority mechanism
- Removed ordering operators, as routerPriority is no longer a field
- Improved toString format
TESTING:
- Changed to fixture
- Removed unnecessary tests
- Rename variables for clarity and consistency
- Added expiration logic with `expTick` and `MAX_ASSEMBLER_TTL`
- Renamed variables for clarity and consistency (`expectedPackets` → `total`, `currentPackets` → `count`, etc.)
- Added missing methods: `toString`, stream operator, and comparison operators
- Improved documentation and exception handling
… tests for clarity, and updated to reflect recent API changes.
…-based queuing, updated constructor signatures, and improved naming for clarity.
…, added public getter methods, and updated tests to use new API.
- Documented `RoutingTable` class with description, methods, and functionality.
- Marked `size()` method as `[[nodiscard]]`.
- Simplified return statement in `getNextHopIP()`.
- Implemented `std::hash<IPAddress>` to enable usage of `IPAddress` in hash-based containers.
…e statistics, and restructured code for clarity and extensibility.
…verage for buffer processing and edge cases.
… options, and improved code clarity

- Replaced `List` containers with `std::unordered_map` for connections and terminals.
- Added bandwidth and buffer configuration via a new `Config` struct.
- Enhanced buffer management and routing logic with updated methods and improved statistics tracking.
- Expanded API with additional getters, `tick` logic, and packet processing functions.
- Updated constructors and documentation for clarity and extensibility.
…overage for connection and packet processing scenarios.
- Introduced a new API to retrieve IP addresses of connected neighbor routers.
- Added associated documentation and implementation.
- Replaced hardcoded values in `Packet` creation with proper field ordering.
- Updated `processInputBuffer` calls to use delay argument.
- Applied `std::move` for routing table updates.
- Renamed comments for square topology tests for better readability.
- Renamed variables and comments for better readability.
- Updated neighbor processing logic to use `getNeighborIPs` and buffer usage.
- Adjusted function formatting for consistency.
- Enhanced documentation in header file.
- Improved class-level and method-level documentation across `Page`, `PageReassembler`, `RoutingTable`, and `Terminal`.
- Clarified parameter descriptions, return values, and error conditions.
- Unified comment formatting for consistency.
- Added missing inline documentation for constructors and operators.
… methods, parameters, and documentation for consistency and clarity. Add `srcIP` to `PageReassembler`.
- Introduced terminal-sharing APIs: `shareAddressBook`, `shareRandomGenerator`, `shareTrafficProbability`, and `shareMaxPageLength`.
- Added `getTerminals` and `getTerminalIPs` for enhanced terminal management.
- Replaced `expTick` with `timeout` in `Router`'s packet processing for consistency.
…handling

- Added traffic generation (`generateTraffic`) with configurable probability, destination selection, and page length.
- Introduced setters and getters for traffic configuration: `setTrafficProbability`, `setMaxPageLength`, `setRandomGenerator`, and `setAddressBook`.
- Replaced `expTick` with `timeout` across methods, parameters, and documentation for consistency.
- Enhanced `PageReassembler` with `srcIP` tracking for improved packet handling.
- Updated reassembly logic, buffer processing, and quarantine handling to use `timeout`.
- Introduced the `Network` class to handle router and terminal topology, traffic generation, and simulation.
- Implemented key methods for network initialization, minimal spanning tree connection, additional connections, and route recalculation.
- Added simulation features with tick-based updates and routing table recalculations.
- Included configuration struct for flexible network setup.
- Introduced comprehensive test coverage for the `Network` class, including constructor behavior, link establishment, and simulation functionality.
- Added stress tests to evaluate performance under large-scale and high-load configurations.
- Verified correctness of packet handling metrics: dropped, forwarded, delivered, and timed out packets.
- Ensured stable behavior during multi-call simulations and route recalculations.
- Added Doxygen configuration to CMake for documentation generation and warnings checking.
- Adjusted `.clang-format` settings: reduced column limit to 100 and enabled automatic comment reflow.
@David-A-T-M David-A-T-M self-assigned this Feb 28, 2026
@David-A-T-M David-A-T-M linked an issue Feb 28, 2026 that may be closed by this pull request
@David-A-T-M David-A-T-M merged commit a81268d into master Feb 28, 2026
6 checks passed
@David-A-T-M David-A-T-M deleted the feat/network branch February 28, 2026 03:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Network class

1 participant