Message transmission method, device and system

By encapsulating device identification in MPLS messages and transmitting through tag switching paths, the accuracy of network traffic statistics based on MPLS technology is solved, and traffic statistics in EVPN over MPLS and MPLS L3VPN scenarios are realized.

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

Patent Information

Application Number
CN202310638085.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-31
Publication Date
2024-12-03

AI Technical Summary

Technical Problem

In network scenarios based on MPLS technology for forwarding, it is difficult to achieve accurate statistics of network traffic, especially in EVPN over MPLS and MPLS L3VPN scenarios.

Method used

By encapsulating the device identification between the MPLS header of the message and sending messages to other devices through the tag exchange path, the receiving device can parse the device identification and determine the source of the message, thereby achieving accurate traffic statistics.

Benefits of technology

In the EVPN over MPLS and MPLS L3VPN scenarios, accurate statistics of network traffic is realized and the traffic management capabilities of network equipment are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119071196A_ABST
    Figure CN119071196A_ABST
Patent Text Reader

Abstract

The invention discloses a message transmission method, device and system, and belongs to the technical field of networks. The first device generates a message, the message comprises an MPLS header, a device identifier of the first device and a message payload, and the device identifier is encapsulated between the MPLS header and the message payload. And the first equipment sends the message to the second equipment through the LSP established between the first equipment and the second equipment. Since the message received by the second device carries the device identifier of the first device, the second device can analyze the message to obtain the device identifier of the first device, and determines that the message is sent by the first device according to the device identifier. And thus, accurate statistics of the network traffic in the incoming direction is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] Traffic statistics is a basic function of communication networks. By counting network traffic, the quality and health of network operation can be analyzed. Traffic statistics can also be used to locate network faults in a hierarchical manner to narrow the scope of the fault. However, in some network scenarios based on multiprotocol label switching (MPLS) technology for forwarding, such as Ethernet virtual private network (EVPN) based on MPLS (abbreviated as: EVPN over MPLS) scenarios and layer 3 virtual private network (L3VPN) based on MPLS (abbreviated as: MPLS L3VPN) scenarios, it is difficult to achieve accurate statistics of network traffic on network devices. Summary of the invention

[0003] The present application provides a message transmission method, device and system.

[0004] In a first aspect, a message transmission method is provided. The method includes: a first device generates a message, the message includes an MPLS header, a device identifier of the first device, and a message payload, and the device identifier is encapsulated between the MPLS header and the message payload. The first device sends a message to a second device through a label switched path (LSP) established between the first device and the second device.

[0005] In the present application, when the first device generates a message, it encapsulates the device identifier of the first device between the MPLS header and the message payload of the message, and then sends the generated message to the second device through the LSP established between the first device and the second device. Since the message received by the second device carries the device identifier of the first device, the second device can parse the message to obtain the device identifier of the first device, and determine that the message is sent by the first device based on the device identifier. In other words, the second device, as the egress device of the message on the label switching path, can accurately identify the ingress device of the message on the label switching path as the first device. The present application can achieve accurate statistics of network traffic in a network scenario based on MPLS technology for forwarding. For example, in an EVPN over MPLS scenario or an MPLS L3VPN scenario, the egress device on the label switching path can accurately count network traffic in the ingress direction.

[0006] In a specific implementation, the device identifier of the first device is a router identifier of the first device.

[0007] In a specific implementation, the message includes a control word, and the control word is used to carry the device identifier. This implementation does not need to change the format of the original MPLS message, and only requires configuring the second device with the ability to parse the control word and identify the device identifier, and configuring the first device with the ability to set the control word as the device identifier.

[0008] In a specific implementation, the message includes a control word, and the device identifier is adjacent to the control word. This implementation does not need to change the original control word and does not affect the function of the original control word.

[0009] In a specific implementation, the bottom label of the MPLS header is used to indicate that the device identifier is adjacent to the bottom label. In a specific implementation, the bottom label can independently indicate that the device identifier is adjacent to the bottom label. Alternatively, the bottom label and other labels in the label stack jointly indicate that the device identifier is adjacent to the bottom label. For example, if the bottom label is a designated extended special-purpose label, the extended special-purpose label and the preceding extended label jointly indicate that the device identifier is adjacent to the bottom label.

[0010] In a specific implementation, the first device receives capability negotiation information sent by the second device, where the capability negotiation information is used to negotiate between the first device and the second device a capability of carrying a device identifier of the first device in a message.

[0011] In the present application, the first device and the second device can carry the device identifier of the first device in the message sent from the first device to the second device through capability negotiation. Alternatively, the capability of the first device to carry the device identifier of the first device in the generated message and the capability of the second device to parse the device identifier in the received message can also be manually configured.

[0012] In one implementation, the capability negotiation information is used to negotiate between a first device and a second device the capability of carrying a device identifier of the first device in a control word of a message.

[0013] In a specific implementation, the control word is a 4-byte control word. The 4-byte control word is used to carry the device identification of the first device. The main idea of ​​this implementation scheme is that the first device and the second device negotiate the control word capability, and carry the device identification of the first device in the control word, so that after the message reaches the second device, the second device can determine that the message comes from the first device by using the control word information.

[0014] In a specific implementation, the control word is an 8-byte long control word, 4 bytes of the long control word are used to carry the original control word, and the other 4 bytes of the long control word are used to carry the device identification of the first device. In a specific implementation, the upper 4 bytes of the long control word are used to carry the original control word, and the lower 4 bytes of the long control word are used to carry the device identification of the first device. The main idea of ​​this implementation scheme is that the first device and the second device negotiate the long control word capability, the upper 4 bytes of the long control word carry the original control word, and the lower 4 bytes of the long control word carry the device identification of the first device, so that after the message arrives at the second device, the second device can use the lower 4 bytes of the long control word to determine that the message comes from the first device.

[0015] In another implementation manner, the capability negotiation information is used to negotiate between the first device and the second device the capability of carrying the device identifier of the first device after the bottom label of the message.

[0016] In a specific implementation, the bottom label is a pre-configured static label, or a dynamic label assigned by the second device, or a specified base special-purpose label (bSPL). The main idea of ​​this implementation is that the first device and the second device negotiate a label indication capability, and the 4 bytes after the bottom label indication label stack carry the device identification of the first device, so that after the message arrives at the second device, the second device can determine that the message comes from the first device using the 4 bytes after the bottom label.

[0017] In a specific implementation, the label at the bottom of the stack is a designated extended special-purpose label (eSPL). When the label stack of the message carries the eSPL, the label stack also carries a special label, which is used to indicate that the subsequent adjacent label is the eSPL. The main idea of ​​this implementation scheme is that the first device and the second device negotiate an extended label indication capability, and the 4 bytes after the eSPL indication label stack designated by the bottom of the stack carry the device identification of the first device, so that after the message reaches the second device, the second device can determine that the message comes from the first device using the 4 bytes after the label at the bottom of the stack.

[0018] In a specific implementation, the first device receives capability negotiation information sent by the second device, including: the first device receives a border gateway protocol (BGP) EVPN route sent by the second device, the BGP EVPN route includes a capability negotiation extended group attribute, and the capability negotiation extended group attribute is used to carry the capability negotiation information.

[0019] This application can be applied to EVPN over MPLS scenarios, and capability negotiation information can be published in BGP EVPN routes.

[0020] In a specific implementation, the first device receives capability negotiation information sent by the second device, including: the first device receives a BGP L3VPN route sent by the second device, the BGP L3VPN route includes a capability negotiation extended group attribute, and the capability negotiation extended group attribute is used to carry the capability negotiation information.

[0021] This application can be applied to MPLS L3VPN scenarios, and capability negotiation information can be published in L3VPN routing.

[0022] In a specific implementation, the first device sends a capability negotiation response to the second device. The capability negotiation response indicates that the first device has the capability to carry the device identifier of the first device in the message. In this way, the second device can clearly know whether the first device has the capability to carry the device identifier in the message, which can improve the reliability of capability negotiation.

[0023] In a specific implementation, the first device is an inbound operator edge device, and the second device is an outbound operator edge device.

[0024] In a second aspect, a message transmission method is provided. The method includes: a second device receives a message sent by a third device through an LSP established between the second device and the first device, the third device is a label switching device located between the first device and the second device on the LSP, the message includes an MPLS header, a device identifier of the first device, and a message payload, and the device identifier is encapsulated between the MPLS header and the message payload. The second device parses the message to obtain the device identifier of the first device.

[0025] In a specific implementation, the second device determines that the message comes from the first device according to the device identifier of the first device, so as to perform traffic statistics on the message from the first device.

[0026] In the present application, since the message received by the second device carries the device identification of the first device, the second device can obtain the device identification of the first device by parsing the message, and determine that the message is sent by the first device based on the device identification of the first device. In other words, the second device, as the egress device of the message on the label switching path, can accurately identify the ingress device of the message on the label switching path as the first device. The present application can achieve accurate statistics of network traffic in a network scenario based on MPLS technology for forwarding. For example, in an EVPN over MPLS scenario or an MPLS L3VPN scenario, the egress device on the label switching path can accurately count network traffic in the ingress direction.

[0027] In a specific implementation, the device identifier of the first device is a router identifier of the first device.

[0028] In a specific implementation, the message includes a control word, and the control word is used to carry a device identifier.

[0029] In a specific implementation, the message includes a control word, and the device identifier is adjacent to the control word.

[0030] In a specific implementation, the bottom label of the MPLS header is used to indicate that the device identifier is adjacent to the bottom label.

[0031] In a specific implementation, the second device sends capability negotiation information to the first device, where the capability negotiation information is used to negotiate between the first device and the second device a capability of carrying a device identifier of the first device in a message.

[0032] In one implementation, the capability negotiation information is used to negotiate between a first device and a second device the capability of carrying a device identifier of the first device in a control word of a message.

[0033] In a specific implementation, the control word is a 4-byte control word.

[0034] In a specific implementation, the control word is an 8-byte long control word, 4 bytes of the long control word are used to carry the original control word, and the other 4 bytes of the long control word are used to carry the device identifier of the first device.

[0035] In another implementation manner, the capability negotiation information is used to negotiate between the first device and the second device the capability of carrying the device identifier of the first device after the bottom label of the message.

[0036] In a specific implementation, the stack bottom label is a pre-configured static label, or a dynamic label allocated by the second device, or a specified bSPL.

[0037] In a specific implementation, the bottom label of the stack is a specified eSPL. When the label stack of the message carries the eSPL, the label stack also carries a special label, and the special label is used to indicate that the subsequent adjacent label is the eSPL.

[0038] In a specific implementation, the second device sends capability negotiation information to the first device, including: the second device sends a BGP EVPN route to the first device, the BGP EVPN route includes a capability negotiation extended group attribute, and the capability negotiation extended group attribute is used to carry the capability negotiation information.

[0039] In a specific implementation, the second device sends capability negotiation information to the first device, including: the second device sends a BGP L3VPN route to the first device, the BGP L3VPN route includes a capability negotiation extended group attribute, and the capability negotiation extended group attribute is used to carry the capability negotiation information.

[0040] In a specific implementation, the second device receives a capability negotiation response sent by the first device.

[0041] In a specific implementation, the first device is an inbound operator edge device, and the second device is an outbound operator edge device.

[0042] In a third aspect, a message transmission method is provided, comprising: a first device receiving capability negotiation information sent by a second device, the capability negotiation information being used to negotiate between the first device and the second device a capability of carrying a device identifier of the first device in an MPLS message sent by the first device to the second device.

[0043] In the present application, the first device and the second device negotiate capabilities to implement a message sent from the first device to the second device that carries the device identifier of the first device.

[0044] In one implementation, the capability negotiation information is used to negotiate between a first device and a second device the capability of carrying a device identifier of the first device in a control word of a message.

[0045] In a specific implementation, the control word is a 4-byte control word.

[0046] In a specific implementation, the control word is an 8-byte long control word, 4 bytes of the long control word are used to carry the original control word, and the other 4 bytes of the long control word are used to carry the device identifier of the first device.

[0047] In another implementation manner, the capability negotiation information is used to negotiate between the first device and the second device the capability of carrying the device identifier of the first device after the bottom label of the message.

[0048] In a specific implementation, the stack bottom label is a pre-configured static label, or a dynamic label allocated by the second device, or a specified bSPL.

[0049] In a specific implementation, the bottom label of the stack is a specified eSPL. When the label stack of the message carries the eSPL, the label stack also carries a special label, and the special label is used to indicate that the subsequent adjacent label is the eSPL.

[0050] In a specific implementation, a method for a first device to receive capability negotiation information sent by a second device includes: the first device receives a BGP EVPN route sent by the second device, the BGP EVPN route includes a capability negotiation extended group attribute, and the capability negotiation extended group attribute is used to carry capability negotiation information.

[0051] In a specific implementation, the implementation method of the first device receiving the capability negotiation information sent by the second device includes: the first device receives a BGP L3VPN route sent by the second device, the BGP L3VPN route includes a capability negotiation extended group attribute, and the capability negotiation extended group attribute is used to carry the capability negotiation information.

[0052] In a specific implementation, the first device sends a capability negotiation response to the second device.

[0053] In a specific implementation, the first device is an inbound operator edge device, and the second device is an outbound operator edge device.

[0054] In a fourth aspect, a message transmission method is provided. The method includes: a second device generates capability negotiation information, the capability negotiation information is used to negotiate between a first device and a second device a capability of carrying a device identifier of the first device in an MPLS message sent by the first device to the second device. The second device sends the capability negotiation information to the first device.

[0055] In one implementation, the capability negotiation information is used to negotiate between a first device and a second device the capability of carrying a device identifier of the first device in a control word of a message.

[0056] In a specific implementation, the control word is a 4-byte control word.

