network testing: using IPFW to add latency or limit bandwidth

If you need to test an iOS app’s network performance, this technique helps make the simulator perform a little more like it is out on a real mobile network.  This is also helpful testing / simulating any other scenario that may involve slow WAN links, dial up connections, Satellite links, etc.

ipfw to add latency or limit bandwidth:

as root, run:

ipfw add pipe 1 ip from any to any out
ipfw add pipe 2 ip from any to any in
ipfw pipe 1 config delay 150 bw 50kbit/s
ipfw pipe 2 config delay 150 bw 200kbit/s

to reset:

ipfw flush

Advertisements

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 )

Google+ photo

You are commenting using your Google+ 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 )

w

Connecting to %s