Skip to content

checkpoint20/net-simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

96 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NET-Simulator

An educational virtual computer network simulator for lecturers and students learning the basics of computer networks.

NET-Simulator screenshot

Overview

NET-Simulator lets students build virtual networks in a virtual environment. It supports four kinds of virtual devices — router, desktop computer, switch, and hub — wired together with universal cables and controlled through a command-line interface that mimics real network gear. The simulator implements layers 1–3 of the ISO/OSI model.

Features

Network protocols

  • Restricted IPv4 implementation (RFC 791)
  • ARP service with broadcast requests to resolve IP-to-MAC bindings
  • Restricted ICMP (RFC 792) supporting ping and traceroute
  • Ethernet-like layer-2 protocol with 6-byte MAC addressing, auto-assigned by the simulator kernel

Virtual devices

  • Router — layer-3 commutator with 8 IPv4 interfaces; forwards packets per a static routing table
  • Desktop — a router with a single interface
  • Switch — layer-2 commutator with 8 ports; uses MAC-learning like a real Ethernet switch
  • Hub — 8-port broadcast device with no forwarding logic
  • Cables — universal links with no physical characteristics and infinite bandwidth; they blink when transmitting

GUI

  • Drag-and-drop devices on the virtual desktop
  • Per-device context menus; double-click a device to open its virtual console
  • Command history (Up/Down), Ctrl+L to refresh, Ctrl+C to abort
  • Export the current network to an HTML report with a PNG diagram via a user-customizable XSLT template (cfg/tohtml.xsl)

Project files are XML, validated against src/main/resources/dtd/netsimulator.dtd.

Requirements

  • Java 21 (JRE to run; JDK to build from source)
  • Apache Maven 3.x to build from source

Avoid installing into a path that contains non-ASCII characters — the JVM may fail to read configuration files. See public_html/en/install.shtml for details.

Build from source

mvn package

This produces a shaded fat JAR at target/netsimulator.jar plus a distribution archive under target/ (built via the Maven Assembly plugin).

Run

On Linux/macOS:

./run.sh

On Windows:

run.bat

Both scripts launch netsimulator.jar with cfg/logging.properties as the logging config. On first launch the app opens xml/test.xml — a sample network with 4 desktops, 1 router, and 1 switch.

Quick start

  1. Run ./run.sh (or run.bat). The bundled xml/test.xml opens.
  2. Double-click any computer to open its virtual terminal.
  3. Try ifconfig to see the configured interfaces, then ping 12.0.0.11 from Desktop 1 to send ICMP across the router to Desktop 5.
  4. Type help for the full command list.

CLI reference

Command Synopsis Description
help help [-h] Display the reference guide.
ifconfig ifconfig [-h] [-a] [<interface>] [<address>] [-broadcast <address>] [-netmask <address>] [-up|-down] Configure a network interface, or show interface info.
route route [-h] [{-add|-del} <target> [-netmask <address>] [-gw <address>] [-metric <M>] [-dev <If>]] Manipulate the IPv4 routing table; without options, prints it.
ping ping [-h] [-i <interval>] [-t <ttl>] <destination> Send ICMP echo to check accessibility of an interface. Ctrl+C aborts.
arp arp [-h] [-r <IP-address> <interface>] Show the ARP table; -r resolves a MAC for a given IP via a request.
mactable mactable [-h] Show the MAC-address table (switch-specific).

Pass -h to any command for its full help. Shell shortcuts: Up/Down navigate history, Ctrl+L refreshes the screen, Ctrl+C aborts the running command.

Project layout

src/main/java/org/netsimulator/
├── Netsimulator.java   entry point (main)
├── gui/                Swing UI: MainFrame, NetworkPanel, device shapes, dialogs
├── net/                simulation core: devices, packets, routing, ARP, ICMP, addresses
├── term/               virtual terminal and CLI command implementations
└── util/               misc utilities (ID generator, etc.)

Runtime resources live under cfg/ (logging, XSLT export template, default config) and xml/ (sample projects).

License

NET-Simulator is licensed under the GNU General Public License v2 — see COPYING for the full text.

Links

About

NET-Simulator is an educational application. It was created to help lecturers and students in the learning of computer networks. Students can build virtual networks in the virtual environment provided by NET-Simulator.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors