RIPsimulate

To test your RIP code, and especially to create RIP transmissions that will excercise your RIPprovider, I have created three special programs.

The programs

The program RIPgather captures real RIP output from a live system which uses RIP. Since this must listen at the privileged RIP port 520, it can only be used by root.

It saves the output in a special RIPsession format, which also encapsulates the source and timing of the data.

The program RIPscatter takes a RIPsession file, and sends it to a host and port of your choosing.

The program RIPcreator takes a text file in a special format, and creates a RIPsession file, which can then be input to RIPscatter.

The formats of the special files are as follows:

RIP session file
A series of records consisting of:
RIP session text file
A series of text lines consisting of: A sample session.txt file is:

T 18143
S 134.48.4.192 5555
R 134.48.4.192 255.255.254.0 0.0.0.0 7
R 134.48.4.100 255.255.255.0 0.0.0.0 1
R 134.48.4.124 255.255.254.0 0.0.0.0 5
T 18567
S 134.48.4.192 5555
R 134.48.4.129 255.255.254.0 134.48.4.100 3
R 134.48.4.192 255.255.254.0 0.0.0.0 7
T 0

Using these programs

  1. Write a scatter.txt file with some sample packets to test your code.
  2. Run the RIPcreator program to make a scatter file.
    
    java RIPcreator scatter.txt scatter
    
  3. Choose a source machine and port, and a destination machine and port (which could be running RIPgather or your listener code).
  4. Run the RIPscatter program from your scatter file.
    
    java RIPscatter srcHost srcPort dstHost dstPort scatter
    
    That is, if you run on studsys and send to netlab-a,
    
    java RIPscatter studsys 5555 netlab-a 6666 scatter
    
    while at the same time perhaps running on netlab-a:
    
    java RIPgather netlab-a 6666 scatter.new
    

    The scatter.new file collected on netlab-a should be identical to the scatter file from which it was derived, except that possibly the sending host name and port has changed.

    Of course what you really want is to run your own listener, rather than RIPgather! That was the point of creating these programs.

    I suggest you create scatter.txt files that show systems becoming uncreachable, metrics increasing or decreasing, and so on.

    You can leave your listener running, create a new file to test it, and run RIPcreate/RIPscatter on that file.

    Please realize that you can have RIPListen and RIPscatter use the "limited-broadcast" address 255.255.255.255, as long as you run them on different machines.

    This would look like:

    
    on netlab-a: java RIPscatter localhost 4321 255.255.255.255 6666 someFile
    on netlab-b: java RIPgather  255.255.255.255 6666 someOtherFile
    
    and when done you will expect someFile and someOtherFile to be the same.

    If you notice that broadcasting on netlab-a, say, does not reach studsys, you might stop and contemplate what the phrase "limited broadcast address" means.

    There are some saved sesssion files already here: you can retrieve them into your own directory (they are binary, so you have to save them appropriately). Their lengths are shown preceding the name. The first one is the text file that created the second one: note that

    The others were obtained from gather, and the name shoud give you an idea of how they were saved.

    
    260     session.txt
    
        The remainder of these files are binary:
       download them  by right-clicking and saving.
    
    140     session
    2280    session.255.255.255.255.520
    7600    session.netlab-a.6666
    41800   session.speckle.520
    1600    session.studsys
    


Prepared by     doug@mscs.mu.edu Douglas Harris
Created October 25, 1998