Data communication interaction system and method for virtualized container and NS-3

By building a data interaction channel composed of virtualized bridges, routing coordinators and Tap devices between virtualized containers and NS-3, the connectivity problem between virtualized containers and NS-3 is solved, and efficient data is achieved Communication interaction improves the efficiency and accuracy of network application development and testing.

CN119254650BActive Publication Date: 2025-02-18NAT UNIV OF DEFENSE TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411763335.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2025-02-18
Estimated Expiration
2044-12-03

AI Technical Summary

Technical Problem

There is a lack of an effective interaction mechanism between the traditional NS-3 simulation environment and the virtualized container, making it difficult to realize data communication simulation based on the container environment, limiting the effectiveness and reliability of network simulation results.

Method used

A data communication interaction system for virtualized containers and NS-3 is designed. Through the data interaction channel composed of virtualized bridges, routing coordinators and Tap devices, the virtualized containers and NS-3 network scenarios are realized. Data communication interaction.

Benefits of technology

It realizes efficient two-way data transmission between virtualized containers and NS-3, reduces data transmission delay, improves communication efficiency, and enhances the efficiency and accuracy of network application development and testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119254650B_ABST
    Figure CN119254650B_ABST
Patent Text Reader

Abstract

The present application relates to a data communication interaction system and method for virtualized containers and NS‑3. The system consists of a virtualized container unit, an NS‑3 simulation environment unit, and a data interaction channel. The system solves the connectivity problem between the virtualized container and NS‑3 by building a dedicated isolated data interaction channel between the virtualized container and NS‑3. It can not only realize real-time communication and information interaction between the virtualized container and NS‑3, but also realize cross-container data communication between different virtualized containers. Through this system, network behavior can be simulated in a virtualized container environment, real-time data analysis and testing can be performed, and the reliability and performance of network applications can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication interaction technology, and in particular to a data communication interaction system and method for virtualized containers and NS-3. Background Art

[0002] With the continuous development of network technology and the widespread application of virtualization technology, container-based virtualization technology has become a key means to achieve network function virtualization (NFV) and cloud computing. Virtualization container technology (also known as Docker container) makes the development, testing and deployment of network applications more flexible by providing efficient resource utilization and lightweight virtual environment. However, in the process of network application development and verification, an effective means is needed to simulate the real network environment for protocol verification, performance evaluation and network behavior analysis.

[0003] NS-3 (Network Simulator version-3) is an open source network simulation tool that can simulate various types of network structures in the physical world and is widely used in the development, testing and verification of network protocols. However, the traditional NS-3 simulation environment lacks an effective interaction mechanism with virtualized containers, making it difficult to implement data communication simulation based on a container environment. This makes it impossible to accurately simulate the behavior of virtualized network applications in the actual network environment when developing and testing them, limiting the effectiveness and reliability of network simulation results. Summary of the invention

[0004] Based on this, it is necessary to provide a data communication interaction system and method for virtualized containers and NS-3 to address the above technical problems, so as to achieve seamless connection between virtualized container applications and NS-3 network emulators, thereby enhancing the efficiency and accuracy of development, testing and verification of network protocols and applications in the virtualized container environment, and providing a basic data communication foundation for subsequent large-scale, distributed virtual network simulation and development.

[0005] A data communication interaction system for virtualized containers and NS-3, the system consisting of a virtualized container unit, an NS-3 simulation environment unit and a data interaction channel;

[0006] The virtualized container unit includes a plurality of virtualized containers, each of which is isolated from another and is connected to a data interaction channel through an internally configured virtual Ethernet interface for data communication interaction;

[0007] The NS-3 simulation environment unit includes several NS-3 network scenarios. The user space inside each NS-3 network scenario is configured with a TapBridge network device, a control center, and several network nodes. Each NS-3 network scenario is connected to a data interaction channel through a corresponding TapBridge network device for data communication interaction, and forwards data to the internal network nodes through the control center connected to the TapBridge network device.

[0008] The data interaction channel is used to realize data communication interaction between each virtualized container and each NS-3 network scenario, and is composed of a virtualized bridge, a routing coordinator, and several Tap devices. The number of Tap devices in the data interaction channel is consistent with the number of virtualized containers and NS-3 network scenarios, and they correspond one to one.

[0009] Among them, one end of the virtualization bridge is connected to the virtual Ethernet interface of each virtualization container. The virtualization bridge creates and customizes the virtual network to realize cross-container data communication interaction among virtualization containers on the same host, and realizes data communication interaction between each virtualization container and the external network;

[0010] The routing coordinator is connected to the other end of the virtualized bridge and one end of several isolated tap devices. The routing coordinator collects and updates the routing information of all links in the system network, sets routing policies and packet forwarding priorities, monitors the flow of packets, and dynamically updates the routing table. It regulates the forwarding path of packets during communication interactions according to the routing policies, and forwards packets in an orderly manner according to the packet forwarding priorities.

