How to use bonding to increase the throughput?
http://csie.nqu.edu.tw/smallko/sdn/mininet-link-aggregate.htm
[Description]
In linux system, you can bond multiple networkinterfaces to increase bandwidth. I will show how to do it in this lecture. Inthe 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 bondthese two interfaces to become one logical interface, i.e. bond0. h3 and h4 arejust normal hosts. In the first experiment, no bonding is used. In the secondexperiment, bonding is used to evaluate the performance for comparison.
[Note] If you don't install the bridgetool, 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 TCPserver at h1 with port 5566 and another iperf TCPserver at h1 with port 6666
start iperfclient at h3 and h4 and see the results
Experiment 2.
bonding setting at h1
performance evaluation (We can see that thethroughput has increased for h3-h1 and h4-h1 communications)
Dr. Chih-Heng Ke
Department of Computer Science andInformation Engineering, National Quemoy University, Kinmen,Taiwan
Email: smallko@gmail.com
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通