A little CLI-based network simulator for learning networking concepts, utilizing lightweight goroutines and channels for network traffic. Includes fictional network appliances and simple implementations of essential TCP/IP protocols.
Download the Windows or Linux executable binary from the Releases page
- Install Go (https://golang.org/doc/install)
- Clone this repository and enter the directory
- Make the run script executable, and execute it (./run.sh)
First, create a network and pick a network size (/24 is recommended to start)
Currently, each network can only have one router. It is best to start off by creating the router:
add router router1
Next, create a host:
add host host1
You can now look at your network by running a show command. The most comprehensive of these is:
show overview
Once you have created a host, you can "plug in" the host to the router by linking them.
link host host1 router1
Next, set the IP configuration for your host. There are two ways to do this: Statically, or dynamically through DHCP. Both ways require you to be in device control mode.
When controlling a device, the commands are different from the main ltdnet menu. Run help
to see all available device control commands.
To enter device control mode for host1, run:
control host host1
If you wish to statically set your host's IP configuration, from device control mode run:
ip set <address>
The program will pick a subnet mask and default gateway, then ask you to confirm the new IP configuration.
To run DHCP to dynamically acquire an IP configuration, from device control mode simply run dhcp
. As long as there are available addresses in the router's DHCP pool, your host should now have an IP configuration.
To test connectivity, try pinging your router (likely 192.168.0.1) from the device control:
ping <gateway>
What now? You can start by reading the user manual from within the program with the manual
command, or you can try to complete all the Achievements (achievements
command).
I hope you find this program to be fun. Many more features are on their way, but the main focus right now is ironing out some of the remaining bugs in v0.x.
For any further questions, please email vincebel@protonmail.com
-
Switches can't yet connect to routers, or other switches
-
Display functions sometimes cause program to crash if a host has been deleted
-
Save files may break with newer versions (Future fix: No breaking changes in minor versions after v1.0)
Simple run script to run *.go from source
Clears the /saves directory
Builds executables for Linux and Windows
What has been accomplished at each version
Generate saves directory for binary running, implement shell command history with up+down arrows
DNS lookups, router has DNS server
Layer 1 rework (interfaces), host-level routing, static hostnames, bypasses for self-bound traffic
Bugfixes, rework local and remote ends of switchport links
Switch fixes: Hosts can link to switches, better broadcast handling, improved ARP + MAC tables
User Achievements, ARP table, switch MAC address tables, user preferences
Subnetting, DHCP + ping functionality rework, generalize destination MAC finding
Structs for messages and datagrams, sockets for internal application-layer communication
DHCP improvements, router control, router pinging
CLI improvements, host linking bugfixes
DHCP pool sorting changes, cleaning up JSON schema
Increase debug output
Improved host unlinking
Implement virtual switch for router, ping improvements
Deleting hosts, improved diagrams
Network diagram, initial design of switches
Debug system, IP configuration clearing
ARP, DHCP, complete network functionality, project structuring
Creating, saving, and loading JSON savefiles, creating a network, adding and linking hosts, adding routers, host controlling, device listeners, basic host-to-host pinging
Basic interface
This project is licensed under the terms of the GNU General Public License v3.0. See the LICENSE file for details.