[0011] The other ends of several isolated Tap devices are connected one-to-one with the TapBridge network devices of each NS-3 network scenario. Each Tap device realizes data communication interaction between each NS-3 network scenario and the external network by sending and receiving data packets and monitoring network traffic.

[0012] Furthermore, a specific application or network service runs inside each virtualized container, and is correspondingly configured with a corresponding network protocol stack, network card and virtual Ethernet interface; one end of the network protocol stack is connected to the network card, and the other end is connected to the application or network service; the virtual Ethernet interface consists of two paired virtual network interfaces, one end of the virtual Ethernet interface is connected to the network card, and the other end is connected to the virtualized bridge in the data interaction channel.

[0013] Furthermore, when the NS-3 application is running inside the virtualized container, the network protocol stack consists of a Tap device and a TapBridge network device. At this time, the TapBridge network device is located in the NS-3 application and connected to the Tap device outside the application. The other end of the Tap device is connected to the network card inside the virtualized container.

[0014] Furthermore, the virtual Ethernet interface in each virtualization container is used in a different network namespace, and the network namespace is connected to the corresponding virtualization container in a symbolic manner.

[0015] Furthermore, one end of the control center in each NS-3 network scenario is connected to the TapBridge network device, and the other end of the control center is connected to the internal network node. The control center is used to allocate IP addresses to the network nodes in the network scenario, create network topology, install protocol stacks, set channel models, transmission models, and forward data packets. Each network node has multiple network interfaces, can send and receive data packets, and communicate with other network nodes. Specifically, when the control center forwards a data packet to a network node, it first builds an address mapping table of the network node IP. After receiving the data packet sent by the virtualized container, it reads the destination IP corresponding to the data packet and queries the address mapping table to forward the data packet to the network node of the corresponding IP.

[0016] Furthermore, the NS-3 simulation environment unit also includes an NS-3 channel, which is connected to the control center in each NS-3 network scenario. Through the NS-3 channel, each control center equipped with a socket object adopts a UDP socket communication mechanism and exchanges data and information with the control centers in other NS-3 network scenarios in the form of broadcasting, and after receiving the information, adjusts the control center's own network status and network configuration according to the corresponding information.

[0017] A data communication interaction method for virtualized containers and NS-3, the method is implemented based on the above-mentioned data communication interaction system for virtualized containers and NS-3, and includes the following steps:

[0018] Step 1, define services for several virtualized containers in the virtualized container unit by configuring a YAML file; specifically, it includes configuring the container name, building the basic configuration of the container, configuring each virtualized container to connect with the virtualized bridge, and enabling terminal support for each virtualized container, so that each virtualized container receives terminal input and displays output;

[0019] Step 2: define the operating environment and execution tasks of several virtualized containers by configuring the virtualized container file; wherein the execution tasks include building a virtualized container basic environment, installing basic network tools, and loading data tasks;

[0020] Step 3: Rapidly orchestrate application services of several virtualized containers through a virtualized container orchestration tool;

[0021] Step 4: Automatically create and configure a virtualized bridge and several tap devices in the data interaction channel by running a shell script, and configure and deploy several virtualized containers according to the files defined and arranged in steps 1 to 3, and configure the virtual Ethernet interface, network card, IP address, and MAC address of each virtualized container;

[0022] Step 5, build several NS-3 network scenarios in the NS-3 simulation environment unit and perform relevant configurations, and connect each TapBridge network device to each Tap device in the data interaction channel one-to-one through the TapBridge network device configured in the user space of each NS-3 network scenario; wherein the number of Tap devices in the data interaction channel is consistent with the number of virtualized containers and NS-3 network scenarios, and corresponds one-to-one;

[0023] Step 6: Configure the routing coordinator in the data exchange channel, set the routing strategy and data packet forwarding priority according to the routing coordinator, monitor the flow of data packets, and dynamically update the routing table;

[0024] Step 7: According to the well-configured data interaction channel, the data packets generated in each virtualized container are sent to the network nodes in each NS-3 network scenario, and the data packets generated by the network nodes in each NS-3 network scenario are sent to each virtualized container, so as to realize data communication interaction between the virtualized container and the NS-3 network scenario.

[0025] In one embodiment, a virtualized bridge and several tap devices in a data interaction channel are automatically created and configured by running a shell script, and several virtualized containers are configured and deployed according to the files defined and arranged in steps 1 to 3, and a virtual Ethernet interface, a network card, an IP address, and a MAC address of each virtualized container are configured, including:

[0026] Run the shell script to automatically create several Tap devices in the data exchange channel, set all Tap devices to promiscuous mode and start them;

[0027] Create a virtualized bridge, bind all Tap devices to the virtualized bridge, and enable the Ethernet frame forwarding permission of the virtualized bridge;

[0028] Configure and deploy several virtualized containers according to the files defined in steps 1 to 3 and start them.

[0029] Get the process IDs of all virtualized containers, create a network namespace corresponding to each virtualized container, and symbolically connect the network namespace to the corresponding virtualized container;

[0030] Create and configure a pair of virtual Ethernet interfaces for each virtualized container and name them;

[0031] Create a network card for each virtualized container and assign an IP address and MAC address to the network card.

[0032] In one embodiment, several NS-3 network scenarios are built in the NS-3 simulation environment unit and relevant configurations are performed, and through the TapBridge network devices configured in the user space of each NS-3 network scenario, each TapBridge network device is connected to each Tap device in the data interaction channel one by one, including:

[0033] Initialization parameters: Set the creation mode of the TapBridge network device to UseBridge mode and specify the name of the Tap device to be used. In UseBridge mode, the TapBridge network device uses the already created Tap device;

[0034] Parsing command line parameters: Use the CommandLine class to parse command line parameters, allowing users to modify the creation mode and Tap device name of the TapBridge network device at runtime;

[0035] Bind global values: Set the implementation type of the NS-3 network scenario to ns3::RealtimeSimulatorImpl and enable checksum;

[0036] Create network nodes: Create several network nodes for each NS-3 network scenario. The network nodes are used to simulate specific devices in the NS-3 network scenario.

[0037] Configure specific network scenarios: Set specific NS-3 network scenarios and network topology, configure channel models, data transmission rates and delays;

[0038] Install network equipment: Install specific network equipment on all network nodes so that network nodes can communicate through specific channels;

[0039] Install Internet Protocol Stack: Install Internet Protocol Stack on all network nodes to enable the nodes to support IP protocol;

[0040] Allocate IP addresses to network nodes: Allocate IP addresses to each network node;

[0041] Configure TapBridge network devices: Set the creation mode of TapBridge network devices to UseBridge, allowing the TapBridge network devices configured in the user space of each NS-3 network scenario to connect to and use the Tap devices in the data exchange channel;

[0042] Install and connect the TapBridge network device to the control center: Install and connect the TapBridge network device to the control center in the corresponding NS-3 network scenario so that the control center can communicate with the Tap device;

[0043] Set up the global routing table: Set up the global routing table to ensure that the network nodes in each NS-3 network scenario receive data packets from the correct route through the control center.

[0044] In one embodiment, a routing coordinator in a data exchange channel is configured, a routing strategy and a data packet forwarding priority are set according to the routing coordinator, a data packet flow direction is monitored, and a routing table is dynamically updated, including:

[0045] The routing coordinator uses the Hello protocol to search and collect routing information of all links in the network and obtain the initial state information of all links, where the initial state information includes network topology, path status and delay;

[0046] The routing coordinator sets a specific routing strategy based on the source IP address, destination IP address and port number, regulates the forwarding path of data packets during communication interaction according to the routing strategy, and monitors and records the flow direction, arrival time and forwarding time of data packets;

[0047] Set the packet forwarding priority according to the packet arrival waiting time. The packet forwarding priority starts to calculate the arrival waiting time when the packet arrives at the routing coordinator. Set the packet with a long arrival waiting time as a high forwarding priority, and record and cache the arriving packets through the first-in-first-out queue to achieve orderly forwarding of packets and network load balancing;

[0048] Update the routing tables of all links according to the routing strategy to ensure that the routing information of each link is synchronized. After the routing table is updated, the routing coordinator will process the data packet transmission and forwarding according to the latest routing table, and delete the paths that are no longer valid by regularly checking the validity of the paths in the routing table, so as to realize the dynamic update of the routing tables of all links.

[0049] The above-mentioned data communication interaction system and method for virtualized containers and NS-3 solves the connectivity problem between virtualized containers and NS-3 by building a dedicated and isolated data interaction channel between virtualized containers and NS-3. The data interaction channel supports real-time communication and data stream transmission, ensures efficient two-way data transmission between virtualized containers and NS-3, reduces data transmission delay, and improves communication efficiency. In addition, the present application not only supports real-time data communication and information interaction between a single virtualized container and NS-3, but also supports the expansion of container scale, realizes real-time data communication and information interaction between multiple virtualized containers and multiple NS-3 network scenarios, and at the same time, each virtualized container can also realize cross-container data communication interaction between multiple virtualized containers by connecting to the virtualized bridge in the data interaction channel. Based on this application, the efficiency and accuracy of network application development and testing can be improved, the reliability and flexibility of network simulation can be enhanced, more effective tools and methods can be provided for developers, and the basic foundation of data communication is provided for subsequent large-scale, distributed virtual network simulation and development, thereby promoting the further development of network technology. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 A schematic diagram of the structure of a data communication interaction system for a virtualized container and NS-3 in one embodiment;

[0051] Figure 2 It is a flowchart of a data communication interaction method between a virtualized container and NS-3 in one embodiment;

[0052] Figure 3 A schematic diagram of the process of building and configuring an NS-3 network scenario in an embodiment;

[0053] Figure 4 A schematic diagram of a flow chart of configuring a routing coordinator in one embodiment. DETAILED DESCRIPTION

[0054] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0055] In one embodiment, Figure 1 As shown in the figure, a data communication interaction system for virtualized containers and NS-3 is provided. The host operating system deployed by the system is Ubuntu 20.04 LTS. It consists of a virtualized container unit, an NS-3 simulation environment unit, and a data interaction channel. The functions of each component are as follows:

[0056] The virtualization container unit contains several virtualization containers, each of which is isolated from each other and connected to the data exchange channel through an internally configured virtual Ethernet interface for data communication interaction. Specifically, the virtualization container is a lightweight, portable operating environment that contains the application and all its dependencies. Each virtualization container shares the host operating system kernel, but is isolated from each other in the user space.

[0057] Among them, a specific application or network service runs inside each virtualized container, and is configured with a corresponding network protocol stack, network card (eth0) and virtual Ethernet interface (veth pair); one end of the network protocol stack is connected to the network card, and the other end is connected to the application or network service; the virtual Ethernet interface is a virtual network device implemented in the Linux kernel, consisting of two paired virtual network interfaces. When data is sent from one virtual network interface to another, it is transmitted in a direct connection manner, similar to the network cable connection in the physical network; one end of the virtual Ethernet interface is connected to the network card, and the other end is connected to the virtualized bridge in the data interaction channel.

[0058] Specifically, when the NS-3 application is running inside the virtualized container, the network protocol stack consists of a Tap device and a TapBridge network device. At this time, the TapBridge network device is located in the NS-3 application and connected to the Tap device outside the application. The other end of the Tap device is connected to the network card inside the virtualized container.

[0059] Specifically, the virtual Ethernet interface in each virtualization container is used in a different network namespace, and the network namespace is connected to the corresponding virtualization container in a symbolic manner, thereby achieving isolation and security.

[0060] The NS-3 simulation environment unit contains several NS-3 network scenarios. The user space inside each NS-3 network scenario is configured with a TapBridge network device (TapBridge NetDevice), a control center, and several network nodes. Each NS-3 network scenario is connected to the data interaction channel through the corresponding TapBridge network device for data communication interaction, and forwards the data to the internal network nodes through the control center connected to the TapBridge network device.

[0061] Among them, the TapBridge network device is a subclass of the network device in the NS-3 network scenario, which supports the integration of virtual network devices (such as Tap devices) in the host operating system kernel into the NS-3 simulation environment. Nodes with the TapBridge network device installed can receive / send packets from the physical host, and then send the packets to NS-3 through virtual network devices (such as Tap devices).

[0062] Among them, one end of the control center in each NS-3 network scenario is connected to the TapBridge network device, and the other end of the control center is connected to the internal network node. The control center is used to assign IP addresses to the network nodes in the network scenario, create network topology, install protocol stacks, set channel models, transmission models, and forward data packets. Each network node has multiple network interfaces, can send and receive data packets, and communicate with other network nodes. Specifically, when the control center forwards a data packet to a network node, it first builds an address mapping table (Address Map) of the network node IP. After receiving the data packet sent by the virtualized container, it reads the destination IP corresponding to the data packet and queries the address mapping table to forward the data packet to the network node corresponding to the IP.

[0063] Specifically, the NS-3 simulation environment unit also includes an NS-3 channel, which is connected to the control center in each NS-3 network scenario. The NS-3 channel transmits data packets between any network nodes by simulating various physical and logical connections (such as radio channels, wired connections, etc.). Through the NS-3 channel, each control center equipped with a socket object uses the UDP socket communication mechanism (User Datagram Protocol Socket, UDP Socket) and exchanges data and information with the control centers in other NS-3 network scenarios in the form of broadcasting, such as control information, operation information, configuration information, etc., and after receiving the information, adjusts the network status and network configuration of the control center itself according to the corresponding information, thereby achieving network optimization and performance adjustment.

[0064] The data exchange channel is used to realize the data communication interaction between each virtualized container and each NS-3 network scenario. It consists of a virtualized bridge (Docker bridge), a routing coordinator, and several Tap devices. The number of Tap devices in the data exchange channel is consistent with the number of virtualized containers and NS-3 network scenarios, and they correspond one to one. Specifically, Figure 1 The system shown contains 10 virtualized containers, 10 Tap devices, and 10 NS-3 network scenarios, and each NS-3 network scenario contains 10 network nodes.

[0065] Among them, the virtualization bridge is a network driver that mainly provides network connection and communication functions for Docker containers. One end of the virtualization bridge is connected to the virtual Ethernet interface of each virtualization container. The virtualization bridge creates and customizes virtual networks to enable cross-container data communication interaction between virtualization containers on the same host, and to enable data communication interaction between each virtualization container and the external network.

