Commits

Shlomi Fish  committed 481b48b

Moving away the old site

  • Participants
  • Parent commits e8a48cb

Comments (0)

Files changed (44)

File site/Old/site/wml/.wmlrc

+-D ROOT~.

File site/Old/site/wml/Makefile

+
+D = ./dest
+
+IMAGES = $(D)/style.css                                       \
+         $(D)/docs/Arbitrator_Architecture.txt                \
+         $(D)/docs/Architecture.txt                           \
+         $(D)/docs/ip_noise.spec.zip                          \
+         $(D)/docs/Protocol.txt                               \
+         $(D)/docs/Syntax_Description.txt                     \
+         $(D)/docs/roadmaps/2001-08-22.txt                    \
+         $(D)/download/IP-Noise-Engine-perl-0.1.0.tar.gz      \
+         $(D)/download/IP-Noise-Engine-perl-0.1.1.tar.gz      \
+         $(D)/download/IP-Noise-Engine-perl-0.1.2.tar.gz      \
+         $(D)/download/IP-Noise-Engine-perl-0.1.4.tar.gz      \
+         $(D)/download/IP-Noise-Engine-perl-0.1.5.tar.gz      \
+         $(D)/download/IP-Noise-perl-filters-0.1.0.tar.gz     \
+         
+
+
+SUBDIRS = $(D)/download $(D)/docs $(D)/docs/roadmaps $(D)/mailing-list
+
+HTMLS = $(D)/index.html $(D)/download/index.html $(D)/links.html \
+	$(D)/docs/index.html $(D)/mailing-list/index.html
+
+all : $(SUBDIRS) $(HTMLS) $(IMAGES)
+
+$(SUBDIRS) :: % : 
+	@if [ ! -e $@ ] ; then \
+		mkdir $@ ; \
+	fi
+	
+
+$(HTMLS) :: $(D)/% : %.wml .wmlrc
+	wml $< > $@
+
+$(IMAGES) :: $(D)/% : %
+	cp -f $< $@

File site/Old/site/wml/docs/Arbitrator_Architecture.txt

