Message processing method, message forwarding method, device and equipment

By editing and marking packets on the inlet chip, the problem of complex message editing resource management and bandwidth waste in multi-chip systems is solved, and efficient message forwarding is achieved.

CN115914142BActive Publication Date: 2024-11-08SUZHOU CENTEC COMM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110931712.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-13
Publication Date
2024-11-08
Estimated Expiration
2041-08-13

AI Technical Summary

Technical Problem

In multi-chip stacking systems, message editing resource management is complex and the chip interconnection port bandwidth is wasted, resulting in the risk of network blockage.

Method used

Receive messages through the inlet chip, determine the exit port number and edit information according to the destination MAC address, obtain the exit terminal attribute information, and edit the packet header on the inlet chip, mark it and send it to the exit chip so that it does not need to be edited again and is forwarded directly.

Benefits of technology

It reduces the complexity of editing resource management on export chips, saves the bandwidth of chip interconnected ports, and avoids the risk of network blockage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115914142B_ABST
    Figure CN115914142B_ABST
Patent Text Reader

Abstract

The present application relates to a message processing method, a message forwarding method, a device and an apparatus. The message processing method is applied to an inlet chip, and receives a first message, and determines the port number of the outlet for forwarding the first message and the editing information for editing the first message according to the destination MAC address of the first message; obtains the attribute information of the outlet according to the port number of the outlet; edits the packet header of the first message according to the attribute information and the editing information to obtain a second message; wherein the second message is forwarded by the inlet chip through the outlet to the outside of the device where the inlet chip is located. The present application enables all editing actions of the message to be completed on the inlet chip of the message, without the need to edit the message on the outlet chip of the message, so that there is no need to carry the message editing information obtained on the inlet chip to the outlet chip, thereby reducing the complexity of editing resource management, and can also greatly save the bandwidth of the chip interconnection port.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of network communication technology, and in particular to a message processing method, a message forwarding method, a device and equipment. Background Art

[0002] Ethernet has different protocol messages, and the Ethernet switching chip needs to edit the original message to generate a new message during the message processing process.

[0003] In the message processing process, the switching chip first searches the message forwarding table through the IPE (Ingress Process Engine) module to obtain the forwarding destination and message editing information, and then stores and forwards the message through the BSR (Buffer Store Retrieve) module, and then edits the original message through the EPE (Egress Process Engine) module according to the editing information obtained by the IPE module. In the message editing process, the message needs to be edited or other actions need to be performed according to the attributes configured on the egress end.

[0004] In a single-chip application, the switching chip can easily obtain the attribute message configured on the egress end, and message editing is easy to implement.

[0005] In multi-chip scenario applications, such as stacking systems, multiple stacking member devices are virtualized into one network device, and the message needs to enter from the entry chip (that is, the chip where the message entry end is located), and send the message to the message exit chip (that is, the chip where the message exit end is located) through the interconnection port between chips. At the same time, the message editing information obtained from the entry chip is carried to the exit chip, and the attributes configured on the exit end and the edit information carried are obtained on the exit chip to edit the message. In this scenario application, editing resources must be globally allocated and managed on the exit chip, but this will make editing resource management more complicated; in addition, since the editing information needs to be carried to the exit chip when editing the message on the exit chip, this will also waste the bandwidth of the chip interconnection port and even cause the risk of network congestion. Summary of the invention

[0006] The embodiments of the present application provide a message processing method, a message forwarding method, an apparatus and a device.

[0007] The technical solution of this application is implemented as follows:

[0008] In a first aspect, a message processing method is provided, which is applied to an ingress chip, and the method includes:

[0009] receiving a first message;

[0010] Determine, according to the destination MAC address of the first message, a port number of an egress port for forwarding the first message and editing information for editing the first message;

[0011] According to the port number of the export port, acquiring the attribute information of the export port;

[0012] According to the attribute information and the editing information, the header of the first message is edited to obtain a second message; wherein the second message is forwarded by the ingress chip through the egress port to the outside of the device where the ingress chip is located.

[0013] In the above technical solution, the method further comprises:

[0014] marking the second message;

[0015] The marked second message is sent to the egress chip included in the device where the ingress chip is located, wherein the marked second message is used for the egress chip to forward outward from the egress end without editing the message.

[0016] In the above technical solution, obtaining the attribute information of the outlet port according to the port number of the outlet port includes:

[0017] The port attribute table is queried according to the port number of the egress port to obtain the attribute information of the egress port.

[0018] In the above technical solution, obtaining the attribute information of the outlet port according to the port number of the outlet port includes:

[0019] According to the mapping relationship between the chip identifier and the index interval information in the preset index mapping table, the index interval information corresponding to the chip identifier of the egress chip where the egress end is located is obtained;

[0020] According to the index interval information, obtaining the index value of the port attribute table corresponding to the egress port;

[0021] The attribute information of the egress port is read from the port attribute table corresponding to the index value.

[0022] In the above technical solution, the index interval information corresponding to the chip identification of the egress chip includes: the base address of the port attribute table corresponding to the chip identification of the egress chip, the minimum port number and the maximum port number of the egress chip.

[0023] In the above technical solution, obtaining the index value of the port attribute table corresponding to the egress port according to the index interval information includes:

