Blocking N consecutive packets with netgraph

Julian Elischer julian at elischer.org
Wed May 24 19:34:11 PDT 2006


benjamin at cactus.org wrote:

>I need to test a multicast streaming media application by selectively
>dropping packets in the network connecting the source to the viewer.
>
>The capability I need is to drop N consecutive packets, where N ranges
>from 1 to 50 and is chosen via the command line.
>
>I had hoped to do this with dummynet and ipfw, but apparently I can
>only drop packets with a specified probablity.  The network topology
>for this method was to bridge two ethernet nics, then use dummynet pipes
>to vary the bandwith and packet loss rate.
>
>I also tested a method using ipfw to temporarily enable packet block
>rules using a short sleep interval, but there was only very coarse
>control of the number of packets blocked.
>
>Is it feasible to do this with netgraph?  Please outline how this may
>be accomplihsed.
>  
>

Certainly it is as long as you are happy to write your own node.
Now, don't be scared.. nodes are relatively simple to write.

They can be loaded dynamically once written.
check out all the nodes available at:
http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/netgraph/
 you can start easily with the "sample" node.

change its name and compile it by adding a directory in the 
/sys/modules.netgraph directory,
copying the Makefile from another one and modifying it accordingly.
 
start hacking..

documantation is in:
  
http://www.freebsd.org/cgi/man.cgi?query=netgraph&apropos=0&sektion=4&manpath=FreeBSD+7.0-current&format=html

and all the other man pages for netgraph modules,


>TIA
>
>Tom Benjamin
>_______________________________________________
>freebsd-net at freebsd.org mailing list
>http://lists.freebsd.org/mailman/listinfo/freebsd-net
>To unsubscribe, send any mail to "freebsd-net-unsubscribe at freebsd.org"
>  
>


More information about the freebsd-net mailing list