+The Arbitrator is going to have two threads:
+
+1. The Arbitrating Thread - this thread accepts packets from the
+Packets Queue, decides what to with them according to the Markovian chains
+and if it is to be delayed, it puts it in the priority queue of the release 
+thread (which is not part of the arbitrator and is described in 
+Architecure.txt.
+
+2. The Chains States Maintainance thread - this thread updates the
+active states of the Markovian chains by using a priority queue.
+
+It is possible that there will be several arbitrating threads, all of which
+are symetrical. Each one will decide what to do with a single packet before
+opting to receive others of its kind.
+
+The chains states maintainance thread is quite trivial to write. Therefore,
+most of this document will focus on the Arbitrating Thread.
+
+Chain Filter Structure:
+-----------------------
+
+A chain filter structure will look as follows:
+
+struct chain_filter
+{
+    ip_specification * source;
+    ip_specification * dest;
+    protocols_bit_mask protocols; /* A bit mask specifiying which protocols to filter */
+    /* We treat the TOS bits as one big 6-bit integer 
+    int min_tos;
+    int max_tos;
+    int which_tos;        /* 
+                             Can be - 0 - don't care.
+                             1 - Greater than min 
+                             2 - Lower than max
+                             3 - Between min and max
+                             4 - Not between min and max.
+                          */
+    int min_packet_len;
+    int max_packet_len;
+    int which_packet_len; /* 
+                             Can be - 0 - don't care.
+                             1 - Greater than min 
+                             2 - Lower than max
+                             3 - Between min and max
+                             4 - Not between min and max.
+                          */
+}
+
+typedef char protocols_bit_mask[32];
+
+-> A complete bitmask of all available IP-based protocol. One bit
+for every protocol.
+
+And the ip_specification struct is defined as follows:
+
+struct ip_specification
+{
+    ip_specification * next; /* = NULL to terminate the linked list. */
+
+    bit inverse; /* Inverse the condition */
+    in_addr ip;
+    int net_mask; /* The sub-net width of the IP range */
+    int num_port_ranges; /* If = 0 then any port will do. */
+    /* A sorted array of port ranges. We do a binary (or linear) search to see
+       if the port of the packet matches them. */
+    port_range_struct * port_ranges; 
+}
+
+State Syntax:
+-------------
+
+struct state_struct
+{
+    probability_type drop_prob;
+    probability_type delay_prob;
+    delay_type * delay_function;
+    int time_factor;
+    int num_move_tos;
+    move_to_type * move_tos;
+    probability_type stable_delay_prob;
+}
+
+struct move_to_type
+{
+    probabilty_type comulative_prob;
+    int which_state; /* Determines the state to go to */
+}
+
+Move to is a sorted array. We search it for the apropriate probability
+in the range (0,1) and from that we determine the state to go to next.
+
+Chain Syntax:
+-------------
+
+struct chain_struct
+{
+    int num_states;
+    state_type * states;
+
+    int current_state;
+    chain_filter_type * filter;
+
+    time_t time_of_last_packet;
+
+    Dictionary <String -> Int> state_names;
+}
+
+Arbitrator Data Structure Syntax:
+---------------------------------
+
+struct arbitrator_struct
+{
+    int num_chains;
+    chain_type * chains;
+
+    read_write_lock_t lock;
+
+    priority_queue<change_state_event_type> change_states_pq;
+
+#if there is more than one arbitrator threads:
+    mutex protect_num_active_threads;
+    int num_active_threads;
+    bool terminate_threads;
+#endif
+
+    Dictionary <sting -> int> chain_names;
+}
+
+struct change_state_event_struct
+{
+    int chain;
+    time_t invalidation_time;
+}
+
+
+The Delay Function Type:
+------------------------
+
+struct delay_function_struct
+{
+    int type;
+                 
+    union params
+    {
+        double lambda;
+        struct split_linear_function_struct
+        {
+            int num_points;
+            struct prob_and_delay 
+            {
+                probability_t prob;
+                double delay;
+            } * points;
+        };
+    };
+}

File site/Old/site/wml/docs/Architecture.txt

+Msg:
+----
+
+The class Msg is an implementation of a "Heap" element that contains
+the actual IP packet as well as the time (in seconds and microseconds)
+of its arrival. 
+
+There's nothing too interesting there, and the functions are very short
+and trivial. For more information consult the Heap::Elem man page.
+
+Delayer:
+--------
+
+Delayer is a class that handles delaying packets with the possibility
+of different delay lengths and different arrival times. It accepts 
+the packets as is and does not decide how much to delay them itself.
+Moreover, it does not use the IP-Queue interface directly and rather
+uses a callback to release the packets after their delay.
+
+This module has two methods:
+
+delay_packet() - this method accepts a packet, its arrival time
+and the amount of time, in quanta of 1 millisecond, to delay it, 
+and register this packet to be released only at this amount of time 
+at the future.
+
+release_packets_poll_function() - this method should be called periodically
+in order to release those packets whose time has come to be released.
+
+The class uses a priority queue to organize the packets and their release
+times. release_packets_poll_function() constantly peaks the minimal item of 
+the PQ to determine whether its release time has already come. If so, 
+it extracts it out of there.
+
+Packet::Logic:
+--------------
+
+Perhaps should have been named "Packet::Arbitrator" or "Packet::Decide".
+This class determines what to do with a packet. It has one method -
+decide_what_to_do_with_packet() which returns the outcome of the packet.
+This way, a state can be implemented inside the object.
+
+The function should return a reference to a hash that contains the following 
+fields:
+
+'action' - can be of value "accept", "delay", or "drop".
+'delay_len' => applicable only if 'action' is "delay". This is the delay
+in quanta.
+
+At the moment this function implements a simple state-less rule-based noise
+, where the rules are not unlike the IP firewalling rules of the kernel. A
+better description of the format of the rules should be written at a
+certain stage, but is not available now.
+
+main.pl:
+--------
+
+This is a script that use Delayer, Packet::Logic and the IP-Queue interface. 
+However, it can be easily encapsulated in its own class by an experienced
+perl coder.
+
+The script performs a loop in which it:
+1. Gets the next message from the IP-Queue.
+2. Calls release_packets_poll_function to release the appropriately delayed 
+   packets.
+3. Call decide_what_to_do_with_packet() to get its verdict.
+4. Accepts, drops, or queues the packet for delay based on its verdict.
+5. Return to Step #1.
+
+Note that this script relies on a fact that packets constantly arrive 
+at the IP Queue for verification. If not it may get stuck, while some
+packets that need to be released after a significant delay will not be
+released. 
+
+This can be easily solved by putting step #2 on its own thread, but it has
+not been done yet. (Some versions of the perl interpreter do not support 
+multi-threading).
+
+main_mt.pl:
+-----------
+
+This script is similar to main.pl only that it initiates three threads, each
+of which is responsbile for doing one operation:
+
+1. The main thread gets a message from the IP-Queue, stamps it with its
+arrival time and places it inside a (thread-safe) queue.
+
+2. The arbitrator thread gets a message from that queue, and determines what
+to do with it. If it should be dropped or released it does so. If it is to 
+be delayed it invokes the delayer to delay it.
+
+3. The delayed packets' release thread performs an infinite loop in which
+it calls the delayer's release_packets_poll_function() method.
+
+By using this scheme, one can ensure that the delayed packets will be released
+on time, even if the traffic is inconsistent.
+
+    Notes:
+    1. This file requires the perl interpereter to be compiled with 
+       multi-threading support.
+    2. This file contains some duplicate code with main.pl. I'd like to wrap
+       their functionality in a nice object, which can be used by both 
+       the non-threaded script and the threaded script.
+
+

File site/Old/site/wml/docs/Protocol.txt

+
+State - If 0 is transmitted - <int32> - index
+        If 1 is transmitted - <string> - its name
+        <string> is string_len+1 bytes that terminate with a NULL character.
+        string_len should be 127 bytes or so.
+
+Chain - If 0 is transmitted - <int32> - index
+        If 1 - <string> - its name
+
+Return Values - 0 - OK
+                1 - Wrong Input
+                
+Packet Range - start=<int16> end=<int16> 
+               If start > end then it's a terminator.
+
+Packet Ranges Specifier - <Packet Range> <Packet Range> .... <Terminator>
+
+IP Component - ip=<int32> 
+               netmask_width=<int32> 
+               inverse=<bool> 
+               <Packet Ranges Specifier>
+
+IP Component Terminator - ip=255.255.255.255 but there is still a netmask
+and a packet range specifier for parity.
+
+IP Filter - <IP Component> <IP Component> <IP Component> <Terminator>
+
+Split Linear Specifier Token : 
+    prob=<Probability Type>
+    delay=<Delay Type>
+
+    terminator (last element) is when prob=1.
+
+Split Linear Specifier:
+    <Split Linear Token> <Split Linear Token> ... <Terminator>
+
+Delay Type - any of:
+    1. Exponential   0x0
+    2. Split Linear  0x1
+    
+
+Protocol Operations:
+
+
+* Define a new chain.
+
+    Input: <0x0000> chain_name=<string>
+    Output : <RetValue> chain_number=<int32>
+
+    Note: even if RetValue indicates failure we still broadcast the
+    chain number, which should be ignored by the front-end.
+
+* Define a new state in a chain.
+
+    Input: <0x0001> chain=<Chain> state_name=<State>
+    Output : <RetValue> state_number=<int32>
+
+* Define the move probabilities between states @source to states @dest.
+(by using a matrix of inputs) inside a chain.
+
+    Input: <0x0002> 
+           chain=<Chain> 
+           scalar(@source)=<int32> 
+           scalar(@dest)=<int32> 
+           $source[0]=<State>
+           $source[1]=<State>
+           .
+           .
+           $dest[0]=<State>
+           $dest[1]=<State>
+           $dest[2]=<State>
+           probs($s -> $d)=<Probability Type> (scalar(@source)*scalar(@dest) of them)
+
+    Return: <RetValue>
+
+* Chain Filters:
+    - Set source to something.
+        Input: <0x0003>
+               chain=<Chain>
+               filter=<IP Packet Filter>
+        Output:
+            <RetValue>
+            
+    
+    
+    - Set dest to something
+        Input: <0x0004>
+               chain=<Chain>
+               filter=<IP Packet Filter>
+        Output:
+            <RetValue>
+        
+    - Enable/Disable Protocol X.
+        Input: <0x0005>
+              chain=<Chain>
+              protocol_id=<int32>
+                - If = 256 then all protocols should be enabled or disabled.
+              enable_or_disable=<bool>
+        Output:
+            <RetValue>
+        
+    - Set TOS Precedence Bits
+        Input: <0x0006>
+               chain=<Chain>
+               Precedence = <int16>
+        Output:
+            <RetValue>
+            
+    - Set TOS bits mask
+        Input: <0x0007>
+            chain=<Chain>
+            tos_bits_mask=<int16>
+        Output:
+            <RetValue>
+
+    - Set Min. packet length
+        Input: <0x0008>
+               chain=<Chain>
+               Min_Packet_Length=<int16>
+        Output:
+            <RetValue>
+            
+    - Set Max. packet length
+        Input: <0x0009>
+               chain=<Chain>
+               Max_Packet_Length=<int16>
+        Output:
+            <RetValue>
+
+    - Set Which packet length
+        Input: <0x000a>
+               chain=<Chain>
+               Which_Packet-Length=<int16>
+        Output:
+            <RetValue>
+                             Can be - 0 - don't care.
+                             1 - Greater than min 
+                             2 - Lower than max
+                             3 - Between min and max
+                             4 - Not between min and max.
+
+* Retrieve the index of the chain (by name).
+        Input: <0x000b>
+            chain=<Chain>
+            
+        Output:
+            <RetValue> 
+            chain#=<int32>
+
+* Retrieve the index of a state within a chain (by name).
+        Input: <0x000c>
+            chain=<Chain>
+        Output:
+            <RetValue> 
+            state_index=<int32>
+
+* Retrieve the move probabilities between @source and @dest.
+        Input: <0x000d>
+               chain=<Chain>
+               scalar(@source)=<int32> 
+               scalar(@dest)=<int32> 
+               $source[0]=<State>
+               $source[1]=<State>
+               .
+               .
+               $dest[0]=<State>
+               $dest[1]=<State>
+               $dest[2]=<State>
+        Output:
+               <RetValue>
+               prob[$s][$d]=<Probability Type> for each source and dest.
+
+* Set the drop/delay prob of a state.
+        Input: <0x000e>
+               chain=<Chain>
+               state=<State>
+               drop_prob=<Probability Type>
+               delay_prob=<Probability Type>
+        Output:
+            <RetValue>
+
+* Set the delay function type of a state.
+        Input: <0x000f>
+               chain=<Chain>
+               state=<State>
+               delay_type=<Delay Type>
+        Output:
+            <RetValue>
+
+* Set the split-linear delay function of a state.
+        Input: <0x0010>
+               chain=<Chain>
+               state=<State>
+               split_linear=<Split Linear Spec>
+        Output:
+            <RetValue>
+               
+
+* Set the delay function's lambda. (in case it is Exponential).
+        Input: <0x0011>
+               chain=<Chain>
+               state=<State>
+               lambda=<lambda_type>
+        Output:
+            <RetValue>
+
+* Set the time factor of a state.
+        Input: <0x00013>
+               chain=<Chain>
+               state=<State>
+               time_factor=<Delay Type>
+        Output:
+            <RetValue>
+               
+
+* Set the stable delay probability of a state. (we mean that packets are sent
+in the order in which they were received).
+        Input: <0x0014>
+               chain=<Chain>
+               state=<State>
+               prob=<Probability Type>
+        Output:
+            <RetValue>
+               
+
+* Delete a state from a chain.
+        Input: <0x0015>
+               chain=<Chain>
+               state=<State>
+        Output:
+            <RetValue>
+
+
+* Delete an entire chain.
+        Input: <0x0016>
+               chain=<Chain>
+        Output:
+               <RetValue>
+
+* Set a chain's current state.
+        Input: <0x0017>
+               chain=<Chain>
+               state=<State>
+        Output:
+               <RetValue>
+
+* Dump all the information of all the chains.
+        Input: <0x0018>
+        Output: 
+            <RetValue>
+            num_chains=<int32>
+            @chains=@<Output_Chain> where 
+                Output_Chain=
+                    name=<string>
+                    current_state=<int32>
+                    time_of_last_packet=<Time Type> where
+                        Time Type=
+                            sec=<int32>
+                            usec=<int32>
+                    filter_protocols=<Bitmask of 32 bytes>
+                    filter_tos_precedence=<int16>
+                    filter_tos_bits=<int16>
+                    filter_min_packet_len=<int16>
+                    filter_max_packet_len=<int16>
+                    filter_which_packet_len=<int16>
+                    filter_source_ip_spec=<IP Specification>
+                    filter_dest_ip_spec=<IP Specification>
+                    states_num=<int32>
+                    @states=@<Output_State> where
+                        Output_State=
+                            drop_prob=<Probability Type>
+                            delay_prob=<Probability Type>
+                            delay_type=<Delay Function Type>
+                            delay_type_param= Depends on delay_type:
+                                If Exponential=
+                                    lambda=<lambda_type>
+                                If Split-linear=
+                                    split_linear_spec=<Split Linear Spec>
+                            time_factor=<Delay Type>
+                            stable_delay_prob=<Probability Type>
+                           
+

File site/Old/site/wml/docs/Syntax_Description.txt

+Internals:
+----------
+
+There are going to be several Markovian chains, each one with its
+own rules that decide which packets to pass to it. It is possible 
+that a packet would be processed in more than one chain. In this
+case:
+
+1. If one of those chains decided to drop it - the packet would be dropped.
+2. Else, the packet would be delayed for a sum of the delays of the chains.
+
+Each chain will store the time of the last packet that was sent. There is 
+a probability constant in each of its states that determines if the delay 
+is relative to the time of the last packet, or an absolute delay. 
+
+Each one of a chain's states contains the probabilities of the releasing,
+dropping or delaying a packet, as well as the delay function (refer to "Delay
+Functions"). It also contains the probabilities of passing to the other states.
+
+There will always be one special chain called the default chain, which
+determines what to do with packets that did not fit into any other chain, 
+assuming that they indeed did not. If such a chain was not defined by the
+user, it will be initialized to always pass a packet.
+
+Chain Filters:
+--------------
+
+A chain filter may refer to the following specifications:
+
+Source IP Address: a list of subnets, each specified in a similar way
+to that of the Linux fire-walling rules. Each IP or subnet is accompanied
+with a specification of the input port (if appropriate to the protocol).
+
+Examples:
+
+{ 129.28.5.0/24:80,8080-8090 ; 132.68.0.0/16:20-21 }
+
+; - separates IP/Masks/Ports constructs
+, - separate ports
+/ - separate the number of 1's in the net-mask from the IP address.
+
+Destination IP Address: Same syntax as the source IP Address.
+
+Protocol : can be a list of any of TCP, udp, icmp or any other of
+the /etc/protocols protocols, or an inversion of such list.
+
+Type of Service:
+
+    Is split into several specifications:
+    Precedence: can be any of the 3-bit octets.
+    Delay            \
+    Throughput       |- Each a one-bit flag.
+    Relay-ability     /
+
+    Each one of those fields may be safely specified to be ignored.
+
+Packet Length:
+
+    Can be "l>5000", "l<3000", "200<l<600".
+
+Whole Chains Syntax:
+--------------------
+
+State "A" {
+   drop = 0.2
+   delay = 0.1
+   delay_type = [!--- A Delay Function ---]
+   time_factor = 500 # This is the time factor to move to the other state
+   move_to = {
+        0.2 = B
+        0.3 = C
+        0.5 = E
+   }    
+}
+
+Chain "MyChain" {
+    source = ...   #  All of these are optional
+    dest =  ...    #
+    length =       #
+    protocol =     #
+    ToS/QoS =      #
+    
+    State "A" { 
+        ...
+    }
+    State "B" { 
+        ...
+    }
+}
+
+Chain "default" {
+
+}
+
+The identifiers are case-insensitive
+
+Delay Functions:
+----------------
+
+1. Exponential: With a given Lambda     E(500)
+
+2. Uniform : From t=t_{start} to t=t_{end} U(500,1500)
+
+3. Generic: Define a function from [0,1] using intermediate points. Between
+two points there is a linear interpolation of them. ( a la Spice)
+
+Generic {
+    0 = 500
+    0.1 = 500
+    0.2 = 300
+    0.5 = 0
+    0.8 = 0
+    0.8001 = 1000
+    1      = 2000
+}
+
+Incremental Changes:
+--------------------
+
+It would be possible to modify the arbitrator at run time. 
+
+Thus, a protocol should be defined so that such incremental changes would 
+be possible.
+
+Examples: 
+
+1. Set move_to of State "A" of Chain "MyChain" to { 0.2 = B, 0.3 = D, 0.5 =A }
+
+2. Set time_factor of State "A" of Chain "MyChain" to 900.
+
+3. Define new Chain "Hello" as { }.
+
+4. Delete chain "MyChain".
+
+5. Override chain "Hello" as { }.
+
+6. Define new state "MyState" in Chain "Hello" as { }
+
+7. Define in chain "Hello" probabilities of transfer from (A,B,C,D) to 
+(A,B,C,D,E,time_factor) as { ... matrix ... }.
+
+

File site/Old/site/wml/docs/index.html.wml

+#!wml
+#include 'template.wml'
+
+<subject "IP-Noise Project Documents">
+
+<p>
+<a href="ip_noise.spec.zip">The Project's Specification</a>
+</p>
+
+<p>
+<a href="Syntax_Description.txt">A description of the syntax of the 
+packet arbitrator
+</a>
+</p>
+
+<p>
+<a href="Architecture.txt">A description of the Architecture of the 
+IP-Noise Engine Perl Framework</a> - at the moment it has a very 
+stupid arbitrator. Nevertheless, we plan to keep much of the structure
+in the final product.
+</p>
+
+<p>
+<a href="Arbitrator_Architecture.txt">A description of the Arbitrator's
+Architecture</a>
+</p>
+
+<p>
+<a href="Protocol.txt">A description of the Arbitrator's Protocol</a>
+</p>
+
+<h2>Road-maps</h2>
+
+<p>
+<a href="roadmaps/2001-08-22.txt">22 August, 2001</a>
+</p>
+

File site/Old/site/wml/docs/ip_noise.spec.zip

Binary file added.

File site/Old/site/wml/docs/roadmaps/2001-08-22.txt

+I decided to take a moment and sum up what Roy and I have achieved so
+far and what is our roadmap for the future. So far, progress has been
+hampered by the fact that Roy had Milu'im, but we still achieved to do several
+things. Here is a small report of our current status:
+
+The Development Workstation:
+----------------------------
+
+* Local Web-server is running.
+
+* X-Windows is running. ( we will have some problems once we switch to
+the bigger and better screen)
+
+* Very crappy temporary screen, but I can successfully work on it
+by accessing it through VNC from the nearby workstation which has a better
+screen.
+
+* SMB mounting of the home-directory of comnet 
+(The Computer Networks Lab server) is working. 
+
+* CVS server is running and operational on the local workstation.
+
+* Everything I can think of, from KDE to gvim to bash, was customized to match my whims.
+
+* Soundcard is working. (I don't think we'll need it much, but the music 
+sure is nice)
+
+* The Win2000 partition is not defined, but technically still present on the
+hard-disk. I believe that with some effort we can define it by knowing what
+the start and end sectors are. In any case, we don't need Windows for the time 
+being and we can always use a network workstation.
+
+Com-Net Account:
+----------------
+
+* HTML site is on. -
+    http://comnet.technion.ac.il/~cn1w02/
+
+* SSH/Telnet account is active. (only SSH version 2, though)
+
+* Login via the NT domain is working.
+
+Mailing-List:
+-------------
+
+* Created a mailing list of ip-noise@iglu.org.il.
+
+* Should be archived at http://www.mail-archive.com/ip-noise@iglu.org.il/.
+Archive is not active yet from some reason.
+
+BerliOS Project:
+----------------
+
+* I opened a BerliOS project for it under the id of "ip-noise". Those who
+wish to become members of this project:
+
+1. Register at http://developer.berlios.de/
+2. Send me an E-mail and I'll add them to the project.
+
+In any case, the project's page is:
+
+http://developer.berlios.de/projects/ip-noise
+
+* Remote BerliOS CVS is operational.
+
+* The BerliOS web-site just contains a link to the web-site at the Technion.
+    http://ip-noise.berlios.de/
+
+* We may activate some of the other services BerliOS offers us (Bug Tracking? 
+Mailing Lists? Patch Manager? Web Forums? ) later, but they
+are most suitable for projects whose developers are not concentrated in 
+one place, which is not exactly the case for us.
+
+Code:
+-----
+
+We have written an engine in Perl that can retrieve packets off the kernel
+and then send them away, drop them or delay them to arbitrary delays. The
+arbitrator that is available at the moment is is a simple state-less 
+arbitrator, which does not resemble our conception of the final arbitrator 
+at all.
+
+Available at:
+
+http://comnet.technion.ac.il/~cn1w02/download/IP-Noise-Engine-perl-0.1.5.tar.gz
+
+The design includes three threads, one of which is the arbitrator's. For the
+final design we plan to have two more arbitrator specific threads:
+
+One to modify the current state of all the Markovian chains, and the second
+to listen for requests of incremental changes from the user, and execute them.
+
+Documents:
+----------
+
+We have several documents available:
+
+1. A "Dokh Ifyun" of the project. Not too much of interest here, but 
+we had to write it in order to get a workstation:
+
+http://comnet.technion.ac.il/~cn1w02/docs/ip_noise.spec.zip
+
+2. A not-entirely-complete description of the Syntax that the user will work
+with the packet arbitrator:
+
+http://comnet.technion.ac.il/~cn1w02/docs/Syntax_Description.txt
+
+3. A description of the Architecture of the IP-Noise Engine Framework (the perl
+one):
+
+http://comnet.technion.ac.il/~cn1w02/docs/Architecture.txt
+
+4. A description of the proposed Arbitrator's Architecture:
+
+http://comnet.technion.ac.il/~cn1w02/docs/Arbitrator_Architecutre.txt
+
+5. A description of the protocol that the compiler will use to talk 
+to the arbitrator:
+
+http://comnet.technion.ac.il/~cn1w02/docs/Protocol.txt
+
+---
+
+All of the documents are text files except for the "Dokh Ifyun" which
+is written in Hebrew MS-Word, but is also available as PostScript. Note, that
+the contents of all the documents are not final and subject to change as we
+progress in the project.
+
+
+Web-site:
+---------
+
+The web-site is working and functional, but does not look very attractive. 
+We have recently started experimenting with a tool called "Web Meta Language" 
+that enables to easily generate complex HTML code. With it, we may be able 
+to maintain a better site.
+
+The BerliOS site at the moment just links to this site, not mirrors it, which
+is another problem which I believe can be easily resolved with WML.
+
+Road-Map:
+=========
+
+Our plan for now is this:
+
+Writing a compiler:
+-------------------
+
+1. Write a compiler (in perl) to compile the syntax of the noise definition
+language to commands of the protocol that is understood by the arbitrator.
+
+We plan to keep the compiler written in Perl up till the end of the
+project because:
+
+1. Parsing, Analyzing, etc. is much better done in Perl.
+
+2. We figure that modifying the behaviour of the noise simulator is not
+a real-time task, so nothing bad will happen if it is written in Perl.
+
+3. We can always convert it to C later, if such a need arises.
+
+
+Writing an Arbitrator in Perl:
+------------------------------
+
+Roy and I decided that we are going to write the first working version of 
+the Arbitrator as Perl code. We realize that we cannot expect to process
+heavy loads of packets in real-time this way. However, that way we will be
+able to write the code quickly without having to meddle with C's
+idiosyncrecies, and we would have a good idea of a proper architecture for
+the C code.
+
+The Arbitrator would be integrated into the existing perl code, to yield
+a fully functional (albiet very slow) noise simulator written in Perl.
+
+Convert the Arbitrator and Engine to C:
+---------------------------------------
+
+Naturally, we are not going to keep everything in Perl, so the next logical
+step would be to convert them to C. We would probably stick to ANSI C so
+the code would compile faster. (g++ is quite slow)
+
+We have to make sure not to rely too much on the stanard C library, or else
+the code will not be very ready for the kernel. (see the next section) Thus,
+it is proposed that we will use wrappers for such functions wherever possible,
+and possibly write our own for the kernel.
+
+Adapt the C code to run in kernel-mode:
+---------------------------------------
+
+After we have a fully functional noise simulator written in C running in
+user-land, we plan to port the code to be a set of kernel modules. Omer
+Mussaev said in a mail message that user-level code that relies on IP-Queue, 
+can only handle loads of up to 30 Mbps. Thus, converting the code to run 
+in the kernel may be inevitable if we want to have a good performance.
+
+We're still don't know exactly what mechanisms are available for us in the
+kernel as we didn't work in kernel mode too much. For instance, we may have
+to rip the code of GNU libc in order to extract a portable code that can 
+calculate the ln() function for us. This is just a simple example that working
+at the kernel is much more difficult than doing everything in user-land.
+
+

File site/Old/site/wml/download/IP-Noise-Engine-perl-0.1.0.tar.gz

Binary file added.

File site/Old/site/wml/download/IP-Noise-Engine-perl-0.1.1.tar.gz

Binary file added.

File site/Old/site/wml/download/IP-Noise-Engine-perl-0.1.2.tar.gz

Binary file added.

File site/Old/site/wml/download/IP-Noise-Engine-perl-0.1.4.tar.gz

Binary file added.

File site/Old/site/wml/download/IP-Noise-Engine-perl-0.1.5.tar.gz

Binary file added.

File site/Old/site/wml/download/IP-Noise-perl-filters-0.1.0.tar.gz

Binary file added.

File site/Old/site/wml/download/index.html

+<html>
+<head>
+<title>IP-Noise Project Downloads</title>
+</head>
+<body bgcolor="#FFFFFF">
+
+<h1>Downloads</h1>
+
+<p>
+<a href="IP-Noise-perl-filters-0.1.0.tar.gz">
+IP-Noise-perl-filters-0.1.0.tar.gz
+</a> - some proof-of-concept programs written in perl (;-)).
+</p>
+
+<p>
+<a href="IP-Noise-Engine-perl-0.1.5.tar.gz">
+IP-Noise-Engine-perl-0.1.5.tar.gz
+</a> - 
+a more sophisticated perl API that enables accepting, dropping and 
+delaying packets for arbitrary delays. It comes with a simple, stateless
+, rule-based arbitrator, but alternative ones may be written.
+</p>
+
+
+</body>
+</html>

File site/Old/site/wml/download/index.html.wml

+#!wml
+#include 'template.wml'
+<subject "IP-Noise Project Downloads">
+<p>
+<a href="IP-Noise-perl-filters-0.1.0.tar.gz">
+IP-Noise-perl-filters-0.1.0.tar.gz
+</a> - some proof-of-concept programs written in perl (;-)).
+</p>
+
+<p>
+<a href="IP-Noise-Engine-perl-0.1.5.tar.gz">
+IP-Noise-Engine-perl-0.1.5.tar.gz
+</a> - 
+a more sophisticated perl API that enables accepting, dropping and 
+delaying packets for arbitrary delays. It comes with a simple, stateless
+, rule-based arbitrator, but alternative ones may be written.
+</p>