[0057] In a specific implementation, the control word is an 8-byte long control word, 4 bytes of the long control word are used to carry the original control word, and the other 4 bytes of the long control word are used to carry the device identifier of the first device.

[0058] In another implementation manner, the capability negotiation information is used to negotiate between the first device and the second device the capability of carrying the device identifier of the first device after the bottom label of the message.

[0059] In a specific implementation, the stack bottom label is a pre-configured static label, or a dynamic label allocated by the second device, or a specified bSPL.

[0060] In a specific implementation, the bottom label of the stack is a specified eSPL. When the label stack of the message carries the eSPL, the label stack also carries a special label, and the special label is used to indicate that the subsequent adjacent label is the eSPL.

[0061] In a specific implementation, the second device sends capability negotiation information to the first device, including: the second device sends a BGP EVPN route to the first device, the BGP EVPN route includes a capability negotiation extended group attribute, and the capability negotiation extended group attribute is used to carry the capability negotiation information.

[0062] In a specific implementation, the second device sends capability negotiation information to the first device, including: the second device sends a BGP L3VPN route to the first device, the BGP L3VPN route includes a capability negotiation extended group attribute, and the capability negotiation extended group attribute is used to carry the capability negotiation information.

[0063] In a specific implementation, the second device receives a capability negotiation response sent by the first device.

[0064] In a specific implementation, the first device is an inbound operator edge device, and the second device is an outbound operator edge device.

[0065] In a fifth aspect, a first device is provided. The first device includes multiple functional modules, and the multiple functional modules interact with each other to implement the method in the above-mentioned first aspect and its various embodiments. The multiple functional modules can be implemented based on software, hardware, or a combination of software and hardware, and the multiple functional modules can be arbitrarily combined or divided based on specific implementations. The multiple functional modules include a processing module and a sending module. In a specific implementation, the multiple functional modules also include a receiving module.

[0066] The processing module is used to generate a message, the message includes an MPLS header, a device identifier of the first device and a message payload, and the device identifier is encapsulated between the MPLS header and the message payload. The sending module is used to send the message to the second device through the LSP established between the first device and the second device.

[0067] In a specific implementation, the device identifier of the first device is a router identifier of the first device.

[0068] In a specific implementation, the message includes a control word, and the control word is used to carry a device identifier.

[0069] In a specific implementation, the message includes a control word, and the device identifier is adjacent to the control word.

[0070] In a specific implementation, the bottom label of the MPLS header is used to indicate that the device identifier is adjacent to the bottom label.

[0071] In a specific implementation, the receiving module is used to receive capability negotiation information sent by the second device, where the capability negotiation information is used to negotiate between the first device and the second device a capability of carrying a device identifier of the first device in a message.

[0072] In a specific implementation, the capability negotiation information is used to negotiate between the first device and the second device the capability of carrying the device identifier of the first device in a control word of a message.

[0073] In a specific implementation, the control word is a 4-byte control word.

[0074] In a specific implementation, the control word is an 8-byte long control word, 4 bytes of the long control word are used to carry the original control word, and the other 4 bytes of the long control word are used to carry the device identifier of the first device.

[0075] In a specific implementation, the capability negotiation information is used to negotiate between the first device and the second device the capability of carrying the device identifier of the first device after the bottom label of the message.

[0076] In a specific implementation, the stack bottom label is a pre-configured static label, or a dynamic label allocated by the second device, or a specified bSPL.

[0077] In a specific implementation, the bottom label of the stack is a specified eSPL. When the label stack of the message carries the eSPL, the label stack also carries a special label, and the special label is used to indicate that the subsequent adjacent label is the eSPL.

[0078] In a specific implementation, the receiving module is specifically used to receive the BGP EVPN route sent by the second device, and the BGP EVPN route includes a capability negotiation extended community attribute, and the capability negotiation extended community attribute is used to carry capability negotiation information.

[0079] In a specific implementation, the receiving module is specifically used to receive the BGP L3VPN route sent by the second device, the BGP L3VPN route includes a capability negotiation extended community attribute, and the capability negotiation extended community attribute is used to carry capability negotiation information.

[0080] In a specific implementation, the first device is an inbound operator edge device, and the second device is an outbound operator edge device.

[0081] In a sixth aspect, a second device is provided. The second device includes multiple functional modules, and the multiple functional modules interact with each other to implement the method in the above-mentioned second aspect and its various embodiments. The multiple functional modules can be implemented based on software, hardware, or a combination of software and hardware, and the multiple functional modules can be arbitrarily combined or divided based on the specific implementation. The multiple functional modules include a receiving module and a processing module. In a specific implementation, the multiple functional modules also include a sending module.

[0082] The receiving module is used to receive a message sent by a third device through an LSP established between the second device and the first device, the third device is a label switching device located between the first device and the second device on the LSP, and the message includes an MPLS header, a device identifier of the first device, and a message payload, and the device identifier is encapsulated between the MPLS header and the message payload. The processing module is used to parse the message to obtain the device identifier of the first device.

[0083] In a specific implementation, the processing module is further used to determine that the message comes from the first device according to the device identifier of the first device, so as to perform traffic statistics on the message from the first device.

[0084] In a specific implementation, the device identifier of the first device is a router identifier of the first device.

[0085] In a specific implementation, the message includes a control word, and the control word is used to carry a device identifier.

[0086] In a specific implementation, the message includes a control word, and the device identifier is adjacent to the control word.

[0087] In a specific implementation, the bottom label of the MPLS header is used to indicate that the device identifier is adjacent to the bottom label.

[0088] In a specific implementation, the sending module is used to send capability negotiation information to the first device, where the capability negotiation information is used to negotiate between the first device and the second device a capability of carrying a device identifier of the first device in a message.

[0089] In a specific implementation, the capability negotiation information is used to negotiate between the first device and the second device the capability of carrying the device identifier of the first device in a control word of a message.

[0090] In a specific implementation, the control word is a 4-byte control word.

[0091] In a specific implementation, the control word is an 8-byte long control word, 4 bytes of the long control word are used to carry the original control word, and the other 4 bytes of the long control word are used to carry the device identifier of the first device.

[0092] In a specific implementation, the capability negotiation information is used to negotiate between the first device and the second device the capability of carrying the device identifier of the first device after the bottom label of the message.

[0093] In a specific implementation, the stack bottom label is a pre-configured static label, or a dynamic label allocated by the first device, or a specified bSPL.

[0094] In a specific implementation, the bottom label of the stack is a specified eSPL. When the label stack of the message carries the eSPL, the label stack also carries a special label, and the special label is used to indicate that the subsequent adjacent label is the eSPL.

[0095] In a specific implementation, the sending module is specifically used to send a BGP EVPN route to the first device, where the BGP EVPN route includes a capability negotiation extended community attribute, and the capability negotiation extended community attribute is used to carry capability negotiation information.

[0096] In a specific implementation, the sending module is specifically used to send a BGP L3VPN route to the first device, where the BGP L3VPN route includes a capability negotiation extended community attribute, and the capability negotiation extended community attribute is used to carry capability negotiation information.

[0097] In a specific implementation, the first device is an inbound operator edge device, and the second device is an outbound operator edge device.

[0098] In the seventh aspect, a first device is provided. The first device includes multiple functional modules, and the multiple functional modules interact with each other to implement the method in the third aspect and its respective embodiments. The multiple functional modules can be implemented based on software, hardware, or a combination of software and hardware, and the multiple functional modules can be arbitrarily combined or divided based on the specific implementation. The multiple functional modules include a receiving module. In a specific implementation, the multiple functional modules also include a sending module.

[0099] The receiving module is used to receive capability negotiation information sent by the second device, where the capability negotiation information is used to negotiate between the first device and the second device the capability of carrying the device identifier of the first device in an MPLS message sent by the first device to the second device.

[0100] In a specific implementation, the capability negotiation information is used to negotiate between the first device and the second device the capability of carrying the device identifier of the first device in a control word of a message.

[0101] In a specific implementation, the control word is a 4-byte control word.

[0102] In a specific implementation, the control word is an 8-byte long control word, 4 bytes of the long control word are used to carry the original control word, and the other 4 bytes of the long control word are used to carry the device identifier of the first device.

[0103] In a specific implementation, the capability negotiation information is used to negotiate between the first device and the second device the capability of carrying the device identifier of the first device after the bottom label of the message.

[0104] In a specific implementation, the stack bottom label is a pre-configured static label, or a dynamic label allocated by the second device, or a specified bSPL.

[0105] In a specific implementation, the bottom label of the stack is a specified eSPL. When the label stack of the message carries the eSPL, the label stack also carries a special label, and the special label is used to indicate that the subsequent adjacent label is the eSPL.

[0106] In a specific implementation, the receiving module is specifically used to receive a BGP EVPN route sent by the second device, where the BGP EVPN route includes a capability negotiation extended community attribute, and the capability negotiation extended community attribute is used to carry capability negotiation information.

[0107] In a specific implementation, the receiving module is specifically used to receive a BGP L3VPN route sent by the second device, where the BGP L3VPN route includes a capability negotiation extended community attribute, and the capability negotiation extended community attribute is used to carry capability negotiation information.

[0108] In a specific implementation, the sending module is used to send a capability negotiation response to the second device.

[0109] In a specific implementation, the first device is an inbound operator edge device, and the second device is an outbound operator edge device.

[0110] In an eighth aspect, a second device is provided. The second device includes a plurality of functional modules, and the plurality of functional modules interact with each other to implement the method in the fourth aspect and each embodiment thereof. The plurality of functional modules can be implemented based on software, hardware, or a combination of software and hardware, and the plurality of functional modules can be arbitrarily combined or divided based on a specific implementation. The plurality of functional modules include a processing module and a sending module. In a specific implementation, the plurality of functional modules also include a receiving module.

[0111] The processing module is used to generate capability negotiation information, which is used to negotiate between the first device and the second device on the capability of carrying the device identifier of the first device in the MPLS message sent by the first device to the second device. The sending module is used to send the capability negotiation information to the first device.

[0112] In a specific implementation, the capability negotiation information is used to negotiate between the first device and the second device the capability of carrying the device identifier of the first device in a control word of a message.

[0113] In a specific implementation, the control word is a 4-byte control word.

[0114] In a specific implementation, the control word is an 8-byte long control word, 4 bytes of the long control word are used to carry the original control word, and the other 4 bytes of the long control word are used to carry the device identifier of the first device.

[0115] In a specific implementation, the capability negotiation information is used to negotiate between the first device and the second device the capability of carrying the device identifier of the first device after the bottom label of the message.

[0116] In a specific implementation, the stack bottom label is a pre-configured static label, or a dynamic label allocated by the first device, or a specified bSPL.

[0117] In a specific implementation, the bottom label of the stack is a specified eSPL. When the label stack of the message carries the eSPL, the label stack also carries a special label, and the special label is used to indicate that the subsequent adjacent label is the eSPL.

[0118] In a specific implementation, the sending module is specifically used to send a BGP EVPN route to the first device, where the BGP EVPN route includes a capability negotiation extended community attribute, and the capability negotiation extended community attribute is used to carry capability negotiation information.

[0119] In a specific implementation, the sending module is specifically used to send a BGP L3VPN route to the first device, where the BGP L3VPN route includes a capability negotiation extended community attribute, and the capability negotiation extended community attribute is used to carry capability negotiation information.

[0120] In a specific implementation, the receiving module is used to receive a capability negotiation response sent by the first device.

[0121] In a specific implementation, the first device is an inbound operator edge device, and the second device is an outbound operator edge device.

[0122] In the ninth aspect, a message transmission system is provided, including: a first device and a second device, wherein the first device is used to implement the method in the first aspect or any possible implementation of the first aspect, and the second device is used to implement the method in the second aspect or any possible implementation of the second aspect; or, the first device is used to implement the method in the third aspect or any possible implementation of the third aspect, and the second device is used to implement the method in the fourth aspect or any possible implementation of the fourth aspect.

[0123] In a tenth aspect, a network device is provided, comprising: a communication interface; and a processor connected to the communication interface. According to the communication interface and the processor, the method in the first aspect or any possible implementation of the first aspect is implemented, or the method in the second aspect or any possible implementation of the second aspect is implemented, or the method in the third aspect or any possible implementation of the third aspect is implemented, or the method in the fourth aspect or any possible implementation of the fourth aspect is implemented.

[0124] In the eleventh aspect, a computer-readable storage medium is provided, on which instructions are stored. When the instructions are executed by a processor, the method in the first aspect or any possible implementation of the first aspect is implemented, or the method in the second aspect or any possible implementation of the second aspect is implemented, or the method in the third aspect or any possible implementation of the third aspect is implemented, or the method in the fourth aspect or any possible implementation of the fourth aspect is implemented.

[0125] In the twelfth aspect, a computer program product is provided, including a computer program. When the computer program is executed by a processor, it implements the method in the first aspect or any possible implementation of the first aspect, or implements the method in the second aspect or any possible implementation of the second aspect, or implements the method in the third aspect or any possible implementation of the third aspect, or implements the method in the fourth aspect or any possible implementation of the fourth aspect.

[0126] In the thirteenth aspect, a chip is provided, which includes a programmable logic circuit and / or program instructions. When the chip is running, it implements the method in the first aspect or any possible implementation of the first aspect, or implements the method in the second aspect or any possible implementation of the second aspect, or implements the method in the third aspect or any possible implementation of the third aspect, or implements the method in the fourth aspect or any possible implementation of the fourth aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0127] Figure 1 It is a schematic diagram of publishing MAC addresses in the EVPN over MPLS scenario in the related art;

[0128] Figure 2 It is a schematic diagram of message transmission in the EVPN over MPLS scenario in the related technology;

[0129] Figure 3 It is a schematic diagram of issuing IP addresses in an MPLS L3VPN scenario in the related art;