[0066] Among them, the routing coordinator is a virtual network device that is mainly responsible for collecting and updating the routing information of all links in the network and regulating the transmission of data packets in the network. Its core function is to ensure that data packets can reach the target address efficiently and reliably based on the network status and preset routing policies. Specifically, the routing coordinator is connected to the other end of the virtualized bridge and one end of several isolated Tap devices. The routing coordinator collects and updates the routing information of all links in the system network, sets routing policies and data packet forwarding priorities, monitors the flow of data packets, and dynamically updates the routing table. It regulates the forwarding path of data packets during communication interactions according to the routing policy, and forwards data packets in an orderly manner according to the data packet forwarding priority.

[0067] Among them, the other end of several isolated Tap devices is connected to the TapBridge network device of each NS-3 network scene one by one. Each Tap device realizes data communication interaction between each NS-3 network scene and the external network by sending and receiving data packets and monitoring network traffic. The Tap device is a virtual network device at the link layer, mainly used for network traffic monitoring and data packet processing at the link layer. It can receive and send Ethernet frames, allowing users to monitor and control data flows without affecting the actual network.

[0068] In one embodiment, Figure 2 As shown, a data communication interaction method for virtualized containers and NS-3 is provided, and the method is based on Figure 1 The data communication interaction system between the virtualized container and NS-3 shown in the figure includes the following steps:

[0069] Step 1: Define services for several virtualized containers in the virtualized container unit by configuring a YAML file.

