Message forwarding method, apparatus and device, and computer readable storage medium

By using identification information and direct tunnels, the method ensures consistent message interfaces, reducing device interactions and troubleshooting complexity in communication systems.

CN119155243APending Publication Date: 2024-12-17HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310714870.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-15
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

Existing communication technologies fail to ensure that the input and output interfaces for message forwarding between terminals and network devices are the same, leading to increased complexity and cost in troubleshooting when abnormalities occur.

Method used

A method and device that utilize identification information to ensure the same interface for message input and output by establishing tunnels like SRv6 or GRE tunnels, ensuring direct connection between devices, and using APN-IDs to identify and forward messages accurately.

Benefits of technology

Reduces the number of devices involved in interactions, simplifying troubleshooting by guaranteeing the same interface for message flow, thereby reducing complexity and cost.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119155243A_ABST
    Figure CN119155243A_ABST
Patent Text Reader

Abstract

The invention discloses a message forwarding method, device and equipment and a computer readable storage medium, and belongs to the technical field of communication. The method comprises the following steps: a second device adds first identification information for identifying a first interface for the second device to receive a second message into the received second message to obtain a first message sent to a first device; the first device generates, based on the first message, a third message including second identification information for identifying a second interface for the second device to forward the third message, the first interface being the same as the second interface; and the second device forwards the third message through the second interface based on the second identification information in the third message sent by the first device. According to the invention, the incoming interface for receiving the message and the outgoing interface for forwarding the message of the network equipment are identified, so that the incoming interface and the outgoing interface are the same interface, the source-in and source-out of the message are ensured, the interaction interface of the network and the terminal is fixed, and the difficulty of troubleshooting the faulty equipment when an abnormality occurs in the interaction process of the network and the terminal is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a method, apparatus, device and computer-readable storage medium for forwarding a message. Background Art

[0002] With the development of communication technology, the interaction between terminals and network devices is becoming more and more common. More and more messages need to be transmitted in communication links. The network devices in the communication links complete the transmission of messages by forwarding them to achieve interaction between terminals and network devices. Summary of the invention

[0003] The present application provides a method, apparatus, device and computer-readable storage medium for forwarding a message, so as to ensure that the input interface of the message entering the network side and the output interface of the message forwarded from the network side are the same interface, that is, to ensure the source of the message, the technical solution is as follows:

[0004] In the first aspect, a method for forwarding a message is provided, which is applied to a first device, and the method includes: receiving a first message sent by a second device, the first message is generated by the second device based on the received second message, the first message includes first identification information, and the first identification information is used to identify the first interface of the second device receiving the second message; based on the first message, generating a third message including second identification information, the second identification information is used to identify the second interface of the second device forwarding the third message, and the first interface is the same as the second interface; sending the third message to the second device. The first device receives the first message including the first identification information, and clearly states that the input interface of the second message indicated by the first identification information is the first interface. According to the first message, the first device determines the second interface that is the same as the first interface as the output interface of the third message, and generates a third message including second identification information for identifying the second interface, so that the second device can forward the third message through the second interface based on the second identification information included in the third message, and ensure that the input interface of the message entering the network side and the output interface of the message transferred out of the network side are the same interface, that is, the source entry and source exit of the message are ensured. This can reduce the number of devices involved in the interaction between the terminal and the network side, and can also reduce the number of devices that need to be troubleshooted when an abnormality occurs in the interaction between the terminal and the network side, thereby reducing the difficulty and cost of troubleshooting.

[0005] In a possible implementation, generating a third message including the second identification information based on the first message includes: determining the second identification information based on the routing information and the first identification information in the fourth message, and generating the fourth message based on the first message; and updating the fourth message based on the second identification information to obtain the third message. Determining the second identification information based on the routing information and the first identification information can ensure that the second interface indicated by the second identification information is the same as the first interface indicated by the first identification information, and further ensure forwarding based on the third message including the second identification information, thereby realizing the source-in and source-out of the message.

[0006] In a possible implementation, before determining the second identification information according to the routing information and the first identification information in the fourth message, the method further includes: obtaining the first session information corresponding to the first message, the first session information being used to store the first identification information; generating a fifth message based on the first message; adding the first identification information to the fifth message based on the first identification information stored in the first session information to obtain a fourth message. According to the first identification information stored in the first session information, a fourth message including the first identification information is obtained, so as to subsequently generate a third message according to the first identification information in the fourth message, thereby improving the accuracy and efficiency of generating the third message.

[0007] In a possible implementation, obtaining the first session information corresponding to the first message includes: obtaining the second session information corresponding to the first message, the second session information being the session information not including the first identification information; and adding the first identification information in the first message to the second session information to obtain the first session information. By adding the first identification information to the second session information, the first identification information is stored in the session information, thereby improving the efficiency and accuracy of subsequently generating a fourth message according to the first identification information.

[0008] In a possible implementation, a first tunnel is established between the first device and the second device, and the first tunnel is a segment routing (segment routing over IPv6, SRv6) tunnel based on the forwarding plane of Internet Protocol version 6 (internet protocol version 6, IPv6); the routing information includes the correspondence between the first identification information and the address of the second device, and the correspondence between the first identification information and the address of the first interface; the second identification information includes the address of the second device and the address of the second interface. The first tunnel established between the first device and the second device can enable the first device and the second device to be directly connected in one hop. In the case where the first tunnel is an SRv6 tunnel, the second identification information including the address of the second device and the address of the second interface can ensure that the first device and the second device forward the third message according to the determined path, ensuring the source entry and source exit of the message.

[0009] In one possible implementation, a second tunnel is established between the first device and the second device, and the second tunnel is a general routing encapsulation (GRE) tunnel; the routing information includes the correspondence between the first identification information and the address of the second device, and the correspondence between the address of the second device and the identification information of the second interface; the second identification information includes the identification information of the second interface and the address of the second device. The second tunnel established between the first device and the second device can enable the first device and the second device to be directly connected in one hop. In the case where the first tunnel is a GRE tunnel, the second identification information including the identification information of the second interface and the address of the second device can ensure that the first device and the second device forward the third message according to the determined path, ensuring the source entry and source exit of the message.

[0010] In a possible implementation, the first identification information includes an application-aware networking identifier (APN-ID) corresponding to the first interface. Identifying the first interface by the APN-ID that can be recognized by both the first device and the second device can ensure that the source input and source output of the message are realized based on the first identification information.

[0011] In the second aspect, a method for forwarding a message is provided, which is applied to a second device, and the method includes: receiving a second message through a first interface on the second device; adding first identification information to the second message to obtain a first message, wherein the first identification information is used to identify the first interface of the second device receiving the second message; sending a first message including the first identification information to the first device; receiving a third message sent by the first device based on the first message, wherein the third message includes second identification information, wherein the second identification information is used to identify the second interface of the second device forwarding the third message, wherein the first interface is the same as the second interface; forwarding the third message through the second interface according to the second identification information. The second device determines the first interface for receiving the second message, and generates a first message according to the first identification information indicating the first interface, so that the first device can generate a third message including the second identification information for identifying the second interface based on the first message. The second device forwards the third message through the second interface based on the second identification information included in the third message, and ensures that the inbound interface of the message entering the network side and the outbound interface of the message transferred out of the network side are the same interface, that is, the source in and source out of the message are ensured. This can reduce the number of devices involved in the interaction between the terminal and the network side, and can also reduce the number of devices that need to be troubleshooted when an abnormality occurs in the interaction between the terminal and the network side, thereby reducing the difficulty and cost of troubleshooting.

[0012] In a possible implementation, before adding the first identification information to the second message and obtaining the first message, the method further includes: determining the first identification information corresponding to the first interface according to the correspondence between each interface on the second device and the identification information. The first identification information determined by the second device according to the correspondence between each interface on the second device and the identification information can ensure that the first identification information is used to identify the first interface, and ensure the accuracy and reliability of the first identification information.

[0013] In a possible implementation, a first tunnel is established between the first device and the second device, and the first tunnel is an SRv6 tunnel; the second identification information includes the address of the second device and the address of the second interface. The first tunnel between the first device and the second device enables the first device and the second device to be directly connected in one hop. In the case where the first tunnel is an SRv6 tunnel, the second identification information including the address of the second device and the address of the second interface can ensure that the first device and the second device forward the third message according to the determined path, ensuring the source entry and source exit of the message.

[0014] In a possible implementation, a second tunnel is established between the first device and the second device, and the second tunnel is a GRE tunnel; the second identification information includes identification information of the second interface. The second tunnel established between the first device and the second device enables the first device and the second device to be directly connected in one hop. In the case where the first tunnel is a GRE tunnel, the second identification information including the identification information of the second interface and the address of the second device can ensure that the first device and the second device forward the third message according to the determined path, ensuring the source entry and source exit of the message.

[0015] In a possible implementation, the first identification information includes an APN-ID corresponding to the first interface. Identifying the first interface by an APN-ID that can be recognized by both the first device and the second device can ensure that the source input and source output of the message are implemented based on the first identification information.

[0016] In a third aspect, a device for forwarding messages is provided, which is applied to a first device, and the device includes: a transceiver module, used to perform reception and / or sending related operations performed by the first device in the first aspect or any possible implementation of the first aspect; a processing module, used to perform other operations besides the reception and / or sending related operations performed by the first device in the first aspect or any possible implementation of the first aspect.

[0017] In a fourth aspect, a device for forwarding messages is provided, which is applied to a second device, and the device includes: a transceiver module, used to perform reception and / or sending related operations performed by the second device in the second aspect or any possible implementation of the second aspect; a processing module, used to perform other operations other than the reception and / or sending related operations performed by the second device in the second aspect or any possible implementation of the second aspect.

[0018] In a fifth aspect, another communication device is provided, the device comprising: a network interface, a memory, and a processor. The network interface, the memory, and the processor communicate with each other through an internal connection path, the memory is used to store instructions, and the processor is used to execute the instructions stored in the memory to control the network interface to receive signals and control the network interface to send signals, and when the processor executes the instructions stored in the memory, the processor executes the method in the first aspect or any possible implementation of the first aspect, or executes the method in the second aspect or any possible implementation of the second aspect.

[0019] Optionally, there are one or more processors and one or more memories.

[0020] Optionally, the memory may be integrated with the processor, or the memory may be provided separately from the processor.

[0021] In a sixth aspect, a communication system is provided, the system comprising the apparatus in the third aspect or any possible implementation of the third aspect and the apparatus in the fourth aspect or any possible implementation of the fourth aspect.

[0022] In the seventh aspect, a computer program (product) is provided, which includes: computer program code, which, when executed by a computer, enables the computer to execute the method in the first aspect or any possible implementation of the first aspect, or execute the method in the second aspect or any possible implementation of the second aspect.

[0023] In an eighth aspect, a computer-readable storage medium is provided, which stores a program or instruction. When the program or instruction runs on a computer, the method in the above-mentioned first aspect or any possible implementation of the first aspect, or the method in the second aspect or any possible implementation of the second aspect is executed.

[0024] In the ninth aspect, a chip is provided, comprising a processor for calling and executing instructions stored in a memory from the memory, so that a computer equipped with the chip executes the method in the first aspect or any possible implementation of the first aspect, or executes the method in the second aspect or any possible implementation of the second aspect.

[0025] In the tenth aspect, another chip is provided, comprising: an input interface, an output interface, a processor and a memory, wherein the input interface, the output interface, the processor and the memory are connected via an internal connection path, and the processor is used to execute the code in the memory. When the code is executed, a computer equipped with the chip executes the method in the first aspect or any possible implementation of the first aspect, or executes the method in the second aspect or any possible implementation of the second aspect.

[0026] It should be understood that the beneficial effects achieved by the technical solutions of the third to tenth aspects of the present application and the corresponding possible implementation methods can be referred to the technical effects of the first and second aspects and their corresponding possible implementation methods mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 A schematic diagram of a scenario of interaction between a terminal and a network device provided in an embodiment of the present application;

[0028] Figure 2 A flowchart of a method for forwarding a message provided in an embodiment of the present application;

[0029] Figure 3 A schematic diagram of the format of a segmented APN-ID provided in an embodiment of the present application;

[0030] Figure 4 A schematic diagram of the structure of APN information provided in an embodiment of the present application;

[0031] Figure 5 A schematic diagram of a mapping table of interface names and identification information provided in an embodiment of the present application;

[0032] Figure 6 A schematic diagram of another scenario of interaction between a terminal and a network device provided in an embodiment of the present application;

[0033] Figure 7 A schematic diagram of a result of forwarding a message provided in an embodiment of the present application;

[0034] Figure 8 A schematic diagram of the structure of a device for forwarding messages provided in an embodiment of the present application;

[0035] Fig. 9 A schematic diagram of the structure of another device for forwarding messages provided in an embodiment of the present application;

[0036] Fig.10 A schematic diagram of the structure of a device for forwarding messages provided in an embodiment of the present application;

[0037] Fig.11A schematic diagram of the structure of another device for forwarding messages provided in an embodiment of the present application. DETAILED DESCRIPTION

[0038] The terms used in the implementation section of this application are only used to explain the specific embodiments of this application and are not intended to limit this application.

[0039] The interaction between the user and the network is usually completed based on the forwarding of messages by network devices. For example, when a user needs to request network resources stored in a network data center, the user sends a user message for requesting the required network resources to the network interface of the network data center through the terminal. The network interface forwards the user message to the network device to realize the transmission of the user message from the user side to the network side. The user message will reach the server that provides network resources for the user after being forwarded layer by layer by multiple network devices. The server determines the network resources required by the user based on the user message and generates a service message corresponding to the user message. The service message is forwarded layer by layer by the network device and reaches the network interface. The network interface transmits it to the terminal so that the service message carrying the network resources reaches the terminal, realizing the user's acquisition of the required network resources. Among them, the network interface of the network data center can be the interface of the router that undertakes the forwarding task in the network data center, or it can be a device in the data center connected to the router that undertakes the forwarding task.

[0040] For example, see Figure 1 , Figure 1A scenario of terminal interaction with network devices is shown. The scenario includes a terminal, a backbone network and multiple data centers (DCs). Among them, the terminal is a device that can interact with the user, such as a smart device such as a smartphone or a personal computer. Each DC includes a designated router (DR), an access router (AR), a firewall (FW), a load balancing (LB) device, a forwarding device and a server. DR is a router that undertakes the forwarding task in the DC. DR can be a fourth-layer device, that is, a transport layer device. The DR in each DC is connected to the corresponding device in the backbone network, so that the DC is connected to the backbone network. The DCs are interconnected through the backbone network. The backbone network can be, for example, an SRv6 backbone network. AR11, AR21, and AR31 are all devices provided by operator A, AR12, AR22, and AR32 are all devices provided by operator B, and AR13, AR23, and AR33 are all devices provided by operator C. Each AR is connected to the DR in the DC as the network interface of the DC to which it belongs, so as to realize the connection between the terminal and the data center. There may be one or more servers in each DC. For example, server 2 in DC2 may be a single server or a server cluster consisting of multiple servers.

[0041] Below, based on Figure 1 The scenario shown is used to exemplify the process of forwarding messages. The user sends a user message for requesting network resources to AR22 through the terminal, and AR22 forwards the user message to DR2. If Server 2 in DC2 can provide the required network resources for the user, DR2 can forward the user message to Server 2 of DC2, and Server 2 processes the user message to determine the network resources required by the user. Server 2 generates a service message carrying the network resources based on the network resources required by the user, and sends the service message to DR2. DR2 sends the service message to the terminal through AR22, and the terminal receives the service message and obtains the required network resources based on the service message.

[0042] However, since the server 2 in DC2 where the network interface AR22 receiving the user message is located may not be able to provide the user with the required network resources, while the server 1 in DC1 can provide the user with the required network resources, DR2 can forward the user message to DR1 in DC1 through the backbone network, and then DR1 forwards it to server 1, so that server 1 processes the user message. After server 1 generates a service message carrying the network resources required by the user based on the user message, it sends the service message to DR1. DR1 queries the forwarding table and determines the network interface AR12 that belongs to the same operator as the network interface AR22 receiving the user message from among the multiple network interfaces in DC1, and sends the service message to the terminal through AR12, so that the terminal obtains the required network resources based on the service message.

[0043] Based on the above description, it can be known that when user messages need to be forwarded through multiple DRs, or in a multi-data center scenario, the input interface of the user message and the output interface of the service message may be different interfaces, and it cannot be guaranteed that the output interface of the message in the exit area of ​​the Internet and the extranet is consistent with the input interface of the user message, that is, it cannot be guaranteed that the service traffic is sourced in and out. If the source of the service traffic cannot be guaranteed, the number of devices involved in the interaction between the terminal and the network will increase. Once an abnormality occurs in the interaction process between the terminal and the network, it is necessary to check multiple devices from the terminal to multiple interfaces, which is difficult and costly to check. If the source of the service traffic can be guaranteed, the number of devices involved in the interaction between the terminal and the network will be reduced. In the event of an abnormality in the interaction process between the terminal and the network, fewer devices need to be checked, which is less difficult and costly.

[0044] The embodiment of the present application provides a method for forwarding a message, which can ensure that the inbound interface of the message entering the network side and the outbound interface of the message from the network side are the same interface, that is, the source of the message is guaranteed. The method for forwarding a message can be applied to Figure 1 In the scenario shown, the method includes but is not limited to the following S201 to S208.

[0045] S201: A second device receives a second message through a first interface on the second device.

[0046] The second device can be Figure 1 Any DC in the implementation scenario shown, such as DC2 or DC3. Figure 1Taking DC2 in the implementation scenario shown as an example, the method for forwarding a message is described. The second device can receive the second message through any one interface of AR21, AR22 and AR23. The second message can be a user message sent by a user to the interface through a terminal, and the interface of the second device receiving the second message is the first interface. For example, if the interface receiving the second message in DC2 is AR22, AR22 is the first interface.

[0047] S202: The second device adds first identification information to the second message to obtain a first message, where the first identification information is used to identify a first interface of the second device for receiving the second message.

[0048] The embodiment of the present application does not limit the content and format of the first identification information. Exemplarily, the first identification information may include the APN-ID corresponding to the first interface.

[0049] APN-ID can be an overall identifier or a segmented identifier, or the APN-ID can be divided into different fields. For example, see Figure 3 , shows a schematic diagram of the format of a segmented APN-ID. Figure 3 As shown, the APN-ID includes an application group identifier (APP-Group-ID) field, a user group identifier (USER-Group-ID) field, and a reserved field. The content of the application group identifier field is the identifier of the application group to which the application traffic belongs, or the identifier of the application group to which the application that can provide the network resources required by the user belongs. The content of the user group identifier field is the identifier of the group to which the user belongs, or the identifier of the group to which the terminal where the user is located belongs. The reserved field is used to extend the first identification information. For example, if the first identification information needs to be extended, the extended content can be added to the reserved field. In addition Figure 3 The first identification information may also include a flow identification (FLOW ID) field and a service level agreement (SLA) field, etc. Among the multiple fields included in the APN-ID, at least one of the application group identification field and the user group identification field exists, and the remaining fields are all optional fields.

[0050] Optionally, when the first identification information includes an APN-ID, the first identification information may also include other information, and the other information and the APN-ID together constitute the APN information. The APN information may be, for example, APN information based on IPv6, and the APN information based on IPv6 may be referred to as APN6 information. The APN6 information is located in a message header of an IPv6 formatted message, and the APN information may also be an APN header.

[0051] See also Figure 4 , shows a schematic diagram of the structure of APN information. APN information includes multiple fields such as APN-ID-Type field, Flags field, APN-parameters (Para)-Type field, APN-ID field, Intent field, APN-Para field, etc. Figure 4 The second row of numbers in the table represents bits. One number corresponds to one bit, and there are 10 bits between the two numbers in the first row.

[0052] The APN-ID-Type field corresponds to 8 bits from 0 to 7, so the size of the APN-ID-Type field can be 8 bits, and the APN-ID-Type field is used to identify the type of APN-ID. The size of the Flags field can be 8 bits, and the content of the Flags field can include different identifiers for identifying the type of the message. The size of the APN-Para-Type field can be 16 bits, indicating the APN parameters related to the corresponding APN-ID, and the format can be a bit map, that is, the requirements are reflected in the form of bit settings. For example, when the most significant bit bit 0 is set, it indicates that there is a bandwidth requirement; when bit 1 is set, it indicates that there is a delay requirement; when bit 2 is set, it indicates that there is a jitter requirement; when bit 3 is set, it indicates that there is a packet loss rate requirement. The size of the Intent field can be 32 bits, representing the service requirements for the network. The APN-Para: field can include a series of APN parameters, and the type of the APN parameter is specified by the value of the APN-Para-Type field.

[0053] The size of the APN-ID field can be 32 bits, 64 bits, and 128 bits. The length of the APN-ID field can be indicated by the APN-ID-Type field. For example, if the value of the APN-ID-Type field is 1, it means that the length of the APN-ID field is 32 bits, if the value of the APN-ID-Type field is 2, it means that the length of the APN-ID field is 64 bits, and if the value of the APN-ID-Type field is 3, it means that the length of the APN-ID field is 128 bits. In one possible implementation, the Intent field and the APN-Para field in the APN information are both optional fields. In addition, the description of the APN information can also refer to the draft related to the APNheader in the Internet Engineering Task Force (IETF) document, such as the draft-li-apn-header document.

[0054] The APN information is carried in the message, so that after the message enters the network, the network can directly perceive the application and its needs based on the APN information, thereby providing refined network resource allocation, transmission path scheduling and SLA service quality assurance for the application. Therefore, in the embodiment of the present application, the APN information can be used as the first identification information, so that the message is forwarded according to the required path according to the first identification information.

[0055] Optionally, the second device adds the first identification information to the second message, and before obtaining the first message, can also determine the first identification information corresponding to the first interface according to the correspondence between each interface on the second device and the identification information.

[0056] The embodiment of the present application does not limit the method by which the second device obtains the correspondence between each interface on the second device and the identification information. Exemplarily, the second device can obtain the correspondence by receiving the correspondence configuration information sent by the controller, and the controller can be located in the backbone network connected to the second device. Alternatively, the correspondence can be manually configured at the second device to enable the second device to obtain the correspondence. Alternatively, when each interface is connected to the DR in the second device, the DR can determine the identification information corresponding to each interface, that is, determine the correspondence between each interface on the second device and the identification information, and store the correspondence in a storage module in the second device that can be connected to the DR.

[0057] In a possible implementation, the correspondence between each interface on the second device and the identification information may be in the form of a mapping table of the interface name and the identification information of each interface. Figure 5, shows a schematic diagram of a mapping table of interface names and identification information. The mapping table includes the names of the interfaces included in the second device, such as AR21, AR22, and AR23. Each interface corresponds to an identification information, such as the identification information corresponding to AR21 is APN21, the identification information corresponding to AR22 is APN22, and the identification information corresponding to AR23 is APN23. Among them, APN21, APN22, and APN23 are APN-IDs. In addition, the mapping table may also include the mapping relationship between the interface names and identification information in other DCs.

[0058] After determining the first identification information, the second device may add the first identification information to the second message to obtain the first message. Figure 1 , DR2 in DC2 can add the first identification information for identifying AR22 to the second message to obtain the first message carrying the first identification information.

[0059] S203: The second device sends a first message including first identification information to the first device.

[0060] The embodiment of the present application does not limit the method by which the second device sends the first message to the first device. For example, the second device may send the first message to the first device through a tunnel established between the first device and the second device. Figure 1 , DR2 in DC2 can send the first message to DR1 in DC1 through the tunnel established between DR1 and DR2. Since the tunnel established between the first device and the second device can realize a one-hop direct connection between the first device and the second device, the second device sends the third message to the first device through the tunnel, which can make the message transmission efficiency higher.

[0061] Alternatively, the second device may also send the first message to the backbone network, and the backbone network forwards the first message to the first device. Figure 1 DR2 in DC2 can send a first message to the device connected to DR2 in the backbone network. The first message is forwarded layer by layer by multiple devices in the backbone network, reaches the device connected to DR1 in DC1, and is sent to DR1, thereby realizing the sending of the first message from the second device to the first device.

[0062] S204, the first device receives a first message sent by the second device, the first message is generated by the second device based on the received second message, the first message includes first identification information, and the first identification information is used to identify a first interface of the second device for receiving the second message.

[0063] Exemplarily, after the second device sends the first message to the first device, the first device can receive the first message sent by the second device through the tunnel established between the first device and the second device, or the first device can also receive the first message sent by the second device to the backbone network through a device in the backbone network connected to the first device.

[0064] S205: The first device generates a third message including second identification information based on the first message, where the second identification information is used to identify a second interface of the second device for forwarding the third message, and the first interface is the same as the second interface.

[0065] In a possible implementation, after receiving the first message, the first device may obtain the second session information corresponding to the first message, where the second session information is the session information that does not include the first identification information; and add the first identification information in the first message to the second session information to obtain the first session information. Among them, the second session information corresponding to the first message may be the session information generated by the FW or LB based on the first message. The second session information may include a quintuple, where the source address of the first message included in the quintuple is the address of the terminal, and the destination address included in the quintuple is the address of a server deployed with an application that can provide the user with the required network resources. The embodiment of the present application may add the first identification information to the quintuple in the second session information so that the session information can store the first identification information, and determine the session information to which the first identification information is added as the first session information.

[0066] For example, see Figure 1 , taking the first session information corresponding to the first message generated by LB as an example, the process of the first device obtaining the first session information is illustrated. After receiving the first message sent by DR2 in DC2, DR1 in DC1 can send the first message to FW1. FW1 sends the first message to LB1 through the internal forwarding device 1. Based on the first message, LB1 determines the network resources required by the user, and determines Server 1 that can provide the required network resources to the user from one or more servers in DC1. Afterwards, LB1 can create the second session information corresponding to the first message. The source address of the first message included in the quintuple in the second session information is the address of the terminal, and the destination address is the address of Server 1. LB1 adds the first identification information to the generated second session information to implement the storage of the first identification information by the session information, and obtains the first session information used to store the first identification information. In one possible implementation, see Figure 6 In the implementation scenario shown, the DC does not include a FW, so the DR can interact directly with the internal forwarding device.

[0067] The first device adds the first identification information to the second session information, that is, the first device obtains the first session information corresponding to the first message. After the first device obtains the first session information, it can also generate a fifth message based on the first message; based on the first identification information stored in the first session information, the first identification information is added to the fifth message to obtain a fourth message.

[0068] Based on the above example, LB1 determines that the server that can provide the required network resources for the user is server 1, then LB1 can send the first message to server 1 through internal forwarding device 1, server 1 processes the first message, and generates a fifth message carrying the network resources required by the user, and the fifth message is the return message corresponding to the first message. Server 1 sends the fifth message to LB1 through internal forwarding device 1. After receiving the fifth message, LB1 queries the locally stored session information and determines that the fifth message is a message that matches the first message, and thus determines that the first session information corresponds to the fifth message. LB1 extracts the first identification information in the first session information, and adds the first identification information to the fifth message to obtain a fourth message including the first identification information.

[0069] By adding the first identification information to the session information of the LB, the problem of the return traffic being unable to restore the first identification information in the inbound traffic due to the DR not supporting the storage or reading of the first identification information is avoided, thereby ensuring that the return traffic can achieve traffic traceability based on the first identification information, thereby ensuring the source of the traffic and determining the forwarding path of the message, wherein the forwarding path of the message can be a border gateway protocol (BGP) route.

[0070] In one possible implementation, after determining the fourth message, the first device can determine the second identification information based on the routing information and the first identification information in the fourth message, and the fourth message is generated based on the first message; update the fourth message based on the second identification information to obtain the third message.

[0071] In an embodiment of the present application, the process in which the first device determines the second identification information and generates the third message based on the routing information and the first identifier in the fourth message can be divided into different situations according to different routing information. Situation A1 and situation A2 are used as examples for explanation below.

[0072] In case A1, a first tunnel is established between the first device and the second device, and the first tunnel is an SRv6 tunnel; the routing information includes the correspondence between the first identification information and the address of the second device, and the correspondence between the first identification information and the address of the first interface; the second identification information includes the address of the second device and the address of the second interface. The routing information may be a forwarding table entry forwarded based on the first identification information, and the routing information may be sent by the control device to the first device, or may be manually configured statically or dynamically on the first device.

[0073] For example, see Figure 1 , the first device determines that the return message needs to be forwarded from DR1 to DR2 according to the routing information and the first identification information, and sends it to the terminal through AR22 connected to DR2. Therefore, the first device can determine that the second identification information can include the address of the second device DC2 where the second interface is located, and the address of the second interface AR22. Since the device that undertakes the forwarding task in DC2 is DR2, the address of the second device DC2 can be the address of DR2.

[0074] In the case where the first tunnel is an SRv6 tunnel, the message transmitted in the first tunnel can be a message in the SRv6 format, that is, the third message can be a message in the SRv6 format. Therefore, the second identification information can be a segment identifier (SID) list, and the address of the next hop (HP) of DR1 included in the SID list is the address of the second device, and end.x.SID is the address of AR22. The first device can add the second identification information to the message header of the fourth message to obtain a third message carrying the second identification information.

[0075] In addition, the second identification information may also include identification information corresponding to the second interface, so that after receiving the third message, the second device can determine that the interface that needs to forward the message is the second interface based on the identification information corresponding to the second interface and the correspondence between the various interfaces of the second device configured in the second device and the identification information, so as to further ensure that the second device forwards the third message through the second interface.

[0076] In case A2, a second tunnel is established between the first device and the second device, and the second tunnel is a GRE tunnel; the routing information includes the correspondence between the first identification information and the address of the second device, and the correspondence between the address of the second device and the identification information of the second interface; the second identification information includes the identification information of the second interface and the address of the second device. The type of the routing information may be policy-based routing (PBR).

[0077] For example, see Figure 1, the first device determines that the return message needs to be forwarded from DR1 to DR2 based on the routing information and the first identification information, and sends it to the terminal through AR22 connected to DR2. Therefore, the first device can determine that the second identification information includes the address of the next hop of DR1 as the address of the second device DC2 where the second interface is located, and the identification information of the second interface AR22. Since the device that undertakes the forwarding task in DC2 is DR2, the address of the second device DC2 can be the address of DR2. The first device adds the determined second identification information to the fourth message to obtain a third message carrying the second identification information.

[0078] S206: The first device sends a third message to the second device.

[0079] The embodiment of the present application does not limit the method by which the first device sends the third message to the second device. For example, the first device may send the third message to the second device through a tunnel established between the first device and the second device. Figure 1 , DR1 in DC1 can send the third message to DR2 in DC2 through the tunnel established between DR1 and DR2. Since the tunnel established between the first device and the second device can realize a one-hop direct connection between the first device and the second device, the first device sends the third message to the second device through the tunnel, which can make the message transmission efficiency higher.

[0080] Alternatively, the first device may also send a third message to the backbone network, and the backbone network forwards the third message to the second device. Figure 1 DR1 in DC1 can send a third message to the device connected to DR1 in the backbone network. The third message is forwarded layer by layer by multiple devices in the backbone network, reaches the device connected to DR2 in DC2, and is sent to DR2, thereby realizing the sending of the third message from the first device to the second device.

[0081] S207, the second device receives a third message sent by the first device based on the first message, the third message includes second identification information, the second identification information is used to identify a second interface of the second device forwarding the third message, and the first interface is the same as the second interface.

[0082] In one possible implementation, after the first device sends the third message to the second device, the second device may receive the third message sent by the first device through a tunnel established between the first device and the second device, or the second device may also receive the third message sent by the first device to the backbone network through a device in the backbone network connected to the second device.

[0083] S208: The second device forwards the third message through the second interface according to the second identification information.

[0084] Corresponding to S205, in the embodiment of the present application, according to the different tunnels established between the first device and the second device, or the different second identification information, the process of the second device forwarding the third message through the second interface according to the second identification information is divided into different situations. The following uses situation B1 and situation B2 corresponding to situation A1 and situation A2 respectively as examples to illustrate the process.

[0085] In case B1, a first tunnel is established between the first device and the second device, and the first tunnel is an SRv6 tunnel; the second identification information includes the address of the second device and the address of the second interface. In this case, the third message received by the second device is a message in SRv6 format, and the second identification information is located in the message header of the third message. The second identification information may include the SID list corresponding to the second interface encapsulated by the first device for the third message. For example, the second interface is Figure 1 If it is AR22 in DC2, the second identification information may include the address of the second device DC2 where the second interface is located, and the address of the second interface AR22. Since the device responsible for the forwarding task in DC2 is DR2, the address of the second device DC2 may be the address of DR2.

[0086] Exemplarily, after receiving the third message including the second identification information, the second device determines that the second device needs to process the message forwarding task based on the fact that the address of the second device in the second identification information is the same as its own address. The second device sends the third message to the second interface according to the address of the second interface in the second identification information, and forwards the third message to the terminal through the second interface.

[0087] In addition, the second identification information may also include identification information corresponding to the second interface, so that the second device can determine that the interface that needs to forward the message is the second interface based on the identification information corresponding to the second interface and the correspondence between the various interfaces of the second device configured in the second device and the identification information, so as to further ensure that the second device forwards the third message through the second interface.

[0088] In case B2, a second tunnel is established between the first device and the second device, and the second tunnel is a GRE tunnel; the second identification information includes the identification information of the second interface and the address of the second device. In this case, after receiving the third message including the second identification information, the second device determines that the forwarding task of the third message needs to be processed by the second device according to the address of the second device in the second identification information, and determines that the interface that needs to forward the third message is the second interface according to the identification information of the second interface in the second identification information and the correspondence between each interface of the second device configured in the second device and the identification information. The second device sends the third message to the second interface to forward the third message to the terminal through the second interface.

[0089] In the process of multi-hop forwarding of messages in the related technology, the forwarding device determines the next hop of the message based on the local session table of the forwarding device. Since the forwarding device that forwards the message to the terminal after the traffic lands may be different from the forwarding device that receives the message sent by the terminal, the outbound interface of the message determined according to the session table in the related technology may be different from the inbound interface of the message, that is, the related technology is difficult to ensure the source of the service traffic. If the interaction between the terminal and the network device is abnormal, it is difficult to troubleshoot the problem and the troubleshooting cost is high.

[0090] The method for forwarding messages provided in the embodiment of the present application adds identification information to the messages sent by the terminal to the network device and the messages sent by the network device to the terminal to indicate the forwarding path of the message, ensures that the outgoing interface and the incoming interface of the message are the same interface, and fixes the interactive interface between the terminal and the network device to ensure the source in and out of the service traffic. If the interaction between the terminal and the network device is abnormal, fewer devices can be troubleshooted, the troubleshooting difficulty is relatively small, and the troubleshooting cost is relatively low. In addition, the forwarding device in the embodiment of the present application can complete the multi-hop stateless forwarding of the message when forwarding in the message, that is, the forwarding of the message can be completed without relying on session information.

[0091] For example, see Figure 7 , showing a schematic diagram of the result of forwarding a message. Figure 7 Based on Figure 1 , after the backend server generates a service message carrying network resources, the service message is forwarded to DR1 via the internal forwarding device of DC1. In the related art, the service message is forwarded from DR1 to the interface connected to the operator in DC1, that is, the service message is forwarded along path 1. In the embodiment of the present application, the service message is forwarded from DR1 to DR2 in DC2, and then sent by DR2 to the interface for receiving user messages, that is, the service message is forwarded along path 2 to realize the source-in and source-out of the message.

