吉林大学学报(信息科学版) ›› 2025, Vol. 43 ›› Issue (4): 830-836.

• • 上一篇    下一篇

基于Linux 命名空间的网络仿真方法设计与实现

孙华宝   

  1. 安徽工业职业技术学院信息工程系,安徽铜陵244000
  • 收稿日期:2025-03-25 出版日期:2025-08-15 发布日期:2025-08-15
  • 作者简介:孙华宝(1979— ), 男, 安徽铜陵人, 安徽工业职业技术学院高级工程师, 主要从事计算机网络技术研究, (Tel)86- 18905626396(E-mail)孙华宝(1979— ), 男, 安徽铜陵人, 安徽工业职业技术学院高级工程师, 主要从事计算机网络技术研究, (Tel)86- 18905626396(E-mail)shb1023@163. com。
  • 基金资助:
    安徽省高校科研基金资助项目(KJ2021A1467); 安徽工业职业技术学院质量工程基金资助项目(2023jxyj03)

Design and Implementation of Network Simulation Method Based on Linux Namespace

 SUN Huabao   

  1. Department of Information Engineering, Anhui Industry Polytechnic, Tongling 24400, China
  • Received:2025-03-25 Online:2025-08-15 Published:2025-08-15

摘要: 由于网络仿真需要消耗大量系统资源且参数配置复杂,因而在进行网络测试时,这些因素均会影响测试 精度, 为此,设计一种基于Linux命名空间的轻量级网络仿真方法。基于Linux内核虚拟化技术构建仿真网络, 针对网络测试过程中动态调整拓扑引起参数配置复杂,运行网络仿真系统时资源消耗大的问题,设计采用人类可读的数据序列化标准文件灵活定义网络,在用户态通过调用系统命令借助Linux网络命名空间机制完成虚拟 网络创建,编写自动化脚本利用iperf3工具执行网络测试。实验结果表明,所提方法网络吞吐量接近测试理论 带宽, 系统表现出高启动效率和低运行资源开销,能满足常见网络测试应用场景,性能较好,具有一定的研究价值。

关键词: 网络仿真, 虚拟网络, Linux命名空间, 自动化测试

Abstract:

Since network simulation consumes a lot of system resources and has complex parameter configuration, these factors will affect the test accuracy when performing network testing. Therefore, a lightweight network simulation method based on Linux namespace is designed. Based on Linux kernel virtualization technology, a simulation network is built. In order to solve the problem of complex parameter configuration caused by dynamic adjustment of topology during network testing and high resource consumption when running network simulation system, human-readable data serialization standard file is used to flexibly define the network, and completes the virtual network creation by calling system commands in user state with the help of Linux network namespace mechanism. An automated script is written to perform network testing using iperf3 tool. Experimental results show that the network throughput of the proposed method is close to the test theoretical bandwidth, the system shows high startup efficiency and low running resource overhead, can meet common network testing application scenarios, has good performance, and has certain research value.

Key words: network simulation, virtual network, Linux namespace, automated testingmininet

中图分类号: 

  • TP393