[0024] Determine the difference between the port number of the egress port and the minimum port number as an offset;

[0025] An index value of the port attribute table corresponding to the egress port is determined according to the offset and a base address of the port attribute table.

[0026] In the above technical solution, the step of editing the header of the first message to obtain the second message according to the attribute information and the editing information includes:

[0027] Editing the layer-3 header of the first message according to the editing information;

[0028] Edit the layer 2 header and / or layer 3 header of the first message according to the attribute information.

[0029] In the above technical solution, the method further comprises:

[0030] When the attribute information and the editing information conflict in editing operations on the layer-3 header of the first message, determining the priority of the attribute information;

[0031] When the priority of the attribute information is higher than the priority of the editing information, the layer-3 header of the first message is edited according to the attribute information; otherwise, the layer-3 header is edited according to the editing information.

[0032] In a second aspect, a message forwarding method is provided, which is applied to an egress chip, and the method includes:

[0033] Receive messages from the ingress chip;

[0034] Determine whether the message received from the entry chip is a second message, wherein the second message is: a message obtained by the entry chip editing a packet header of the first message;

[0035] When the message received from the ingress chip is the second message, the second message is forwarded outward through the egress port without editing the second message.

[0036] In the above technical solution, the step of determining whether the message is a second message obtained by editing the first message includes:

[0037] Determining whether the message received from the ingress chip carries an edited flag;

[0038] When the message received from the entry chip carries an edited mark, it is determined that the message received from the entry chip is the second message.

[0039] In the above technical solution, the method further comprises:

[0040] When the message received from the entry chip is not the second message, receiving editing information of the message from the entry chip and attribute information of the egress end of the message received from the entry chip;

[0041] Editing a packet header of a message received from the ingress chip according to the editing information and the attribute information;

[0042] The message with the edited packet header is forwarded through the egress port to the outside of the device where the egress chip is located.

[0043] In a third aspect, a message processing device is provided, which is applied to an ingress chip, and the device includes:

[0044] A receiving module, used for receiving a first message;

[0045] A determination module, used to determine the port number of the egress port for forwarding the first message and the editing information for editing the first message according to the destination MAC address of the first message;

[0046] An acquisition module, used for acquiring attribute information of the export port according to the port number of the export port;

[0047] An editing module is used to edit the packet header of the first message to obtain a second message according to the attribute information and the editing information; wherein the second message is forwarded by the ingress chip through the egress port to the outside of the device where the ingress chip is located.

[0048] In a fourth aspect, a message forwarding device is provided, which is applied to an egress chip, and the device includes:

[0049] A receiving module, used for receiving messages from an ingress chip;

[0050] A determination module, used to determine whether the message received from the entry chip is a second message, wherein the second message is: a message obtained by the entry chip editing the packet header of the first message;

[0051] A sending module is used for forwarding the second message outward through the egress port without editing the second message when the message received from the ingress chip is the second message.

[0052] In the fifth aspect, an electronic device is provided, comprising a memory and a processor, characterized in that a computer program is stored in the memory, and the processor is configured to run the computer program to execute the message processing method described in the first aspect; or, the processor is configured to run the computer program to execute the message forwarding method described in the second aspect.

[0053] In a sixth aspect, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the message processing method described in the first aspect when running; or, the processor is configured to run the computer program to execute the message forwarding method described in the second aspect.

[0054] The embodiment of the present application provides a message processing method, a message forwarding method, a device and an apparatus. The message processing method is applied to an inlet chip. By receiving a first message, the port number of the outlet for forwarding the first message and the editing information for editing the first message are determined according to the destination MAC address of the first message; the attribute information of the outlet is obtained according to the port number of the outlet; the packet header of the first message is edited according to the attribute information and the editing information to obtain a second message; wherein the second message is forwarded by the inlet chip through the outlet to the outside of the device where the inlet chip is located. As a result, all editing actions of the message can be completed on the inlet chip of the message without editing the message on the outlet chip of the message. In this way, it is not necessary to carry the message editing information obtained on the inlet chip to the outlet chip, thereby solving the problem of complex management of editing resources and wasting the bandwidth of the chip interconnection port caused by implementing message editing on the outlet chip in the related technology, reducing the complexity of editing resource management, and also greatly saving the bandwidth of the chip interconnection port. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] Figure 1 It is a flow chart of the message processing method provided in the embodiment of the present application;

[0056] Figure 2 is another flow chart of the message processing method provided in an embodiment of the present application;

[0057] Figure 3 is a flow chart of obtaining attribute information of an export terminal provided in an embodiment of the present application;

[0058] Figure 4 It is a flow chart of the message forwarding method provided in the embodiment of the present application;

[0059] Figure 5 is another flow chart of the message forwarding method provided in an embodiment of the present application;

[0060] Figure 6 It is a flow chart of a message processing and message forwarding method provided in an embodiment of the present application;

[0061] Figure 7 It is a schematic diagram of a global port index mapping table and an egress attribute table provided in an embodiment of the present application;

[0062] Figure 8It is a structural schematic diagram of a message processing device provided in an embodiment of the present application;

[0063] Fig. 9 It is a structural diagram of a message forwarding device provided in an embodiment of the present application;

[0064] Fig.10 It is a schematic diagram of the structure of the electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0065] In order to make the purpose, technical scheme and advantages of the present application clearer, the technical scheme in the embodiment of the present application will be clearly and completely described below in conjunction with the drawings in the embodiment of the present application. Obviously, the described embodiment is only a part of the embodiment of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application. In the absence of conflict, the embodiments in the present application and the features in the embodiments can be combined with each other arbitrarily. The steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions. In addition, although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that here.

[0066] It should be noted that, unless the context clearly requires otherwise, words such as “include”, “including” and similar words throughout the specification and claims should be interpreted as including rather than exclusive or exhaustive; that is, the meaning is “including but not limited to”.

[0067] In addition, in the description of the present application, it should be understood that the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of the present application, unless otherwise specified, the meaning of "plurality" is two or more.

[0068] The embodiment of the present application provides a message processing method, which can be applied to the inlet chip of the message, and the chip can be an application-specific integrated circuit (ASIC) chip, or a field programmable gate array (FPGA) chip, or NP, etc., and can be adjusted accordingly according to actual conditions. Among them, the inlet chip includes: an inbound processing engine IPE, a storage and forwarding module BSR, and an outbound processing engine EPE.

[0069] like Figure 1As shown, an embodiment of the present application provides a message processing method, which is applied to an ingress chip. The method may include the following steps:

[0070] S11. Receive a first message.

[0071] Here, the first message refers to any received message.

[0072] Specifically, after the first message enters the ingress chip through the ingress port, the first message is received by the ingress processing engine module of the ingress chip.

[0073] S12: Determine, according to the destination MAC address of the first message, the port number of the egress port for forwarding the first message and the editing information for editing the first message.

[0074] The egress port is used to forward the message to a device outside the ingress chip. The message editing information includes editing operations on the message. The editing operations include but are not limited to: deletion, addition, modification and / or replacement.

[0075] Specifically, the IPE of the ingress chip can search the port number of the egress port corresponding to the destination MAC address in the forwarding table according to the destination MAC address in the first message, obtain the port number of the egress end for forwarding the first message, the chip identifier of the egress chip and the editing information index value of the first message, obtain the search result, and forward the search result and the first message to the EPE of the ingress chip through the BSR of the ingress chip.

[0076] Among them, the forwarding table contains two important information: the editing information index value and the export information. The editing information index value is used to index the corresponding forwarding next hop to obtain the editing information of the first message. The editing information index value can be represented by nexthopPtr (i.e., the next hop index value). NexthopPtr is used to index DsNextHop to obtain the message editing information. The export information includes the port number of the export port corresponding to the destination MAC address and the chip identifier of the export chip where the export port is located. Here, the chip identifier of the chip is a global identifier that can uniquely identify a chip.

[0077] The editing information may include layer 2 header editing information and / or layer 3 header editing information.

[0078] The layer 2 header editing information includes: editing information of at least one of a destination MAC address, a source MAC address, an inner VLAN (Virtual Local Area Network) header, and an outer VLAN header.

[0079] The layer 3 header editing information includes, but is not limited to, editing information of IPv4 (Internet Protocol Version 4), IPv6 (Internet Protocol Version 6) and ARP (Address Resolution Protocol) messages.

[0080] The edited information of the IPv4 message includes, but is not limited to: the edited information of the protocol field, TTL (Time To Live), ECN (Explicit Congestion Notification), DSCP (Differentiated Services Code Point), destination IP address and source IP address of the IPv4 message.

[0081] The edited information of the IPv6 message includes, but is not limited to, the edited information of the flow label, protocol field, TTL, ECN, DSCP, destination IP address, and source IP address of the IPv6 message.

[0082] The edited information of the ARP message includes, but is not limited to: the destination protocol address of the ARP message, the destination hardware address, the sender protocol address, the sender hardware address, the protocol type, and the hardware type.

[0083] S13. Obtain attribute information of the exit port according to the port number of the exit port.

[0084] Among them, the attribute information at the exit end includes layer 2 header editing information and / or layer 3 header editing information. The layer 2 header editing information is, for example: processing rules for vlan tags in the inner VLAN header and the outer VLAN header, which are used to edit the vlan tag carried by the first message accordingly. Here, the virtual LAN tag processing rules include insertion, deletion, change or replacement; for example, whether to strip off the virtual LAN vlan tag carried by the message, the default vlan value on the port, etc.; the layer 3 header editing information is, for example: editing information of DSCP, destination IP address and source IP address, etc.

[0085] Specifically, the EPE of the ingress chip receives the search result of the first message forwarded by the BSR, and indexes to the corresponding forwarding next hop according to the editing information index value in the search result to obtain the editing information of the first message.

[0086] S14. Edit the header of the first message to obtain a second message according to the attribute information and the editing information; wherein the second message is forwarded by the ingress chip through the egress port to the outside of the device where the ingress chip is located.

[0087] Specifically, the EPE of the ingress chip edits the header of the first message according to the attribute information and the editing information to obtain the second message.

