Slow down Buck. I am tring to surf here.

17 05 2008

I want it all just like everyone else.. But you know what.. My DSL speed sucks. So how about an application that allows you to pick which TCP stream you want to rate limit. When I tunes updates my Podcasts I just want to slow it down so it doesn’t use all my bandwidth. Anyone know of OS X supporting any type of Rate Limiting like Linux does? So It looks like ipfw is the way to go. So a interface for ipfw to rate-limit tcp streams in realtime.

tcpdump output 192.168.28.224 is me.

IP 82.201.126.114.http > 192.168.28.224.50717: . 118464:119904(1440) ack 1 win 65357
IP 192.168.28.224.50717 > 82.201.126.114.http: . ack 119904 win 65535
IP 82.201.126.114.http > 192.168.28.224.50717: . 119904:121344(1440) ack 1 win 65357

Let’s go for 800K

myitsucks-less:~ joes$ sudo ipfw pipe 1 config bw 800Kbit
myitsucks-less:~ joes$ sudo ipfw add 300 pipe 1 tcp from 82.201.126.114 to 192.168.28.224
00300 pipe 1 tcp from 82.201.126.114 to 192.168.28.224
myitsucks-less:~ joes$ sudo ipfw show
00300 547 807676 pipe 1 tcp from 82.201.126.114 to 192.168.28.224
02000 22407 2261526 allow ip from any to any via lo*
02010 0 0 deny ip from 127.0.0.0/8 to any in
02020 0 0 deny ip from any to 127.0.0.0/8 in
02030 0 0 deny ip from 224.0.0.0/3 to any in
02040 0 0 deny tcp from any to 224.0.0.0/3 in
02050 126189 10071091 allow tcp from any to any out
02060 162883 224330620 allow tcp from any to any established
02065 0 0 allow tcp from any to any frag
02070 0 0 allow tcp from any to any dst-port 22 in
02080 0 0 allow tcp from any to any dst-port 3689 in
02090 0 0 allow tcp from any to any dst-port 80 in
02100 0 0 allow tcp from any to any dst-port 427 in
02110 0 0 allow tcp from any to any dst-port 443 in
02120 0 0 allow tcp from any to any dst-port 5900-5902 in
12190 0 0 deny tcp from any to any
65535 2473 372555 allow ip from any to any

myitsucks-less:~ joes$ sudo ipfw pipe show
00001: 800.000 Kbit/s 0 ms 50 sl. 1 queues (1 buckets) droptail
mask: 0×00 0×00000000/0×0000 -> 0×00000000/0×0000
BKT Prot ___Source IP/port____ ____Dest. IP/port____ Tot_pkt/bytes Pkt/Byte Drp
0 tcp 82.201.126.114/80 192.168.28.224/50511 59657 88081871 24 35456 0

Up it works.

Advertisement

Actions

Information

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s




Follow

Get every new post delivered to your Inbox.