File site/Old/site/wml/index.html.wml

+#!wml
+#include 'template.wml'
+<subject "Com-Net Lab Project : IP Noise Simulator for the Linux Kernel">
+
+<p>
+This page describes the 
+<a href="http://comnet.technion.ac.il/">Computer Networks Lab</a>'s
+project of creating a simulator of IP noise for the Linux kernel. This site
+will be filled with more material as we progress into the project.
+</p>
+
+<h2>Project Takers</h2>
+
+<h3><a href="http://t2.technion.ac.il/~shlomif/">Shlomi Fish</a></h3>
+
+(Please use his Technion E-mail: 
+<a href="mailto:shlomif@vipe.technion.ac.il">
+shlomif@vipe.technion.ac.il
+</a>
+)
+<h3>Roy Glasberg</h3> 
+
+<h2>Project Supervisor</h2>
+
+<h3><a href="http://tiger.technion.ac.il/~libman/">Lavy Libman</a></h3>
+
+<h2>The Project's Purpose</h2>
+
+<p>
+The purpose of the project is to program a noise simulator for TCP/IP
+noise, which will deliberatly drop and hold IP packets that pass through the
+computer. The simulator will support controlled noise, such as a host-based
+noise, or one with a time-varying behaviour. 
+</p>
+
+<p>
+The incensitive for this is to allow researchers and developers to
+test whether their protocols are immune to various types of 
+network noise.
+</p>
+
+<h2><a href="download/">Downloads</a></h2>
+
+<h2><a href="docs/">The Project's Documents</a></h2>
+
+<h2><a href="links.html">Links and References</a></h2>
+
+<h2><a href="mailing-list/">Our Mailing List</a></h2>
+
+<p>
+Includes links to tools and resources, as well as various reference links.
+</p>
+

