Method and system for simulating hub in network target range

By providing hub nodes in the network shooting range and using OVS function to simulate the hub broadcasting characteristics, the problem that existing network shooting ranges cannot simulate hubs is solved, and the simulation capabilities of real-life networks are improved.

CN119865475AInactive Publication Date: 2025-04-22SAINING WANGAN
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510355016.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-25
Publication Date
2025-04-22
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing network shooting range cannot directly simulate hubs, which limits the simulation capabilities of real-life networks.

Method used

By providing hub nodes in the network range and when starting the hub function, create traffic rule parameters, use the OVS function to create bridges, add ports to bridges, and add rules to simulate hub broadcasting characteristics.

Benefits of technology

It realizes the rapid and convenient simulation of hubs in the network shooting range, and improves the ability of network shooting range to simulate real network nodes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119865475A_ABST
    Figure CN119865475A_ABST
Patent Text Reader

Abstract

The invention discloses a method and system for simulating a hub in a network target range, and the method comprises the steps: providing a hub node in a node selection area for a user to arrange the topology of the network target range, inputting the name and the number of ports of the hub node when the user uses the hub node, and connecting the hub node with a network and a terminal node; storing model data of the hub in the network target range topology, wherein the model data comprises attribute information of the hub and a port of the hub; when the concentrator function is started, flow rule parameters are built and created, a network bridge is created according to the parameters, ports are added into the network bridge, and rules are added to simulate concentrator broadcast characteristics. According to the invention, hub nodes can be simulated in a network target range environment, and the hub nodes can be directly used in dragging and connecting modes like elements of other target ranges, so that the capability of simulating real network nodes in the network target range is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a method and a system for simulating a hub in a network target range, belonging to the technical field of network security. Background Art

[0002] A hub is a network device used to connect multiple network devices, usually in a local area network. The hub mainly provides two functions: data broadcasting and simplifying network topology. It receives data packets from a certain port and broadcasts them to all other ports. All devices connected to the hub can receive the same data packet.

[0003] OVS (Open vSwitch) is an open source virtual switch technology, mainly used for network connections in virtualized environments. It provides network communication for virtual machines and supports highly flexible network control and management. Its core functions include packet forwarding, traffic management, and virtual network creation and management.

[0004] In actual network applications, hubs are often used. The network range is implemented based on a virtual cloud platform, and general cloud platforms do not have the ability to directly simulate hubs. Therefore, the existing network range does not have the ability to directly simulate hubs, and it is impossible to build a topology that includes hubs, which limits the network range's ability to simulate real networks. Summary of the invention

[0005] Purpose of the invention: In view of the problems existing in the above-mentioned prior art, the purpose of the present invention is to provide a method and system for simulating a hub in a network target range, so as to quickly and conveniently simulate a hub in the network target range and improve the ability of the network target range to simulate real network nodes.

[0006] Technical solution: To achieve the above-mentioned invention object, the present invention adopts the following technical solution: In a first aspect, the present invention provides a method for simulating a hub in a network range, comprising the following steps: The hub node is provided in the node selection area for users to use when arranging the network range topology. When the user uses the hub node, the user needs to enter the hub node name and port number, and connect the hub node to the network and terminal nodes; Save the model data of the hub in the network range topology, including the hub and its port attribute information; When the hub function is enabled, traffic rule parameters are constructed to create a bridge based on the parameters, add ports to the bridge, and add rules to simulate the hub broadcast feature.

[0007] Furthermore, the hub serial number, topology number, hub number, connected network node number, hub node name and hub port quantity information are stored through the hub table; the hub number, hub port number, connected terminal number and the number and MAC address of the connected terminal port in the virtual environment are stored through the hub port table.

[0008] Furthermore, when the hub function is started, the number of the connected network node and the number of each hub port and the number of the connected terminal are obtained according to the hub number. According to the number of the connected network node and the number of the connected terminal, the identification of the network node in the virtual environment after startup and the identification of the terminal node in the virtual environment after startup are obtained respectively. According to the two identifications, the port list –server instruction is used on the virtual platform to find the number and MAC address of the port connected to the terminal and the hub in the virtual environment. According to the information obtained from the search, the number and MAC address of the connected terminal port in the virtual environment in the hub port table are set.

[0009] Furthermore, when the hub function is started, the hub serial number is obtained according to the hub number, and the bridge name is generated based on the hub serial number; the traffic rule creation parameters include the bridge name and the bridge port list, and the bridge port list includes the name and MAC address of each port; when the terminal is started, if the terminal is connected to the hub, the network information is queried through the hub information.

[0010] Further, the creating a bridge according to the parameters, adding the port to the bridge, and adding rules to simulate the hub broadcast characteristics include: Use the ovs-vsctl add-br command to create a bridge according to the bridge name in the input parameter; According to the information of each terminal port in the input parameters, use the command ovs-vsctl add-port to add all terminal ports to the bridge; Run the ovs-ofctl add-flow command to add rules for each terminal port, match traffic based on the current terminal port name and MAC address, and mirror forward traffic to other ports on the bridge.

[0011] Furthermore, the method also includes: when the hub function is disabled, constructing traffic rule deletion parameters, and deleting the corresponding bridge according to the parameters.

[0012] In a second aspect, the present invention provides a system for simulating a hub in a network range, comprising: The display module is used to provide the hub node in the node selection area for users to use when arranging the network range topology. When the user uses the hub node, he needs to enter the hub node name and port number, and connect the hub node to the network and terminal nodes; The data management module is used to save the model data of the hub in the network range topology, including the hub and its port attribute information; and when the hub function is started, the flow rule parameters are constructed and sent to the flow control module; Traffic control module, used to create a bridge according to parameters, add ports to the bridge, and add rules to simulate hub broadcast characteristics.

[0013] Furthermore, the data management module stores the hub serial number, topology number, hub number, connected network node number, hub node name and hub port quantity information through the hub table; stores the hub number, hub port number, connected terminal number and the number and MAC address of the connected terminal port in the virtual environment through the hub port table; and provides for adding a hub interface, deleting a hub interface, updating a hub interface, starting a hub interface, disabling a hub interface and querying a hub interface.

[0014] Further, the flow control module is implemented using the OVS flow table function, and provides an interface for creating a flow mirror rule and an interface for deleting a flow mirror rule; the input parameters of the flow mirror rule creation interface include a bridge name and a list of bridge ports, and a bridge is created using the command ovs-vsctl add-br according to the bridge name in the input parameters; according to each terminal port information in the input parameters, all terminal ports are added to the bridge using the command ovs-vsctl add-port; the command ovs-ofctl add-flow is used to add rules for each terminal port, and traffic is matched according to the current terminal port name and MAC address, and the mirror is forwarded to other ports on the bridge; the input parameters of the flow mirror rule deletion interface include a bridge name, and the corresponding bridge is deleted according to the input parameters.

[0015] In a third aspect, the present invention provides a computer program product, comprising a computer program, which, when executed by a processor, implements the steps of a method for simulating a hub in a network target range.

[0016] Beneficial effects: Compared with the prior art, the present invention has the following advantages: the present invention is based on the network elements and port elements of the virtual cloud platform, and with the OVS function, it can simulate the hub node in the network range environment, and can be used directly by dragging and connecting like other elements of the range, thereby improving the ability of the network range to simulate real network nodes. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 It is a schematic diagram of the logical effect of an embodiment of the present invention.

[0018] Figure 2Schematic diagram of the module relationship of an embodiment of the present invention.

[0019] Figure 3 This is an example diagram of the interface node selection area expansion design in an embodiment of the present invention.

[0020] Figure 4 This is an example diagram of the hub property setting interface design in an embodiment of the present invention.

[0021] Figure 5 This is an example diagram of hub node connections in an embodiment of the present invention. DETAILED DESCRIPTION

[0022] The technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings and specific embodiments.

[0023] A method for simulating a hub in a network range disclosed in an embodiment of the present invention mainly includes: providing a hub node in a node selection area for users to use when arranging the network range topology. When the user uses the hub node, the user needs to input the hub node name and the number of ports, and connect the hub node to the network and terminal nodes; saving the model data of the hub in the network range topology, including the hub and its port attribute information; when starting the hub function, constructing flow rule creation parameters, creating a bridge according to the parameters, adding the port to the bridge, and adding rules to simulate the hub broadcast characteristics.

[0024] The main effects of the embodiments of the present invention are as follows: Figure 1 As shown in the figure, a hub node is simulated in the topology, and the virtual machine nodes and the hub node are connected through lines. The virtual machines connected to the same hub use OVS to mirror the traffic they receive to other virtual machines.

[0025] The method for simulating a hub in a network range can be implemented by a system for simulating a hub in a network range, which is composed of a display module, a data management module, and a flow control module.

[0026] The display module is used to display and use the hub when arranging the topology. The hub node is provided in the node selection area for the user to use when arranging the network range topology. When the user uses the hub node, the user needs to enter the hub node name and port number, and connect the hub node to the network and terminal nodes.

[0027] The data management module is used to save the model data of the hub in the network range topology, and to build and create traffic rule parameters and send them to the traffic control module when starting the hub function.

[0028] The traffic control module is used to implement the traffic broadcast function when simulating a hub, wherein a bridge is created according to parameters, ports are added to the bridge, and rules are added to simulate the hub broadcast characteristics.

[0029] The relationship between modules is as follows Figure 2 As shown. The user arranges the topology and uses the hub node in the display module. The display module transmits the arrangement results to the data management module for storage. When the hub function is started, the data management module constructs the rule parameters and sends them to the flow control module to create flow rules to simulate the broadcast characteristics of the hub.

[0030] Specifically, the display module defines a set of pages and a series of interaction methods to implement the introduction of hub functions when arranging topologies. The page for drawing the simulation environment in the network range is divided into a node selection area and a topology drawing area. This embodiment adds the option of a hub node in the node selection area, such as Figure 3 .

[0031] When using a hub, drag the hub to a location in the topology drawing area, and then double-click the hub node to pop up the hub's property setting box, such as Figure 4 The main properties of a hub are the node name and the number of ports. The node name is the name of the hub node displayed in the topology, and the number of ports is the number of nodes that can be expanded and connected. Since the hub needs to be connected to at least one network, the number of ports needs to be greater than or equal to 2, that is, the hub node has at least two ports.

[0032] After setting the number of ports, you can connect the hub and other nodes. For example, if the number of ports is set to 5, the hub can access one network and four terminal nodes. Figure 5 At this time, the four terminals are equivalent to accessing a network at the same time, and the four terminals will receive the same traffic.

[0033] In this embodiment, the data management module provides two storage tables for storing the hub data model in the network topology. The storage tables include a hub table and a hub port table. The hub table is used to store the hub information created by the display module, including the hub serial number, topology number, hub number, connected network node number, hub node name, and number of hub ports, etc. The example structure is shown in Table 1. The hub port table is used to store the port information in the hub, including the hub number, hub port number, connected terminal number, and the number and MAC address of the connected terminal port in the virtual environment, etc. The example structure is shown in Table 2.

[0034] Table 1 Hub table Hub serial number Topology ID Hub ID The id of the connected network node in the topology Hub Node Name Number of hub ports 1 1 10001 network0001 Hub 1 4 2 1 10002 network0002 Hub 2 3

[0035] Table 2 Hub port table Hub ID The id of the hub port in the topology The id of the connected terminal port in the virtual environment The id of the connected terminal node in the topology MAC address of the connected terminal port in the virtual environment 10001 tap_10001001 tap_res_10001001 terminal0001 00:11:22:33:44:55 10001 tap_10001002 tap_res_10001002 terminal0002 00:11:22:33:44:66

