Using Token Bucket Filter to simulate a low bandwidth radio link
Hello,
I am attempting to use the LARTC traffic control to simulate a radio link that has variable bandwidth and availability. The basic bandwidth could be as low as 500 bits/sec but will generally be about 4000 bits/sec. If the simulated radio link is unavailable (zero bandwidth) then packets should be queued until a link is re-established.
i.e. Initial bandwidth is 5000bits/sec
then to 0 bits/sec
and back to 5000bits/sec
However, I am having several different problems
Problem 1:
Setting a very low bandwidth tbf - if the rate is less than my ethernet MTU size then packets appear to just get thrown away
Problem 2:
Preventing packets being sent instantaneously then arrive at the tbf (because sufficient tokens are available in the bucket?) I have tried to set the burst and minburst parameters but packets still appear to be transmitted too soon (e.g. a 5000bit packet should be delayed for 1 second on a 5000bit link)
Problem 3:
Is it possible to stop the flow of data when the simulated link is unavailable
- whilst still keeping a queue of packets
The tc command line I am using is
tc qdisc add dev eth0 root tbf rate 5kbit burst 0.01kbit limit 50kbit peakrate 5kbit minburst 500
and to simulate a temporary link loss I use
tc qdisc change dev eth0 root tbf rate 0.001kbit burst 0.01kbit limit 50kbit peakrate 5kbit minburst 500
Any help would be much appreciated.
Signature · 15 lines
Nick Howden - Senior IT Analyst QinetiQ Trusted Information Management Woodward Building, Room B009 Malvern Technology Park, WR14 3PS Telephone 01684 895566, Fax 896660 The Information contained in this E-Mail and any subsequent correspondence is private and is intended solely for the intended recipient(s). For those other than the recipient any disclosure, copying, distribution, or any action taken or omitted to be taken in reliance on such information is prohibited and may be unlawful _______________________________________________ LARTC mailing list / [email protected] http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Re: [LARTC] Using Token Bucket Filter to simulate a low bandwidth
Quoted 9 lines · Nick Howden
Hello,
I am attempting to use the LARTC traffic control to simulate a radio link that has variable bandwidth and availability. The basic bandwidth could be as low as 500 bits/sec but will generally be about 4000 bits/sec. If the simulated radio link is unavailable (zero bandwidth) then packets should be queued until a link is re-established.
Yeah, I think you are going to find it hard to simulate equivalent latency as well?
I seem to remember a kernel module for slowing down a link for testing? Can't remember the details, but I saw it in my 2.6 kernel somewhere. Perhaps check the docs on that.
For my own custom apps I simulated a satellite link simply by writing a small proxy program for my particular protocol (in perl and again in VB). It queued packets and released them after a set time period at a set rate. If you are only testing a simple app then this is another way to go
Ed W
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Re: [LARTC] Using Token Bucket Filter to simulate a low bandwidth
In reply to Nick HowdenQuoted 3 lines
I seem to remember a kernel module for slowing down a link for testing? Can't remember the details, but I saw it in my 2.6 kernel somewhere. Perhaps check the docs on that.
Yes, it's Stephen's sch_delay. Both 2.4 and 2.6 versions available. Just run the 2.4.26 or 2.6.7 and last version of iproute2.
Then: tc qdisc add dev eth0 root delay limit 100000 latency 3000ms
Quoted 10 lines
For my own custom apps I simulated a satellite link simply by writing a small proxy program for my particular protocol (in perl and again in VB). It queued packets and released them after a set time period at a set rate. If you are only testing a simple app then this is another way to go
Ed W
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
---
Catalin(ux aka Dino) BOIE
catab at deuroconsult.ro
http://kernel.umbrella.ro/
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Re: [LARTC] Using Token Bucket Filter to simulate a low bandwidth radio
In reply to Nick Howden<P><BR></P><P><FONT FACE="Monospace,Courier">!!Hello,<BR></FONT><BR><FONT FACE="Monospace,Courier">!!I am attempting to use the LARTC traffic control to simulate a radio link that<BR>!!has variable bandwidth and availability. The basic bandwidth could be as low<BR>!!as 500 bits/sec but will generally be about 4000 bits/sec. If the simulated<BR>!!radio link is unavailable (zero bandwidth) then packets should be queued<BR>!!until a link is re-established.<BR></FONT><BR><FONT FACE="Monospace,Courier">!!i.e. Initial bandwidth is 5000bits/sec<BR>!!then to 0 bits/sec<BR>!!and back to 5000bits/sec<BR></FONT><BR><FONT FACE="Monospace,Courier">!!However, I am having several different problems<BR></FONT><BR><FONT FACE="Monospace,Courier">!!Problem 1:<BR>!!Setting a very low bandwidth tbf - if the rate is less than my ethernet MTU<BR>!!size then packets appear to just get thrown away<BR></FONT></P><P>Hi ,</P><P>the module for simulating delay is sch_delay .</P><P>tc qdisc add dev eth0 root delay latency 300ms rate 100mbit</P><P>regards,</P><P>U.SivaKumar,</P><P>HCL Infosystems Limited.</P><P> </P><P> </P><P> </P><P></P>_______________________________________________ LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/