#2248 - Enhances the PrimAITE documentation, covering the Node, network interfaces, Session Manager, Software Manager, PCAP service, SysLog functionality, and network devices like Routers, Switches, Computers, and Switch Nodes. It details their roles, workflows, and integration within the simulation, focusing on frame processing, software management, and logging. The documentation also clarifies the frame reception process, including port checks and application-level dispatching, ensuring a thorough understanding of network operations within the simulation
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
|
||||
#########
|
||||
Host Node
|
||||
#########
|
||||
|
||||
The ``host_node.py`` module is a core component of the PrimAITE project, aimed at simulating network host. It
|
||||
encapsulates the functionality necessary for modelling the behaviour, communication capabilities, and interactions of
|
||||
hosts in a networked environment.
|
||||
|
||||
|
||||
HostNode Class
|
||||
==============
|
||||
|
||||
The ``HostNode`` class acts as a foundational representation of a networked device or computer, capable of both
|
||||
initiating and responding to network communications.
|
||||
|
||||
**Attributes:**
|
||||
|
||||
- Manages IP addressing with support for IPv4.
|
||||
- Employs ``NIC`` or ``WirelessNIC`` (subclasses of``IPWiredNetworkInterface``) to simulate wired network connections.
|
||||
- Integrates with ``SysLog`` for logging operational events, aiding in debugging and monitoring the host node's
|
||||
behaviour.
|
||||
|
||||
**Key Methods:**
|
||||
|
||||
- Facilitates the sending and receiving of ``Frame`` objects to simulate data link layer communications.
|
||||
- Manages a variety of network services and applications, enhancing the simulation's realism and functionality.
|
||||
|
||||
Default Services and Applications
|
||||
=================================
|
||||
|
||||
Both the ``HostNode`` and its subclasses come equipped with a suite of default services and applications critical for
|
||||
fundamental network operations:
|
||||
|
||||
1. **ARP (Address Resolution Protocol):** The ``HostARP`` subclass enhances ARP functionality for host-specific
|
||||
operations.
|
||||
|
||||
2. **DNS (Domain Name System) Client:** Facilitates domain name resolution to IP addresses, enabling web navigation.
|
||||
|
||||
3. **FTP (File Transfer Protocol) Client:** Supports file transfers across the network.
|
||||
|
||||
4. **ICMP (Internet Control Message Protocol):** Utilised for network diagnostics and control, such as executing ping
|
||||
requests.
|
||||
|
||||
5. **NTP (Network Time Protocol) Client:** Synchronises the host's clock with network time servers.
|
||||
|
||||
6. **Web Browser:** A simulated application that allows the host to request and display web content.
|
||||
@@ -0,0 +1,41 @@
|
||||
.. only:: comment
|
||||
|
||||
© Crown-owned copyright 2023, Defence Science and Technology Laboratory UK
|
||||
|
||||
############
|
||||
Network Node
|
||||
############
|
||||
|
||||
|
||||
The ``network_node.py`` module within the PrimAITE project is pivotal for simulating network nodes like routers and
|
||||
switches, which are integral to network traffic management. This module establishes the framework for these devices,
|
||||
enabling them to receive and process network frames effectively.
|
||||
|
||||
Overview
|
||||
========
|
||||
|
||||
The module defines the ``NetworkNode`` class, an abstract base class that outlines essential behaviours for network
|
||||
devices tasked with handling network traffic. It is designed to be extended by more specific device simulations that
|
||||
implement these foundational capabilities.
|
||||
|
||||
NetworkNode Class
|
||||
=================
|
||||
|
||||
The ``NetworkNode`` class is at the heart of the module, providing an interface for network devices that participate
|
||||
in the transmission and routing of data within the simulated environment.
|
||||
|
||||
**Key Features:**
|
||||
|
||||
- **Frame Processing:** Central to the class is the ability to receive and process network frames, facilitating the
|
||||
simulation of data flow through network devices.
|
||||
|
||||
- **Abstract Methods:** Includes abstract methods such as ``receive_frame``, which subclasses must implement to specify
|
||||
how devices handle incoming traffic.
|
||||
|
||||
- **Extensibility:** Designed for extension, allowing for the creation of specific device simulations, such as router
|
||||
and switch classes, that embody unique behaviours and functionalities.
|
||||
|
||||
|
||||
The ``network_node.py`` module's abstract approach to defining network devices allows the PrimAITE project to simulate
|
||||
a wide range of network behaviours and scenarios comprehensively. By providing a common framework for all network
|
||||
nodes, it facilitates the development of a modular and scalable simulation environment.
|
||||
41
docs/source/simulation_components/network/nodes/router.rst
Normal file
41
docs/source/simulation_components/network/nodes/router.rst
Normal file
@@ -0,0 +1,41 @@
|
||||
.. only:: comment
|
||||
|
||||
© Crown-owned copyright 2023, Defence Science and Technology Laboratory UK
|
||||
|
||||
######
|
||||
Router
|
||||
######
|
||||
|
||||
The ``router.py`` module is a pivotal component of the PrimAITE, designed to simulate the complex functionalities of a
|
||||
router within a network simulation. Routers are essential for directing traffic between different network segments,
|
||||
and this module provides the tools necessary to model these devices' behaviour and capabilities accurately.
|
||||
|
||||
Router Class
|
||||
------------
|
||||
|
||||
The ``Router`` class embodies the core functionalities of a network router, extending the ``NetworkNode`` class to
|
||||
incorporate routing-specific behaviours.
|
||||
|
||||
**Key Features:**
|
||||
|
||||
- **IP Routing:** Supports dynamic handling of IP packets, including forwarding based on destination IP addresses and
|
||||
subnetting.
|
||||
- **Routing Table:** Maintains a routing table to determine the best path for forwarding packets.
|
||||
- **Protocol Support:** Implements support for key networking protocols, including ARP for address resolution and ICMP
|
||||
for diagnostic messages.
|
||||
- **Interface Management:** Manages multiple ``RouterInterface`` instances, enabling connections to different network
|
||||
segments.
|
||||
- **Network Interface Configuration:** Tools for configuring router interfaces, including setting IP addresses, subnet
|
||||
masks, and enabling/disabling interfaces.
|
||||
- **Logging and Monitoring:** Integrates with ``SysLog`` for logging operational events, aiding in debugging and
|
||||
monitoring router behaviour.
|
||||
|
||||
**Operations:**
|
||||
|
||||
- **Packet Forwarding:** Utilises the routing table to forward packets to their correct destination across
|
||||
interconnected networks.
|
||||
- **ARP Handling:** Responds to ARP requests for any IP addresses configured on its interfaces, facilitating
|
||||
communication within local networks.
|
||||
- **ICMP Processing:** Generates and processes ICMP packets, such as echo requests and replies, for network diagnostics.
|
||||
|
||||
The ``router.py`` module offers a comprehensive simulation of router functionalities. By providing detailed modelling of router operations, including packet forwarding, interface management, and protocol handling, PrimAITE enables the exploration of advanced network topologies and routing scenarios.
|
||||
29
docs/source/simulation_components/network/nodes/switch.rst
Normal file
29
docs/source/simulation_components/network/nodes/switch.rst
Normal file
@@ -0,0 +1,29 @@
|
||||
.. only:: comment
|
||||
|
||||
© Crown-owned copyright 2023, Defence Science and Technology Laboratory UK
|
||||
|
||||
######
|
||||
Switch
|
||||
######
|
||||
|
||||
The ``switch.py`` module is a crucial component of the PrimAITE, aimed at simulating network switches within a network simulation environment. Network switches play a vital role in managing data flow within local area networks (LANs) by forwarding frames based on MAC addresses. This module provides a comprehensive framework for modelling switch operations and behaviours.
|
||||
|
||||
Switch Class Overview
|
||||
---------------------
|
||||
|
||||
The module introduces the concept of switch ports through the ``SwitchPort`` class, which extends the functionality of ``WiredNetworkInterface`` to simulate the operation of switch ports in a network.
|
||||
|
||||
**Key Features:**
|
||||
|
||||
- **Data Link Layer Operation:** Operates at the data link layer (Layer 2) of the OSI model, handling the reception and forwarding of frames based on MAC addresses.
|
||||
- **Port Management:** Tools for configuring switch ports, including enabling/disabling ports, setting port speeds, and managing port security features.
|
||||
- **Logging and Monitoring:** Integrates with ``SysLog`` for logging operational events, aiding in debugging and
|
||||
monitoring switch behaviour.
|
||||
|
||||
Functionality and Implementation
|
||||
---------------------------------
|
||||
|
||||
- **MAC Address Learning:** Dynamically learns and associates MAC addresses with switch ports, enabling intelligent frame forwarding.
|
||||
- **Frame Forwarding:** Utilises the learned MAC address table to forward frames only to the specific port associated with the destination MAC address, minimising unnecessary network traffic.
|
||||
|
||||
The ``switch.py`` module offers a realistic and configurable representation of switch operations. By detailing the functionalities of the ``SwitchPort`` class, the module lays the foundation for simulating complex network topologies.
|
||||
Reference in New Issue
Block a user