How to use bonding to increase the throughput?
[Description]
In linux system, you can bond multiple network interfaces to increase bandwidth. I will show how to do it in this lecture. In the experimental environment, I will create 4 hosts, i.e. h1, h2, h3, and h4. h2 will be configured as a switch. There are 2 interfaces in h1. I will bond these two interfaces to become one logical interface, i.e. bond0. h3 and h4 are just normal hosts. In the first experiment, no bonding is used. In the second experiment, bonding is used to evaluate the performance for comparison.
[Note] If you don't install the bridge tool, please use "sudo apt-get install bridge-utils" command to install related software.
[mininet script]
#!/usr/bin/env python from mininet.cli import CLI from mininet.link import Link,TCLink,Intf from mininet.net import Mininet from mininet.node import RemoteController from mininet.term import makeTerm if '__main__' == __name__: net = Mininet(link=TCLink) h1 = net.addHost('h1', mac='00:00:00:00:00:11') h2 = net.addHost('h2', mac='00:00:00:00:00:22') h3 = net.addHost('h3', mac='00:00:00:00:00:23') h4 = net.addHost('h4', mac='00:00:00:00:00:24') linkopts={'bw':1} net.addLink(h1, h2, cls=TCLink, **linkopts) net.addLink(h1, h2, cls=TCLink, **linkopts) net.addLink(h2, h3, cls=TCLink, **linkopts) net.addLink(h2, h4, cls=TCLink, **linkopts) net.build() h2.cmd("sudo ifconfig h2-eth0 0") h2.cmd("sudo ifconfig h2-eth1 0") h2.cmd("sudo ifconfig h2-eth2 0") h2.cmd("sudo ifconfig h2-eth3 0") h2.cmd("sudo brctl addbr mybr") h2.cmd("sudo brctl addif mybr h2-eth0") h2.cmd("sudo brctl addif mybr h2-eth1") h2.cmd("sudo brctl addif mybr h2-eth2") h2.cmd("sudo brctl addif mybr h2-eth3") h2.cmd("sudo ifconfig mybr up") CLI(net) net.stop() |
[Execution]
Experiment 1
start iperf TCP server at h1 with port 5566 and another iperf TCP server at h1 with port 6666
start iperf client at h3 and h4 and see the results
Experiment 2.
bonding setting at h1
performance evaluation (We can see that the throughput has increased for h3-h1 and h4-h1 communications)
Dr. Chih-Heng Ke
Department of Computer Science and
Information Engineering, National Quemoy University, Kinmen,
Taiwan
Email: smallko@gmail.com