[0130] Figure 4 It is a schematic diagram of message transmission in an MPLS L3VPN scenario in the related art;

[0131] Figure 5 It is a schematic diagram of an application scenario provided by an embodiment of the present application;

[0132] Figure 6 It is a flowchart of a message transmission method provided in an embodiment of the present application;

[0133] Figure 7 It is a schematic diagram of the structure of an MPLS message provided in an embodiment of the present application;

[0134] Figure 8 It is a schematic diagram of the structure of another MPLS message provided in an embodiment of the present application;

[0135] Fig. 9 It is a structural diagram of another MPLS message provided in an embodiment of the present application;

[0136] Fig.10 It is a structural diagram of another MPLS message provided in an embodiment of the present application;

[0137] Fig.11 This is a schematic diagram of the structure of a BGP update message provided in an embodiment of the present application;

[0138] Fig.12 This is a schematic diagram of a structure of a capability negotiation extended group attribute provided in an embodiment of the present application;

[0139] Fig.13 This is a schematic diagram of message transmission in an EVPN over MPLS scenario provided by an embodiment of the present application;

[0140] Fig.14 This is a schematic diagram of the structure of another capability negotiation extended group attribute provided in an embodiment of the present application;

[0141] Fig.15 This is another schematic diagram of message transmission in an EVPN over MPLS scenario provided by an embodiment of the present application;

[0142] Fig.16 This is a structural diagram of another capability negotiation extended group attribute provided in an embodiment of the present application;

[0143] Fig.17 This is another schematic diagram of message transmission in an EVPN over MPLS scenario provided by an embodiment of the present application;

[0144] Fig.18 This is a structural diagram of another capability negotiation extended group attribute provided in an embodiment of the present application;

[0145] Fig.19This is another schematic diagram of message transmission in an EVPN over MPLS scenario provided by an embodiment of the present application;

[0146] Fig. 20 It is a flowchart of another message transmission method provided in an embodiment of the present application;

[0147] Fig.21 It is a flowchart of another message transmission method provided in an embodiment of the present application;

[0148] Fig. 22 It is a flowchart of another message transmission method provided in an embodiment of the present application;

[0149] Fig.23 It is a flowchart of another message transmission method provided in an embodiment of the present application;

[0150] Fig.24 It is a structural schematic diagram of a message transmission device provided in an embodiment of the present application;

[0151] Fig.25 It is a structural schematic diagram of another message transmission device provided in an embodiment of the present application;

[0152] Fig.26 It is a structural schematic diagram of another message transmission device provided in an embodiment of the present application;

[0153] Fig. 27 It is a structural schematic diagram of another message transmission device provided in an embodiment of the present application;

[0154] Fig.28 It is a block diagram of a message transmission device provided in an embodiment of the present application;

[0155] Fig.29 It is a block diagram of another message transmission device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0156] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0157] Currently, hosts located at different sites can communicate across sites. A site can be considered as a local area network, such as a single subnet LAN or a multiple subnet LAN. Different sites can be deployed in different regions. One or more hosts can be deployed in a site. A host refers to a terminal device with a client installed, such as a smartphone, tablet computer, desktop computer, Internet of Things (IoT) device, network device, workstation or server.

[0158] The hosts in a site usually belong to a private network. Different hosts in a site can belong to the same private network or different private networks. Hosts in a private network are usually configured with an intranet address. Since the intranet addresses of different private networks can overlap, the intranet addresses configured for hosts in a private network can generally only be used to communicate within the private network. Private networks can be deployed across sites, that is, a private network can include multiple hosts deployed at different sites. For example, a private network is distributed and deployed at site A and site B, and site A and site B are connected through an operator network, which means that the private network includes a host located at site A and a host located at site B. Private networks can be implemented using a virtual private network (VPN). For a private network, the hosts deployed in the private network are intranet hosts, while the operator network and other private networks are external networks. Among them, the operator network used to connect different sites can be a wide area backbone network or a metropolitan area network established using MPLS technology. The private network here can be a private network of an enterprise. The network of an enterprise at a certain site is the enterprise's internal network, and the multiple networks of the enterprise deployed at multiple sites are called the enterprise's private network or multi-site private network.

[0159] For a private network distributed in multiple sites, if the intranet host of one site wants to send a message to the intranet host of another site, the transmission of the message needs to pass through the external network between the two sites. The intranet host of a site needs to communicate with the external network through the edge access device of the site. The edge access device of the site is usually called a customer edge (CE) device. CE devices can be, for example, routers, switches, or gateways. Taking the external network as an operator network as an example, the CE device of each site is connected to a provider edge (PE) device. When the intranet host of one site sends a message to the intranet host of another site, the message first arrives at the CE device of the local site, and then is transmitted by the CE device of the local site to the connected PE device. Then, the message arrives at the remote PE device after being transmitted via the operator network, and then is transmitted by the remote PE device to the CE device of the remote site, and finally is transmitted by the CE device of the remote site to the intranet host of the remote site.

[0160] Optionally, hosts at different sites can communicate via a Layer 2 network or a Layer 3 network. Different hosts communicate via a Layer 2 network, i.e., different hosts communicate based on Media Access Control (MAC) routing. Different hosts communicate via a Layer 3 network, i.e., different hosts communicate based on Internet Protocol (IP) routing.

[0161] EVPN technology is a VPN technology used for Layer 2 network interconnection. Since EVPN can solve the problem that traditional virtual private LAN service (VPLS) does not support dual-home network load sharing, and can avoid the drawbacks of full connection between public network pseudo wires (PW), and achieve rapid routing convergence, it has been widely used in the network in recent years. Among them, VPLS is a Layer 2 VPN technology based on MPLS and Ethernet technology. Unlike the mechanism of learning MAC addresses through the forwarding plane in traditional Layer 2 virtual private network (L2VPN), EVPN introduces the control plane. EVPN transfers the MAC address publishing process between Layer 2 networks at different sites from the forwarding plane to the control plane by extending the multiprotocol border gateway protocol (MP-BGP). Compared with traditional L2VPN, EVPN has some functional differences due to differences in implementation principles. In the EVPN over MPLS scenario, MAC routes are transmitted to the remote PE device through the control plane.

[0162] L3VPN technology is a VPN technology used for interconnecting three-layer networks.

[0163] For example, Figure 1 The figure is a schematic diagram of publishing a MAC address in an EVPN over MPLS scenario in the related art. Figure 2 The diagram is a schematic diagram of message transmission in an EVPN over MPLS scenario in the related art. Figure 3 It is a schematic diagram of issuing IP addresses in an MPLS L3VPN scenario in the related art. Figure 4 FIG. 1 is a schematic diagram of message transmission in an MPLS L3VPN scenario in the related technology. Figures 1 to 4 In the scenario shown, the operator network includes three PE devices, PE1 to PE3, and two operator (provider, P) devices, P1 and P2. Figure 1 and Figure 3The P devices are not shown. PE1 is connected to P1 and P2 respectively. P1, P2, PE2 and PE3 are connected in pairs. CE1 is connected to PE1 to access the communication network. CE2 is dual-homed to PE2 and PE3 to access the communication network, that is, PE2 and PE3 are dual-homed access devices of CE2.

[0164] exist Figure 1 and Figure 2 In the scenario shown, BGP EVPN peer relationships are established between PE1, PE2, and PE3. Figure 1 As shown in the figure, after PE1 learns MAC1 from CE1, it allocates private network label Label1 and sends it to remote PE2 and PE3 respectively. Figure 2 As shown, CE2 sends a Layer 2 message with a destination MAC address of DMAC (e.g., MAC1) and a source MAC address of SMAC to CE1. If the message is sent from PE2 to PE1 via P1, PE2 generates an MPLS message, which includes an MPLS header and a message payload. The MPLS header includes the public network label LSP1 assigned by P1 and the private network label Label1 assigned by PE1. The Layer 2 message sent by CE2 is encapsulated in the message payload. After P1 receives the MPLS message sent by PE2, it can pop out the public network label LSP1 and continue to send the MPLS message to PE1. Finally, the message received by PE1 includes an MPLS header and a message payload. The MPLS header includes the private network label Label1 assigned by PE1. If the message is sent from PE3 to PE1 via P2, PE3 generates an MPLS message, which includes an MPLS header and a message payload. The MPLS header includes the public network label LSP2 assigned by P2 and the private network label Label1 assigned by PE1. The Layer 2 message sent by CE2 is encapsulated in the message payload. After P2 receives the MPLS message sent by PE3, it can pop out the public network label LSP2 and continue to send the MPLS message to PE1. The message finally received by PE1 includes an MPLS header and a message payload. The MPLS header includes the private network label Label1 assigned by PE1. In other words, no matter whether the Layer 2 message sent by CE2 to CE1 is forwarded by PE2 or PE3, the private network label carried by the MPLS message finally received by PE1 is Label1. Therefore, PE1 cannot distinguish whether the traffic comes from PE2 or PE3 in the inbound direction. Figure 2 The message structure shown is only used for exemplary explanation. In fact, the MPLS message received by PE1 may also include an encapsulated outer MAC header before the MPLS header. The private network label is also called a VPN label, and the public network label is also called an LSP label.

[0165] For ease of understanding, Figure 2 and Figure 4In the illustrated scenario, only one P device is drawn between PE devices, and those skilled in the art will appreciate that multiple P devices may be included between PE devices. The MPLS technology described in this application may be a traditional MPLS technology or a segment routing (SR) MPLS (abbreviated as SR-MPLS) technology based on an MPLS forwarding plane.

[0166] exist Figure 3 and Figure 4 In the scenario shown, BGP L3VPN peer relationships are established between PE1, PE2, and PE3. Figure 3 As shown in the figure, after PE1 learns IP1 from CE1, it allocates private network label Label2 and sends it to remote PE2 and PE3 respectively. Figure 4 As shown, CE2 sends a Layer 3 message to CE1, with the destination IP address being the destination IP (e.g., IP1) and the source IP address being the source IP. If the message is sent from PE2 to PE1 via P1, PE2 generates an MPLS message, which includes an MPLS header and a message payload. The MPLS header includes the public network label LSP1 assigned by P1 and the private network label Label2 assigned by PE1. The Layer 3 message sent by CE2 is encapsulated in the message payload. After P1 receives the MPLS message sent by PE2, it can pop out the public network label LSP1 and continue to send the MPLS message to PE1. Finally, the message received by PE1 includes an MPLS header and a message payload. The MPLS header includes the private network label Label2 assigned by PE1. If the message is sent from PE3 to PE1 via P2, PE3 generates an MPLS message, which includes an MPLS header and a message payload. The MPLS header includes the public network label LSP2 assigned by P2 and the private network label Label2 assigned by PE1. The three-layer message sent by CE2 is encapsulated in the message payload. After P2 receives the MPLS message sent by PE3, it can pop out the public network label LSP2 and continue to send the MPLS message to PE1. The message finally received by PE1 includes an MPLS header and a message payload. The MPLS header includes the private network label Label2 assigned by PE1. In other words, no matter whether the three-layer message sent by CE2 to CE1 is forwarded by PE2 or PE3, the private network label carried by the MPLS message finally received by PE1 is Label2. Therefore, PE1 cannot distinguish whether the traffic comes from PE2 or PE3 in the inbound direction. Figure 4 The message structure shown is only used for exemplary description. In reality, the MPLS message received by PE1 may also include an encapsulated outer MAC header before the MPLS header.

[0167] As can be seen from the above, in some network scenarios based on MPLS technology, such as EVPN overMPLS scenarios and MPLS L3VPN scenarios, it is difficult for network devices to achieve accurate statistics of network traffic in the inbound direction. Based on this, the present application provides a technical solution, in which the network device encapsulates the device identifier of the network device between the MPLS header and the payload of the message when generating a message, and then sends the generated message to other network devices through the LSP established between the network device and other network devices. Since the message received by other network devices carries the device identifier of the network device, other network devices can parse the message to obtain the device identifier of the network device, and determine that the message is sent by the network device based on the device identifier, thereby achieving accurate statistics of network traffic in the inbound direction.

[0168] The following is a detailed introduction to the technical solution of this application from multiple angles, including application scenarios, method flow, virtual devices, physical devices, and systems.

[0169] The following is an illustration of the application scenarios involved in the embodiments of the present application.

[0170] The application scenarios of the present application include a communication network and a site accessing the communication network. The communication network is an MPLSVPN network, also known as an MPLS BGP VPN network. The communication network is a bearer network, such as a data center network (DCN), a metropolitan area network, a wide area network or a local area network, which can be used to carry EVPN services and / or L3VPN services. In other words, the application scenario of the present application can be an EVPN over MPLS scenario, or it can also be an MPLS L3VPN scenario. In addition, the communication network can be an operator network or an enterprise-built network.

[0171] The communication network provided in the present application includes multiple network devices for service forwarding, and the multiple network devices are communicatively connected. Each network device may be a switch or a router. Among them, the multiple network devices include edge network devices and core network devices. The edge network device is at the edge of the communication network and is used for sites to access the communication network. The core network device is connected between different edge network devices and is used to forward services between different edge network devices. Optionally, the site is connected to the edge network device of the communication network through an edge access device to access the communication network through the edge access device. The edge access device may be a switch, a router or a gateway, etc. The embodiment of the present application is described by taking the communication network as an operator network as an example, the edge network device is a PE device, the core network device is a P device, the edge access device is a CE device, and one or more hosts are deployed in the site accessing the communication network.

[0172] For example, Figure 5 is a schematic diagram of an application scenario provided by an embodiment of the present application. Figure 5 As shown, the application scenario includes a communication network ( Figure 5 Shown is an MPLS VPN) and two CE devices CE1-CE2 connected to the communication network. The communication network includes three PE devices PE1-PE3 and two P devices P1 and P2. PE1 is connected to P1 and P2 respectively. P1, P2, PE2 and PE3 are connected in pairs. CE1 connects to PE1 to access the communication network. CE2 dual-homes PE2 and PE3 to access the communication network, that is, PE2 and PE3 are dual-home access devices of CE2. CE1 is an edge access device at site 1, used to connect host 1 and host 2 in site 1 to the communication network. CE2 is an edge access device at site 2, used to connect host 3 and host 4 in site 2 to the communication network. Figure 5 The application scenario shown can be as follows Figure 1 or Figure 2 In the application scenario shown, the MPLSVPN is EVPN over MPLS. Or, Figure 5 The application scenario shown can be as follows Figure 3 or Figure 4 In the application scenario shown, the MPLS VPN is an MPLS L3VPN.

[0173] Optionally, PE1, PE2, and PE3 are BGP neighbors of each other. In the embodiment of the present application, two PE devices are BGP neighbors of each other, which may be a BGP peer relationship established between the two PE devices. Alternatively, the communication network also includes a route reflector, and the two PE devices are BGP neighbors of each other, or the two PE devices respectively establish a BGP peer relationship with the route reflector, that is, the two PE devices are indirectly connected in communication through the route reflector. The route reflector is used to forward messages transmitted between different PE devices, and the route reflector does not modify the received messages during the forwarding process. Figure 5 The application scenario shown is the EVPN over MPLS scenario, for example Figure 1 or Figure 2 In the scenario shown, PE1, PE2, and PE3 are BGP EVPN neighbors, and the BGP peer relationship established between the devices is a BGP EVPN peer relationship. Figure 5 The application scenario shown is an MPLS L3VPN scenario, for example Figure 3 or Figure 4 In the illustrated scenario, PE1, PE2, and PE3 are BGP L3VPN neighbors of each other, and the BGP peer relationship established between the devices is a BGP L3VPN peer relationship.

[0174] Optionally, one or more forwarding instances are configured in the PE device in the communication network. Different forwarding instances in the same device work independently to achieve route isolation. In the embodiment of the present application, the forwarding instance in the PE device can be a layer 2 forwarding instance, also known as an EVPN instance (EVPN instance, EVI) (corresponding to a layer 2 forwarding domain), and the layer 2 forwarding instance can publish MAC routes. An EVI can be composed of one or more bridge domains (bridge domains, BD). Alternatively, the forwarding instance in the PE device can also be a layer 3 forwarding instance, also known as a virtual routing forwarding (virtual routing forwarding, VRF) instance (corresponding to a layer 3 forwarding domain), and the layer 3 forwarding instance can publish IP routes. Among them, each forwarding instance is configured with a route target (route target), which can also be called vpn-target. Route target is a BGP extended community attribute, and each forwarding instance needs to be configured with two types of route targets, the outbound direction and the inbound direction. When the outbound route target value configured by the local forwarding instance is equal to the inbound route target value configured by the opposite forwarding instance, the local end and the opposite end can exchange BGP routes with each other. In the embodiment of the present application, two PE devices that are BGP EVPN neighbors are configured with EVIs belonging to the same EVPN. In this case, the two PE devices may also be referred to as belonging to the same EVPN. Two PE devices that are BGP L3VPN neighbors are configured with VRF instances belonging to the same L3VPN. In this case, the two PE devices may also be referred to as belonging to the same L3VPN.

[0175] Optionally, after the PE device learns the MAC route (or IP route) from the CE device, it needs to publish the learned MAC route (or IP route) and its corresponding private network label in the communication network. There are many ways for the PE device to assign private network labels to MAC routes (or IP routes). For example, the PE device can assign a private network label to each forwarding instance configured in the PE device, so the private network labels corresponding to all MAC routes (or IP routes) published by the same forwarding instance in the PE device are the same private network label. Alternatively, the PE device can assign a private network label to each MAC route (or IP route). Alternatively, the PE device can assign a private network label to each accessed CE, so the private network labels corresponding to all MAC routes (or IP routes) learned by the PE device from the same CE device are the same private network label. Alternatively, the PE device can assign a private network label to a broadcast domain, so the private network labels corresponding to all MAC routes published by the PE device in the broadcast domain are the same private network label. The embodiment of the present application does not limit the way in which the PE device assigns private network labels.

[0176] The following is an example of the method flow of the embodiment of the present application.

[0177] For example, Figure 6 Schematic diagram of a message transmission method provided in an embodiment of the present application. Figure 6 As shown, method 600 includes steps 601 to 604. Device 1 and device 2 in method 600 are respectively network edge devices of the MPLS VPN network, such as routers, switches or gateways. An LSP is established between device 1 and device 2, and device 3 is a label switching device located between device 1 and device 2 on the LSP. In the scenario where the MPLS VPN network is an operator network, device 1 in method 600 is an ingress operator edge device (ingress PE), and device 2 in method 600 is an egress operator edge device (egress PE). In the scenario where the MPLS VPN network is a data center network, device 1 in method 600 is an ingress gateway, and device 2 in method 600 is an egress gateway. The embodiments of the present application do not limit the implementation scenarios of the MPLS VPN network and the device types of network edge devices. For example, method 600 can be applied to Figure 5 In the application scenario shown in FIG. 6A , for example, the device 1 in method 600 is Figure 5 PE2 or PE3 shown, device 2 in method 600 is Figure 5 PE1 is shown, and device 3 in method 600 is Figure 5 P1 or P2 shown.

[0178] Step 601: Device 1 generates a message, which includes an MPLS header, a device identifier of device 1 and a message payload. The device identifier is encapsulated between the MPLS header and the message payload.

[0179] Among them, the message generated by device 1 is an MPLS message. The MPLS message includes a message header and a message payload. The message header includes an MPLS header and a device identifier of device 1. The message payload is an inner message of the MPLS message. The inner message can be a layer 2 message or a layer 3 message, which is usually an original data message sent by a user edge device. The layer 3 message can be an IPv4 message or an IPv6 message. In the embodiment of the present application, the message portion of the MPLS message located before the message payload is called the message header of the MPLS message.

[0180] Optionally, the device identification of device 1 is the router identification (router ID) of device 1. Alternatively, the device identification of device 1 may also be information such as the IP address of device 1, the hardware address of device 1 or the MAC address of device 1 that can uniquely identify device 1 in the communication network. The embodiment of the present application does not limit the type of device identification. The length of the device identification of device 1 may be 2 bytes, 4 bytes, 6 bytes or 8 bytes, etc., and the embodiment of the present application does not limit the length of the device identification. For example, the device identification of device 1 is the router ID of device 1, and accordingly, the length of the device identification of device 1 is 4 bytes. The following embodiments of the present application are all described by taking the length of the device identification as 4 bytes as an example.

[0181] Optionally, after receiving the original data message sent by the user edge device, device 1 generates an MPLS message. For example, Figure 7 Schematic diagram of the structure of an MPLS message provided in an embodiment of the present application. Figure 7 As shown, the MPLS message includes a message header and a message payload. The message header includes a MAC header, an MPLS header and a device identifier of device 1. The MPLS header includes an LSP label (optional) and a VPN label. The message payload is the original data message received by device 1 from the user edge device.

[0182] Optionally, the device identifier of device 1 can be set at different positions in the MPLS message. The embodiment of the present application is described by taking the following three possible implementation methods as examples. Among them, the setting position of the device identifier in the MPLS message can be defined in the protocol or standard. Alternatively, the network edge devices can negotiate to determine the setting position of the device identifier in the MPLS message.

[0183] In a first possible implementation, the message generated by device 1 includes a control word, and the control word is used to carry the device identification of device 1. In other words, the device identification of device 1 is the control word in the message. In this implementation, the message generated by device 1 can be, for example, Figure 8 As shown. Optionally, the control word is a 4-byte control word. This implementation does not need to change the format of the original MPLS message, and only requires the ability to parse the control word and identify the device identifier to be configured in the network edge device on the receiving side, and the ability to set the control word as the device identifier to be configured in the network edge device on the sending side.

[0184] In a second possible implementation, the message generated by device 1 includes a control word, and the device identification of device 1 is adjacent to the control word. Optionally, the device identification of device 1 is located after the control word. The control word here refers to the original 4-byte control word. In this implementation, the message generated by device 1 can be, for example, Fig. 9As shown. Optionally, the message generated by device 1 includes an 8-byte long control word. 4 bytes of the long control word are used to carry the original control word, and the other 4 bytes of the long control word are used to carry the device identification of device 1. For example, the upper 4 bytes of the long control word are used to carry the original control word, and the lower 4 bytes of the long control word are used to carry the device identification of device 1, that is, the device identification of device 1 is in the lower 4 bytes of the long control word. This implementation does not require changing the original control word and will not affect the function of the original control word.

[0185] In a third possible implementation, the bottom label of the MPLS header in the message generated by device 1 indicates that the device identifier of device 1 is adjacent to the bottom label. In other words, the device identifier of device 1 is adjacent to the bottom label of the MPLS header. In this implementation, the message generated by device 1 can be, for example, Fig.10 shown.

[0186] Optionally, the bottom label can separately indicate that the device ID of device 1 is adjacent to the bottom label. For example, the bottom label is a pre-configured static label, or a dynamic label assigned by device 2, or a specified basic special purpose label (bSPL). In the case where the bottom label is a pre-configured static label, the static label is pre-configured in each of device 1 and device 2. The static label pre-configured in device 1 is used to carry the bottom of the label stack of the message sent to device 2, so as to indicate that the device ID of device 1 is carried after the static label. The static label pre-configured in device 2 is used to parse the bottom label of the message received by device 2, so as to determine whether the device ID of the device sending the message is carried after the bottom label. In the case where the bottom label is a dynamic label assigned by device 2, device 2 can generate the dynamic label and send it to device 1. In the case where the bottom label is a specified bSPL, the specified bSPL can be defined in the standard or protocol, such as the standard or protocol definition: when the bSPL as the bottom label takes a specified label value, it indicates that the device ID is carried after the bottom label. The embodiment of the present application does not limit the specific value of the specified label value.

[0187] Alternatively, the bottom label and other labels in the label stack together indicate that the device identifier of device 1 is adjacent to the bottom label of the stack. For example, when the bottom label of the stack is a designated extended special purpose label (eSPL), when the label stack of the message carries the eSPL, the label stack also carries a special label, and the special label is used to indicate that the label adjacent thereto is the eSPL. In other words, the bottom label of the stack and the special label together indicate that the device identifier of device 1 is adjacent to the bottom label of the stack. Specifically, the special label indicates that the label adjacent to the special label is the eSPL, and the designated eSPL (bottom label of the stack) indicates that the device identifier of device 1 is adjacent to the eSPL. Among them, the special label can be an extension label (XL) with a label value of 15. In the case where the bottom label of the stack is a designated eSPL, the designated eSPL can be defined in a standard or protocol, such as a standard or protocol definition: when the eSPL as the bottom label of the stack takes a designated label value, it indicates that the device identifier is carried after the bottom label of the stack. Optionally, the value range of eSPL is 16 to 1048, and any label value therein may be defined as the designated label value. The embodiment of the present application does not limit the specific value of the designated label value.

[0188] In the EVPN over MPLS scenario, the message payload of the MPLS message transmitted between the network devices in the communication network is a Layer 2 message. In order to prevent the Layer 2 message from being mistakenly identified as an IPv4 message or an IPv6 message by the network devices in the communication network, the network edge devices can negotiate the control word (CW) capability, and the network edge device on the sending side can insert the control word between the MPLS header and the message payload. The length of the control word is 4 bytes, and the control word is usually set to all 0s, so that the intermediate network devices (such as P devices) in the communication network can avoid mistakenly identifying the Layer 2 message as an IPv4 message or an IPv6 message, thereby performing incorrect load sharing and causing message disorder. For a specific explanation of the definition and function of the control word, please refer to the request for comments (RFC) numbered 7432 (abbreviated as: RFC 7432) document, which will not be repeated in the embodiments of the present application.

[0189] Optionally, when device 1 and device 2 are BGP EVPN neighbors, if CW capability is negotiated between device 1 and device 2, device 1 may carry the device identifier of device 1 in the message using the first possible implementation method or the second possible implementation method. Alternatively, device 1 may also carry the device identifier of device 1 in the message using the third possible implementation method. When device 1 uses the first possible implementation method, in order to avoid conflict with the original function of the control word, if the value of the first 4 bits (bits) of the device identifier of device 2 is 4 (corresponding to binary: 0100) or 6 (corresponding to binary: 0110), the value of the first 4 bits of the device identifier may be mapped to non-4 and non-6 to avoid the intermediate network device in the communication network from misidentifying the received layer 2 message as an IPv4 message or an IPv6 message. For example, if the value of the first 4 bits of the device identifier of device 2 is 4, the value of the first 4 bits may be mapped to 14 (corresponding to binary: 1110). If the value of the first 4 bits of the device identifier of device 2 is 6, the value of the first 4 bits may be mapped to 15 (corresponding to binary: 1111).

[0190] Optionally, when device 1 and device 2 are BGP L3VPN neighbors, device 1 may use the third possible implementation to carry the device identifier of device 1 in the message. That is, the third implementation is applicable to both EVPN over MPLS scenarios and MPLS L3VPN scenarios.

[0191] Step 602: Device 1 sends the message to device 2 through the LSP established between device 1 and device 2.

