cn3-simulator
所属分类:网络编程
开发工具:C/C++
文件大小:21KB
下载次数:3
上传日期:2009-06-03 12:55:29
上 传 者:
wurate
说明: Computer Networks 3/e 的C仿真
(Computer Networks 3/e simulates)
文件列表:
Makefile (283, 1996-03-26)
common.h (999, 1996-03-24)
doc (3667, 1996-03-24)
exercises (1852, 1996-03-26)
p1.c (1238, 1996-03-24)
p2.c (1396, 1996-03-24)
p3.c (2105, 1996-04-18)
p4.c (2102, 1996-03-24)
p5.c (4171, 1996-03-24)
p6.c (5533, 1996-03-25)
protocol.h (1784, 1996-03-24)
r1 (19, 1996-03-25)
run (109, 1996-04-30)
sim.c (8916, 1996-04-30)
worker.c (17679, 1996-04-30)
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 line
CC=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 runs
For 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.
近期下载者:
相关文件:
收藏者: