SIMA
Network node implementations
Current version is 0.90
CONTENTS:
- Introduction to SIMA
- Node implementations
- Some utilities
- IPTOOLS2 (required)
- logger.c
- rttst.c
- Configuration guide and examples
SIMA stands for Simple Integrated Media Access and is a way to
provide QoS (Quality of Service) using
Differentiated Services. The main idea in SIMA is to let access nodes
stamp the TOS (Type of Service) field in every IP packet before forwarding
it to the core network that can provide QoS.
Rest of the documentation and more detailed information can be downloaded
from the
official SIMA homepage.
The network node implementations are built in the
Linux Traffic Control
(DiffServ on Linux) framework, inside the Linux kernel.
Both of these node iplementations are under development and have been
implemented into the Linux operating system. We are developing them
under the newest
stable kernels (2.2.x series), but propably will not merge them to the
default distribution - at least not yet. In other words, you'll have to get
the source code for the appropriate kernel version and apply the patch to
it. After that you will be able to configure and compile the kernel with
SIMA support. You need also some patched tools to operate the SIMA system
(read the Chapter 3).
The reason to this kind of operation obvious: the code is more or
less experimental. In other words - we can not give you any
guarantees.
NEWS and VERSION HISTORY:
- 17.01.2000 - Version 0.90: Major Access Node code changes
- Updated patch file available from 17th Jan 2000
- IF THE ACCESS NODE IMPLEMENTATION DOES NOT COMPILE YOU WILL
NEED TO UPGRADE YOUR GNU ASSEMBLER INTO VERSION 2.9.5 !!!
(it is part of the binutils package in RedHat/Debian distributions)
- still patched against the kernel version 2.2.9
- major changes in the Access Node calculus routines
- no changes in the Core Node implementation
- new patch for the tools also available from
tools section.
- 1.12.1999 - Version 0.89: Performance improvements
- still patched against the kernel version 2.2.9
- dequeuing functions changed - should work better with p-to-p PVC CIP
- removed changes from the CIP code
- some changes to requeuing functions - improved performance
- performance updates to /proc filesystem functions
- current tool patch (version 0.88) works with this version, too
- 23.11.1999 - Version 0.88: Major changes
- still patched against the kernel version 2.2.9
- major changes in core node code - accepts 2 different DPa tables
- "/proc/net/sima" syntax has been updated
- access node can now process RT flags in 3 modes (see below)
- access node has the SPECIAL EDGE mode, which allows it to
stamp the packets from pre-defined table. Table is read from
the user through "/proc/net/special_edge" file and it can hold
upto 4096 values at a time.
- requires updated iproute2 tools (= new patch available)
- some minor bug fixes :)
- 29.10.1999 - Version 0.85: Minor bug fixes
- still patched against the kernel version 2.2.9
- some modifications to Classical IP driver code, which should
enable the packet processing at higher levels (e.g. in SIMA queues)
- some modifications to the core node STATISTICS support. You
must update also the logger.c utility
- unnecessary files removed from the patch
- no changes to the iproute2 package
- the current tool patch (version 0.8) works with this release too...
- 15.10.1999 - Version 0.8: Access and core node operate together
- still patched against the kernel version 2.2.9
- access and core node can operate in same box/interface
simultaneously
- some minor bug fixes
- 06.10.1999 - Version 0.7: The merged core & access node release
- still patched against the kernel version 2.2.9
- following components have been added: access node
implementation + ATM and DiffServ patches.
- core node supports at least ethernet and CIP interfaces
- core node has experimental statistics support
- some changes to the 'tc' utility and core node (= reset command)
- first public release for access node
- some minor bug fixes
- 17.08.1999 - Version 0.6: This version was not made available
- 25.05.1999 - Version 0.5: Patched against the kernel version 2.2.9
- added the packet based queue implementation ("psima")
- queues can be larger than ever (not tested yet, though)
- the code can now be compiled also into the kernel
- some minor upgrades in the proc filesystem code (total packet counter)
- some bug fixes
- 07.04.1999 - Version 0.3: First "public" release. Patched against the
kernel version 2.2.1
- only byte based queues were implemented ("bsima")
The main function of core node is to schedule and buffer packets
before transmission. The scheduler can drop incoming packets that
do not have sufficient precedence level (DSCP) in the IP-headers
TOS-field at the moment. The precedence level is marked by the
access nodes that lie on the edges of the SIMA ("Differentiated
Services") network.
Special features:
This implementation allows the core node operate with either packet
based or byte based queue sizes. See Chapter 4
for configuration examples.
Core node should support now also most of the network interfaces. However
only Ethernet and CIP (with both SVC and PVC connections) have been tested.
The new feature allows user to define the DPa table from 2 different
tables - 12x12 and 24x24. This table can be chosen only during "queue"
initialization/installation. It can not be changed with "tc qdisc change ..."
command.
It has also 2 different filetypes under the proc filesystem. The availability
of these special files depends on the given kernel configuration options.
The core node specific files are:
- /proc/net/sima =
- Collects summary/counter information for each queue.
- /proc/net/sima_<int> =
- Collects statistics for the queue attached to the interface <int>.
Read the sima documentation file
(...linux/Documentation/networking/sima.txt)
for more info and look to the Chapter 4
for proc file reading utility (logger.c).
The main tasks of access node include flow recognition, flow measuring
and packet marking. Flows can be recognized by the 5-tuple and this
implementation exploits the firewalling code in the Linux kernel.
Flows are measured either with the "rate estimator" or with the
hand-made piece of assembler code. Then the packet is stamped with
the correct precedence value (into the TOS field) before forwarding.
Access node can process the RT flag in three different modes:
- 0 = Clear the RT flag for each processed flow
- 1 = Set the RT flag for each processed flow
- 2 = Do not touch the RT flag - let the source set it
New SPECIAL EDGE mode allows access node to stamp packets from table,
that is configurable by user. The table can hold upto 4096 different
values and it loops when the end-of-file is reached. This allows user
to assign pre-defined DP values (e.g. with statistical distribution)
for processed packets.
This implementation is still in the beta stage, so no more
implementation specific information is (yet) available.
- Download and install the kernel source code
- Read the kernel documentation and upgrade/install required programs
- Download the patch: sima-0.90.patch.gz
- Uncompress the patch file with gunzip.
- Apply the patch with following steps.
# cd /usr/src/linux (or wherever the new kernel is)
# patch -p1 < [/path/to/the]/sima-0.90.patch
- After the patch has been applied you can read the implementation
documentation from
.../linux/Documentation/networking/sima.txt
.
- Configure the kernel
# make xconfig (or "make menuconfig" or "make config")
*** Required cofiguration options for CORE NODE are: ***
Code maturity level options ->
Prompt for development and/or incomplete code/drivers [YES]
Networking options ->
Kernel/User netlink socket [YES]
TCP/IP networking [YES]
QoS and/or fair queueing ->
QoS and/or fair queueing [YES]
SIMA queue [YES | MODULE]
SIMA verbose messages [NO]
SIMA statistics (VERY EXPERIMENTAL) [NO | YES]
Scheduler/Timer clock source (read the help!) [GETTIMEOFDAY | CPU/RDTSC]
--- Use GETTIMEOFDAY if this box operates also as ACCESS NODE ---
*** Required cofiguration options for ACCESS NODE are: ***
Code maturity level options ->
Prompt for development and/or incomplete code/drivers [YES]
Networking options ->
Kernel/User netlink socket [YES]
Routing messages [YES]
Network firewalls [YES]
TCP/IP networking [YES]
IP: firewalling [YES]
IP: firewall packet netlink device [YES]
QoS and/or fair queueing ->
QoS and/or fair queueing [YES]
Diffserv field marker [YES | MODULE]
QoS support [YES]
Rate estimator [YES]
Packet classifier API [YES]
Firewall based classifier [YES | MODULE]
SIMA access node calculations [YES]
- Compile the kernel ("make dep; make clean; make bzImage")
- Compile and install the modules ("make modules; make modules_install")
- Install the kernel and update LILO
- Reboot the machine
- Install and patch the required programs
(read the Chapter 3)
- If SIMA support was compiled as module insert it into the kernel
("insmod sch_sima")
- ...and you are ready to go!
IPTOOLS2 (required)
You will need this set of tools (iproute2) to operate the queues of
every network interface. They are not distributed with the kernel, so
you'll have to download them from other sources. After that, you'll
have to patch them to add support for SIMA queues, compile and
install them. Read the following chapter for step-by-step instructions
howto get, install and apply them.
Installation and patching
- Download the tools. The package is called "iproute2" and can be
downloaded from the official site or from one of the mirrors.
Current patch is made against the version
iproute2-2.2.4-now-ss990630.tar.gz.
- Uncompress the package (gtar -zxvf iproute2...tar.gz)
- Patch the source code with the
sima-0.90-iproute2-990630.patch
(patch -p1 < ...patch)
- Configure and compile the tools. You'll need configured kernel too
(version 2.2.9 + SIMA patch),
because these programs require some headers from the kernel source
tree that are created automatically during kernel
configuration/compilation.
- After successfull compilation you can install and utilize the tools.
logger.c
This small utility reads one of the core node specific proc filesystem
files (which gather statistics) and writes out parsed data either to
standard output or into file. This version is modified to work with core
node version 0.85 (and higher). No more support provided (except by
E-MAIL !).
The source code is available here: logger.c
Compile it with the following command: 'gcc -Wall -O2 -o logger logger.c'
rttst.c
This small program tries to read the RDTSC registers from the processor.
If it succeeds it prints out the contents of the realtime registers
during a short loop. If the output looks like list of numbers that have
similar values your processor propably has the RDTSC register(s). I'm not
sure (because I can not test it here) what happens if the processor does
not have the RDTSC register(s), but it should report about invalid
instructions or something like that...
The source code is available here: rttst.c
Compile it with the following command: 'gcc -Wall -O2 -o rttst rttst.c'
RUDE & CRUDE
These programs generate and log close to real-time type of UDP traffic.
More information is available in the
RUDE & CRUDE WWW-pages.
Some scripts, that might be usefull if you want to configure/view
box configuration through WWW.
- show.shtml script for displaying current
network configuration.
- sima.cgi node configuration script. Read
the comments for installation instructions...
4.1 CORE NODE:
Here are the options that you can use to configure SIMA scheduler to your
network interface:
# tc qdisc <CMD> dev <DEV> root [b|p]sima <OPTIONS>
<CMD> = add - add the SIMA scheduler to the specified interface
del - remove the SIMA scheduler
change - change SIMA scheduler properties
<DEV> = network interface name (e.g. eth0)
CORE NODE should support now also non-Ethernet interfaces
<OPTIONS> = reset | [hi <#>] [lo <#>] [normal | stats] [ 12x12 | 24x24 ]
reset - reset queue counters (/proc/net/sima)
hi <#> - HIGH priority queue size in bytes/packets
lo <#> - LOW priority queue size in bytes/packets
normal | stats - Turn off/on the statistics measurements
12x12 | 24x24 - Choose the DPa table (12x12 is the DEFAULT)
Where <#> can be:
12-250000 for HIGH priority byte queue
12-1000000 for LOW priority byte queue
12-2500 for HIGH priority packet queue
12-10000 for LOW priority packet queue
Other values will be neglected and the queues will be created
with the default sizes 10000 bytes or 100 packets per queue.
Example 1: create SIMA queue for eth0, where high priority queue
can hold 9800 bytes and low priority queue 24000 bytes.
# tc qdisc add dev eth0 root bsima hi 9800 lo 24000
Example 2: create SIMA queue for eth1 with statistics, where high
priority queue can hold 50 packets and low priority queue 200 packets.
# tc qdisc add dev eth1 root psima hi 50 lo 200 stats
Example 3: read the status information.
# cat /proc/net/sima
Example 4: reset/clear SIMA queue counters for eth0.
# tc qdisc change dev eth0 root bsima reset
Example 5: remove SIMA queue from eth0.
# tc qdisc del dev eth0 root bsima
4.2 ACCESS NODE:
Examples under construction.
In the meantime you can find out the basic usage instructions from the
downloadable script file(s):
- access_only_cfg.sh
This scripts tells you how to configure access node. If you
would like to know more of the gory details, please ask.
- access_core_cfg.sh
This script shows you the required configuration what is needed
if you would like to use both access and core node features in the
same box/interface.
The script(s) are well commented, so the operation should be self evident...
Authors:
Juha Laine , james@cs.tut.fi
Sampo Saaristo , sambo@cs.tut.fi