Message forwarding method, data communication equipment and readable storage medium
By storing global next hop information in the FPGA chip of the data communication device, determining the forwarding path of the message, and transmitting the message to the corresponding line card for editing and forwarding, the problem of small number of message forwarding terminals in the prior art is solved, and efficient forwarding to more terminals is achieved.
Patent Information
- Application Number
- CN202311670777.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-06
- Publication Date
- 2025-06-06
AI Technical Summary
In existing data communication devices, the MAC chip of each line card needs to store the same IP prefix and adjacency editing information, resulting in a small number of terminals that can be forwarded to.
By storing the global next hop information of the forwardable terminal corresponding to all line cards in the FPGA chip of the data communication device, the global target next hop information of the message is determined, and the message is transmitted to the second line card with the corresponding local target next hop information for editing and forwarding.
When the local next-hop information stored in each line card is different, the editing and forwarding of messages can be accurately completed, and the forwarding of messages of all terminals superimposed by the forwardable terminals corresponding to each line card is supported, greatly increasing the number of terminals that can be forwarded to.
Smart Images

Figure CN120111013A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of communication technology, and in particular to a message forwarding method, a data communication device, and a readable storage medium. Background Art
[0002] Data communication devices such as switches or routers are message forwarding devices in the network, and they are responsible for selecting message forwarding paths. After a message enters a data communication device, the data communication device can obtain the corresponding exit information of the message based on the IP prefix and adjacent editing information (i.e., next hop information) of the Internet Protocol (IP) address of the terminal device stored in a Media Access Control (MAC) chip in a line card, so as to edit and forward the message.
[0003] However, in order to ensure that the message can be forwarded successfully, the MAC chip of each line card in the data communication equipment needs to store the IP prefix and adjacency editing information of the same terminal, and the storage specifications of the MAC chip are limited, resulting in a small number of terminals to which the message can be forwarded. Summary of the invention
[0004] Embodiments of the present application provide a message forwarding method, a data communication device, and a readable storage medium to solve the problem that the number of terminals to which messages can be forwarded is small.
[0005] In order to achieve the above purpose, the embodiment of the present application adopts the following technical solution:
[0006] According to a first aspect of an embodiment of the present application, a message forwarding method is provided, which is applied to a data communication device including a first line card, wherein the first line card includes a field programmable gate array (FPGA) chip, and the method includes:
[0007] Determine, according to the first information stored in the FPGA chip, the global target next hop information corresponding to the received message, wherein the first information includes the global next hop information of the forwardable terminals corresponding to all line cards in the data communication device, and the global next hop information includes the global target next hop information;
[0008] Determine, according to the global target next hop information, a second line card corresponding to the message, wherein the second line card stores local target next hop information corresponding to the global target next hop information;
[0009] The message is transmitted from the FPGA chip to the second line card for editing and forwarding.
[0010] The message forwarding method provided in the embodiment of the present application can first determine the global target next hop information corresponding to the received message according to the global next hop information of the forwardable terminals corresponding to all line cards in the data communication device stored in the FPGA chip, and then determine the second line card storing the local target next hop information corresponding to the global target next hop information according to the global target next hop information, and transmit the message to the second line card for editing and forwarding. Therefore, even if the local next hop information stored in each line card in the data communication device is different, the editing and forwarding of the message can be completed accurately, thereby supporting the forwarding of messages for all terminals after the forwardable terminals corresponding to each line card are superimposed, which can greatly increase the number of terminals to which the message can be forwarded.
[0011] In combination with the first aspect, in a possible implementation manner, the global target next hop information includes: address information of a media access control MAC chip in the second line card;
[0012] The transmitting the message from the FPGA chip to the second line card for editing and forwarding includes:
[0013] According to the address information, transmitting the message from the FPGA chip to the MAC chip;
[0014] The message is edited through the MAC chip according to the local target next hop information stored in the MAC chip, and the first port in the second line card is determined, and the edited message is forwarded through the first port.
[0015] In combination with the first aspect and the above possible implementation manner, in another possible implementation manner, before determining the global target next hop information corresponding to the received message according to the first information stored in the FPGA chip, the method further includes:
[0016] receiving the message through a third line card in the data communication device;
[0017] The message is transmitted from the third line card to the FPGA chip.
[0018] In combination with the first aspect and the foregoing possible implementation manner, in another possible implementation manner, the first line card is a line card of at least two fourth line cards in the data communication device, and each of the fourth line cards includes one FPGA chip.
[0019] In combination with the first aspect and the above possible implementation manner, in another possible implementation manner, the data communication device further includes an access point (AP) port, and the AP port is connected to the at least two fourth line cards respectively;
[0020] Before determining the global target next hop information corresponding to the received message according to the first information stored in the FPGA chip, the method further includes:
[0021] determining the first line card from the at least two fourth line cards according to a message feature of the message;
[0022] The message is transmitted to the FPGA chip of the first line card through the AP port.
[0023] According to a second aspect of an embodiment of the present application, a data communication device is provided, including a first line card, the first line card including an FPGA chip, the data communication device including a determination unit and a processing unit;
[0024] The determining unit is used to determine the global target next hop information corresponding to the received message according to the first information stored in the FPGA chip, the first information including the global next hop information of the forwardable terminals corresponding to all line cards in the data communication device, and the global next hop information including the global target next hop information;
[0025] The determining unit is further configured to determine, according to the global target next hop information, a second line card corresponding to the message, wherein the second line card stores local target next hop information corresponding to the global target next hop information;
[0026] The processing unit is used to transmit the message from the FPGA chip to the second line card for editing and forwarding.
[0027] In conjunction with the second aspect, in a possible implementation manner, the global target next hop information includes: address information of a media access control MAC chip in the second line card;
[0028] The processing unit is specifically used to transmit the message from the FPGA chip to the MAC chip according to the address information; and edit the message through the MAC chip according to the local target next hop information stored in the MAC chip, determine the first port in the second line card, and forward the edited message through the first port.
[0029] In combination with the second aspect and the above possible implementation manner, in another possible implementation manner, the data communication device further includes a receiving unit and a transmitting unit;
[0030] The receiving unit is configured to receive the message through a third line card in the data communication device before the determining unit determines the global target next hop information corresponding to the received message according to the first information stored in the FPGA chip;
[0031] The transmission unit is used to transmit the message from the third line card to the FPGA chip.
[0032] In combination with the second aspect and the foregoing possible implementation manner, in another possible implementation manner, the first line card is a line card of at least two fourth line cards in the data communication device, and each of the fourth line cards includes one FPGA chip.
[0033] In combination with the second aspect and the above possible implementation manner, in another possible implementation manner, the data communication device further includes an AP port, the AP port is respectively connected to the at least two fourth line cards, and the data communication device further includes a transmission unit;
[0034] The determining unit is further configured to determine the first line card from the at least two fourth line cards according to a message feature of the message before determining the global target next hop information corresponding to the received message according to the first information stored in the FPGA chip;
[0035] The transmission unit is used to transmit the message to the FPGA chip of the first line card through the AP port.
[0036] For specific implementation methods, reference may be made to the behavior function of the data communication device in the message forwarding method provided in the first aspect or the possible implementation methods of the first aspect.
[0037] According to a third aspect of an embodiment of the present application, a data communication device is provided, comprising a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the message forwarding method as described in the first aspect and the possible implementation method of the first aspect are implemented.
[0038] According to a fourth aspect of an embodiment of the present application, a readable storage medium is provided, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the message forwarding method as described in the first aspect and the possible implementation method of the first aspect are implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0040] Figure 1 A schematic diagram of an Ethernet forwarding structure provided for related technologies;
[0041] Figure 2 A schematic diagram of a method for forwarding messages by a switch provided in the related art;
[0042] Figure 3 A schematic diagram of a method for forwarding messages by a router provided in the related art;
[0043] Figure 4 One of the flow charts of a message forwarding method provided in an embodiment of the present application;
[0044] Figure 5 A second flowchart of a message forwarding method provided in an embodiment of the present application;
[0045] Figure 6 A schematic diagram of a message forwarding method provided in an embodiment of the present application;
[0046] Figure 7 A third flowchart of a message forwarding method provided in an embodiment of the present application;
[0047] Figure 8 A fourth flowchart of a message forwarding method provided in an embodiment of the present application;
[0048] Fig. 9 A schematic diagram of the composition of a data communication device provided in an embodiment of the present application;
[0049] Fig.10 A schematic diagram of the composition of another data communication device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0050] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0051] The terms "first", "second", etc. in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of the same type, and the number of objects is not limited. For example, the first object can be one or more.
[0052] In addition, the term "and / or" in this article is only a description of the association relationship between the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0053] The terms "at least one (item)", "at least one of" and the like in the specification and claims of the present application refer to any one, any two or a combination of more than two of the objects included therein. For example, at least one (item) of a, b, and c can be represented by: "a", "b", "c", "a and b", "a and c", "b and c" and "a, b and c", where a, b, and c can be single or multiple. Similarly, "at least two (items)" refers to two or more, and its meaning is similar to that of "at least one (item)".
[0054] The implementation of the embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0055] Data communication devices such as switches or routers are message forwarding devices in the network, and they are responsible for selecting message forwarding paths. Taking a switch as an example, in the Ethernet Layer 3 unicast forwarding model, a hardware forwarding table of IP addresses and ports (i.e., ports) is stored on the switch. When an Ethernet message enters the switch, the switch can obtain the destination IP address information to be accessed from the Ethernet message, and query the port hardware forwarding table based on the IP prefix in the destination IP address information to obtain the port information corresponding to the destination IP address information, thereby forwarding the Ethernet message from the port indicated by the port information.
[0056] For example, Figure 1 As shown in the figure, personal computer (PC) A needs to access PC B. The IP prefix of the destination IP address corresponding to the Ethernet message sent is 2.1.1.2, and the routing table on the switch stores that the port corresponding to the IP prefix 2.1.1.2 is port 2; then after determining port 2, the switch will send the Ethernet message from port 2 to achieve access to PC B.
[0057] When a terminal accesses the network, the core gateway device (for example, a switch or router, etc.) is required to store the Address Resolution Protocol (ARP) and Neighbor Discovery (ND) entries corresponding to the terminal, so that the core gateway device can edit and forward messages using the MAC chip in the core gateway device based on the stored information corresponding to the terminal. For example, the information corresponding to terminal 1 is shown in Table 1 below:
[0058] Table 1
[0059] IP Prefix MAC Address Adjacency edit information (i.e. next hop information) 1.1.1.1 1111.2222.3333 Id: 100; port: 1; vid: 10
[0060] Among them, the IP prefix 1.1.1.1 is the prefix of the IP address of the above-mentioned terminal 1; the MAC address 1111.2222.3333 is the MAC address of the terminal 1; Id100 in the adjacency editing information is the identifier of the adjacency editing information, which is used to quickly find the adjacency editing information, port1 is the transmission port corresponding to the terminal 1 in the above-mentioned core gateway device, and the virtual local area network identifier (virtual local area network id, vid) 10 is the virtual local area network identifier corresponding to the terminal 1.
[0061] It should be noted that the core gateway device can determine a line card corresponding to a message through the adjacency editing information (ie, next hop information), complete the editing of the message in the line card, and forward the edited message to the corresponding terminal through the port in the line card.
[0062] However, the terminal specifications that the core gateway device can support strongly rely on the storage performance of the MAC chip. As the scale of the campus becomes larger and larger, the number of campus terminals also increases, and the host routing capacity of the core gateway device can no longer support the campus terminal specifications. If the goal is to support 500,000 terminals, the MAC chip of the core gateway device needs to store 500,000 IP prefixes, 500,000 MAC address information, and 500,000 adjacency editing information. At present, in order to ensure that the message can be forwarded successfully, the MAC chip of each line card in the core gateway device needs to store the same IP prefix and adjacency editing information, and the storage specifications of the MAC chip are limited, resulting in a small number of terminals that the message can be forwarded to. For example, assuming that the worst-performing MAC chip in the core gateway device can store at most 80,000 IP prefixes, 80,000 MAC address information, and 80,000 adjacent editing information, then in order to ensure that the message can be transmitted to the line card to which the forwarding port corresponding to the message belongs regardless of which line card it enters from, so as to edit and forward the message, the MAC chip of each line card in the core gateway device needs to store the same information, that is, the MAC chip of each line card needs to store the 80,000 IP prefixes, 80,000 MAC address information, and 80,000 adjacent editing information, which results in the core gateway device only being able to support 80,000 terminals.
[0063] The following is an exemplary description of a method for forwarding messages by a switch provided by the related art in conjunction with the accompanying drawings.
[0064] For example, taking the above switch as a box switch, Figure 2As shown in the figure, the box switch requires that any line card in the box switch enters the device and takes the same forwarding path, so all line cards in the whole machine need to store the same IP prefix, global next hop information, and MAC address information. When there is a low-performance line card in the box switch, the IP prefix, global next hop information, and MAC address information stored by all line cards in the whole machine are the IP prefix, global next hop information, and MAC address information stored by the low-performance line card, so the forwarding terminal specifications supported by the whole machine will be reduced accordingly. The message flow entering from line card 1 will complete the search of IP prefix, global next hop information, and MAC address information through the MAC chip of line card 1. If the output port corresponding to the message found according to the IP prefix, global next hop information, and MAC address information is a port in line card 1, there is no need to go through the Fast Ethernet (FE) card, but the message can be edited directly in the line card 1, and the edited message can be forwarded to the corresponding terminal through the port in the line card 1; if the output port corresponding to the message found according to the IP prefix, global next hop information, and MAC address information is a port in line card 2, the message must first be transmitted to line card 2 through the FE card, and then the message is edited in line card 2, and the edited message is forwarded to the corresponding terminal through the port in the line card 2.
[0065] There are two types of line cards in routers. One is an ordinary line card that does not use FPGA chips to expand IP prefix capacity specifications and improve forwarding performance, but purely relies on software forwarding of the central processing unit (CPU) (that is, packet forwarding is controlled by the CPU software); the other is a new line card that uses FPGA chips for hardware forwarding.
[0066] If the message is transferred from a common line card, it can be forwarded by software. The line card resource distribution of software forwarding is no different from that of the above switch. Figure 3 As shown in the figure, the thin arrow indicates the traffic entering from line card a that supports software forwarding. The CPU completes the search and message editing of IP prefix, global next hop information, and MAC address information. If the output port corresponding to the message is a port in another line card, the message needs to be transmitted to another line card through the FE card, and then the message is edited and forwarded in the line card. Although the supported forwarding terminal specifications can reach 500,000, due to the need to rely on CPU software control and limited by CPU performance, the forwarding performance of software forwarding is poor, usually below 40G.
[0067] If the message is transferred from a new line card, the FPGA chip of the new line card can be used for hardware forwarding. Figure 3As shown, the thick arrow indicates that after the message enters the device from the new line card, it will first be directed to the FPGA chip of the line card. The FPGA chip stores the global IP prefix and global next hop information. The FPGA chip then completes the route search, that is, according to the IP address information carried in the message, the IP prefix of the required forwarding terminal is determined, and then the corresponding next hop information is found according to the IP prefix; then according to the next hop information, the line card that processes the message is determined, and the message is carried to the MAC chip of the line card to complete the message editing and forwarding. However, in order to ensure that each message entering from the new line card can be found in the corresponding line card for editing and forwarding, the MAC chips of all line cards in the router need to have the same understanding, that is, the MAC chip of each line card in the router needs to store the same global IP prefix, global next hop information, and MAC address information. The current MAC chip can only store up to 95,000 IP prefix information, next hop information, and MAC address information, so the supported forwarding terminal specifications are at most 95,000.
[0068] In order to solve the above technical problems, the embodiments of the present application provide a message forwarding method, a data communication device and a readable storage medium. The message forwarding method provided in the embodiments of the present application can be executed by a message forwarding device, a data communication device or a functional module in the data communication device. In the embodiments of the present application, the message forwarding method provided in the embodiments of the present application is described by taking the data communication device executing the message forwarding method as an example.
[0069] Figure 4 A flowchart of a message forwarding method provided in an embodiment of the present application is shown. The message forwarding method provided in an embodiment of the present application is applied to a data communication device including a first line card, wherein the first line card includes an FPGA chip; Figure 4 As shown, the message forwarding method provided in the embodiment of the present application may include the following steps 401 to 403.
[0070] Step 401: The data communication device determines the global target next hop information corresponding to the received message according to the first information stored in the FPGA chip.
[0071] The first information includes global next hop information of forwardable terminals corresponding to all line cards in the data communication device, and the global next hop information includes the global target next hop information.
[0072] In a possible implementation, the data communication device may be any device such as a switch or a router that can edit and forward messages.
[0073] In a possible implementation manner, the message may be an Ethernet message.
[0074] In a possible implementation manner, the message may be received from any line card in the data communication device.
[0075] In a possible implementation manner, the data communication device may include a plurality of line cards, including the first line card.
[0076] In a possible implementation, each line card in the above data communication device may correspond to a group of forwardable terminals, and the sum of the forwardable terminals corresponding to all line cards in the data communication device is the forwardable terminals supported by the data communication device.
[0077] In a possible implementation, one piece of global next hop information corresponds to one forwardable terminal supported by the data communication device, and the first information is all the global next hop information corresponding to all the forwardable terminals supported by the data communication device.
[0078] In a possible implementation, after receiving the message, the data communication device can determine the global target next hop information corresponding to the IP prefix from the first information through the FPGA chip according to the IP prefix in the IP address information in the message.
[0079] Step 402: The data communication device determines the second line card corresponding to the message according to the global target next hop information.
[0080] The second line card stores local target next hop information corresponding to the global target next hop information.
[0081] In a possible implementation, the second line card may be the same as or different from the first line card, that is, the second line card may be the same line card as the first line card, or may be any line card in the data communication device except the first line card.
[0082] In a possible implementation manner, the local target next hop information may be next hop information among a plurality of local next hop information stored in the second line card, and the plurality of local next hop information corresponds one-to-one to all forwardable terminals corresponding to the second line card.
[0083] The specific method for the data communication device to determine the second line card is exemplarily described below.
[0084] Exemplarily, assuming that the data communication device includes line card 1, line card 2, line card 3 and line card 4, each line card can only store 1w local next hop information (that is, supports 1w forwardable terminals). If the index of the global next hop information in the data communication device is arranged in the order of line card 1, line card 2, line card 3 and line card 4, then 4w global next hop information can be stored in the above-mentioned FPGA chip. Among them, the global next hop information with an index of 1 in the FPGA chip (i.e., the first global next hop information) corresponds to the local next hop information with an index of 1 in line card 1; the global next hop information with an index of 10001 in the FPGA chip (i.e., the 10001th global next hop information) corresponds to the local next hop information with an index of 1 in line card 2; the global next hop information with an index of 20001 in the FPGA chip (i.e., the 20001th global next hop information) corresponds to the local next hop information with an index of 1 in line card 3; the global next hop information with an index of 30001 in the FPGA chip (i.e., the 30001th global next hop information) corresponds to the local next hop information with an index of 1 in line card 4.
[0085] It can be seen that through the correspondence between the global next hop information and the local next hop information, the data communication device can determine the local target next hop information corresponding to the global target next hop information and the second line card to which the local target next hop information belongs according to the global target next hop information.
[0086] As another example, assuming that the data communication device includes line card 1 and line card 2, and each line card can only store 1w local next hop information, then 2w global next hop information can be stored in the above-mentioned FPGA chip, and each of the 2w global next hop information can include the index of the line card; for example, the global next hop information "global next hop information Id: 100; port: 1; vid: 10; line card Id: 1" in the FPGA chip corresponds to the local next hop information "local next hop information Id: 100; port: 1; vid: 10;" in line card 1; the global next hop information "global next hop information Id: 500; port: 1; vid: 10; line card Id: 2" in the FPGA chip corresponds to the local next hop information "local next hop information Id: 500; port: 1; vid: 10;" in line card 2, etc. In this way, the data communication device can directly determine the above-mentioned second line card according to the label Id of the line card in the above-mentioned global next hop information.
[0087] Step 403: The data communication device transmits the message from the FPGA chip to the second line card for editing and forwarding.
[0088] In a possible implementation, the global target next hop information includes: address information of the MAC chip in the second line card. Figure 4 ,like Figure 5 As shown, the above step 403 can be specifically implemented by the following steps 403a and 403b. Step 403a: The data communication device transmits the message from the FPGA chip to the MAC chip according to the address information.
[0089] The MAC chip is the MAC chip in the second line card, and the address information is the address information of the MAC chip.
[0090] In a possible implementation manner, each line card in the above data communication device includes a MAC chip.
[0091] In a possible implementation manner, the MAC chips included in any two line cards in the above data communication device may be the same or different.
[0092] Step 403b: The data communication device edits the message through the MAC chip according to the local target next hop information stored in the MAC chip, determines the first port in the second line card, and forwards the edited message through the first port.
[0093] In a possible implementation manner, the first port is a port corresponding to a terminal to which the message needs to be forwarded.
[0094] In a possible implementation, each line card in the above data communication device includes a plurality of ports, and each port corresponds to a forwardable terminal.
[0095] In a possible implementation, the data communication may update the information in the next hop field in the message to the local target next hop information to complete editing of the message, so that the message may be redirected to the next hop device indicated by the local target next hop information.
[0096] For example, Figure 6As shown, when a message enters from line card A (i.e., the above-mentioned first line card), the data communication device can first determine the global next hop information corresponding to the message (i.e., the above-mentioned global target next hop information) according to the above-mentioned first information stored in the FPGA chip in line card A; then, determine that the corresponding second line card is line card C according to the global next hop information; again, the FPGA chip can transmit the message and the local next hop information of line card C corresponding to the global next hop information (i.e., the above-mentioned local target next hop information) through the FE card to the MAC chip of line card C according to the address information of the MAC chip of line card C (i.e., the above-mentioned second line card) in the global next hop information; thereby, the MAC chip can edit the above-mentioned message according to the local next hop information and determine a port in the line card C (i.e., the above-mentioned first port), and forward the edited message to the corresponding terminal through the port. Of course, line card A may not send the local next hop information of line card C directly to line card C, but instead send the index of the local next hop information in all local next hop information stored in line card C, so that the MAC chip can quickly determine the local next hop information stored in the MAC chip itself according to the index, and edit the above message based on the local next hop information and determine a port in the line card C (i.e., the above first port), and forward the edited message to the corresponding terminal through the port.
[0097] In the embodiment of the present application, since the data communication device can accurately transmit the message to the MAC chip according to the address information of the MAC chip in the second line card in the global target next hop information, and edit and forward the message through the MAC chip according to the local target next hop information stored in the MAC chip; therefore, the local IP prefix and local next hop information stored in any two line cards other than the first line card in the data communication device can be different, so that the terminal specifications of the whole machine can be achieved by superimposing multiple line cards instead of taking the smallest one.
[0098] In the message forwarding method provided in the embodiment of the present application, since the global target next hop information corresponding to the received message can be determined first according to the global next hop information of the forwardable terminals corresponding to all line cards in the data communication device stored in the FPGA chip, and then the second line card storing the local target next hop information corresponding to the global target next hop information can be determined according to the global target next hop information, and the message can be transmitted to the second line card for editing and forwarding, even if the local next hop information stored in each line card in the data communication device is different, the editing and forwarding of the message can be completed accurately, thereby supporting the forwarding of the full number of terminals after the forwardable terminals corresponding to each line card are superimposed, which can greatly increase the number of terminals to which the message can be forwarded.
[0099] In one possible implementation, combining Figure 4 ,like Figure 7 As shown, before the above step 401, the message forwarding method provided in the embodiment of the present application may also include the following steps 404 and 405.
[0100] Step 404: The data communication device receives a message through a third line card in the data communication device.
[0101] In a possible implementation manner, the third line card may be any line card in the data communication device.
[0102] Step 405: The data communication device transmits the message from the third line card to the FPGA chip.
[0103] In a possible implementation, the data communication device may transmit the message from the third line card to the FE card, and then transmit the message to the FPGA chip through the FE card.
[0104] In the embodiment of the present application, since the above-mentioned message will be directed to the above-mentioned FPGA chip regardless of which line card the message is received from, there is no need to query the line card that receives the message, but the query can be performed through the FPGA chip that stores all forwardable terminal information, thereby improving the forwarding capability of the data communication equipment.
[0105] In a possible implementation manner, the first line card is a line card of at least two fourth line cards in the data communication device, and each fourth line card includes an FPGA chip.
[0106] In the embodiment of the present application, since the above-mentioned first line card can be a line card of at least two fourth line cards in the above-mentioned data communication device that include an FPGA chip, that is, the data communication device can include multiple line cards of the same type as the above-mentioned first line card, therefore, through the multiple fourth line cards, multiple messages can be processed simultaneously, and the message queuing when there is only one line card including the FPGA chip can be avoided, thereby expanding the forwarding bandwidth of the whole machine.
[0107] In a possible implementation, the first line card is a line card of the at least two fourth line cards, and the data communication device may further include an AP port, which is connected to the at least two fourth line cards respectively. Figure 4 ,like Figure 8 As shown, before the above step 401, the message forwarding method provided in the embodiment of the present application may also include the following steps 406 and 407.
[0108] Step 406: The data communication device determines the first line card from at least two fourth line cards according to the message characteristics of the message. In a possible implementation, the message characteristics may include at least one of the following: a hardware interface type that the message sender needs to know, a protocol address type that the message sender needs to map, a hardware address length, a protocol length, a message type, a message sender MAC address, a message sender IP address, a message receiver MAC address, a message receiver IP address, etc.
[0109] For example, taking the above-mentioned message characteristics including the above-mentioned message type as an example, each of the above-mentioned at least two fourth line cards can be preset as a line card for forwarding messages of a certain message type. After receiving the above-mentioned message, the above-mentioned data communication equipment can determine the line card corresponding to the message type of the message among the at least two fourth line cards as the above-mentioned first line card according to the message type of the message.
[0110] For another example, taking the above-mentioned message feature including the above-mentioned message receiver IP address as an example, each of the above-mentioned at least two fourth line cards may correspond to a preset IP address list (an IP address list other than the IP address prefix of the forwardable terminal corresponding to all the above-mentioned line cards), and after receiving the above-mentioned message, the above-mentioned data communication device may determine the IP address list to which the IP address belongs according to the message receiver IP address of the message, and then determine the line card corresponding to the IP address list among the at least two fourth line cards as the above-mentioned first line card. For example, in addition to storing the global next hop information of the forwardable terminal corresponding to all line cards in the data communication device, each fourth line card may also set a preset IP address list. For example, line card 1 sets the preset IP address list to a~b, and line card 2 sets the preset IP address list to c~d. If the target IP address corresponding to the message received by the data communication device is a, it will be diverted to line card 1 for processing to achieve balanced diversion.
[0111] In a possible implementation manner, the data communication device may also determine, according to the line card to which the ingress port of the message belongs, a line card among the at least two fourth line cards that is physically closest to the line card as the first line card.
[0112] Step 407: The data communication device transmits the message to the FPGA chip of the first line card through the AP port.
[0113] It should be noted that the AP port is an interface for converting wired signals into wireless signals and transmitting them. Generally, the AP port may include multiple registered jack (RJ) 45 interfaces. Each of the at least two fourth line cards may serve as a member port of the AP port, that is, each of the at least two line cards may be connected to an interface of the AP port through an interface of the line card, so that a message may be transmitted to a corresponding fourth line card through the AP port.
[0114] In a possible implementation, the AP port is respectively connected to the at least two fourth line cards, that is, the at least two fourth line cards can serve as member ports of the AP port; when a message is directed to the AP port, the AP port can decide to which fourth line card the message is assigned for processing, thereby achieving balanced traffic diversion.
[0115] In an embodiment of the present application, since the above-mentioned data communication equipment includes multiple line cards carrying FPGA chips, the above-mentioned message can be diverted to the above-mentioned AP port, and then the above-mentioned first line card is determined from the multiple line cards according to the message characteristics of the message, and then the message is transmitted to the first line card through the AP port, so that balanced diversion to different FPGA chips for processing can be achieved, thereby improving the flexibility of message processing.
[0116] The embodiment of the present application can divide the functional modules of the above-mentioned data communication device according to the above-mentioned method example. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0117] In the case of dividing each functional module into corresponding functional modules, Fig. 9 A possible schematic diagram of the composition of the data communication device involved in the above embodiment is shown. The data communication device includes a first line card, and the first line card includes an FPGA chip; Fig. 9 As shown, the data communication device 90 may include: a determination unit 91 and a processing unit 92 .
[0118] Among them, the determination unit 91 can be used to determine the global target next hop information corresponding to the received message according to the first information stored in the above-mentioned FPGA chip, and the first information includes the global next hop information of the forwardable terminals corresponding to all line cards in the data communication device 90, and the global next hop information includes the global target next hop information. The determination unit 91 can also be used to determine the second line card corresponding to the message according to the global target next hop information, and the second line card stores the local target next hop information corresponding to the global target next hop information. The processing unit 92 can be used to transmit the message from the FPGA chip to the second line card for editing and forwarding.
[0119] In a possible implementation, the global target next hop information may include: address information of the MAC chip in the second line card. Exemplarily, the processing unit 92 may be used to transmit the message from the FPGA chip to the MAC chip according to the address information; and edit the message through the MAC chip according to the local target next hop information stored in the MAC chip, determine the first port in the second line card, and forward the edited message through the first port.
[0120] In a possible implementation, the data communication device 90 may further include a receiving unit and a transmission unit. The receiving unit may be used to receive the message through a third line card in the data communication device 90 before the determination unit 91 determines the global target next hop information corresponding to the received message according to the first information stored in the FPGA chip. The transmission unit may be used to transmit the message from the third line card to the FPGA chip.
[0121] In a possible implementation, the first line card may be a line card of at least two fourth line cards in the data communication device 90, and each fourth line card includes an FPGA chip.
[0122] In a possible implementation, the data communication device 90 may further include an AP port, which is respectively connected to the at least two fourth line cards, and the data communication device 90 may further include a transmission unit. The determination unit 91 may also be configured to determine the first line card from the at least two fourth line cards according to the message characteristics of the message before determining the global target next hop information corresponding to the received message according to the first information stored in the FPGA chip. The transmission unit may be configured to transmit the message to the FPGA chip of the first line card through the AP port.
[0123] It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.
[0124] It should be noted that the specific working process of each functional module in the data communication device provided in the embodiment of the present application can refer to the specific description of the corresponding process in the method embodiment, and the embodiment of the present application will not be described in detail here. The data communication device provided in the embodiment of the present application is used to execute the above-mentioned message forwarding method, so it can achieve the same effect as the above-mentioned message forwarding method.
[0125] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0126] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0127] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0128] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0129] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program code.
[0130] like Fig.10 As shown, an embodiment of the present application also provides a data communication device 100, including a processor 101 and a memory 102, and the memory 102 stores a program or instruction that can be executed on the processor 101. When the program or instruction is executed by the processor 101, the various steps of the above-mentioned message forwarding method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0131] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned message forwarding method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0132] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A message forwarding method, applied to a data communication device including a first line card, wherein the first line card includes a field programmable gate array (FPGA) chip, It is characterized in that The method comprises: Determine, according to the first information stored in the FPGA chip, the global target next hop information corresponding to the received message, wherein the first information includes the global next hop information of the forwardable terminals corresponding to all line cards in the data communication device, and the global next hop information includes the global target next hop information; Determine, according to the global target next hop information, a second line card corresponding to the message, wherein the second line card stores local target next hop information corresponding to the global target next hop information; The message is transmitted from the FPGA chip to the second line card for editing and forwarding.
2. The method according to claim 1, It is characterized in that Determining, according to the global target next hop information, a second line card corresponding to the message, includes: A second line card corresponding to the message is determined according to the line card tag carried in the global target next hop information.
3. The method according to claim 1, It is characterized in that The global target next hop information includes: address information of a media access control MAC chip in the second line card; The transmitting the message from the FPGA chip to the second line card for editing and forwarding includes: According to the address information, transmitting the message from the FPGA chip to the MAC chip; According to the local target next hop information stored in the MAC chip, the message is edited through the MAC chip, and the first port corresponding to the message in the second line card is determined, and the edited message is forwarded through the first port.
4. The method according to any one of claims 1 to 3, It is characterized in that Before determining the global target next hop information corresponding to the received message according to the first information stored in the FPGA chip, the method further includes: receiving the message through a third line card in the data communication device; The message is transmitted from the third line card to the FPGA chip.
5. The method according to claim 1, It is characterized in that The first line card is a line card among at least two fourth line cards in the data communication device, and each of the fourth line cards includes one FPGA chip.
6. The method according to claim 4, It is characterized in that The data communication device further comprises an access point AP port, wherein the AP port is respectively connected to the at least two fourth line cards; Before determining the global target next hop information corresponding to the received message according to the first information stored in the FPGA chip, the method further includes: determining the first line card from the at least two fourth line cards according to a message feature of the message; The message is transmitted to the FPGA chip of the first line card through the AP port.
7. A data communication device, comprising a first line card, wherein the first line card comprises an FPGA chip, It is characterized in that The data communication device comprises a determining unit and a processing unit: The determining unit is used to determine the global target next hop information corresponding to the received message according to the first information stored in the FPGA chip, the first information including the global next hop information of the forwardable terminals corresponding to all line cards in the data communication device, and the global next hop information including the global target next hop information; The determining unit is further configured to determine, according to the global target next hop information, a second line card corresponding to the message, wherein the second line card stores local target next hop information corresponding to the global target next hop information; The processing unit is used to transmit the message from the FPGA chip to the second line card for editing and forwarding.
8. The data communication device according to claim 7, It is characterized in that The global target next hop information includes: address information of a media access control MAC chip in the second line card; The processing unit is specifically used to transmit the message from the FPGA chip to the MAC chip according to the address information; and edit the message through the MAC chip according to the local target next hop information stored in the MAC chip, determine the first port in the second line card, and forward the edited message through the first port.
9. A data communication device, It is characterized in that It comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the message forwarding method as described in any one of claims 1 to 6 are implemented.
10. A readable storage medium, It is characterized in that The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the steps of the message forwarding method according to any one of claims 1 to 6 are implemented.