Port connection method and device for network equipment

By turning off specific functions of network devices and using ACL redirection, port mirroring or VLAN flooding, the high cost problem of traditional physical switches is solved, and the low-cost port connectivity effect is achieved.

CN113839893BActive Publication Date: 2025-09-02ZTE CORP
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202010591396.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-24
Publication Date
2025-09-02
Estimated Expiration
2040-06-24

AI Technical Summary

Technical Problem

Traditional physical switches use optical path hardware to configure ports to connect to high costs.

Method used

By turning off the MAC address learning, VLAN checking, ACL protocol message upload, unknown unicast/multicast/broadcast speed limit suppression function and layer three/tunnel forwarding function of network equipment, and configure port communication using ACL redirection, port mirroring or VLAN flooding.

Benefits of technology

It realizes port connectivity without optical hardware, reducing the cost of automated test networking.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113839893B_ABST
    Figure CN113839893B_ABST
Patent Text Reader

Abstract

An embodiment of the present invention provides a port connectivity method and device for a network device, wherein the method includes: receiving a connectivity instruction for configuring a first port and a second port of a network device to be interconnected; disabling a MAC address learning function, a VLAN checking function, and an ACL protocol message uploading function of the network device, disabling the unknown unicast, multicast, and broadcast rate limit suppression functions of the port, and disabling the three-layer and tunnel forwarding functions of the network device; and interconnecting the first port and the second port according to the connectivity instruction. This can solve the problem in the related art that a physical switch uses optical path hardware to configure two ports, resulting in a high cost for connecting the two ports. The two ports can be connected without using management hardware, thereby achieving the effect of reducing costs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of communications, and in particular to a port connectivity method and device for a network device. Background Art

[0002] Generally, traditional physical switches are used for automatic network connection testing. By configuring the switch, all packets between the two ports can be passed through, creating the effect of a single transmission line between the two ports. This is achieved using an optical path matrix, including:

[0003] Configure a line between two ports. The switch hardware connects these two ports through an optical matrix, allowing all packets to pass directly through the two ports. However, physical switches use optical hardware to achieve this automatic connection. As a result, optical physical switches are very expensive, resulting in high networking costs when physical switches are required for automated testing. Summary of the Invention

[0004] The embodiments of the present invention provide a port connection method and apparatus for a network device, so as to at least solve the problem in the related art that a physical switch uses optical path hardware to configure two ports, resulting in high cost for connecting the two ports.

[0005] According to one embodiment of the present invention, a port connectivity method for a network device is provided, comprising:

[0006] receiving a connection instruction for configuring a first port and a second port of a physical switch to be connected to each other;

[0007] Disable the media access control MAC address learning function, virtual local area network VLAN checking function, access control list ACL protocol message sending function of the physical switch, disable the unknown unicast, multicast, and broadcast rate limit suppression function of the port, and disable the three-layer and tunnel forwarding functions of the network equipment;

[0008] The first port and the second port are connected to each other according to the connection instruction.

[0009] In an exemplary embodiment, connecting the first port and the second port to each other according to the connection instruction includes one of the following:

[0010] Configuring the first port and the second port by means of ACL redirection so that the first port and the second port are connected to each other;

[0011] Configuring the first port and the second port by means of port mirroring so that the first port and the second port are interconnected;

[0012] The first port and the second port are configured by VLAN flooding so that the first port and the second port are connected to each other.

[0013] In an exemplary embodiment, configuring the first port and the second port by means of ACL redirection includes:

[0014] Redirecting all incoming messages from the first port to the second port through ACL;

[0015] All incoming messages of the second port are redirected to the first port through ACL.

[0016] In an exemplary embodiment, configuring the first port and the second port by port mirroring includes:

[0017] Mirroring all incoming messages from the first port to the second port;

[0018] mirroring all incoming messages of the second port to the first port;

[0019] Incoming message forwarding and discarding are configured on the first port and the second port respectively.

[0020] In an exemplary embodiment, configuring the first port and the second port by VLAN flooding includes:

[0021] The first port and the second port are configured in the same VLAN.

[0022] According to another embodiment of the present invention, there is further provided a port communication device of a network device, comprising:

[0023] A receiving module, configured to receive a connection instruction for configuring a first port and a second port of a network device to be connected to each other;