[0088] The above-mentioned message processing method is applied to the inlet chip, by receiving the first message, and determining the port number of the outlet for forwarding the first message and the editing information for editing the first message according to the destination MAC address of the first message; obtaining the attribute information of the outlet according to the port number of the outlet; editing the packet header of the first message to obtain the second message according to the attribute information and the editing information; wherein the second message is forwarded by the inlet chip through the outlet to the outside of the device where the inlet chip is located. As a result, all editing actions of the message can be completed on the inlet chip of the message, without the need to edit the message on the outlet chip of the message, so that there is no need to carry the message editing information obtained on the inlet chip to the outlet chip, thereby solving the problem of complex management of editing resources and wasting the bandwidth of the chip interconnection port caused by implementing message editing on the outlet chip in the related technology, reducing the complexity of editing resource management, and at the same time can greatly save the bandwidth of the chip interconnection port.

[0089] In one embodiment, Figure 2 As shown, based on Figure 1 , the method may further include:

[0090] S15. Mark the second message.

[0091] Specifically, the EPE of the ingress chip marks the second message with an edited mark, which can be a bypass nexthopPtr (next hop index value with a skip mark) to instruct the egress chip of the second message to skip executing the index to the corresponding forwarding next hop for the second message, that is, skip reading the message editing information.

[0092] S16. Send the marked second message to the egress chip included in the device where the ingress chip is located, wherein the marked second message is used for the egress chip to forward outward from the egress end without editing the message.

[0093] Here, the ingress chip of the message and the egress chip of the message are interconnected and can be virtually formed into a network device, and there is an interconnection port between the egress chip and the ingress chip.

[0094] Specifically, the EPE of the ingress chip sends the second message carrying the edited mark to the egress chip where the egress port is located through the chip interconnection port.

[0095] In this embodiment, the marked second message is sent to the egress chip. Since the marked second message is used for the egress chip to forward it outward from the egress end without editing the message, there is no need for the egress chip to edit the second message and the second message can be directly forwarded outward from the egress end. As a result, there is no need to carry the message editing information obtained from the ingress chip to the egress chip, thereby reducing the complexity of the egress chip's management of editing resources and greatly saving the bandwidth of the chip interconnection port.

[0096] In one embodiment, in step S13, the attribute information of the egress port is obtained according to the port number of the egress port. The process may include:

[0097] The port attribute table is queried according to the port number of the egress port to obtain the attribute information of the egress port.

[0098] The port attribute table is pre-stored on the ingress chip and records the attribute information of different ports.

[0099] In one example, the port number of the egress port may be a global identifier that can uniquely identify a port. For example, for chip A and chip B each having 10 ports, the ports of chip A may be identified as port 1 to port 10, and the ports of chip B may be identified as port 11 to port 20.

[0100] In a specific implementation, the port attribute table may be queried according to the global identifier of the egress port to obtain the attribute information of the egress port.

[0101] In another example, the port number of the egress port is used to uniquely identify the port on a chip.

[0102] In a specific implementation, the attribute information of the egress port can be obtained by querying the port attribute table of the egress chip according to the port number of the egress port and the chip identifier of the egress chip where the egress port is located.

[0103] In one embodiment, Figure 3 As shown, in step S13, the attribute information of the outlet port is obtained according to the port number of the outlet port. The process may include:

[0104] S131. According to the mapping relationship between the chip identifier and the index interval information in the preset index mapping table, obtain the index interval information corresponding to the chip identifier of the egress chip where the egress end is located.

[0105] The preset index mapping table may be a global port index mapping table pre-stored in the first chip, and different chip identifiers in the preset index mapping table may correspond to different index interval information.

[0106] Specifically, the preset index mapping table may be indexed based on the chip identifier of the egress chip to obtain index interval information corresponding to the chip identifier of the egress chip.

[0107] S132: Obtain an index value of the port attribute table corresponding to the egress port according to the index interval information.

[0108] The index interval information corresponding to the chip identifier of the egress chip may include: the base address of the port attribute table corresponding to the chip identifier of the egress chip, the minimum port number of the egress chip, and the maximum port number. Here, the port attribute table may be a global port attribute table pre-stored in the ingress chip, and the port attribute table stores port information related to message editing, such as whether to strip off the vlan tag, the default vlan tag value, and so on.

[0109] It can be understood that the index interval information corresponding to the chip identifier of the egress chip may also include index values ​​corresponding to different ports of the egress chip, and the index value of the port may be used to obtain attribute information of the port.

[0110] In one example, the process may include:

[0111] The difference between the port number of the egress port and the minimum port number is determined as an offset, and the index value of the port attribute table corresponding to the egress port is determined according to the offset and the base address of the port attribute table.

[0112] Specifically, the index value of the global port attribute table corresponding to the egress port can be calculated according to the formula: index value=base address of the global port attribute table+egress port number-minimum port number.

[0113] After the index value is calculated, the attribute information of the egress port can be obtained based on the index value.

[0114] Optionally, before step S132, the method may further include:

[0115] According to the maximum port number and the minimum port number in the index interval information, determine whether the port number of the exit port is valid. If the port number is valid, execute step S132. If the port number is invalid, discard the first message, wherein the valid port number is between the minimum port number and the maximum port number.