[0070] Specifically, configure the YAML (YAML Ain't MarkupLanguage, YAML) file in the Ubuntu 20.04 LTS operating system to define the services for the 10 virtualizations to be created, and build a group of related application containers as a service stack. Specifically, configure the following for each virtualization container:

[0071] Configure container names: Name the 10 virtualized containers in sequence;

[0072] Build basic container configuration: Use the virtualized container file (Dockerfile) in the default path to build the basic container configuration;

[0073] Network configuration: configure each virtualized container to connect with the virtualized bridge;

[0074] Enable terminal support: Enable terminal support for each virtualization container so that each virtualization container receives terminal input and displays output.

[0075] Among them, the YAML file is a human-readable data serialization format, which is widely used in configuration files, data exchange, and data transmission between applications.

[0076] Step 2: Define the operating environment and execution tasks of several virtualized containers by configuring the virtualized container file. The execution tasks include building the basic environment of the virtualized container, installing basic network tools, and loading data tasks.

[0077] Specifically, the operating environment and execution tasks of 10 virtualized containers are defined by configuring virtualized container files. Virtualized container files are script files used by virtualized containers to define how to build virtualized container images. They contain a series of instructions (commands) that describe the entire process of creating a new custom image from a base image. Through virtualized container files, users can automate the construction of images and achieve rapid deployment of virtualized container application clusters while ensuring the consistency of the application environment.

[0078] Step 3: Use a virtualized container orchestration tool to quickly orchestrate application services of several virtualized containers.

[0079] Specifically, the application services of 10 virtualized containers are quickly orchestrated through the virtualized container orchestration tool (Docker Compose). Docker Compose is a tool for defining and managing multi-virtualized container applications. Through a configuration file, users can quickly define and run a complete application stack including multiple services, networks, and storage volumes.

[0080] Step 4: Automatically create and configure the virtualized bridge and several tap devices in the data interaction channel by running the shell script, and configure and deploy several virtualized containers according to the files defined and arranged in steps 1 to 3, and configure the virtual Ethernet interface, network card, IP address (Internet Protocol address) and MAC address (Media Access Control Address) of each virtualized container.

[0081] Specifically, run the shell script to automatically create and configure a virtualized bridge and several tap devices in the Ubuntu 20.04 LTS operating system, deploy 10 virtualized containers according to the configurations in steps 1 to 3, and configure the virtual Ethernet interface, network card, IP address, and MAC address of each virtualized container. The specific configuration content includes:

[0082] Run the shell script to automatically create 10 Tap devices in the data exchange channel, set all Tap devices to promiscuous mode and start them;

[0083] Create a virtualized bridge, bind all Tap devices to the virtualized bridge, and enable the Ethernet frame forwarding permission of the virtualized bridge;

[0084] Configure and deploy 10 virtualized containers according to the orchestration files defined in steps 1 to 3 and start them.

[0085] Get the process IDs of all virtualized containers, create a network namespace corresponding to each virtualized container, and symbolically connect the network namespace to the corresponding virtualized container;

[0086] Create and configure a pair of virtual Ethernet interfaces for each virtualized container and name them accordingly;

[0087] Create a network card for each virtualized container and assign an IP address and MAC address to the network card.

[0088] Step 5: Build several NS-3 network scenarios in the NS-3 simulation environment unit and perform relevant configurations, and connect each TapBridge network device to each Tap device in the data interaction channel one-to-one through the TapBridge network device configured in the user space of each NS-3 network scenario; wherein the number of Tap devices in the data interaction channel is consistent with the number of virtualized containers and NS-3 network scenarios, and corresponds one-to-one.

[0089] Specifically, the process of building and configuring the NS-3 network scenario is as follows: Figure 3 As shown, including:

[0090] Initialization parameters: Set the creation mode of the TapBridge network device to UseBridge mode and specify the names of 10 Tap devices. In UseBridge mode, the TapBridge network device uses the 10 Tap devices that have been created.

[0091] Parsing command line parameters: Use the CommandLine class to parse command line parameters, allowing users to modify the creation mode of the TapBridge network device and the names of 10 Tap devices at runtime; the command line (CommandLine) refers to a way for users to enter commands to run applications;

[0092] Bind global values: Set the implementation type of the NS-3 network scenario to ns3::RealtimeSimulatorImpl and enable checksum;

[0093] Create network nodes: Create 100 network nodes for 10 NS-3 network scenarios. The network nodes are used to simulate specific devices in the NS-3 network scenarios.

[0094] Configure specific network scenarios: Set specific NS-3 network scenarios and network topology, configure channel models, data transmission rates and delays;

[0095] Install network equipment: Install specific network equipment on all network nodes so that network nodes can communicate through specific channels;

[0096] Install Internet Protocol Stack: Install Internet Protocol Stack on all network nodes to enable the nodes to support IP protocol;

[0097] Allocate IP addresses to network nodes: Allocate IP addresses to each network node;

[0098] Configure TapBridge network devices: Set the creation mode of TapBridge network devices to UseBridge, allowing the TapBridge network devices configured in the user space of each NS-3 network scenario to connect to and use the Tap devices in the data exchange channel;

[0099] Install and connect the TapBridge network device to the control center: Install and connect the TapBridge network device to the control center in the corresponding NS-3 network scenario so that the control center can communicate with the Tap device;

[0100] Set up the global routing table: Set up the global routing table to ensure that the network nodes in each NS-3 network scenario receive data packets from the correct route through the control center.

[0101] Step 6: Configure the routing coordinator in the data exchange channel, set the routing strategy and data packet forwarding priority according to the routing coordinator, monitor the flow of data packets, and dynamically update the routing table.

[0102] Specifically, the process of routing coordinator configuration is as follows Figure 4 As shown, including:

[0103] Use the Hello protocol to search and collect routing information of all links in the network and obtain the initial state information of all links. The initial state information includes network topology, path status and delay for subsequent path calculation and network status update;

[0104] Set specific routing policies based on conditions such as source IP address, destination IP address and port number, regulate the forwarding path of data packets during communication interaction according to the routing policies, and monitor and record the flow direction, arrival time and forwarding time of data packets;

[0105] Set the packet forwarding priority according to the packet arrival waiting time. The packet forwarding priority starts from the arrival waiting time of the packet at the routing coordinator. The packet with a long arrival waiting time is set as a high forwarding priority. The first-in-first-out queue (FIFO) is used to record and cache the arriving packets to achieve orderly forwarding of packets and network load balancing.

[0106] Update the routing tables of all links according to the routing strategy to ensure that the routing information of each link is synchronized. After the routing table is updated, the routing coordinator will process the data packet transmission and forwarding according to the latest routing table, and delete the paths that are no longer valid by regularly checking the validity of the paths in the routing table, so as to realize the dynamic update of the routing tables of all links.

[0107] Step 7: According to the well-configured data interaction channel, the data packets generated in each virtualized container are sent to the network nodes in each NS-3 network scenario, and the data packets generated by the network nodes in each NS-3 network scenario are sent to each virtualized container, so as to realize data communication interaction between the virtualized container and the NS-3 network scenario.

[0108] Based on this method, not only can real-time communication and information interaction between virtualized containers and NS-3 be achieved, but also cross-container data communication between different virtualized containers can be achieved. Through this method, developers can simulate network behavior in a virtualized container environment, perform real-time data analysis and testing, and thus improve the reliability and performance of network applications.

[0109] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0110] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A data communication interaction system for virtualized containers and NS-3, characterized in that: The system consists of a virtualized container unit, an NS-3 simulation environment unit, and a data interaction channel; The virtualized container unit includes a plurality of virtualized containers, each of which is isolated from another and is connected to the data interaction channel through an internally configured virtual Ethernet interface to perform data communication interaction; The NS-3 simulation environment unit includes several NS-3 network scenarios, and the user space inside each NS-3 network scenario is configured with a TapBridge network device, a control center, and several network nodes. Each NS-3 network scenario is connected to the data interaction channel through the corresponding TapBridge network device to perform data communication interaction, and forwards data to the internal network node through the control center connected to the TapBridge network device; The data interaction channel is used to realize data communication interaction between each virtualized container and each NS-3 network scenario, and is composed of a virtualized bridge, a routing coordinator, and a plurality of Tap devices; wherein the number of Tap devices in the data interaction channel is consistent with the number of virtualized containers and NS-3 network scenarios, and corresponds one to one; One end of the virtualized network bridge is connected to the virtual Ethernet interface of each virtualized container. The virtualized network bridge creates and customizes a virtual network to achieve data communication interaction between each virtualized container on the same host, and to achieve data communication interaction between each virtualized container and an external network. The routing coordinator is respectively connected to the other end of the virtualized bridge and one end of several mutually isolated Tap devices. The routing coordinator collects and updates the routing information of all links in the system network, sets routing strategies and data packet forwarding priorities, monitors the flow of data packets, and dynamically updates the routing table. It regulates the forwarding path of data packets during communication interaction according to the routing strategy, and forwards data packets in an orderly manner according to the data packet forwarding priorities. The other ends of the several isolated Tap devices are connected one-to-one with the TapBridge network devices of each NS-3 network scenario. Each Tap device realizes data communication interaction between each NS-3 network scenario and the external network by sending and receiving data packets and monitoring network traffic.

2. The data communication interaction system for virtualized containers and NS-3 according to claim 1 is characterized in that: A specific application or network service runs inside each virtualized container, and is correspondingly configured with a corresponding network protocol stack, a network card, and a virtual Ethernet interface; one end of the network protocol stack is connected to the network card, and the other end is connected to the application or network service; the virtual Ethernet interface consists of two virtual network interfaces that exist in pairs, one end of the virtual Ethernet interface is connected to the network card, and the other end is connected to the virtualized bridge in the data interaction channel.

3. The data communication interaction system for virtualized containers and NS-3 according to claim 2 is characterized in that: When the NS-3 application is running inside the virtualized container, the network protocol stack consists of a Tap device and a TapBridge network device. At this time, the TapBridge network device is located in the NS-3 application and connected to the Tap device outside the application. The other end of the Tap device is connected to the network card inside the virtualized container.

4. The data communication interaction system for virtualized containers and NS-3 according to claim 2 is characterized in that: The virtual Ethernet interface in each virtualization container is used in a different network namespace, and the network namespace is connected to the corresponding virtualization container in a symbolic manner.

5. The data communication interaction system for virtualized containers and NS-3 according to claim 1, characterized in that: One end of the control center in each NS-3 network scenario is connected to the TapBridge network device, and the other end of the control center is connected to the internal network node. The control center is used to assign IP addresses to the network nodes in the network scenario, create network topology, install protocol stacks, set channel models, transmission models, and forward data packets. Each network node has multiple network interfaces, can send and receive data packets, and communicate with other network nodes. Specifically, when the control center forwards a data packet to a network node, it first constructs an address mapping table of the network node IP. After receiving the data packet sent by the virtualized container, it reads the destination IP corresponding to the data packet and queries the address mapping table to forward the data packet to the network node of the corresponding IP.

6. The data communication interaction system for virtualized containers and NS-3 according to claim 1, characterized in that: The NS-3 simulation environment unit also includes an NS-3 channel, which is connected to the control center in each NS-3 network scenario. Through the NS-3 channel, each control center equipped with a socket object adopts a UDP socket communication mechanism and exchanges data and information with the control centers in other NS-3 network scenarios in the form of broadcasting, and after receiving the information, adjusts the control center's own network status and network configuration according to the corresponding information.

7. A data communication interaction method for virtualized containers and NS-3, the method is implemented based on the data communication interaction system for virtualized containers and NS-3 according to any one of claims 1 to 6, characterized in that: The method comprises: Step 1, define services for several virtualized containers in the virtualized container unit by configuring a YAML file; specifically, it includes configuring the container name, building the basic configuration of the container, configuring each virtualized container to connect with the virtualized bridge, and enabling terminal support for each virtualized container, so that each virtualized container receives terminal input and displays output; Step 2, defining the operating environment and execution tasks of several virtualized containers by configuring the virtualized container file; wherein the execution tasks include building a virtualized container basic environment, installing basic network tools, and loading data tasks; Step 3: Rapidly orchestrate application services of several virtualized containers through a virtualized container orchestration tool; Step 4: Automatically create and configure a virtualized bridge and several tap devices in the data interaction channel by running a shell script, and configure and deploy several virtualized containers according to the files defined and arranged in steps 1 to 3, and configure the virtual Ethernet interface, network card, IP address, and MAC address of each virtualized container; Step 5, build several NS-3 network scenarios in the NS-3 simulation environment unit and perform relevant configurations, and connect each TapBridge network device to each Tap device in the data interaction channel in a one-to-one correspondence through the TapBridge network device configured in the user space of each NS-3 network scenario; wherein the number of Tap devices in the data interaction channel is consistent with the number of virtualized containers and NS-3 network scenarios, and corresponds one-to-one; Step 6: configure the routing coordinator in the data exchange channel, set the routing strategy and data packet forwarding priority according to the routing coordinator, monitor the flow of data packets, and dynamically update the routing table; Step 7: According to the well-configured data interaction channel, the data packets generated in each virtualized container are sent to the network nodes in each NS-3 network scenario, and the data packets generated by the network nodes in each NS-3 network scenario are sent to each virtualized container, so as to realize data communication interaction between the virtualized container and the NS-3 network scenario.

