CN110247851B - Information updating method and device in three-layer switch, three-layer switch and medium - Google Patents

Information updating method and device in three-layer switch, three-layer switch and medium Download PDF

Info

Publication number
CN110247851B
CN110247851B CN201910576358.1A CN201910576358A CN110247851B CN 110247851 B CN110247851 B CN 110247851B CN 201910576358 A CN201910576358 A CN 201910576358A CN 110247851 B CN110247851 B CN 110247851B
Authority
CN
China
Prior art keywords
arp
switch
forwarding
port
layer switch
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910576358.1A
Other languages
Chinese (zh)
Other versions
CN110247851A (en
Inventor
王小军
李广鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Armyfly Technology Co Ltd
Original Assignee
Beijing Armyfly Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Armyfly Technology Co Ltd filed Critical Beijing Armyfly Technology Co Ltd
Priority to CN201910576358.1A priority Critical patent/CN110247851B/en
Publication of CN110247851A publication Critical patent/CN110247851A/en
Application granted granted Critical
Publication of CN110247851B publication Critical patent/CN110247851B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/28Routing or path finding of packets in data switching networks using route fault recovery

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Small-Scale Networks (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the invention discloses an information updating method and device in a three-layer switch, the three-layer switch and a storage medium. The method comprises the following steps: when the switching condition of a spanning tree protocol link is detected to be met, a first switch port to be blocked is obtained; acquiring network positioning information of a neighbor terminal of a three-layer switch according to a target ARP associated table item matched with a first switch port obtained by learning; executing the switching operation of the spanning tree protocol link and deleting the target ARP associated table entry; and constructing an ARP request message for network forwarding according to the network positioning information of the neighbor terminal so as to trigger the three-layer switch to learn new ARP associated table entries aiming at each neighbor terminal. By the technical scheme of the embodiment of the invention, the performance of the three-layer switch in the spanning tree protocol link switching process is optimized, and the switching pressure on the CPU of the three-layer switch is reduced.

Description

Information updating method and device in three-layer switch, three-layer switch and medium
Technical Field
The embodiment of the invention relates to a forwarding processing technology of a three-layer switch, in particular to an information updating method and device in the three-layer switch, the three-layer switch and a storage medium.
Background
The Spanning Tree Protocol (STP), a communication Protocol working in the open system interconnection network model, is basically applied to prevent redundant links of a switch from generating loops to avoid broadcast storms. MSTP (multiple spanning tree protocol) is commonly used in spanning tree protocols to provide fast switching of links in a ring network.
As shown in fig. 1a, the PC1 (terminal 1), the PC2 (terminal 2), the Switch a, the Switch B, the Switch C, and the Switch D collectively form a multiple spanning tree Region (MST Region) to communicate with other networks (networks), when the Region is used for transmitting three-layer data, the gateway of the terminal 1 is the Switch C, and the Switch C learns ARP (Address Resolution Protocol) information of the PC1 and the PC2 and forwards the three-layer data sent by the PC1 according to the routing table. When PC1 sends three layers of data to PC2, the ARP table entry learned by Switch C points to Switch A, and the three layers of data are sent to PC2 according to the path of PC1- > Switch C- > Switch A- > Switch B- > Switch D- > PC 2; when a link directly connected between Switch a and Switch B fails, the spanning tree protocol switches the link, and changes the port state between Switch C and Switch D from block (blocking) to forwarding (forwarding), at which time, the three layers of data are forwarded according to the path of PC1- > Switch C- > Switch D- > PC 2.
In the prior art, in the process of implementing link switching, Switch C has two working modes: one is fast mode in which the ARP information that needs to be updated on Switch C is deleted directly, and the other is normal mode in which the ARP information that needs to be updated on Switch C is aged quickly. Both of the two methods are to directly delete the MAC (Media Access Control) information. After the ARP information and the MAC information are processed, the Switch C receives the three-layer data pointing to the PC2 and then directly sends the three-layer data to a CPU (Central Processing Unit) of the Switch C to perform software forwarding Processing, sends out an ARP request message, and after ARP learning is completed, updates the ARP information of the PC2 to a port between the Switch C and the Switch D, and then sends the three-layer data of the PC2 to the CPU of the Switch C, but performs forwarding of the Switch chip according to the ARP information.
The inventor discovers that in the process of implementing the invention: after the switching of the spanning tree protocol link based on the three-layer data is completed, a large impact is generated on the CPU in the updating process of the ARP information, and in addition, for a switching mode in which the ARP information is not directly deleted, the packet is seriously lost due to an incorrect forwarding path, and the performance of the switch in the whole switching process is very poor.
Disclosure of Invention
Embodiments of the present invention provide an information updating method and apparatus in a three-layer switch, and a storage medium, so as to optimize performance of the three-layer switch in a spanning tree protocol link switching process and reduce switching pressure on a CPU of the three-layer switch.
In a first aspect, an embodiment of the present invention provides an information updating method in a three-layer switch, where the method includes:
when the switching condition of a spanning tree protocol link is detected to be met, a first switch port to be blocked is obtained;
acquiring network positioning information of at least one neighbor terminal of the three-layer switch according to at least one target ARP associated table item matched with the first switch port, wherein the network positioning information comprises: an internet protocol address and a virtual local area network identifier;
executing the switching operation of the spanning tree protocol link and deleting the at least one target ARP associated table entry;
and constructing an ARP request message for network forwarding according to the network positioning information of the at least one neighbor terminal so as to trigger the three-layer switch to learn new ARP associated table entries for each neighbor terminal.
In a second aspect, an embodiment of the present invention further provides an information updating apparatus in a three-layer switch, where the apparatus includes:
the device comprises a blocking port acquisition module, a blocking port acquisition module and a blocking port acquisition module, wherein the blocking port acquisition module is used for acquiring a first switch port to be blocked when the switching condition of a spanning tree protocol link is detected to be met;
a network positioning information obtaining module, configured to obtain, according to at least one target ARP associated entry that is obtained by learning and matches with the first switch port, network positioning information of at least one neighbor terminal of the three-layer switch, where the network positioning information includes: an internet protocol address and a virtual local area network identifier;
a target ARP associated table item deleting module, configured to execute a switching operation of the spanning tree protocol link and delete the at least one target ARP associated table item;
and the ARP request message forwarding module is used for constructing an ARP request message according to the network positioning information of the at least one neighbor terminal to carry out network forwarding so as to trigger the three-layer switch to carry out the learning of new ARP associated table items aiming at each neighbor terminal.
In a third aspect, an embodiment of the present invention further provides a three-layer switch, where the three-layer switch includes:
one or more processors;
storage means for storing one or more programs;
when the one or more programs are executed by the one or more processors, the one or more processors implement the information updating method in the three-layer switch according to any embodiment of the present invention.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements an information updating method in a three-layer switch according to any embodiment of the present invention.
According to the technical scheme of the embodiment of the invention, when the switching condition of the spanning tree protocol link is detected to be met, the network positioning information corresponding to at least one neighbor terminal of the three-layer switch in the ARP association table entry to be deleted is firstly obtained, and then the ARP association table entry is deleted, an ARP request message is constructed based on the network positioning information to carry out network forwarding so as to trigger the three-layer switch to learn the new ARP association table entry aiming at each neighbor terminal.
Drawings
FIG. 1a is a schematic diagram of a multiple spanning tree protocol based switch network topology in the prior art;
fig. 1b is a flowchart of an information updating method in a three-layer switch according to a first embodiment of the present invention;
fig. 2 is a flowchart of an information updating method in a three-layer switch according to a second embodiment of the present invention;
fig. 3 is a flowchart of an information updating method in a three-layer switch according to a third embodiment of the present invention;
FIG. 4a is a schematic diagram of a network topology under the effect of a spanning tree protocol to which an embodiment of the present invention is applicable;
FIG. 4b is a schematic diagram of a network topology after completion of spanning tree link switching according to an embodiment of the present invention;
fig. 5 is a structural diagram of an information updating apparatus in a three-layer switch in the fourth embodiment of the present invention;
fig. 6 is a block diagram of a three-layer switch in the fifth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1b is a flowchart of an information updating method in a three-layer switch according to an embodiment of the present invention, where this embodiment is applicable to a situation where, in a three-layer switch adapted to a spanning tree protocol, ARP information after switching in the three-layer switch is quickly updated after a link of the spanning tree protocol is switched, and this method may be executed by an information updating apparatus in the three-layer switch, where this apparatus may be implemented in a software and/or hardware manner and may generally be integrated in the three-layer switch, and the method of this embodiment specifically includes the following steps:
s110, when the switching condition of the spanning tree protocol link is detected to be met, a first switch port to be blocked is obtained.
The spanning tree protocol is a two-layer management protocol, and achieves the purpose of eliminating a two-layer loop of a network by selectively blocking (block) network redundant links, and simultaneously has a backup function of the links. When the spanning tree protocol is adapted on a plurality of three-layer switches, some forwarding ports on one or several switches on the plurality of three-layer switches are set to be in a blocking state to form a ring network for forwarding three-layer data.
When a switch in the ring network has a port failure, the spanning tree protocol sets one or more forwarding ports in one (or several) three-layer switches, which were previously set to a blocking state, as backup ports to a forwarding (forwarding) state, and sets one or more forwarding ports in one (1 or several) three-layer switches, which were previously set to a forwarding state, to a blocking state, so as to construct a new ring network to continue forwarding three-layer data.
Correspondingly, when the switch fails, the spanning tree protocol is triggered, and a corresponding spanning tree protocol link switching instruction can be sent to the three-layer switch needing port state switching. Meanwhile, the three-layer switch receiving the spanning tree link switching instruction can correspondingly detect the switching condition of the spanning tree protocol link, and further can determine which forwarding ports currently set to be in the forwarding state in the local computer need to be set to be in the blocking state and which forwarding ports currently set to be in the blocking state need to be set to be in the forwarding state, so that the spanning tree protocol link switching is realized.
In this embodiment, the first switch port to be blocked is one or more forwarding ports that are currently set to a forwarding state and need to be set to a blocking state in the three-layer switch.
S120, according to the learned at least one target ARP associated table item matched with the first switch port, network positioning information of at least one neighbor terminal of the three-layer switch is obtained.
Wherein the network location information comprises: an Internet Protocol Address (IP) and a Virtual Local Area Network Identity (VLAN ID).
In this embodiment, the inventors creatively combine MAC information stored in a switch with ARP information to construct the ARP association entry. The ARP association entry may specifically include: the media intervenient controls the mapping between layer addresses (MAC addresses), forwarding ports (ports), internet protocol addresses (IP), and virtual local area network identifications (VLAN IDs).
Based on the ARP associated table entry stored by the three-layer switch, the method for forwarding the three-layer data to the network by the three-layer switch in the process of receiving the three-layer data can be determined.
For example, the above information is recorded in one ARP association entry: MAC (08:00:20:0A:8C: 6D); port (1); IP (192.168.0.1); VLAN ID (10). When the three-layer switch receives three-layer data to be forwarded, the three-layer data is determined to be forwarded to a terminal with the physical address of 08:00:20:0A:8C:6D in a number 10 virtual local area network through a forwarding port 1 of the three-layer switch based on the IP address in the three-layer data.
When a forwarding port a of the three-layer switch is in a forwarding state, the three-layer switch may gradually learn an ARP association entry of a terminal that needs to forward data through the forwarding port a, that is, the forwarding port recorded in the ARP association entry is the forwarding port a.
It can be understood that, when the first switch port is set to the blocking state, all ARP associated entries (target ARP associated entries) corresponding to the first switch port become unavailable, and if the target ARP associated entry corresponding to the first switch port is still used to forward three layers of data, the three layers of data cannot actually reach the neighbor terminal that needs to be reached, and packet loss may occur. Accordingly, new ARP association entries need to be learned again based on the neighboring terminals corresponding to the target ARP association entries, so that three-layer data directed to these neighboring terminals can be forwarded through other forwarding ports.
The neighbor terminal specifically refers to a terminal that correspondingly stores relevant routing information of the three-layer switch, and generally, terminals corresponding to ARP association entries stored in the three-layer switch are all neighbor terminals of the three-layer switch.
In this embodiment, the learning process of the ARP association entry of the terminal is not triggered by the three-layer data received by the three-layer switch any more, but the three-layer switch automatically triggers learning according to the network positioning information of the neighboring terminal corresponding to the port of the first switch. Correspondingly, the network positioning information of at least one neighbor terminal of the three-layer switch needs to be obtained in advance according to at least one target ARP associated table entry matched with the first switch port, which is obtained through learning.
S130, executing the switching operation of the spanning tree protocol link, and deleting the at least one target ARP associated table entry.
In this embodiment, the three-layer switch correspondingly performs the switching operation of the spanning tree protocol link based on the switching instruction of the spanning tree protocol link sent by the ring network where the three-layer switch is located. Specifically, the switching operation of the spanning tree protocol link may be to modify one or more forwarding ports of the three-layer switch, which are currently set to the forwarding state, into the forwarding state, and modify one or more forwarding ports of the three-layer switch, which are currently set to the blocking state, into the forwarding state. For example, forwarding port 1 of a three-layer switch is modified from a block state to a forwarding state, and forwarding port 2 of the three-layer switch is modified from a forwarding state to a block state.
In this embodiment, in order to avoid packet loss caused by retaining a target ARP associated entry, after the switching operation of the spanning tree protocol link is performed, the at least one target ARP associated entry is directly deleted, only the IP and VLAN ID of the neighbor terminal corresponding to the target ARP associated entry are retained, and a new ARP associated entry corresponding to the neighbor terminal is actively learned according to the network positioning information.
S140, according to the network positioning information of at least one neighbor terminal, constructing an ARP request message for network forwarding so as to trigger the three-layer switch to learn new ARP associated table entries for each neighbor terminal.
In this embodiment, according to the IP and VLAN ID respectively corresponding to each neighbor terminal, an ARP request packet corresponding to each neighbor terminal may be further constructed, so as to obtain an MAC address corresponding to each neighbor terminal, and in the three-layer switch network, a forwarding port currently set in a forwarding state may be pointed to the forwarding port of the neighbor terminal, so as to determine a new ARP association entry of each neighbor terminal corresponding to the first switch port already set in a blocking state.
In this embodiment, the three-layer switch is triggered to learn the new ARP associated entry for each neighbor terminal through the ARP request packet, and does not rely on the received three-layer data to trigger learning, so that when the three-layer data corresponding to the updated new ARP associated entry is received, the three-layer switch does not need to have the CPU of the three-layer switch perform software forwarding on the three-layer data, so as to greatly reduce the processing pressure on the CPU of the three-layer switch.
According to the technical scheme of the embodiment of the invention, when the switching condition of the spanning tree protocol link is detected to be met, the network positioning information corresponding to at least one neighbor terminal of the three-layer switch in the ARP association table entry to be deleted is firstly obtained, and then the ARP association table entry is deleted, an ARP request message is constructed based on the network positioning information to carry out network forwarding so as to trigger the three-layer switch to learn the new ARP association table entry aiming at each neighbor terminal.
Example two
Fig. 2 is a flowchart of an information updating method in a three-layer switch according to a second embodiment of the present invention, which is embodied on the basis of the foregoing embodiment, and in this embodiment, the method obtains network location information of at least one neighbor terminal of the three-layer switch according to at least one target ARP associated entry matched with a port of the first switch, which is obtained by learning, specifically: acquiring the target ARP associated table item matched with the forwarding port and the first switch port from the ARP associated table item set learned by the three-layer switch; and extracting the combination of the Internet protocol address and the virtual local area network identifier in each target ARP associated table entry as the network positioning information corresponding to each neighbor terminal. Correspondingly, the method of the embodiment may include:
s210, when the switching condition of the spanning tree protocol link is detected to be met, a first switch port to be blocked is obtained.
S220, obtaining the target ARP associated table item matched with the forwarding port and the first switch port from the ARP associated table item set obtained by the three-layer switch learning.
The ARP association table entry comprises: and the media intervenes in the mapping relation among the control layer address, the forwarding port, the Internet protocol address and the virtual local area network identifier.
Wherein the network location information comprises: an internet protocol address and a virtual local area network identification.
In this embodiment, the ARP association table entries corresponding to each forwarding port in the three-layer switch may be stored in a unified manner, so as to form the ARP association table entry set. Correspondingly, all ARP associated entries recorded in the ARP associated entry, the forwarding port of which is the first switch port, may be obtained in the ARP associated entry set as the target ARP associated entry.
It can be understood that, in the three-layer switch, the ARP association table entry of each neighboring terminal that needs to be forwarded through each forwarding port may also be stored at the corresponding forwarding port. That is, the ARP association table entries corresponding to all the neighboring terminals of the forwarding port a, which need to be forwarded through the forwarding port a, are stored in the forwarding port a.
Correspondingly, the manner of obtaining at least one target ARP associated entry matching the first switch port may also be that, at the first switch port, at least one target ARP associated entry matching the first switch port is obtained.
S230, extracting a combination of the Internet protocol address and the virtual local area network identifier in each target ARP correlation table entry as network positioning information corresponding to each neighbor terminal.
In this embodiment, each target ARP association entry corresponds to a neighbor terminal that matches the first switch port, that is, three-layer data that points to the neighbor terminal may be forwarded through the first switch port. Correspondingly, the network positioning information respectively corresponding to each neighbor terminal can be generated by extracting the network P and the VLAN ID included in each target ARP associated entry.
S240, executing the switching operation of the spanning tree protocol link, and deleting the at least one target ARP associated table entry.
S250, constructing an ARP request message for network forwarding according to the network positioning information of the at least one neighbor terminal so as to trigger the three-layer switch to learn new ARP associated table entries for each neighbor terminal.
According to the technical scheme of the embodiment of the invention, the target ARP associated table entry matched with the port of the first switch is obtained from the ARP associated table entry set obtained by learning the three-layer switch; extracting the combination of the internet protocol address and the virtual local area network identification in each target ARP associated table entry, as a mode of network positioning information corresponding to each neighbor terminal, quickly positioning the neighbor terminal needing to update the ARP associated table entry, quickly acquiring the network positioning information of the neighbor terminal, further constructing an ARP request message to carry out network forwarding based on the network positioning information after deleting the ARP associated table entry so as to trigger the three-layer switch to learn a new ARP associated table entry aiming at each neighbor terminal, wherein the updating process of the ARP associated table entry is not triggered by the received three-layer data but triggered and completed by a mode of actively sending the ARP request message, the updating speed of the ARP associated table entry is accelerated, and after link switching is completed, the link switching is reduced on the premise of reducing packet loss by deleting the original ARP associated table entry, impact of the received three-layer data on the CPU of the three-layer switch.
EXAMPLE III
Fig. 3 is a flowchart of a video data forwarding method according to a third embodiment of the present invention, which is embodied based on the foregoing embodiments, and in this embodiment, an ARP learning packet is constructed according to network positioning information of at least one neighboring terminal to perform network forwarding, specifically: constructing an ARP request message corresponding to each neighbor terminal according to the network positioning information of the at least one neighbor terminal; obtaining at least one second switch port in a forwarding state of the three-layer switch after the switching operation of the spanning tree protocol link is executed; forwarding the ARP request message through the second switch port;
and after constructing an ARP request message for network forwarding operation according to the network positioning information of the at least one neighbor terminal, the method further comprises the following steps: and generating a new ARP associated table entry corresponding to the neighbor terminal according to the received ARP response message corresponding to the ARP request message, and storing the new ARP associated table entry in the ARP associated table entry set. Correspondingly, the method of the embodiment may include:
s310, when the switching condition of the spanning tree protocol link is detected to be met, a first switch port to be blocked is obtained;
s320, acquiring network positioning information of at least one neighbor terminal of the three-layer switch according to at least one target ARP associated table item matched with the first switch port obtained through learning.
The ARP association table entry comprises: and the media intervenes in the mapping relation among the control layer address, the forwarding port, the Internet protocol address and the virtual local area network identifier.
Wherein the network location information comprises: an internet protocol address and a virtual local area network identification.
S330, executing the switching operation of the spanning tree protocol link and deleting the at least one target ARP associated table entry.
S340, constructing ARP request messages respectively corresponding to each neighbor terminal according to the network positioning information of at least one neighbor terminal.
S350, after the switching operation of the spanning tree protocol link is obtained and executed, at least one second switch port in a forwarding state in the three-layer switch is obtained.
In this embodiment, after the three-layer switch completes the spanning tree link switching, it is considered that there may be one or more forwarding ports (second switch ports) in a forwarding state currently, and therefore, after the second switch port is obtained, the ARP request packet corresponding to one or more neighbor terminals of the first switch port that is obtained through the construction may be forwarded.
And S360, forwarding the ARP request message through the second switch port.
In this embodiment, after the three-layer switch generates the ARP request packet corresponding to each of the neighboring terminals, each generated ARP request packet is forwarded to the outside through the second switch port.
In this embodiment, the forwarding manner of the ARP request packet is a broadcast manner, so that the neighboring terminal to which the ARP request packet is directed can receive the ARP request packet and reply to the ARP request packet, so that the three-layer switch can learn a new ARP associated entry corresponding to the neighboring terminal.
S370, according to the received ARP response message corresponding to the ARP request message, generating a new ARP associated table entry corresponding to the neighbor terminal and storing the new ARP associated table entry in the ARP associated table entry set.
In this embodiment, after the three-layer switch receives the ARP response packet corresponding to the ARP request packet, the ARP response packet may be analyzed or a forwarding port that receives the ARP response packet is obtained, so as to determine a forwarding port and an MAC address of a neighboring terminal that are matched with the ARP response packet, and further generate a new ARP association entry to be stored in the ARP association entry set.
Of course, the new ARP association entry may be stored in the set of ARP association entries, and the ARP association entry may also be stored at the corresponding forwarding port, which is not limited in this embodiment.
According to the technical scheme of the embodiment of the invention, when the switching condition of the spanning tree protocol link is detected to be met, the network positioning information corresponding to at least one neighbor terminal of the three-layer switch in the ARP association table entry to be deleted is firstly obtained, and then the ARP association table entry is deleted, an ARP request message is constructed based on the network positioning information to carry out network forwarding so as to trigger the three-layer switch to learn the new ARP association table entry aiming at each neighbor terminal.
On the basis of the foregoing embodiments, after performing the switching operation of the spanning tree protocol link and deleting the at least one target ARP association entry, the method may further include:
acquiring a message to be forwarded, and matching the message to be forwarded with a currently stored ARP (address resolution protocol) associated table item set;
if the matching is successful, hardware forwarding is carried out on the message to be forwarded according to the ARP association table entry successfully matched; and if the matching fails, forwarding the message to be forwarded to a central processing unit of the three-layer switch so as to perform software forwarding on the message to be forwarded.
In this embodiment, the technical effect that three-layer data matched with the updated ARP association entry is not reported to the CPU can be achieved by actively learning the ARP association entry corresponding to the neighbor terminal of the blocked forwarding port, but if three-layer data pointing to the neighbor terminal a is received before the ARP association entry of a certain neighbor terminal a is updated, the packet to be forwarded still needs to be forwarded to the CPU of the three-layer switch, so as to perform software forwarding on the packet to be forwarded (instead of directly forwarding the packet using the undeleted ARP information).
According to the technical scheme of the embodiment of the invention, by means of the combined use of the two operations of deleting all the ARP associated table items corresponding to the blocked forwarding ports and actively learning the new ARP associated table items of the neighbor terminals corresponding to all the ARP associated table items, the impact of the switching of the spanning tree protocol link on the CPU of the three-layer switch can be reduced to the maximum extent on the premise of reducing the packet loss of the switch (deleting wrong ARP associated table items), the software processing function of the CPU is comprehensively utilized, the coverage of all three layers of data is ensured, and the switching performance of the spanning tree protocol link is optimized to the maximum extent.
Application specific scenarios
In order to clarify the technical solutions of the embodiments of the present invention, the application of the solutions of the embodiments of the present invention to the following specific application scenarios will be briefly described.
Fig. 4a shows a network topology diagram of the embodiment of the present invention in which the spanning tree protocol is in effect, and fig. 4b shows a network topology diagram of the embodiment of the present invention after the spanning tree link handover is completed.
As shown in fig. 4a, a standard ring network is formed by networking the switch 1, the switch 2, the switch 3 and the switch 4, the gateway of the terminal 1 is arranged on the switch 1, the gateway of the terminal 2 is arranged on the switch 4, and the gateway of the terminal 3 is arranged on the switch 2. The switch 1, the switch 2, and the switch 4 are three-layer switches, and are configured to forward three-layer data between the terminals 1 and 2 and between the terminals 1 and 3.
Running spanning tree protocol in the ring network, and assuming that after running spanning tree protocol, switch 1 will set forwarding port 1 between switch 1 and switch 2 to block state, and set forwarding port between switch 1 and switch 3 to forwarding state, the three-layer data message from terminal 1 to terminal 2 will follow the path: forwarding is performed in a mode of terminal 1- > switch 3 machine- > switch 4- > terminal 2, a forwarding port in an associated ARP entry of terminal 2 (neighbor terminal) stored on switch 1 is port 2, and meanwhile, three layers of data messages from terminal 1 to terminal 3 will follow a path: the forwarding is performed in a manner of terminal 1- > switch 3 machine- > switch 4- > switch 2- > terminal 3, the forwarding port in the associated ARP entry of terminal 2 (neighbor terminal) stored on switch 1 is port 2, and the forwarding port in the associated ARP entry of terminal 3 (neighbor terminal) stored on switch 1 is port 2.
When the ring network is switched by the spanning tree protocol link, the forwarding port state of the switch 1 is changed by the network, that is, the forwarding port 1 of the switch 1 is switched to the forward state, and the forwarding port 2 of the switch 1 is switched to the block state.
At this time, before the forwarding port 1 of the switch 1 is switched to the forward state and the forwarding port 2 of the switch 1 is switched to the block state, the switch 1 extracts the IP and VLAN ID of the terminal 2 based on the associated ARP entry corresponding to the terminal 2, and extracts the IP and VLAN ID of the terminal 2 based on the associated ARP entry corresponding to the terminal 3.
After the forwarding port 1 of the switch 1 is switched to a forward state and the forwarding port 2 of the switch 1 is switched to a block state, the switch 1 correspondingly deletes all associated ARP entries corresponding to the terminal 2 and the terminal 3, at this time, the switch 1 constructs an ARP request message pointing to the terminal 2 based on the IP and VLAN ID corresponding to the terminal 2, and constructs an ARP request message pointing to the terminal 3 based on the IP and VLAN ID corresponding to the terminal 3 (that is, constructs an ARP request message corresponding to each of the neighboring terminals).
Then, the switch 1 actively broadcasts the ARP request message directed to the terminal 2 and the ARP request message directed to the terminal 3 through the forwarding port 1. After the terminal 2 and the terminal 3 reply the corresponding ARP response messages, the associated ARP entry corresponding to the terminal 2 and the associated ARP entry corresponding to the terminal 3 are directly generated, so that the three-layer data for the terminal 2 and the terminal 3 are not reported to the CPU of the switch 1 for software forwarding, but are forwarded through the switch chip of the switch 1 for hardware forwarding.
The learning process of the related ARP table entry is triggered by actively sending an ARP request instead of triggering by three-layer flow, so that the switching speed of the three-layer flow is accelerated, and the impact on a CPU (central processing unit) caused by software forwarding of three-layer data through the CPU of the switch is reduced.
Example four
Fig. 5 is a structural diagram of an information updating apparatus in a three-layer switch according to a fourth embodiment of the present invention, and as shown in fig. 5, the apparatus includes: a blocked port obtaining module 510, a network positioning information obtaining module 520, a target ARP association table item deleting module 530 and an ARP request message forwarding module 540, wherein:
a blocking port obtaining module 510, configured to obtain a first switch port to be blocked when it is detected that a switching condition of a spanning tree protocol link is satisfied;
a network positioning information obtaining module 520, configured to obtain, according to at least one target address resolution protocol, ARP, associated entry matched with the first switch port, network positioning information of at least one neighbor terminal of the three-layer switch, where the network positioning information includes: an internet protocol address and a virtual local area network identifier;
a target ARP association table item deleting module 530, configured to execute a switching operation of the spanning tree protocol link and delete the at least one target ARP association table item;
and an ARP request packet forwarding module 540, configured to construct an ARP request packet according to the network positioning information of the at least one neighbor terminal to perform network forwarding, so as to trigger the three-layer switch to perform learning of a new ARP associated entry for each neighbor terminal.
According to the technical scheme of the embodiment of the invention, when the switching condition of the spanning tree protocol link is detected to be met, the network positioning information corresponding to at least one neighbor terminal of the three-layer switch in the ARP association table entry to be deleted is firstly obtained, and then the ARP association table entry is deleted, an ARP request message is constructed based on the network positioning information to carry out network forwarding so as to trigger the three-layer switch to learn the new ARP association table entry aiming at each neighbor terminal.
The information updating device in the three-layer switch provided by the embodiment of the invention can execute the information updating method in the three-layer switch provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
EXAMPLE five
Fig. 6 is a schematic diagram of a hardware structure of a three-layer switch according to a fifth embodiment of the present invention, as shown in fig. 6, the three-layer switch includes:
one or more processors 610, one processor 610 being exemplified in fig. 6;
a memory 620;
the three-tier switch may further comprise: an input device 630 and an output device 640.
The processor 610, the memory 620, the input device 630 and the output device 640 of the apparatus may be connected by a bus or other means, and fig. 6 illustrates the example of connection by a bus.
The memory 620, as a non-transitory computer-readable storage medium, may be used to store software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to a screen switching method in the embodiments of the present application (for example, the blocking port obtaining module 510, the network location information obtaining module 520, the target ARP association table entry deleting module 530, and the ARP request message forwarding module 540 shown in fig. 5). The processor 610 executes various functional applications and data processing in the information updating apparatus in the three-layer switch by executing the software programs, instructions and modules stored in the memory 620, that is, implements the information updating method in the three-layer switch of the above-described method embodiment.
Namely: the processor 610, when executing the software programs, instructions, and modules, implements:
when the switching condition of a spanning tree protocol link is detected to be met, a first switch port to be blocked is obtained; acquiring network positioning information of at least one neighbor terminal of the three-layer switch according to at least one target ARP associated table item matched with the first switch port, wherein the network positioning information comprises: an internet protocol address and a virtual local area network identifier; executing the switching operation of the spanning tree protocol link and deleting the at least one target ARP associated table entry; and constructing an ARP request message for network forwarding according to the network positioning information of the at least one neighbor terminal so as to trigger the three-layer switch to learn new ARP associated table entries for each neighbor terminal.
The memory 620 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to use of the electronic device, and the like. Further, the memory 620 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, memory 620 optionally includes memory located remotely from processor 610, which may be connected to the terminal device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input means 630 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic device. The output device 640 may include a display device such as a display screen.
EXAMPLE six
An embodiment of the present invention further provides a computer storage medium storing a computer program, where the computer program is used to execute the information updating method in the three-tier switch according to any one of the above embodiments of the present invention when executed by a computer processor.
That is, the processor, when executing the computer program, implements: when the switching condition of a spanning tree protocol link is detected to be met, a first switch port to be blocked is obtained; acquiring network positioning information of at least one neighbor terminal of the three-layer switch according to at least one target ARP associated table item matched with the first switch port, wherein the network positioning information comprises: an internet protocol address and a virtual local area network identifier; executing the switching operation of the spanning tree protocol link and deleting the at least one target ARP associated table entry; and constructing an ARP request message for network forwarding according to the network positioning information of the at least one neighbor terminal so as to trigger the three-layer switch to learn new ARP associated table entries for each neighbor terminal.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a Read-Only Memory (ROM), an Erasable Programmable Read-Only Memory (EPROM) or flash Memory), an optical fiber, a portable compact disc Read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, Radio Frequency (RF), etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (9)

1. An information updating method in a three-layer switch, comprising:
when the switching condition of a spanning tree protocol link is detected to be met, a first switch port to be blocked is obtained; the first switch port to be blocked is one or more forwarding ports which are currently set to be in a forwarding state and need to be set to be in a blocking state in the three-layer switch;
acquiring network positioning information of at least one neighbor terminal of the three-layer switch according to at least one target Address Resolution Protocol (ARP) associated table item matched with the port of the first switch, wherein the network positioning information comprises: an internet protocol address and a virtual local area network identifier;
executing the switching operation of the spanning tree protocol link and deleting the at least one target ARP associated table entry;
constructing an ARP request message for network forwarding according to the network positioning information of the at least one neighbor terminal so as to trigger the three-layer switch to learn new ARP associated table entries for each neighbor terminal;
after the switching operation of the spanning tree protocol link is executed and the at least one target ARP association table entry is deleted, the method further comprises the following steps:
acquiring a message to be forwarded, and matching the message to be forwarded with a currently stored ARP (address resolution protocol) associated table item set;
if the matching is successful, hardware forwarding is carried out on the message to be forwarded according to the ARP association table entry successfully matched;
and if the matching fails, forwarding the message to be forwarded to a central processing unit of the three-layer switch so as to perform software forwarding on the message to be forwarded.
2. The method of claim 1, wherein the ARP association table entry includes: and the media intervenes in the mapping relation among the control layer address, the forwarding port, the Internet protocol address and the virtual local area network identifier.
3. The method according to claim 2, wherein obtaining network positioning information of at least one neighbor terminal of the three-layer switch according to at least one target ARP association table entry matched with the first switch port, which is learned, comprises:
acquiring the target ARP associated table item matched with the forwarding port and the first switch port from the ARP associated table item set learned by the three-layer switch;
and extracting the combination of the Internet protocol address and the virtual local area network identifier in each target ARP associated table entry as the network positioning information corresponding to each neighbor terminal.
4. The method according to claim 1, wherein constructing an ARP learning packet for network forwarding according to the network positioning information of the at least one neighboring terminal comprises:
constructing an ARP request message corresponding to each neighbor terminal according to the network positioning information of the at least one neighbor terminal;
obtaining at least one second switch port in a forwarding state of the three-layer switch after the switching operation of the spanning tree protocol link is executed;
and forwarding the ARP request message through the second switch port.
5. The method according to claim 1, wherein after constructing the ARP request packet for network forwarding according to the network positioning information of the at least one neighboring terminal, the method further comprises:
and generating a new ARP associated table entry corresponding to the neighbor terminal according to the received ARP response message corresponding to the ARP request message, and storing the new ARP associated table entry in the ARP associated table entry set.
6. An information updating apparatus in a three-tier switch, comprising:
the device comprises a blocking port acquisition module, a blocking port acquisition module and a blocking port acquisition module, wherein the blocking port acquisition module is used for acquiring a first switch port to be blocked when the switching condition of a spanning tree protocol link is detected to be met; the first switch port to be blocked is one or more forwarding ports which are currently set to be in a forwarding state and need to be set to be in a blocking state in the three-layer switch;
a network positioning information obtaining module, configured to obtain, according to at least one target address resolution protocol, ARP, associated entry that is matched with the first switch port and is obtained through learning, network positioning information of at least one neighbor terminal of the three-layer switch, where the network positioning information includes: an internet protocol address and a virtual local area network identifier;
a target ARP associated table item deleting module, configured to execute a switching operation of the spanning tree protocol link and delete the at least one target ARP associated table item;
an ARP request message forwarding module, configured to construct an ARP request message for network forwarding according to the network positioning information of the at least one neighbor terminal, so as to trigger the three-layer switch to perform learning of new ARP associated entries for each neighbor terminal;
the device is used for acquiring a message to be forwarded after executing the switching operation of the spanning tree protocol link and deleting the at least one target ARP associated table entry, and matching the message to be forwarded with a currently stored ARP associated table entry set; if the matching is successful, hardware forwarding is carried out on the message to be forwarded according to the ARP association table entry successfully matched; and if the matching fails, forwarding the message to be forwarded to a central processing unit of the three-layer switch so as to perform software forwarding on the message to be forwarded.
7. The apparatus of claim 6, wherein the ARP association table entry comprises: and the media intervenes in the mapping relation among the control layer address, the forwarding port, the Internet protocol address and the virtual local area network identifier.
8. A three-tier switch comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any of claims 1-5 when executing the program.
9. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-5.
CN201910576358.1A 2019-06-28 2019-06-28 Information updating method and device in three-layer switch, three-layer switch and medium Active CN110247851B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910576358.1A CN110247851B (en) 2019-06-28 2019-06-28 Information updating method and device in three-layer switch, three-layer switch and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910576358.1A CN110247851B (en) 2019-06-28 2019-06-28 Information updating method and device in three-layer switch, three-layer switch and medium

Publications (2)

Publication Number Publication Date
CN110247851A CN110247851A (en) 2019-09-17
CN110247851B true CN110247851B (en) 2022-01-21

Family

ID=67890109

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910576358.1A Active CN110247851B (en) 2019-06-28 2019-06-28 Information updating method and device in three-layer switch, three-layer switch and medium

Country Status (1)

Country Link
CN (1) CN110247851B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111327523B (en) * 2020-02-28 2022-03-22 深信服科技股份有限公司 Network protection method and device based on aggregation port, network equipment and storage medium
CN111556179B (en) * 2020-04-28 2023-04-28 杭州迪普科技股份有限公司 ARP (Address resolution protocol) table entry updating method and device
CN114531414A (en) * 2022-01-07 2022-05-24 锐捷网络股份有限公司 Terminal migration acceleration method and device
CN115643202A (en) * 2022-09-28 2023-01-24 北京东土军悦科技有限公司 Link selection control protocol switching method, device, equipment and medium
CN116094990B (en) * 2023-01-19 2024-06-14 重庆长安汽车股份有限公司 Software optimization method and device based on MAC address forwarding table and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004260238A (en) * 2003-02-24 2004-09-16 Nippon Telegr & Teleph Corp <Ntt> Apparatus and method of connecting lan-atm network
CN101980488A (en) * 2010-10-22 2011-02-23 中兴通讯股份有限公司 Address resolution protocol (ARP) table entry management method and three-layer exchanger
CN105991795A (en) * 2015-07-31 2016-10-05 杭州迪普科技有限公司 ARP (address resolution protocol) table item updating method and device
CN107623757A (en) * 2017-10-27 2018-01-23 新华三技术有限公司 Entry updating method and apparatus
CN108243262A (en) * 2016-12-26 2018-07-03 大唐移动通信设备有限公司 Learning method, device and the network three-layer equipment of ARP table

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004260238A (en) * 2003-02-24 2004-09-16 Nippon Telegr & Teleph Corp <Ntt> Apparatus and method of connecting lan-atm network
CN101980488A (en) * 2010-10-22 2011-02-23 中兴通讯股份有限公司 Address resolution protocol (ARP) table entry management method and three-layer exchanger
CN105991795A (en) * 2015-07-31 2016-10-05 杭州迪普科技有限公司 ARP (address resolution protocol) table item updating method and device
CN108243262A (en) * 2016-12-26 2018-07-03 大唐移动通信设备有限公司 Learning method, device and the network three-layer equipment of ARP table
CN107623757A (en) * 2017-10-27 2018-01-23 新华三技术有限公司 Entry updating method and apparatus

Also Published As

Publication number Publication date
CN110247851A (en) 2019-09-17

Similar Documents

Publication Publication Date Title
CN110247851B (en) Information updating method and device in three-layer switch, three-layer switch and medium
US8885521B2 (en) Topology management method of ether multi-ring network, and system thereof
US20150117451A1 (en) Communication between hetrogenous networks
CN109561033B (en) Method and device for multicast replication in Overlay network
US9413628B2 (en) Network relay node device, network relay method, and recording medium
US20120155463A1 (en) Increased Communication Opportunities with Low-Contact Nodes in a Computer Network
CN110798403B (en) Communication method, communication device and communication system
US9264327B2 (en) Communication network management system, method and program, and management computer
CN112187647B (en) Message forwarding method, message forwarding equipment and computer readable storage medium
US9143431B2 (en) Hiding a service node in a network from a network routing topology
CN111682996A (en) Method, network node and network system for forwarding message in network
CN113055297B (en) Network topology discovery method and device
CN110430116A (en) Data forwarding method and device, edge device and readable storage medium storing program for executing
CN105827439A (en) Method for realizing wireless device ad hoc network
EP3566401B1 (en) Detecting and mitigating loops
EP4152701A1 (en) Routing processing method and related device
Sahhaf et al. Experimental validation of resilient tree-based greedy geometric routing
CN111711571B (en) Ad hoc network on-demand routing method and device supporting IP transparent transmission and computer equipment
Gouvy et al. Greedy routing recovery using controlled mobility in wireless sensor networks
US20160330166A1 (en) Address Acquiring Method and Network Virtualization Edge Device
US20160028622A1 (en) Network path setup method based on identifier, and apparatus thereof
CN111654558B (en) ARP interaction and intranet flow forwarding method, device and equipment
CN112543142B (en) Method and device for realizing RSTP ring network protocol based on FPGA
CN104079485A (en) Method and device of transmitting appointed forwarder information
CN106452992B (en) Method and device for realizing remote multi-homing networking

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant