Let’s say you want to set up a test network. You have your client, your server, your device under test (in our case, our WarpTCP proxy), and one or two tc boxes.

The tc boxes are just little linux boxes with bridged interfaces set up to forward traffic. Plus we apply tc rules to shape the outgoing traffic.

The question then becomes: “What values should I use?” How do you know what type of network you are simulating?

To answer that question, we went and measured the delay and jitter in various network environments. We took those numbers and came up with the tc commands below.

Remember that tc only applies to outgoing traffic, which is why there are two commands each for WAN and LAN.

The sample commands below are for the Ubuntu version of tc. If you are using CentOS, unfortunately the rate parameter cannot be applied with the netem discipline. Also, don’t forget to adjust your interface names as needed.

Without further ado, here are the different scenarios:

 

Enterprise Wi-Fi

WAN
tc qdisc add dev eth2 root netem delay 5ms 1ms rate 1000000kbit
tc qdisc add dev eth3 root netem delay 5ms 1ms rate 1000000kbit
LAN
tc qdisc add dev eth2 root netem delay 5ms 4ms rate 1000000kbit
tc qdisc add dev eth3 root netem delay 5ms 4ms rate 1000000kbit

 

Enterprise Branch Office

WAN
tc qdisc add dev eth2 root netem delay 20ms 8ms rate 1000000kbit
tc qdisc add dev eth3 root netem delay 20ms 8ms rate 1000000kbit
LAN
tc qdisc add dev eth2 root netem delay 5ms 4ms rate 1000000kbit
tc qdisc add dev eth3 root netem delay 5ms 4ms rate 1000000kbit

 

Site-to-Site VPN

WAN
tc qdisc add dev eth2 root netem delay 20ms 15ms rate 1000000kbit
tc qdisc add dev eth3 root netem delay 20ms 15ms rate 1000000kbit
LAN
tc qdisc add dev eth2 root netem delay 5ms 4ms rate 1000000kbit
tc qdisc add dev eth3 root netem delay 5ms 4ms rate 1000000kbit

 

Remote User VPN

WAN
tc qdisc add dev eth2 root netem delay 20ms 15ms rate 100000kbit
tc qdisc add dev eth3 root netem delay 20ms 15ms rate 100000kbit
LAN
tc qdisc add dev eth2 root netem delay 2.5ms 0.5ms rate 600000kbit
tc qdisc add dev eth3 root netem delay 2.5ms 0.5ms rate 600000kbit

 

Coffee Shop Wi-Fi

WAN
tc qdisc add dev eth2 root netem delay 5ms 1ms rate 100000kbit
tc qdisc add dev eth3 root netem delay 5ms 1ms rate 100000kbit
LAN
tc qdisc add dev eth2 root netem delay 5ms 4ms rate 600000kbit
tc qdisc add dev eth3 root netem delay 5ms 4ms rate 600000kbit

 

Hotel / Airport Wi-Fi

WAN
tc qdisc add dev eth2 root netem delay 5ms 1ms rate 100000kbit
tc qdisc add dev eth3 root netem delay 5ms 1ms rate 100000kbit
LAN
tc qdisc add dev eth2 root netem delay 8ms 6ms rate 600000kbit
tc qdisc add dev eth3 root netem delay 8ms 6ms rate 600000kbit

 

Stadium / Event Wi-Fi

WAN
tc qdisc add dev eth2 root netem delay 5ms 1ms rate 100000kbit
tc qdisc add dev eth3 root netem delay 5ms 1ms rate 100000kbit
LAN
tc qdisc add dev eth2 root netem delay 10ms 9ms rate 600000kbit
tc qdisc add dev eth3 root netem delay 10ms 9ms rate 600000kbit

 

Congested ISP Core

WAN
tc qdisc add dev eth2 root netem delay 20ms 8ms rate 1000000kbit
tc qdisc add dev eth3 root netem delay 20ms 8ms rate 1000000kbit
LAN
tc qdisc add dev eth2 root netem delay 2.5ms 1ms rate 1000000kbit
tc qdisc add dev eth3 root netem delay 2.5ms 1ms rate 1000000kbit

 

Cellular LTE Edge

WAN
tc qdisc add dev eth2 root netem delay 2.5ms 1ms rate 1000000kbit
tc qdisc add dev eth3 root netem delay 2.5ms 1ms rate 1000000kbit
LAN
tc qdisc add dev eth2 root netem delay 17.5ms 4.5ms rate 1000000kbit
tc qdisc add dev eth3 root netem delay 17.5ms 4.5ms rate 1000000kbit