[0116] S133. Read the attribute information of the egress port from the port attribute table corresponding to the index value.

[0117] In this embodiment, the index interval information corresponding to the chip identifier of the egress chip is obtained through a preset index mapping table, and based on the index interval information, the index value of the port attribute table corresponding to the egress port is obtained, and the attribute information of the egress port is read from the port attribute table corresponding to the index value, thereby achieving the acquisition of the attribute information of the egress port at the ingress chip, and being able to quickly acquire the attribute information of the egress port; in addition, since the egress attribute table is not fixedly allocated, but uses the global chip ID as an index to obtain the range of the egress attribute table, dynamic and flexible allocation of each chip can be achieved.

[0118] In one embodiment, in the above step S14, editing the header of the first message to obtain the second message according to the attribute information and the editing information may include:

[0119] The layer-3 header of the first message is edited according to the editing information, and the layer-2 header and / or layer-3 header of the first message is edited according to the attribute information.

[0120] Specifically, edit the layer 2 header of the first message according to the layer 2 header editing information in the editing information, edit the layer 3 header of the first message according to the layer 3 header editing information in the editing information, edit the layer 2 header of the first message according to the attribute information, and determine the edited first message as the second message.

[0121] In specific implementation, the layer 2 header of the first message can be edited according to the editing information of at least one of the destination MAC address, the source MAC address, the inner VLAN header, and the outer VLAN header; the layer 3 header of the first message can be edited according to the editing information of one of the IPv4, IPv6 and ARP messages; the layer 2 header of the first message can be edited according to the virtual LAN VLAN tag processing rules included in the attribute information, so that the edited first message has the virtual LAN tag of the outgoing port.

[0122] In one embodiment, the method may further include:

[0123] When the editing operations of the three-layer header of the first message by the attribute information and the editing information conflict, the priority of the attribute information is determined. When the priority of the attribute information is higher than the priority of the editing information, the three-layer header of the first message is edited according to the attribute information; otherwise, the three-layer header is edited according to the editing information.

[0124] Among them, corresponding priorities can be set for the editing operations of the attribute information and the editing information on the message according to actual application requirements. For example, the priority of the attribute information is set higher than the priority of the editing information. At this time, the second layer header of the first message is edited according to the attribute information, but the embodiments of the present application are not limited to this.

[0125] In this embodiment, there may be a situation where both the attribute information and the editing information perform editing operations on the third-layer header of the first message. By determining that the priority of the attribute information is higher than the priority of the editing information, the second-layer header of the first message is edited according to the priority of the attribute information, thereby ensuring that the first message can be edited normally.

[0126] Based on the message processing method provided in the above embodiment, the embodiment of the present application also provides a message forwarding method, which is applied to the egress chip of the message, which can be an application-specific integrated circuit (ASIC) chip, or a field programmable gate array (FPGA) chip, or NP, etc., which can be adjusted accordingly according to actual conditions. Among them, the egress chip includes: an inbound processing engine IPE, a storage and forwarding module BSR, and an outbound processing engine EPE.

[0127] like Figure 4 As shown, an embodiment of the present application provides a message forwarding method, which is applied to an egress chip. The method may include the steps of:

[0128] S21. Receive a message from an ingress chip.

[0129] Specifically, the message is sent from the ingress chip to the egress chip through the chip interconnection port between the ingress chip and the egress chip. After the ingress message reaches the egress chip, the message is received by the ingress processing engine IPE of the egress chip and forwarded to the EPE of the egress chip through the BSR of the egress chip.

[0130] S22. Determine whether the message received from the ingress chip is a second message, wherein the second message is: a message obtained by the ingress chip editing the packet header of the first message.

[0131] Specifically, the EPE of the egress chip determines whether the message received from the ingress chip is the second message.

[0132] In one example, the process may include:

[0133] It may be determined whether the message received from the ingress chip carries an edited mark. When the message received from the ingress chip carries the edited mark, it is determined that the message received from the ingress chip is the second message.

[0134] S23: When the message received from the ingress chip is the second message, forward the second message outward through the egress port without editing the second message.

[0135] Specifically, when the EPE of the egress chip determines that the message is the second message, the message is directly forwarded outward through the egress port.

[0136] The above-mentioned message forwarding method is applied to the egress chip, and by receiving a message from the ingress chip, it is determined whether the message received from the ingress chip is a second message, wherein the second message is: a message obtained by editing the header of the first message by the ingress chip; when the message received from the ingress chip is the second message, the second message is forwarded outward through the egress port without editing the second message. Since all editing actions of the message can be completed on the ingress chip of the message, when the egress chip determines that the message received from the ingress chip is the second message obtained by editing the header of the first message by the ingress chip, the egress chip no longer needs to edit the message by obtaining the editing information from the ingress chip, but forwards the message to the outside of the device where the egress chip is located through the egress port, which solves the problem of complex management of editing resources and waste of bandwidth of chip interconnection ports caused by implementing message editing on the egress chip in the related technology, thereby reducing the complexity of editing resource management, and can also greatly save the bandwidth of chip interconnection ports.

[0137] In one embodiment, Figure 5 As shown, based on Figure 4 , the method may further include:

