From 9418998c31a8b13717ca226690e0ac96685887ee Mon Sep 17 00:00:00 2001 From: Michael Marsh <mmarsh@cs.umd.edu> Date: Mon, 19 Feb 2018 08:51:50 -0500 Subject: [PATCH] configure links with network emulation --- start_testbed.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/start_testbed.py b/start_testbed.py index 1381b99..52eec78 100755 --- a/start_testbed.py +++ b/start_testbed.py @@ -54,6 +54,13 @@ def connect_nodes(node1, node2): 'ip', 'link', 'add', dev_1, 'type', 'veth', 'peer', 'name', dev_2 ]) + + # Configure the link for network emulation. + subprocess.call([ + 'sudo', + 'tc', 'qdisc', 'add', 'dev', dev_1, 'root', 'handle', '1:0', 'netem' + ]) + # Add the link endpoints to the container namespaces. def add_to_ns(dev,ns): subprocess.call([ -- GitLab