[0092] The above describes the method for forwarding a message provided by the embodiment of the present application. Corresponding to the above method, the embodiment of the present application also provides a device for forwarding a message. The device is applied to a first device. The device is used to Figure 8 The modules shown above perform the Figure 2 The method for forwarding a message executed by the first device in the embodiment. Figure 8 As shown, the device for forwarding messages provided in the embodiment of the present application includes the following modules.

[0093] A receiving module 801 is used to receive a first message sent by a second device, where the first message is generated by the second device based on a received second message, and the first message includes first identification information, where the first identification information is used to identify a first interface of the second device for receiving the second message; a generating module 802 is used to generate a third message including second identification information based on the first message, where the second identification information is used to identify a second interface of the second device for forwarding the third message, and the first interface is the same as the second interface; and a sending module 803 is used to send a third message to the second device.

[0094] In a possible implementation, the generation module 802 is used to determine the second identification information according to the routing information and the first identification information in the fourth message, and the fourth message is generated based on the first message; and update the fourth message based on the second identification information to obtain the third message.

[0095] In a possible implementation, the generation module 802 is also used to obtain first session information corresponding to the first message, where the first session information is used to store first identification information; generate a fifth message based on the first message; and add the first identification information to the fifth message based on the first identification information stored in the first session information to obtain a fourth message.

[0096] In a possible implementation, the generating module 802 is configured to obtain second session information corresponding to the first message, where the second session information does not include the first identification information; and add the first identification information in the first message to the second session information to obtain the first session information.

[0097] In a possible implementation, a first tunnel is established between the first device and the second device, and the first tunnel is an SRv6 tunnel; the routing information includes a correspondence between the first identification information and the address of the second device, and a correspondence between the first identification information and the address of the first interface; the second identification information includes the address of the second device and the address of the second interface.

[0098] In one possible implementation, a second tunnel is established between the first device and the second device, and the second tunnel is a GRE tunnel; the routing information includes the correspondence between the first identification information and the address of the second device, and the correspondence between the address of the second device and the identification information of the second interface; the second identification information includes the identification information of the second interface and the address of the second device.

[0099] In a possible implementation manner, the first identification information includes an APN-ID corresponding to the first interface.

[0100] The embodiment of the present application also provides a device for forwarding a message. The device is applied to a second device. The device is used to Fig. 9 The modules shown above perform the Figure 2The method for forwarding a message executed by the second device in Fig. 9 As shown, the device for forwarding messages provided in the embodiment of the present application includes the following modules.

[0101] A receiving module 901 is used to receive a second message through a first interface on a second device; a generating module 902 is used to add first identification information to the second message to obtain a first message, wherein the first identification information is used to identify a first interface on the second device for receiving the second message; a sending module 903 is used to send a first message including the first identification information to the first device; the receiving module 901 is also used to receive a third message sent by the first device based on the first message, wherein the third message includes second identification information, wherein the second identification information is used to identify a second interface on the second device for forwarding the third message, wherein the first interface is the same as the second interface; and the sending module 903 is also used to forward the third message through the second interface according to the second identification information.

[0102] In a possible implementation, the apparatus further includes a determination module, which is configured to determine first identification information corresponding to the first interface according to a correspondence between each interface on the second device and the identification information.

[0103] In a possible implementation, a first tunnel is established between the first device and the second device, and the first tunnel is an SRv6 tunnel; the second identification information includes an address of the second device and an address of the second interface.

[0104] In a possible implementation manner, a second tunnel is established between the first device and the second device, and the second tunnel is a GRE tunnel; and the second identification information includes identification information of the second interface.

[0105] In a possible implementation manner, the first identification information includes an APN-ID corresponding to the first interface.

[0106] It should be understood that the above Figure 8 and Fig. 9 The device provided has the following beneficial effects when achieving its function: Figure 2 The method for forwarding a message provided has the same beneficial effects, which will not be described in detail here. Figure 8 and Fig. 9 When the device provided realizes its functions, only the division of the above-mentioned functional modules is used as an example for illustration. In practical applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0107] See also Fig.10 , Fig.10 A schematic structural diagram of an exemplary message forwarding device 1000 of the present application is shown. The message forwarding device 1000 includes at least one processor 1001, a memory 1003, and at least one network interface 1004.

[0108] Processor 1001 is, for example, a general-purpose central processing unit (CPU), a digital signal processor (DSP), a network processor (NP), a graphics processing unit (GPU), a neural-network processing units (NPU), a data processing unit (DPU), a microprocessor or one or more integrated circuits or application-specific integrated circuits (ASICs) for implementing the solution of the present application, a programmable logic device (PLD), other general-purpose processors or other programmable logic devices, discrete gates, transistor logic devices, discrete hardware components or any combination thereof. PLD is, for example, a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof. A general-purpose processor may be a microprocessor or any conventional processor, etc. It is worth noting that the processor may be a processor supporting an advanced RISC machines (ARM) architecture. It can implement or execute various logic blocks, modules and circuits described in conjunction with the disclosure of this application. The processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.

[0109] Optionally, the message forwarding device 1000 further includes a bus 1002. The bus 1002 is used to transmit information between components of the message forwarding device 1000. The bus 1002 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus 1002 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.10 The fact that only one line is used in the diagram does not mean that there is only one bus or only one type of bus.

[0110] The memory 1003 is, for example, a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memories. Among them, the nonvolatile memory may be a read-only memory (ROM), a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache.

[0111] By way of example but not limitation, many forms of ROM and RAM are available. For example, ROM is a compact disc read-only memory (CD-ROM). RAM includes, but is not limited to, static RAM (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct rambus RAM (DR RAM).

[0112] The memory 1003 may also be other types of storage devices that can store static information and instructions. Or it may be other types of dynamic storage devices that can store information and instructions. Or it may be other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, blue-ray disk, etc.), magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by the computer, but is not limited to this. The memory 1003, for example, exists independently and is connected to the processor 1001 through the bus 1002. The memory 1003 may also be integrated with the processor 1001.

[0113] The network interface 1004 uses any transceiver-like device to communicate with other devices or communication networks, and the communication network can be Ethernet, radio access network (RAN) or wireless local area network (WLAN), etc. The network interface 1004 may include a wired network interface and may also include a wireless network interface. Specifically, the network interface 1004 may be an Ethernet interface, such as a fast Ethernet (FE) interface, a gigabit Ethernet (GE) interface, an asynchronous transfer mode (ATM) interface, a WLAN interface, a cellular network interface or a combination thereof. The Ethernet interface may be an optical interface, an electrical interface or a combination thereof. In some embodiments of the present application, the network interface 1004 may be used for the device 1000 that forwards messages to communicate with other devices.

[0114] In a specific implementation, as some embodiments, the processor 1001 may include one or more CPUs, such as Fig.10 0 and CPU1 shown in FIG. Each of these processors may be a single-core processor or a multi-core processor. A processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).

[0115] In a specific implementation, as some implementation methods, the device 1000 for forwarding a message may include multiple processors, such as Fig.10 1 and 1005. Each of these processors may be a single-core processor or a multi-core processor. A processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (such as computer program instructions).

[0116] In some implementations, the memory 1003 is used to store program instructions 1010 for executing the solution of the present application, and the processor 1001 can execute the program instructions 1010 stored in the memory 1003. That is, the device 1000 for forwarding messages can implement the method provided in the method embodiment through the processor 1001 and the program instructions 1010 in the memory 1003, that is, Figure 2 The method shown. The program instruction 1010 may include one or more software modules. Optionally, the processor 1001 itself may also store program instructions for executing the solution of the present application.

[0117] In a specific implementation process, the device 1000 of the present application for forwarding a message may correspond to a first device or a second device for executing the above method, and the processor 1001 in the device 1000 for forwarding a message reads the instruction in the memory 1003, so that Fig.10 The first device or the second device 1000 shown can execute all or part of the steps in the method embodiment.

[0118] The device 1000 for forwarding a message may also correspond to the above Figure 8 and Fig. 9 The device shown, Figure 8 and Fig. 9 Each functional module in the device shown is implemented using software of the device 1000 for forwarding messages. In other words, Figure 8 and Fig. 9 The functional modules included in the apparatus shown are generated after the processor 1001 of the device 1000 for forwarding messages reads the program instructions 1010 stored in the memory 1003 .

[0119] in, Figure 2 Each step of the method shown is completed by an integrated logic circuit of hardware or software instructions in the processor of the device 1000 that forwards the message. The steps of the method embodiment disclosed in the present application can be directly embodied as being executed by a hardware processor, or can be executed by a combination of hardware and software modules in the processor. The software module can be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory, and completes the steps of the above method embodiment in combination with its hardware. To avoid repetition, it is not described in detail here.

[0120] See also Fig.11 , Fig.11 The schematic diagram of the structure of an exemplary device 1100 for forwarding messages of the present application is shown. The device 1100 for forwarding messages includes: a main control board 1110 and an interface board 1130 . Fig.11 The device 1100 shown in the figure for forwarding messages is used to perform the above Figure 2 The operations involved in the method for forwarding a message are shown. The device 1100 for forwarding a message is, for example, a switch, a router, a controller, etc. The device 1100 for forwarding a message may be an example of the device 1000 for forwarding a message.

[0121] The main control board 1110 is also called a main processing unit (MPU) or a route processor card. The main control board 1110 is used to control and manage various components in the device 1100 for forwarding messages, including route calculation, device management, device maintenance, and protocol processing functions. The main control board 1110 includes: a central processing unit 1111 and a memory 1112.

[0122] The interface board 1130 is also called a line processing unit (LPU), a line card or a service board. The interface board 1130 is used to provide various service interfaces and implement data packet forwarding. Service interfaces include but are not limited to Ethernet interfaces, POS (Packet over SONET / SDH) interfaces, etc., and Ethernet interfaces are, for example, flexible Ethernet clients (FlexE Clients). The interface board 1130 includes: a central processing unit 1131, a network processor 1132, a forwarding table entry memory 1134 and a physical interface card (PIC) 1133.

[0123] The central processing unit 1131 on the interface board 1130 is used to control and manage the interface board 1130 and communicate with the central processing unit 1111 on the main control board 1110 .

[0124] The network processor 1132 is used to implement the forwarding processing of the message. The network processor 1132 can be in the form of a forwarding chip. Specifically, the network processor 1132 is used to forward the received message based on the forwarding table stored in the forwarding table entry memory 1134. If the destination address of the message is the address of the device 1100 that forwards the message, the message is sent to the CPU (such as the central processor 1111) for processing; if the destination address of the message is not the address of the device 1100 that forwards the message, the next hop and the output interface corresponding to the destination address are found in the forwarding table according to the destination address, and the message is forwarded to the output interface corresponding to the destination address. Among them, the processing of the uplink message includes: processing of the message input interface, forwarding table search; processing of the downlink message: forwarding table search, etc.

[0125] The physical interface card 1133 is used to implement the connection function of the physical layer, and the original traffic enters the interface board 1130 from it, and the processed message is sent from the physical interface card 1133. The physical interface card 1133 is also called a daughter card, which can be installed on the interface board 1130 and is responsible for converting the optical signal into a message and forwarding the message to the network processor 1132 for processing after checking the legitimacy of the message. In some embodiments, the central processor can also perform the functions of the network processor 1132, such as implementing software forwarding based on a general-purpose CPU, so that the network processor 1132 is not required in the physical interface card 1133.

[0126] Optionally, the device 1100 for forwarding messages includes multiple interface boards. For example, the device 1100 for forwarding messages also includes an interface board 1140 . The interface board 1140 includes a central processor 1141 , a network processor 1142 , a forwarding table entry memory 1144 and a physical interface card 1143 .

[0127] Optionally, the device 1100 for forwarding messages further includes a switching fabric board 1120. The switching fabric board 1120 may also be referred to as a switch fabric unit (SFU). When the device for forwarding messages has multiple interface boards 1130, the switching fabric board 1120 is used to complete data exchange between the interface boards. For example, the interface board 1130 and the interface board 1140 may communicate through the switching fabric board 1120.

[0128] The main control board 1110 is coupled to the interface board 1130. For example, the main control board 1110, the interface board 1130, the interface board 1140, and the switching network board 1120 are connected to the system backplane through a system bus to achieve intercommunication. In a possible implementation, an inter-process communication (IPC) channel is established between the main control board 1110 and the interface board 1130, and the main control board 1110 and the interface board 1130 communicate through the IPC channel.

[0129] Logically, the device 1100 for forwarding messages includes a control plane and a forwarding plane. The control plane includes a main control board 1110 and a central processor 1131. The forwarding plane includes various components for performing forwarding, such as a forwarding table entry memory 1134, a physical interface card 1133, and a network processor 1132. The control plane performs functions such as a router, generating a forwarding table, processing signaling and protocol messages, and configuring and maintaining the status of the device. The control plane sends the generated forwarding table to the forwarding plane. On the forwarding plane, the network processor 1132 forwards the message received by the physical interface card 1133 based on the forwarding table sent by the control plane. The forwarding table sent by the control plane can be stored in the forwarding table entry memory 1134. In some embodiments, the control plane and the forwarding plane can be completely separated and not on the same device.

[0130] It is worth noting that there may be one or more main control boards, and when there are multiple boards, they may include a primary main control board and a backup main control board. There may be one or more interface boards. The stronger the data processing capability of the device forwarding the message, the more interface boards are provided. There may also be one or more physical interface cards on the interface board. There may be no switching network board, or there may be one or more switching network boards. When there are multiple switching network boards, they can jointly realize load sharing and redundant backup. In a centralized forwarding architecture, the device forwarding the message may not need a switching network board, and the interface board is responsible for the processing function of the service data of the entire system. In a distributed forwarding architecture, the device forwarding the message may have at least one switching network board, and the switching network board is used to realize data exchange between multiple interface boards, providing large-capacity data exchange and processing capabilities. Therefore, the data access and processing capabilities of the device forwarding the message in a distributed architecture are greater than those of the device in a centralized architecture. Optionally, the device that forwards the message may also be in the form of only one board, that is, without a switching network board, and the functions of the interface board and the main control board are integrated on the board. In this case, the central processor on the interface board and the central processor on the main control board can be combined into one central processor on the board to perform the functions of the two superimposed. The data exchange and processing capabilities of this type of device are relatively low (for example, low-end switches or routers and other communication devices). The specific architecture to be adopted depends on the specific networking deployment scenario, and no limitation is made here.

[0131] In an exemplary embodiment, a system for forwarding a message is provided, the system comprising a first device and a second device, the first device being configured to execute Figure 2 The method executed by the first device in the second device is used to execute Figure 2 A method performed by a second device in.

[0132] In an exemplary embodiment, a computer program (product) is provided, the computer program (product) comprising: a computer program code, when the computer program code is executed by a computer, the computer executes Figure 2 The method shown.

[0133] In an exemplary embodiment, a computer-readable storage medium is provided, the computer-readable storage medium storing a program or instruction, when the program or instruction is executed on a computer, the computer executes the above Figure 2 The method shown.

[0134] In an exemplary embodiment, a chip is provided, including a processor for calling and executing instructions stored in a memory, so that a computer equipped with the chip executes Figure 2 The method shown.

[0135] In an exemplary embodiment, another chip is provided, including: an input interface, an output interface, a processor and a memory, wherein the input interface, the output interface, the processor and the memory are connected through an internal connection path, and the processor is used to execute the code in the memory. When the code is executed, the computer equipped with the chip executes Figure 2 The method shown.

[0136] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in this application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integration. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk), etc.

[0137] In this application, the terms "first", "second", etc. are used to distinguish between identical or similar items with substantially the same effects and functions. It should be understood that there is no logical or temporal dependency between "first", "second", and "nth", nor is there a limitation on the quantity and execution order. It should also be understood that although the following description uses the terms first, second, etc. to describe various elements, these elements should not be limited by the terms. These terms are only used to distinguish one element from another element.

[0138] It should also be understood that in the various embodiments of the present application, the size of the serial number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0139] The term "at least one" in this application means one or more, and the term "multiple" in this application means two or more, for example, multiple second devices means two or more second devices. The terms "system" and "network" are often used interchangeably herein.

[0140] It should be understood that the terms used in the description of the various examples herein are only for describing specific examples and are not intended to be limiting. As used in the description of the various examples and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.

[0141] It should also be understood that the term "and / or" used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items. The term "and / or" is a description of the association relationship of associated objects, indicating that three relationships may exist. 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 application generally indicates that the associated objects before and after are in an "or" relationship.

[0142] It should also be understood that the terms "if" and "if" may be interpreted to mean "when" or "upon" or "in response to determining" or "in response to detecting." Similarly, the phrases "if it is determined that ..." or "if [a stated condition or event] is detected" may be interpreted to mean "upon determining that ..." or "in response to determining that ..." or "upon detecting [a stated condition or event]" or "in response to detecting [a stated condition or event]," depending on the context.

[0143] The above description is only an embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present application shall be included in the protection scope of the present application.

Claims

1. A method for forwarding a message, characterized in that: The method is applied to a first device, and the method includes: receiving a first message sent by a second device, where the first message is generated by the second device based on a received second message, and the first message includes first identification information, where the first identification information is used to identify a first interface of the second device for receiving the second message; Based on the first message, generate a third message including second identification information, where the second identification information is used to identify a second interface of the second device forwarding the third message, and the first interface is the same as the second interface; Send the third message to the second device.

2. The method according to claim 1, characterized in that: The generating, based on the first message, a third message including the second identification information comprises: Determine the second identification information according to the routing information and the first identification information in the fourth message, wherein the fourth message is generated based on the first message; The fourth message is updated based on the second identification information to obtain the third message.

3. The method according to claim 2, characterized in that Before determining the second identification information according to the routing information and the first identification information in the fourth message, the method further includes: Acquire first session information corresponding to the first message, where the first session information is used to store the first identification information; generating a fifth message based on the first message; Based on the first identification information stored in the first session information, the first identification information is added to the fifth message to obtain the fourth message.

4. The method according to claim 3, characterized in that The acquiring the first session information corresponding to the first message includes: Acquire second session information corresponding to the first message, where the second session information is session information that does not include the first identification information; The first identification information in the first message is added to the second session information to obtain the first session information.

5. The method according to any one of claims 2 to 4, characterized in that: A first tunnel is established between the first device and the second device, where the first tunnel is a segment routing SRv6 tunnel based on an Internet Protocol version 6 forwarding plane; The routing information includes a correspondence between the first identification information and an address of the second device, and a correspondence between the first identification information and an address of the first interface; The second identification information includes an address of the second device and an address of the second interface.

6. The method according to any one of claims 2 to 4, characterized in that: A second tunnel is established between the first device and the second device, where the second tunnel is a Generic Routing Encapsulation (GRE) tunnel; The routing information includes a correspondence between the first identification information and the address of the second device, and a correspondence between the address of the second device and the identification information of the second interface; The second identification information includes identification information of the second interface and an address of the second device.

7. The method according to any one of claims 1 to 6, characterized in that: The first identification information includes an application-aware network identifier APN-ID corresponding to the first interface.

8. A method for forwarding a message, characterized in that: The method is applied to a second device, and the method includes: receiving a second message through the first interface on the second device; Adding first identification information to the second message to obtain a first message, where the first identification information is used to identify the first interface of the second device to receive the second message; Sending the first message including the first identification information to the first device; receiving a third message sent by the first device based on the first message, where the third message includes second identification information, where the second identification information is used to identify a second interface of the second device that forwards the third message, and the first interface is the same as the second interface; According to the second identification information, the third message is forwarded through the second interface.

9. The method according to claim 8, characterized in that Before adding the first identification information to the second message to obtain the first message, the method further includes: The first identification information corresponding to the first interface is determined according to the correspondence between each interface on the second device and the identification information.

10. The method according to claim 8 or 9, characterized in that: A first tunnel is established between the first device and the second device, where the first tunnel is a segment routing SRv6 tunnel based on an Internet Protocol version 6 forwarding plane; The second identification information includes an address of the second device and an address of the second interface.

11. The method according to claim 8 or 9, characterized in that: A second tunnel is established between the first device and the second device, where the second tunnel is a Generic Routing Encapsulation (GRE) tunnel; The second identification information includes identification information of the second interface.

12. The method according to any one of claims 8 to 11, characterized in that: The first identification information includes an application-aware network identifier APN-ID corresponding to the first interface.

13. A device for forwarding a message, characterized in that: The device is applied to a first device, and includes: A transceiver module, configured to perform the reception and / or transmission related operations performed by the first device in the method according to any one of claims 1 to 7; A processing module, used to perform other operations other than the reception and / or transmission related operations performed by the first device in any one of the methods described in claims 1-7.

14. A device for forwarding a message, characterized in that: The device is applied to a second device, and includes: A transceiver module, used to perform the reception and / or transmission related operations performed by the second device in any one of the methods of claims 8 to 12; A processing module, used to perform other operations other than the receiving and / or sending related operations performed by the second device in the method described in any one of claims 8-12.

15. A communication device, characterized in that: The device includes a processor, which is coupled to a memory; the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor, so that the communication device implements the method for forwarding a message described in any one of claims 1-12.

16. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one instruction, and the instruction is loaded and executed by the processor to implement the method for forwarding a message as described in any one of claims 1-12.

17. A computer program product, characterized in that The computer program product includes a computer program or instructions, and the computer program or instructions are executed by a processor to enable a computer to implement the method for forwarding a message as described in any one of claims 1 to 12.