A message forwarding method and device, electronic equipment and storage medium
By introducing an extended address table into the switching network board in the switching equipment, the flooding forwarding problem caused by the limited capacity of the service board is solved, and more efficient packet forwarding and resource utilization are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- RUIJIE NETWORKS CO LTD
- Filing Date
- 2022-10-31
- Publication Date
- 2026-07-03
AI Technical Summary
Existing switch equipment has limited address table entries due to the limited capacity of service cards. When the relevant address table entry cannot be found, flooding is required for forwarding, resulting in wasted system bandwidth and low hardware resource utilization.
Introducing a switching network board into the switching device expands the address table. By querying the packet information that does not match the address table of the service board through the switching network board, unicast forwarding is achieved, reducing flooding forwarding.
It increases the probability of address table lookup, reduces flooding forwarding, saves system bandwidth, and improves hardware resource utilization.
Smart Images

Figure CN117997832B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a message forwarding method, apparatus, electronic device, and storage medium. Background Technology
[0002] A message is a data unit that is exchanged and transmitted in a network. When different systems interact, they can exchange information through messages. Network devices with forwarding functions, such as switches, can be used for message exchange and forwarding. The following examples will use switches.
[0003] In related technologies, after a message is sent to a switch, the switch uses the destination Media Access Control (MAC) address and the Virtual Local Area Network (VLAN) information carried in the message to check whether there is an address entry related to the forwarding information on the address table of the service card that received the message. If there is, the switch forwards the message according to the port corresponding to the address entry.
[0004] However, in practical applications, due to the limited capacity of a service board, the number of address entries that the service board can store is also limited. Alternatively, the service board may not have previously learned to store address entries, resulting in many cases where the relevant address entries cannot be found. For a packet in such a situation, the switch needs to query all ports corresponding to the VLAN to which the port responsible for sending the packet belongs, in order to flood the packet from all other ports corresponding to the VLAN except for the receiving port. Excessive flooding causes a waste of system bandwidth and results in low hardware resource utilization of the switch network device. Summary of the Invention
[0005] This application provides a message forwarding method, apparatus, electronic device, and storage medium to solve the problem of bandwidth waste caused by excessive flooding during message forwarding.
[0006] This application provides a message forwarding method, including:
[0007] Based on the forwarding information of the message to be processed, a matching address entry is queried in the first address table of the initial board in the network device;
[0008] If the address entry is not found in the first address table, based on the forwarding information, a matching address entry is searched in the second address table of the switching board in the network device.
[0009] If a matching address entry is found in the second address table, the packet to be processed is forwarded through the target forwarding port in the matching address entry.
[0010] This application provides a message forwarding device, comprising:
[0011] The acquisition unit is used to query a matching address entry in the first address table of the initial board in the network device based on the forwarding information of the message to be processed.
[0012] The query unit is configured to, when the address entry is not found in the first address table, query the second address table of the switching board in the network device based on the forwarding information;
[0013] The forwarding unit is used to forward the packet to be processed through the target forwarding port in the matching address entry when a matching address entry is found in the second address table.
[0014] Optionally, the device further includes:
[0015] The determining unit is configured to obtain a pre-configured target packet type from a pre-configured forwarding table before querying a matching address entry in the second address table of the switching board in the network device based on the forwarding information; wherein the target packet type is a packet type that is not allowed to be redirected.
[0016] If it is determined that the message to be processed does not belong to the target message type, the message to be processed is sent to the switching network board.
[0017] Optionally, the forwarding information includes destination VLAN information;
[0018] If it is determined that the message to be processed belongs to the target message type, the forwarding unit is further configured to:
[0019] Obtain multiple member forwarding ports corresponding to the destination VLAN information;
[0020] The messages to be processed are flooded and forwarded through the multiple member forwarding ports.
[0021] Optionally, the device further includes:
[0022] The learning unit is configured to obtain the source information of the received historical forwarded packets and the forwarding port for receiving the historical forwarded packets before querying the second address table of the switching board in the network device based on the forwarding information to find a matching address entry; wherein the source information includes the source MAC address of the historical forwarded packets and the source VLAN information.
[0023] In the first address table, an address entry that matches the source information is queried to obtain a first query result;
[0024] If the first query result satisfies the preset first address table expansion condition, then the source information and the forwarding port are stored in the second address table; wherein, the first address table expansion condition is: no address table entry matching the source information is found in the first address table, and the historical forwarded packet does not belong to the target packet type.
[0025] Optionally, if the number of switching boards in the network device is one, then the learning unit is specifically used for:
[0026] In the second address table of the switching network board, the address entry that matches the source information is queried to obtain the second query result;
[0027] If the second query result satisfies the preset second address table expansion condition, then the source information and the forwarding port are stored in the second address table of the switching network board; wherein, the second address table expansion condition is: no address table entry matching the source information is found in the second address table, and the second address table has storage space.
[0028] Optionally, if the number of switching boards in the network device is at least two, then the learning unit is specifically used for:
[0029] Based on the network board routing order, determine the current network board to be routed from at least two of the said network boards;
[0030] Based on the pre-configured forwarding table, the historical forwarded packets are redirected to the current switching network board;
[0031] In the second address table of the current switching network board, the address entry that matches the source information is queried to obtain the second query result;
[0032] If the second query result satisfies the preset second address table expansion conditions, then based on the source information and the forwarding port, a new address table entry is generated and stored in the second address table of the current switching network board.
[0033] Optionally, if the first query result does not satisfy the first address table expansion condition, the learning unit is further configured to:
[0034] If the first query result indicates that no address table entry matching the source information is found in the first address table, and the first address table has storage space, then a new address table entry is generated based on the source information and the forwarding port; and the new address table entry is stored in the first address table.
[0035] Optionally, the query unit is specifically used for:
[0036] If the number of the switching network boards is one, then based on the forwarding information, a matching address entry is queried in the second address table of the switching network board;
[0037] If the number of switching network boards is at least two, then based on the forwarding information and the preset network board query order, the matching address entries are queried sequentially in the second address table of each of the switching network boards.
[0038] An electronic device provided in this application includes a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of any of the above-described message forwarding methods.
[0039] This application provides a computer-readable storage medium including a computer program. When the computer program is run on an electronic device, the computer program is used to cause the electronic device to perform the steps of any of the above-described message forwarding methods.
[0040] This application provides a computer program product, which includes a computer program stored in a computer-readable storage medium. When the processor of an electronic device reads the computer program from the computer-readable storage medium, the processor executes the computer program, causing the electronic device to perform the steps of any of the above-described message forwarding methods.
[0041] The beneficial effects of this application are as follows:
[0042] This application provides a message forwarding method, apparatus, electronic device, and storage medium. In related technologies, after a message is sent to a device, subsequent forwarding requires the device to query the address table on the service board that received the message to obtain the forwarding port. However, since a service board can only store a limited number of address entries, there is a possibility that the relevant address entry cannot be found in the address table. In such cases, message flooding is required, further wasting system bandwidth and resulting in low hardware resource utilization. This application expands the address table by using a switching network board. In addition to the service boards, the switching network board also stores the address table. When a service board receives a packet but cannot find an address table entry matching the packet's forwarding information, it redirects the packet to the switching network board to continue searching for a matching entry. Once found, the device unicasts the packet from the forwarding port in the address table entry. Because this application uses both the switching network board and the service boards to store the address table, and both can query the address table entries corresponding to the packet's forwarding information, the probability of finding the corresponding address table entry is increased, flooding is reduced, system bandwidth is further saved, and hardware resource utilization is improved.
[0043] Other features and advantages of this application will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the application. The objectives and other advantages of this application may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings. Attached Figure Description
[0044] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0045] Figure 1 This is a schematic diagram illustrating an application scenario of a message forwarding method provided in an embodiment of this application.
[0046] Figure 2 A flowchart illustrating the implementation of a message forwarding method provided in this application embodiment;
[0047] Figure 3 An address representation schematic provided for an embodiment of this application;
[0048] Figure 4 A schematic diagram of a rule table provided for an embodiment of this application;
[0049] Figure 5 A schematic diagram of message flooding and forwarding provided in this application embodiment;
[0050] Figure 6 A logical diagram illustrating a message forwarding and diversion process provided in an embodiment of this application;
[0051] Figure 7 A logical diagram illustrating the configuration of a switching network board is provided in an embodiment of this application.
[0052] Figure 8 A schematic diagram of a switching network board overlay mode provided in an embodiment of this application;
[0053] Figure 9 A comparison diagram of a related technology provided for an embodiment of this application and the address table construction of this application;
[0054] Figure 10 A logical comparison diagram of a related technology and message forwarding in this application, provided for an embodiment of this application;
[0055] Figure 11 Another overall flowchart for message forwarding provided in this application embodiment;
[0056] Figure 12 An overall flowchart of address table learning is provided for an embodiment of this application;
[0057] Figure 13 A schematic diagram of the composition structure of a message forwarding device provided in this application embodiment;
[0058] Figure 14 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0059] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings of the embodiments of this application. Obviously, the described embodiments are only some embodiments of the technical solutions of this application, and not all embodiments. Based on the embodiments recorded in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the technical solutions of this application.
[0060] The following describes some of the concepts involved in the embodiments of this application.
[0061] Message: A data unit exchanged and transmitted in a network, containing complete data information to be sent. In this application, messages are divided into two main categories according to the order of processing: pending messages and historical forwarded messages. Pending messages are messages currently received by the service board and awaiting forwarding, while historical forwarded messages are messages received by the service board in the historical time before the current moment. The historical forwarded messages in this application can be used to generate address table entries and store them based on the corresponding source information and the forwarding port that received the historical forwarded message.
[0062] Forwarding information includes the destination MAC address of the packet and the VLAN information of the target forwarding port of the packet. The destination MAC address is used to identify the location of the target device for packet forwarding in the network. A VLAN is a logical network divided from a physical network.
[0063] Source information: This includes the source MAC address of the packet and the source VLAN information. The source VLAN information can be carried in the packet itself or the VLAN information of the forwarding port that received the packet.
[0064] Forwarding port: On the service board of the relevant device, the port for forwarding packets can include the port for receiving packets and the port for sending packets. In this application, it includes target forwarding port, member forwarding port, etc. The target forwarding port can be queried through the packet forwarding information. The member forwarding port is all forwarding ports corresponding to the same VLAN. If the target forwarding port can be found through the packet forwarding information, the device will unicast the packet from the target forwarding port. Otherwise, according to the VLAN information in the forwarding information, it will flood the packet from all forwarding ports corresponding to that VLAN.
[0065] Boards: including service boards and switching boards. Service boards are used to receive and send data externally, and switching boards are used for internal data exchange within the device. In this application, service boards are used to store address tables, receive messages, and forward messages, while switching boards are used to store address tables to enable address table expansion. Among them, the service board that receives a message is the initial board corresponding to that message, and the switching board that stores address table entries generated based on the source information of historically forwarded messages and the forwarding port that receives the message is the target switching board.
[0066] Address table: Contains multiple address table entries. Each address table entry stores VLAN information, a MAC address, and the corresponding forwarding port. Specifically, based on the forwarding information of a packet, the target forwarding port of the packet can be queried in the address table. Alternatively, the source information of the packet and the forwarding port receiving the packet can be stored in the address table as one of the address table entries. In this application, the address table includes a first address table and a second address table. The address table stored on the initial board is the first address table, and the address table stored on the switching board is the second address table.
[0067] Forwarding table: Stores the target message type and the port to be forwarded. If the message to be forwarded to the target port cannot be found on the initial board, and the message type does not belong to the target message type, it can be forwarded to the switching board based on the port to be forwarded in the forwarding table.
[0068] Dive port: A pre-defined, non-external physical port. When the destination forwarding port of the packet to be processed cannot be found on the initial board, the packet to be processed is diverted to the switching board through the dive port.
[0069] Address table expansion conditions include a first address table expansion condition and a second address table expansion condition. The first address table expansion condition is used to filter out historical forwarded packets to redirect them to the switching board for address table learning and expansion. The second address table expansion condition is used to filter out historical forwarded packets that will store the address table entries generated based on the source information and the forwarding port of the received packet into the second address table of the target switching board, so as to store the newly generated address table entries into the switching board and realize address table expansion.
[0070] The preferred embodiments of this application are described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit this application. Furthermore, the embodiments and features in the embodiments of this application can be combined with each other without conflict.
[0071] like Figure 1 The diagram shown is an application scenario illustration of an embodiment of this application. The application scenario diagram includes a source device 110, a network device 120, and a target device 130.
[0072] The source device and the target device can be either a terminal device or a server. Figure 1 The example used here is a terminal device.
[0073] In this application embodiment, the terminal device includes, but is not limited to, mobile phones, tablets, laptops, desktop computers, vehicle terminals, and other devices; the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0074] It should be noted that the message forwarding methods in the various embodiments of this application can be executed by electronic devices, namely network devices (hereinafter referred to as network devices), such as... Figure 1 As shown.
[0075] Taking network device 120 as an example, in an artificial intelligence scenario, source device 110 sends a message to target device 130. The message is first sent to network device 120, and then forwarded by network device 120 to target device 130. A certain service board of network device 120 receives the message to be processed and now needs to forward it. Network device 120 obtains the forwarding information of the packet to be processed. In the address table on the service board that receives the packet, i.e., the initial board, it searches for an address entry that matches the forwarding information. If network device 120 cannot find the entry in the address table on the initial board, it obtains a routing port that can redirect the packet to be processed to the switching board according to the pre-configured forwarding table. Then, it redirects the packet to be processed to at least one switching board through the routing port. After that, network device 120 searches for an address entry that matches the forwarding information in the address table of each switching board. If a match is found, network device 120 unicasts the packet to be processed from the target forwarding port according to the target forwarding port in the matching address entry.
[0076] In one alternative implementation, the source device 110, the network device 120, and the target device 130 can communicate via a communication network.
[0077] In one alternative implementation, the communication network is a wired network or a wireless network.
[0078] It should be noted that, Figure 1 The examples shown are merely illustrative. In reality, the number of source device 110, network device 120, and target device 130 is not limited and is not specifically limited in this embodiment.
[0079] Furthermore, the embodiments of this application can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, and smart transportation.
[0080] The following describes the message forwarding method provided by the exemplary embodiments of this application in conjunction with the application scenarios described above and with reference to the accompanying drawings. It should be noted that the above application scenarios are only shown to facilitate understanding of the spirit and principles of this application, and the embodiments of this application are not limited in any way in this respect.
[0081] See Figure 2 This is a flowchart illustrating the implementation of a message forwarding method provided in this application embodiment. Taking network device 120 alone as an example, the specific implementation process of this method is as follows: S201-S203:
[0082] S201: Based on the forwarding information of the message to be processed, look up the matching address entry in the first address table of the initial board in the network device.
[0083] In the above, the network device refers to a device with packet forwarding capabilities, such as a switch network device. The following examples all use switch network devices. A switch network device includes service cards and a switching network board. The packet to be processed is the packet currently received by the service card and is to be forwarded. The forwarding information includes the destination MAC address of the packet to be processed and the VLAN information of the target forwarding port of the packet to be processed. The initial card is the local service card that receives the packet to be processed; the local service card is the service card of the switch network device. The first address table is the address table stored on the initial card. The forwarding port is the port on the service card of the relevant device that forwards packets, which may include the port for receiving packets and the port for sending packets. In this embodiment, the forwarding port is a port visible to the user, while the internal port of the switching network board is a port invisible to the user.
[0084] Specifically, the address table contains multiple address table entries, such as Figure 3 The diagram illustrates an address representation provided in this application. Each address entry stores a VLAN and a MAC address, along with a corresponding forwarding port. Combining a VLAN and a MAC address will result in only one forwarding port. For example, combining VLAN 1 with MAC address 0000.0000.1111 will result in port 1; combining VLAN 1 with MAC address 0000.0000.1112 will result in port 1; combining VLAN 2 with MAC address 0000.0000.1113 will result in port 2, and so on.
[0085] The address table entries mentioned above are obtained based on address table learning. Initially, the address table of the switch network device is empty. When a service card of the switch network device receives a packet, it learns the address table based on the source information of the packet and the forwarding port that received the packet. The source information includes the source MAC address and source VLAN information of the packet. The address table learning content includes: MAC, VLAN, and port. The MAC is the source MAC information carried by the packet, and the VLAN is the source VLAN information. There are two cases for the VLAN value: the first case is that the packet itself carries VLAN information, then the VLAN information carried by the packet is used; the second case is that the packet does not carry VLAN information, then the VLAN information of the forwarding port that received the packet belongs to is used. The address table entries generated by address learning are stored on the service card that received the packet. That is, after the initial card, the address can be synchronized to other in-situ service cards through the card's address synchronization function, ensuring that the address table information of all service cards of the switch network device is consistent.
[0086] For example, suppose a service card L1 of a network switch receives a message M1 to be processed. Service card L1 is the initial card for message M1. If the network switch finds that its first address table does not contain an address entry corresponding to the source information of M1, and the address table space of service card L1 is not full, then the network switch obtains the source information of M1 and the forwarding port that received M1. Based on the source information and the forwarding port, it generates a new address entry and stores it in the address table of service card L1. The network switch also obtains the forwarding information of the message M1 to be processed and, based on this forwarding information, searches for a matching address entry in the first address table of service card L1.
[0087] As described above, based on the address learning of the message and the order of message forwarding, address learning can be performed first and then message forwarding can be performed, or address learning and message forwarding can be performed simultaneously. This application does not make any specific limitations.
[0088] S202: If no address entry is found in the first address table, based on the forwarding information, a matching address entry is searched in the second address table of the switching board in the network device.
[0089] In the above scenario, if no address table entry is found in the first address table, the switch network device will also obtain the pre-configured target packet type from the pre-configured forwarding table. The target packet type is a packet type that is not allowed to be redirected. If it is determined that the packet to be processed does not belong to the target packet type, the pre-configured redirection port in the forwarding table will be obtained. The redirection port is an internal port of the switching network board. Then, based on the redirection port, the packet to be processed will be redirected to the switching network board.
[0090] Specifically, if the switch network device does not find the address table entry corresponding to the forwarding information of the packet to be processed in the first address table, the switch network device obtains multiple member forwarding ports corresponding to the destination VLAN information of the packet to be processed, as well as the pre-configured target packet type in the forwarding table. The target packet type is a packet type that is not allowed to be redirected, including multicast packets, tunnel packets, and Layer 3 packets, which can be stored in the forwarding table in the form of a rule table, such as... Figure 4 The diagram shown is a schematic of a rule table provided in an embodiment of this application. It includes three rules: when the packet is a multicast packet, a tunnel packet, or a Layer 3 packet, the switch network device will not redirect the packet.
[0091] The forwarding information includes the destination MAC address of the packet to be processed and the destination VLAN information of the target forwarding port of the packet to be processed. The forwarding table is pre-configured and stores the target packet type and the referrer port. The referrer port is a preset physical port that is not exposed to the outside. When the destination forwarding port of the packet to be processed cannot be found on the initial board, the packet to be processed is referred to the switching board based on the referrer port.
[0092] Subsequently, if the switch network device determines that the packet to be processed does not belong to the target packet type, it retrieves the pre-configured redirection port in the forwarding table and redirects the packet to the switching network board based on the redirection port. If the switch network device determines that the packet to be processed belongs to the target packet type, it floods the packet through multiple member forwarding ports other than the forwarding port that receives the packet. Assuming the packet is flooded through the member forwarding ports of its VLAN, such as... Figure 5 The diagram shown is a message flooding forwarding schematic provided in an embodiment of this application. The VLAN includes service card 1 and service card 2 of the network device. The message flooding forwarding is then carried out through the VLAN member forwarding ports of service card 1 and service card 2.
[0093] Furthermore, if the switch network device directly finds the address table entry corresponding to the forwarding information of the packet to be processed in the first address table, the switch network device directly obtains the target forwarding port of the packet to be processed from the address table entry, and unicasts the packet to be processed from the target forwarding port.
[0094] Taking the assumption in S201 as an example again, such as Figure 6 The diagram shown is a logical schematic of a packet forwarding diversion process provided in an embodiment of this application. After the relevant address table entry cannot be found in the address table of the initial board L1, the packet M1 to be processed will be marked as an unknown packet. The switch network device obtains all member forwarding ports of the VLAN to which its target forwarding port belongs, and then sends the packet M1 to be processed to the diversion port based on the forwarding table.
[0095] Specifically, after the switch network device obtains all member forwarding ports of the VLAN to which its target forwarding port belongs, it also obtains the pre-configured target packet types in the forwarding table, namely multicast packets, tunnel packets, and Layer 3 packets. If it determines that the packet to be processed, M1, does not belong to any of the above three types of packets, it obtains the redirection port in the forwarding table. Then, based on the redirection port, the switch network device redirects the packet to be processed to the switching board. The above redirection process can be implemented through the board's own registers, rather than using a redirection method, and will not occupy the hardware resources of the Access Control List (ACL). The redirection port is the packet exit specified by the forwarding table, and can be a physical port that is not exposed to the outside, such as an inline port (HIGIG).
[0096] Further assuming that service board L2 receives a message M2 to be processed, and the switch network device directly finds the address entry corresponding to the forwarding information of the message M2 in the first address table of service board L2, then the switch network device directly obtains the target forwarding port P2 of M2 from the address entry and forwards M2 unicast from the target forwarding port P2; assuming that service board L3 receives a message M3 to be processed, and the switch network device does not find the address entry corresponding to the forwarding information of the message M3 in the first address table of service board L3, but the message M3 is a multicast message, then the switch network device obtains multiple member forwarding ports corresponding to the destination VLAN information in the forwarding information, and floods forwards the message M3 through the multiple member forwarding ports.
[0097] In addition, after routing the packets to be processed to the switching network board, the switch network device queries the second address table of the switching network board for a matching address entry based on the forwarding information.
[0098] Optionally, if the number of switching network boards in the switch network device is one, the switch network device queries the second address table of the switching network board based on the forwarding information; if the number of switching network boards in the switch network device is at least two, the switch network device queries the second address table of each switching network board sequentially based on the forwarding information and the preset network board query order.
[0099] Using the assumption in S202 as an example, the switch network device redirects the packet M1 to be processed to the switching board. Assuming there are multiple switching boards, the switch network device sequentially queries the second address table of each switching board to find the matching address entry.
[0100] In the above, the specific routing order can be a pre-arranged fixed order or a randomly selected one. That is, the switch network device randomly selects a switching board, let's say the selected switching board is S1, and redirects the packet M1 to be processed to the switching board S1. Then, it searches for a matching address entry in the second address table of the switching board S1. If no matching entry is found, the switch network device randomly selects another switching board from the remaining switching boards, let's say the selected switching board is S2. The switch network device redirects the packet M1 to be processed to the switching board S2, and searches for a matching address entry in the second address table of the switching board S2, and so on.
[0101] Furthermore, the address table stored on the switching network board is a second address table, and the second address table of each switching network board is an extended address table pre-built based on the first address table; before the second address table is pre-built, such as Figure 7 The diagram shown is a logical schematic of setting up a switching network board according to an embodiment of this application. The switching network device needs to disable the address synchronization function of at least one switching network board; enable the address learning function of at least one switching network board; and map the forwarding ports and corresponding port attributes of the initial board on at least one switching network board. Disabling the address synchronization function of the switching network board can significantly expand the address table capacity. Enabling the address learning function on the routing ports of the switching network board allows the switching network board to also learn the address table. Mapping the learning capability of the forwarding ports of the service boards on the switching network board inherits the learning attributes of the forwarding ports of the service boards, maintaining consistency, thereby ensuring the superposition and scalability of the address table capacity.
[0102] Specifically, each second address table is constructed as follows: the switch network device obtains the source information of the received historical forwarded packets and the forwarding port used to receive the historical forwarded packets, and queries the first address table for the address table that matches the source information to obtain the first query result.
[0103] In the above, the historical forwarded message is a message received by the service board, which waits to generate an address table entry and store it based on the source information and the forwarding port that received the historical forwarded message.
[0104] If the corresponding first query result satisfies the preset first address table expansion condition, the switch network device determines the number of switching network boards. If the number of switching network boards is one, the switch network device, based on the pre-configured forwarding table, redirects historical forwarded packets to that switching network board and queries the second address table of the switching network board for an address entry that matches the source information to obtain the second query result. If the corresponding second query result satisfies the preset second address table expansion condition, a new address entry is generated based on the source information and the forwarding port that received the historical forwarded packet, and stored in the second address table of the switching network board. If the number of switching network boards is at least two, the switch network device, based on the network board redirection order, determines the current switching network board to be redirected from at least two switching network boards and redirects historical forwarded packets to the current switching network board based on the pre-configured forwarding table. The switch network device queries the second address table of the current switching network board for an address entry that matches the source information to obtain the second query result. If the second query result satisfies the preset second address table expansion condition, a new address entry is generated based on the source information and the forwarding port, and stored in the second address table of the current switching network board.
[0105] The conditions for expanding the first address table include: no address table entry matching the source information is found in the first address table, the storage space of the first address table is full, and the historically forwarded packets do not belong to the target packet type; the target packet types include: multicast packets, tunnel packets, and Layer 3 packets; the conditions for expanding the second address table include: no address table entry matching the source information is found in the second address table, and the second address table has storage space. The network board routing order can be pre-set or randomly selected by the switch network device; this application does not impose any restrictions.
[0106] The specific number of switching network boards mentioned above can be determined based on the capacity requirements of the application scenario. If the address table space of the switching network boards is insufficient, it can be decided whether to use a superposition mode, such as... Figure 8 The diagram shown is a schematic of a switching network board stacking mode provided in an embodiment of this application, that is, enabling more in-situ switching network boards to expand the address table, and the addresses installed on each switching network board are different.
[0107] like Figure 9The diagram shows a comparison between a related technology and the address table construction method of this application. In the related technology, after a switch network device receives a historically forwarded packet, it only searches for a relevant address table entry in the initial board based on the source information. If the entry is not found and the address table of the initial board has space, a new address table entry is inserted into the initial board. If the entry is found or the address table of the initial board has no space, the address is not learned. In contrast, this application, when the entry is not found and the address table of the initial board has no space, determines whether the packet can be redirected based on its type. If the packet cannot be redirected, the address is not learned. If the packet can be redirected, it is redirected to the switching board, where a relevant address table entry is searched based on the source information. If the entry is not found, a new address table entry is inserted into the switching board. If the entry is found, the address is not learned.
[0108] In addition, the process of redirecting historical forwarded packets to the switching network board by the switch network device adopts a redirection method. Specifically, the historical forwarded packets can be redirected to a pre-set internal port. This internal port can be a virtual port that is not currently used by the system or a physical port that is not exposed to the outside. Then, based on the pre-set correspondence between the internal port and the redirection port, the historical forwarded packets are redirected to the corresponding redirection port so that the historical forwarded packets can be redirected to the switching network board through the redirection port. Alternatively, the historical forwarded packets can be directly redirected to the redirection port and then to the switching network board through the redirection port.
[0109] The correspondence between the internal opening and the drainage opening mentioned above can be predefined by relevant personnel, and this article does not impose specific restrictions.
[0110] Optionally, if the first query result indicates that no address table entry matching the source information is found in the first address table, and the first address table has storage space, the switch network device generates a new address table entry based on the source information and the forwarding port of the historical forwarded packet; and stores the new address table entry in the first address table.
[0111] If the first query result indicates that an address entry matching the source information is found in the first address table, or that the message type of the message to be processed belongs to the target message type, then the query ends. If the second query result indicates that an address entry matching the source information is found in the second address table of a certain switching board, then the query ends.
[0112] Suppose that service board L4 receives a historical forwarded message M4, service board L5 receives a historical forwarded message M5, service board L6 receives a historical forwarded message M6, service board L7 receives a historical forwarded message M7, and service board L8 receives a historical forwarded message M8.
[0113] For historical forwarded packet M4, the switch network device obtains the source information of historical forwarded packet M4 and the forwarding port used to receive historical forwarded packet M4, and queries the first address table of service board L4 to find the address table entry that matches the source information. Assuming that the switch network device finds the address table entry that matches the source information in the first address table of service board L4, the query ends.
[0114] For historical forwarded packet M5, the switch network device obtains the source information of historical forwarded packet M5 and the forwarding port used to receive historical forwarded packet M5, and queries the first address table of service board L5 to find an address entry that matches the source information. If the switch network device does not find an address entry that matches the source information in the first address table of service board L5, and the space of the first address table of service board L5 is full, then the switch network device obtains the packet type of historical forwarded packet M5. If historical forwarded packet M5 belongs to the target packet type, then the query ends.
[0115] For historical forwarded packet M6, the switch network device obtains the source information of historical forwarded packet M6 and the forwarding port used to receive historical forwarded packet M6, and queries the first address table of service board L6 for an address entry that matches the source information. Assuming that the switch network device does not find an address entry that matches the source information in the first address table of service board L6, but the first address table of service board L6 has storage space, the switch network device generates a new address entry based on the source information and the forwarding port of historical forwarded packet M6, that is, the port that receives the packet, and stores the new address entry in the first address table of service board L6.
[0116] For historical forwarded packet M7, the switch network device obtains the source information of historical forwarded packet M7 and the forwarding port used to receive historical forwarded packet M7. It then queries the first address table of service board L7 for an address entry that matches the source information. Assuming the switch network device does not find an address entry matching the source information in the first address table of service board L7, and the storage space of the first address table is full, the switch network device obtains the packet type of historical forwarded packet M7. After determining that historical forwarded packet M7 does not belong to the target packet type, the switch network device determines the number of switching network boards. Assuming there are s switching network boards (s≥2), and the network board routing order is preset by relevant personnel, the switch network device then determines the number of switching network boards. If the packets are S1, S2, S3, ..., Ss, then the network switch will enable a routing scheme on the switching board. This means that the historically forwarded packet M7 will be routed to switching board S1 according to the routing order. In the second address table of switching board S1, a matching address entry will be searched. If no match is found, the network switch will then route the historically forwarded packet M7 to switching board S2. The second address table of switching board S2 will then be searched for a matching address entry, and so on. For example, if the network switch routes the historically forwarded packet M7 to switching board S4, and a matching address entry is found in the second address table of switching board S4, then the search ends.
[0117] For historical forwarded packet M8, the switch network device obtains the source information of historical forwarded packet M8 and the forwarding port used to receive historical forwarded packet M8. It then queries the first address table of service board L8 for an address entry that matches the source information. If the switch network device does not find an address entry matching the source information in the first address table of service board L8, and the storage space of the first address table is full, then the switch network device obtains the packet type of historical forwarded packet M8. After determining that historical forwarded packet M8 does not belong to the target packet type, the switch network device determines the number of switching network boards. Assuming there are s switching network boards (s≥2), and the network board routing order is pre-set by relevant personnel as S1, S2, S3, ..., Ss... If the network switch activates a routing scheme on the switching board, the historical forwarded packet M8 is first routed to switching board S1 according to the routing order. Then, the second address table of switching board S1 is searched for an address entry matching the source information. If no match is found, the network switch then routes the historical forwarded packet M8 to switching board S2. The second address table of switching board S2 is searched for an address entry matching the source information, and so on, until the last switching board Ss. If no address entry matching the source information is found, and the address table of the switching board is not full, the network switch generates a new address entry based on the source information and the forwarding port of the historical forwarded packet M8, and stores it in the second address table of switching board Ss.
[0118] It should be noted that the aforementioned historical forwarded packet M8 was added only when no matching address table entry was found on any of the switching boards, and the switching boards had storage space. If any of the switching boards had a matching address table entry, no new address table entry was added. Alternatively, other methods could be used, such as searching for a matching address table entry on the first switching board to which the historical forwarded packet was redirected. If no matching entry was found, and that switching board had storage space, the address table entry could be added directly on that switching board without continuing to search the next one. If a matching address table entry was found on that switching board, the search would end, and so on. This article does not impose any specific limitations on these methods.
[0119] S203: If a matching address entry is found in the second address table, the packet to be processed is forwarded through the target forwarding port in the matching address entry.
[0120] The forwarding mentioned above specifically refers to unicast forwarding. In addition, if the switch network device does not find the address table entry in the second address table, the switch network device will flood forward the packet to be processed through multiple member forwarding ports other than the forwarding port that received the packet to be processed. Following the assumptions in S201 and S202, the network switch redirects the packet M1 to be processed in a certain order, assuming the redirection order is: switching board S1, switching board S2, ..., Se, ..., switching board Ss. The network switch redirects the packet M1 to the switching board S1 and searches for a matching address entry in the second address table of switching board S1. If no matching address entry is found, the network switch redirects the packet M1 to the switching board S2 and searches for a matching address entry thereafter. This process continues until the network switch redirects the packet M1 to the switching board Se and finds a matching address entry in the second address table of switching board Se. Then, the network switch obtains the target forwarding port from the address entry and forwards the packet M1 unicastly through the target forwarding port.
[0121] In summary, as Figure 10 The diagram illustrates a logical comparison between a related technology and the packet forwarding logic of this application. In the related technology, the corresponding address table entry is queried based on forwarding information only in the initial board. If found, the packet to be processed is unicast forwarded through the destination forwarding port in the address table entry. If not found, multiple member forwarding ports corresponding to the VLAN are obtained, and the packet to be processed is flooded forwarded through these multiple member forwarding ports. In contrast, when the corresponding address table entry is not found on the initial board, this application obtains multiple member forwarding ports corresponding to the VLAN and determines whether the packet to be processed can be diverted based on the target packet type stored in the forwarding table. If not, the packet to be processed is flooded forwarded through multiple member forwarding ports. If it can, the pre-configured diversion port in the forwarding table is further obtained, and the packet to be processed is diverted to the switching network board based on the diversion port. Then, the corresponding address table entry is queried on the switching network board based on the forwarding information. If found, the packet to be processed is unicast forwarded through the destination forwarding port in the address table entry. If not found, the packet to be processed is flooded forwarded through multiple member forwarding ports.
[0122] Based on the above process, suppose a certain service board of the switch network device receives a message to be processed, such as Figure 11 The diagram shows the overall flowchart of packet forwarding in this scenario. The switch network device performs the following steps.
[0123] Step 1101: Obtain the forwarding information of the message to be processed, and based on the forwarding information, query the matching address table entry in the first address table of the initial board.
[0124] The initial board is a local service board that receives messages to be processed. The local service board is the service board of the switch network device.
[0125] Step 1102: Determine whether a matching address table entry has been found. If yes, proceed to step 1103; otherwise, proceed to step 1104.
[0126] Locate the address table entry that matches the forwarding information of the message to be processed to obtain the target forwarding port.
[0127] Step 1103: Unicast forwarding through the target forwarding port in the address table entry.
[0128] Step 1104: Obtain multiple member forwarding ports corresponding to the destination VLAN information of the message to be processed.
[0129] Step 1105: Determine whether the message to be processed belongs to the target message type. If yes, proceed to step 1106; otherwise, proceed to step 1107.
[0130] The target message types include multicast messages, tunnel messages, and Layer 3 messages.
[0131] Step 1106: Flood forwarding through multiple member forwarding ports other than the forwarding port that receives the message to be processed.
[0132] Step 1107: Obtain the pre-configured redirection ports in the forwarding table.
[0133] Step 1108: Based on the diversion port, divert the packets to be processed to the switching board.
[0134] The feed port is the designated message outlet of the forwarding table. Messages to be processed can be fed to the switching board through the feed port.
[0135] Step 1109: In the second address table of the switching board, look up the matching address entry.
[0136] Step 1110: Determine whether a matching address table entry can be found in the second address table. If yes, proceed to step 1103; otherwise, proceed to step 1106.
[0137] Furthermore, such as Figure 12 The diagram shows the overall flowchart of an address table learning method implemented in this application, in which the switch network device performs the following steps.
[0138] Step 1201: Obtain the source information of the received historical forwarded packets and the forwarding port used to receive the historical forwarded packets.
[0139] The source information includes the source MAC address of historically forwarded packets, as well as the source VLAN information.
[0140] Step 1202: In the first address table of the initial board, query the address table entry that matches the source information.
[0141] Step 1203: Determine if a matching address table entry is found. If found, proceed to step 1204; otherwise, proceed to step 1205.
[0142] Step 1204: Do not learn this address.
[0143] Step 1205: Determine if there is space in the first address table of the initial board. If yes, proceed to step 1206; otherwise, proceed to step 1207.
[0144] Step 1206: Generate new address table entries and store them in the first address table.
[0145] Step 1207: Obtain the message type of the historical forwarded messages.
[0146] Step 1208: Determine whether the historical forwarded message belongs to the target message type. If yes, proceed to step 1204; otherwise, proceed to step 1209.
[0147] Target message types include multicast messages, tunnel messages, and Layer 3 messages. Only historically forwarded messages that do not belong to the target message type will be redirected.
[0148] Step 1209: Drain the flow to the switching plate.
[0149] Step 1210: In the second address table of the switching board, look up the address entry that matches the source information.
[0150] Step 1211: Determine if a matching address table entry is found. If found, proceed to step 1204; otherwise, proceed to step 1212.
[0151] Step 1212: Generate new address table entries and store them in the second address table.
[0152] Based on the same inventive concept, embodiments of this application also provide a message forwarding device 1300. For example... Figure 13 As shown, this is a schematic diagram of a message forwarding device, which may include:
[0153] The acquisition unit 1301 is used to query the first address table of the initial board in the network device based on the forwarding information of the message to be processed;
[0154] The query unit 1302 is used to query the second address table of the switching board in the network device based on the forwarding information when no address table entry is found in the first address table.
[0155] The forwarding unit 1303 is used to forward the packet to be processed through the target forwarding port in the matching address table when a matching address table entry is found in the second address table.
[0156] Optionally, the device also includes:
[0157] The determining unit 1304 is used to obtain a pre-configured target packet type from a pre-configured forwarding table before querying a matching address table entry in the second address table of the switching board in the network device based on forwarding information; wherein the target packet type is a packet type that is not allowed to be redirected.
[0158] If it is determined that the message to be processed does not belong to the target message type, the message to be processed is sent to the switching board.
[0159] Optionally, the forwarding information includes destination VLAN information;
[0160] If it is determined that the message to be processed belongs to the target message type, the forwarding unit 1304 is also used for:
[0161] Obtain multiple member forwarding ports corresponding to the destination VLAN information;
[0162] The pending messages are flooded and forwarded through multiple member forwarding ports.
[0163] Optionally, the device also includes:
[0164] Learning unit 1305 is used to obtain the source information of received historical forwarded packets and the forwarding port used to receive historical forwarded packets before querying the second address table of the switching board in the network device based on forwarding information to find a matching address table entry; wherein, the source information includes the source MAC address of the historical forwarded packets and the source VLAN information.
[0165] In the first address table, query the address table entry that matches the source information to obtain the first query result;
[0166] If the first query result satisfies the preset first address table expansion condition, the source information and forwarding port are stored in the second address table; wherein, the first address table expansion condition is: no address table entry matching the source information is found in the first address table, and the historical forwarded packet does not belong to the target packet type.
[0167] Optionally, if the number of switching boards in the network device is one, then the learning unit 1306 is specifically used for:
[0168] In the second address table of the switching network board, the address table entry that matches the source information is queried to obtain the second query result;
[0169] If the second query result meets the preset second address table expansion conditions, the source information and forwarding port are stored in the second address table of the switching network board; wherein, the second address table expansion conditions are: no address table entry matching the source information is found in the second address table, and the second address table has storage space.
[0170] Optionally, if the number of switching boards in the network device is at least two, then the learning unit 1305 is specifically used for:
[0171] Based on the network board routing order, determine the current network board to be routed from at least two network boards;
[0172] Based on the pre-configured forwarding table, historical forwarded packets are redirected to the current switching network board;
[0173] In the second address table of the current switching network board, query the address table entry that matches the source information to obtain the second query result;
[0174] If the second query result meets the preset conditions for expanding the second address table, then based on the source information and forwarding port, a new address table entry is generated and stored in the second address table of the current switching network board.
[0175] Optionally, if the first query result does not satisfy the first address table expansion condition, learning unit 1305 is also used for:
[0176] If the first query result indicates that no address table entry matching the source information is found in the first address table, and the first address table has storage space, then a new address table entry is generated based on the source information and the forwarding port; the new address table entry is stored in the first address table.
[0177] Optionally, query unit 1302 is specifically used for:
[0178] If there is only one switching board, then based on the forwarding information, the matching address entry is searched in the second address table of the switching board;
[0179] If there are at least two switching boards, then based on the forwarding information and the preset board query order, the matching address entries are queried in the second address table of each switching board in turn.
[0180] Based on the same inventive concept as the above-described method embodiments, this application also provides an electronic device. In this embodiment, the structure of the electronic device can be as follows: Figure 14 As shown, it includes a memory 1401, a communication module 1403, and one or more processors 1402.
[0181] The memory 1401 is used to store computer programs executed by the processor 1402. The memory 1401 may mainly include a program storage area and a data storage area. The program storage area may store the operating system and programs required to run instant messaging functions, etc.; the data storage area may store various instant messaging information and operation instruction sets, etc.
[0182] Memory 1401 may be volatile memory, such as random-access memory (RAM); memory 1401 may also be non-volatile memory, such as read-only memory, flash memory, hard disk drive (HDD), or solid-state drive (SSD); or memory 1401 may be any other medium capable of carrying or storing a desired computer program having the form of instructions or data structures and accessible by a computer, but is not limited thereto. Memory 1401 may be a combination of the above-described memories.
[0183] Processor 1402 may include one or more central processing units (CPUs) or digital processing units, etc. Processor 1402 is used to implement the above-described message forwarding method when calling computer programs stored in memory 1401.
[0184] The communication module 1403 is used to communicate with terminal devices and other servers.
[0185] This application embodiment does not limit the specific connection medium between the memory 1401, communication module 1403, and processor 1402. This application embodiment... Figure 14 The memory 1401 and the processor 1402 are connected via a bus 1404, and the bus 1404 is in Figure 14 The diagram uses thick lines to describe the connections between other components; these are for illustrative purposes only and should not be considered limiting. The 1404 bus can be divided into address bus, data bus, control bus, etc. For ease of description, Figure 14 It is described using only a thick line, but does not indicate that there is only one bus or one type of bus.
[0186] The memory 1401 stores a computer storage medium, which stores computer-executable instructions for implementing the packet forwarding method of this application embodiment. The processor 1402 is used to execute the above-described packet forwarding method, such as... Figure 2 As shown.
[0187] In some possible implementations, various aspects of the message forwarding method provided in this application can also be implemented as a program product, which includes a computer program. When the program product is run on an electronic device, the computer program causes the electronic device to perform the steps of the message forwarding method according to the various exemplary embodiments of this application described above. For example, the electronic device can perform actions such as... Figure 2 The steps are shown in the figure.
[0188] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: electrical connections having one or more wires, portable disks, hard disks, RAM, read-only memory (ROM), erasable programmable read-only memory (EPROM, or flash memory), optical fiber, compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0189] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0190] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1A device that provides the functions specified in one or more boxes.
[0191] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0192] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0193] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A packet forwarding method applied in a network device, characterized in that, The method includes: Based on the forwarding information of the message to be processed, a matching address entry is queried in the first address table of the initial board in the network device; If the address table entry is not found in the first address table, the packet to be processed is diverted to the first switching board in the network device based on the pre-configured diversion port; Based on the forwarding information, a matching address entry is queried in the second address table of the first switching board in the network device; If a matching address entry is found in the second address table of the first switching network board, the packet to be processed is forwarded through the target forwarding port in the matching address entry. If no matching address entry is found in the second address table of the first switching board and the network device includes at least two switching boards, the packet to be processed is diverted to the second switching board in the network device, and a matching address entry is searched in the second address table of the second switching board in the network device. If a matching address entry is found in the second address table of the second switching network board, the packet to be processed is forwarded through the target forwarding port in the matching address entry. The second address table of the first switching network board and the second address table of the second switching network board are extended address tables pre-built for the first address table, which are used to realize the superposition and expansion of the capacity of the initial board address table; Before querying a matching address entry in the second address table of the first switching board in the network device based on the forwarding information, the method further includes: Obtain the source information of the received historical forwarded packets and the forwarding port used to receive the historical forwarded packets; wherein, the source information includes the source MAC address of the historical forwarded packets and the source VLAN information; In the first address table, an address entry that matches the source information is queried to obtain a first query result; If the first query result satisfies the preset first address table expansion condition, then the source information and the forwarding port are stored in the second address table of the first switching network board; wherein, the first address table expansion condition is: no address table entry matching the source information is found in the first address table, and the historical forwarded packet does not belong to the pre-configured target packet type; wherein, the target packet type is a packet type that is not allowed to be redirected.
2. The method of claim 1, wherein, Before querying the second address table entry for a matching address based on the forwarding information in the second address table of the first switching board in the network device, the method further includes: Retrieve the pre-configured target packet type from the pre-configured forwarding table; If it is determined that the message to be processed does not belong to the target message type, the message to be processed is sent to the first switching network board.
3. The method of claim 2, wherein, The forwarding information includes the destination virtual local area network (VLAN) information; If it is determined that the message to be processed belongs to the target message type, the method further includes: Obtain multiple member forwarding ports corresponding to the destination VLAN information; The messages to be processed are flooded and forwarded through the multiple member forwarding ports.
4. The method of claim 1, wherein, The step of storing the source information and the forwarding port in the second address table of the first switching network board includes: In the second address table of the first switching network board, the address entry that matches the source information is queried to obtain the second query result; If the second query result satisfies the preset second address table expansion condition, then the source information and the forwarding port are stored in the second address table of the first switching network board; wherein, the second address table expansion condition is: no address table entry matching the source information is found in the second address table of the first switching network board, and the second address table of the first switching network board has storage space.
5. The method of claim 1, wherein, If the number of switching boards in the network device is at least two, the method further includes: Based on the network board routing order, determine the current network board to be routed from at least two of the said network boards; Based on the pre-configured forwarding table, the historical forwarded packets are redirected to the current switching network board; In the second address table of the current switching network board, the address entry that matches the source information is queried to obtain the second query result; If the second query result satisfies the preset second address table expansion conditions, then based on the source information and the forwarding port, a new address table entry is generated and stored in the second address table of the current switching network board.
6. The method as described in claim 1, characterized in that, If the first query result does not satisfy the first address table expansion condition, the method further includes: If the first query result indicates that no address table entry matching the source information is found in the first address table, and the first address table has storage space, then a new address table entry is generated based on the source information and the forwarding port; and the new address table entry is stored in the first address table.
7. The method according to any one of claims 1 to 6, wherein When no matching address entry is found in the second address table of the first switching board, the packet to be processed is diverted to the second switching board in the network device, and a matching address entry is searched in the second address table of the second switching board in the network device, including: If no matching address entry is found in the second address table of the first switching board, the second switching board is determined based on the forwarding information and the preset board query order. In the second address table of the second switching network board, a matching address entry is searched.
8. A packet forwarding device, characterized by, include: The acquisition unit is used to look up a matching address entry in the first address table of the initial board in the network device based on the forwarding information of the message to be processed. The query unit is used to redirect the packet to be processed to the first switching board in the network device based on the pre-configured redirection port when the address table entry is not found in the first address table. Based on the forwarding information, the query unit is used to look up a matching address entry in the second address table of the first switching board in the network device; the query unit is further configured to, if no matching address entry is found in the second address table of the first switching board and the network device includes at least two switching boards, redirect the packet to be processed to the second switching board in the network device, and look up a matching address entry in the second address table of the second switching board in the network device. The forwarding unit is configured to forward the packet to be processed through the target forwarding port in the matching address table when a matching address table entry is found in the second address table of the first switching network board; the forwarding unit is also configured to forward the packet to be processed through the target forwarding port in the matching address table when a matching address table entry is found in the second address table of the second switching network board; wherein, the second address table of the first switching network board and the second address table of the second switching network board are extended address tables pre-built for the first address table, used to realize the superposition and expansion of the initial board address table capacity; The learning unit is configured to obtain the source information of the received historical forwarded packets and the forwarding port for receiving the historical forwarded packets before querying the second address table of the first switching board in the network device based on the forwarding information to find a matching address entry; wherein the source information includes the source MAC address of the historical forwarded packets and the source VLAN information. In the first address table, an address entry that matches the source information is queried to obtain a first query result; If the first query result satisfies the preset first address table expansion condition, then the source information and the forwarding port are stored in the second address table of the first switching network board; wherein, the first address table expansion condition is: no address table entry matching the source information is found in the first address table, and the historical forwarded packet does not belong to the pre-configured target packet type; wherein, the target packet type is a packet type that is not allowed to be redirected.
9. An electronic device, comprising: It includes a processor and a memory, wherein the memory stores a computer program that, when executed by the processor, causes the processor to perform the steps of any of the methods described in claims 1 to 7.