[0024] A shutdown module is used to disable the media access control MAC address learning function, virtual local area network VLAN checking function, access control list ACL protocol message sending function of the network device, disable the unknown unicast, multicast, and broadcast rate limit suppression function of the port, and disable the three-layer and tunnel forwarding functions of the network device;

[0025] A communication module is configured to connect the first port and the second port to each other according to the communication instruction.

[0026] In an exemplary embodiment, the connectivity module includes:

[0027] A first configuration submodule, configured to configure the first port and the second port by means of ACL redirection so that the first port and the second port are interconnected;

[0028] A second configuration submodule is configured to configure the first port and the second port by means of port mirroring so that the first port and the second port are interconnected;

[0029] The third configuration submodule is configured to configure the first port and the second port by means of VLAN flooding, so that the first port and the second port are interconnected.

[0030] In an exemplary embodiment, the first configuration submodule includes:

[0031] A first redirection unit, configured to redirect all incoming messages of the first port to the second port through an ACL;

[0032] The second redirecting unit is configured to redirect all incoming messages of the second port to the first port through an ACL.

[0033] In an exemplary embodiment, the second configuration submodule includes:

[0034] A first mirroring unit, configured to mirror all incoming messages of the first port to the second port;

[0035] A second mirroring unit, configured to mirror all incoming messages of the second port to the first port;

[0036] The first configuration unit is configured to configure forwarding and discarding of incoming messages on the first port and the second port respectively.

[0037] In an exemplary embodiment, the third configuration submodule includes:

[0038] The second configuration unit is configured to configure the first port and the second port into the same VLAN.

[0039] According to yet another embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored. The computer program is configured to execute the steps of any one of the above method embodiments when run.

[0040] According to another embodiment of the present invention, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the steps in any one of the above method embodiments.

[0041] Through the present invention, a connection instruction for configuring a first port and a second port of a network device to be connected to each other is received; the media access control MAC address learning function, the virtual local area network VLAN checking function, and the access control list ACL protocol message sending function of the network device are turned off, the unknown unicast, multicast, and broadcast rate limit suppression functions of the port are turned off, and the three-layer and tunnel forwarding functions of the network device are turned off; and the first port and the second port are connected to each other according to the connection instruction. This can solve the problem in the related art that a physical switch uses optical path hardware to configure two ports, resulting in a high cost for connecting the two ports. The two ports can be connected without using management hardware, thereby achieving the effect of reducing costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 1 is a hardware structure block diagram of a mobile terminal for a port connection method of a network device according to an embodiment of the present invention;

[0043] Figure 2 is a flow chart of a port connectivity method for a network device according to an embodiment of the present invention;

[0044] Figure 3 is a flow chart of a method for implementing a physical switch using existing network equipment according to this embodiment;

[0045] Figure 4 This is a schematic diagram of the connection between ports according to this embodiment. Figure 1 ;

[0046] Figure 5 This is a schematic diagram of the connection between ports according to this embodiment. Figure 2 ;

[0047] Figure 6 This is a schematic diagram of the connection between ports according to this embodiment. Figure 3 ;

[0048] Figure 7 FIG. 4 is a block diagram of a port communication device of a network device according to this embodiment. DETAILED DESCRIPTION

[0049] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings and in combination with embodiments.

[0050] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0051] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1FIG. 1 is a hardware structure diagram of a mobile terminal of a method for connecting ports of a network device according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown) a processor 102 (the processor 102 may include but is not limited to a microprocessor MCU or a programmable logic device FPGA and other processing devices) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It will be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown.

[0052] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the port connectivity method of the network device in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, implementing the above-mentioned method. The memory 104 may include a high-speed random access memory and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely located relative to the processor 102, and these remote memories may be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0053] The transmission device 106 is used to receive or send data via a network. Specific examples of the aforementioned network may include a wireless network provided by the mobile terminal's communications provider. In one embodiment, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In one embodiment, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0054] In this embodiment, a port connection method for a network device running on the above mobile terminal or network architecture is provided.

[0055] Figure 2 FIG. 1 is a flow chart of a port connectivity method for a network device according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:

[0056] Step S202, receiving a connection instruction for configuring a first port and a second port of a network device to connect to each other;

[0057] Step S204: disable the MAC address learning function, VLAN checking function, and ACL protocol message sending function of the network device, disable the unknown unicast, multicast, and broadcast rate limit suppression functions of the port, and disable the three-layer and tunnel forwarding functions of the network device;

[0058] Step S206: Connect the first port and the second port to each other according to the connection instruction.

[0059] Through the above steps S202 to S206, a connection instruction for configuring the first port and the second port of the network device to be connected to each other is received; the MAC address learning function, VLAN checking function, and ACL protocol message sending function of the network device are turned off, the unknown unicast, multicast, and broadcast rate limit suppression functions of the port are turned off, and the three-layer and tunnel forwarding functions of the network device are turned off; the first port and the second port are connected to each other according to the connection instruction, which can solve the problem in the related art that the physical switch uses optical path hardware to configure two ports, resulting in a high cost for connecting the two ports. The two ports can be connected without using management hardware, thereby achieving the effect of reducing costs.

[0060] In an exemplary embodiment, the above step S206 may specifically include:

[0061] Configuring the first port and the second port by means of ACL redirection so that the first port and the second port are interconnected, and further redirecting all incoming packets of the first port to the second port by means of ACL, and redirecting all incoming packets of the second port to the first port by means of ACL;

[0062] The first port and the second port are configured to be interconnected by port mirroring, and all incoming packets from the first port are mirrored to the second port, and all incoming packets from the second port are mirrored to the first port. Incoming packet forwarding and discarding are configured on the first port and the second port, respectively, to facilitate discarding original packets.

[0063] The first port and the second port are configured by VLAN flooding so that the first port and the second port are interconnected. Furthermore, the first port and the second port are configured in the same VLAN so that the first port and the second port are connected, and packets input from the first port are output from the second port, and packets input from the second port are output from the first port.

[0064] This embodiment utilizes existing network devices to implement a physical switch. By configuring the chip in an existing Ethernet switch, it automatically connects ports, ensuring the smooth flow of all packets, achieving the same effect as a physical switch and reducing the networking costs of automated testing. Specifically, it utilizes ACLs, mirroring, and VLAN flooding to ensure lossless transmission of all packets between two ports.

[0065] First, disable the device's MAC address learning function, VLAN check function, all ACL protocol message sending functions, disable the port's unknown unicast, multicast, and broadcast rate limit suppression functions, and disable the device's Layer 3, MPLS, VXLAN, and various tunnel forwarding functions.

[0066] Disabling MAC address learning can prevent MAC address learning from interfering with the direction of packets. Disabling the Virtual Local Area Network (VLAN) check function can prevent the port from discarding packets from VLANs that are not to which the port belongs. Disabling the sending of Access Control Lists (ACL) protocol packets can prevent the device from capturing protocol packets and sending them to the CPU. Disabling the port's unknown unicast, multicast, and broadcast rate limit suppression function can prevent unknown unicast, multicast, and broadcast packets from being discarded due to rate limit suppression.

[0067] Disabling the device's Layer 3, MPLS, Virtual eXtensible Local Area Network (VXLAN), and various tunnel forwarding functions can prevent such packets from being interfered with by Layer 3, Multi-Protocol Label Switching (MPLS), VXLAN, various tunnel forwarding mechanisms, and other forwarding mechanisms.

[0068] In the first case, use ACL redirection: configure the two ports as ports that need to be connected, and configure ACL to redirect all incoming packets of the two ports to the outgoing direction of the other port.

[0069] By using ACL, all incoming packets of a port can be redirected to the outgoing direction of another port. Similarly, all incoming packets of another port can be redirected to the outgoing direction of this port. Thus, all packets of the two ports can be directly connected.

[0070] In the second case, use port mirroring: configure two ports as ports that need to be connected, mirror all incoming packets of each port to the outgoing direction of the other port, and configure the two ports to forward and discard incoming packets.

[0071] Port mirroring can mirror all incoming packets from a port to the outgoing packets from another port. Similarly, it can mirror all incoming packets from another port to the outgoing packets from this port. This allows all packets from both ports to flow directly through.

[0072] The mirroring method requires discarding the original message of the port. Otherwise, the original message of the port may be forwarded through the chip to another port, resulting in a multi-packet error in which a message is forwarded and mirrored at the same time.

[0073] The third case uses VLAN flooding: configure two ports as ports that need to be connected, configure the two ports in the same VLAN, and disable VLAN checking for this VLAN.

[0074] Through the configuration of this embodiment, all incoming packets to a port can be flooded in this VLAN, thereby reaching another port without loss. When configuring using VLANs, it is important to note that a pair of ports configured to be connected must occupy a dedicated VLAN, and other ports must not conflict with this VLAN configuration, otherwise the error of packet broadcasting will occur.

[0075] By simply configuring the existing network equipment's ACL, mirroring, and VLAN functions and performing some configuration adjustments, you can achieve automatic connection between two ports, just like connecting physical switches using physical optical paths. This method can significantly reduce equipment costs for automated test networking.

[0076] Figure 3 FIG. 1 is a flow chart of a method for implementing a physical switch using existing network equipment according to this embodiment. Figure 3 Shown, including:

[0077] Step S301, configure two ports to communicate with each other;

[0078] Step S302: Disable the device's MAC address learning function, VLAN check function, all ACL protocol message sending functions, disable the port's unknown unicast, multicast, and broadcast rate limit suppression functions, and disable the device's Layer 3, MPLS, VXLAN, and other tunnel forwarding functions.

[0079] Step S303: Configuring the two ports to communicate with each other through ACL / port mirroring / VLAN flooding.

[0080] Step S304: Complete all configuration processes.

[0081] The embodiment is described below by taking the first port as port A and the second port as port B as an example.

[0082] On the device, you need to directly connect port A and port B to achieve automatic connection. First, disable the device's MAC address learning, VLAN checking, and all ACL protocol message forwarding functions. Disable the port's unknown unicast, multicast, and broadcast rate limit suppression functions. Also disable the device's Layer 3, MPLS, VXLAN, and other tunnel forwarding functions.

[0083] Example 1

[0084] Using ACL redirection to achieve, Figure 4 This is a schematic diagram of the connection between ports according to this embodiment. Figure 1 ,like Figure 4 Shown, including:

[0085] 1. Configure direct connection between port A and port B.

[0086] 2. Configure ACL redirection to match all incoming packets from port A and redirect them to port B.

[0087] 3. Configure ACL redirection to match all incoming packets from port B and redirect them to port A.

[0088] 4. After the configuration is completed, lossless message transmission can be achieved between ports A and B.

[0089] Example 2

[0090] Using port mirroring, Figure 5 This is a schematic diagram of the connection between ports according to this embodiment. Figure 2 ,like Figure 5 Shown, including:

[0091] 1. Configure direct connection between port A and port B.

[0092] 2. Configure port mirroring, with the mirror source being all incoming packets from port A and the mirror destination being port B.

[0093] 3. Configure port mirroring, with the mirror source being all incoming packets from port B and the mirror destination being port A.

[0094] 4. After the configuration is completed, lossless message transmission can be achieved between ports A and B.

[0095] Example 3

[0096] Utilize VLAN flooding to achieve, Figure 6 This is a schematic diagram of the connection between ports according to this embodiment. Figure 3 ,like Figure 6 Shown, including:

[0097] 1. Configure direct connection between port A and port B.

[0098] 2. Configure port A and port B to VLAN 100.

[0099] 3. Disable VLAN check for VLAN 100.

[0100] 4. After the configuration is completed, lossless message transmission can be achieved between ports A and B.

[0101] As can be seen from the above technical solution, compared with the typical physical switch implementation, this method eliminates the need for new network equipment. Existing network equipment can be directly configured to achieve automatic physical switch connection. The configuration method is also relatively simple, easy to manage and program. This method eliminates the need to purchase expensive physical switches for optical network implementations for automated test networking, significantly reducing the cost of automated test networking.

[0102] According to another embodiment of the present invention, a port connection device for a network device is provided. Figure 7 FIG. 1 is a block diagram of a port connection device of a physical switch according to this embodiment, as shown in FIG. Figure 7 Shown, including:

[0103] A receiving module 72 is configured to receive a connection instruction for configuring the first port and the second port of the network device to be connected to each other;

[0104] A shutdown module 74 is used to disable the MAC address learning function, VLAN checking function, ACL protocol message sending function of the network device, disable the unknown unicast, multicast, and broadcast rate limit suppression function of the port, and disable the three-layer and tunnel forwarding functions of the network device;

[0105] The communication module 76 is configured to connect the first port and the second port to each other according to the communication instruction.

[0106] In an exemplary embodiment, the communication module 76 includes:

[0107] A first configuration submodule, configured to configure the first port and the second port by means of ACL redirection so that the first port and the second port are interconnected;

