A method for configuring an address resolution protocol table, a switch, a medium and a product
By configuring a dynamic non-aging MAC address in the Ethernet Layer 3 switch, the problem of asynchronous aging time of the FDB table and ARP table is solved, ensuring the correctness of traffic forwarding and avoiding damage to network services.
Patent Information
- Application Number
- CN202411367272.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2044-09-29
AI Technical Summary
In Ethernet Layer 3 switches, the aging time of FDB tables and ARP tables is not synchronized, resulting in damage to network services such as packet drop, bandwidth occupancy and network congestion.
The second address resolution protocol table is determined by obtaining the first address resolution protocol table issued by the protocol software and based on the table and the Layer 2 MAC address table in the switching chip. If port migration occurs for the MAC address in the second address resolution protocol table, the outgoing port information is updated, and the attributes of all MAC addresses are configured to dynamically not age to avoid aging.
By dynamically configuring the MAC address without aging, traffic forwarding errors caused by port migration are avoided, and network service damage caused by the out-of-synchronization of the aging time of the FDB table and ARP table is prevented.
Smart Images

Figure CN118869653B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer network communication, and in particular to an address resolution protocol table configuration method, a switch, a medium and a product. Background Art
[0002] Ethernet layer 3 forwarding is usually achieved by searching the IP routing table. The next hop in the IP routing table is the layer 3 neighbor, which is discovered and learned through the ARP (Address Resolution Protocol) protocol. The function of the ARP protocol is to correctly map the IP address to the corresponding MAC address to facilitate the sending and receiving of data packets. However, on an Ethernet layer 3 switch, the layer 3 interface is usually a virtual local area network (VLAN) interface, and the ARP table entry generated by its kernel protocol stack only contains the IP address, MAC address, and layer 3 interface. In order to specifically implement the sending and receiving of data packets, the ARP table entry of the switch chip in the switch also needs to include the outbound port information. Therefore, the MAC address and VLAN ID are usually used to query the layer 2 MAC address table (Forwarding DataBase, FDB table) that the switch chip automatically learns when receiving data packets to obtain specific outbound port information, so as to ensure that the ARP table entry in the switch chip includes: IP address, MAC address, layer 3 interface, and outbound port.
[0003] However, in the switch, in order to save table space and improve table utilization, both the FDB table and the ARP table have aging functions. However, since the aging time of the FDB table and the ARP table are not synchronized, this will result in a MAC address still existing in the ARP table but being deleted in the FDB table. When the management software in the switch senses the event of the MAC address being deleted in the FDB table, it will update the next hop of the ARP corresponding to the MAC address, and the specific settings are to discard or send to the central processing unit (CPU). In this case, under the same VLAN interface, the message whose target is the ARP will be flooded in the VLAN due to the failure of the destination MAC query, occupying the bandwidth of other ports and causing network congestion; and for data packets from different three-layer interfaces that use IP routing, if the next hop of the route is the MAC address in the ARP, it will be discarded or sent to the CPU for processing because the destination MAC address has no outbound port.
[0004] In the prior art, in order to prevent the aging of the ARP table, the target IP address of the ARP request is actively sent by software control before the aging cycle arrives. If the switch receives a response message to the ARP request, the switching chip automatically updates the aging time of the MAC address in the FDB table. At the same time, the response message of the ARP request is sent to the CPU. After receiving the ARP response message, its kernel protocol stack updates the aging time of the ARP table entry and enters the next aging cycle. However, in this method, in order to prevent the aging of the FDB table and the ARP table, the sending interval must be less than the aging cycle of both. Generally, the aging time of the MAC address is short, which leads to the need to send ARP request messages frequently, which puts more pressure on the CPU. Too many ARP request messages flooding the network will occupy the network bandwidth and may be submerged, resulting in the inability to receive ARP responses and ARP update failure.
[0005] It can be seen that how to avoid the problem of network service damage caused by the asynchronous aging of the FDB table and the ARP table is a problem that technical personnel in this field need to solve. Summary of the invention
[0006] The purpose of the embodiments of the present invention is to provide an address resolution protocol table configuration method, a switch, a medium and a product, which can solve the problem of network service damage caused by the aging asynchronism of the FDB table and the ARP table in the current Ethernet three-layer forwarding.
[0007] To solve the above technical problems, on the one hand, an embodiment of the present invention provides an address resolution protocol table configuration method, including:
[0008] Obtain a first address resolution protocol table issued by the protocol software, and determine a second address resolution protocol table according to the first address resolution protocol table and a layer 2 MAC address table in the switching chip;
[0009] If port migration occurs to the first MAC address in the second address resolution protocol table, determine the target egress port corresponding to the first MAC address from the layer 2 MAC address table;
[0010] The egress port corresponding to the second MAC address in the second address resolution protocol table is updated to the target egress port, and the attributes of each MAC address in the second address resolution protocol table and the second layer MAC address table are configured to be dynamic and non-aging; the first MAC address and the second MAC address are the same MAC address.
[0011] In some embodiments, further comprising:
[0012] Compare the layer 2 MAC address table corresponding to the current cycle with the layer 2 MAC address table corresponding to the previous cycle to obtain a corresponding comparison result;
[0013] Based on the comparison result, determine whether the first MAC address in the second address resolution protocol table has port migration. If port migration occurs, store the layer 2 MAC address table corresponding to the current cycle in the protocol software to replace the layer 2 MAC address table corresponding to the previous cycle in the protocol software.
[0014] In some embodiments, determining whether a port migration occurs to the first MAC address in the second address resolution protocol table based on the comparison result includes:
[0015] If there are different egress ports in the layer 2 MAC address table corresponding to the current cycle and the layer 2 MAC address table corresponding to the previous cycle, determine whether the MAC address corresponding to the different egress port belongs to the second address resolution protocol table;
[0016] If it belongs to the second address resolution protocol table, it is determined that the first MAC address in the second address resolution protocol table has port migration.
[0017] In some embodiments, determining whether a port migration occurs to the first MAC address in the second address resolution protocol table based on the comparison result includes:
[0018] If the Layer 2 MAC address table corresponding to the current cycle is exactly the same as the Layer 2 MAC address table corresponding to the previous cycle, it is determined that the first MAC address in the second address resolution protocol table has not undergone port migration, and the MAC address with dynamic attributes in the Layer 2 MAC address table corresponding to the current cycle is configured as dynamic and non-aging.
[0019] In some embodiments, obtaining a first address resolution protocol table issued by the protocol software includes:
[0020] The control protocol software obtains the address information in the data packet currently received by the switch, so that the protocol software generates a first address resolution protocol table according to the IP address, MAC address and layer 3 interface in the address information, and sends it to the switch chip.
[0021] In some embodiments, it also includes:
[0022] Get the source MAC address and virtual LAN interface ID in the data packet sent by the host to the slave through the switch;
[0023] Get the destination MAC address and outgoing port in the response message corresponding to the data packet sent by the slave to the host through the switch;
[0024] The source MAC address, the ID of the virtual LAN interface, the destination MAC address, and the egress port are learned to generate a layer 2 MAC address table.
[0025] In some embodiments, determining the second address resolution protocol table according to the first address resolution protocol table and the layer 2 MAC address table in the switch chip includes:
[0026] Obtaining a layer 3 interface in the first address resolution protocol table, and determining whether the layer 3 interface in the first address resolution protocol table is a virtual local area network interface;
[0027] If the layer 3 interface is a virtual LAN interface, a second address resolution protocol table is constructed based on the ID of the virtual LAN interface in the first address resolution protocol table, the IP address and MAC address corresponding to the virtual LAN interface, and the corresponding output port in the layer 2 MAC address table.
[0028] In some embodiments, after configuring the attribute of each MAC address in the second address resolution protocol table to be dynamic and non-aging, the method further includes:
[0029] Detecting the attributes of each MAC address in the second address resolution protocol table;
[0030] If the attributes of each MAC address in the second address resolution protocol table are all dynamic and non-aging, an update instruction of the layer 2 MAC address table is sent to the switching chip to configure the attributes of each MAC address in the layer 2 MAC address table as dynamic and non-aging.
[0031] In some embodiments, it also includes:
[0032] Determine whether a deletion instruction issued by the protocol software has been received;
[0033] If a deletion instruction is received from the protocol software, the address resolution protocol table entry to be deleted in the deletion instruction is obtained;
[0034] Determining whether the layer 3 interface in the second address resolution protocol table is a virtual local area network interface;
[0035] If the layer 3 interface is a virtual LAN interface, the MAC address to be deleted in the address resolution protocol table to be deleted is obtained, the MAC address to be deleted in the layer 2 MAC address table is deleted, and the address resolution protocol table entry to be deleted in the second address resolution protocol table is deleted.
[0036] In some embodiments, it also includes:
[0037] If the layer 3 interface is not a virtual LAN interface, the address resolution protocol table entry to be deleted in the second address resolution protocol table is deleted.
[0038] In some embodiments, it also includes:
[0039] Determine whether the addition instruction issued by the protocol software is received;
[0040] If an add instruction is received from the protocol software, the MAC address to be added in the add instruction is obtained;
[0041] Add the MAC address to be added to the Layer 2 MAC address table, and configure the attribute of the MAC address to be added as dynamic and non-aging.
[0042] In some embodiments, it also includes:
[0043] Comparing the second address resolution protocol table with the layer 2 MAC address table within a preset time to determine the target MAC address and the corresponding egress port that are stored in the layer 2 MAC address table and not stored in the second address resolution protocol table;
[0044] The target MAC address and the corresponding egress port are stored in the second address resolution protocol table.
[0045] On the other hand, the present invention also provides a switch, comprising:
[0046] Memory for storing computer programs;
[0047] The processor is used to execute a computer program to implement the steps of the above-mentioned address resolution protocol table configuration method.
[0048] On the other hand, the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned address resolution protocol table configuration method are implemented.
[0049] On the other hand, the present invention also provides a computer program product, including a computer program / instruction, which implements the steps of the above-mentioned address resolution protocol table configuration method when executed by a processor.
[0050] It can be seen from the above technical scheme that the present invention provides an address resolution protocol table configuration method, including: obtaining the first address resolution protocol table issued by the protocol software, and determining the second address resolution protocol table according to the first address resolution protocol table and the layer 2 MAC address table in the switching chip; if the first MAC address in the second address resolution protocol table undergoes port migration, then determining the target egress port corresponding to the first MAC address from the layer 2 MAC address table; updating the egress port corresponding to the second MAC address in the second address resolution protocol table to the target egress port, and configuring the attributes of each MAC address in the second address resolution protocol table and the layer 2 MAC address table to be dynamic and non-aging; the first MAC address and the second MAC address are the same MAC address. It can be seen that the present invention configures the attributes of the MAC addresses in the second address resolution protocol table and the layer 2 MAC address table to be dynamic and non-aging. On the one hand, since the attributes of the MAC address are dynamic, the MAC address in the present invention is not affected by port migration. When the MAC address in the second address resolution protocol table undergoes port migration, the switching chip can automatically learn the MAC address on the new port. When the software detects this change, the second address resolution protocol table and the layer 2 MAC address table are updated again, thereby ensuring the correctness of traffic forwarding. On the other hand, since the MAC address is non-aging, the switching chip will not age it, thus avoiding the problem of network service damage caused by different aging times of the MAC address in the Layer 2 MAC address table and the second address resolution protocol table. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0052] Figure 1 A flowchart of an address resolution protocol table configuration method provided by an embodiment of the present invention;
[0053] Figure 2 A schematic diagram of a switching chip FDB table provided in an embodiment of the present invention;
[0054] Figure 3 A schematic diagram of a second ARP table of a switching chip provided in an embodiment of the present invention;
[0055] Figure 4 An overall flow chart of creating a second ARP table provided by an embodiment of the present invention;
[0056] Figure 5 The overall flow chart of the process of updating the second ARP table and the MAC address when the MAC address appears port migration provided by the embodiment of the present invention;
[0057] Figure 6 A flowchart of a process for deleting an ARP entry provided by an embodiment of the present invention;
[0058] Figure 7 A structural diagram of a switch provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0059] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0060] The terms "including" and "having" in the specification of the present invention and the above-mentioned drawings, as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but may include steps or units that are not listed.
[0061] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0062] Next, an address resolution protocol table configuration method provided by an embodiment of the present invention is described in detail. Figure 1 A flowchart of a method for configuring an address resolution protocol table provided by an embodiment of the present invention is shown in FIG. Figure 1 As shown, the address resolution protocol table configuration method includes the following process:
[0063] S10: Obtain a first address resolution protocol table issued by the protocol software, and determine a second address resolution protocol table according to the first address resolution protocol table and a layer 2 MAC address table in the switching chip.
[0064] In a specific embodiment, the address resolution protocol table configuration method provided by the present invention is specifically applied to a switch, and the switch specifically includes protocol software and a switching chip. The protocol software in the switch generates a first address resolution protocol table, i.e., a first ARP table, through its own kernel protocol stack. The first ARP table includes an IP address, a MAC address, and a layer 3 interface. The switching chip itself constructs a layer 2 MAC address table, i.e., an FDB table, through a learning function. The FDB table includes a mapping of a MAC address and a virtual LAN interface ID (VLAN ID) to an egress port. Therefore, when the protocol software sends the first ARP table to the switching chip, the switching chip queries the FDB table according to information such as the MAC address in the first ARP table. At this time, a complete set of corresponding relationships can be obtained: IP address, MAC address, virtual LAN interface ID, and egress port, and a second address resolution protocol table, i.e., a second ARP table, is constructed according to this set of corresponding relationships. The second ARP table includes four table items, namely, IP address, MAC address, VLAN ID (layer 3 interface), and egress port.
[0065] It should be noted that the second ARP table is configured, while the FDB table is automatically learned, so the attributes of the MAC address in the FDB table are usually dynamic, and the attributes of the MAC address in the second ARP table are also usually dynamic.
[0066] S11: If port migration occurs to the first MAC address in the second address resolution protocol table, determine the target egress port corresponding to the first MAC address from the layer 2 MAC address table.
[0067] In the embodiment, when the three-layer interface is a VLAN interface, it specifically includes a physical port. When the switch is connected, port migration is likely to occur, that is, the MAC address originally corresponding to port 1 corresponds to port 2 after the port migration occurs. In this case, since the FDB table is learned and constructed by the switch chip itself, when port migration occurs, it is automatically updated in the FDB table, but cannot be updated in the second ARP table. Therefore, if data needs to be sent at this time, it cannot be sent from the latest port. Therefore, it is necessary to determine the target port after migration corresponding to the first MAC address where the port migration occurs from the FDB table, so as to reconfigure it according to the target port in the second ARP table.
[0068] S12: Update the egress port corresponding to the second MAC address in the second address resolution protocol table to the target egress port, and configure the attributes of each MAC address in the second address resolution protocol table and the layer 2 MAC address table to be dynamic and non-aging; the first MAC address and the second MAC address are the same MAC address.
[0069] In the embodiment, the first MAC address (second MAC address) where port migration occurs is determined in the above step S11, and the target egress port after port migration is determined, so the egress port corresponding to the second MAC address in the second ARP table in the switching chip is updated to the target egress port.
[0070] Among them, the attributes of MAC addresses are divided into dynamic, static and dynamic non-aging (i.e. static migration). Among them, the MAC address with dynamic attributes will be subject to the aging control of the FDB table. If no data packet matches the MAC within the aging period, the MAC address will be aged and deleted from the FDB table. If the data packet enters the switching chip from other ports, that is, the port migration of the MAC address occurs, the switching chip will automatically learn the dynamic MAC to the new port; the MAC with static attributes is usually configured by software, it is not subject to the aging control of the FDB table and will never be aged, but at the same time it will not receive the MAC address port migration. When the host After the entry port is changed, since the MAC address with static attributes does not migrate, the final MAC is the data packet of the host and still goes out from the original exit port, resulting in forwarding path errors and different traffic. The MAC address with dynamic non-aging (static migration) attribute has the characteristics of static attribute MAC address non-aging, and it will not be deleted by the aging function of the FDB table. At the same time, it has the function of specific dynamic attribute MAC address migration. When the data packet changes the source port to enter, it will automatically learn to the new exit port. After learning the new exit port, the original static migration mark is cleared and updated to the dynamic mark.
[0071] In order to save table space and improve table utilization, the MAC addresses in the second ARP table and the FDB table are aged. Therefore, it can be seen that the attributes of the MAC addresses in the second ARP table and the FDB table are usually dynamic. However, the aging time of the FDB table and the ARP table are not synchronized, which will result in a MAC address still existing in the ARP table but deleted in the FDB table. Therefore, the present invention reconfigures the attributes of the MAC addresses in the second ARP table and the FDB table to be dynamic and non-aging, which can avoid the problem of network service damage caused by different aging times of MAC addresses in the second-layer MAC address table and the second address resolution protocol table.
[0072] It can be seen from the above technical scheme that the present invention provides an address resolution protocol table configuration method, including: obtaining the first address resolution protocol table issued by the protocol software, and determining the second address resolution protocol table according to the first address resolution protocol table and the layer 2 MAC address table in the switching chip; if the first MAC address in the second address resolution protocol table undergoes port migration, then determining the target egress port corresponding to the first MAC address from the layer 2 MAC address table; updating the egress port corresponding to the second MAC address in the second address resolution protocol table to the target egress port, and configuring the attributes of each MAC address in the second address resolution protocol table and the layer 2 MAC address table to be dynamic and non-aging; the first MAC address and the second MAC address are the same MAC address. It can be seen that the present invention configures the attributes of the MAC addresses in the second address resolution protocol table and the layer 2 MAC address table to be dynamic and non-aging. On the one hand, since the attributes of the MAC address are dynamic, the MAC address in the present invention is not affected by port migration. When the MAC address in the second address resolution protocol table undergoes port migration, the switching chip can automatically learn the MAC address on the new port. When the software detects this change, the second address resolution protocol table and the layer 2 MAC address table are updated again, thereby ensuring the correctness of traffic forwarding. On the other hand, since the MAC address is non-aging, the switching chip will not age it, thus avoiding the problem of network service damage caused by different aging times of the MAC address in the Layer 2 MAC address table and the second address resolution protocol table.
[0073] In some embodiments, how to determine whether a port migration occurs to the first MAC address in the second address resolution protocol table (second ARP table) specifically includes:
[0074] Compare the layer 2 MAC address table corresponding to the current cycle with the layer 2 MAC address table corresponding to the previous cycle to obtain a corresponding comparison result;
[0075] Based on the comparison result, determine whether the first MAC address in the second address resolution protocol table has port migration. If port migration occurs, store the layer 2 MAC address table corresponding to the current cycle in the protocol software to replace the layer 2 MAC address table corresponding to the previous cycle in the protocol software.
[0076] Wherein, determining whether the first MAC address in the second address resolution protocol table has port migration based on the comparison result specifically includes:
[0077] If there are different outbound ports in the Layer 2 MAC address table corresponding to the current cycle and the Layer 2 MAC address table corresponding to the previous cycle, determine whether the MAC address corresponding to the different outbound port belongs to the second address resolution protocol table; if it belongs to the second address resolution protocol table, determine that the first MAC address in the second address resolution protocol table has undergone port migration.
[0078] If the Layer 2 MAC address table corresponding to the current cycle is exactly the same as the Layer 2 MAC address table corresponding to the previous cycle, it is determined that the first MAC address in the second address resolution protocol table has not undergone port migration, and the MAC address with dynamic attributes in the Layer 2 MAC address table corresponding to the current cycle is configured as dynamic and non-aging.
[0079] In a specific embodiment, the FDB table learned by the switching chip will be stored in the protocol software for easy query. At that time, since the FDB table is constructed through periodic automatic learning, there will be an update problem. How to determine whether the FDB table has been updated, that is, obtain the Layer 2 MAC address table (FDB table) corresponding to the current cycle and the Layer 2 MAC address table (FDB table) corresponding to the previous cycle stored in the software protocol, and compare the FDB table corresponding to the current cycle with the FDB table corresponding to the previous cycle to obtain the corresponding comparison result, that is, determine whether the FDB table has been updated based on the comparison result, and further determine whether the port migration of the first MAC address in the second ARP table has occurred.
[0080] When the FDB table learned in the current cycle is different from the FDB table corresponding to the previous cycle, that is, port migration occurs between the previous cycle and the current cycle, that is, an update occurs in the FDB table, so the output port that is different between the FDB table corresponding to the current cycle and the FDB table corresponding to the previous cycle is obtained at this time. However, since the FDB table is constructed by learning, and the second ARP table is configured, there is a possibility that the number of MAC addresses stored in the FDB table is more than that in the second ARP table. Therefore, it is necessary to further judge whether the first MAC address in the second ARP table has undergone port migration based on whether the FDB table is updated, that is, to judge whether the MAC address corresponding to the output port with differences belongs to the second ARP table; if the MAC address corresponding to the output port with differences belongs to the second ARP, it is determined that the first MAC address in the second ARP has undergone port migration, and when the MAC address corresponding to the output port with differences does not belong to the second ARP table, it is determined that the first MAC address in the second ARP has not undergone port migration. When the FDB table learned in the current cycle has no difference with the FDB table corresponding to the previous cycle, that is, they are exactly the same, it means that the FDB has not been updated between the current cycle and the previous cycle, that is, the first MAC address in the second ARP table has not undergone port migration.
[0081] Among them, the judgment of whether the first MAC address in the second ARP table in the present invention has port migration is periodically judged, that is, it is periodically determined whether the FDB table corresponding to the current cycle is different from the FDB table corresponding to the previous cycle. Therefore, in this process, if the FDB table corresponding to the current cycle is different from the FDB table corresponding to the previous cycle, it is necessary to delete the FDB table corresponding to the previous cycle in the protocol software, and store the FDB table corresponding to the current cycle in the protocol software again, and when the next cycle comes, it is used as the new FDB table corresponding to the previous cycle. In this process, if the FDB table corresponding to the current cycle is exactly the same as the FDB table corresponding to the previous cycle, in order to avoid wasting resources, it is not necessary to replace it.
[0082] It should be noted that the specific time standard corresponding to the period can be set according to the needs of the user, and the present invention is not limited thereto. In addition, the attributes of the MAC address in the FDB table and the MAC address in the second ARP table in the embodiment of the present invention are configured to be dynamic and non-aging.
[0083] It should also be noted that the embodiment provided by the present invention is only one possible implementation method, but is not limited to only this implementation method and can be customized according to the needs of users.
[0084] The embodiment of the present invention provides a method for determining whether the first MAC address in the second address resolution protocol table has undergone port migration. In this method, the method of determining whether the second-layer MAC address table is updated is used to determine whether the first MAC address in the second address resolution protocol table has undergone port migration. In this process, it is also determined whether the updated MAC address belongs to the second address resolution protocol. Overall, the correct mapping between the MAC address and the egress port is guaranteed, and the correctness of traffic forwarding is guaranteed.
[0085] In some embodiments, obtaining the first address resolution protocol table sent by the protocol software specifically includes: controlling the protocol software to obtain the address information in the data packet received by the current switch, so that the protocol software generates the first address resolution protocol table according to the IP address, MAC address and three-layer interface in the address information, and sends it to the switching chip.
[0086] Obtaining the Layer 2 MAC address table specifically includes: obtaining the source MAC address and the ID of the virtual LAN interface in the data packet sent by the host to the slave through the switch; obtaining the destination MAC address and the egress port in the response message corresponding to the data packet sent by the slave to the host through the switch; and learning the source MAC address, the ID of the virtual LAN interface, the destination MAC address and the egress port to generate a Layer 2 MAC address table.
[0087] Among them, under the above-mentioned specific steps of obtaining the first address resolution protocol table and the layer 2 MAC address table, the second address resolution protocol table is determined according to the first address resolution protocol table and the layer 2 MAC address table in the switching chip, specifically including: obtaining the layer 3 interface in the first address resolution protocol table, and determining whether the layer 3 interface in the first address resolution protocol table is a virtual LAN interface; if the layer 3 interface is a virtual LAN interface, constructing the second address resolution protocol table based on the ID of the virtual LAN interface in the first address resolution protocol table, the IP address and MAC address corresponding to the virtual LAN interface, and the corresponding output port in the layer 2 MAC address table.
[0088] In the embodiment, the specific process of the protocol software generating the first ARP table is: obtaining the data packet sent by the host or slave received by the current switch, and storing some relevant address information of the sender (host) in the data packet, and the address information mainly includes: IP address, MAC address and three-layer interface, so the kernel protocol stack generates the first address resolution protocol table (first ARP table) according to the IP address, MAC address and three-layer interface, and sends it to the switch chip through the software protocol. Therefore, the specific table items of the first ARP table include: IP address, MAC address and three-layer interface.
[0089] The acquisition of the Layer 2 MAC address table (FDB table) specifically includes: the switching chip acquires the data packet sent by the host to the slave through the switch, and the data packet includes the source MAC address, the ID of the virtual LAN interface (VLAN ID), and the destination IP address. Since there is no destination MAC address, the switch at this time will send the data packet from all current ports, that is, all slaves under this VLAN port receive the data packet. The slave determines whether the current data packet is sent to itself based on the destination IP in the data packet. If so, it sends a response message corresponding to the data packet to the switch, and its response message includes the destination MAC address and the egress port; therefore, the source MAC address, the ID of the virtual LAN interface, the destination MAC address, and the egress port are learned to generate a Layer 2 MAC address table. Its source MAC address and MAC address are both MAC addresses.
[0090] Finally, under the above-mentioned specific steps of obtaining the first address resolution protocol table and the second-layer MAC address table, the second address resolution protocol table is determined, which first needs to determine whether the third-layer interface in the first ARP table is a virtual LAN interface (VLAN interface); if the third-layer interface is (VLAN interface), then the second ARP table is constructed based on the VLANID in the first ARP table, the IP address and MAC address corresponding to the VLAN interface, and the corresponding output port in the second-layer MAC address table.
[0091] Its Figure 2The figure shows a schematic diagram of the FDB table of the switching chip, which includes MAC address, VLAN ID, egress port and tag information (attributes). The port is the port when the data packet with the source MAC address enters the switching chip. When the switching chip receives the data packet, it learns the MAC address according to the source MAC address and VLAN ID and stores it in the FDB table. When the data packet with the destination MAC address matching the MAC address obtains the egress port when querying the FDB table of the switching chip, it is forwarded from the egress port.
[0092] Its Figure 3 As shown, it is a schematic diagram of the second ARP table in the switching chip, which includes IP address and next hop information. The next hop information includes MAC address (source MAC address and destination MAC address), outbound port, and VLAN ID. After the data packet enters the switching chip, if the interface to which it belongs is a layer-3 interface and the destination MAC is the MAC of the layer-3 interface, it will be forwarded at layer-3, and the routing table will be searched to obtain the next hop information. The source MAC address, destination MAC address, and VLAN ID will be modified according to the next hop information, and it will be forwarded from the destination outbound port in the next hop table. When the data packet searches the routing table inside the switching chip for layer-3 forwarding, the destination port is obtained according to the next hop information associated with the routing table. In the case where the layer-3 interface is a VLAN interface, since the table entry in the first ARP table sent by the kernel protocol stack does not include the outbound port, it is necessary to search the FDB table of the switching chip according to the MAC address + VLAN ID before setting the switching chip to obtain the outbound port and set it in the next hop table associated with the second ARP in the switching chip.
[0093] It should be noted that the embodiment provided by the present invention is only one possible implementation method, but is not limited to only this implementation method and can be set according to the needs of the user.
[0094] The embodiment of the present invention provides a specific acquisition process of the first address resolution protocol table, the second layer MAC address table and the first address resolution protocol table. In this process, the mapping between the IP address, MAC address, VLAN ID and the output port in different tables is guaranteed, thereby ensuring the correct forwarding of traffic and the normal operation of network services.
[0095] In some embodiments, the address resolution protocol table configuration method provided by the present invention also includes the steps of specifying addition and specifying deletion, wherein the specific steps of specifying deletion are: determining whether a deletion instruction issued by the protocol software is received; if a deletion instruction issued by the protocol software is received, obtaining the address resolution protocol table item to be deleted in the deletion instruction; determining whether the three-layer interface in the second address resolution protocol table is a virtual LAN interface; if the three-layer interface is a virtual LAN interface, obtaining the MAC address to be deleted in the address resolution protocol table item to be deleted, and deleting the MAC address to be deleted in the two-layer MAC address table, and deleting the address resolution protocol table item to be deleted in the second address resolution protocol table; if the three-layer interface is not a virtual LAN interface, deleting the address resolution protocol table item to be deleted in the second address resolution protocol table.
[0096] The specific steps of specifying addition are: determining whether an addition instruction issued by the protocol software is received; if an addition instruction issued by the protocol software is received, obtaining the MAC address to be added in the addition instruction; adding the MAC address to be added to the Layer 2 MAC address table, and configuring the attributes of the MAC address to be added to be dynamic and non-aging.
[0097] In a specific embodiment, since the attributes of the MAC addresses in the FDB table and the second ARP table in the present invention are both dynamic and non-aging, they will not be automatically deleted or added, and the deletion and addition actions will be executed only after an instruction is issued from the outside. For the deletion action, when a deletion instruction issued by the protocol software is received, the address resolution protocol table item to be deleted in the deletion instruction is obtained, and the address resolution protocol table item to be deleted specifically includes an IP address, a MAC address, and a three-layer interface. At this time, the subsequent steps are divided into two branches. The first branch is: when the three-layer interface in the second ARP table is a VLAN interface, it is determined whether the address resolution protocol table item is specifically a MAC address. If so, the MAC address to be deleted in the address resolution protocol table item to be deleted is obtained, and the MAC address to be deleted in the FDB table is deleted at this time, and then the address resolution protocol table item to be deleted in the second ARP table is deleted; the second branch: the three-layer interface in the second ARP table is not a VLAN interface. At this time, only the address resolution protocol table item to be deleted in the second ARP table is deleted, and the FDB table is not deleted. As for the adding action, the added content is a specific MAC address. Therefore, after receiving the adding instruction issued by the protocol software, the MAC address to be added in the adding instruction is obtained; the MAC address to be added is specifically added to the FDB table, and the second ARP table will not be added. It should also be noted that since the attribute of the added MAC address is dynamic, it needs to be reconfigured to be dynamic and non-aging.
[0098] It should be noted that the embodiment provided by the present invention is only one possible implementation method, but is not limited to only this implementation method and can be set according to the needs of the user.
[0099] Among them, the address resolution protocol table configuration method provided by the present invention also includes two points: the first point: after the attributes of each MAC address in the second address resolution protocol table (second ARP table) are configured as dynamic and non-aging, in order to ensure that the attributes of each MAC address in the second ARP table are configured as dynamic and non-aging, and will not be affected by automatic deletion due to aging, it is necessary to detect the attributes of each MAC address in the second ARP table; if the attributes of each MAC address in the second ARP table are all dynamic and non-aging, an update instruction of the FDB table is sent to the switching chip, and then the attributes of each MAC address in the FDB table will be configured as dynamic and non-aging. After the attributes of each MAC address in the FDB table are configured as dynamic and non-aging, the attributes of each MAC address in the FDB table can also be detected to determine whether they are all dynamic and non-aging.
[0100] Second point: Since the FDB table and the second ARP table are constructed differently, the specific MAC addresses inside may also be different in quantity, etc. Therefore, in order to ensure the synchronization and consistency of the FDB table and the second ARP table, the second ARP table is compared with the FDB table within a preset time to determine the target MAC address and the corresponding output port that are stored in the FDB table but not stored in the second ARP table; the target MAC address and the corresponding output port are stored in the ARP table.
[0101] In addition, since the second ARP table provided by the present invention will be updated when the MAC address undergoes port migration, and the attributes of the MAC address will be configured to be dynamic and non-aging, and the attributes of the MAC address in the FDB table provided by the present invention will also be configured to be dynamic and non-aging, the overall action is completed by software, so when the software fails, both the second ARP table and the FDB will fail, and the displayed data may be incomplete. Therefore, each time the MAC address in the second ARP table undergoes port migration, the updated second ARP table and FDB table are compressed into a data packet, sent from the switch to the host, and stored in the host. When the software in the switch fails, and the host detects that the software in the switch fails, the data packet stored in the latest version of the second ARP table and FDB table is sent to the switch, so that the switch still has a complete second ARP table and FDB table at this time.
[0102] To sum up, the overall process of creating the second ARP table is as follows: Figure 4 As shown, the following process is included:
[0103] S20: The first ARP table is issued.
[0104] S21: Processing of VLAN interface.
[0105] S22: Setting the second ARP table of the switch chip.
[0106] S23: Reconfigure MAC address attributes.
[0107] In the embodiment, step S20: the first ARP table is sent, specifically: the first ARP table sent by the receiving protocol software, wherein the table items of the first ARP table include the three-layer interface, IP address and MAC address; step S21: the processing of the VLAN interface, specifically: if the three-layer interface is a VLAN interface, the FDB table in the switching chip is searched according to the VLAN ID and the MAC address to determine the corresponding output port; step S22: the second ARP table is constructed, specifically: the table items of the second ARP table of the switching chip include the IP address and the next hop information, and the next hop information includes the source MAC address, the VLAN interface, the destination MAC address and the output port. For the IP data packet received by the switching chip, when the routing table matches the host route (ARP table item) or the next hop is the route of the ARP, it is directly forwarded from the output port in the next hop; step S23: the reconfiguration of the MAC address attribute, specifically: modifying the attributes of the MAC address in the FDB table and the second ARP table, and configuring it to be dynamic and non-aging.
[0108] Among them, since steps S20-S23 are a summary of the above-mentioned embodiment, the embodiment corresponding to steps S20-S23 is the same as the above-mentioned embodiment, and the present invention will not be described in detail here.
[0109] In summary, the overall process of updating the second ARP table and MAC address according to the port migration of the MAC address is as follows: Figure 5 As shown, the following process is included:
[0110] S30: Periodically query the FDB table.
[0111] S31: Determine whether the MAC address has been port-migrated.
[0112] S32: Update the second ARP table of the switch chip.
[0113] S33: Update the FDB table in the switch chip.
[0114] S34: Update the FDB table stored in the protocol software.
[0115] In the embodiment, step S30: periodically query the FDB table, specifically: periodically query the FDB table of the switching chip, and compare the queried FDB table of the current cycle with the FDB table corresponding to the previous cycle saved by the software, and the query cycle must be less than the aging time of the FDB table; step S31: determine whether the MAC address has port migration, specifically: when there is a difference between the FDB table learned in the current cycle and the FDB table corresponding to the previous cycle, and the MAC address corresponding to the different egress port belongs to the second ARP table, that is, if the MAC address has port migration, and the new MAC address is marked as dynamic, and the MAC address saved by the protocol software is marked as statically migratable, then the MAC address is considered to be the MAC address of the ARP neighbor, and the send If the port migration of the ARP neighbor occurs, execute step S32, otherwise execute step S34; step S32: update the second ARP table of the switching chip, specifically: if the MAC port migration is received and the corresponding egress port after migration is determined, update the second ARP table of the switching chip, and set the egress port in the next hop associated with the second ARP table to the new port (target egress port) learned by the MAC address; step S33: update the FDB table in the switching chip, specifically: configure the attribute of the MAC address in the FDB table to be dynamic and non-aging; step S34: update the FDB table stored in the protocol software, specifically: for the MAC address of the ARP neighbor, configure it to be dynamic and non-aging, and for the MAC address of the non-ARP neighbor, record it by software.
[0116] Among them, since steps S30-S34 are a summary of the above-mentioned embodiment, the embodiment corresponding to steps S30-S34 is the same as the above-mentioned embodiment, and the present invention will not be described in detail here.
[0117] To sum up, the process flow chart of deleting ARP entries is as follows: Figure 6 As shown, the following process is included:
[0118] S40: The protocol software sends the ARP entry to be deleted.
[0119] S41: Determine whether the Layer 3 interface is a VLAN interface. If it is a VLAN interface, execute steps S42 and S43; otherwise, execute step S43.
[0120] S42: According to the MAC address corresponding to the ARP entry to be deleted, query the FDB table and delete it from the FDB table.
[0121] S43: Deleting from the second ARP table according to the ARP entry to be deleted.
[0122] Among them, since steps S40-S43 are a summary of the above-mentioned embodiment, the embodiment corresponding to steps S40-S43 is the same as the above-mentioned embodiment, and the present invention will not be described in detail here.
[0123] It can be seen that the present invention provides an address resolution protocol table configuration method, including: obtaining the first address resolution protocol table issued by the protocol software, and determining the second address resolution protocol table according to the first address resolution protocol table and the layer 2 MAC address table in the switching chip; if the first MAC address in the second address resolution protocol table undergoes port migration, then determining the target egress port corresponding to the first MAC address from the layer 2 MAC address table; updating the egress port corresponding to the second MAC address in the second address resolution protocol table to the target egress port, and configuring the attributes of each MAC address in the second address resolution protocol table and the layer 2 MAC address table to be dynamic and non-aging; the first MAC address and the second MAC address are the same MAC address. It can be seen that the present invention configures the attributes of the MAC addresses in the second address resolution protocol table and the layer 2 MAC address table to be dynamic and non-aging. On the one hand, since the attributes of the MAC address are dynamic, the MAC address in the present invention is not affected by port migration. When the MAC address in the second address resolution protocol table undergoes port migration, the switching chip can automatically learn the MAC address on the new port. When the software detects this change, the second address resolution protocol table and the layer 2 MAC address table are updated again, thereby ensuring the correctness of traffic forwarding. On the other hand, since the MAC address is non-aging, the switching chip will not age it, thus avoiding the problem of network service damage caused by different aging times of the MAC address in the Layer 2 MAC address table and the second address resolution protocol table.
[0124] In addition, the present invention also provides an address resolution protocol table configuration device, which specifically includes:
[0125] An ARP table entry setting unit receives a first ARP table sent by the protocol software, converts it into a second ARP table required by the switching chip, and sets it in the switching chip;
[0126] An ARP entry updating unit, when receiving a port migration of a MAC address corresponding to the second ARP, updates an egress port of the second ARP and sends a message to notify the update of the attribute of the MAC address;
[0127] The MAC address query unit periodically queries the FDB table of the switching chip and synchronously updates the software FDB table. When the MAC address changes, it sends a message to notify other modules for processing;
[0128] The MAC address updating unit receives and processes a message for updating the MAC address corresponding to the second ARP.
[0129] In the embodiment, the main function of the ARP table setting unit is: the protocol software in the switch generates a first address resolution protocol table, i.e., a first ARP table, through its own kernel protocol stack, and the first ARP table includes an IP address, a MAC address, and a layer 3 interface. The switching chip itself constructs a layer 2 MAC address table, i.e., an FDB table, through a learning function, and the FDB table includes a mapping of a MAC address and a virtual LAN interface ID (VLAN ID) to an egress port. Therefore, when the protocol software sends the first ARP table to the switching chip, the switching chip queries the FDB table according to the MAC address and other information in the first ARP table, and at this time, a complete set of corresponding relationships can be obtained: IP address, MAC address, virtual LAN interface ID and egress port, and a second address resolution protocol table, i.e., a second ARP table, is constructed according to this set of corresponding relationships, and the second ARP table includes four table items, namely: IP address, MAC address, VLAN ID (layer 3 interface), and egress port.
[0130] The main function of the ARP table entry update unit is: when the three-layer interface is a VLAN interface, it specifically includes a physical port. When the switch is connected, port migration is very likely to occur, that is, the MAC address that originally corresponds to port 1 corresponds to port 2 after the port migration occurs. In this case, since the FDB table is built by the switching chip itself, when port migration occurs, it is automatically updated in the FDB table, but it cannot be updated in the second ARP table. Therefore, if data needs to be sent at this time, it cannot be sent from the latest port. Therefore, it is necessary to determine the target port after migration corresponding to the first MAC address where the port migration occurs from the FDB table, so as to reconfigure it according to the target port in the second ARP table, and configure the attributes of the MAC in the second ARP table to be dynamic and non-aging.
[0131] The main function of the MAC address query unit is to compare the layer 2 MAC address table corresponding to the current cycle with the layer 2 MAC address table corresponding to the previous cycle to obtain the corresponding comparison result; determine whether the first MAC address in the second address resolution protocol table has undergone port migration based on the comparison result, and if port migration has occurred, store the layer 2 MAC address table corresponding to the current cycle in the protocol software to replace the layer 2 MAC address table corresponding to the previous cycle in the protocol software; if there are different egress ports in the layer 2 MAC address table corresponding to the current cycle and the layer 2 MAC address table corresponding to the previous cycle, determine whether the MAC address corresponding to the different egress port belongs to the second address resolution protocol table; if it belongs to the second address resolution protocol table, determine that the first MAC address in the second address resolution protocol table has undergone port migration; if the layer 2 MAC address table corresponding to the current cycle is exactly the same as the layer 2 MAC address table corresponding to the previous cycle, determine that the first MAC address in the second address resolution protocol table has not undergone port migration, and configure the MAC address with dynamic attributes in the layer 2 MAC address table corresponding to the current cycle to be dynamic and non-aging.
[0132] The main function of the MAC address update unit is to configure the attributes of the MAC address in the FDB table to be dynamic and non-aging.
[0133] Among them, since the address resolution protocol table configuration device provided by the present invention corresponds to the above-mentioned address resolution protocol table configuration method, the embodiment of its address resolution protocol table configuration device is the same as the embodiment corresponding to the above-mentioned address resolution protocol table configuration method, the present invention will not be repeated here, and at the same time has the same beneficial effects.
[0134] Figure 7 A structural diagram of a switch provided by an embodiment of the present invention, such as Figure 7 As shown, the switch includes: a memory 60 for storing a computer program;
[0135] The processor 61 is used to implement the steps of the address resolution protocol table configuration method in the above embodiment when executing the computer program.
[0136] The switch provided in this embodiment may include but is not limited to a smart phone, a tablet computer, a laptop computer, or a desktop computer.
[0137] Among them, the processor 61 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 61 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 61 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 61 may be integrated with a graphics processing unit (GPU), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 61 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.
[0138] The memory 60 may include one or more computer-readable storage media, which may be non-transitory. The memory 60 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 60 is at least used to store the following computer program 601, wherein, after the computer program is loaded and executed by the processor 61, it can implement the relevant steps of the address resolution protocol table configuration method disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 60 may also include an operating system 602 and data 603, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 602 may include Windows, Unix, Linux, etc.
[0139] In some embodiments, the switch may also include a display screen 62 , an input / output interface 63 , a communication interface 64 , a power supply 65 , and a communication bus 66 .
[0140] Those skilled in the art will understand that Figure 7 The structure shown in the figure does not constitute a limitation on the switch, and may include more or fewer components than shown in the figure.
[0141] It is understandable that if the address resolution protocol table configuration method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the current technology or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and executes all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, magnetic disk or optical disk and other media that can store program code.
[0142] Based on this, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned address resolution protocol table configuration method are implemented.
[0143] The above is a detailed introduction to a switch provided by an embodiment of the present invention. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0144] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0145] The above is a detailed introduction to an address resolution protocol table configuration method, switch, medium and product provided by the present invention. This article uses specific examples to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.
Claims
1. A method for configuring an address resolution protocol table, characterized in that: include: Obtain a first address resolution protocol table issued by the protocol software, and construct a second address resolution protocol table according to the ID of the virtual LAN interface in the first address resolution protocol table, the IP address and MAC address corresponding to the virtual LAN interface, and the corresponding output port in the layer 2 MAC address table in the switching chip; If port migration occurs to the first MAC address in the second address resolution protocol table, determining the target egress port corresponding to the first MAC address from the layer 2 MAC address table; The egress port corresponding to the second MAC address in the second address resolution protocol table is updated to the target egress port, and the attributes of each MAC address in the second address resolution protocol table and the second-layer MAC address table are configured to be dynamic and non-aging; the first MAC address and the second MAC address are the same MAC address.
2. The method for configuring an address resolution protocol table according to claim 1, characterized in that: Also includes; Compare the layer 2 MAC address table corresponding to the current cycle with the layer 2 MAC address table corresponding to the previous cycle to obtain a corresponding comparison result; Based on the comparison result, determine whether port migration occurs for the first MAC address in the second address resolution protocol table; if port migration occurs, store the layer 2 MAC address table corresponding to the current cycle in the protocol software to replace the layer 2 MAC address table corresponding to the previous cycle in the protocol software.
3. The method for configuring an address resolution protocol table according to claim 2, characterized in that: The determining, based on the comparison result, whether the first MAC address in the second address resolution protocol table has port migration, comprises: If there are different egress ports in the layer 2 MAC address table corresponding to the current cycle and the layer 2 MAC address table corresponding to the previous cycle, determine whether the MAC address corresponding to the different egress port belongs to the second address resolution protocol table; If it belongs to the second address resolution protocol table, it is determined that the first MAC address in the second address resolution protocol table undergoes port migration.
4. The method for configuring an address resolution protocol table according to claim 2, characterized in that: The determining, based on the comparison result, whether the first MAC address in the second address resolution protocol table has port migration, comprises: If the layer 2 MAC address table corresponding to the current cycle is exactly the same as the layer 2 MAC address table corresponding to the previous cycle, it is determined that no port migration has occurred for the first MAC address in the second address resolution protocol table, and the MAC address with dynamic attributes in the layer 2 MAC address table corresponding to the current cycle is configured as dynamic and non-aging.
5. The method for configuring an address resolution protocol table according to claim 1, characterized in that: The first address resolution protocol table issued by the acquisition protocol software includes: The protocol software is controlled to obtain the address information in the data packet currently received by the switch, so that the protocol software generates the first address resolution protocol table according to the IP address, MAC address and layer 3 interface in the address information, and sends it to the switching chip.
6. The method for configuring an address resolution protocol table according to claim 5, characterized in that: Also includes: Get the source MAC address and virtual LAN interface ID in the data packet sent by the host to the slave through the switch; Obtaining a destination MAC address and an egress port in a response message corresponding to the data packet sent by the slave to the host through the switch; The source MAC address, the ID of the virtual LAN interface, the destination MAC address and the egress port are learned to generate the layer 2 MAC address table.
7. The method for configuring an address resolution protocol table according to claim 6, characterized in that: Constructing a second address resolution protocol table according to the ID of the virtual LAN interface in the first address resolution protocol table, the IP address and MAC address corresponding to the virtual LAN interface, and the corresponding outbound port in the layer 2 MAC address table in the switching chip, including: Obtaining a layer-3 interface in the first address resolution protocol table, and determining whether the layer-3 interface in the first address resolution protocol table is the virtual local area network interface; If the third-layer interface is the virtual LAN interface, the second address resolution protocol table is constructed based on the ID of the virtual LAN interface in the first address resolution protocol table, the IP address and MAC address corresponding to the virtual LAN interface, and the corresponding output port in the second-layer MAC address table.
8. The method for configuring an address resolution protocol table according to claim 1, wherein: After configuring the attribute of each MAC address in the second address resolution protocol table to be dynamic and non-aging, the method further includes: Detecting the attributes of each MAC address in the second address resolution protocol table; If the attributes of each MAC address in the second address resolution protocol table are dynamic and non-aging, an update instruction of the layer 2 MAC address table is sent to the switching chip to configure the attributes of each MAC address in the layer 2 MAC address table to be dynamic and non-aging.
9. The method for configuring an address resolution protocol table according to claim 1, characterized in that: Also includes: Determining whether a deletion instruction issued by the protocol software is received; If the deletion instruction sent by the protocol software is received, then obtaining the address resolution protocol table entry to be deleted in the deletion instruction; Determining whether the layer 3 interface in the second address resolution protocol table is a virtual local area network interface; If the third-layer interface is the virtual LAN interface, obtain the MAC address to be deleted in the address resolution protocol table entry to be deleted, delete the MAC address to be deleted in the second-layer MAC address table, and delete the address resolution protocol table entry to be deleted in the second address resolution protocol table.
10. The method for configuring an address resolution protocol table according to claim 9, characterized in that: Also includes: If the layer-3 interface is not the virtual LAN interface, the address resolution protocol entry to be deleted in the second address resolution protocol table is deleted.
11. The method for configuring an address resolution protocol table according to any one of claims 1 to 10, characterized in that: Also includes: Determining whether an addition instruction issued by the protocol software is received; If the adding instruction sent by the protocol software is received, then obtaining the MAC address to be added in the adding instruction; The MAC address to be added is added to the layer 2 MAC address table, and the attribute of the MAC address to be added is configured as dynamic and non-aging.
12. The method for configuring an address resolution protocol table according to claim 11, characterized in that: Also includes: Comparing the second address resolution protocol table with the layer 2 MAC address table within a preset time to determine a target MAC address and a corresponding egress port that are stored in the layer 2 MAC address table and are not stored in the second address resolution protocol table; The target MAC address and the corresponding egress port are stored in the second address resolution protocol table.
13. A switch, characterized in that: include: Memory for storing computer programs; A processor is used to execute the computer program to implement the steps of the address resolution protocol table configuration method as described in any one of claims 1 to 12.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the address resolution protocol table configuration method according to any one of claims 1 to 12 are implemented.
15. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the steps of the address resolution protocol table configuration method described in any one of claims 1 to 12 are implemented.
Citation Information
Patent Citations
A method and device for updating port address in address parsing protocol table
CN101127709A
Method for preventing network interruption caused by address aging and time inconformity
CN1992672A