Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/enderdzz/cn3-simulator
network protocol simulate
https://github.com/enderdzz/cn3-simulator
Last synced: 2 months ago
JSON representation
network protocol simulate
- Host: GitHub
- URL: https://github.com/enderdzz/cn3-simulator
- Owner: enderdzz
- Created: 2016-06-06T15:55:15.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-06-11T14:30:39.000Z (over 8 years ago)
- Last Synced: 2024-08-03T01:19:47.321Z (6 months ago)
- Language: C
- Homepage:
- Size: 123 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
This package simulates the protocols of Chapter 3 of "Computer Networks 3/e"
by Andrew S. Tanenbaum, published by Prentice Hall PTR, 1996. It was written
by Andrew S. Tanenbaum and may be freely distributed.The simulator is compiled by just typing 'make'. If you want to use gcc
instead of cc, change the lineCC=cc
to
CC=gcc
in Makefile.
It is executed by giving a command line containing the simulation parameters.
The command line has six decimal parameters, as follows:sim protocol events timeout pct_loss pct_cksum debug_flags
where
protocol tells which protocol to run, e.g. 5
events tells how long to run the simulation
timeout gives the timeout interval in ticks
pct_loss gives the percentage of frames that are lost (0-99)
pct_cksum gives the percentage of arriving frames that are bad (0-99)
debug_flags enables various tracing flags:
1 frames sent
2 frames received
4 timeouts
8 periodic printout for use with long runsFor example
sim 6 100000 40 20 10 3
will run protocol 6 for 100,000 events with a timeout interval of 40 ticks,
a 20% packet loss rate, a 10% rate of checksum errors (of the 80% that get
through), and will print a line for each frame sent or received. Because
each peer process is represented by a different UNIX process, there is
(quasi)parallel processing going on. This means that successive runs will
not give the same results due to timing fluctuations.A set of possible student exercises is given in the file exercises.