[0108] A second configuration submodule is configured to configure the first port and the second port by means of port mirroring so that the first port and the second port are interconnected;

[0109] The third configuration submodule is configured to configure the first port and the second port by means of VLAN flooding, so that the first port and the second port are interconnected.

[0110] In an exemplary embodiment, the first configuration submodule includes:

[0111] A first redirection unit, configured to redirect all incoming messages of the first port to the second port through an ACL;

[0112] The second redirecting unit is configured to redirect all incoming messages of the second port to the first port through an ACL.

[0113] In an exemplary embodiment, the second configuration submodule includes:

[0114] A first mirroring unit, configured to mirror all incoming messages of the first port to the second port;

[0115] A second mirroring unit, configured to mirror all incoming messages of the second port to the first port;

[0116] The first configuration unit is configured to configure forwarding and discarding of incoming messages on the first port and the second port respectively.

[0117] In an exemplary embodiment, the third configuration submodule includes:

[0118] The second configuration unit is configured to configure the first port and the second port into the same VLAN.

[0119] It should be noted that the above modules can be implemented through software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0120] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps of any one of the above method embodiments when running.

[0121] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.

[0122] An embodiment of the present invention further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0123] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0124] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail here.

[0125] Obviously, those skilled in the art will appreciate that the various modules or steps of the present invention described above can be implemented using a general-purpose computing device, can be centralized on a single computing device, or can be distributed across a network of multiple computing devices. They can be implemented using program code executable by the computing device, and thus, can be stored in a storage device and executed by the computing device. In some cases, the steps shown or described herein can be performed in a different order than that shown, or can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.

[0126] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the principles of the present invention are intended to be within the scope of protection of the present invention.

Claims

1. A port connection method for a network device, characterized in that: include: receiving a connection instruction for configuring a first port and a second port of a network device to be connected to each other; Disable the media access control MAC address learning function, virtual local area network VLAN checking function and access control list ACL protocol message sending function of the network device, disable the unknown unicast, multicast and broadcast rate limit suppression function of the port, and disable the three-layer and tunnel forwarding functions of the network device; Connecting the first port and the second port to each other according to the connection instruction includes one of the following: Configuring the first port and the second port by means of ACL redirection so that the first port and the second port are connected to each other; Configuring the first port and the second port by means of port mirroring so that the first port and the second port are interconnected; The first port and the second port are configured by VLAN flooding so that the first port and the second port are connected to each other.

2. The method according to claim 1, characterized in that Configuring the first port and the second port by using ACL redirection includes: Redirecting all incoming messages from the first port to the second port through ACL; All incoming messages of the second port are redirected to the first port through ACL.

3. The method according to claim 1, characterized in that Configuring the first port and the second port by means of port mirroring includes: Mirroring all incoming messages from the first port to the second port; mirroring all incoming messages of the second port to the first port; Incoming message forwarding and discarding are configured on the first port and the second port respectively.

4. The method according to claim 1, wherein Configuring the first port and the second port by means of VLAN flooding includes: The first port and the second port are configured in the same VLAN.

5. A port connection device for a network device, characterized in that: include: A receiving module, configured to receive a connection instruction for configuring a first port and a second port of a network device to be connected to each other; A shutdown module is used to disable the media access control MAC address learning function, virtual local area network VLAN checking function, access control list ACL protocol message sending function of the network device, disable the unknown unicast, multicast, and broadcast rate limit suppression function of the port, and disable the three-layer and tunnel forwarding functions of the network device; a connection module, configured to connect the first port and the second port to each other according to the connection instruction; The connectivity module includes one of the following: A first configuration submodule, configured to configure the first port and the second port by means of ACL redirection so that the first port and the second port are interconnected; A second configuration submodule is configured to configure the first port and the second port by means of port mirroring so that the first port and the second port are interconnected; The third configuration submodule is configured to configure the first port and the second port by means of VLAN flooding, so that the first port and the second port are interconnected.

6. The device according to claim 5, characterized in that The first configuration submodule includes: A first redirecting unit, configured to redirect all incoming messages of the first port to the second port through an ACL; The second redirecting unit is configured to redirect all incoming messages of the second port to the first port through an ACL.

7. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 4 when executed.

8. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Ethernet switch batch whole machine test method and system

    CN107204893A