This project is a simple implementation of a TCP/IP stack simulation, focusing on Layer 2 and Layer 3 functionalities. It allows you to build network topologies, set routing entries, and perform basic networking operations.
To build the project, use the following command:
make build
Run the compiled executable with the following command:
./tcpip
You can set routing entries using the config node route
command. Here is an example:
config node route R1 122.1.1.3 32 10.1.1.2 eth0/1
To ping a destination address, use the run node ping
command. Example:
run node ping R1 122.1.1.3
You can also perform IP-in-IP encapsulation using the following command:
run node ping tunnel R1 <destinationIP> <tunnelIP>
- VLAN Support: Create and manage VLANs for network segmentation.
- Loopback Address: Assign loopback addresses to nodes for local testing.
In the topology/topology.go
file, you can create your own topology. Use the created topology in the cmd/commands.go
file by calling the function you created to replace the variable topology
with the returned topology.
This simulation is a work in progress, and more features will be added in the future.
Feel free to explore the code and experiment with different network topologies!