File site/Old/site/wml/links.html.wml

+#!wml
+#include 'template.wml'
+<subject "IP-Noise Project: Links and Reference Material">
+
+<h2>Tools we can use for the project</h2>
+
+<p>
+<a href="http://user-mode-linux.sourceforge.net/">User-mode Linux</a> - 
+a version of the Linux kernel that runs as a standard Linux process. Thus,
+it can be debugged with gdb, and the system doesn't hang when there's a 
+problem in the kernel code.
+</p>
+
+<p>
+<b>Writing an IP firewalling driver in user-mode</b> - I was told that
+using the Linux' IP Firewalling mechanism it would be possible to write
+the entire noise simulator in user-mode. Of course, we should write the code
+so it can also be compiled as a module. However, running the whole thing
+as user-level will make for an easier debugging.
+</p>
+
+<p>
+<a href="http://oss.sgi.com/projects/kdb/">SGI's kdb</a> - A kernel debugger
+from SGI that enables setting breakpoints, examining contents and debugging
+kernel code. Should prove useful at the times when we have to work in 
+kernel-mode.
+</p>
+
+<p>
+<a href="http://pice.sourceforge.net/">Private ICE</a> - A system-level 
+symbolic source debugger for Linux, not unlike Soft-ICE for Windows. Should
+prove useful too.
+</p>
+
+<p>
+<a href="http://www.vmware.com/">VMWare</a> - An emulator of an i386 that runs
+above Linux. We can use it to test experimental kernels without having to 
+reboot constantly. There's a free alternative in the making called 
+<a href="http://www.plex86.org/">Plex86</a>, but it is still not as complete
+or as usable.
+</p>
+
+<p>
+<a href="http://www.gnu.org/directory/ksymoops.html">ksymoops</a> - In case
+OOPS faults do happen (and the kernel debuggers don't trap them) we can use 
+this tool to diagnose them.
+</p>
+
+<h2>Reference Material</h2>
+
+<p>
+<a href="http://plasma-gate.weizmann.ac.il/Linux/maillists/01/07/msg00363.html">
+Linux-IL's thread on the subject</a>
+</p>
+
+<p>
+<a href="http://www.kernelnewbies.org/documents/ipnetworking/linuxipnetworking.html">
+The Kernel-Newbies IP Networking tutorial</a> - contains a packet filter 
+example.
+</p>
+
+<p>
+<a href="http://www.linuxdoc.org/">The Linux Documentation Project</a> -
+contains some in-depth guides and HOWTOs which may prove useful.
+</p>
+
+<p>
+<a href="http://www.oreilly.com/catalog/linuxdrive2/chapter/book/index.html">
+Linux Device Drivers 2nd edition</a> - this book is available online
+for free, too.
+</p>
+
+<h2>Kernel 2.4 Firewalling</h2>
+
+<p>
+<a href="http://netfilter.samba.org/">The Netfilter/IP-Tables Homepage</a> 
+- contains the most up-to-date iptables package as well as many documents
+and stuff for hacking it.
+</p>
+
+<p>
+<a href="http://www.intercode.com.au/jmorris/perlipq/">Perl-IPQ</a> -
+perl bindings for the user-space IP filtering. Good for experiencing.
+</p>
+
+<p>
+<a href="http://netfilter.samba.org/unreliable-guides/packet-filtering-HOWTO/packet-filtering-HOWTO.linuxdoc-7.html">
+Filtering Packets in user-space using the QUEUE directive</a>
+</p>
+

File site/Old/site/wml/mailing-list/index.html.wml

+#!wml
+#include 'template.wml'
+
+<subject "Mailing-List Information">
+
+<h2>Subscribing</h2>
+
+<p>
+To subscribe to the mailing-list send an empty message
+to <a href="mailto:ip-noise-subscribe@iglu.org.il">ip-noise-subscribe@iglu.org.il</a>.
+</p>
+
+<h2>Unsubscribing</h2>
+
+<p>
+To unsubscribe to the mailing-list send an empty message
+to <a href="mailto:ip-noise-unsubscribe@iglu.org.il">ip-noise-unsubscribe@iglu.org.il</a>.
+</p>
+
+<h2>Sending E-mail to the list</h2>
+
+<p>
+Send your messages to 
+<a href="mailto:ip-noise@iglu.org.il">ip-noise@iglu.org.il</a>.
+</p>
+
+<h2>Online Messages' Archive</h2>
+
+<a href="http://www.mail-archive.com/ip-noise@iglu.org.il/">
+http://www.mail-archive.com/ip-noise@iglu.org.il/
+</a>

File site/Old/site/wml/style.css

+body { background-color : "white" }
+

File site/Old/site/wml/template.wml

+<html>
+<head>
+<title>{#SUBJECT_LOC#}</title>
+<link rel="StyleSheet" href="$(ROOT)/style.css" type="text/css">
+</head>
+<body>
+
+<h1>{#SUBJECT_LOC#}</h1>
+{#BODY#}
+
+</body>
+</html>
+
+<define-tag subject>
+{#SUBJECT_LOC#:%0:##}
+</define-tag>
+
+#   per default we are in body
+{#BODY#:
+

File site/site/wml/.wmlrc

--D ROOT~.

File site/site/wml/Makefile

-
-D = ./dest
-
-IMAGES = $(D)/style.css                                       \
-         $(D)/docs/Arbitrator_Architecture.txt                \
-         $(D)/docs/Architecture.txt                           \
-         $(D)/docs/ip_noise.spec.zip                          \
-         $(D)/docs/Protocol.txt                               \
-         $(D)/docs/Syntax_Description.txt                     \
-         $(D)/docs/roadmaps/2001-08-22.txt                    \
-         $(D)/download/IP-Noise-Engine-perl-0.1.0.tar.gz      \
-         $(D)/download/IP-Noise-Engine-perl-0.1.1.tar.gz      \
-         $(D)/download/IP-Noise-Engine-perl-0.1.2.tar.gz      \
-         $(D)/download/IP-Noise-Engine-perl-0.1.4.tar.gz      \
-         $(D)/download/IP-Noise-Engine-perl-0.1.5.tar.gz      \
-         $(D)/download/IP-Noise-perl-filters-0.1.0.tar.gz     \
-         
-
-
-SUBDIRS = $(D)/download $(D)/docs $(D)/docs/roadmaps $(D)/mailing-list
-
-HTMLS = $(D)/index.html $(D)/download/index.html $(D)/links.html \
-	$(D)/docs/index.html $(D)/mailing-list/index.html
-
-all : $(SUBDIRS) $(HTMLS) $(IMAGES)
-
-$(SUBDIRS) :: % : 
-	@if [ ! -e $@ ] ; then \
-		mkdir $@ ; \
-	fi
-	
-
-$(HTMLS) :: $(D)/% : %.wml .wmlrc
-	wml $< > $@
-
-$(IMAGES) :: $(D)/% : %
-	cp -f $< $@

File site/site/wml/docs/Arbitrator_Architecture.txt

-The Arbitrator is going to have two threads:
-
-1. The Arbitrating Thread - this thread accepts packets from the
-Packets Queue, decides what to with them according to the Markovian chains
-and if it is to be delayed, it puts it in the priority queue of the release 
-thread (which is not part of the arbitrator and is described in 
-Architecure.txt.
-
-2. The Chains States Maintainance thread - this thread updates the
-active states of the Markovian chains by using a priority queue.
-
-It is possible that there will be several arbitrating threads, all of which
-are symetrical. Each one will decide what to do with a single packet before
-opting to receive others of its kind.
-
-The chains states maintainance thread is quite trivial to write. Therefore,
-most of this document will focus on the Arbitrating Thread.
-
-Chain Filter Structure:
------------------------
-
-A chain filter structure will look as follows:
-
-struct chain_filter
-{
-    ip_specification * source;
-    ip_specification * dest;
-    protocols_bit_mask protocols; /* A bit mask specifiying which protocols to filter */
-    /* We treat the TOS bits as one big 6-bit integer 
-    int min_tos;
-    int max_tos;
-    int which_tos;        /* 
-                             Can be - 0 - don't care.
-                             1 - Greater than min 
-                             2 - Lower than max
-                             3 - Between min and max
-                             4 - Not between min and max.
-                          */
-    int min_packet_len;
-    int max_packet_len;
-    int which_packet_len; /* 
-                             Can be - 0 - don't care.
-                             1 - Greater than min 
-                             2 - Lower than max
-                             3 - Between min and max
-                             4 - Not between min and max.
-                          */
-}
-
-typedef char protocols_bit_mask[32];
-
--> A complete bitmask of all available IP-based protocol. One bit
-for every protocol.
-
-And the ip_specification struct is defined as follows:
-
-struct ip_specification
-{
-    ip_specification * next; /* = NULL to terminate the linked list. */
-
-    bit inverse; /* Inverse the condition */
-    in_addr ip;
-    int net_mask; /* The sub-net width of the IP range */
-    int num_port_ranges; /* If = 0 then any port will do. */
-    /* A sorted array of port ranges. We do a binary (or linear) search to see
-       if the port of the packet matches them. */
-    port_range_struct * port_ranges; 
-}
-
-State Syntax:
--------------
-
-struct state_struct
-{
-    probability_type drop_prob;
-    probability_type delay_prob;
-    delay_type * delay_function;
-    int time_factor;
-    int num_move_tos;
-    move_to_type * move_tos;
-    probability_type stable_delay_prob;
-}
-
-struct move_to_type
-{
-    probabilty_type comulative_prob;
-    int which_state; /* Determines the state to go to */
-}
-
-Move to is a sorted array. We search it for the apropriate probability
-in the range (0,1) and from that we determine the state to go to next.
-
-Chain Syntax:
--------------
-
-struct chain_struct
-{
-    int num_states;
-    state_type * states;
-
-    int current_state;
-    chain_filter_type * filter;
-
-    time_t time_of_last_packet;
-
-    Dictionary <String -> Int> state_names;
-}
-
-Arbitrator Data Structure Syntax:
----------------------------------
-
-struct arbitrator_struct
-{
-    int num_chains;
-    chain_type * chains;
-
-    read_write_lock_t lock;
-
-    priority_queue<change_state_event_type> change_states_pq;
-
-#if there is more than one arbitrator threads:
-    mutex protect_num_active_threads;
-    int num_active_threads;
-    bool terminate_threads;
-#endif
-
-    Dictionary <sting -> int> chain_names;
-}
-
-struct change_state_event_struct
-{
-    int chain;
-    time_t invalidation_time;
-}
-
-
-The Delay Function Type:
-------------------------
-
-struct delay_function_struct
-{
-    int type;
-                 
-    union params
-    {
-        double lambda;
-        struct split_linear_function_struct
-        {
-            int num_points;
-            struct prob_and_delay 
-            {
-                probability_t prob;
-                double delay;
-            } * points;
-        };
-    };
-}

File site/site/wml/docs/Architecture.txt

-Msg:
-----
-
-The class Msg is an implementation of a "Heap" element that contains
-the actual IP packet as well as the time (in seconds and microseconds)
-of its arrival. 
-
-There's nothing too interesting there, and the functions are very short
-and trivial. For more information consult the Heap::Elem man page.
-
-Delayer:
---------
-
-Delayer is a class that handles delaying packets with the possibility
-of different delay lengths and different arrival times. It accepts 
-the packets as is and does not decide how much to delay them itself.
-Moreover, it does not use the IP-Queue interface directly and rather
-uses a callback to release the packets after their delay.
-
-This module has two methods:
-
-delay_packet() - this method accepts a packet, its arrival time
-and the amount of time, in quanta of 1 millisecond, to delay it, 
-and register this packet to be released only at this amount of time 
-at the future.
-
-release_packets_poll_function() - this method should be called periodically
-in order to release those packets whose time has come to be released.
-
-The class uses a priority queue to organize the packets and their release
-times. release_packets_poll_function() constantly peaks the minimal item of 
-the PQ to determine whether its release time has already come. If so, 
-it extracts it out of there.
-
-Packet::Logic:
---------------
-
-Perhaps should have been named "Packet::Arbitrator" or "Packet::Decide".
-This class determines what to do with a packet. It has one method -
-decide_what_to_do_with_packet() which returns the outcome of the packet.
-This way, a state can be implemented inside the object.
-
-The function should return a reference to a hash that contains the following 
-fields:
-
-'action' - can be of value "accept", "delay", or "drop".
-'delay_len' => applicable only if 'action' is "delay". This is the delay
-in quanta.
-
-At the moment this function implements a simple state-less rule-based noise
-, where the rules are not unlike the IP firewalling rules of the kernel. A
-better description of the format of the rules should be written at a
-certain stage, but is not available now.
-
-main.pl:
---------
-
-This is a script that use Delayer, Packet::Logic and the IP-Queue interface. 
-However, it can be easily encapsulated in its own class by an experienced
-perl coder.
-
-The script performs a loop in which it:
-1. Gets the next message from the IP-Queue.
-2. Calls release_packets_poll_function to release the appropriately delayed 
-   packets.
-3. Call decide_what_to_do_with_packet() to get its verdict.
-4. Accepts, drops, or queues the packet for delay based on its verdict.
-5. Return to Step #1.
-
-Note that this script relies on a fact that packets constantly arrive 
-at the IP Queue for verification. If not it may get stuck, while some
-packets that need to be released after a significant delay will not be
-released. 
-
-This can be easily solved by putting step #2 on its own thread, but it has
-not been done yet. (Some versions of the perl interpreter do not support 
-multi-threading).
-
-main_mt.pl:
------------
-
-This script is similar to main.pl only that it initiates three threads, each
-of which is responsbile for doing one operation:
-
-1. The main thread gets a message from the IP-Queue, stamps it with its
-arrival time and places it inside a (thread-safe) queue.
-
-2. The arbitrator thread gets a message from that queue, and determines what
-to do with it. If it should be dropped or released it does so. If it is to 
-be delayed it invokes the delayer to delay it.
-
-3. The delayed packets' release thread performs an infinite loop in which
-it calls the delayer's release_packets_poll_function() method.
-
-By using this scheme, one can ensure that the delayed packets will be released
-on time, even if the traffic is inconsistent.
-
-    Notes:
-    1. This file requires the perl interpereter to be compiled with 
-       multi-threading support.
-    2. This file contains some duplicate code with main.pl. I'd like to wrap
-       their functionality in a nice object, which can be used by both 
-       the non-threaded script and the threaded script.
-
-

File site/site/wml/docs/Protocol.txt

-
-State - If 0 is transmitted - <int32> - index
-        If 1 is transmitted - <string> - its name
-        <string> is string_len+1 bytes that terminate with a NULL character.
-        string_len should be 127 bytes or so.
-
-Chain - If 0 is transmitted - <int32> - index
-        If 1 - <string> - its name
-
-Return Values - 0 - OK
-                1 - Wrong Input
-                
-Packet Range - start=<int16> end=<int16> 
-               If start > end then it's a terminator.
-
-Packet Ranges Specifier - <Packet Range> <Packet Range> .... <Terminator>
-
-IP Component - ip=<int32> 
-               netmask_width=<int32> 
-               inverse=<bool> 
-               <Packet Ranges Specifier>
-
-IP Component Terminator - ip=255.255.255.255 but there is still a netmask
-and a packet range specifier for parity.
-
-IP Filter - <IP Component> <IP Component> <IP Component> <Terminator>
-
-Split Linear Specifier Token : 
-    prob=<Probability Type>
-    delay=<Delay Type>
-
-    terminator (last element) is when prob=1.
-
-Split Linear Specifier:
-    <Split Linear Token> <Split Linear Token> ... <Terminator>
-
-Delay Type - any of:
-    1. Exponential   0x0
-    2. Split Linear  0x1
-    
-
-Protocol Operations:
-
-
-* Define a new chain.
-
-    Input: <0x0000> chain_name=<string>
-    Output : <RetValue> chain_number=<int32>
-
-    Note: even if RetValue indicates failure we still broadcast the
-    chain number, which should be ignored by the front-end.
-
-* Define a new state in a chain.
-
-    Input: <0x0001> chain=<Chain> state_name=<State>
-    Output : <RetValue> state_number=<int32>
-
-* Define the move probabilities between states @source to states @dest.
-(by using a matrix of inputs) inside a chain.
-
-    Input: <0x0002> 
-           chain=<Chain> 
-           scalar(@source)=<int32> 
-           scalar(@dest)=<int32> 
-           $source[0]=<State>
-           $source[1]=<State>
-           .
-           .
-           $dest[0]=<State>
-           $dest[1]=<State>
-           $dest[2]=<State>
-           probs($s -> $d)=<Probability Type> (scalar(@source)*scalar(@dest) of them)
-
-    Return: <RetValue>
-
-* Chain Filters:
-    - Set source to something.
-        Input: <0x0003>
-               chain=<Chain>
-               filter=<IP Packet Filter>
-        Output:
-            <RetValue>
-            
-    
-    
-    - Set dest to something
-        Input: <0x0004>
-               chain=<Chain>
-               filter=<IP Packet Filter>
-        Output:
-            <RetValue>
-        
-    - Enable/Disable Protocol X.
-        Input: <0x0005>
-              chain=<Chain>
-              protocol_id=<int32>
-                - If = 256 then all protocols should be enabled or disabled.
-              enable_or_disable=<bool>
-        Output:
-            <RetValue>
-        
-    - Set TOS Precedence Bits
-        Input: <0x0006>
-               chain=<Chain>
-               Precedence = <int16>
-        Output:
-            <RetValue>
-            
-    - Set TOS bits mask
-        Input: <0x0007>
-            chain=<Chain>
-            tos_bits_mask=<int16>
-        Output:
-            <RetValue>
-
-    - Set Min. packet length
-        Input: <0x0008>
-               chain=<Chain>
-               Min_Packet_Length=<int16>
-        Output:
-            <RetValue>
-            
-    - Set Max. packet length
-        Input: <0x0009>
-               chain=<Chain>
-               Max_Packet_Length=<int16>
-        Output:
-            <RetValue>
-
-    - Set Which packet length
-        Input: <0x000a>
-               chain=<Chain>
-               Which_Packet-Length=<int16>
-        Output:
-            <RetValue>
-                             Can be - 0 - don't care.
-                             1 - Greater than min 
-                             2 - Lower than max
-                             3 - Between min and max
-                             4 - Not between min and max.
-
-* Retrieve the index of the chain (by name).
-        Input: <0x000b>
-            chain=<Chain>
-            
-        Output:
-            <RetValue> 
-            chain#=<int32>
-
-* Retrieve the index of a state within a chain (by name).
-        Input: <0x000c>
-            chain=<Chain>
-        Output:
-            <RetValue> 
-            state_index=<int32>
-
-* Retrieve the move probabilities between @source and @dest.
-        Input: <0x000d>
-               chain=<Chain>
-               scalar(@source)=<int32> 
-               scalar(@dest)=<int32> 
-               $source[0]=<State>
-               $source[1]=<State>
-               .
-               .
-               $dest[0]=<State>
-               $dest[1]=<State>
-               $dest[2]=<State>
-        Output:
-               <RetValue>
-               prob[$s][$d]=<Probability Type> for each source and dest.
-
-* Set the drop/delay prob of a state.
-        Input: <0x000e>
-               chain=<Chain>
-               state=<State>
-               drop_prob=<Probability Type>
-               delay_prob=<Probability Type>
-        Output:
-            <RetValue>
-
-* Set the delay function type of a state.
-        Input: <0x000f>
-               chain=<Chain>
-               state=<State>
-               delay_type=<Delay Type>
-        Output:
-            <RetValue>
-
-* Set the split-linear delay function of a state.
-        Input: <0x0010>
-               chain=<Chain>
-               state=<State>
-               split_linear=<Split Linear Spec>
-        Output:
-            <RetValue>
-               
-
-* Set the delay function's lambda. (in case it is Exponential).
-        Input: <0x0011>
-               chain=<Chain>
-               state=<State>
-               lambda=<lambda_type>
-        Output:
-            <RetValue>
-
-* Set the time factor of a state.
-        Input: <0x00013>
-               chain=<Chain>
-               state=<State>
-               time_factor=<Delay Type>
-        Output:
-            <RetValue>
-               
-
-* Set the stable delay probability of a state. (we mean that packets are sent
-in the order in which they were received).
-        Input: <0x0014>
-               chain=<Chain>
-               state=<State>
-               prob=<Probability Type>
-        Output:
-            <RetValue>
-               
-
-* Delete a state from a chain.
-        Input: <0x0015>
-               chain=<Chain>
-               state=<State>
-        Output:
-            <RetValue>
-
-
-* Delete an entire chain.
-        Input: <0x0016>
-               chain=<Chain>
-        Output:
-               <RetValue>
-
-* Set a chain's current state.
-        Input: <0x0017>
-               chain=<Chain>
-               state=<State>
-        Output:
-               <RetValue>
-
-* Dump all the information of all the chains.
-        Input: <0x0018>
-        Output: 
-            <RetValue>
-            num_chains=<int32>
-            @chains=@<Output_Chain> where 
-                Output_Chain=
-                    name=<string>
-                    current_state=<int32>
-                    time_of_last_packet=<Time Type> where
-                        Time Type=
-                            sec=<int32>
-                            usec=<int32>
-                    filter_protocols=<Bitmask of 32 bytes>
-                    filter_tos_precedence=<int16>
-                    filter_tos_bits=<int16>
-                    filter_min_packet_len=<int16>
-                    filter_max_packet_len=<int16>
-                    filter_which_packet_len=<int16>
-                    filter_source_ip_spec=<IP Specification>
-                    filter_dest_ip_spec=<IP Specification>
-                    states_num=<int32>
-                    @states=@<Output_State> where
-                        Output_State=
-                            drop_prob=<Probability Type>
-                            delay_prob=<Probability Type>
-                            delay_type=<Delay Function Type>
-                            delay_type_param= Depends on delay_type:
-                                If Exponential=
-                                    lambda=<lambda_type>
-                                If Split-linear=
-                                    split_linear_spec=<Split Linear Spec>
-                            time_factor=<Delay Type>
-                            stable_delay_prob=<Probability Type>
-                           
-

File site/site/wml/docs/Syntax_Description.txt

-Internals:
-----------
-
-There are going to be several Markovian chains, each one with its
-own rules that decide which packets to pass to it. It is possible 
-that a packet would be processed in more than one chain. In this
-case:
-
-1. If one of those chains decided to drop it - the packet would be dropped.
-2. Else, the packet would be delayed for a sum of the delays of the chains.
-
-Each chain will store the time of the last packet that was sent. There is 
-a probability constant in each of its states that determines if the delay 
-is relative to the time of the last packet, or an absolute delay. 
-
-Each one of a chain's states contains the probabilities of the releasing,
-dropping or delaying a packet, as well as the delay function (refer to "Delay
-Functions"). It also contains the probabilities of passing to the other states.
-
-There will always be one special chain called the default chain, which
-determines what to do with packets that did not fit into any other chain, 
-assuming that they indeed did not. If such a chain was not defined by the
-user, it will be initialized to always pass a packet.
-
-Chain Filters:
---------------
-
-A chain filter may refer to the following specifications:
-
-Source IP Address: a list of subnets, each specified in a similar way
-to that of the Linux fire-walling rules. Each IP or subnet is accompanied
-with a specification of the input port (if appropriate to the protocol).
-
-Examples:
-
-{ 129.28.5.0/24:80,8080-8090 ; 132.68.0.0/16:20-21 }
-
-; - separates IP/Masks/Ports constructs
-, - separate ports
-/ - separate the number of 1's in the net-mask from the IP address.
-
-Destination IP Address: Same syntax as the source IP Address.
-
-Protocol : can be a list of any of TCP, udp, icmp or any other of
-the /etc/protocols protocols, or an inversion of such list.
-
-Type of Service:
-
-    Is split into several specifications:
-    Precedence: can be any of the 3-bit octets.
-    Delay            \
-    Throughput       |- Each a one-bit flag.
-    Relay-ability     /
-
-    Each one of those fields may be safely specified to be ignored.
-
-Packet Length:
-
-    Can be "l>5000", "l<3000", "200<l<600".
-
-Whole Chains Syntax:
---------------------
-
-State "A" {
-   drop = 0.2
-   delay = 0.1
-   delay_type = [!--- A Delay Function ---]
-   time_factor = 500 # This is the time factor to move to the other state
-   move_to = {
-        0.2 = B
-        0.3 = C
-        0.5 = E
-   }    
-}
-