SimpleNetSim: A Java Network Simulator


Overview

SimpleNetSim is a basic network simulator written in Java for the entire purpose of teaching core ideas in network protocols, in particular, the datalink, network and transport layers. The GUI-based simulator handles the application and physical layers, handles generation of packets, and provides statistics.

What you need to know:


Installation


The STTP protocol

SimpleNetSim provides a sample "web browser" application that abstracts away just about all detail but the basic idea.

Let's try this in the GUI:

  • Before starting up simplenetsim, examine the file index.stml in the directory. As you can see, it's a simple text file.
  • Now run simplenetsim as before:
       java -jar ../simplenetsim.jar
       
  • Click on "Load", which loads the default parameter file test1.dat.
  • Click on "Debug", which turns on debugging.
  • Set animation to "Fast".
  • Click on "Reset".
  • Right click on node 1, the second node from the left and click on "Start browser". This will bring up a separate browser window, a really simple browser.
  • Enter "0:index.stml" in the URL textbox and click "Get".
  • Click on "Go" in the main window. Note: this may obscure the browser window. Move the main simplenetsim window to reveal the browser window.
  • You should see some packets move back and forth and the contents of index.stml appear in the default browser's window.
What exactly is going on?
  • STTP stands for: Simple Text Transfer Protocol.
  • The browser lets you enter a URL of the type: 0:index.stml.
          => What this means: this fetches the file index.stml from node 0.
  • Every node by default runs a webserver on port 80 and a webbrowser when brought up through a right-click (as above).
  • Read through the code in DefaultWebBrowser and DefaultWebServer to see how it works.
  • The idea is, you can implement a more sophisticated web browser that implements the WebServer interface.