[0192] by Figure 5 Taking the application scenario shown as an example, assuming that host 3 in site 2 and host 1 in site 1 belong to the same private network, when host 3 needs to send a data packet to host 1 across sites, the data packet will pass through CE2, MPLSVPN network and CE1 in sequence, and finally reach host 1. Among them, there are 4 transmission paths from CE2 to CE1 in the MPLS VPN network, including transmission path 1: CE2→PE2→P1→PE1→CE1, transmission path 2: CE2→PE2→P2→PE1→CE1, transmission path 3: CE2→PE3→P1→PE1→CE1, and transmission path 4: CE2→PE3→P2→PE1→CE1. Assume that device 2 is Figure 5 In the application scenario shown, PE1, device 1 is Figure 5 In the application scenario shown, after PE2 receives the data packet sent by CE2, it generates an MPLS packet containing the data packet, and then PE2 sends the generated MPLS packet to PE1. The MPLS packet can be transmitted through transmission path 1 or transmission path 2.

[0193] After receiving the message sent by device 1, device 3 located between device 1 and device 2 continues to send the message to device 2 based on the MPLS protocol.

[0194] Step 603: Device 2 parses the message and obtains the device identification of device 1.

[0195] Optionally, after device 2 receives the message sent by device 3 through the LSP established between device 2 and device 1, it can parse the device identifier of device 1 from the corresponding setting position based on the setting position of the device identifier in the message header determined by negotiation with device 1, or the setting position of the device identifier in the message header defined in the protocol or standard.

[0196] In combination with the first possible implementation manner in step 601 above, device 2 obtains the device identification of device 1 by parsing the control word in the message.

[0197] In combination with the second possible implementation of step 601, device 2 obtains the device identification of device 1 by parsing the field adjacent to the control word in the message. For example, device 2 can parse the 4-byte content adjacent to the control word in the message to obtain the device identification of device 1.

[0198] In combination with the third possible implementation in step 601, device 2 first parses the label stack of the message, and after determining that the bottom label of the label stack indicates that the device identifier is adjacent to the bottom label, device 2 further parses the field adjacent to the bottom label to obtain the device identifier of device 1. For example, device 2 can parse the 4-byte content adjacent to the bottom label in the message to obtain the device identifier of device 1.

[0199] Step 604: Device 2 determines that the message comes from device 1 according to the device identifier.

[0200] Since the message received by device 2 carries the device identifier of device 1, device 2 can determine that the message comes from device 1. Then, traffic statistics can be performed on the message from device 1. Combined with the example in the above step 602, for PE1, after PE1 receives the MPLS message sent by P1 or P2, it can only determine that the MPLS message comes from PE2 or PE3 according to the VPN label in the MPLS message, and can clearly determine that the MPLS message comes from PE2 according to the device identifier of PE2 carried in the MPLS message, that is, PE1 can distinguish whether the traffic comes from PE2 or PE3, and then can achieve accurate statistics of network traffic in the inbound direction.

[0201] Alternatively, device 2 may not perform traffic statistics on the messages from device 1. For example, the obtained device identification and traffic information may be uniformly reported to the control device, and the control device may perform traffic statistics on the messages from different devices according to different device identifications.

[0202] In the message transmission method provided in the embodiment of the present application, when a network device generates a message, it encapsulates the device identification of the network device between the MPLS header and the message payload of the message, and then sends the generated message to other network devices. Since the message received by other network devices carries the device identification of the network device, the other network devices can parse the message to obtain the device identification, and determine that the message is sent by the network device based on the device identification. Therefore, it is possible to achieve accurate statistics of network traffic in a network scenario based on MPLS technology forwarding. For example, in an EVPN overMPLS scenario or an MPLS L3VPN scenario, accurate statistics of network traffic can be achieved.

[0203] Optionally, the ability of device 1 to carry the device identifier of device 1 in the generated MPLS message and the ability of device 2 to parse the device identifier in the received MPLS message can be manually configured. Alternatively, the ability to carry the device identifier of device 1 in the message can also be negotiated between device 1 and device 2. For example, before the execution of the above step 601, device 2 generates capability negotiation information, and the capability negotiation information is used to negotiate between device 1 and device 2 on the ability to carry the device identifier of device 1 in the MPLS message sent by device 1 to device 2, and then device 2 sends the capability negotiation information to device 1. Specifically, the capability negotiation information indicates that device 1 carries the device identifier of device 1 in the message sent to device 2, and that device 2 has the ability to parse the device identifier carried in the message. Optionally, the capability negotiation information also indicates the setting position of the device identifier of device 1 in the message.

[0204] Optionally, after receiving the capability negotiation information sent by device 2, device 1 sends a capability negotiation response to device 2. The capability negotiation response indicates that device 1 has the capability to carry the device identification of device 1 in the message. In this way, device 2 can clearly know whether device 1 has the capability to carry the device identification in the message, which can improve the reliability of capability negotiation.

[0205] Alternatively, device 1 may not respond to the capability negotiation information sent by device 2. After device 2 subsequently receives the message, it can determine by itself whether the designated position of the received message carries the device identification of the network edge device that sent the message. For example, in the first possible implementation method of step 601 above, device 2 can determine whether the control word of the received message is a device identification based on whether the control word of the received message is all 0. If the control word of the message is all 0, device 2 determines that the message does not carry a device identification. If the control word of the message is not all 0, device 2 determines that the control word of the message is the device identification of the network edge device that sent the message.

[0206] Optionally, the capability negotiation information sent by device 2 to device 1 is carried in a BGP update message, for example, it can be carried in an extended group attribute of the BGP update message, that is, device 2 can use the BGP update message to negotiate with device 1 the ability to carry the device identifier of device 1 in the message. Alternatively, the capability negotiation information sent by device 2 to device 1 can also be carried in a message based on other protocols, such as the Path Computation Element Protocol (PCEP). Alternatively, the capability negotiation information sent by device 2 to device 1 can also be carried in a message in a custom format. The following embodiments of the present application are described by taking the example of carrying the capability negotiation information in an extended group attribute of the BGP update message. In the embodiments of the present application, the extended group attribute that carries the capability negotiation information is referred to as the capability negotiation extended group attribute.

[0207] For example, Fig.11 Schematic diagram of the structure of a BGP update message provided by an embodiment of the present application. Fig.11As shown, the BGP update message includes an Ethernet header, an IP header, a Transmission Control Protocol (TCP) header, a BGP data packet, and a frame check sequence (FCS). Among them, the BGP data packet includes a BGP header and a BGP message field. The BGP header includes a maker field, a length field, and a type field (not shown in the figure). The BGP message field includes an address family identifier, a subsequent address family identifier, a length of next hop network address, a next hop network address, a reserved field, network layer reachability information (NLRI), a capability negotiation extended community attribute, and other path attributes. Among them, the address family identifier, the subsequent address family identifier, the length of the next hop network address, the next hop network address, the reserved field, and the NLRI are collectively referred to as a multi-protocol reachable NLRI (MP_REACH_NLRI) attribute. Optionally, the capability negotiation extended group attribute includes a type field, a subtype field, a flag bit field and a reserved field. It can be defined that when the type field and the subtype field of the extended group attribute are a certain value, it means that the extended group attribute is a capability negotiation extended group attribute, that is, the extended group attribute carries the above-mentioned capability negotiation information. In addition, the flag bit field of the capability negotiation extended group attribute can be used to indicate the setting position of the device identifier in the message. Different bits of the flag bit field can be used to indicate different setting positions of the device identifier in the message. The interpretation of other fields in the BGP message field can refer to the definition in the RFC4760 document, and the embodiments of the present application will not be repeated here.

[0208] In the first implementation scenario, device 1 and device 2 belong to the same EVPN, that is, device 1 and device 2 are configured with EVI instances belonging to the same EVPN. In other words, device 1 and device 2 are BGP EVPN neighbors. This implementation scenario is the above-mentioned EVPN over MPLS scenario. Device 2 can send a BGP EVPN route to device 1, and the BGP EVPN route includes a capability negotiation extended community attribute, and the capability negotiation extended community attribute is used to carry capability negotiation information. In other words, capability negotiation information can be published in the BGP EVPN route.

[0209] Optionally, the BGP EVPN route can be a Type 1 route (Ethernet auto-discovery route), a Type 2 route (MAC / IP route) or a Type 3 route (inclusive multicast Ethernet tag route) defined in the BGP NLRI. Among them, the Type 1 route is used to describe the link status and cost of the device. The Type 2 route is used to announce the host MAC address, the host Address Resolution Protocol (ARP) mapping (that is, the correspondence between the IP address and the MAC address) or the host IP address, that is, the Type 2 route can be used to announce Layer 2 routing information and / or Layer 3 routing information. When the Type 2 route is used to announce the host ARP mapping, the Type 2 route can also be called an ARP type route. When the Type 2 route is used to announce the host IP address, the Type 2 route can also be called an integrated routing and bridge (IRB) type route. Type 3 routing is used to establish a BUM (broadcast, unknown-unicast, multicast) tree between network edge devices (such as PE). Of course, the above BGP EVPN routing can also be other types of routing defined in BGP NLRI, or other types of routing that evolve later. The embodiment of the present application does not limit the type of BGP EVPN routing. BGP EVPN routing can be carried in Fig.11 Figure 1 shows the NLRI field in a BGP message.

[0210] In the first possible implementation manner of the first implementation scenario, the capability negotiation information sent by device 2 to device 1 is used to negotiate between device 1 and device 2 the capability of carrying the device identifier of device 1 in the control word of the message.

[0211] Optionally, the control word is a 4-byte control word. The 4-byte control word is used to carry the device identification of device 1. The main idea of ​​this implementation scheme is that device 1 and device 2 negotiate the control word capability, and by carrying the device identification of device 1 in the control word, after the message arrives at device 2, device 2 can determine that the message comes from device 1 by using the control word information.

[0212] Optionally, the capability negotiation information sent by device 2 to device 1 further indicates that the device identification of device 1 is set in the 4-byte control word. For example, taking the length of the tag bit field of the capability negotiation extended community attribute as 16 bits (0 to 15 bits), Fig.12 Schematic diagram of a structure of a capability negotiation extension group attribute provided by an embodiment of the present application. Fig.12 As shown in FIG. 1 , the 15th bit of the tag bit of the capability negotiation extended community attribute is set to 1, and the remaining bits are set to 0, to indicate that the 4-byte control word in the message is set to the device identifier of device 1. In this case, device 1 can generate the following Figure 8 The message shown.

[0213] For example, Figure 5 In the application scenario shown, the MAC address of host 3 is SMAC, and the MAC address of host 1 is DMAC. The destination MAC address of the message sent by host 3 to host 1 is DMAC, and the source MAC address is SMAC. The private network label assigned by PE1 to PE2 and PE3 is Label1. The public network label assigned by P1 is LSP1, and the public network label assigned by P2 is LSP2. The transmission process of the message sent by host 3 to host 1 between CE2 and CE1 can be referred to Fig.13 , Fig.13 This is a schematic diagram of message transmission in an EVPN over MPLS scenario provided by an embodiment of the present application. Figure 2In the example shown, when CE2 sends a message with a destination MAC address of DMAC and a source MAC address of SMAC to CE1, if the message is sent from PE2 to PE1 via P1, the message generated by PE2 will carry the public network label LSP1, the private network label Label1 and the control word (CW), and the control word carries the device identifier of PE2 (CW(PE2)). Accordingly, after PE1 receives the message from PE2, it parses the control word in the message to obtain the device identifier of PE2, and then determines that the message is sent by PE2. If the message is sent from PE3 to PE1 via P2, the message generated by PE3 will carry the public network label LSP2, the private network label Label1 and the control word, and the control word carries the device identifier of PE3. Accordingly, after PE1 receives the message from PE3, it parses the control word in the message to obtain the device identifier of PE3, and then determines that the message is sent by PE3. Therefore, PE1 can support traffic statistics that distinguish PEs in the inbound direction.

[0214] Optionally, the control word is an 8-byte long control word, 4 bytes of which are used to carry the original control word, and the other 4 bytes of which are used to carry the device identification of device 1. The main idea of ​​this implementation scheme is that device 1 and device 2 negotiate the long control word (LCW) capability, the upper 4 bytes of the long control word carry the original control word, and the lower 4 bytes of the long control word carry the device identification of device 1, so that after the message arrives at device 2, device 2 can determine that the message comes from device 1 using the lower 4 bytes of the long control word.

[0215] Optionally, the capability negotiation information sent by device 2 to device 1 further indicates that the device identification of device 1 is set in the lower 4 bytes of the long control word. For example, taking the length of the tag bit field of the capability negotiation extended community attribute as 16 bits (0 to 15 bits), Fig.14 Schematic diagram of another structure of capability negotiation extended group attribute provided by the embodiment of the present application. Fig.14 As shown in FIG. 1 , the 14th bit of the tag bit of the capability negotiation extended community attribute is set to 1, and the remaining bits are set to 0, to indicate that the lower 4 bytes of the long control word in the message are set to the device ID of device 1. In this case, device 1 can generate the following Fig. 9 The message shown.

[0216] For example, Figure 5In the application scenario shown, the MAC address of host 3 is SMAC, and the MAC address of host 1 is DMAC. The destination MAC address of the message sent by host 3 to host 1 is DMAC, and the source MAC address is SMAC. The private network label assigned by PE1 to PE2 and PE3 is Label1. The public network label assigned by P1 is LSP1, and the public network label assigned by P2 is LSP2. The transmission process of the message sent by host 3 to host 1 between CE2 and CE1 can be referred to Fig.15 , Fig.15 This is another schematic diagram of message transmission in an EVPN over MPLS scenario provided by an embodiment of the present application. Figure 2 In the example shown, when CE2 sends a message with a destination MAC address of DMAC and a source MAC address of SMAC to CE1, if the message is sent from PE2 to PE1 via P1, the message generated by PE2 will carry a public network label LSP1, a private network label Label1, and a long control word (LCW), the upper 4 bytes of which carry the original control word (LCW(0)), and the lower 4 bytes of which carry the device identifier of PE2 (LCW(PE2)). Accordingly, after PE1 receives the message from PE2, it parses the lower 4 bytes of the long control word in the message to obtain the device identifier of PE2, and then determines that the message is sent by PE2. If the message is sent from PE3 to PE1 via P2, the message generated by PE3 will carry a public network label LSP2, a private network label Label1, and a long control word (LCW), the upper 4 bytes of which carry the original control word (LCW(0)), and the lower 4 bytes of which carry the device identifier of PE3 (LCW(PE3)). Accordingly, after receiving the message from PE3, PE1 parses the lower 4 bytes of the long control word in the message to obtain the device identifier of PE3, and then determines that the message is sent by PE3. Therefore, PE1 can support traffic statistics distinguishing PEs in the inbound direction.

[0217] In a second possible implementation manner of the first implementation scenario, the capability negotiation information sent by device 2 to device 1 is used to negotiate between device 1 and device 2 the capability of carrying the device identifier of device 1 after the bottom label of the message.

[0218] Optionally, the bottom label is a pre-configured static label, or a dynamic label assigned by device 2, or a specified bSPL. The main idea of ​​this implementation scheme is that device 1 and device 2 negotiate a label indication capability, and the 4 bytes after the bottom label indication label stack carry the device ID of device 1. In this way, after the message arrives at device 2, device 2 can determine that the message comes from device 1 using the 4 bytes after the bottom label.

[0219] Optionally, the capability negotiation information sent by device 2 to device 1 further indicates that the stack bottom label is set to the above-mentioned pre-configured static label, or the dynamic label assigned by device 2, or the specified bSPL, and indicates that the device identifier of device 1 is set to the 4 bytes after the stack bottom label. For example, taking the length of the tag bit field of the capability negotiation extended community attribute as 16 bits (0 to 15 bits), Fig.16 This is a schematic diagram of the structure of another capability negotiation extension group attribute provided by the embodiment of the present application. Fig.16 As shown in FIG. 1 , the 13th bit of the tag bit of the capability negotiation extended community attribute is set to 1, and the remaining bits are set to 0, to indicate that the stack bottom label in the message is set to the specified bSPL, and the 4 bytes after the stack bottom label are set to the device ID of device 1. In this case, device 1 can generate the following Fig.10 In the message shown, the bottom label of the stack is the specified bSPL.

[0220] For example, Figure 5 In the application scenario shown, the MAC address of host 3 is SMAC, and the MAC address of host 1 is DMAC. The destination MAC address of the message sent by host 3 to host 1 is DMAC, and the source MAC address is SMAC. The private network label assigned by PE1 to PE2 and PE3 is Label1. The public network label assigned by P1 is LSP1, and the public network label assigned by P2 is LSP2. The transmission process of the message sent by host 3 to host 1 between CE2 and CE1 can be referred to Fig.17 , Fig.17 This is another schematic diagram of message transmission in an EVPN over MPLS scenario provided by an embodiment of the present application. Figure 2In the example shown, when CE2 sends a message with a destination MAC address of DMAC and a source MAC address of SMAC to CE1, if the message is sent from PE2 to PE1 via P1, the message generated by PE2 will carry the public network label LSP1, the private network label Label1 and the aforementioned bottom label (LabelS), and the 4 bytes after the bottom label carry the device identifier of PE2 (PE2). Accordingly, after PE1 receives the message from PE2, it parses the bottom label of the message to determine that the 4 bytes after the bottom label carry the device identifier, and then obtains the device identifier of PE2 from the 4 bytes after the bottom label, thereby determining that the message is sent by PE2. If the message is sent from PE3 to PE1 via P2, the message generated by PE3 will carry the public network label LSP2, the private network label Label1 and the aforementioned bottom label (LabelS), and the 4 bytes after the bottom label carry the device identifier of PE3 (PE3). Accordingly, after PE1 receives the message from PE3, it parses the bottom label of the message to determine that the 4 bytes after the bottom label carry the device ID, and then obtains the device ID of PE3 from the 4 bytes after the bottom label, and further determines that the message is sent by PE3. Therefore, PE1 can support traffic statistics distinguishing PEs in the inbound direction.

[0221] Optionally, the label at the bottom of the stack is a specified eSPL. When the label stack of the message carries the eSPL, the label stack also carries a special label, which is used to indicate that the subsequent adjacent label is the eSPL. The main idea of ​​this implementation scheme is that device 1 and device 2 negotiate an extended label indication capability, and the 4 bytes after the eSPL indication label stack specified at the bottom of the stack carry the device ID of device 1. In this way, after the message arrives at device 2, device 2 can determine that the message comes from device 1 using the 4 bytes after the label at the bottom of the stack.

[0222] Optionally, the capability negotiation information sent by device 2 to device 1 further indicates that the stack bottom label is set to the specified eSPL, and indicates that the device identifier of device 1 is set to the 4 bytes after the stack bottom label. For example, taking the length of the tag bit field of the capability negotiation extended community attribute as 16 bits (0 to 15 bits), Fig.18 1 is a schematic diagram of a structure of another capability negotiation extension group attribute provided in an embodiment of the present application. Fig.18 As shown in FIG. 1 , by setting the 12th bit of the tag bit of the capability negotiation extended community attribute to 1 and the remaining bits to 0, it is indicated that the stack bottom label in the message is set to the specified eSPL, and an extension label (XL) is set before the eSPL, and the 4 bytes after the stack bottom label are set to the device ID of device 1. In this case, device 1 can generate the following Fig.10 In the message shown, the bottom label of the stack is the specified eSPL.

[0223] For example, Figure 5 In the application scenario shown, the MAC address of host 3 is SMAC, and the MAC address of host 1 is DMAC. The destination MAC address of the message sent by host 3 to host 1 is DMAC, and the source MAC address is SMAC. The private network label assigned by PE1 to PE2 and PE3 is Label1. The public network label assigned by P1 is LSP1, and the public network label assigned by P2 is LSP2. The transmission process of the message sent by host 3 to host 1 between CE2 and CE1 can be referred to Fig.19 , Fig.19 This is another schematic diagram of message transmission in an EVPN over MPLS scenario provided by an embodiment of the present application. Figure 2 In the example shown, when CE2 sends a message with a destination MAC address of DMAC and a source MAC address of SMAC to CE1, if the message is sent from PE2 to PE1 via P1, the message generated by PE2 will carry the public network label LSP1, the private network label Label1, the extended label (XL) and the specified eSPL. The eSPL is the bottom label, and the 4 bytes after the bottom label carry the device identifier of PE2 (PE2). Accordingly, after PE1 receives the message from PE2, it parses the extended label of the message to determine that the extended label carries the eSPL, parses the eSPL as the bottom label to determine that the 4 bytes after the bottom label carry the device identifier, and then obtains the device identifier of PE2 from the 4 bytes after the bottom label, thereby determining that the message is sent by PE2. If the message is sent from PE3 to PE1 via P2, the message generated by PE3 will carry the public network label LSP2, the private network label Label1, the extended label (XL) and the specified eSPL. The eSPL is the bottom label, and the 4 bytes after the bottom label carry the device identifier of PE3 (PE3). Accordingly, after PE1 receives the message from PE3, it parses the extended label of the message to determine that the extended label carries the eSPL, parses the eSPL as the bottom label to determine that the 4 bytes after the bottom label carry the device identifier, and then obtains the device identifier of PE3 from the 4 bytes after the bottom label, thereby determining that the message is sent by PE3. Therefore, PE1 can support traffic statistics that distinguish PEs in the inbound direction.

[0224] In the second implementation scenario, device 1 and device 2 belong to the same L3VPN, that is, device 1 and device 2 are configured with VRF instances belonging to the same L3VPN. In other words, device 1 and device 2 are BGP L3VPN neighbors. This implementation scenario is the above-mentioned MPLS L3VPN scenario. Device 2 can send a BGP L3VPN route to device 1, and the BGP L3VPN route includes a capability negotiation extended group attribute, and the capability negotiation extended group attribute is used to carry capability negotiation information. In other words, capability negotiation information can be published in the L3VPN route. The L3VPN route can be carried in Fig.11 Figure 1 shows the NLRI field in a BGP message.

[0225] In a possible implementation manner under the above-mentioned second implementation scenario, the capability negotiation information sent by device 2 to device 1 is used to negotiate between device 1 and device 2 the capability of carrying the device identifier of device 1 after the bottom label of the stack in the message. Optionally, the bottom label of the stack is a pre-configured static label, or a dynamic label assigned by device 2, or a specified bSPL. Alternatively, the bottom label of the stack is a specified eSPL, and when the label stack of the message carries the eSPL, the label stack also carries a special label, which is used to indicate that the subsequent adjacent label is an eSPL. The specific explanation of this implementation manner can be referred to the second possible implementation manner under the above-mentioned first implementation scenario, and the embodiments of the present application will not be repeated here. It is worth distinguishing that the message transmitted across sites between hosts in the above-mentioned first implementation scenario is a layer 2 message (based on MAC routing), while the message transmitted across sites between hosts in the second implementation scenario is a layer 3 message (based on IP routing).

[0226] The sequence of the steps of the message transmission method provided in the embodiment of the present application can be adjusted appropriately, and the steps can be increased or decreased accordingly. Any technician familiar with the technical field can easily think of a change within the technical scope disclosed in the present application, and all of them should be included in the protection scope of the present application.

[0227] Fig. 20 is a flow chart of another message transmission method provided in an embodiment of the present application, wherein the application scenario of the method includes at least a first device and a second device. For example, the application scenario may be Figure 5 In the application scenario shown, the first device may be, for example, Figure 5 The second device may be, for example, PE2 or PE3. Figure 5 The method can be used to implement Figure 6 The method 600 shown in the corresponding embodiment. Fig. 20 As shown, the method includes but is not limited to the following steps 2001 to 2002.

[0228] Step 2001: A first device generates a message, which includes an MPLS header, a device identifier of the first device, and a message payload, wherein the device identifier is encapsulated between the MPLS header and the message payload.

[0229] Step 2002: The first device sends a message to the second device through the LSP established between the first device and the second device.

[0230] When this method is specifically used to implement the above Figure 6 In the method 600 shown, the first device may be, for example, device 1, and the second device may be, for example, device 2. The specific implementation process of step 2001 to step 2002 may refer to step 601 to step 602 in method 600, and will not be repeated here.

[0231] In a specific implementation, the device identifier of the first device is a router identifier of the first device.

[0232] In a specific implementation, the message includes a control word, and the control word is used to carry a device identifier.

[0233] In a specific implementation, the message includes a control word, and the device identifier is adjacent to the control word.

[0234] In a specific implementation, the bottom label of the MPLS header is used to indicate that the device identifier is adjacent to the bottom label.

[0235] In a specific implementation, the method further includes: the first device receives capability negotiation information sent by the second device, and the capability negotiation information is used to negotiate between the first device and the second device the capability of carrying the device identifier of the first device in the message. The specific implementation process of this step can be referred to Figure 6 The relevant descriptions in the illustrated embodiments will not be repeated here.

[0236] In a specific implementation, the capability negotiation information is used to negotiate between the first device and the second device the capability of carrying the device identifier of the first device in a control word of a message.

[0237] In a specific implementation, the control word is a 4-byte control word.

[0238] In a specific implementation, the control word is an 8-byte long control word, 4 bytes of the long control word are used to carry the original control word, and the other 4 bytes of the long control word are used to carry the device identifier of the first device.

[0239] In a specific implementation, the capability negotiation information is used to negotiate between the first device and the second device the capability of carrying the device identifier of the first device after the bottom label of the message.

[0240] In a specific implementation, the stack bottom label is a pre-configured static label, or a dynamic label allocated by the second device, or a specified bSPL.

[0241] In a specific implementation, the bottom label of the stack is a specified eSPL. When the label stack of the message carries the eSPL, the label stack also carries a special label, and the special label is used to indicate that the subsequent adjacent label is the eSPL.

[0242] In a specific implementation, a first device receives capability negotiation information sent by a second device, including: the first device receives a BGP EVPN route sent by the second device, the BGP EVPN route includes a capability negotiation extended group attribute, and the capability negotiation extended group attribute is used to carry capability negotiation information.

[0243] In a specific implementation, the implementation method of the first device receiving the capability negotiation information sent by the second device includes: the first device receives the BGP L3VPN route sent by the second device, the BGP L3VPN route includes the capability negotiation extended group attribute, and the capability negotiation extended group attribute is used to carry the capability negotiation information.

[0244] In a specific implementation, the first device is an ingress provider edge device (PE), and the second device is an egress provider edge device (PE).

[0245] Fig.21 is a flow chart of another message transmission method provided in an embodiment of the present application, wherein the application scenario of the method includes at least a first device and a second device. For example, the application scenario may be Figure 5 In the application scenario shown, the second device may be, for example, Figure 5 As shown in PE1, the first device may be, for example, Figure 5 PE2 or PE3 shown, the third device may be, for example, Figure 5 The method can be used to implement P1 or P2. Figure 6 The method 600 shown in the corresponding embodiment. Fig.21 As shown, the method includes but is not limited to the following steps 2101 to 2102.

[0246] Step 2101: The second device receives a message sent by a third device through an LSP established between the second device and the first device. The third device is a label switching device located between the first device and the second device on the LSP. The message includes an MPLS header, a device identifier of the first device, and a message payload. The device identifier is encapsulated between the MPLS header and the message payload.

[0247] Step 2102: The second device parses the message to obtain the device identification of the first device.

[0248] When this method is specifically used to implement the above Figure 6 In the method 600 shown, the second device may be, for example, device 2, and the first device may be, for example, device 1. The specific implementation process of step 2101 to step 2102 may refer to step 602 to step 603 in method 600, and will not be repeated here.

[0249] In a specific implementation, the method further includes: the second device determines that the message comes from the first device according to the device identifier of the first device, so as to perform traffic statistics on the message from the first device. The specific implementation process of this step can refer to step 604 in method 600, which will not be repeated here.