[0138] S24. When the message received from the ingress chip is not the second message, edit information of the message received from the ingress chip and attribute information of the egress end of the message received from the ingress chip.

[0139] Specifically, the inbound processing engine IPE of the egress chip receives the editing information of the message and the attribute information of the egress end, and forwards the editing information and the attribute information to the EPE of the egress chip through the BSR of the egress chip.

[0140] S25. Edit the packet header of the message received from the ingress chip according to the editing information and the attribute information.

[0141] Specifically, the EPE of the egress chip edits the packet header of the message received from the ingress chip according to the editing information and the attribute information.

[0142] The implementation process of this step may refer to step S14 in the above embodiment, which will not be described in detail here.

[0143] S26. Forward the message with the edited packet header through the egress port to the outside of the device where the egress chip is located.

[0144] In this embodiment, when the message received from the ingress chip is not an edited message, the message editing operation can be performed on the egress chip according to the editing information of the message received from the ingress chip and the attribute information of the egress end of the message.

[0145] Combine the following Figure 6 , taking the stacking system as an example, the message processing process of the ingress chip and the message forwarding process of the egress chip are illustrated. The stacking system includes stacked ingress chips and egress chips, one of the two stacked chips is defined as the ingress chip, and the chip connected to it and located downstream thereof is correspondingly defined as the egress chip.

[0146] like Figure 6 As shown, the message processing flow of the ingress chip is as follows:

[0147] 1. After the message enters the ingress chip from the network port, the IPE module of the ingress chip obtains destPort and nexthopPtr by searching the forwarding table. Among them, destPort represents the destination egress information, which includes the CHIP ID and egress port number of the egress chip. NexthopPtr is used to index DsNextHop to obtain the message editing information.

[0148] 2. The message is stored by the BSR module, and the message, destPort and nexthopPtr are sent to the EPE module for editing;

[0149] 3. In the EPE module, read the DsNexthop table through nexthopPtr to obtain the editing information of the message. When it is detected that the chip where the egress port is located is not a local chip (that is, the egress CHIP ID is not equal to the local CHIP ID), the global port index mapping table is obtained by indexing according to the CHIP ID in destPort. The global port index mapping table stores the base address of the global egress attribute table and the maximum port number and the minimum port number; the global port index mapping table and the egress attribute table can be referred to Figure 7 shown.

[0150] 4. Determine whether the port number is valid based on the egress port number and the maximum and minimum port numbers stored in the global port index mapping table. If the port number is valid, execute step 5. If the port number is invalid, discard the message. The valid port number should be between the minimum and maximum port numbers.

[0151] 5. According to the base address, export port number and minimum port number of the global export attribute table in the global port index mapping table, the index value of the global port attribute table is calculated according to the following formula:

[0152] Index value = base address of global port attribute table + outgoing port number - minimum port number;

[0153] 6. Get the global port attribute table according to the index value;

[0154] 7. Edit the message accordingly according to the message editing information and the port attributes in the global port attribute table to complete all editing actions of the message.

[0155] 8. Mark the edited message with a bypass nexthopPtr, and send the edited message carrying bypass nexthopPtr and destPort to the egress chip.

[0156] like Figure 6 As shown in the figure, the message forwarding process of the egress chip is as follows:

[0157] 1. After the edited message enters the egress chip, the IPE module of the egress chip skips the forwarding table search;

[0158] 2. The message is forwarded to the EPE module through the BSR module;

[0159] 3. The EPE module reads the DsNexthop table and finds that it is a bypass Nexthop. It skips reading DsDestPort and does not edit the message. It only forwards the message to the corresponding port.

[0160] From the above, it can be seen that the method provided in the embodiment of the present application can use the centralized CPU to reduce the message editing mode in the stacking system to a single chip, that is, the message entry chip, which is very simple to manage and can greatly save the bandwidth of the interconnection port.

[0161] like Figure 8 As shown, an embodiment of the present application provides a message processing device, which is applied to an ingress chip. The device may include:

[0162] The receiving module 801 is used to receive a first message;

[0163] A determination module 802, configured to determine, according to a destination MAC address of the first message, a port number of an egress port for forwarding the first message and editing information for editing the first message;

[0164] The acquisition module 803 is used to acquire the attribute information of the export port according to the port number of the export port;

[0165] The editing module 804 is used to edit the header of the first message to obtain a second message according to the attribute information and the editing information; wherein the second message is forwarded by the ingress chip through the egress port to the outside of the device where the ingress chip is located.

[0166] In one embodiment, the apparatus further comprises:

[0167] A marking module, used for marking the second message;

[0168] The sending module is used to send the marked second message to the egress chip included in the device where the ingress chip is located, wherein the marked second message is used for the egress chip to forward outward from the egress end without editing the message.

[0169] In one embodiment, the acquisition module is specifically used for:

[0170] The port attribute table is queried according to the port number of the egress port to obtain the attribute information of the egress port.

[0171] In one embodiment, the acquisition module is specifically used for:

[0172] According to the mapping relationship between the chip identifier and the index interval information in the preset index mapping table, the index interval information corresponding to the chip identifier of the egress chip where the egress end is located is obtained;

[0173] According to the index interval information, obtain the index value of the port attribute table corresponding to the egress port;