[0036] The data management module provides 6 interfaces for hub management, including add hub interface, delete hub interface, update hub interface, start hub interface, disable hub interface, and query hub interface.

[0037] Table 3 Newly added hub interface input parameters Property name Data Types Remark Example topo_id String Topology ID 1 hub_id String Hub ID 10001 hub_name String Hub Name Hub 1 network_id String The network node id of the connection network0001 port_num number Number of Ports 4 ports List Hub Port List / -terminal_id String The id of the connected terminal node in the topology terminal0001 -port_id String The id of the connected terminal port in the topology tap_10001001

[0038] The input parameters of the newly added hub interface are shown in Table 3. The interface processing flow includes the following steps: S101: Input hub parameters, topology id is recorded as ${topo_id}, hub id is recorded as ${hub_id}, hub name is recorded as ${hub_name}, network node id connected to the hub is recorded as ${network_id}, number of ports is recorded as ${port_num}, hub port list is recorded as ${ports}, hub port list is an array, each element of which contains the connected terminal node id, recorded as ${terminal_id_index}, hub port id, recorded as ${port_id_index}.

[0039] S102: Look up the largest serial number in the hub table, record it as ${max_num}, then the serial number of the newly added hub is ${max_num}+1, and write ${max_num}+1, ${topo_id}, ${hub_id}, ${network_id}, ${hub_name}, and ${port_num} into the port information table.

[0040] S103: Write all the information in the parameter ports into the hub port information table. Take the port information from the ports list in turn, record the array subscript of each port as index, record the connected terminal node id as ${terminal_id_index}, and record the hub port id as ${port_id_index}. ${hub_id}, ${port_id_index}, and ${terminal_id_index} are written into the hub port information table.

[0041] The input parameter for deleting a hub interface is the hub ID, and the processing flow is: S201: According to the input hub id, recorded as ${hub_id}, delete the data with hub id ${hub_id} in the hub table. The statement used is: delete from hub table where hub id=${hub_id}.

[0042] S202: Delete the data whose hub id is ${hub_id} in the hub port table. The statement used is: delete from hub port table where hub id = ${hub_id}.

[0043] Table 4 Update Hub Interface Input Parameters Property name Data Types Remark topo_id String Topology ID hub_id String Hub ID hub_name String Hub Name network_id String The network node id of the connection port_num number Number of Ports ports List Hub Port List -terminal_id String The endpoint id of the connection -port_id String Hub port id

[0044] The input parameters of the updated hub interface are shown in Table 4. The processing flow is: first delete the old data according to the input ${hub_id}, and then execute the new logic of the newly added hub interface.

[0045] The input parameter of starting the hub interface is the hub id. The interface processing flow includes the following steps: S301: Record the input parameter hub id as ${hub_id}.

[0046] S302: Obtain the ID and MAC address of the terminal port connected to the hub in the virtual environment, and update each port information. Specifically including: S3021: Get the id of the network node connected to the hub from the hub table, using the statement: select the id of the connected network node in the topology where hub id=${hub_id} from the hub table, recorded as ${network_id}; according to the value of ${network_id}, query the data management table of the business system to obtain the identifier of the network node in the virtual environment after startup, recorded as ${network_res_id}.

[0047] S3022: Obtain the port information of the hub connection from the hub port table, using the statement: select the id of the hub port in the topology, the id of the connected terminal node in the topology where hub id=${hub_id} from the hub port table.

[0048] S3023: Since the hub may have multiple ports, take processing one port as an example, and record the value corresponding to one of the ports as ${port_id_index} and ${terminal_id_index}. According to the value of ${terminal_id_index}, query the data management table of the business system to obtain the identifier of the terminal node in the virtual environment after startup, and record it as ${terminal_res_id_index}; According to ${network_res_id} and ${terminal_res_id_index}, you can use the command to query the mac address and port id information of the port connected to the terminal and the hub in the virtual environment. Taking openstack as an example, the command is: openstack port list --server ${terminal_res_id_index} | grep ${network_res_id} In the execution result, record the ID as ${port_res_id_index} and the MAC Address as ${terminal_mac_address_index}.

