How could i add some delay netween IP packages

How could i add some delay netween IP packages

Post by pe.. » Sun, 21 May 2000 04:00:00

Quote:> Hi
> I am trying to se the result of delay in a small network. I have therefore
> made two client-server program to send data from client to the server. One
> of them using TCP socket and the other using UDP socket (In Unix platform ).
> I want to ask
>     -How could I add some delay in between each IP package going to the
> server ?
> Hope some body could help.

Another solution would be to introduce a device between two networks that
actually delays packets with adjustable (and possibly randomized) values.

One such tool is available in FreeBSD, it's called DUMMYNET.

Manpage first line follows :
DUMMYNET(4)            FreeBSD Kernel Interfaces Manual            DUMMYNET(4)

     dummynet - Flexible bandwidth manager and delay emulator

     #include <sys/types.h>
     #include <sys/queue.h>
     #include <netinet/in.h>
     #include <netinet/ip_fw.h>

     setsockopt(raw_socket, IPPROTO_IP, ipfw option, struct ipfw, size)

     dummynet is a system facility that permits the control of traffic going
     through the various network interfaces, by applying bandwidth and queue
     size limitations, and simulating delays and losses.

     In its current implementation, packet selection is done with the ipfw
     program, by means of ``pipe'' rules.  A dummynet pipe is characterized by
     a bandwidth, delay, queue size, and loss rate, which can be configured
     with the ipfw program. Pipes are numbered from 1 to 65534, and packets
     can be passed through multiple pipes depending on the ipfw configuration.

     Dummynet operates at the ip level, but if bridging extensions are en-
     abled, it is possible to pass bridged packets through pipes as well.

Quote:> Thanks  Loui

Peter H?kanson        
        Manet Networking      (At the Riverside of Gothenburg, home of Volvo)
           Sorry about my e-mail address, but i'm trying to keep spam out.