1#!/usr/bin/python 2# fairness.py 3# A complex test for butterly-like topology, 4# using 3 TCP connections and 3 ping flows. 5# 6# Bottleneck of 4 Mbit/300 ms overall delay is added. 7# 8# s1---. .---r1 9# s2----\ / 10# s3-----\__.R1---R2.__/__.--r2 11# s4-----/ \ 12# s5----/ \_.--r3 13# s6---^ 14# 15 16from topology import * 17 18T = Topology() 19net1 = Network(T) 20net2 = Network(T, "pyt0") 21net3 = Network(T) 22 23router1 = Host(T, net1, net2, delay2="150", bw2="4M") 24router2 = Host(T, net2, net3) 25 26send1 = Host(T, net1, args="tcpbench:t:172.16.3.2:") 27send2 = Host(T, net1, args="tcpbench:t:172.16.3.3:") 28send3 = Host(T, net1, args="tcpbench:t:172.16.3.4:") 29 30send4 = Host(T, net1, args="ping:172.16.3.2:") 31send5 = Host(T, net1, args="ping:172.16.3.3:") 32send6 = Host(T, net1, args="ping:172.16.3.4:") 33 34 35recv1 = Host(T, net3, args="tcpbench:r:") 36recv2 = Host(T, net3, args="tcpbench:r:") 37recv3 = Host(T, net3, args="tcpbench:r:") 38 39 40sleep(1) 41start(T) 42 43wait(send1) 44wait(send2) 45wait(send3) 46 47cleanup() 48