1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
/*
* tbf - Single TBF shaper
*/
#define MTU 1508B
#define RATE 1Mbps
#define BURST 3kB
#define LIMIT 20kB
#define PACKET /* 100-sizeof(iphdr) = 80 bytes. */ \
IP_PCK($ip_src=10.0.0.1 $ip_dst=10.0.0.2) \
0 x 80
dev eth0 10000 { /* 10 Mbps */
tbf (mtu MTU,limit LIMIT,rate RATE,burst BURST);
}
every 0.0005s send PACKET /* 1.6 Mbps */
; Excess: 600 kbps, so we will fill the burst after 24ms, and start
; losing packets 267ms later. We should lose about 532 packets (of
; 2001) or 53200 bytes. Actual numbers vary slightly due to 1024 vs.
; 1000 issues.
time 1s
end
|