8. The data communication interaction method for virtualized container and NS-3 according to claim 7, characterized in that: By running the shell script, the virtualized bridge and several tap devices in the data exchange channel are automatically created and configured. According to the files defined in steps 1 to 3, several virtualized containers are configured and deployed, and the virtual Ethernet interface, network card, IP address, and MAC address of each virtualized container are configured, including: Run the shell script to automatically create several Tap devices in the data exchange channel, set all Tap devices to promiscuous mode and start them; Create a virtualized bridge, bind all Tap devices to the virtualized bridge, and enable the Ethernet frame forwarding permission of the virtualized bridge; Configure and deploy several virtualized containers according to the files defined in steps 1 to 3 and start them. Get the process IDs of all virtualized containers, create a network namespace corresponding to each virtualized container, and symbolically connect the network namespace to the corresponding virtualized container; Create and configure a pair of virtual Ethernet interfaces for each virtualized container and name them; Create a network card for each virtualized container and assign an IP address and MAC address to the network card.

9. The data communication interaction method for virtualized container and NS-3 according to claim 7, characterized in that: Several NS-3 network scenarios are built in the NS-3 simulation environment unit and related configurations are performed. Through the TapBridge network devices configured in the user space of each NS-3 network scenario, each TapBridge network device is connected to each Tap device in the data interaction channel one by one, including: Initialization parameters: Set the creation mode of the TapBridge network device to UseBridge mode and specify the name of the Tap device to be used. In UseBridge mode, the TapBridge network device uses the already created Tap device; Parsing command line parameters: Use the CommandLine class to parse command line parameters, allowing users to modify the creation mode and Tap device name of the TapBridge network device at runtime; Bind global values: Set the implementation type of the NS-3 network scenario to ns3::RealtimeSimulatorImpl and enable checksum; Create network nodes: Create several network nodes for each NS-3 network scenario. The network nodes are used to simulate specific devices in the NS-3 network scenario. Configure specific network scenarios: Set specific NS-3 network scenarios and network topology, configure channel models, data transmission rates and delays; Install network equipment: Install specific network equipment on all network nodes so that network nodes can communicate through specific channels; Install Internet Protocol Stack: Install Internet Protocol Stack on all network nodes to enable the nodes to support IP protocol; Allocate IP addresses to network nodes: Allocate IP addresses to each network node; Configure TapBridge network devices: Set the creation mode of TapBridge network devices to UseBridge, allowing the TapBridge network devices configured in the user space of each NS-3 network scenario to connect to and use the Tap devices in the data exchange channel; Install and connect the TapBridge network device to the control center: Install and connect the TapBridge network device to the control center in the corresponding NS-3 network scenario so that the control center can communicate with the Tap device; Set up the global routing table: Set up the global routing table to ensure that the network nodes in each NS-3 network scenario receive data packets from the correct route through the control center.

10. The data communication interaction method for virtualized container and NS-3 according to claim 7, characterized in that: Configuring a routing coordinator in the data interaction channel, setting routing policies and data packet forwarding priorities according to the routing coordinator, monitoring data packet flow, and dynamically updating a routing table, including: The routing coordinator uses the Hello protocol to search and collect routing information of all links in the network, and obtains the initial state information of all links, wherein the initial state information includes network topology, path status and delay; The routing coordinator sets a specific routing strategy based on the source IP address, the destination IP address and the port number, regulates the forwarding path of the data packet during the communication interaction according to the routing strategy, and monitors and records the flow direction, arrival time and forwarding time of the data packet; The data packet forwarding priority is set according to the data packet arrival waiting time. The data packet forwarding priority starts to calculate the arrival waiting time when the data packet arrives at the routing coordinator, and the data packet with a long arrival waiting time is set as a high forwarding priority. The arriving data packets are recorded and cached through a first-in-first-out queue to achieve orderly forwarding of data packets and network load balancing; The routing tables of all links are updated according to the routing strategy to ensure the synchronization of routing information of each link. After the routing table is updated, the routing coordinator will process data packet transmission and forwarding according to the latest routing table, and delete the paths that are no longer valid by regularly checking the validity of the paths in the routing table, thereby realizing dynamic update of the routing tables of all links.

Citation Information

Patent Citations

  • Multiple virtual network interface support for virtual execution elements

    CN110875844A

  • Container networking interface for multiple types of interfaces

    US20220278926A1