Tuesday, December 3, 2013

Asymmetric Links and Jitter

Asymmetric link effects can now be configured using the CORE GUI. A new Unidir. >> button in the Link Configuration dialog (when you double-click a link) will expand to show unidirectional link effects. When collapsed, the specified parameters are used bidirectionally.
Below is a screenshot of the expanded dialog. The parameters on the left are for downstream (e.g. for a link from n1 to n2, traffic going from n2 to n1) and upstream on the right.

Jitter

Also a new jitter parameter has been added. Like delay, this value is in microseconds, and specifies a random variation in delay for each packet. See this netem page for details. If you're curious about which tc netem rules that CORE is using, turn on the "-v" verbose logging option in the daemon:
16276: linkconfig: [['/sbin/tc', 'qdisc', 'replace', 'dev', 'n1.eth0.69', 'root', 'handle', '1:', 'tbf', 'rate', '512000', 'burst', '3000', 'limit', '65535']]
16276: linkconfig: [['/sbin/tc', 'qdisc', 'replace', 'dev', 'n1.eth0.69', 'parent', '1:1', 'handle', '10:', 'netem', 'delay', '45000us', '7000us', '25%', 'loss', '0.0%', 'duplicate', '0.0%']]

Caveats

There are a few caveats with asymmetric link effects. To get unidirectional link effects in a wireless model (using the WLAN), look to the EMANE Comm Effect model. The basic on/off model can only support on/off connectivity and uniform effects for the WLAN network as a whole. The asymmetric effects can be used between layer-3 nodes (router, PC, host, etc.), between hubs/switches, and links with RJ45s -- but not for a link between a hub/switch and another node.
Links between hubs/switches and other nodes only have a downstream effect. The round-trip delay (RTT) in the example above is 5ms between n1 and n2 (not 10ms) and 3ms between n1 and n3. This is because CORE is configuring the netem queue, which is outbound queuing only, on one of the veth pair interfaces, highlighted in yellow in the diagram below.

To get a round-trip delay using a switch, configure half the delay on all of the links to the switch (e.g. use 1.5ms on all links for a 3ms round-trip delay.) This could be fixed in future revisions by adding a netem queue on the outbound interface (e.g. the white veths in the diagram) inside the namespace, or by using inbound netem queuing with IFB devices.