[0250] In a specific implementation, the device identifier of the first device is a router identifier of the first device.

[0251] In a specific implementation, the message includes a control word, and the control word is used to carry a device identifier.

[0252] In a specific implementation, the message includes a control word, and the device identifier is adjacent to the control word.

[0253] In a specific implementation, the bottom label of the MPLS header is used to indicate that the device identifier is adjacent to the bottom label.

[0254] In a specific implementation, the method further includes: the second device sends capability negotiation information to the first device, and the capability negotiation information is used to negotiate between the first device and the second device the capability of carrying the device identifier of the first device in the message. Figure 6 The relevant descriptions in the illustrated embodiments will not be repeated here.

[0255] In a specific implementation, the capability negotiation information is used to negotiate between the first device and the second device the capability of carrying the device identifier of the first device in a control word of a message.

[0256] In a specific implementation, the control word is a 4-byte control word.

[0257] In a specific implementation, the control word is an 8-byte long control word, 4 bytes of the long control word are used to carry the original control word, and the other 4 bytes of the long control word are used to carry the device identifier of the first device.

[0258] In a specific implementation, the capability negotiation information is used to negotiate between the first device and the second device the capability of carrying the device identifier of the first device after the bottom label of the message.

[0259] In a specific implementation, the stack bottom label is a pre-configured static label, or a dynamic label allocated by the first device, or a specified bSPL.

[0260] In a specific implementation, the bottom label of the stack is a specified eSPL. When the label stack of the message carries the eSPL, the label stack also carries a special label, and the special label is used to indicate that the subsequent adjacent label is the eSPL.

[0261] In a specific implementation, the implementation method of sending capability negotiation information from the second device to the first device includes: the second device sends a BGP EVPN route to the first device, the BGP EVPN route includes a capability negotiation extended group attribute, and the capability negotiation extended group attribute is used to carry the capability negotiation information.

[0262] In a specific implementation, the second device sends capability negotiation information to the first device by sending a BGP L3VPN route to the first device, where the BGP L3VPN route includes a capability negotiation extended group attribute, and the capability negotiation extended group attribute is used to carry the capability negotiation information.

[0263] In a specific implementation, the first device is an inbound operator edge device, and the second device is an outbound operator edge device.

[0264] Fig. 22 is a flow chart of another message transmission method provided in an embodiment of the present application, wherein the application scenario of the method includes at least a first device and a second device. For example, the application scenario may be Figure 5 In the application scenario shown, the first device may be, for example, Figure 5 The second device may be, for example, PE2 or PE3. Figure 5 The method can be used to implement Figure 6 The method 600 shown in the corresponding embodiment. Fig. 22 As shown, the method includes but is not limited to the following steps 2201.

[0265] Step 2201: A first device receives capability negotiation information sent by a second device, where the capability negotiation information is used to negotiate between the first device and the second device a capability of carrying a device identifier of the first device in an MPLS message sent by the first device to the second device.

[0266] In a specific implementation, the capability negotiation information is used to negotiate between the first device and the second device the capability of carrying the device identifier of the first device in a control word of a message.

[0267] In a specific implementation, the control word is a 4-byte control word.

[0268] In a specific implementation, the control word is an 8-byte long control word, 4 bytes of the long control word are used to carry the original control word, and the other 4 bytes of the long control word are used to carry the device identifier of the first device.

[0269] In a specific implementation, the capability negotiation information is used to negotiate between the first device and the second device the capability of carrying the device identifier of the first device after the bottom label of the message.

[0270] In a specific implementation, the stack bottom label is a pre-configured static label, or a dynamic label allocated by the second device, or a specified bSPL.

[0271] In a specific implementation, the bottom label of the stack is a specified eSPL. When the label stack of the message carries the eSPL, the label stack also carries a special label, and the special label is used to indicate that the subsequent adjacent label is the eSPL.

[0272] In a specific implementation, a method for a first device to receive capability negotiation information sent by a second device includes: the first device receives a BGP EVPN route sent by the second device, the BGP EVPN route includes a capability negotiation extended group attribute, and the capability negotiation extended group attribute is used to carry capability negotiation information.

[0273] In a specific implementation, the implementation method of the first device receiving the capability negotiation information sent by the second device includes: the first device receives a BGP L3VPN route sent by the second device, the BGP L3VPN route includes a capability negotiation extended group attribute, and the capability negotiation extended group attribute is used to carry the capability negotiation information.

[0274] In a specific implementation, the first device sends a capability negotiation response to the second device.

[0275] In a specific implementation, the first device is an inbound operator edge device, and the second device is an outbound operator edge device.

[0276] Fig.23 is a flow chart of another message transmission method provided in an embodiment of the present application, wherein the application scenario of the method includes at least a first device and a second device. For example, the application scenario may be Figure 5 In the application scenario shown, the second device may be, for example, Figure 5 As shown in PE1, the first device may be, for example, Figure 5 The method can be used to implement PE2 or PE3. Figure 6 The method 600 shown in the corresponding embodiment. Fig.23 As shown, the method includes but is not limited to the following steps 2301 to 2302.

[0277] Step 2301: The second device generates capability negotiation information, where the capability negotiation information is used to negotiate between the first device and the second device a capability of carrying a device identifier of the first device in an MPLS message sent by the first device to the second device.

[0278] Step 2302: The second device sends the capability negotiation information to the first device.

[0279] In a specific implementation, the capability negotiation information is used to negotiate between the first device and the second device the capability of carrying the device identifier of the first device in a control word of a message.

[0280] In a specific implementation, the control word is a 4-byte control word.

[0281] In a specific implementation, the control word is an 8-byte long control word, 4 bytes of the long control word are used to carry the original control word, and the other 4 bytes of the long control word are used to carry the device identifier of the first device.

[0282] In a specific implementation, the capability negotiation information is used to negotiate between the first device and the second device the capability of carrying the device identifier of the first device after the bottom label of the message.

[0283] In a specific implementation, the stack bottom label is a pre-configured static label, or a dynamic label allocated by the first device, or a specified bSPL.

[0284] In a specific implementation, the bottom label of the stack is a specified eSPL. When the label stack of the message carries the eSPL, the label stack also carries a special label, and the special label is used to indicate that the subsequent adjacent label is the eSPL.

[0285] In a specific implementation, the second device sends capability negotiation information to the first device, including: the second device sends a BGP EVPN route to the first device, the BGP EVPN route includes a capability negotiation extended group attribute, and the capability negotiation extended group attribute is used to carry the capability negotiation information.

[0286] In a specific implementation, the second device sends capability negotiation information to the first device, including: the second device sends a BGP L3VPN route to the first device, the BGP L3VPN route includes a capability negotiation extended group attribute, and the capability negotiation extended group attribute is used to carry the capability negotiation information.

[0287] In a specific implementation, the first device receives a capability negotiation response sent by the second device.

[0288] In a specific implementation, the first device is an inbound operator edge device, and the second device is an outbound operator edge device.

[0289] The following is an example of a virtual device according to an embodiment of the present application.

[0290] Fig.24is a structural diagram of a message transmission device provided in an embodiment of the present application. The message transmission device is, for example, a first device. Fig.24 As shown, the message transmission device 2400 includes but is not limited to a processing module 2401 and a sending module 2402. Optionally, the message transmission device 2400 further includes a receiving module 2403.

[0291] The processing module 2401 is used to generate a message, the message includes an MPLS header, a device identifier of the first device and a message payload, and the device identifier is encapsulated between the MPLS header and the message payload. The sending module 2402 is used to send a message to the second device through the LSP established between the first device and the second device.

[0292] In a specific implementation, the device identifier of the first device is a router identifier of the first device.

[0293] In a specific implementation, the message includes a control word, and the control word is used to carry a device identifier.

[0294] In a specific implementation, the message includes a control word, and the device identifier is adjacent to the control word.

[0295] In a specific implementation, the bottom label of the MPLS header is used to indicate that the device identifier is adjacent to the bottom label.

[0296] In a specific implementation, the receiving module 2403 is used to receive capability negotiation information sent by the second device, where the capability negotiation information is used to negotiate between the first device and the second device the capability of carrying the device identifier of the first device in a message.

[0297] In a specific implementation, the capability negotiation information is used to negotiate between the first device and the second device the capability of carrying the device identifier of the first device in a control word of a message.

[0298] In a specific implementation, the control word is a 4-byte control word.

[0299] In a specific implementation, the control word is an 8-byte long control word, 4 bytes of the long control word are used to carry the original control word, and the other 4 bytes of the long control word are used to carry the device identifier of the first device.

[0300] In a specific implementation, the capability negotiation information is used to negotiate between the first device and the second device the capability of carrying the device identifier of the first device after the bottom label of the message.

[0301] In a specific implementation, the stack bottom label is a pre-configured static label, or a dynamic label allocated by the second device, or a specified bSPL.

[0302] In a specific implementation, the bottom label of the stack is a specified eSPL. When the label stack of the message carries the eSPL, the label stack also carries a special label, and the special label is used to indicate that the subsequent adjacent label is the eSPL.

[0303] In a specific implementation, the receiving module 2403 is specifically configured to receive a BGP EVPN route sent by the second device, where the BGP EVPN route includes a capability negotiation extended community attribute, and the capability negotiation extended community attribute is used to carry capability negotiation information.

[0304] In a specific implementation, the receiving module 2403 is specifically configured to receive a BGP L3VPN route sent by the second device, where the BGP L3VPN route includes a capability negotiation extended community attribute, and the capability negotiation extended community attribute is used to carry capability negotiation information.

[0305] In a specific implementation, the first device is an inbound operator edge device, and the second device is an outbound operator edge device.

[0306] Fig.25 is a schematic diagram of the structure of another message transmission device provided in an embodiment of the present application. The message transmission device is, for example, a first device. Fig.25 As shown, the message transmission device 2500 includes but is not limited to a receiving module 2501 and a processing module 2502. Optionally, the message transmission device 2500 further includes a sending module 2503.

[0307] The receiving module 2501 is used to receive a message sent by a third device through an LSP established between the second device and the first device, where the third device is a label switching device located between the first device and the second device on the LSP, and the message includes an MPLS header, a device identifier of the first device, and a message payload, where the device identifier is encapsulated between the MPLS header and the message payload. The processing module 2502 is used to parse the message to obtain the device identifier of the first device.

[0308] In a specific implementation, the processing module 2502 is further configured to determine, according to the device identifier of the first device, that the message comes from the first device, so as to perform traffic statistics on the message from the first device.

[0309] In a specific implementation, the device identifier of the first device is a router identifier of the first device.

[0310] In a specific implementation, the message includes a control word, and the control word is used to carry a device identifier.

[0311] In a specific implementation, the message includes a control word, and the device identifier is adjacent to the control word.

[0312] In a specific implementation, the bottom label of the MPLS header is used to indicate that the device identifier is adjacent to the bottom label.

[0313] In a specific implementation, the sending module 2503 is used to send capability negotiation information to the first device, where the capability negotiation information is used to negotiate between the first device and the second device the capability of carrying the device identifier of the first device in a message.

[0314] In a specific implementation, the capability negotiation information is used to negotiate between the first device and the second device the capability of carrying the device identifier of the first device in a control word of a message.

[0315] In a specific implementation, the control word is a 4-byte control word.

[0316] In a specific implementation, the control word is an 8-byte long control word, 4 bytes of the long control word are used to carry the original control word, and the other 4 bytes of the long control word are used to carry the device identifier of the first device.

[0317] In a specific implementation, the capability negotiation information is used to negotiate between the first device and the second device the capability of carrying the device identifier of the first device after the bottom label of the message.

[0318] In a specific implementation, the stack bottom label is a pre-configured static label, or a dynamic label allocated by the first device, or a specified bSPL.

[0319] In a specific implementation, the bottom label of the stack is a specified eSPL. When the label stack of the message carries the eSPL, the label stack also carries a special label, and the special label is used to indicate that the subsequent adjacent label is the eSPL.

[0320] In a specific implementation, the sending module 2503 is specifically configured to send a BGP EVPN route to the first device, where the BGP EVPN route includes a capability negotiation extended community attribute, and the capability negotiation extended community attribute is used to carry capability negotiation information.

[0321] In a specific implementation, the sending module 2503 is specifically used to send a BGP L3VPN route to the first device, where the BGP L3VPN route includes a capability negotiation extended community attribute, and the capability negotiation extended community attribute is used to carry capability negotiation information.

[0322] In a specific implementation, the first device is an inbound operator edge device, and the second device is an outbound operator edge device.

[0323] Fig.26 is a structural diagram of another message transmission device provided in an embodiment of the present application. The message transmission device is, for example, a first device. Fig.26As shown, the message transmission device 2600 includes but is not limited to a receiving module 2601. Optionally, the message transmission device 2600 further includes a sending module 2602.

[0324] The receiving module 2601 is used to receive capability negotiation information sent by the second device, where the capability negotiation information is used to negotiate between the first device and the second device a capability of carrying a device identifier of the first device in an MPLS message sent by the first device to the second device.

[0325] In a specific implementation, the capability negotiation information is used to negotiate between the first device and the second device the capability of carrying the device identifier of the first device in a control word of a message.

[0326] In a specific implementation, the control word is a 4-byte control word.

[0327] In a specific implementation, the control word is an 8-byte long control word, 4 bytes of the long control word are used to carry the original control word, and the other 4 bytes of the long control word are used to carry the device identifier of the first device.

[0328] In a specific implementation, the capability negotiation information is used to negotiate between the first device and the second device the capability of carrying the device identifier of the first device after the bottom label of the message.

[0329] In a specific implementation, the stack bottom label is a pre-configured static label, or a dynamic label allocated by the second device, or a specified bSPL.

