#Add link 
net.addLink(r1, h1, max_queue_size=100, intfName1 = 'r1-eth0', intfName2 = 'h1-eth0',       cls=TCLink, use_htb = True, bw1)
net.addLink(r2, h1, max_queue_size=100, intfName1 = 'r2-eth1', intfName2 = 'h1-eth1', cls=TCLink, use_htb = True, bw1)
net.addLink(r3, h2, max_queue_size=100, intfName1 = 'r3-eth0', intfName2 = 'h2-eth0', cls=TCLink, use_htb = True, bw1)
net.addLink(r4, h2, max_queue_size=100, intfName1 = 'r4-eth1', intfName2 = 'h2-eth1', cls=TCLink, use_htb = True, bw1)
net.addLink(r1, r3, max_queue_size=100, intfName1 = 'r1-eth1', intfName2 = 'r3-eth1', cls=TCLink, use_htb = True, bw2)
net.addLink(r1, r4, max_queue_size=100, intfName1 = 'r1-eth2', intfName2 = 'r4-eth2', cls=TCLink, use_htb = True, bw1)
net.addLink(r2, r4, max_queue_size=100, intfName1 = 'r2-eth0', intfName2 = 'r4-eth0', cls=TCLink, use_htb = True, bw1)
net.addLink(r2, r3, max_queue_size=100, intfName1 = 'r2-eth2', intfName2 = 'r3-eth2', cls=TCLink, use_htb = True, bw2)
    net.build()