[0049] S3024: Update the information of the hub port table, using the statement: update hub port table set the mac address of the connected terminal port in the virtual environment = ${terminal_mac_address_index}, the id of the connected terminal port in the virtual environment = ${port_res_id_index} where hub id = ${hub_id} and port id = ${port_id_index}.

[0050] S303: query the serial number of the hub id ${hub_id} from the hub table, record it as ${hub_num}, and the bridge name when creating the mirror rule is br_${hub_num}.

[0051] S304: Call the create mirror rule interface of the traffic control module, where the bridge name = br_${hub_num}, the taps list is the information of each port, the port name = ${port_res_id_index}, and the port mac address = ${terminal_mac_address_index}.

[0052] The input parameter of the deactivate hub interface is the hub id. The processing flow is: query the serial number corresponding to the hub according to the input ${hub_id}, and the statement used is select hub serial number where hub id=${hub_id} from hub table. Assuming that the queried hub serial number is ${hub_num}, the bridge name in the flow control module corresponding to the hub is br_${hub_num}. Call the delete mirror rule interface of the flow control module and input the parameter bridge name=br_${hub_num}.

[0053] The input parameter of the query hub interface is the hub id, and the output parameter is the connected network node id. The interface processing flow is: according to the input parameter ${hub_id}, query the hub table, and use the statement select connected network node id from hub table where hub_id=${hub_id}.

[0054] The traffic control module is used to implement traffic mirroring and forwarding, and provides the hub with the ability to simulate traffic broadcasting. This module is implemented using the OVS plus flow table function, and provides two external interfaces for creating and deleting traffic mirroring rules.

[0055] Table 5 Input parameters for creating mirroring rules Property name Data Types Remark br_name String Bridge Name taps List Bridge port list -tap_name String Port Name -mac_address Character transmission Port mac address

[0056] The input parameters for creating a mirroring rule interface are shown in Table 5. The interface processing flow includes the following steps: S401: Input parameters, the bridge name is recorded as ${br_name}, each port information on the bridge is stored in taps, each port name is recorded as ${tap_name_index}, and the port MAC address is recorded as ${mac_address_index}.

[0057] S402: Create a bridge according to the input bridge name br_name. The command used is as follows: sudo ovs-vsctl add-br ${br_name}.

[0058] S403: Add all ports on the hub to the bridge. According to the information of each port, the splicing command is as follows: sudo ovs-vsctl add-port ${br_name} ${tap_name_index}.

[0059] S404: Add rules to all ports. When simulating a hub, each virtual machine on the hub will mirror the traffic destined for the local machine and send a copy to other virtual machines on the hub, thereby simulating the broadcast characteristics of the hub. Assume that there are 3 ports on the hub at this time, the port name of port 1 is ${tap_name1}, and the port mac address is ${port_1_mac_address}; the port name of port 2 is ${tap_name2}, and the port mac address is ${port_2_mac_address}; the port name of port 3 is ${tap_name3}, and the port mac address is ${port_3_mac_address}; The rules for port 1 are constructed as follows: the traffic sent to port 1 is mirrored to ports 2 and 3; sudo ovs-ofctl add-flow ${br_name} "in_port=${tap_name1},eth_src=${port_1_mac_address},actions=output:${tap_name2},output:${tap_name3}" The rules for port 2 are constructed as follows: the traffic sent to port 2 is mirrored to port 1 and port 3; sudo ovs-ofctl add-flow ${br_name} "in_port=${tap_name2},eth_src=${port_2_mac_address},actions=output:${tap_name1},output:${tap_name3}" The rules for port 3 are as follows: the traffic sent to port 3 is mirrored to port 1 and port 2; sudo ovs-ofctl add-flow ${br_name} "in_port=${tap_name3},eth_src=${port_3_mac_address},actions=output:${tap_name1},output:${tap_name2}" The input parameter of the interface for deleting mirroring rules is the bridge name. The entered bridge name is recorded as ${br_name}. To delete the bridge, use the following command: sudo ovs-vsctl del-br ${br_name}.

[0060] It should be noted that after the hub node is introduced in this embodiment, the original topology drawing and scene terminal startup process that does not support hub simulation needs to be further adjusted.

[0061] Specifically, in the topology drawing process, the operation includes the following steps: S501: Analyze the currently executed drawing action. In this embodiment, the original shooting range business logic is added with the actions of adding a hub and deleting a hub.

[0062] S502: Determine whether it is an action of adding a hub, if so, proceed to step S504, otherwise proceed to step S503.

[0063] S503: Determine whether it is an action to delete the hub, if so, proceed to step S505, otherwise proceed to step S506.

[0064] S504: Call the newly added hub interface. The parameters that need to be collected are the current topology id, recorded as ${topo_id}, the id of the hub in the topology, recorded as ${hub_id}, the name of the hub in the topology, recorded as ${hub_name}, the id of the network node connected to the hub in the topology, recorded as ${network_id}, and the number of ports configured on the hub, recorded as ${port_num}. It is also necessary to collect information on all terminals connected to the current hub. The node id of each terminal in the topology is recorded as ${terminal_id}, and the port id of the connected terminal in the topology is recorded as ${port_id}. Use these parameters to call the newly added hub interface of the data management module; end.

[0065] S505: calling the hub deletion interface, using the ID of the deleted hub as a parameter, and calling the hub deletion interface of the data management module; end.

[0066] S506: Execute the original logic in the shooting range business.

[0067] Specifically, when the scene is started, the terminal startup process includes the following steps: S601: When starting the terminal, because the terminal may be connected to a hub, the network information is queried through the hub information. Try to obtain an unprocessed node from the nodes connected to the terminal. If the acquisition fails, go to step S605; if the acquisition succeeds, go to step S602.

[0068] S602: If it is a hub node, proceed to step S603; otherwise, proceed to step S606.

[0069] S603: According to the connected node ID, that is, the ID of the hub, query the network node ID connected to the hub through the query hub interface of the data management module; proceed to step S604.

[0070] S604: Query network information according to the network ID and go to step S601.

[0071] S605: After analyzing all nodes, collect all network information from the results, and execute the subsequent process of creating a terminal; end.

[0072] S606: If the connected node is not a hub node, the original logic is executed; and the process proceeds to step S601.

[0073] The embodiment of the present invention also discloses a computer program product, including a computer program, which implements the steps of the method of simulating a hub in a network range when executed by a processor. The program code for implementing the method of the present invention can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer or other programmable data processing device, so that the steps of the method of the present invention are implemented when the program code is executed by the processor or controller. The program code can be executed entirely on the machine, partially on the machine, partially on the machine as an independent software package and partially on a remote machine, or entirely on a remote machine or server. What is not described in detail in the present invention is a well-known technology for those skilled in the art.

Claims

1. A method for simulating a hub in a network range, characterized in that: The following steps are involved: The hub node is provided in the node selection area for users to use when arranging the network range topology. When the user uses the hub node, the user needs to enter the hub node name and port number, and connect the hub node to the network and terminal nodes; Save the model data of the hub in the network range topology, including the hub and its port attribute information; When the hub function is enabled, traffic rule parameters are constructed to create a bridge based on the parameters, add ports to the bridge, and add rules to simulate the hub broadcast feature.

2. A method for simulating a hub in a network range according to claim 1, characterized in that: The hub table stores the hub serial number, topology number, hub number, connected network node number, hub node name and hub port quantity information; the hub port table stores the hub number, hub port number, connected terminal number and the number and MAC address of the connected terminal port in the virtual environment.

3. A method for simulating a hub in a network range according to claim 2, characterized in that: When starting the hub function, the number of the connected network node and the number of each hub port and the number of the connected terminal are obtained according to the hub number. According to the number of the connected network node and the number of the connected terminal, the identification of the network node in the virtual environment after startup and the identification of the terminal node in the virtual environment after startup are obtained respectively. According to the two identifications, the port list –server command is used on the virtual platform to find the number and MAC address of the port connected to the terminal and the hub in the virtual environment. According to the information obtained from the search, the number and MAC address of the connected terminal port in the virtual environment in the hub port table are set.

4. A method for simulating a hub in a network range according to claim 1, characterized in that: When starting the hub function, the hub serial number is obtained according to the hub number, and the bridge name is generated based on the hub serial number; the traffic rule creation parameters include the bridge name and the bridge port list, and the bridge port list includes the name and MAC address of each port; when starting the terminal, if the terminal is connected to the hub, the network information is queried through the hub information.

5. A method for simulating a hub in a network range according to claim 1, characterized in that: The steps of creating a bridge based on parameters, adding ports to the bridge, and adding rules to simulate hub broadcast characteristics include: Use the ovs-vsctl add-br command to create a bridge according to the bridge name in the input parameter; According to the information of each terminal port in the input parameters, use the command ovs-vsctl add-port to add all terminal ports to the bridge; Run the ovs-ofctl add-flow command to add rules for each terminal port, match traffic based on the current terminal port name and MAC address, and mirror forward traffic to other ports on the bridge.

6. A method for simulating a hub in a network range according to claim 1, characterized in that: Also includes: When the hub function is disabled, the traffic rule parameters for deletion are constructed and the corresponding bridges are deleted according to the parameters.

7. A system for simulating a hub in a network range, characterized in that: include: The display module is used to provide the hub node in the node selection area for users to use when arranging the network range topology. When the user uses the hub node, he needs to enter the hub node name and port number, and connect the hub node to the network and terminal nodes; The data management module is used to save the model data of the hub in the network range topology, including the hub and its port attribute information; and when the hub function is started, the flow rule parameters are constructed and sent to the flow control module; Traffic control module, used to create a bridge according to parameters, add ports to the bridge, and add rules to simulate hub broadcast characteristics.

8. A system for simulating a hub in a network range according to claim 7, characterized in that: The data management module stores the hub serial number, topology number, hub number, connected network node number, hub node name and hub port quantity information through the hub table; stores the hub number, hub port number, connected terminal number and the number and MAC address of the connected terminal port in the virtual environment through the hub port table; and provides the functions of adding a hub interface, deleting a hub interface, updating a hub interface, starting a hub interface, disabling a hub interface and querying a hub interface.

9. A system for simulating a hub in a network range according to claim 7, characterized in that: The flow control module is implemented using the OVS flow table function, and provides an interface for creating a flow mirror rule and an interface for deleting a flow mirror rule; the input parameters of the flow mirror rule creation interface include a bridge name and a list of bridge ports, and a bridge is created using the command ovs-vsctl add-br according to the bridge name in the input parameters; according to each terminal port information in the input parameters, all terminal ports are added to the bridge using the command ovs-vsctl add-port; the command ovs-ofctladd-flow is used to add rules for each terminal port, match traffic according to the current terminal port name and MAC address, and forward the mirror to other ports on the bridge; The input parameters of the interface for deleting traffic mirroring rules include a bridge name, and the corresponding bridge is deleted according to the input parameters.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of a method for simulating a hub in a network range according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Synchronous network of superspeed and non-superspeed usb devices

    CN102439532A

  • Network service application and customer-aware virtualized network function placement

    CN108259216A

  • Construction method and device of target 5G security network of target range, terminal and medium

    CN115334698A

  • Method and device for replacing Linux virtual machine of network target range with container

    CN115834410A