[0330] In a specific implementation, the bottom label of the stack is a specified eSPL. When the label stack of the message carries the eSPL, the label stack also carries a special label, and the special label is used to indicate that the subsequent adjacent label is the eSPL.

[0331] In a specific implementation, the receiving module 2601 is specifically configured to receive a BGP EVPN route sent by the second device, where the BGP EVPN route includes a capability negotiation extended community attribute, and the capability negotiation extended community attribute is used to carry capability negotiation information.

[0332] In a specific implementation, the receiving module 2601 is specifically configured to receive a BGP L3VPN route sent by the second device, where the BGP L3VPN route includes a capability negotiation extended community attribute, and the capability negotiation extended community attribute is used to carry capability negotiation information.

[0333] In a specific implementation, the sending module 2602 is configured to send a capability negotiation response to the second device.

[0334] In a specific implementation, the first device is an inbound operator edge device, and the second device is an outbound operator edge device.

[0335] Fig. 27 is a structural diagram of another message transmission device provided in an embodiment of the present application. The message transmission device is, for example, a first device. Fig. 27 As shown, the message transmission device 2700 includes but is not limited to a processing module 2701 and a sending module 2702. Optionally, the message transmission device 2700 further includes a receiving module 2703.

[0336] The processing module 2701 is used to generate capability negotiation information, which is used to negotiate between the first device and the second device about the capability of carrying the device identifier of the first device in the MPLS message sent by the first device to the second device. The sending module 2702 is used to send the capability negotiation information to the first device.

[0337] In a specific implementation, the capability negotiation information is used to negotiate between the first device and the second device the capability of carrying the device identifier of the first device in a control word of a message.

[0338] In a specific implementation, the control word is a 4-byte control word.

[0339] In a specific implementation, the control word is an 8-byte long control word, 4 bytes of the long control word are used to carry the original control word, and the other 4 bytes of the long control word are used to carry the device identifier of the first device.

[0340] In a specific implementation, the capability negotiation information is used to negotiate between the first device and the second device the capability of carrying the device identifier of the first device after the bottom label of the message.

[0341] In a specific implementation, the stack bottom label is a pre-configured static label, or a dynamic label allocated by the first device, or a specified bSPL.

[0342] In a specific implementation, the bottom label of the stack is a specified eSPL. When the label stack of the message carries the eSPL, the label stack also carries a special label, and the special label is used to indicate that the subsequent adjacent label is the eSPL.

[0343] In a specific implementation, the sending module 2702 is specifically configured to send a BGP EVPN route to the first device, where the BGP EVPN route includes a capability negotiation extended community attribute, where the capability negotiation extended community attribute is used to carry capability negotiation information.

[0344] In a specific implementation, the sending module 2702 is specifically configured to send a BGP L3VPN route to the first device, where the BGP L3VPN route includes a capability negotiation extended community attribute, where the capability negotiation extended community attribute is used to carry capability negotiation information.

[0345] In a specific implementation, the receiving module 2703 is configured to receive a capability negotiation response sent by the first device.

[0346] In a specific implementation, the first device is an inbound operator edge device, and the second device is an outbound operator edge device.

[0347] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0348] The following is an illustration of the hardware structure involved in the embodiments of the present application.

[0349] Fig.28 2 is a block diagram of a message transmission device 2800 provided in an embodiment of the present application. The message transmission device 2800 is a network device. In one implementation, the message transmission device 2800 may be a network edge device. Fig.28 As shown, the device 2800 includes: a processor 2801 and a memory 2802 .

[0350] Memory 2802, for storing computer readable instructions;

[0351] Processor 2801 is used to call the computer readable instructions and execute the following according to the instructions of the computer readable instructions: Figure 6 All operations in the method 600 are performed by device 1 or device 2.

[0352] In a specific implementation manner, the device 2800 may further include a communication interface 2803. The memory 2802, the processor 2801 and the communication interface 2803 are communicatively connected with each other.

[0353] Fig.29 2 is a block diagram of another message transmission device 2900 provided in an embodiment of the present application. The message transmission device 2900 is a network device. In one implementation, the message transmission device 2900 may be a network edge device. Fig.29 As shown, the device 2900 includes: a communication interface 2901; and a processor 2902 connected to the communication interface 2901. According to the communication interface 2901 and the processor 2902, the message transmission device 2900 can perform the following Figure 6 All operations performed by device 1 or device 2 in method 600 shown in FIG. 2901 are used to implement the sending and receiving operations, and processor 2902 is used to implement operations other than sending and receiving. For example, when device 2900 is Figure 6 In the device 1 in the method shown, the communication interface 2901 is used to send a message to the device 2, and the processor 2902 is used to generate a message.

[0354] In the embodiment of the present application, the processor may be a central processing unit (CPU). The processor may include one or more processing cores, and the processor executes various functional applications and data processing by running computer programs. The processor may be connected to the memory and the communication interface through a communication bus.

[0355] The processor may further include a hardware chip. The hardware chip may be an application specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof. In a specific implementation, the hardware chip may be used to implement encryption / decryption operations.

[0356] The memory may include volatile memory, such as random access memory (RAM). The memory may also include non-volatile memory, such as flash memory, hard disk drive (HDD) or solid-state drive (SSD). The memory may also include a combination of the above types of memory.

[0357] There may be multiple communication interfaces, and the communication interfaces are used to communicate with other devices. The communication interface may include a wired communication interface, a wireless communication interface, or a combination thereof. Among them, the wired communication interface may be, for example, an Ethernet interface. The Ethernet interface may be an optical interface, an electrical interface, or a combination thereof. The wireless communication interface may be a wireless local area network (WLAN) interface, a cellular network communication interface, or a combination thereof, etc.

[0358] In the above embodiments, it can be implemented in whole or in part by hardware, firmware or any combination thereof. When software is involved in the specific implementation process, it can be embodied 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 the embodiment of the present 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 by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital video disc (DVD)), or a semiconductor medium (eg, an SSD), etc.

[0359] The following is an example of the system of the embodiment of the present application.

[0360] The embodiment of the present application also provides a message transmission system, including: a first device and a second device, the first device can be, for example, Figure 6 In the method 600 shown in FIG. 1 , the second device may be, for example, Figure 6 The device 2 in the method 600 shown. Alternatively, the first device may be, for example Fig.24 In the message transmission apparatus 2400 shown, the second device may be, for example, Fig.25 Alternatively, the first device may be, for example, Fig.26 In the message transmission apparatus 2600 shown, the second device may be, for example, Fig. 27 A message transmission apparatus 2700 is shown.

[0361] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0362] In the embodiments of the present application, the terms “first”, “second” and “third” are used for descriptive purposes only and should not be understood as indicating or implying relative importance.

[0363] The term "and / or" in this application is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0364] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

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

Claims

1. A message transmission method, characterized in that: The method comprises: The first device generates a message, wherein the message includes a multi-protocol label switching (MPLS) header, a device identifier of the first device, and a message payload, wherein the device identifier is encapsulated between the MPLS header and the message payload; The first device sends the message to the second device.

2. The method according to claim 1, characterized in that The device identifier of the first device is a router identifier of the first device.

3. The method according to claim 1 or 2, characterized in that: The message includes a control word, and the control word is used to carry the device identifier.

4. The method according to claim 1 or 2, characterized in that: The message includes a control word, and the device identifier is adjacent to the control word.

5. The method according to claim 1 or 2, characterized in that: The stack bottom label of the MPLS header is used to indicate that the device identifier is adjacent to the stack bottom label.

6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: The first device receives capability negotiation information sent by the second device, where the capability negotiation information is used to negotiate between the first device and the second device a capability of carrying a device identifier of the first device in a message.

7. The method according to claim 6, characterized in that The capability negotiation information is used to negotiate between the first device and the second device a capability of carrying a device identifier of the first device in a control word of a message.

8. The method according to claim 7, characterized in that The control word is a 4-byte control word.

9. The method according to claim 7, characterized in that: The control word is an 8-byte long control word, 4 bytes of the long control word are used to carry the original control word, and the other 4 bytes of the long control word are used to carry the device identification of the first device.

10. The method according to claim 6, characterized in that The capability negotiation information is used to negotiate between the first device and the second device a capability of carrying the device identifier of the first device after the stack bottom label of the message.

11. The method according to claim 10, characterized in that The stack bottom label is a pre-configured static label, or a dynamic label allocated by the second device, or a designated basic special purpose label bSPL.

12. The method according to claim 10, characterized in that The bottom label of the stack is a designated extended special-purpose label eSPL. When the label stack of the message carries the eSPL, the label stack also carries a special label. The special label is used to indicate that the subsequent adjacent label is the eSPL.

13. The method according to any one of claims 6 to 12, characterized in that: The first device receiving the capability negotiation information sent by the second device includes: The first device receives a Border Gateway Protocol Ethernet Virtual Private Network BGP EVPN route sent by the second device, where the BGP EVPN route includes a capability negotiation extended community attribute, and the capability negotiation extended community attribute is used to carry the capability negotiation information.

14. The method according to any one of claims 6, 10-12, characterized in that: The first device receiving the capability negotiation information sent by the second device includes: The first device receives a Border Gateway Protocol Layer 3 Virtual Private Network (BGP L3VPN) route sent by the second device, where the BGP L3VPN route includes a capability negotiation extended community attribute, and the capability negotiation extended community attribute is used to carry the capability negotiation information.

15. The method according to any one of claims 1 to 14, characterized in that: The first device is an ingress provider edge device (PE), and the second device is an egress provider edge device (PE).

16. A message transmission method, characterized in that: The method comprises: The second device receives a message sent by a third device through a label switching path LSP established between the second device and the first device, the third device being a label switching device located between the first device and the second device on the LSP, the message comprising a multi-protocol label switching MPLS header, a device identifier of the first device, and a message payload, the device identifier being encapsulated between the MPLS header and the message payload; The second device parses the message to obtain the device identification of the first device.

17. The method according to claim 16, characterized in that The method further comprises: The second device determines, according to the device identifier of the first device, that the message comes from the first device, so as to perform traffic statistics on the message from the first device.

18. The method according to claim 16 or 17, characterized in that The device identifier of the first device is a router identifier of the first device.

19. The method according to any one of claims 16 to 18, characterized in that: The message includes a control word, and the control word is used to carry the device identifier.

20. The method according to any one of claims 16 to 18, characterized in that: The message includes a control word, and the device identifier is adjacent to the control word.

21. The method according to any one of claims 16 to 18, characterized in that: The stack bottom label of the MPLS header is used to indicate that the device identifier is adjacent to the stack bottom label.

22. The method according to any one of claims 16 to 21, characterized in that: The method further comprises: The second device sends capability negotiation information to the first device, where the capability negotiation information is used to negotiate between the first device and the second device a capability of carrying a device identifier of the first device in a message.

23. The method according to claim 22, characterized in that The capability negotiation information is used to negotiate between the first device and the second device a capability of carrying a device identifier of the first device in a control word of a message.

24. The method according to claim 23, characterized in that The control word is a 4-byte control word.

25. The method according to claim 23, characterized in that The control word is an 8-byte long control word, 4 bytes of the long control word are used to carry the original control word, and the other 4 bytes of the long control word are used to carry the device identification of the first device.

26. The method according to claim 22, characterized in that The capability negotiation information is used to negotiate between the first device and the second device a capability of carrying the device identifier of the first device after the stack bottom label of the message.

27. The method according to claim 26, characterized in that The stack bottom label is a pre-configured static label, or a dynamic label allocated by the second device, or a designated basic special purpose label bSPL.

28. The method according to claim 26, characterized in that The bottom label of the stack is a designated extended special-purpose label eSPL. When the label stack of the message carries the eSPL, the label stack also carries a special label. The special label is used to indicate that the subsequent adjacent label is the eSPL.

29. The method according to any one of claims 22 to 28, characterized in that: The second device sending capability negotiation information to the first device includes: The second device sends a Border Gateway Protocol Ethernet Virtual Private Network BGP EVPN route to the first device, where the BGP EVPN route includes a capability negotiation extended community attribute, and the capability negotiation extended community attribute is used to carry the capability negotiation information.

30. The method according to any one of claims 22, 26-28, characterized in that: The second device sending capability negotiation information to the first device includes: The second device sends a Border Gateway Protocol Layer 3 Virtual Private Network (BGP L3VPN) route to the first device, where the BGP L3VPN route includes a capability negotiation extended community attribute, and the capability negotiation extended community attribute is used to carry the capability negotiation information.

31. The method according to any one of claims 16 to 30, characterized in that: The first device is an ingress provider edge device (PE), and the second device is an egress provider edge device (PE).

32. A message transmission method, characterized in that: The method comprises: The first device receives capability negotiation information sent by the second device, where the capability negotiation information is used to negotiate between the first device and the second device a capability of carrying a device identifier of the first device in a Multi-Protocol Label Switching (MPLS) message sent by the first device to the second device.

33. A message transmission method, characterized in that: The method comprises: The second device generates capability negotiation information, where the capability negotiation information is used to negotiate between the first device and the second device a capability of carrying a device identifier of the first device in a multi-protocol label switching MPLS message sent by the first device to the second device; The second device sends the capability negotiation information to the first device.

34. A message transmission system, characterized in that: include: A first device and a second device, wherein the first device is used to execute the method according to any one of claims 1 to 15, and the second device is used to execute the method according to any one of claims 16 to 31; or, the first device is used to execute the method according to claim 32, and the second device is used to execute the method according to claim 33.

35. A network device, characterized in that: include: Communication interface; as well as a processor connected to the communication interface; According to the communication interface and the processor, the method according to any one of claims 1 to 33 is implemented.

36. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed by the processor, the method according to any one of claims 1 to 33 is implemented.

37. A computer program product, characterized in that The method comprises a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 33.