[0174] Read the attribute information of the egress port from the port attribute table corresponding to the index value.

[0175] In one embodiment, the index interval information corresponding to the chip identification of the egress chip includes: a base address of the port attribute table corresponding to the chip identification of the egress chip, a minimum port number of the egress chip, and a maximum port number.

[0176] In one embodiment, the acquisition module is used to acquire the index value of the port attribute table corresponding to the egress port according to the index interval information, including:

[0177] The difference between the port number of the egress port and the minimum port number is determined as an offset;

[0178] According to the offset and the base address of the port attribute table, the index value of the port attribute table corresponding to the egress port is determined.

[0179] In one embodiment, the editing module is specifically used to:

[0180] Editing the layer 3 header of the first message according to the editing information;

[0181] The layer 2 header and / or layer 3 header of the first message is edited according to the attribute information.

[0182] In one embodiment, the editing module is further configured to:

[0183] When the attribute information and the editing information conflict in editing operations on the layer 3 header of the first message, determining the priority of the attribute information;

[0184] When the priority of the attribute information is higher than the priority of the editing information, the layer-3 header of the first message is edited according to the attribute information; otherwise, the layer-3 header is edited according to the editing information.

[0185] It should be noted that: when the message processing device provided in the above embodiment executes the message processing method, only the division of the above program modules is used as an example. In actual application, the above processing can be assigned to different program modules as needed, that is, the internal structure of the device is divided into different program modules to complete all or part of the processing described above. In addition, the message processing device provided in the above embodiment and the message processing method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0186] like Fig. 9 As shown, an embodiment of the present application provides a message forwarding device, which is applied to an egress chip. The device may include:

[0187] Receiving module 901, used to receive messages from the ingress chip;

[0188] The determination module 902 is used to determine whether the message received from the ingress chip is a second message, wherein the second message is: a message obtained by the ingress chip editing the packet header of the first message;

[0189] The sending module 903 is configured to forward the second message outward through the egress port without editing the second message when the message received from the ingress chip is the second message.

[0190] In one embodiment, the determination module is specifically used to:

[0191] Determine whether the message received from the ingress chip carries an edited flag;

[0192] When the message received from the ingress chip carries the edited mark, it is determined that the message received from the ingress chip is the second message.

[0193] In one embodiment, the apparatus further comprises an editing module:

[0194] The receiving module is further used for receiving the editing information of the message received from the inlet chip and the attribute information of the egress end of the message received from the inlet chip when the message received from the inlet chip is not the second message;

[0195] An editing module, used for editing a packet header of a message received from an ingress chip according to the editing information and the attribute information;

[0196] The sending module is also used to forward the message with the edited packet header through the egress port to the outside of the device where the egress chip is located.

[0197] It should be noted that: when the message forwarding device provided in the above embodiment executes the message forwarding method, only the division of the above program modules is used as an example. In actual application, the above processing can be assigned to different program modules as needed, that is, the internal structure of the device is divided into different program modules to complete all or part of the processing described above. In addition, the message forwarding device provided in the above embodiment and the message forwarding method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0198] The present application also provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein:

[0199] When the electronic device is applied to the message processing method, the processor implements the steps of any message processing method of the embodiment of the present application when executing the computer program;

[0200] When the electronic device is applied to the message forwarding method, the processor implements the steps of the message forwarding method of any embodiment of the present application when executing the computer program.

[0201] Fig.10 A hardware structure diagram of an electronic device according to an embodiment of the present application is given. Fig.10 The electronic device 1000 shown includes: at least one processor 1001, a memory 1002, and at least one network interface 1003. The various components in the electronic device 1000 are coupled together via a bus system 1004. It is understood that the bus system 1004 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 1004 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, the bus system 1004 is not described in detail. Fig.10 Various buses are labeled as bus system 1004 .

[0202] It can be understood that the memory 1002 can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories.

[0203] The memory 1002 in the embodiment of the present application is used to store various types of data to support the operation of the electronic device 900. Examples of such data include: any computer program for operating on the electronic device 1000, such as the executable program 10021, and the program implementing the method of the embodiment of the present application may be included in the executable program 10021.

[0204] The embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer-readable storage medium is applied to the message processing method, when the computer program is executed by the processor, the steps in any message processing method of the embodiment of the present application are implemented;

[0205] When the computer-readable storage medium is applied to the message forwarding method, when the computer program is executed by the processor, the steps of the message forwarding method in any of the above embodiments are implemented.

[0206] It should be noted that the storage medium of the embodiment of the present application can be implemented by any type of volatile or non-volatile storage device, or a combination thereof. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM, SyncLink Dynamic Random Access Memory), and direct RAM bus random access memory (DRRAM, Direct Rambus Random Access Memory).The storage media described in the embodiments of the present application are intended to include, but are not limited to, these and any other suitable types of memory.

[0207] 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. The device embodiments described above are only schematic. For example, the division of 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 can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0208] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0209] In addition, all functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may be a separate unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0210] A person skilled in the art can understand that: all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), disks or optical disks, etc. Various media that can store program codes.

