Coder Social home page Coder Social logo

wkoszek / kmnsim Goto Github PK

View Code? Open in Web Editor NEW
59.0 4.0 5.0 9.17 MB

Koszek-Matyja Network Simulator. Specify network architecture in a simple configuration file and run network simulations.

License: BSD 2-Clause "Simplified" License

C 98.62% Makefile 1.38%
network-simulator network-architecture c simulation

kmnsim's Introduction

Koszek-Matyja Network Simulator

Build Status

It's a simple simulator of the Ethernet network architecture.

You specify network topology in a text file, and run the simulator. Simulator interprets the text file, and creates virtual hosts, its interfaces, switches/hubs and their interfaces too. It then creates connections between those.

Based on what has been requested in the configuration file, you can then ping the a host from another one and observe the network activity stage by stage.

Flow of data is documented in the "report file". Except from report file, one can also visualize the topology of the network in Graphviz, through the The DOT language.

Usage

Usage of kmnsim looks like this:

Usage: kmnsim [-a] [-d] [-D <file] [-h] [-S <file>] [-T <file>] [-v]
spec_file
-a		direct summary (.out), .dot and .txt files to spec_file.EXT;
-d		turn on debug mode;
-D <file>	put Graphviz file to <file>
-h		print this help
-S <file>	put summary file to <file>
-T <file>	put text (debug) file to <file>
-v		turn verbose mode

If you want to get all output files to the same prefix path, use option -a. For a debugging, you may want to turn a debugging mode with -d, which will cause more debugging warnings to be printed out. If you want to just get a .dot file (for graphing with Graphviz), use -D flag. -h will print help. Both -S and -T are used for tracking how the flow of packets happened in the network. The -v turns the verbose mode. One can specify -v multiple tiles (e.g.: -vv) to get more verbose output.

Examples

To generate a summary file, use:

./kmnsim -d -v -S spec.4.i out4

Assuming you want to plot a configuration file from spec.5.i file.

For getting a .dot file, you:

./kmnsim -d -v -D spec.4.u out4.dot

(later just use dot -Tjpg -o out4.dot out4.jpg to get an JPG file). Example JPG file (which came from an input file spec.11.i in conf/ directory) may look like this:

spec.11.i file plotted

Configuration file syntax

Example configuration file looks like this (see spec/spec.4.i file):

     1	host h1 create
     2	host h2 create
     3
     4	iface h1 0 ip 192.168.1.1
     5	iface h1 0 netmask 255.255.255.0
     6	iface h1 0 mac a2:b1:c1:1:2:3
     7
     8	iface h2 0 ip 192.168.1.2
     9	iface h2 0 netmask 255.255.255.0
    10	iface h2 0 mac a3:c3:d3:a2:10:20
    11
    12	hub buh1 create
    13
    14	connect buh1 0 h1 0
    15	connect buh1 1 h2 0

Following are the descriptions of individual lines:

a. Lines (1) and (2) create hosts h1 and h2 respectively b. Lines (4--6) configure the interface 0 of host h1 with IP address, the netmask and the physical MAC address c. Lines (8--10) are like (b), but for host h2 d. Line (12) creates hub called buh1 e. Line (14) uses connect directive to connect hub's buh1 interface 0 with host's h1 interface 0. f. Line (15) is like line (14), but for host h2

Author

kmnsim's People

Contributors

iiseymour avatar pmatyja avatar wkoszek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.