[0211] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for an electronic device (which can be a personal computer, server, or network device, etc.) to execute all or part of the methods of each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, disks, or optical disks.

[0212] The methods disclosed in several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.

[0213] The features disclosed in several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.

[0214] The features disclosed in several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.

[0215] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the 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 processing method, characterized in that: The method for the entry chip applied to a multi-chip application scenario includes: receiving a first message; Determine, according to the destination MAC address of the first message, a port number of an egress end of an egress chip for forwarding the first message and editing information for editing the first message; According to the port number of the export port, acquiring the attribute information of the export port; According to the attribute information and the editing information, the header of the first message is edited to obtain a second message; wherein the second message is forwarded by the ingress chip through the egress port to the outside of the device where the ingress chip is located.

2. The method according to claim 1, characterized in that The method further comprises: marking the second message; The marked second message is sent to the egress chip included in the device where the ingress chip is located, wherein the marked second message is used for the egress chip to forward outward from the egress end without editing the message.

3. The method according to claim 1 or 2, characterized in that: The acquiring the attribute information of the export port according to the port number of the export port includes: The port attribute table is queried according to the port number of the egress port to obtain the attribute information of the egress port.

4. The method according to claim 1 or 2, characterized in that: The acquiring the attribute information of the export port according to the port number of the export port includes: According to the mapping relationship between the chip identifier and the index interval information in the preset index mapping table, the index interval information corresponding to the chip identifier of the egress chip where the egress end is located is obtained; According to the index interval information, obtaining the index value of the port attribute table corresponding to the egress port; The attribute information of the egress port is read from the port attribute table corresponding to the index value.

5. The method according to claim 4, characterized in that The index interval information corresponding to the chip identification of the egress chip includes: a base address of a port attribute table corresponding to the chip identification of the egress chip, a minimum port number of the egress chip, and a maximum port number of the egress chip.

6. The method according to claim 5, characterized in that The acquiring, according to the index interval information, an index value of the port attribute table corresponding to the egress port includes: Determine the difference between the port number of the egress port and the minimum port number as an offset; An index value of the port attribute table corresponding to the egress port is determined according to the offset and a base address of the port attribute table.

7. The method according to claim 1, characterized in that The step of editing the header of the first message to obtain the second message according to the attribute information and the editing information includes: Editing the layer-3 header of the first message according to the editing information; Edit the layer 2 header and / or layer 3 header of the first message according to the attribute information.

8. The method according to claim 7, characterized in that The method further comprises: When the attribute information and the editing information conflict in editing operations on the layer-3 header of the first message, determining the priority of the attribute information; When the priority of the attribute information is higher than the priority of the editing information, the layer-3 header of the first message is edited according to the attribute information; otherwise, the layer-3 header is edited according to the editing information.

9. A message forwarding method, characterized in that: Applied to an egress chip in a multi-chip application scenario, the method comprises: Receive messages from the ingress chip; Determine whether the message received from the ingress chip is a second message, wherein the second message is: a message obtained by the ingress chip editing the packet header of the first message based on the editing information of the first message and the attribute information of the egress end of the egress chip; When the message received from the ingress chip is the second message, the second message is forwarded outward through the egress port without editing the second message.

10. The method according to claim 9, characterized in that The determining whether the message is a second message obtained by editing the first message includes: Determining whether the message received from the ingress chip carries an edited flag; When the message received from the entry chip carries an edited mark, it is determined that the message received from the entry chip is the second message.

11. The method according to claim 9, characterized in that The method further comprises: When the message received from the entry chip is not the second message, receiving editing information of the message from the entry chip and attribute information of the egress end of the message received from the entry chip; Editing a packet header of a message received from the ingress chip according to the editing information and the attribute information; The message with the edited packet header is forwarded through the egress port to the outside of the device where the egress chip is located.

12. A message processing device, characterized in that: An entry chip used in a multi-chip application scenario, the device comprising: A receiving module, used for receiving a first message; A determination module, used to determine the port number of the egress end of the egress chip used to forward the first message and the editing information used to edit the first message according to the destination MAC address of the first message; An acquisition module, used for acquiring attribute information of the export port according to the port number of the export port; An editing module is used to edit the packet header of the first message to obtain a second message according to the attribute information and the editing information; wherein the second message is forwarded by the ingress chip through the egress port to the outside of the device where the ingress chip is located.

13. A message forwarding device, characterized in that: An egress chip used in a multi-chip application scenario, the device comprising: A receiving module, used for receiving messages from an ingress chip; a determination module, configured to determine whether the message received from the ingress chip is a second message, wherein the second message is a message obtained by editing the header of the first message by the ingress chip based on the editing information of the first message and the attribute information of the egress end of the egress chip; A sending module is used for forwarding the second message outward through the egress port without editing the second message when the message received from the ingress chip is the second message.

14. An electronic device comprising a memory and a processor, characterized in that: The memory stores a computer program, and the processor is configured to run the computer program to execute the message processing method described in any one of claims 1 to 8; or, the processor is configured to run the computer program to execute the message forwarding method described in any one of claims 9 to 11.

15. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the message processing method described in any one of claims 1 to 8 when running; or the computer program is configured to run the computer program to execute the message forwarding method described in any one of claims 9 to 11.