[go: up one dir, main page]

WO2024244974A1 - Packet transmission method and apparatus, and system - Google Patents

Packet transmission method and apparatus, and system Download PDF

Info

Publication number
WO2024244974A1
WO2024244974A1 PCT/CN2024/093302 CN2024093302W WO2024244974A1 WO 2024244974 A1 WO2024244974 A1 WO 2024244974A1 CN 2024093302 W CN2024093302 W CN 2024093302W WO 2024244974 A1 WO2024244974 A1 WO 2024244974A1
Authority
WO
WIPO (PCT)
Prior art keywords
message
label
control word
capability negotiation
identifier
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
PCT/CN2024/093302
Other languages
French (fr)
Chinese (zh)
Inventor
朱彤
王海波
杨平安
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Publication of WO2024244974A1 publication Critical patent/WO2024244974A1/en
Anticipated expiration legal-status Critical
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0876Network utilisation, e.g. volume of load or congestion level
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/14Network analysis or design
    • H04L41/142Network analysis or design using statistical or mathematical methods
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/50Routing or path finding of packets in data switching networks using label swapping, e.g. multi-protocol label switch [MPLS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/06Notations for structuring of protocol data, e.g. abstract syntax notation one [ASN.1]

Definitions

  • the present application relates to the field of network technology, and in particular to a message transmission method, device and system.
  • 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.
  • MPLS multiprotocol label switching
  • EVPN Ethernet virtual private network
  • L3VPN layer 3 virtual private network
  • MPLS L3VPN MPLS L3VPN
  • the present application provides a message transmission method, device and system.
  • a message transmission 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 the message to the second device through a label switched path (LSP) established between the first device and the second device.
  • LSP label switched path
  • the first device 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 that the ingress device of the message on the label switching path is 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.
  • the device identifier of the first device is a router identifier of the first device.
  • 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.
  • 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.
  • the bottom label of the MPLS header is used to indicate that the device identifier is adjacent to the bottom label.
  • the bottom label can independently indicate that the device identifier is adjacent to the bottom label.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • control word is an 8-byte long control word
  • 4 bytes of the long control word are used to carry the original control word
  • the other 4 bytes of the long control word are used to carry the device identification of the first device.
  • the upper 4 bytes of the long control word are used to carry the original control word
  • 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.
  • 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.
  • 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).
  • bSPL base special-purpose label
  • the label at the bottom of the stack is a designated extended special-purpose label (eSPL).
  • eSPL extended special-purpose label
  • 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. In this way, after the message arrives at the second device, the second device can determine that the message comes from the first device by using the 4 bytes after the label at the bottom of the stack.
  • a first device receives capability negotiation information sent by a 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.
  • BGP border gateway protocol
  • This application can be applied to EVPN over MPLS scenarios, and capability negotiation information can be published in BGP EVPN routing.
  • a first device receives capability negotiation information sent by a 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.
  • This application can be applied to MPLS L3VPN scenarios, and capability negotiation information can be published in L3VPN routing.
  • 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.
  • 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.
  • the first device is an inbound operator edge device
  • the second device is an outbound operator edge device
  • a message transmission 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.
  • 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 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.
  • 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 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 the network traffic in the ingress direction.
  • the device identifier of the first device is a router identifier of the first device.
  • the message includes a control word, and the control word is used to carry a device identifier.
  • the message includes a control word, and the device identifier is adjacent to the control word.
  • the bottom label of the MPLS header is used to indicate that the device identifier is adjacent to the bottom label.
  • 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.
  • 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.
  • control word is a 4-byte control word.
  • 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.
  • 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.
  • the stack bottom label is a pre-configured static label, or a dynamic label allocated by the second device, or a specified bSPL.
  • the bottom label of the stack is a specified eSPL.
  • 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.
  • the method for the second device to send capability negotiation information 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.
  • the method for the second device to send capability negotiation information to the first device includes: the second device sends a BGP L3VPN route to the first device, and 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.
  • the second device receives a capability negotiation response sent by the first device.
  • the first device is an inbound operator edge device
  • the second device is an outbound operator edge device
  • a message transmission method 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.
  • 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.
  • 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.
  • control word is a 4-byte control word.
  • 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.
  • 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.
  • the stack bottom label is a pre-configured static label, or a dynamic label allocated by the second device, or a specified bSPL.
  • the bottom label of the stack is a specified eSPL.
  • 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.
  • 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 the capability negotiation information.
  • a method for a first device to receive capability negotiation information sent by a 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.
  • the first device sends a capability negotiation response to the second device.
  • the first device is an inbound operator edge device
  • the second device is an outbound operator edge device
  • a message transmission method includes: a second device generates capability negotiation information, and the capability negotiation information is used The first device and the second device are used to negotiate 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.
  • 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.
  • control word is a 4-byte control word.
  • 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.
  • 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.
  • the stack bottom label is a pre-configured static label, or a dynamic label allocated by the second device, or a specified bSPL.
  • the bottom label of the stack is a specified eSPL.
  • 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.
  • the method for the second device to send capability negotiation information 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.
  • the method for the second device to send capability negotiation information to the first device includes: the second device sends a BGP L3VPN route to the first device, and 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.
  • the second device receives a capability negotiation response sent by the first device.
  • the first device is an inbound operator edge device
  • the second device is an outbound operator edge device
  • a first device in a fifth aspect, 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.
  • 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.
  • the device identifier of the first device is a router identifier of the first device.
  • the message includes a control word, and the control word is used to carry a device identifier.
  • the message includes a control word, and the device identifier is adjacent to the control word.
  • the bottom label of the MPLS header is used to indicate that the device identifier is adjacent to the bottom label.
  • 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.
  • 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.
  • control word is a 4-byte control word.
  • 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.
  • 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.
  • the stack bottom label is a pre-configured static label, or a dynamic label allocated by the second device, or a specified bSPL.
  • the bottom label of the stack is a specified eSPL.
  • 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.
  • 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 group attribute, and the capability negotiation extended group attribute is used to carry capability negotiation information.
  • 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.
  • the first device is an inbound operator edge device
  • the second device is an outbound operator edge device
  • a second device in a sixth aspect, 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.
  • 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.
  • 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.
  • the device identifier of the first device is a router identifier of the first device.
  • the message includes a control word, and the control word is used to carry a device identifier.
  • the message includes a control word, and the device identifier is adjacent to the control word.
  • the bottom label of the MPLS header is used to indicate that the device identifier is adjacent to the bottom label.
  • 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.
  • 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.
  • control word is a 4-byte control word.
  • 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.
  • 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.
  • the stack bottom label is a pre-configured static label, or a dynamic label allocated by the first device, or a specified bSPL.
  • the bottom label of the stack is a specified eSPL.
  • 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.
  • 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 group attribute, and the capability negotiation extended group attribute is used to carry capability negotiation information.
  • 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 group attribute, and the capability negotiation extended group attribute is used to carry capability negotiation information.
  • the first device is an inbound operator edge device
  • the second device is an outbound operator edge device
  • a first device in the seventh aspect, 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.
  • the multiple functional modules also include a sending module.
  • 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.
  • 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.
  • control word is a 4-byte control word.
  • 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.
  • 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.
  • the stack bottom label is a pre-configured static label, or a dynamic label allocated by the second device, or a specified bSPL.
  • the bottom label of the stack is a specified eSPL.
  • 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.
  • the receiving module is specifically used to receive a BGP EVPN route sent by a second device, where 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.
  • the receiving module is specifically used to receive a BGP L3VPN route sent by a second device, where 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.
  • the sending module is used to send a capability negotiation response to the second device.
  • the first device is an inbound operator edge device
  • the second device is an outbound operator edge device
  • a second device in an eighth aspect, 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.
  • 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.
  • 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.
  • control word is a 4-byte control word.
  • 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.
  • 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.
  • the stack bottom label is a pre-configured static label, or a dynamic label allocated by the first device, or a specified bSPL.
  • the bottom label of the stack is a specified eSPL.
  • 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.
  • the sending module is specifically used to send a BGP EVPN route to a first device, where 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.
  • 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 group attribute, and the capability negotiation extended group attribute is used to carry capability negotiation information.
  • the receiving module is used to receive a capability negotiation response sent by the first device.
  • the first device is an inbound operator edge device
  • the second device is an outbound operator edge device
  • a message transmission system 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.
  • a network device 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.
  • a computer-readable storage medium on which instructions are stored.
  • 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.
  • a computer program product including a computer program.
  • the 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.
  • a chip which includes a programmable logic circuit and/or program instructions.
  • the chip 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.
  • FIG1 is a schematic diagram of publishing MAC addresses in an EVPN over MPLS scenario in the related art
  • FIG2 is a schematic diagram of message transmission in an EVPN over MPLS scenario in the related art
  • FIG3 is a schematic diagram of issuing IP addresses in an MPLS L3VPN scenario in the related art
  • FIG4 is a schematic diagram of message transmission in an MPLS L3VPN scenario in the related art
  • FIG5 is a schematic diagram of an application scenario provided by an embodiment of the present application.
  • FIG6 is a flow chart of a message transmission method provided in an embodiment of the present application.
  • FIG. 7 is a schematic diagram of the structure of an MPLS message provided in an embodiment of the present application.
  • FIG8 is a schematic diagram of the structure of another MPLS message provided in an embodiment of the present application.
  • FIG9 is a schematic diagram of the structure of another MPLS message provided in an embodiment of the present application.
  • FIG. 10 is a schematic diagram of the structure of another MPLS message provided in an embodiment of the present application.
  • FIG. 11 is a schematic diagram of the structure of a BGP update message provided in an embodiment of the present application.
  • FIG. 12 is a schematic diagram of the structure of a capability negotiation extended group attribute provided in an embodiment of the present application.
  • FIG13 is a schematic diagram of message transmission in an EVPN over MPLS scenario provided by an embodiment of the present application.
  • FIG. 14 is a schematic diagram of the structure of another capability negotiation extended group attribute provided in an embodiment of the present application.
  • FIG15 is another schematic diagram of message transmission in an EVPN over MPLS scenario provided by an embodiment of the present application.
  • 16 is a schematic diagram of the structure of another capability negotiation extended group attribute provided in an embodiment of the present application.
  • FIG17 is another schematic diagram of message transmission in an EVPN over MPLS scenario provided by an embodiment of the present application.
  • FIG. 18 is a schematic diagram of the structure of another capability negotiation extended group attribute provided in an embodiment of the present application.
  • FIG19 is a schematic diagram of another message transmission in an EVPN over MPLS scenario provided by an embodiment of the present application.
  • FIG20 is a schematic diagram of a flow chart of another message transmission method provided in an embodiment of the present application.
  • FIG21 is a flow chart of another message transmission method provided in an embodiment of the present application.
  • FIG22 is a flow chart of another message transmission method provided in an embodiment of the present application.
  • FIG23 is a flow chart of another message transmission method provided in an embodiment of the present application.
  • FIG24 is a schematic diagram of the structure of a message transmission device provided in an embodiment of the present application.
  • FIG25 is a schematic diagram of the structure of another message transmission device provided in an embodiment of the present application.
  • FIG26 is a schematic diagram of the structure of another message transmission device provided in an embodiment of the present application.
  • FIG27 is a schematic diagram of the structure of another message transmission device provided in an embodiment of the present application.
  • FIG28 is a block diagram of a message transmission device provided in an embodiment of the present application.
  • Figure 29 is a block diagram of another message transmission device provided in an embodiment of the present application.
  • a site can be considered as a local area network, such as a single subnet local area network or a multiple subnet local area network. 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.
  • IoT Internet of Things
  • Hosts within a site usually belong to a private network. Different hosts within a site can belong to the same private network or different private networks. Hosts within 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 within 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 a carrier network, which means that the private network includes hosts located at site A and hosts located at site B. Private networks can be implemented using virtual private networks (VPN).
  • VPN virtual private networks
  • hosts deployed in the private network are intranet hosts, while carrier networks and other private networks are external networks.
  • the carrier 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.
  • 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.
  • the CE device of each site is connected to a provider edge (PE) device.
  • PE provider edge
  • the message When the intranet host of one site sends a message to the intranet host of another site, the message first reaches 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 reaches the remote PE device after being transmitted through the operator network, and then is transmitted by the remote PE device to the CE device of the remote site, and finally, the CE device of the remote site is transmitted to the intranet host of the remote site.
  • hosts at different sites can communicate via a Layer 2 network or a Layer 3 network.
  • Hosts communicate via a Layer 2 network, i.e., hosts communicate based on Media Access Control (MAC) routing.
  • Hosts communicate via a Layer 3 network, i.e., hosts communicate based on Internet Protocol (IP) routing.
  • MAC Media Access Control
  • IP Internet Protocol
  • 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-homing 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. Different from 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 of 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 delivered to the remote PE devices through the control plane.
  • MP-BGP multiprotocol border gateway protocol
  • L3VPN technology is a VPN technology used for interconnecting three-layer networks.
  • FIG1 is a schematic diagram of publishing a MAC address in an EVPN over MPLS scenario in the related art.
  • FIG2 is a schematic diagram of message transmission in an EVPN over MPLS scenario in the related art.
  • FIG3 is a schematic diagram of publishing an IP address in an MPLS L3VPN scenario in the related art.
  • FIG4 is a schematic diagram of message transmission in an MPLS L3VPN scenario in the related art.
  • the operator network includes three PE devices, PE1 to PE3, and two operator (provider, P) devices, P1 and P2.
  • the P device is not shown in FIG1 and FIG3.
  • 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.
  • PE1, PE2, and PE3 establish BGP EVPN peer relationships with each other.
  • PE1 learns MAC1 from CE1, it allocates a private network label Label1 and sends it to the remote PE2 and PE3 respectively.
  • CE2 sends a Layer 2 message with a destination MAC address of DMAC (for example, MAC1) and a source MAC address of SMAC to CE1. If the message is sent from PE2 to PE1 through P1, PE2 generates an MPLS message, which includes an MPLS header and a message payload.
  • the MPLS header includes the public network label LSP1 allocated by P1 and the private network label Label1 allocated by PE1.
  • the Layer 2 message sent by CE2 is encapsulated in the message payload.
  • P1 receives the MPLS message sent by PE2, it can pop out the public network label LSP1 and then continue to send the MPLS message to PE1.
  • 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 through P2, PE3 generates an MPLS message.
  • the MPLS message 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.
  • the MPLS header of the actual MPLS message received by PE1 may also include an encapsulated outer MAC header.
  • the private network label is also called a VPN label
  • the public network label is also called an LSP label.
  • the MPLS technology described in this application can be a traditional MPLS technology or a segment routing (SR) MPLS (abbreviated as: SR-MPLS) technology based on the MPLS forwarding plane.
  • SR segment routing
  • BGP L3VPN peer relationships are established between PE1, PE2, and PE3.
  • PE1 learns IP1 from CE1, it allocates a private network label Label2 and sends it to the remote PE2 and PE3 respectively.
  • CE2 sends a Layer 3 message to CE1 with the destination IP address being the destination IP (for example, 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 allocated by P1 and the private network label Label2 allocated by PE1.
  • the Layer 3 message sent by CE2 is encapsulated in the message payload.
  • 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 through P2, PE3 generates an MPLS message.
  • the MPLS message 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 received by PE1 includes an MPLS header and a message payload.
  • the MPLS header includes the private network label Label2 assigned by PE1.
  • the private network label carried by the MPLS message received by PE1 is Label2. Therefore, PE1 cannot distinguish whether the traffic comes from PE2 or PE3 in the inbound direction.
  • the message structure shown in FIG. 4 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.
  • 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.
  • 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.
  • the application scenarios of the present application include a communication network and a site connected to the communication network.
  • the communication network is an MPLS VPN 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.
  • DCN data center network
  • the application scenario of the present application can be an EVPN over MPLS scenario, or it can also be an MPLS L3VPN scenario.
  • the communication network can be an operator network or an enterprise-built network.
  • 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.
  • 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.
  • 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 edge network device is a PE device
  • the core network device is a P device
  • the edge access device is a CE device
  • one or more hosts are deployed in the site accessing the communication network.
  • Figure 5 is a schematic diagram of an application scenario provided by an embodiment of the present application.
  • the application scenario includes a communication network (Figure 5 shows MPLS VPN) and two CE devices CE1 to CE2 connected to the communication network.
  • the communication network includes three PE devices PE1 to 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 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 for site 1, used to connect host 1 and host 2 in site 1 to the communication network.
  • CE2 is an edge access device for site 2, used to connect host 3 and host 4 in site 2 to the communication network.
  • the application scenario shown in Figure 5 may be the application scenario shown in Figure 1 or Figure 2, Then the MPLS VPN is EVPN over MPLS.
  • the application scenario shown in FIG5 may be the application scenario shown in FIG3 or FIG4 , then the MPLS VPN is MPLS L3VPN.
  • PE1, PE2, and PE3 are BGP neighbors of each other.
  • two PE devices are BGP neighbors of each other, which may be a BGP peer relationship established between the two PE devices.
  • 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 communicated 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.
  • the EVPN over MPLS scenario for example, in the scenario shown in Figure 1 or Figure 2, PE1, PE2, and PE3 are BGP EVPN neighbors of each other, and the BGP peer relationship established between the devices is a BGP EVPN peer relationship.
  • PE1, PE2, and PE3 are each other's BGP L3VPN neighbors, and the BGP peer relationship established between the devices is a BGP L3VPN peer relationship.
  • 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.
  • 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 domain, BD).
  • 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.
  • VRF virtual routing forwarding
  • 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.
  • 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.
  • two PE devices that are BGP EVPN neighbors are configured with EVIs belonging to the same EVPN. In this case, the two PE devices can also be said to belong 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 can also be said to belong to the same L3VPN.
  • the PE device 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.
  • the PE device can 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.
  • the PE device can assign a private network label to each MAC route (or IP route).
  • 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.
  • 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.
  • FIG6 is a flow chart of a message transmission method provided by an embodiment of the present application.
  • method 600 includes steps 601 to 604.
  • Device 1 and device 2 in method 600 are network edge devices of the MPLS VPN network, such as routers, switches, or gateways.
  • An LSP is established between device 1 and device 2
  • device 3 is a label switching device located between device 1 and device 2 on the LSP.
  • device 1 in method 600 is an ingress operator edge device (ingress PE)
  • device 2 in method 600 is an egress operator edge device (egress PE).
  • the MPLS VPN network is a data center network
  • device 1 in method 600 is an ingress gateway
  • device 2 in method 600 is an egress gateway.
  • the embodiment of the present application does not limit the implementation scenario of the MPLS VPN network and the device type of the network edge device.
  • the method 600 can be applied to the application scenario shown in FIG5.
  • device 1 in method 600 is PE2 or PE3 shown in FIG. 5
  • device 2 in method 600 is PE1 shown in FIG. 5
  • device 3 in method 600 is P1 or P2 shown in FIG. 5 .
  • 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.
  • 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.
  • the message portion of the MPLS message located before the message payload is called the message header of the MPLS message.
  • the device identification of device 1 is a router identification (router ID) of device 1.
  • the device identification of device 1 may also be a router identification (router ID) of device 1.
  • the information that can uniquely identify device 1 in the communication network such as the IP address of device 1, the hardware address of device 1, or the MAC address of device 1.
  • the embodiment of the present application does not limit the type of device identification.
  • the length of the device identification of device 1 can 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.
  • 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.
  • FIG. 7 is a schematic diagram of the structure of an MPLS message provided in an embodiment of the present application.
  • 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.
  • 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.
  • the setting position of the device identifier in the MPLS message can be defined in the protocol or standard.
  • the network edge devices can negotiate to determine the setting position of the device identifier in the MPLS message.
  • the message generated by device 1 includes a control word, and the control word is used to carry the device identification of device 1.
  • the device identification of device 1 is the control word in the message.
  • the message generated by device 1 can be shown in Figure 8, for example.
  • the control word is a 4-byte control word. This implementation does not require changing the format of the original MPLS message, but only requires configuring the ability to parse the control word and identify the device identification in the network edge device on the receiving side, and configuring the ability to set the control word as the device identification in the network edge device on the sending side.
  • the message generated by device 1 includes a control word, and the device identification of device 1 is adjacent to the control word.
  • the device identification of device 1 is located after the control word.
  • the control word here refers to the original control word of 4 bytes.
  • the message generated by device 1 can be shown in Figure 9, for example.
  • the message generated by device 1 includes an 8-byte long control word. The 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.
  • the upper 4 bytes of the long control word are used to carry the original control word
  • 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.
  • the stack 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 stack bottom label.
  • the device identifier of device 1 is adjacent to the stack bottom label of the MPLS header.
  • the message generated by device 1 may be, for example, as shown in FIG. 10 .
  • the bottom label can separately indicate that the device ID of device 1 is adjacent to the bottom label.
  • 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).
  • the static label is pre-configured in device 1 and device 2 respectively.
  • 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.
  • the bottom label is a dynamic label assigned by device 2
  • device 2 can generate the dynamic label and send it to device 1.
  • 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.
  • 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.
  • the bottom label is a designated extended special purpose label (eSPL)
  • 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 label adjacent thereto is the eSPL. That is to say, the bottom label and the special label together indicate that the device identifier of device 1 is adjacent to the bottom label of the stack.
  • the special label indicates that the label adjacent to the special label is the eSPL
  • the designated eSPL bottom label indicates that the device identifier of device 1 is adjacent to the eSPL.
  • the special label may be an extension label (XL) with a label value of 15.
  • XL extension label
  • the designated eSPL may be defined in a standard or protocol, such as a standard or protocol definition: when the eSPL as the bottom label takes a designated label value, it indicates that the device identifier is carried after the bottom label of the stack.
  • 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.
  • the payload of the MPLS message transmitted between network devices in the communication network is a Layer 2 message.
  • the network edge devices can negotiate the control word (CW) capability.
  • the network edge device on the sending side can insert the control word between the MPLS header and the message payload.
  • the control word is 4 bytes long and is usually set to all 0s. This can prevent the intermediate network devices (such as P devices) in the communication network from misidentifying the Layer 2 message as an IPv4 message or an IPv6 message.
  • the control word is misidentified as an IPv4 message or an IPv6 message, thereby performing incorrect load sharing and causing message disorder.
  • the definition and function of the control word can be explained in detail in the request for comments (RFC) numbered 7432 (abbreviated as RFC 7432), which will not be described in detail in the present application.
  • device 1 and device 2 are BGP EVPN neighbors
  • device 1 may carry the device identifier of device 1 in the message using the first possible implementation or the second possible implementation.
  • device 1 may carry the device identifier of device 1 in the message using the third possible implementation.
  • 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, so as to prevent the intermediate network device in the communication network from misidentifying the received layer 2 message as an IPv4 message or an IPv6 message.
  • 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).
  • device 1 can 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.
  • Step 602 Device 1 sends the message to device 2 through the LSP established between device 1 and device 2.
  • CE2 ⁇ PE2 ⁇ P1 ⁇ PE1 ⁇ CE1 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.
  • PE2 Assuming that device 2 is PE1 in the application scenario shown in FIG5, and device 1 is PE2 in the application scenario shown in FIG5, 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, and the MPLS packet can be transmitted through transmission path 1 or transmission path 2.
  • device 3 located between device 1 and device 2 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.
  • Step 603 Device 2 parses the message and obtains the device identification of device 1.
  • device 2 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.
  • device 2 obtains the device identification of device 1 by parsing the control word in the message.
  • 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.
  • 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.
  • Step 604 Device 2 determines that the message comes from device 1 according to the device identifier.
  • device 2 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.
  • device 2 may not perform traffic statistics on the messages from device 1.
  • 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.
  • a network device 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, 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 over MPLS scenario or an MPLS L3VPN scenario, accurate statistics of network traffic can be achieved.
  • the device 1 carries the device identification of the device 1 in the generated MPLS message, and the device 2 parses the received MPLS message.
  • the capability of the device identifier in the text can be manually configured.
  • the capability of carrying the device identifier of device 1 in the message can be negotiated between device 1 and device 2.
  • device 2 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 the capability of carrying 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.
  • 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 capability to parse the device identifier carried in the message.
  • the capability negotiation information also indicates the setting position of the device identifier of device 1 in the message.
  • device 1 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.
  • 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.
  • device 1 may not respond to the capability negotiation information sent by device 2.
  • 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.
  • the capability negotiation information sent by device 2 to device 1 is carried in a BGP update (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.
  • BGP update BGP update
  • 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).
  • PCEP Path Computation Element Protocol
  • the capability negotiation information sent by device 2 to device 1 can also be carried in a message in a custom format.
  • PCEP Path Computation Element Protocol
  • 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.
  • the extended group attribute that carries the capability negotiation information is referred to as the capability
  • FIG. 11 is a schematic diagram of the structure of a BGP update message provided in an embodiment of the present application.
  • 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).
  • 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 next hop network address length, a next hop network address, a reserved field, a network layer reachability information (NLRI), a capability negotiation extended community attribute, and other path attributes.
  • NLRI network layer reachability information
  • the address family identifier, the subsequent address family identifier, the next-hop network address length, the next-hop network address, the reserved field and the NLRI are collectively referred to as the multi-protocol reachable NLRI (MP_REACH_NLRI) attribute.
  • the capability negotiation extended group attribute includes a type field, a subtype field, a tag bit field and a reserved field.
  • the type field and the subtype field of the extended group attribute are a certain value, it indicates 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.
  • the tag 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 tag 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 RFC 4760 document, and the embodiments of the present application will not be repeated here.
  • 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.
  • 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.
  • 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.
  • 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 the Layer 2 routing information and/or the Layer 3 routing information.
  • ARP Address Resolution Protocol
  • the Type 2 route can also be called an ARP type route.
  • the Type 2 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 network edge devices (such as PE)
  • the above-mentioned BGP EVPN route can also be other types of routes defined in BGP NLRI, or other types of routes evolved subsequently.
  • the embodiment of the present application does not limit the type of BGP EVPN route.
  • the BGP EVPN route can carry the NLRI in the BGP message field shown in FIG. 11.
  • 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.
  • 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.
  • the capability negotiation information sent by device 2 to device 1 also indicates that the device identification of device 1 is set in the 4-byte control word.
  • Figure 12 is a schematic diagram of the structure of a capability negotiation extended group attribute provided by an embodiment of the present application. As shown in Figure 12, by setting the 15th bit of the tag bit of the capability negotiation extended group attribute to 1 and the remaining bits to 0, it is indicated that the 4-byte control word in the message is set to the device identification of device 1. In this case, device 1 can generate a message as shown in Figure 8.
  • the MAC address of host 3 is SMAC
  • the MAC address of host 1 is DMAC
  • the destination MAC address of the message sent by host 3 to host 1 is DMAC
  • the source MAC address is SMAC.
  • the private network labels assigned by PE1 to PE2 and PE3 are both Label1.
  • the public network label assigned by P1 is LSP1
  • the public network label assigned by P2 is LSP2.
  • FIG13 is a schematic diagram of message transmission in an EVPN over MPLS scenario provided by an embodiment of the present application.
  • CE2 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 a message from PE2, it parses the control word in the message to obtain the device ID of PE2, and then determines that the message is sent by PE2.
  • PE1 If the message is sent from PE3 to PE1 through 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 ID of PE3. Accordingly, after PE1 receives a message from PE3, it parses the control word in the message to obtain the device ID 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.
  • 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.
  • device 1 and device 2 negotiate the long control word (LCW) capability, carry the original control word in the upper 4 bytes of the long control word, and carry the device identification of device 1 in the lower 4 bytes of the long control word, 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.
  • LCW long control word
  • the MAC address of host 3 is SMAC
  • the MAC address of host 1 is DMAC
  • the destination MAC address of the message sent by host 3 to host 1 is DMAC
  • the source MAC address is SMAC.
  • the private network labels assigned by PE1 to PE2 and PE3 are both Label1.
  • the public network label assigned by P1 is LSP1
  • 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 Figure 15, which is another schematic diagram of message transmission in the EVPN over MPLS scenario provided in an embodiment of the present application.
  • CE2 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 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.
  • LSP1 public network label Label1
  • LCW long control word
  • LCW(0) the upper 4 bytes of which carry the original control word
  • LCW(PE2) the lower 4 bytes of which carry the device identifier of PE2
  • 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.
  • the capability negotiation information sent by device 2 to device 1 also 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.
  • Figure 16 is a structural schematic diagram of another capability negotiation extended group attribute provided by an embodiment of the present application.
  • device 1 can generate a message as shown in Figure 10, in which the stack bottom label is the specified bSPL.
  • the MAC address of host 3 is SMAC
  • the MAC address of host 1 is DMAC
  • the destination MAC address of the message sent by host 3 to host 1 is DMAC
  • the source MAC address is SMAC.
  • the private network labels assigned by PE1 to PE2 and PE3 are both Label1.
  • the public network label assigned by P1 is LSP1
  • the public network label assigned by P2 is LSP2.
  • FIG17 is another schematic diagram of message transmission in the EVPN over MPLS scenario provided by an embodiment of the present application.
  • CE2 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 a certain bottom-of-stack label (LabelS) mentioned above, and the 4 bytes after the bottom-of-stack label carry the device identifier of PE2 (PE2).
  • LSP1 public network label
  • Label1 the private network label
  • LabelS bottom-of-stack label
  • PE1 After PE1 receives a message from PE2, it parses the stack bottom label of the message to determine that the 4 bytes after the stack bottom label carry a device identifier, and then obtains the device identifier of PE2 from the 4 bytes after the stack bottom label, thereby determining that the message is sent by PE2. If the message is sent from PE3 to PE1 through P2, the message generated by PE3 will carry the public network label LSP2, the private network label Label1, and a certain stack bottom label (LabelS) mentioned above, and the 4 bytes after the stack bottom label carry the device identifier of PE3 (PE3).
  • LSP2 public network label
  • LabelS a certain stack bottom label
  • PE1 After PE1 receives a message from PE3, it parses the stack bottom label of the message to determine that the 4 bytes after the stack bottom label carry a device identifier, and then obtains the device identifier of PE3 from the 4 bytes after the stack bottom label, thereby determining that the message is sent by PE3. Therefore, PE1 can support traffic statistics that differentiate PEs in the inbound direction.
  • the label at the bottom of the stack is a specified eSPL.
  • 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.
  • the capability negotiation information sent by device 2 to device 1 also indicates that the stack bottom label is set to a specified eSPL, and indicates that the device identifier of device 1 is set to the 4 bytes after the stack bottom label.
  • Figure 18 is a structural schematic diagram of another capability negotiation extended group attribute provided by an embodiment of the present application.
  • device 1 can generate a message as shown in Figure 10, in which the stack bottom label is the specified eSPL.
  • the MAC address of host 3 is SMAC
  • the MAC address of host 1 is DMAC
  • the destination MAC address of the message sent by host 3 to host 1 is DMAC
  • the source MAC address is SMAC.
  • the private network labels assigned by PE1 to PE2 and PE3 are both Label1.
  • the public network label assigned by P1 is LSP1
  • 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 Figure 19, which is another schematic diagram of message transmission in the EVPN over MPLS scenario provided in an embodiment of the present application.
  • CE2 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, an extended label (XL) and a specified eSPL, the eSPL being the bottom label, and the 4 bytes after the bottom label carrying the device identifier of PE2 (PE2).
  • LSP1 public network label
  • Label1 a private network label Label1
  • XL extended label
  • eSPL being the bottom label
  • PE1 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).
  • PE1 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 the inbound Traffic statistics to different PEs.
  • 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.
  • 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.
  • the capability negotiation information can be published in the L3VPN route.
  • the L3VPN route can carry the NLRI in the BGP message field shown in Figure 11.
  • 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.
  • the bottom label of the stack is a pre-configured static label, or a dynamic label assigned by device 2, or a specified bSPL.
  • 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 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).
  • FIG20 is a flow chart of another message transmission method provided by an embodiment of the present application, wherein the application scenario of the method includes at least a first device and a second device.
  • the application scenario may be, for example, the application scenario shown in FIG5
  • the first device may be, for example, PE2 or PE3 shown in FIG5
  • the second device may be, for example, PE1 shown in FIG5 .
  • the method may be specifically used to implement the method 600 shown in the corresponding embodiment of FIG6 .
  • the method includes but is not limited to the following steps 2001 to 2002.
  • 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.
  • Step 2002 The first device sends a message to the second device through the LSP established between the first device and the second device.
  • the first device may be, for example, device 1
  • the second device may be, for example, device 2.
  • the specific implementation process of steps 2001 to 2002 may refer to steps 601 to 602 in method 600, which will not be repeated here.
  • the device identifier of the first device is a router identifier of the first device.
  • the message includes a control word, and the control word is used to carry a device identifier.
  • the message includes a control word, and the device identifier is adjacent to the control word.
  • the bottom label of the MPLS header is used to indicate that the device identifier is adjacent to the bottom label.
  • 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 refer to the relevant description in the embodiment shown in Figure 6, and will not be repeated here.
  • 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.
  • control word is a 4-byte control word.
  • 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.
  • 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.
  • the stack bottom label is a pre-configured static label, or a dynamic label allocated by the second device, or a specified bSPL.
  • the bottom label of the stack is a specified eSPL.
  • 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.
  • 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 the capability negotiation information.
  • a first device receives capability negotiation information sent by a second device, including: the first device receives the capability negotiation information sent by the second device.
  • the BGP L3VPN route sent by the second device includes a capability negotiation extended community attribute, and the capability negotiation extended community attribute is used to carry capability negotiation information.
  • the first device is the ingress operator edge device ingress PE
  • the second device is the egress operator edge device egress PE.
  • FIG21 is a flow chart of another message transmission method provided by an embodiment of the present application, wherein the application scenario of the method includes at least a first device and a second device.
  • the application scenario may be, for example, the application scenario shown in FIG5
  • the second device may be, for example, PE1 shown in FIG5
  • the first device may be, for example, PE2 or PE3 shown in FIG5
  • the third device may be, for example, P1 or P2 shown in FIG5 .
  • the method may be specifically used to implement the method 600 shown in the corresponding embodiment of FIG6 .
  • the method includes, but is not limited to, the following steps 2101 to 2102.
  • 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.
  • Step 2102 The second device parses the message to obtain the device identification of the first device.
  • the second device may be, for example, device 2
  • the first device may be, for example, device 1.
  • the specific implementation process of steps 2101 to 2102 may refer to steps 602 to 603 in method 600, and will not be repeated here.
  • 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.
  • the device identifier of the first device is a router identifier of the first device.
  • the message includes a control word, and the control word is used to carry a device identifier.
  • the message includes a control word, and the device identifier is adjacent to the control word.
  • the bottom label of the MPLS header is used to indicate that the device identifier is adjacent to the bottom label.
  • 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.
  • the specific implementation process of this step can be referred to the relevant description in the embodiment shown in Figure 6, and will not be repeated here.
  • 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.
  • control word is a 4-byte control word.
  • 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.
  • 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.
  • the stack bottom label is a pre-configured static label, or a dynamic label allocated by the first device, or a specified bSPL.
  • the bottom label of the stack is a specified eSPL.
  • 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.
  • a method for a second device to send capability negotiation information to a 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.
  • the method for the second device to send capability negotiation information to the first device includes: 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.
  • the first device is an inbound operator edge device
  • the second device is an outbound operator edge device
  • FIG22 is a flow chart of another message transmission method provided by an embodiment of the present application, wherein the application scenario of the method includes at least a first device and a second device.
  • the application scenario may be, for example, the application scenario shown in FIG5
  • the first device may be, for example, PE2 or PE3 shown in FIG5
  • the second device may be, for example, PE1 shown in FIG5 .
  • the method may be specifically used to implement the method 600 shown in the corresponding embodiment of FIG6 .
  • the method includes, but is not limited to, the following steps 2201.
  • 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.
  • 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.
  • control word is a 4-byte control word.
  • 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.
  • 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.
  • the stack bottom label is a pre-configured static label, or a dynamic label allocated by the second device, or a specified bSPL.
  • the bottom label of the stack is a specified eSPL.
  • 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.
  • 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 the capability negotiation information.
  • a method for a first device to receive capability negotiation information sent by a 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.
  • the first device sends a capability negotiation response to the second device.
  • the first device is an inbound operator edge device
  • the second device is an outbound operator edge device
  • FIG23 is a flow chart of another message transmission method provided by an embodiment of the present application, wherein the application scenario of the method includes at least a first device and a second device.
  • the application scenario may be, for example, the application scenario shown in FIG5
  • the second device may be, for example, PE1 shown in FIG5
  • the first device may be, for example, PE2 or PE3 shown in FIG5 .
  • the method may be specifically used to implement the method 600 shown in the corresponding embodiment of FIG6 .
  • the method includes, but is not limited to, the following steps 2301 to 2302.
  • 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.
  • Step 2302 The second device sends the capability negotiation information to the first device.
  • 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.
  • control word is a 4-byte control word.
  • 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.
  • 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.
  • the stack bottom label is a pre-configured static label, or a dynamic label allocated by the first device, or a specified bSPL.
  • the bottom label of the stack is a specified eSPL.
  • 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.
  • the method for the second device to send capability negotiation information 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.
  • the method for the second device to send capability negotiation information to the first device includes: the second device sends a BGP L3VPN route to the first device, and 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.
  • the first device receives a capability negotiation response sent by the second device.
  • the first device is an inbound operator edge device
  • the second device is an outbound operator edge device
  • FIG24 is a schematic diagram of the structure of a message transmission device provided in an embodiment of the present application.
  • the message transmission device is, for example, a first device.
  • the message transmission device 2400 includes but is not limited to a processing module 2401 and a sending module 2402.
  • the message transmission device 2400 further includes a receiving module 2403.
  • 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.
  • the device identifier of the first device is a router identifier of the first device.
  • the message includes a control word, and the control word is used to carry a device identifier.
  • the message includes a control word, and the device identifier is adjacent to the control word.
  • the bottom label of the MPLS header is used to indicate that the device identifier is adjacent to the bottom label.
  • 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.
  • 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.
  • control word is a 4-byte control word.
  • 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.
  • 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.
  • the stack bottom label is a pre-configured static label, or a dynamic label allocated by the second device, or a specified bSPL.
  • the bottom label of the stack is a specified eSPL.
  • 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.
  • the receiving module 2403 is specifically used to receive the BGP EVPN route sent by the second device, and 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.
  • the receiving module 2403 is specifically used to receive the BGP L3VPN route sent by the second device, 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.
  • the first device is an inbound operator edge device
  • the second device is an outbound operator edge device
  • FIG25 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.
  • the message transmission device 2500 includes but is not limited to a receiving module 2501 and a processing module 2502.
  • the message transmission device 2500 also includes a sending module 2503.
  • 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.
  • 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.
  • the device identifier of the first device is a router identifier of the first device.
  • the message includes a control word, and the device identifier is adjacent to the control word.
  • the bottom label of the MPLS header is used to indicate that the device identifier is adjacent to the bottom label.
  • 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.
  • 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.
  • control word is a 4-byte control word.
  • 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.
  • 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.
  • the stack bottom label is a pre-configured static label, or a dynamic label allocated by the first device, or a specified bSPL.
  • the sending module 2503 is specifically used to send a BGP EVPN route to the first device, where 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.
  • 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 group attribute, and the capability negotiation extended group attribute is used to carry capability negotiation information.
  • the first device is an inbound operator edge device
  • the second device is an outbound operator edge device
  • 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.
  • 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.
  • control word is a 4-byte control word.
  • 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.
  • 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.
  • the stack bottom label is a pre-configured static label, or a dynamic label allocated by the second device, or a specified bSPL.
  • the bottom label of the stack is a specified eSPL.
  • 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.
  • the receiving module 2601 is specifically used to receive a BGP EVPN route sent by a second device, where 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.
  • the receiving module 2601 is specifically used to receive a BGP L3VPN route sent by a second device, where 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.
  • the sending module 2602 is configured to send a capability negotiation response to the second device.
  • the first device is an inbound operator edge device
  • the second device is an outbound operator edge device
  • FIG27 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.
  • the message transmission device 2700 includes but is not limited to a processing module 2701 and a sending module 2702.
  • the message transmission device 2700 also includes a receiving module 2703.
  • 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.
  • 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.
  • control word is a 4-byte control word.
  • 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.
  • 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.
  • the stack bottom label is a pre-configured static label, or a dynamic label allocated by the first device, or a specified bSPL.
  • the bottom label of the stack is a specified eSPL.
  • 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.
  • the sending module 2702 is specifically used to send 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 capability negotiation information.
  • the receiving module 2703 is configured to receive a capability negotiation response sent by the first device.
  • the first device is an inbound operator edge device
  • the second device is an outbound operator edge device
  • FIG28 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.
  • the message transmission device 2800 may be a network edge device.
  • the device 2800 includes: a processor 2801 and a memory 2802.
  • the processor 2801 is used to call the computer-readable instructions and execute all operations performed by the device 1 or the device 2 in the method 600 shown in FIG. 6 according to the instructions of the computer-readable instructions.
  • 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.
  • Figure 29 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.
  • the message transmission device 2900 may be a network edge device.
  • the device 2900 includes: a communication interface 2901; and a processor 2902 connected to the communication interface 2901.
  • the message transmission device 2900 can perform all operations performed by device 1 or device 2 in the method 600 shown in Figure 6.
  • the communication interface 2901 is used to implement the sending and receiving operations
  • the processor 2902 is used to implement operations other than sending and receiving.
  • the communication interface 2901 is used to send a message to the device 2, and the processor 2902 is used to generate a message.
  • 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.
  • 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.
  • the hardware chip may be used to implement encryption/decryption operations.
  • the memory may include volatile memory, such as random access memory (RAM).
  • RAM random access memory
  • the memory may also include non-volatile memory, such as flash memory, hard disk drive (HDD) or solid-state drive (SSD).
  • flash memory such as hard disk drive (HDD) or solid-state drive (SSD).
  • SSD solid-state drive
  • the memory may also include a combination of the above types of memory.
  • the communication interfaces may include wired communication interfaces, wireless communication interfaces, or a combination thereof.
  • 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.
  • WLAN wireless local area network
  • all or part of the embodiments may be implemented by hardware, firmware, or any combination thereof.
  • software When software is involved in the specific implementation process, it may 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 embodiments of the present application is generated in whole or in part.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device.
  • the computer instructions may be The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium.
  • the computer instructions may be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means.
  • the computer-readable storage medium may 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 therein.
  • the available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a digital video disc (DVD)), or a semiconductor medium (e.g., an SSD), etc.
  • the embodiment of the present application further provides a message transmission system, including: a first device and a second device, wherein the first device may be, for example, the device 1 in the method 600 shown in FIG6 , and the second device may be, for example, the device 2 in the method 600 shown in FIG6 .
  • the first device may be, for example, the message transmission device 2400 shown in FIG24
  • the second device may be, for example, the message transmission device 2500 shown in FIG25
  • the first device may be, for example, the message transmission device 2600 shown in FIG26
  • the second device may be, for example, the message transmission device 2700 shown in FIG27 .
  • a and/or B can represent: A exists alone, A and B exist at the same time, and B exists alone.
  • the character "/" in this article generally indicates that the associated objects before and after are in an "or" relationship.
  • 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.
  • 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.

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Mathematical Physics (AREA)
  • Probability & Statistics with Applications (AREA)
  • Pure & Applied Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Algebra (AREA)
  • Computer Security & Cryptography (AREA)
  • Environmental & Geological Engineering (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The present application relates to the technical field of networks, and discloses a packet transmission method and apparatus, and a system. A first device generates a packet, the packet comprises an MPLS header, a device identifier of the first device, and a packet payload, and the device identifier is encapsulated between the MPLS header and the packet payload. The first device sends a packet to a second device by means of an LSP established between the first device and the second device. Since the packet received by the second device carries the device identifier of the first device, the second device can parse the packet to obtain the device identifier of the first device, and determine, according to the device identifier, that the packet is sent by the first device. Thus, accurate statistics of network traffic is realized in an incoming direction.

Description

报文传输方法、装置及系统Message transmission method, device and system

本申请要求于2023年05月31日提交的申请号为202310638085.5、发明名称为“报文传输方法、装置及系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to Chinese patent application No. 202310638085.5, filed on May 31, 2023, with invention name “Message Transmission Method, Device and System”, the entire contents of which are incorporated by reference into this application.

技术领域Technical Field

本申请涉及网络技术领域,特别涉及一种报文传输方法、装置及系统。The present application relates to the field of network technology, and in particular to a message transmission method, device and system.

背景技术Background Art

流量统计是通信网络的一个基本功能。通过对网络流量进行统计,可以分析网络运行的质量和健康程度。流量统计还可以用来对网络故障进行分层次的故障定位,以缩小故障范围。但是,目前在基于多协议标签交换(multiprotocol label switching,MPLS)技术进行转发的一些网络场景下,比如基于MPLS的以太虚拟专用网(Ethernet virtual private network,EVPN)(简称:EVPN over MPLS)场景和基于MPLS的三层虚拟专用网(layer 3 virtual private network,L3VPN)(简称:MPLS L3VPN)场景下,难以在网络设备上实现对网络流量的精确统计。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

本申请提供了一种报文传输方法、装置及系统。The present application provides a message transmission method, device and system.

第一方面,提供了一种报文传输方法。该方法包括:第一设备生成报文,该报文包括MPLS头、第一设备的设备标识和报文净荷,设备标识封装在MPLS头与报文净荷之间。第一设备通过第一设备与第二设备之间建立的标签交换路径(label switched path,LSP)向第二设备发送报文。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 the message to the second device through a label switched path (LSP) established between the first device and the second device.

本申请中,第一设备在生成报文时,在报文的MPLS头和报文净荷之间封装第一设备的设备标识,然后通过第一设备与第二设备之间建立的LSP向第二设备发送生成的报文。由于第二设备接收到的报文中携带有第一设备的设备标识,因此第二设备可以解析该报文得到第一设备的设备标识,并根据该设备标识确定该报文是由第一设备发送的。也就是说,第二设备作为该报文在标签交换路径上的出口设备,能够准确识别该报文在该标签交换路径上的入口设备为第一设备。本申请能够在基于MPLS技术进行转发的网络场景下,实现对网络流量的精确统计。比如在EVPN over MPLS场景或MPLS L3VPN场景下,标签交换路径上的出口设备能够在入方向对网络流量进行精确统计。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 that the ingress device of the message on the label switching path is 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.

一种具体的实现中,第一设备的设备标识为第一设备的路由器标识。In a specific implementation, the device identifier of the first device is a router identifier of the first device.

一种具体的实现中,报文包括控制字,控制字用于携带设备标识。这种实现方式无需改变原有MPLS报文的格式,只需在第二设备中配置解析控制字和识别设备标识的能力,以及在第一设备中配置将控制字设置为设备标识的能力即可。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.

一种具体的实现中,报文包括控制字,设备标识与控制字邻接。这种实现方式无需改变原始控制字,不会影响原始控制字的功能。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.

一种具体的实现中,MPLS头的栈底标签用于指示与栈底标签邻接的为设备标识。一种具体的实现中,栈底标签可单独指示与该栈底标签邻接的为设备标识。或者,栈底标签与标签栈中的其它标签共同指示与该栈底标签邻接的为设备标识。比如栈底标签为指定的扩展特殊用途标签,扩展特殊用途标签与在前的扩展标签共同指示与该栈底标签邻接的为设备标识。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.

一种具体的实现中,第一设备接收第二设备发送的能力协商信息,能力协商信息用于在第一设备和第二设备之间协商在报文中携带第一设备的设备标识的能力。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.

本申请中,第一设备与第二设备可以通过能力协商实现在第一设备发往第二设备的报文中携带第一设备的设备标识。或者,第一设备在生成的报文中携带第一设备的设备标识的能力,以及第二设备解析接收到的报文中的设备标识的能力也可以是手动配置的。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.

一种实现方式,该能力协商信息用于在第一设备和第二设备之间协商在报文的控制字中携带第一设备的设备标识的能力。 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.

一种具体的实现中,控制字为4字节的控制字。该4字节的控制字用于携带第一设备的设备标识。这种实施方案的主要思想是,第一设备与第二设备之间协商控制字能力,通过在控制字中携带第一设备的设备标识,这样报文到达第二设备后,第二设备利用控制字信息可确定该报文来自第一设备。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.

一种具体的实现中,控制字为8字节的长控制字,长控制字的4字节用于携带原始控制字,长控制字的其它4字节用于携带第一设备的设备标识。一种具体的实现中,长控制字的高4字节用于携带原始控制字,长控制字的低4字节用于携带第一设备的设备标识。这种实施方案的主要思想是,第一设备与第二设备之间协商长控制字能力,在长控制字的高4字节携带原始控制字,在长控制字的低4字节携带第一设备的设备标识,这样报文到达第二设备后,第二设备利用长控制字的低4字节可确定该报文来自第一设备。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.

另一种实现方式,能力协商信息用于在第一设备和第二设备之间协商在报文的栈底标签之后携带第一设备的设备标识的能力。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.

一种具体的实现中,栈底标签为预先配置的静态标签,或第二设备分配的动态标签,或指定的基本特殊用途标签(base special-purpose label,bSPL)。这种实施方案的主要思想是,第一设备与第二设备之间协商一种标签指示能力,由栈底标签指示标签栈之后的4字节携带第一设备的设备标识,这样报文到达第二设备后,第二设备利用栈底标签之后的4字节可确定该报文来自第一设备。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 scheme 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.

一种具体的实现中,栈底标签为指定的扩展特殊用途标签(extended special-purpose label,eSPL),当报文的标签栈中携带该eSPL时,标签栈还携带一个特殊标签,特殊标签用于指示其后邻接的标签为该eSPL。这种实施方案的主要思想是,第一设备与第二设备之间协商一种扩展标签指示能力,由栈底指定的eSPL指示标签栈之后的4字节携带第一设备的设备标识,这样报文到达第二设备后,第二设备利用栈底标签之后的4字节可确定该报文来自第一设备。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. In this way, after the message arrives at the second device, the second device can determine that the message comes from the first device by using the 4 bytes after the label at the bottom of the stack.

一种具体的实现中,第一设备接收第二设备发送的能力协商信息,包括:第一设备接收第二设备发送的边界网关协议(border gateway protocol,BGP)EVPN路由,BGP EVPN路由包括能力协商扩展团体属性,能力协商扩展团体属性用于携带能力协商信息。In a specific implementation, a first device receives capability negotiation information sent by a 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.

本申请可以应用于EVPN over MPLS场景,能力协商信息可以在BGP EVPN路由中发布。This application can be applied to EVPN over MPLS scenarios, and capability negotiation information can be published in BGP EVPN routing.

一种具体的实现中,第一设备接收第二设备发送的能力协商信息,包括:第一设备接收第二设备发送的BGP L3VPN路由,BGP L3VPN路由包括能力协商扩展团体属性,能力协商扩展团体属性用于携带能力协商信息。In a specific implementation, a first device receives capability negotiation information sent by a 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.

本申请可以应用于MPLS L3VPN场景,能力协商信息可以在L3VPN路由中发布。This application can be applied to MPLS L3VPN scenarios, and capability negotiation information can be published in L3VPN routing.

一种具体的实现中,第一设备向第二设备发送能力协商响应。该能力协商响应指示第一设备具备在报文中携带第一设备的设备标识的能力。这样第二设备能够明确知道第一设备是否具备在报文中携带设备标识的能力,能够提高能力协商可靠性。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.

一种具体的实现中,第一设备为入运营商边缘设备,第二设备为出运营商边缘设备。In a specific implementation, the first device is an inbound operator edge device, and the second device is an outbound operator edge device.

第二方面,提供了一种报文传输方法。该方法包括:第二设备通过第二设备和第一设备之间建立的LSP接收第三设备发送的报文,第三设备是该LSP上位于第一设备和第二设备之间的标签交换设备,该报文包括MPLS头、第一设备的设备标识和报文净荷,该设备标识封装在MPLS头与报文净荷之间。第二设备解析该报文,得到第一设备的设备标识。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.

一种具体的实现中,第二设备根据第一设备的设备标识确定报文来自第一设备,以对来自第一设备的报文进行流量统计。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.

本申请中,由于第二设备接收到的报文中携带有第一设备的设备标识,因此第二设备通过解析该报文可以得到第一设备的设备标识,并根据第一设备的设备标识确定该报文是由第一设备发送的。也就是说,第二设备作为该报文在标签交换路径上的出口设备,能够准确识别该报文在该标签交换路径上的入口设备为第一设备。本申请能够在基于MPLS技术进行转发的网络场景下,实现对网络流量的精确统计。比如在EVPN over MPLS场景或MPLS L3VPN场景下,标签交换路径上的出口设备能够在入方向对网络流量进行精确统计。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 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 the network traffic in the ingress direction.

一种具体的实现中,第一设备的设备标识为第一设备的路由器标识。In a specific implementation, the device identifier of the first device is a router identifier of the first device.

一种具体的实现中,报文包括控制字,控制字用于携带设备标识。In a specific implementation, the message includes a control word, and the control word is used to carry a device identifier.

一种具体的实现中,报文包括控制字,设备标识与控制字邻接。 In a specific implementation, the message includes a control word, and the device identifier is adjacent to the control word.

一种具体的实现中,MPLS头的栈底标签用于指示与栈底标签邻接的为设备标识。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 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.

一种实现方式,能力协商信息用于在第一设备和第二设备之间协商在报文的控制字中携带第一设备的设备标识的能力。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.

一种具体的实现中,控制字为4字节的控制字。In a specific implementation, the control word is a 4-byte control word.

一种具体的实现中,控制字为8字节的长控制字,长控制字的4字节用于携带原始控制字,长控制字的其它4字节用于携带第一设备的设备标识。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.

另一种实现方式,能力协商信息用于在第一设备和第二设备之间协商在报文的栈底标签之后携带第一设备的设备标识的能力。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.

一种具体的实现中,栈底标签为预先配置的静态标签,或第二设备分配的动态标签,或指定的bSPL。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.

一种具体的实现中,栈底标签为指定的eSPL,当报文的标签栈中携带该eSPL时,标签栈还携带一个特殊标签,特殊标签用于指示其后邻接的标签为eSPL。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.

一种具体的实现中,第二设备向第一设备发送能力协商信息的实现方式,包括:第二设备向第一设备发送BGP EVPN路由,该BGP EVPN路由包括能力协商扩展团体属性,该能力协商扩展团体属性用于携带能力协商信息。In a specific implementation, the method for the second device to send capability negotiation information 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.

一种具体的实现中,第二设备向第一设备发送能力协商信息的实现方式,包括:第二设备向第一设备发送BGP L3VPN路由,该BGP L3VPN路由包括能力协商扩展团体属性,该能力协商扩展团体属性用于携带能力协商信息。In a specific implementation, the method for the second device to send capability negotiation information to the first device includes: the second device sends a BGP L3VPN route to the first device, and 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.

一种具体的实现中,第二设备接收第一设备发送的能力协商响应。In a specific implementation, the second device receives a capability negotiation response sent by the first device.

一种具体的实现中,第一设备为入运营商边缘设备,第二设备为出运营商边缘设备。In a specific implementation, the first device is an inbound operator edge device, and the second device is an outbound operator edge device.

第三方面,提供了一种报文传输方法。该方法包括:第一设备接收第二设备发送的能力协商信息,该能力协商信息用于在第一设备和第二设备之间协商在第一设备向第二设备发送的MPLS报文中携带第一设备的设备标识的能力。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.

本申请中,第一设备与第二设备通过能力协商,实现在第一设备发往第二设备的报文中携带第一设备的设备标识。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.

一种实现方式,该能力协商信息用于在第一设备和第二设备之间协商在报文的控制字中携带第一设备的设备标识的能力。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.

一种具体的实现中,控制字为4字节的控制字。In a specific implementation, the control word is a 4-byte control word.

一种具体的实现中,控制字为8字节的长控制字,长控制字的4字节用于携带原始控制字,长控制字的其它4字节用于携带第一设备的设备标识。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.

另一种实现方式,能力协商信息用于在第一设备和第二设备之间协商在报文的栈底标签之后携带第一设备的设备标识的能力。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.

一种具体的实现中,栈底标签为预先配置的静态标签,或第二设备分配的动态标签,或指定的bSPL。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.

一种具体的实现中,栈底标签为指定的eSPL,当报文的标签栈中携带该eSPL时,标签栈还携带一个特殊标签,特殊标签用于指示其后邻接的标签为eSPL。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.

一种具体的实现中,第一设备接收第二设备发送的能力协商信息的实现方式,包括:第一设备接收第二设备发送的BGP EVPN路由,该BGP EVPN路由包括能力协商扩展团体属性,该能力协商扩展团体属性用于携带能力协商信息。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 the capability negotiation information.

一种具体的实现中,第一设备接收第二设备发送的能力协商信息的实现方式,包括:第一设备接收第二设备发送的BGP L3VPN路由,该BGP L3VPN路由包括能力协商扩展团体属性,该能力协商扩展团体属性用于携带能力协商信息。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 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.

一种具体的实现中,第一设备向第二设备发送能力协商响应。In a specific implementation, the first device sends a capability negotiation response to the second device.

一种具体的实现中,第一设备为入运营商边缘设备,第二设备为出运营商边缘设备。In a specific implementation, the first device is an inbound operator edge device, and the second device is an outbound operator edge device.

第四方面,提供了一种报文传输方法。该方法包括:第二设备生成能力协商信息,该能力协商信息用 于在第一设备和第二设备之间协商在第一设备向第二设备发送的MPLS报文中携带第一设备的设备标识的能力。第二设备向第一设备发送该能力协商信息。In a fourth aspect, a message transmission method is provided. The method includes: a second device generates capability negotiation information, and the capability negotiation information is used The first device and the second device are used to negotiate 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.

一种实现方式,能力协商信息用于在第一设备和第二设备之间协商在报文的控制字中携带第一设备的设备标识的能力。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.

一种具体的实现中,控制字为4字节的控制字。In a specific implementation, the control word is a 4-byte control word.

一种具体的实现中,控制字为8字节的长控制字,长控制字的4字节用于携带原始控制字,长控制字的其它4字节用于携带第一设备的设备标识。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.

另一种实现方式,能力协商信息用于在第一设备和第二设备之间协商在报文的栈底标签之后携带第一设备的设备标识的能力。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.

一种具体的实现中,栈底标签为预先配置的静态标签,或第二设备分配的动态标签,或指定的bSPL。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.

一种具体的实现中,栈底标签为指定的eSPL,当报文的标签栈中携带该eSPL时,标签栈还携带一个特殊标签,特殊标签用于指示其后邻接的标签为eSPL。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.

一种具体的实现中,第二设备向第一设备发送能力协商信息的实现方式,包括:第二设备向第一设备发送BGP EVPN路由,该BGP EVPN路由包括能力协商扩展团体属性,该能力协商扩展团体属性用于携带能力协商信息。In a specific implementation, the method for the second device to send capability negotiation information 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.

一种具体的实现中,第二设备向第一设备发送能力协商信息的实现方式,包括:第二设备向第一设备发送BGP L3VPN路由,该BGP L3VPN路由包括能力协商扩展团体属性,该能力协商扩展团体属性用于携带能力协商信息。In a specific implementation, the method for the second device to send capability negotiation information to the first device includes: the second device sends a BGP L3VPN route to the first device, and 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.

一种具体的实现中,第二设备接收第一设备发送的能力协商响应。In a specific implementation, the second device receives a capability negotiation response sent by the first device.

一种具体的实现中,第一设备为入运营商边缘设备,第二设备为出运营商边缘设备。In a specific implementation, the first device is an inbound operator edge device, and the second device is an outbound operator edge device.

第五方面,提供了一种第一设备。所述第一设备包括多个功能模块,所述多个功能模块相互作用,实现上述第一方面及其各实施方式中的方法。所述多个功能模块可以基于软件、硬件或软件和硬件的结合实现,且所述多个功能模块可以基于具体实现进行任意组合或分割。所述多个功能模块包括处理模块和发送模块。一种具体的实现中,所述多个功能模块还包括接收模块。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.

处理模块,用于生成报文,报文包括MPLS头、第一设备的设备标识和报文净荷,设备标识封装在MPLS头与报文净荷之间。发送模块,用于通过第一设备和第二设备之间建立的LSP向第二设备发送报文。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.

一种具体的实现中,第一设备的设备标识为第一设备的路由器标识。In a specific implementation, the device identifier of the first device is a router identifier of the first device.

一种具体的实现中,报文包括控制字,控制字用于携带设备标识。In a specific implementation, the message includes a control word, and the control word is used to carry a device identifier.

一种具体的实现中,报文包括控制字,设备标识与控制字邻接。In a specific implementation, the message includes a control word, and the device identifier is adjacent to the control word.

一种具体的实现中,MPLS头的栈底标签用于指示与栈底标签邻接的为设备标识。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 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.

一种具体的实现中,能力协商信息用于在第一设备和第二设备之间协商在报文的控制字中携带第一设备的设备标识的能力。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.

一种具体的实现中,控制字为4字节的控制字。In a specific implementation, the control word is a 4-byte control word.

一种具体的实现中,控制字为8字节的长控制字,长控制字的4字节用于携带原始控制字,长控制字的其它4字节用于携带第一设备的设备标识。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.

一种具体的实现中,能力协商信息用于在第一设备和第二设备之间协商在报文的栈底标签之后携带第一设备的设备标识的能力。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.

一种具体的实现中,栈底标签为预先配置的静态标签,或第二设备分配的动态标签,或指定的bSPL。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.

一种具体的实现中,栈底标签为指定的eSPL,当报文的标签栈中携带eSPL时,标签栈还携带一个特殊标签,特殊标签用于指示其后邻接的标签为eSPL。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.

一种具体的实现中,接收模块,具体用于接收第二设备发送的BGP EVPN路由,BGP EVPN路由包括能力协商扩展团体属性,能力协商扩展团体属性用于携带能力协商信息。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 group attribute, and the capability negotiation extended group attribute is used to carry capability negotiation information.

一种具体的实现中,接收模块,具体用于接收第二设备发送的BGP L3VPN路由,BGP L3VPN路由包括能力协商扩展团体属性,能力协商扩展团体属性用于携带能力协商信息。 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.

一种具体的实现中,第一设备为入运营商边缘设备,第二设备为出运营商边缘设备。In a specific implementation, the first device is an inbound operator edge device, and the second device is an outbound operator edge device.

第六方面,提供了一种第二设备。第二设备包括多个功能模块,多个功能模块相互作用,实现上述第二方面及其各实施方式中的方法。多个功能模块可以基于软件、硬件或软件和硬件的结合实现,且多个功能模块可以基于具体实现进行任意组合或分割。多个功能模块包括接收模块和处理模块。一种具体的实现中,多个功能模块还包括发送模块。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.

接收模块,用于通过第二设备和第一设备之间建立的LSP接收第三设备发送的报文,第三设备是该LSP上位于第一设备和第二设备之间的标签交换设备,该报文包括MPLS头、第一设备的设备标识和报文净荷,该设备标识封装在MPLS头与报文净荷之间。处理模块,用于解析该报文,得到第一设备的设备标识。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.

一种具体的实现中,处理模块,还用于根据第一设备的设备标识确定报文来自第一设备,以对来自第一设备的报文进行流量统计。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.

一种具体的实现中,第一设备的设备标识为第一设备的路由器标识。In a specific implementation, the device identifier of the first device is a router identifier of the first device.

一种具体的实现中,报文包括控制字,控制字用于携带设备标识。In a specific implementation, the message includes a control word, and the control word is used to carry a device identifier.

一种具体的实现中,报文包括控制字,设备标识与控制字邻接。In a specific implementation, the message includes a control word, and the device identifier is adjacent to the control word.

一种具体的实现中,MPLS头的栈底标签用于指示与栈底标签邻接的为设备标识。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 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.

一种具体的实现中,能力协商信息用于在第一设备和第二设备之间协商在报文的控制字中携带第一设备的设备标识的能力。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.

一种具体的实现中,控制字为4字节的控制字。In a specific implementation, the control word is a 4-byte control word.

一种具体的实现中,控制字为8字节的长控制字,长控制字的4字节用于携带原始控制字,长控制字的其它4字节用于携带第一设备的设备标识。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.

一种具体的实现中,能力协商信息用于在第一设备和第二设备之间协商在报文的栈底标签之后携带第一设备的设备标识的能力。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.

一种具体的实现中,栈底标签为预先配置的静态标签,或第一设备分配的动态标签,或指定的bSPL。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.

一种具体的实现中,栈底标签为指定的eSPL,当报文的标签栈中携带eSPL时,标签栈还携带一个特殊标签,特殊标签用于指示其后邻接的标签为eSPL。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.

一种具体的实现中,发送模块,具体用于向第一设备发送BGP EVPN路由,BGP EVPN路由包括能力协商扩展团体属性,能力协商扩展团体属性用于携带能力协商信息。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 group attribute, and the capability negotiation extended group attribute is used to carry capability negotiation information.

一种具体的实现中,发送模块,具体用于向第一设备发送BGP L3VPN路由,BGP L3VPN路由包括能力协商扩展团体属性,能力协商扩展团体属性用于携带能力协商信息。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 group attribute, and the capability negotiation extended group attribute is used to carry capability negotiation information.

一种具体的实现中,第一设备为入运营商边缘设备,第二设备为出运营商边缘设备。In a specific implementation, the first device is an inbound operator edge device, and the second device is an outbound operator edge device.

第七方面,提供了一种第一设备。所述第一设备包括多个功能模块,所述多个功能模块相互作用,实现上述第三方面及其各实施方式中的方法。所述多个功能模块可以基于软件、硬件或软件和硬件的结合实现,且所述多个功能模块可以基于具体实现进行任意组合或分割。所述多个功能模块包括接收模块。一种具体的实现中,所述多个功能模块还包括发送模块。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.

接收模块,用于接收第二设备发送的能力协商信息,该能力协商信息用于在第一设备和第二设备之间协商在第一设备向第二设备发送的MPLS报文中携带第一设备的设备标识的能力。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.

一种具体的实现中,能力协商信息用于在第一设备和第二设备之间协商在报文的控制字中携带第一设备的设备标识的能力。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.

一种具体的实现中,控制字为4字节的控制字。In a specific implementation, the control word is a 4-byte control word.

一种具体的实现中,控制字为8字节的长控制字,长控制字的4字节用于携带原始控制字,长控制字的其它4字节用于携带第一设备的设备标识。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.

一种具体的实现中,能力协商信息用于在第一设备和第二设备之间协商在报文的栈底标签之后携带第一设备的设备标识的能力。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.

一种具体的实现中,栈底标签为预先配置的静态标签,或第二设备分配的动态标签,或指定的bSPL。 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.

一种具体的实现中,栈底标签为指定的eSPL,当报文的标签栈中携带该eSPL时,标签栈还携带一个特殊标签,特殊标签用于指示其后邻接的标签为eSPL。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.

一种具体的实现中,接收模块,具体用于接收第二设备发送的BGP EVPN路由,该BGP EVPN路由包括能力协商扩展团体属性,该能力协商扩展团体属性用于携带能力协商信息。In a specific implementation, the receiving module is specifically used to receive a BGP EVPN route sent by a second device, where 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.

一种具体的实现中,接收模块,具体用于接收第二设备发送的BGP L3VPN路由,该BGP L3VPN路由包括能力协商扩展团体属性,该能力协商扩展团体属性用于携带能力协商信息。In a specific implementation, the receiving module is specifically used to receive a BGP L3VPN route sent by a second device, where 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 a specific implementation, the sending module is used to send a capability negotiation response to the second device.

一种具体的实现中,第一设备为入运营商边缘设备,第二设备为出运营商边缘设备。In a specific implementation, the first device is an inbound operator edge device, and the second device is an outbound operator edge device.

第八方面,提供了一种第二设备。所述第二设备包括多个功能模块,所述多个功能模块相互作用,实现上述第四方面及其各实施方式中的方法。所述多个功能模块可以基于软件、硬件或软件和硬件的结合实现,且所述多个功能模块可以基于具体实现进行任意组合或分割。所述多个功能模块包括处理模块和发送模块。一种具体的实现中,所述多个功能模块还包括接收模块。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.

处理模块,用于生成能力协商信息,该能力协商信息用于在第一设备和第二设备之间协商在第一设备向第二设备发送的MPLS报文中携带第一设备的设备标识的能力。发送模块,用于向第一设备发送该能力协商信息。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.

一种具体的实现中,能力协商信息用于在第一设备和第二设备之间协商在报文的控制字中携带第一设备的设备标识的能力。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.

一种具体的实现中,控制字为4字节的控制字。In a specific implementation, the control word is a 4-byte control word.

一种具体的实现中,控制字为8字节的长控制字,长控制字的4字节用于携带原始控制字,长控制字的其它4字节用于携带第一设备的设备标识。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.

一种具体的实现中,能力协商信息用于在第一设备和第二设备之间协商在报文的栈底标签之后携带第一设备的设备标识的能力。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.

一种具体的实现中,栈底标签为预先配置的静态标签,或第一设备分配的动态标签,或指定的bSPL。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.

一种具体的实现中,栈底标签为指定的eSPL,当报文的标签栈中携带eSPL时,标签栈还携带一个特殊标签,特殊标签用于指示其后邻接的标签为eSPL。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.

一种具体的实现中,发送模块,具体用于向第一设备发送BGP EVPN路由,该BGP EVPN路由包括能力协商扩展团体属性,该能力协商扩展团体属性用于携带能力协商信息。In a specific implementation, the sending module is specifically used to send a BGP EVPN route to a first device, where 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.

一种具体的实现中,发送模块,具体用于向第一设备发送BGP L3VPN路由,该BGP L3VPN路由包括能力协商扩展团体属性,该能力协商扩展团体属性用于携带能力协商信息。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 group attribute, and the capability negotiation extended group attribute is used to carry capability negotiation information.

一种具体的实现中,接收模块,用于接收第一设备发送的能力协商响应。In a specific implementation, the receiving module is used to receive a capability negotiation response sent by the first device.

一种具体的实现中,第一设备为入运营商边缘设备,第二设备为出运营商边缘设备。In a specific implementation, the first device is an inbound operator edge device, and the second device is an outbound operator edge device.

第九方面,提供了一种报文传输系统,包括:第一设备和第二设备,所述第一设备用于实现第一方面或第一方面任一可能的实现方式中的方法,所述第二设备用于实现第二方面或第二方面任一可能的实现方式中的方法;或者,所述第一设备用于实现第三方面或第三方面任一可能的实现方式中的方法,所述第二设备用于实现第四方面或第四方面任一可能的实现方式中的方法。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.

第十方面,提供了一种网络设备,包括:通信接口;以及与所述通信接口连接的处理器。根据所述通信接口和所述处理器,实现第一方面或第一方面任一可能的实现方式中的方法,或者实现第二方面或第二方面任一可能的实现方式中的方法,或者实现第三方面或第三方面任一可能的实现方式中的方法,或者实现第四方面或第四方面任一可能的实现方式中的方法。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.

第十一方面,提供了一种计算机可读存储介质,所述计算机可读存储介质上存储有指令,当所述指令被处理器执行时,实现第一方面或第一方面任一可能的实现方式中的方法,或者实现第二方面或第二方面任一可能的实现方式中的方法,或者实现第三方面或第三方面任一可能的实现方式中的方法,或者实现第四方面或第四方面任一可能的实现方式中的方法。 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.

第十二方面,提供了一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行时,实现第一方面或第一方面任一可能的实现方式中的方法,或者实现第二方面或第二方面任一可能的实现方式中的方法,或者实现第三方面或第三方面任一可能的实现方式中的方法,或者实现第四方面或第四方面任一可能的实现方式中的方法。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.

第十三方面,提供了一种芯片,芯片包括可编程逻辑电路和/或程序指令,当芯片运行时,实现第一方面或第一方面任一可能的实现方式中的方法,或者实现第二方面或第二方面任一可能的实现方式中的方法,或者实现第三方面或第三方面任一可能的实现方式中的方法,或者实现第四方面或第四方面任一可能的实现方式中的方法。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

图1是相关技术中在EVPN over MPLS场景下发布MAC地址的示意图;FIG1 is a schematic diagram of publishing MAC addresses in an EVPN over MPLS scenario in the related art;

图2是相关技术中在EVPN over MPLS场景下的报文传输示意图;FIG2 is a schematic diagram of message transmission in an EVPN over MPLS scenario in the related art;

图3是相关技术中在MPLS L3VPN场景下发布IP地址的示意图;FIG3 is a schematic diagram of issuing IP addresses in an MPLS L3VPN scenario in the related art;

图4是相关技术中在MPLS L3VPN场景下的报文传输示意图;FIG4 is a schematic diagram of message transmission in an MPLS L3VPN scenario in the related art;

图5是本申请实施例提供的一种应用场景的示意图;FIG5 is a schematic diagram of an application scenario provided by an embodiment of the present application;

图6是本申请实施例提供的一种报文传输方法的流程示意图;FIG6 is a flow chart of a message transmission method provided in an embodiment of the present application;

图7是本申请实施例提供的一种MPLS报文的结构示意图;7 is a schematic diagram of the structure of an MPLS message provided in an embodiment of the present application;

图8是本申请实施例提供的另一种MPLS报文的结构示意图;FIG8 is a schematic diagram of the structure of another MPLS message provided in an embodiment of the present application;

图9是本申请实施例提供的又一种MPLS报文的结构示意图;FIG9 is a schematic diagram of the structure of another MPLS message provided in an embodiment of the present application;

图10是本申请实施例提供的再一种MPLS报文的结构示意图;10 is a schematic diagram of the structure of another MPLS message provided in an embodiment of the present application;

图11是本申请实施例提供的一种BGP更新消息的结构示意图;11 is a schematic diagram of the structure of a BGP update message provided in an embodiment of the present application;

图12是本申请实施例提供的一种能力协商扩展团体属性的结构示意图;12 is a schematic diagram of the structure of a capability negotiation extended group attribute provided in an embodiment of the present application;

图13是本申请实施例提供的一种在EVPN over MPLS场景下的报文传输示意图;FIG13 is a schematic diagram of message transmission in an EVPN over MPLS scenario provided by an embodiment of the present application;

图14是本申请实施例提供的另一种能力协商扩展团体属性的结构示意图;14 is a schematic diagram of the structure of another capability negotiation extended group attribute provided in an embodiment of the present application;

图15是本申请实施例提供的另一种在EVPN over MPLS场景下的报文传输示意图;FIG15 is another schematic diagram of message transmission in an EVPN over MPLS scenario provided by an embodiment of the present application;

图16是本申请实施例提供的又一种能力协商扩展团体属性的结构示意图;16 is a schematic diagram of the structure of another capability negotiation extended group attribute provided in an embodiment of the present application;

图17是本申请实施例提供的又一种在EVPN over MPLS场景下的报文传输示意图;FIG17 is another schematic diagram of message transmission in an EVPN over MPLS scenario provided by an embodiment of the present application;

图18是本申请实施例提供的再一种能力协商扩展团体属性的结构示意图;18 is a schematic diagram of the structure of another capability negotiation extended group attribute provided in an embodiment of the present application;

图19是本申请实施例提供的再一种在EVPN over MPLS场景下的报文传输示意图;FIG19 is a schematic diagram of another message transmission in an EVPN over MPLS scenario provided by an embodiment of the present application;

图20是本申请实施例提供的另一种报文传输方法的流程示意图;FIG20 is a schematic diagram of a flow chart of another message transmission method provided in an embodiment of the present application;

图21是本申请实施例提供的又一种报文传输方法的流程示意图;FIG21 is a flow chart of another message transmission method provided in an embodiment of the present application;

图22是本申请实施例提供的再一种报文传输方法的流程示意图;FIG22 is a flow chart of another message transmission method provided in an embodiment of the present application;

图23是本申请实施例提供的还一种报文传输方法的流程示意图;FIG23 is a flow chart of another message transmission method provided in an embodiment of the present application;

图24是本申请实施例提供的一种报文传输装置的结构示意图;FIG24 is a schematic diagram of the structure of a message transmission device provided in an embodiment of the present application;

图25是本申请实施例提供的另一种报文传输装置的结构示意图;FIG25 is a schematic diagram of the structure of another message transmission device provided in an embodiment of the present application;

图26是本申请实施例提供的又一种报文传输装置的结构示意图;FIG26 is a schematic diagram of the structure of another message transmission device provided in an embodiment of the present application;

图27是本申请实施例提供的再一种报文传输装置的结构示意图;FIG27 is a schematic diagram of the structure of another message transmission device provided in an embodiment of the present application;

图28是本申请实施例提供的一种报文传输装置的框图;FIG28 is a block diagram of a message transmission device provided in an embodiment of the present application;

图29是本申请实施例提供的另一种报文传输装置的框图。Figure 29 is a block diagram of another message transmission device provided in an embodiment of the present application.

具体实施方式DETAILED DESCRIPTION

为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。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.

目前,位于不同站点的主机可以跨站点通信。其中,一个站点可视为一个局域网,比如可以是单网段(single subnet)的局域网,也可以是多网段(multiple subnet)的局域网。不同站点可以部署在不同地区。 一个站点内可以部署有一台或多台主机。主机指安装有客户端的终端设备,例如是智能手机、平板电脑、台式计算机、物联网(internet of things,IoT)设备、网络设备、工作站或服务器等。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 local area network or a multiple subnet local area network. 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.

站点内的主机通常属于私有网络。一个站点内的不同主机可以属于同一私有网络或不同私有网络。私有网络内的主机通常都会被配置有一个内网地址。由于不同私有网络的内网地址可以有重叠,因此私有网络内的主机被配置的内网地址一般只能用来在该私有网络内部进行通信。私有网络可以跨站点部署,也即是,一个私有网络可以包括部署在不同站点的多台主机。例如,一个私有网络分布部署在站点A和站点B,站点A与站点B通过运营商网络连接起来,那么说明该私有网络包括位于站点A的主机和位于站点B的主机。私有网络可以采用虚拟专用网(virtual private network,VPN)实现。对于一个私有网络而言,部署在该私有网络中的主机为内网主机,而运营商网络和其它私有网络都为外部网络。其中,用于连接不同站点的运营商网络可以是使用MPLS技术建立的广域骨干网或城域网等。这里的私有网络可以是企业的私有网络。某个站点的该企业的网络是企业内部网络,部署在多个站点的该企业的多个网络称为该企业的私有网络或多站点私有网络。Hosts within a site usually belong to a private network. Different hosts within a site can belong to the same private network or different private networks. Hosts within 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 within 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 a carrier network, which means that the private network includes hosts located at site A and hosts located at site B. Private networks can be implemented using virtual private networks (VPN). For a private network, hosts deployed in the private network are intranet hosts, while carrier networks and other private networks are external networks. Among them, the carrier 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.

对于分布部署在多个站点的私有网络,如果一个站点的内网主机要向另一个站点的内网主机发送报文,那么该报文的传输需要经过两个站点之间的外部网络。一个站点的内网主机需要通过该站点的边缘接入设备与外部网络通信。站点的边缘接入设备通常被称为用户边缘(customer edge,CE)设备。CE设备例如可以是路由器、交换机或网关等。以外部网络为运营商网络为例,每个站点的CE设备分别与一个运营商边缘(provider edge,PE)设备相连。一个站点的内网主机向另一个站点的内网主机发送报文时,该报文先到达本地站点的CE设备,再由本地站点的CE设备传输至相连的PE设备,然后该报文经由运营商网络传输之后到达远端的PE设备,再由远端的PE设备传输至远端站点的CE设备,最后由远端站点的CE设备传输至远端站点的内网主机。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 reaches 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 reaches the remote PE device after being transmitted through the operator network, and then is transmitted by the remote PE device to the CE device of the remote site, and finally, the CE device of the remote site is transmitted to the intranet host of the remote site.

可选地,位于不同站点的主机可以通过二层网络或三层网络进行通信。不同主机之间通过二层网络进行通信,即不同主机之间基于媒体访问控制(Media Access Control,MAC)路由进行通信。不同主机之间通过三层网络进行通信,即不同主机之间基于互联网协议(Internet Protocol,IP)路由进行通信。Optionally, hosts at different sites can communicate via a Layer 2 network or a Layer 3 network. Hosts communicate via a Layer 2 network, i.e., hosts communicate based on Media Access Control (MAC) routing. Hosts communicate via a Layer 3 network, i.e., hosts communicate based on Internet Protocol (IP) routing.

EVPN技术是一种用于二层网络互连的VPN技术。由于EVPN能够解决传统虚拟专用局域网(local area network,LAN)服务(virtual private LAN service,VPLS)不支持双归网络负载分担的问题,并且能够避免公网伪线(pseudo wire,PW)间的全连接弊端,实现路由快速收敛,近年来被广泛应用于网络中。其中,VPLS是一种基于MPLS和以太网技术的二层VPN技术。不同于传统二层虚拟专用网(layer 2virtual private network,L2VPN)通过转发面来学习MAC地址的机制,EVPN引入了控制面。EVPN通过扩展多协议边界网关协议(multiprotocol border gateway protocol,MP-BGP),使不同站点的二层网络间MAC地址的发布过程从转发面转移到控制面。EVPN与传统L2VPN相比,由于实现原理上的差异,在一些功能上存在差距。在EVPN over MPLS场景下,MAC路由是通过控制面传递到远端PE设备的。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-homing 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. Different from 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 of 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 delivered to the remote PE devices through the control plane.

L3VPN技术是一种用于三层网络互连的VPN技术。L3VPN technology is a VPN technology used for interconnecting three-layer networks.

例如,图1是相关技术中在EVPN over MPLS场景下发布MAC地址的示意图。图2是相关技术中在EVPN over MPLS场景下的报文传输示意图。图3是相关技术中在MPLS L3VPN场景下发布IP地址的示意图。图4是相关技术中在MPLS L3VPN场景下的报文传输示意图。在图1至图4所示的场景中,运营商网络包括PE1~PE3这三个PE设备,以及P1和P2这两个运营商(provider,P)设备。其中图1和图3中未示出P设备。PE1分别与P1和P2连接。P1、P2、PE2和PE3两两连接。CE1连接PE1以接入该通信网络。CE2双归连接PE2和PE3以接入该通信网络,即PE2和PE3是CE2的双归接入设备。For example, FIG1 is a schematic diagram of publishing a MAC address in an EVPN over MPLS scenario in the related art. FIG2 is a schematic diagram of message transmission in an EVPN over MPLS scenario in the related art. FIG3 is a schematic diagram of publishing an IP address in an MPLS L3VPN scenario in the related art. FIG4 is a schematic diagram of message transmission in an MPLS L3VPN scenario in the related art. In the scenarios shown in FIG1 to FIG4, the operator network includes three PE devices, PE1 to PE3, and two operator (provider, P) devices, P1 and P2. The P device is not shown in FIG1 and FIG3. 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.

在图1和图2所示的场景下,PE1、PE2、PE3两两之间分别建立有BGP EVPN对等关系。如图1所示,PE1学习到来自CE1的MAC1后,分配私网标签Label1分别发送给远端的PE2和PE3。如图2所示,CE2向CE1发送目的MAC地址为DMAC(例如MAC1)、源MAC地址为SMAC的二层报文。如果该报文由PE2通过P1发往PE1,则PE2生成MPLS报文,该MPLS报文包括MPLS头和报文净荷,该MPLS头包括P1分配的公网标签LSP1和PE1分配的私网标签Label1,CE2发送的二层报文封装在该报文净荷中。P1接收到PE2发送的MPLS报文之后,可以将公网标签LSP1弹出,然后继续向PE1发送MPLS报文。最终PE1接收到的报文包括MPLS头和报文净荷,该MPLS头包括PE1分配的私网标签Label1。如果该报文由PE3通过P2发往PE1,则PE3生成MPLS报文,该MPLS报文包括MPLS头和报文净荷,该MPLS头包括P2分配的公网标签LSP2和PE1分配的私网标签Label1,CE2发送的二层报文封装在该报文净荷中。P2接收到PE3发送的MPLS报文之后,可以将公网标 签LSP2弹出,然后继续向PE1发送MPLS报文。最终PE1接收到的报文包括MPLS头和报文净荷,该MPLS头包括PE1分配的私网标签Label1。也就是说,CE2向CE1发送的二层报文无论是由PE2转发还是由PE3转发,最终PE1接收到的MPLS报文所携带的私网标签都是Label1,因此PE1无法在入方向区分流量来自PE2还是PE3。图2示出的报文结构仅用作示例性说明,实际PE1接收到的MPLS报文的MPLS头之前还可以包括封装的外层MAC头。其中,私网标签也称VPN标签,公网标签也称LSP标签。In the scenarios shown in Figures 1 and 2, PE1, PE2, and PE3 establish BGP EVPN peer relationships with each other. As shown in Figure 1, after PE1 learns MAC1 from CE1, it allocates a private network label Label1 and sends it to the remote PE2 and PE3 respectively. As shown in Figure 2, CE2 sends a Layer 2 message with a destination MAC address of DMAC (for example, MAC1) and a source MAC address of SMAC to CE1. If the message is sent from PE2 to PE1 through P1, PE2 generates an MPLS message, which includes an MPLS header and a message payload. The MPLS header includes the public network label LSP1 allocated by P1 and the private network label Label1 allocated 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 then 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 through P2, PE3 generates an MPLS message. The MPLS message 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 encapsulate the public network label LSP2 and the private network label Label1 assigned by PE1. Label LSP2 pops up, and then continues 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. The message structure shown in Figure 2 is only used as an example. The MPLS header of the actual MPLS message received by PE1 may also include an encapsulated outer MAC header. Among them, the private network label is also called a VPN label, and the public network label is also called an LSP label.

为了方便理解,如图2和图4所示的场景中在PE设备之间仅画出一个P设备,本领域技术人员可以理解,在PE设备之间可以包括多个P设备。本申请所述的MPLS技术可以是传统的MPLS技术,也可以是基于MPLS转发平面的段路由(segment routing,SR)MPLS(简称:SR-MPLS)技术。For ease of understanding, only one P device is drawn between PE devices in the scenarios shown in FIG2 and FIG4 , and those skilled in the art can understand that multiple P devices can be included between PE devices. The MPLS technology described in this application can be a traditional MPLS technology or a segment routing (SR) MPLS (abbreviated as: SR-MPLS) technology based on the MPLS forwarding plane.

在图3和图4所示的场景下,PE1、PE2、PE3两两之间分别建立有BGP L3VPN对等关系。如图3所示,PE1学习到来自CE1的IP1后,分配私网标签Label2分别发送给远端的PE2和PE3。如图4所示,CE2向CE1发送目的IP地址为目的IP(例如IP1)、源IP地址为源IP的三层报文。如果该报文由PE2通过P1发往PE1,则PE2生成MPLS报文,该MPLS报文包括MPLS头和报文净荷,该MPLS头包括P1分配的公网标签LSP1和PE1分配的私网标签Label2,CE2发送的三层报文封装在该报文净荷中。P1接收到PE2发送的MPLS报文之后,可以将公网标签LSP1弹出,然后继续向PE1发送MPLS报文。最终PE1接收到的报文包括MPLS头和报文净荷,该MPLS头包括PE1分配的私网标签Label2。如果该报文由PE3通过P2发往PE1,则PE3生成MPLS报文,该MPLS报文包括MPLS头和报文净荷,该MPLS头包括P2分配的公网标签LSP2和PE1分配的私网标签Label2,CE2发送的三层报文封装在该报文净荷中。P2接收到PE3发送的MPLS报文之后,可以将公网标签LSP2弹出,然后继续向PE1发送MPLS报文。最终PE1接收到的报文包括MPLS头和报文净荷,该MPLS头包括PE1分配的私网标签Label2。也就是说,CE2向CE1发送的三层报文无论是由PE2转发还是由PE3转发,最终PE1接收到的MPLS报文所携带的私网标签都是Label2,因此PE1无法在入方向区分流量来自PE2还是PE3。图4示出的报文结构仅用作示例性说明,实际PE1接收到的MPLS报文的MPLS头之前还可以包括封装的外层MAC头。In the scenarios shown in Figures 3 and 4, BGP L3VPN peer relationships are established between PE1, PE2, and PE3. As shown in Figure 3, after PE1 learns IP1 from CE1, it allocates a private network label Label2 and sends it to the remote PE2 and PE3 respectively. As shown in Figure 4, CE2 sends a Layer 3 message to CE1 with the destination IP address being the destination IP (for example, 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 allocated by P1 and the private network label Label2 allocated 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 through P2, PE3 generates an MPLS message. The MPLS message 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. 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. 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 received by PE1 is Label2. Therefore, PE1 cannot distinguish whether the traffic comes from PE2 or PE3 in the inbound direction. The message structure shown in FIG. 4 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.

由上可知,目前在基于MPLS技术进行转发的一些网络场景下,比如在EVPN over MPLS场景和MPLS L3VPN场景下,网络设备难以在入方向实现对网络流量的精确统计。基于此,本申请提供了一种技术方案,网络设备在生成报文时,在报文的MPLS头和报文净荷之间封装该网络设备的设备标识,然后通过该网络设备与其它网络设备之间建立的LSP向其它网络设备发送生成的报文。由于其它网络设备接收到的报文中携带有该网络设备的设备标识,因此其它网络设备可以解析该报文得到该网络设备的设备标识,并根据该设备标识确定该报文是由该网络设备发送的,进而实现在入方向对网络流量的精确统计。As can be seen from the above, in some network scenarios based on MPLS technology for forwarding, such as EVPN over MPLS 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.

下面从应用场景、方法流程、虚拟装置、实体装置、系统等多个角度对本申请技术方案进行详细介绍。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.

以下对本申请实施例涉及的应用场景举例说明。The following is an illustration of the application scenarios involved in the embodiments of the present application.

本申请的应用场景包括通信网络以及接入该通信网络的站点。该通信网络是MPLS VPN网络,也称为MPLS BGP VPN网络。该通信网络为承载网,例如可以是数据中心网络(data center network,DCN)、城域网、广域网或局域网等,可用于承载EVPN业务和/或L3VPN业务。也就是说,本申请的应用场景可以是EVPN over MPLS场景,或者也可以是MPLS L3VPN场景。此外,该通信网络可以是运营商网络或企业自建网络。The application scenarios of the present application include a communication network and a site connected to the communication network. The communication network is an MPLS VPN 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.

本申请提供的通信网络包括用于业务转发的多个网络设备,该多个网络设备通信连接。每个网络设备可以是交换机或路由器。其中,该多个网络设备包括边缘网络设备和核心网络设备。边缘网络设备处于该通信网络的边缘,用于站点接入该通信网络。核心网络设备连接在不同的边缘网络设备之间,用于在不同边缘网络设备之间进行业务转发。可选地,站点通过边缘接入设备与该通信网络的边缘网络设备连接,以通过该边缘接入设备接入该通信网络,该边缘接入设备可以是交换机、路由器或网关等。本申请实施例以该通信网络为运营商网络为例进行说明,边缘网络设备是PE设备,核心网络设备是P设备,边缘接入设备是CE设备,接入该通信网络的站点内部署有一台或多台主机。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.

例如,图5是本申请实施例提供的一种应用场景的示意图。如图5所示,该应用场景包括通信网络(图5示出的是MPLS VPN)以及连接到该通信网络的CE1~CE2这两个CE设备。该通信网络包括PE1~PE3这三个PE设备,以及P1和P2这两个P设备。PE1分别与P1和P2连接。P1、P2、PE2和PE3两两连接。CE1连接PE1以接入该通信网络。CE2双归连接PE2和PE3以接入该通信网络,即PE2和PE3是CE2的双归接入设备。CE1为站点1的边缘接入设备,用于将站点1内的主机1和主机2接入该通信网络。CE2为站点2的边缘接入设备,用于将站点2内的主机3和主机4接入该通信网络。图5示出的应用场景可以是如图1或图2所示的应用场景, 则该MPLS VPN为EVPN over MPLS。或者,图5示出的应用场景可以是如图3或图4示出的应用场景,则该MPLS VPN为MPLS L3VPN。For example, Figure 5 is a schematic diagram of an application scenario provided by an embodiment of the present application. As shown in Figure 5, the application scenario includes a communication network (Figure 5 shows MPLS VPN) and two CE devices CE1 to CE2 connected to the communication network. The communication network includes three PE devices PE1 to 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 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 for site 1, used to connect host 1 and host 2 in site 1 to the communication network. CE2 is an edge access device for site 2, used to connect host 3 and host 4 in site 2 to the communication network. The application scenario shown in Figure 5 may be the application scenario shown in Figure 1 or Figure 2, Then the MPLS VPN is EVPN over MPLS. Alternatively, the application scenario shown in FIG5 may be the application scenario shown in FIG3 or FIG4 , then the MPLS VPN is MPLS L3VPN.

可选地,PE1、PE2、PE3两两之间互为BGP邻居。本申请实施例中,两个PE设备互为BGP邻居,可以是这两个PE设备之间建立有BGP对等体关系。或者,通信网络中还包括路由反射器,两个PE设备互为BGP邻居,也可以是这两个PE设备分别与该路由反射器建立有BGP对等体关系,即这两个PE设备之间通过该路由反射器间接通信连接。其中,路由反射器用于转发不同PE设备之间传递的消息,且路由反射器在转发过程中不修改接收的消息。在图5示出的应用场景为EVPN over MPLS场景下,例如图1或图2示出的场景下,PE1、PE2、PE3两两之间互为BGP EVPN邻居,设备之间建立的BGP对等体关系为BGP EVPN对等体关系。在图5示出的应用场景为MPLS L3VPN场景下,例如图3或图4示出的场景下,PE1、PE2、PE3两两之间互为BGP L3VPN邻居,设备之间建立的BGP对等体关系为BGP L3VPN对等体关系。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 communicated through the route reflector. Among them, 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. In the application scenario shown in Figure 5, the EVPN over MPLS scenario, for example, in the scenario shown in Figure 1 or Figure 2, PE1, PE2, and PE3 are BGP EVPN neighbors of each other, and the BGP peer relationship established between the devices is a BGP EVPN peer relationship. In the application scenario shown in FIG5 , which is an MPLS L3VPN scenario, for example, in the scenario shown in FIG3 or FIG4 , PE1, PE2, and PE3 are each other's BGP L3VPN neighbors, and the BGP peer relationship established between the devices is a BGP L3VPN peer relationship.

可选地,通信网络中的PE设备中配置有一个或多个转发实例。同一设备中的不同转发实例独立工作,用于实现路由隔离。本申请实施例中,PE设备中的转发实例可以是二层转发实例,也称EVPN实例(EVPN instance,EVI)(对应二层转发域),二层转发实例能够发布MAC路由。一个EVI可以由一个或多个桥接域(bridge domain,BD)组成。或者,PE设备中的转发实例也可以是三层转发实例,也称虚拟路由转发(virtual routing forwarding,VRF)实例(对应三层转发域),三层转发实例能够发布IP路由。其中,每个转发实例均配置有路由目标(route target),也可以称为vpn-target。Route target是一种BGP扩展团体属性,每个转发实例均需要配置出方向和入方向两类route target。本端转发实例配置的出方向route target值与对端转发实例配置的入方向route target值相等时,本端和对端才能相互交换BGP路由。本申请实施例中,互为BGP EVPN邻居的两个PE设备中配置有属于同一EVPN的EVI,这种情况下,也可称为这两个PE设备属于同一EVPN。互为BGP L3VPN邻居的两个PE设备中配置有属于同一L3VPN的VRF实例,这种情况下,也可称为这两个PE设备属于同一L3VPN。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 domain, 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 can also be said to belong 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 can also be said to belong to the same L3VPN.

可选地,PE设备从CE设备学习到MAC路由(或IP路由)之后,需要在通信网络中发布学习到的MAC路由(或IP路由)及其对应的私网标签。PE设备为MAC路由(或IP路由)分配私网标签的方式有多种。比如PE设备可以针对该PE设备中配置的每个转发实例分别分配一个私网标签,那么由该PE设备中的同一转发实例发布的所有MAC路由(或IP路由)对应的私网标签为同一个私网标签。或者,PE设备可以针对每条MAC路由(或IP路由)分别分配一个私网标签。又或者,PE设备可以针对接入的每个CE分别分配一个私网标签,那么该PE设备从同一CE设备学习到的所有MAC路由(或IP路由)对应的私网标签为同一个私网标签。又或者,PE设备可以针对广播域分配一个私网标签,那么该PE设备在该广播域中发布的所有MAC路由对应的私网标签为同一个私网标签。本申请实施例对PE设备分配私网标签的方式不做限定。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.

以下对本申请实施例的方法流程举例说明。The following is an example of the method flow of the embodiment of the present application.

例如,图6是本申请实施例提供的一种报文传输方法的流程示意图。如图6所示,方法600包括步骤601至步骤604。方法600中的设备1和设备2分别是MPLS VPN网络的网络边缘设备,例如可以是路由器、交换机或网关等。设备1和设备2之间建立有LSP,设备3是该LSP上位于设备1和设备2之间的标签交换设备。在该MPLS VPN网络为运营商网络的场景下,方法600中的设备1为入运营商边缘设备(ingress PE),方法600中的设备2为出运营商边缘设备(egress PE)。在该MPLS VPN网络为数据中心网络的场景下,方法600中的设备1为一个入口网关,方法600中的设备2为出口网关。本申请实施例对MPLS VPN网络的实施场景以及网络边缘设备的设备类型不做限定。举例来说,该方法600可以应用于如图5所示的应用场景中。例如,方法600中的设备1是图5示出的PE2或PE3,方法600中的设备2是图5示出的PE1,方法600中的设备3是图5示出的P1或P2。For example, FIG6 is a flow chart of a message transmission method provided by an embodiment of the present application. As shown in FIG6, method 600 includes steps 601 to 604. Device 1 and device 2 in method 600 are 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 embodiment of the present application does not limit the implementation scenario of the MPLS VPN network and the device type of the network edge device. For example, the method 600 can be applied to the application scenario shown in FIG5. For example, device 1 in method 600 is PE2 or PE3 shown in FIG. 5 , device 2 in method 600 is PE1 shown in FIG. 5 , and device 3 in method 600 is P1 or P2 shown in FIG. 5 .

步骤601、设备1生成报文,该报文包括MPLS头、设备1的设备标识和报文净荷,该设备标识封装在该MPLS头与该报文净荷之间。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.

其中,设备1生成的报文为MPLS报文。MPLS报文包括报文头和报文净荷(payload)。报文头包括MPLS头和设备1的设备标识。报文净荷是MPLS报文的内层报文。内层报文可以是二层报文或三层报文,通常为用户边缘设备发送的原始数据报文。三层报文可以是IPv4报文或IPv6报文。本申请实施例中,将MPLS报文中位于报文净荷之前的报文部分称为MPLS报文的报文头。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.

可选地,设备1的设备标识为设备1的路由器标识(router ID)。或者,设备1的设备标识还可以是设备1 的IP地址、设备1的硬件地址或设备1的MAC地址等能够在通信网络中唯一标识设备1的信息。本申请实施例对设备标识的类型不做限定。设备1的设备标识的长度可以是2字节、4字节、6字节或8字节等,本申请实施例对设备标识的长度不做限定。例如,设备1的设备标识为设备1的router ID,相应地,设备1的设备标识的长度为4字节。本申请以下实施例均以设备标识的长度为4字节为例进行说明。Optionally, the device identification of device 1 is a router identification (router ID) of device 1. Alternatively, the device identification of device 1 may also be a router identification (router ID) of device 1. The information that can uniquely identify device 1 in the communication network, such as the IP address of device 1, the hardware address of device 1, or the MAC address of device 1. The embodiment of the present application does not limit the type of device identification. The length of the device identification of device 1 can 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.

可选地,设备1接收到用户边缘设备发送的原始数据报文之后,生成MPLS报文。例如,图7是本申请实施例提供的一种MPLS报文的结构示意图。如图7所示,该MPLS报文包括报文头和报文净荷。其中,报文头包括MAC头、MPLS头和设备1的设备标识。MPLS头包括LSP标签(可选)和VPN标签。报文净荷为设备1接收到的来自用户边缘设备的原始数据报文。Optionally, after receiving the original data message sent by the user edge device, device 1 generates an MPLS message. For example, Figure 7 is a schematic diagram of the structure of an MPLS message provided in an embodiment of the present application. As shown in Figure 7, the MPLS message includes a message header and a message payload. Among them, 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.

可选地,设备1的设备标识可以设置在MPLS报文的不同位置,本申请实施例以下面三种可能实现方式为例进行说明。其中,设备标识在MPLS报文中的设置位置可以在协议或标准中定义。或者,网络边缘设备之间可以协商确定设备标识在MPLS报文中的设置位置。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.

第一种可能实现方式,设备1生成的报文包括控制字,该控制字用于携带设备1的设备标识。换句话来说,设备1的设备标识是该报文中的控制字。这种实现方式下,设备1生成的报文例如可以如图8所示。可选地,该控制字为4字节的控制字。这种实现方式无需改变原有MPLS报文的格式,只需在接收侧的网络边缘设备中配置解析控制字和识别设备标识的能力,以及在发送侧的网络边缘设备中配置将控制字设置为设备标识的能力即可。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 shown in Figure 8, for example. Optionally, the control word is a 4-byte control word. This implementation does not require changing the format of the original MPLS message, but only requires configuring the ability to parse the control word and identify the device identification in the network edge device on the receiving side, and configuring the ability to set the control word as the device identification in the network edge device on the sending side.

第二种可能实现方式,设备1生成的报文包括控制字,设备1的设备标识与该控制字邻接。可选地,设备1的设备标识位于控制字之后。这里的控制字指4字节的原始控制字。这种实现方式下,设备1生成的报文例如可以如图9所示。可选地,设备1生成的报文包括8字节的长控制字。该长控制字的4字节用于携带原始控制字,该长控制字的其它4字节用于携带设备1的设备标识。比如该长控制字的高4字节用于携带原始控制字,该长控制字的低4字节用于携带设备1的设备标识,即设备1的设备标识在该长控制字的低4字节中。这种实现方式无需改变原始控制字,不会影响原始控制字的功能。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 control word of 4 bytes. Under this implementation, the message generated by device 1 can be shown in Figure 9, for example. Optionally, the message generated by device 1 includes an 8-byte long control word. The 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.

第三种可能实现方式,设备1生成的报文中的MPLS头的栈底标签指示与该栈底标签邻接的为设备1的设备标识。换句话来说,设备1的设备标识邻接在MPLS头的栈底标签之后。这种实现方式下,设备1生成的报文例如可以如图10所示。In a third possible implementation, the stack 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 stack bottom label. In other words, the device identifier of device 1 is adjacent to the stack bottom label of the MPLS header. In this implementation, the message generated by device 1 may be, for example, as shown in FIG. 10 .

可选地,栈底标签可单独指示邻接在该栈底标签之后的为设备1的设备标识。比如栈底标签为预先配置的静态标签,或设备2分配的动态标签,或指定的基本特殊用途标签(bSPL)。在栈底标签为预先配置的静态标签的情况下,设备1和设备2中各自预先配置有该静态标签。其中设备1中预先配置的该静态标签用于携带在发往设备2的报文的标签栈栈底,以指示该静态标签之后携带有设备1的设备标识。设备2中预先配置的该静态标签用于解析设备2接收到的报文的栈底标签,以判断该栈底标签之后是否携带有发送该报文的设备的设备标识。在栈底标签为设备2分配的动态标签的情况下,设备2可以生成该动态标签并发送给设备1。在栈底标签为指定的bSPL的情况下,可以在标准或协议定义该指定的bSPL,比如标准或协议定义:当作为栈底标签的bSPL取值为指定标签值时,指示该栈底标签之后携带有设备标识。本申请实施例对该指定标签值的具体取值不做限定。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 device 1 and device 2 respectively. 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.

或者,栈底标签与标签栈中的其它标签共同指示邻接在该栈底标签之后的为设备1的设备标识。比如栈底标签为指定的扩展特殊用途标签(eSPL),当报文的标签栈中携带该eSPL时,该标签栈还携带一个特殊标签,该特殊标签用于指示其后邻接的标签为eSPL。也就是说,栈底标签与该特殊标签共同指示邻接在该栈底标签之后的为设备1的设备标识,具体来说,该特殊标签指示邻接在该特殊标签之后的标签为eSPL,该指定的eSPL(栈底标签)指示邻接在该eSPL之后的为设备1的设备标识。其中,该特殊标签可以是标签值为15的扩展标签(extension label,XL)。在栈底标签为指定的eSPL的情况下,可以在标准或协议定义该指定的eSPL,比如标准或协议定义:当作为栈底标签的eSPL取值为指定标签值时,指示该栈底标签之后携带有设备标识。可选地,eSPL的取值范围为16~1048,可以将其中的任意标签值定义为该指定标签值。本申请实施例对该指定标签值的具体取值不做限定。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. For example, when the bottom label 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. That is to say, the bottom label 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) indicates that the device identifier of device 1 is adjacent to the eSPL. The special label may be an extension label (XL) with a label value of 15. When the bottom label of the stack is a designated eSPL, the designated eSPL may be defined in a standard or protocol, such as a standard or protocol definition: when the eSPL as the bottom label 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.

在EVPN over MPLS场景下,通信网络中的网络设备之间传输的MPLS报文的报文净荷为二层报文。为避免该二层报文被通信网络中的网络设备误识别为IPv4报文或IPv6报文,网络边缘设备之间可以协商控制字(control word,CW)能力,发送侧的网络边缘设备可以在MPLS头与报文净荷之间插入控制字。控制字的长度为4字节,控制字通常设置为全0,这样可以避免通信网络中的中间网络设备(比如P设备)将二层报 文误识别为IPv4报文或IPv6报文,从而进行错误地负载分担而导致报文乱序。对控制字的定义和功能的具体解释可参考编号为7432的请求评论(request for comments,RFC)(简称:RFC 7432)文档,本申请实施例在此不再赘述。In the EVPN over MPLS scenario, the payload of the MPLS message transmitted between network devices in the communication network is a Layer 2 message. 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. The network edge device on the sending side can insert the control word between the MPLS header and the message payload. The control word is 4 bytes long and is usually set to all 0s. This can prevent the intermediate network devices (such as P devices) in the communication network from misidentifying the Layer 2 message as an IPv4 message or an IPv6 message. The control word is misidentified as an IPv4 message or an IPv6 message, thereby performing incorrect load sharing and causing message disorder. The definition and function of the control word can be explained in detail in the request for comments (RFC) numbered 7432 (abbreviated as RFC 7432), which will not be described in detail in the present application.

可选地,在设备1与设备2互为BGP EVPN邻居的情况下,如果设备1与设备2之间协商了CW能力,那么设备1可以采用上述第一种可能实现方式或第二种可能实现方式在报文中携带设备1的设备标识。或者,设备1也可以采用上述第三种可能实现在报文中携带设备1的设备标识。设备1采用上述会第一种可能实现方式时,为了避免与控制字原有功能冲突,如果设备2的设备标识的前4比特(bit)的值是4(对应二进制:0100)或者6(对应二进制:0110),则可以将设备标识的前4bit的值映射为非4且非6,以避免通信网络中的中间网络设备将接收到的二层报文误识别为IPv4报文或IPv6报文。例如,如果设备2的设备标识的前4bit的值为4,则可以将该前4bit的值映射为14(对应二进制:1110)。如果设备2的设备标识的前4bit的值为6,则可以将该前4bit的值映射为15(对应二进制:1111)。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 or the second possible implementation. Alternatively, device 1 may carry the device identifier of device 1 in the message using the third possible implementation. When device 1 uses the first possible implementation, 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, so as to prevent 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).

可选地,在设备1与设备2互为BGP L3VPN邻居的情况下,设备1可以采用上述第三种可能实现在报文中携带设备1的设备标识。也就是说,上述第三种实现方式通用于EVPN over MPLS场景和MPLS L3VPN场景。Optionally, when device 1 and device 2 are BGP L3VPN neighbors, device 1 can 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.

步骤602、设备1通过设备1和设备2之间建立的LSP向设备2发送该报文。Step 602: Device 1 sends the message to device 2 through the LSP established between device 1 and device 2.

以图5示出的应用场景为例,假设站点2中的主机3与站点1中的主机1属于同一私有网络,当主机3需要跨站点向主机1发送数据报文时,该数据报文会依次经过CE2、MPLS VPN网络和CE1,最终到达主机1。其中,CE2到CE1在MPLS VPN网络中的传输路径有4条,包括传输路径1:CE2→PE2→P1→PE1→CE1,传输路径2:CE2→PE2→P2→PE1→CE1,传输路径3:CE2→PE3→P1→PE1→CE1,以及传输路径4:CE2→PE3→P2→PE1→CE1。假设设备2为图5示出的应用场景中的PE1,设备1为图5示出的应用场景中的PE2,PE2接收到CE2发送的数据报文之后,生成包含该数据报文的MPLS报文,之后PE2向PE1发送生成的MPLS报文,该MPLS报文可以通过传输路径1或传输路径2传输。Taking the application scenario shown in FIG5 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, MPLS VPN 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. Assuming that device 2 is PE1 in the application scenario shown in FIG5, and device 1 is PE2 in the application scenario shown in FIG5, 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, and the MPLS packet can be transmitted through transmission path 1 or transmission path 2.

位于设备1和设备2之间的设备3接收到设备1发送的报文之后,基于MPLS协议继续向设备2发送报文。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.

步骤603、设备2解析报文,得到设备1的设备标识。Step 603: Device 2 parses the message and obtains the device identification of device 1.

可选地,设备2通过设备2和设备1之间建立的LSP接收设备3发送的报文之后,可以根据与设备1协商确定的设备标识在报文头的设置位置,或者协议或标准中定义的设备标识在报文头的设置位置,从对应的设置位置解析得到设备1的设备标识。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.

结合上述步骤601中的第一种可能实现方式,设备2通过解析报文中的控制字得到设备1的设备标识。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.

结合上述步骤601中的第二种可能实现方式,设备2通过解析报文中邻接在控制字之后的字段得到设备1的设备标识。比如设备2可以解析报文中邻接在控制字之后的4字节内容得到设备1的设备标识。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.

结合上述步骤601中的第三种可能实现方式,设备2先解析报文的标签栈,在确定该标签栈的栈底标签指示与该栈底标签邻接的为设备标识之后,设备2进一步解析邻接在该栈底标签之后的字段得到设备1的设备标识。比如设备2可以解析报文中邻接在该栈底标签之后的4字节内容得到设备1的设备标识。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.

步骤604、设备2根据该设备标识确定该报文来自设备1。Step 604: Device 2 determines that the message comes from device 1 according to the device identifier.

由于设备2接收到的报文中携带有设备1的设备标识,因此设备2可以确定该报文来自设备1。进而可以实现对来自设备1的报文进行流量统计。结合上述步骤602中的例子,对于PE1来说,PE1接收到P1或P2发送的MPLS报文之后,根据该MPLS报文中的VPN标签仅可以确定该MPLS报文来自PE2或PE3,而根据该MPLS报文中携带的PE2的设备标识可以明确确定该MPLS报文来自PE2,也就是说,PE1可以区分流量是来自PE2还是PE3的,进而可以实现在入方向对网络流量的精确统计。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.

或者,设备2也可以不对来自设备1的报文进行流量统计,例如可以将获得的设备标识和流量信息统一上报给控制设备,由控制设备根据不同的设备标识对来自不同设备的报文进行流量统计。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.

在本申请实施例提供的报文传输方法中,网络设备在生成报文时,在报文的MPLS头和报文净荷之间封装该网络设备的设备标识,然后向其它网络设备发送生成的报文。由于其它网络设备接收到的报文中携带有该网络设备的设备标识,因此其它网络设备可以解析该报文得到该设备标识,并根据该设备标识确定该报文是由该网络设备发送的。进而能够在基于MPLS技术进行转发的网络场景下,实现对网络流量的精确统计。比如在EVPN over MPLS场景或MPLS L3VPN场景下,实现对网络流量的精确统计。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, 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 over MPLS scenario or an MPLS L3VPN scenario, accurate statistics of network traffic can be achieved.

可选地,设备1在生成的MPLS报文中携带设备1的设备标识的能力,以及设备2解析接收到的MPLS报 文中的设备标识的能力可以是手动配置的。或者,设备1与设备2之间也可以协商在报文中携带设备1的设备标识的能力。例如在上述步骤601执行之前,设备2生成能力协商信息,该能力协商信息用于在设备1和设备2之间协商在设备1向设备2发送的MPLS报文中携带设备1的设备标识的能力,然后设备2向设备1发送该能力协商信息。具体来说,该能力协商信息指示设备1在向设备2发送的报文中携带设备1的设备标识,以及设备2具备解析报文所携带的设备标识的能力。可选地,该能力协商信息还指示设备1的设备标识在报文中的设置位置。Optionally, the device 1 carries the device identification of the device 1 in the generated MPLS message, and the device 2 parses the received MPLS message. The capability of the device identifier in the text can be manually configured. Alternatively, the capability of carrying the device identifier of device 1 in the message can 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 the capability of carrying 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 capability 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.

可选地,设备1在接收到设备2发送的该能力协商信息之后,向设备2发送能力协商响应。该能力协商响应指示设备1具备在报文中携带设备1的设备标识的能力。这样设备2能够明确知道设备1是否具备在报文中携带设备标识的能力,能够提高能力协商可靠性。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.

或者,设备1也可以不响应设备2发送的能力协商信息。后续设备2接收到报文之后,可以自行判断接收到的报文的指定位置是否携带有发送该报文的网络边缘设备的设备标识。比如在上述步骤601中的第一种可能实现方式下,设备2可以根据接收到的报文的控制字是否为全0来判断该控制字是否为设备标识。如果报文的控制字为全0,则设备2确定该报文未携带有设备标识。如果报文的控制字不为全0,则设备2确定该报文的控制字为发送该报文的网络边缘设备的设备标识。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.

可选地,设备2向设备1发送的能力协商信息携带在BGP更新(BGP update)消息中,比如可以携带在BGP更新消息的一种扩展团体属性中,也就是说,设备2可以采用BGP更新消息与设备1协商在报文中携带设备1的设备标识的能力。或者,设备2向设备1发送的能力协商信息也可以携带在基于其它协议实现的消息中,其它协议例如可以是路径计算单元协议(Path Computation Element Protocol,PCEP)。又或者,设备2向设备1发送的能力协商信息也可以携带自定义格式的消息中。本申请以下实施例以能力协商信息携带在BGP更新消息的一种扩展团体属性中发布为例进行说明。本申请实施例将携带能力协商信息的扩展团体属性称为能力协商扩展团体属性。Optionally, the capability negotiation information sent by device 2 to device 1 is carried in a BGP update (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.

例如,图11是本申请实施例提供的一种BGP更新消息的结构示意图。如图11所示,该BGP更新消息包括以太网头部(Ethernet header)、IP头部(IP header)、传输控制协议(Transmission Control Protocol,TCP)头部(TCP header)、BGP数据包以及帧校验序列(frame check sequence,FCS)。其中,BGP数据包中包括BGP头部以及BGP消息字段。该BGP头部中包括标志(maker)字段、长度(length)字段和类型(type)字段(图中未示出)。该BGP消息字段包括地址族标识符(address family identifier)、后续地址族标识符(subsequent address family identifier)、下一跳网络地址长度(length of next hop network address)、下一跳网络地址(next hop network address)、保留(reserved)字段、网络层可达信息(network layer reachability information,NLRI)、能力协商扩展团体属性以及其它路径属性(path attribute)。其中,地址族标识符、后续地址族标识符、下一跳网络地址长度、下一跳网络地址、保留字段和NLRI统称为多协议可达NLRI(MP_REACH_NLRI)属性。可选地,能力协商扩展团体属性包括类型字段、子类型字段、标记位字段和保留字段。可以定义当扩展团体属性的类型字段和子类型字段为某个值时,表示该扩展团体属性为能力协商扩展团体属性,即该扩展团体属性携带有上述能力协商信息。另外,能力协商扩展团体属性的标记位字段可用于指示设备标识在报文中的设置位置。该标记位字段的不同位可用于指示设备标识在报文中的不同设置位置。该BGP消息字段中的其它字段的解释可参考RFC 4760文档中的定义,本申请实施例在此不再赘述。For example, FIG. 11 is a schematic diagram of the structure of a BGP update message provided in an embodiment of the present application. As shown in FIG. 11, 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 next hop network address length, a next hop network address, a reserved field, a 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 next-hop network address length, the next-hop network address, the reserved field and the NLRI are collectively referred to as the multi-protocol reachable NLRI (MP_REACH_NLRI) attribute. Optionally, the capability negotiation extended group attribute includes a type field, a subtype field, a tag 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 indicates 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 tag 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 tag 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 RFC 4760 document, and the embodiments of the present application will not be repeated here.

第一种实施场景,设备1与设备2属于同一EVPN,即设备1和设备2中配置有属于同一EVPN的EVI实例。换句话来说,设备1与设备2互为BGP EVPN邻居。这种实施场景即上述EVPN over MPLS场景。设备2可以向设备1发送BGP EVPN路由,该BGP EVPN路由包括能力协商扩展团体属性,该能力协商扩展团体属性用于携带能力协商信息。也就是说,能力协商信息可以在BGP EVPN路由中发布。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.

可选地,该BGP EVPN路由可以是BGP NLRI中定义的Type1路由(以太自动发现路由(Ethernet auto-discovery route))、Type2路由(MAC/IP路由)或Type3路由(集成多播以太标签路由(inclusive multicast Ethernet tag route))。其中,Type1路由用于描述设备的链路状态和开销。Type2路由用于通告主机MAC地址、主机地址解析协议(Address Resolution Protocol,ARP)映射(即IP地址和MAC地址的对应关系)或主机IP地址,也即是,Type2路由可用于通告二层路由信息和/或三层路由信息。当Type2路由用于通告主机ARP映射时,Type2路由也可称为ARP类型路由。当Type2路由用于通告主机IP地址时,Type2路由也可称为集成路由和桥接(integrated routing and bridge,IRB)类型路由。Type3路由用于建立网络边缘设备(比如PE)之 间的BUM(广播(broadcast),未知单播(unknown-unicast),多播(multicast))树。当然,上述BGP EVPN路由也可以是BGP NLRI中定义的其它类型路由,或者还可以是后续演变的其它类型路由,本申请实施例对BGP EVPN路由的类型不作限定。BGP EVPN路由可以携带在图11示出的BGP消息字段中的NLRI。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 the Layer 2 routing information and/or the 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 network edge devices (such as PE) Of course, the above-mentioned BGP EVPN route can also be other types of routes defined in BGP NLRI, or other types of routes evolved subsequently. The embodiment of the present application does not limit the type of BGP EVPN route. The BGP EVPN route can carry the NLRI in the BGP message field shown in FIG. 11.

上述第一种实施场景下的第一种可能实现方式,设备2向设备1发送的能力协商信息用于在设备1和设备2之间协商在报文的控制字中携带设备1的设备标识的能力。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.

可选地,控制字为4字节的控制字。该4字节的控制字用于携带设备1的设备标识。这种实施方案的主要思想是,设备1与设备2之间协商控制字能力,通过在控制字中携带设备1的设备标识,这样报文到达设备2后,设备2利用控制字信息可确定该报文来自设备1。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.

可选地,设备2向设备1发送的能力协商信息还指示将设备1的设备标识设置在该4字节的控制字中。例如以能力协商扩展团体属性的标记位字段的长度为16bit(0~15位)为例,图12是本申请实施例提供的一种能力协商扩展团体属性的结构示意图。如图12所示,通过将该能力协商扩展团体属性的标记位的第15位设置为1,其余位设置为0,以指示将报文中4字节的控制字设置为设备1的设备标识。这种情况下,设备1可以生成如图8所示的报文。Optionally, the capability negotiation information sent by device 2 to device 1 also 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 group attribute as 16 bits (0 to 15 bits), Figure 12 is a schematic diagram of the structure of a capability negotiation extended group attribute provided by an embodiment of the present application. As shown in Figure 12, by setting the 15th bit of the tag bit of the capability negotiation extended group attribute to 1 and the remaining bits to 0, it is indicated that the 4-byte control word in the message is set to the device identification of device 1. In this case, device 1 can generate a message as shown in Figure 8.

例如在图5示出的应用场景中,主机3的MAC地址为SMAC,主机1的MAC地址为DMAC,则主机3向主机1发送的报文的目的MAC地址为DMAC、源MAC地址为SMAC。PE1为PE2和PE3分配的私网标签均为Label1。P1分配的公网标签为LSP1,P2分配的公网标签为LSP2。主机3向主机1发送的报文在CE2与CE1之间的传输过程可参考图13,图13是本申请实施例提供的一种在EVPN over MPLS场景下的报文传输示意图。参考图2示出的例子,CE2向CE1发送目的MAC地址为DMAC、源MAC地址为SMAC的报文时,如果该报文由PE2通过P1发往PE1,则PE2生成的报文会携带公网标签LSP1、私网标签Label1和控制字(CW),该控制字携带有PE2的设备标识(CW(PE2))。相应地,PE1接收到来自PE2的报文之后,解析该报文中的控制字得到PE2的设备标识,进而确定该报文是由PE2发送的。如果该报文由PE3通过P2发往PE1,则PE3生成的报文会携带公网标签LSP2、私网标签Label1和控制字,该控制字携带有PE3的设备标识。相应地,PE1接收到来自PE3的报文之后,解析该报文中的控制字得到PE3的设备标识,进而确定该报文是由PE3发送的。因此,PE1可以支持入方向区分PE的流量统计。For example, in the application scenario shown in FIG5 , the MAC address of host 3 is SMAC, and the MAC address of host 1 is DMAC. Then, 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 labels assigned by PE1 to PE2 and PE3 are both 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 FIG13 , which is a schematic diagram of message transmission in an EVPN over MPLS scenario provided by an embodiment of the present application. Referring to the example shown in FIG2 , 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 a message from PE2, it parses the control word in the message to obtain the device ID of PE2, and then determines that the message is sent by PE2. If the message is sent from PE3 to PE1 through 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 ID of PE3. Accordingly, after PE1 receives a message from PE3, it parses the control word in the message to obtain the device ID 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.

可选地,控制字为8字节的长控制字,该长控制字的4字节用于携带原始控制字,该长控制字的其它4字节用于携带设备1的设备标识。这种实施方案的主要思想是,设备1与设备2之间协商长控制字(long control word,LCW)能力,在长控制字的高4字节携带原始控制字,在长控制字的低4字节携带设备1的设备标识,这样报文到达设备2后,设备2利用长控制字的低4字节可确定该报文来自设备1。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, carry the original control word in the upper 4 bytes of the long control word, and carry the device identification of device 1 in the lower 4 bytes of the long control word, 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.

可选地,设备2向设备1发送的能力协商信息还指示将设备1的设备标识设置在该长控制字的低4字节中。例如以能力协商扩展团体属性的标记位字段的长度为16bit(0~15位)为例,图14是本申请实施例提供的另一种能力协商扩展团体属性的结构示意图。如图14所示,通过将该能力协商扩展团体属性的标记位的第14位设置为1,其余位设置为0,以指示将报文中长控制字的低4字节设置为设备1的设备标识。这种情况下,设备1可以生成如图9所示的报文。Optionally, the capability negotiation information sent by device 2 to device 1 also 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 group attribute as 16 bits (0 to 15 bits), Figure 14 is a schematic diagram of the structure of another capability negotiation extended group attribute provided by an embodiment of the present application. As shown in Figure 14, by setting the 14th bit of the tag bit of the capability negotiation extended group attribute to 1 and the remaining bits to 0, it is indicated that the lower 4 bytes of the long control word in the message are set to the device identification of device 1. In this case, device 1 can generate a message as shown in Figure 9.

例如在图5示出的应用场景中,主机3的MAC地址为SMAC,主机1的MAC地址为DMAC,则主机3向主机1发送的报文的目的MAC地址为DMAC、源MAC地址为SMAC。PE1为PE2和PE3分配的私网标签均为Label1。P1分配的公网标签为LSP1,P2分配的公网标签为LSP2。主机3向主机1发送的报文在CE2与CE1之间的传输过程可参考图15,图15是本申请实施例提供的另一种在EVPN over MPLS场景下的报文传输示意图。参考图2示出的例子,CE2向CE1发送目的MAC地址为DMAC、源MAC地址为SMAC的报文时,如果该报文由PE2通过P1发往PE1,则PE2生成的报文会携带公网标签LSP1、私网标签Label1和长控制字(LCW),该长控制字的高4字节携带有原始控制字(LCW(0)),该长控制字的低4字节携带有PE2的设备标识(LCW(PE2))。相应地,PE1接收到来自PE2报文之后,解析该报文中的长控制字的低4字节得到PE2的设备标识,进而确定该报文是由PE2发送的。如果该报文由PE3通过P2发往PE1,则PE3生成的报文会携带公网标签LSP2、私网标签Label1和长控制字(LCW),该长控制字的高4字节携带有原始控制字(LCW(0)),该长控制字的低4字节携带有PE3的设备标识(LCW(PE3))。相应地,PE1接收到来自PE3的报文之后,解析该报文中的长控制字的低4字节得到PE3的设备标识,进而确定该报文是由PE3发送的。因此,PE1可以支持入方向区分PE的流量统计。For example, in the application scenario shown in Figure 5, 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 labels assigned by PE1 to PE2 and PE3 are both 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 Figure 15, which is another schematic diagram of message transmission in the EVPN over MPLS scenario provided in an embodiment of the present application. Referring to the example shown in FIG2 , 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 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 the public network label LSP2, the private network label Label1, and the long control word (LCW). The upper 4 bytes of the long control word carry the original control word (LCW(0)), and the lower 4 bytes of the long control word carry the device identifier of PE3 (LCW(PE3)). Accordingly, after PE1 receives the message from PE3, it 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 that distinguish PEs in the inbound direction.

上述第一种实施场景下的第二种可能实现方式,设备2向设备1发送的能力协商信息用于在设备1和设 备2之间协商在报文的栈底标签之后携带设备1的设备标识的能力。In the second possible implementation manner of the first implementation scenario, the capability negotiation information sent by device 2 to device 1 is used to negotiate the capability between device 1 and device 1. Device 2 negotiates with device 1 to carry the device identifier of device 1 after the bottom label of the packet.

可选地,栈底标签为预先配置的静态标签,或设备2分配的动态标签,或指定的bSPL。这种实施方案的主要思想是,设备1与设备2之间协商一种标签指示能力,由栈底标签指示标签栈之后的4字节携带设备1的设备标识,这样报文到达设备2后,设备2利用栈底标签之后的4字节可确定该报文来自设备1。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.

可选地,设备2向设备1发送的能力协商信息还指示将栈底标签设置为上述预先配置的静态标签,或设备2分配的动态标签,或指定的bSPL,并指示将设备1的设备标识设置在栈底标签之后的4字节。例如以能力协商扩展团体属性的标记位字段的长度为16bit(0~15位)为例,图16是本申请实施例提供的又一种能力协商扩展团体属性的结构示意图。如图16所示,通过将该能力协商扩展团体属性的标记位的第13位设置为1,其余位设置为0,以指示将报文中的栈底标签设置为指定的bSPL,并将栈底标签之后的4字节设置为设备1的设备标识。这种情况下,设备1可以生成如图10所示的报文,其中栈底标签为指定的bSPL。Optionally, the capability negotiation information sent by device 2 to device 1 also 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 group attribute as 16 bits (0 to 15 bits), Figure 16 is a structural schematic diagram of another capability negotiation extended group attribute provided by an embodiment of the present application. As shown in Figure 16, by setting the 13th bit of the tag bit of the capability negotiation extended group 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 bSPL, and the 4 bytes after the stack bottom label are set to the device identifier of device 1. In this case, device 1 can generate a message as shown in Figure 10, in which the stack bottom label is the specified bSPL.

例如在图5示出的应用场景中,主机3的MAC地址为SMAC,主机1的MAC地址为DMAC,则主机3向主机1发送的报文的目的MAC地址为DMAC、源MAC地址为SMAC。PE1为PE2和PE3分配的私网标签均为Label1。P1分配的公网标签为LSP1,P2分配的公网标签为LSP2。主机3向主机1发送的报文在CE2与CE1之间的传输过程可参考图17,图17是本申请实施例提供的又一种在EVPN over MPLS场景下的报文传输示意图。参考图2示出的例子,CE2向CE1发送目的MAC地址为DMAC、源MAC地址为SMAC的报文时,如果该报文由PE2通过P1发往PE1,则PE2生成的报文会携带公网标签LSP1、私网标签Label1和上述某种栈底标签(LabelS),该栈底标签之后的4字节携带有PE2的设备标识(PE2)。相应地,PE1接收到来自PE2的报文之后,解析该报文的栈底标签确定该栈底标签之后的4字节中携带有设备标识,然后从该栈底标签之后的4字节得到PE2的设备标识,进而确定该报文是由PE2发送的。如果该报文由PE3通过P2发往PE1,则PE3生成的报文会携带公网标签LSP2、私网标签Label1和上述某种栈底标签(LabelS),该栈底标签之后的4字节携带有PE3的设备标识(PE3)。相应地,PE1接收到来自PE3的报文之后,解析该报文的栈底标签确定该栈底标签之后的4字节中携带有设备标识,然后从该栈底标签之后的4字节得到PE3的设备标识,进而确定该报文是由PE3发送的。因此,PE1可以支持入方向区分PE的流量统计。For example, in the application scenario shown in FIG5 , the MAC address of host 3 is SMAC, and the MAC address of host 1 is DMAC. Then, 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 labels assigned by PE1 to PE2 and PE3 are both 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 FIG17 , which is another schematic diagram of message transmission in the EVPN over MPLS scenario provided by an embodiment of the present application. Referring to the example shown in FIG2 , 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 a certain bottom-of-stack label (LabelS) mentioned above, and the 4 bytes after the bottom-of-stack label carry the device identifier of PE2 (PE2). Accordingly, after PE1 receives a message from PE2, it parses the stack bottom label of the message to determine that the 4 bytes after the stack bottom label carry a device identifier, and then obtains the device identifier of PE2 from the 4 bytes after the stack bottom label, thereby determining that the message is sent by PE2. If the message is sent from PE3 to PE1 through P2, the message generated by PE3 will carry the public network label LSP2, the private network label Label1, and a certain stack bottom label (LabelS) mentioned above, and the 4 bytes after the stack bottom label carry the device identifier of PE3 (PE3). Accordingly, after PE1 receives a message from PE3, it parses the stack bottom label of the message to determine that the 4 bytes after the stack bottom label carry a device identifier, and then obtains the device identifier of PE3 from the 4 bytes after the stack bottom label, thereby determining that the message is sent by PE3. Therefore, PE1 can support traffic statistics that differentiate PEs in the inbound direction.

可选地,栈底标签为指定的eSPL,当报文的标签栈中携带该eSPL时,标签栈还携带一个特殊标签,该特殊标签用于指示其后邻接的标签为eSPL。这种实施方案的主要思想是,设备1与设备2之间协商一种扩展标签指示能力,由栈底指定的eSPL指示标签栈之后的4字节携带设备1的设备标识,这样报文到达设备2后,设备2利用栈底标签之后的4字节可确定该报文来自设备1。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.

可选地,设备2向设备1发送的能力协商信息还指示将栈底标签设置为指定的eSPL,并指示将设备1的设备标识设置在栈底标签之后的4字节。例如以能力协商扩展团体属性的标记位字段的长度为16bit(0~15位)为例,图18是本申请实施例提供的再一种能力协商扩展团体属性的结构示意图。如图18所示,通过将该能力协商扩展团体属性的标记位的第12位设置为1,其余位设置为0,以指示将报文中的栈底标签设置为指定的eSPL,且该eSPL之前设置有扩展标签(XL),并将栈底标签之后的4字节设置为设备1的设备标识。这种情况下,设备1可以生成如图10所示的报文,其中栈底标签为指定的eSPL。Optionally, the capability negotiation information sent by device 2 to device 1 also indicates that the stack bottom label is set to a 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 group attribute as 16 bits (0 to 15 bits), Figure 18 is a structural schematic diagram of another capability negotiation extended group attribute provided by an embodiment of the present application. As shown in Figure 18, by setting the 12th bit of the tag bit of the capability negotiation extended group 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 identifier of device 1. In this case, device 1 can generate a message as shown in Figure 10, in which the stack bottom label is the specified eSPL.

例如在图5示出的应用场景中,主机3的MAC地址为SMAC,主机1的MAC地址为DMAC,则主机3向主机1发送的报文的目的MAC地址为DMAC、源MAC地址为SMAC。PE1为PE2和PE3分配的私网标签均为Label1。P1分配的公网标签为LSP1,P2分配的公网标签为LSP2。主机3向主机1发送的报文在CE2与CE1之间的传输过程可参考图19,图19是本申请实施例提供的再一种在EVPN over MPLS场景下的报文传输示意图。参考图2示出的例子,CE2向CE1发送目的MAC地址为DMAC、源MAC地址为SMAC的报文时,如果该报文由PE2通过P1发往PE1,则PE2生成的报文会携带公网标签LSP1、私网标签Label1、扩展标签(XL)和指定的eSPL,该eSPL为栈底标签,该栈底标签之后的4字节携带有PE2的设备标识(PE2)。相应地,PE1接收到来自PE2报文之后,解析该报文的扩展标签确定该扩展标签之后携带有eSPL,解析作为栈底标签的该eSPL确定该栈底标签之后的4字节中携带有设备标识,然后从该栈底标签之后的4字节得到PE2的设备标识,进而确定该报文是由PE2发送的。如果该报文由PE3通过P2发往PE1,则PE3生成的报文会携带公网标签LSP2、私网标签Label1、扩展标签(XL)和指定的eSPL,该eSPL为栈底标签,该栈底标签之后的4字节携带有PE3的设备标识(PE3)。相应地,PE1接收到来自PE3的报文之后,解析该报文的扩展标签确定该扩展标签之后携带有eSPL,解析作为栈底标签的该eSPL确定该栈底标签之后的4字节中携带有设备标识,然后从该栈底标签之后的4字节得到PE3的设备标识,进而确定该报文是由PE3发送的。因此,PE1可以支持入方 向区分PE的流量统计。For example, in the application scenario shown in Figure 5, the MAC address of host 3 is SMAC, and the MAC address of host 1 is DMAC, then 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 labels assigned by PE1 to PE2 and PE3 are both 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 Figure 19, which is another schematic diagram of message transmission in the EVPN over MPLS scenario provided in an embodiment of the present application. Referring to the example shown in FIG2 , 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, an extended label (XL) and a specified eSPL, the eSPL being the bottom label, and the 4 bytes after the bottom label carrying 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 the inbound Traffic statistics to different PEs.

第二种实施场景,设备1与设备2属于同一L3VPN,即设备1和设备2中配置有属于同一L3VPN的VRF实例。换句话来说,设备1与设备2互为BGP L3VPN邻居。这种实施场景即上述MPLS L3VPN场景。设备2可以向设备1发送BGP L3VPN路由,该BGP L3VPN路由包括能力协商扩展团体属性,该能力协商扩展团体属性用于携带能力协商信息。也就是说,能力协商信息可以在L3VPN路由中发布。L3VPN路由可以携带在图11示出的BGP消息字段中的NLRI。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, the capability negotiation information can be published in the L3VPN route. The L3VPN route can carry the NLRI in the BGP message field shown in Figure 11.

上述第二种实施场景下的一种可能实现方式,设备2向设备1发送的能力协商信息用于在设备1和设备2之间协商在报文中通过在栈底标签之后携带设备1的设备标识的能力。可选地,栈底标签为预先配置的静态标签,或设备2分配的动态标签,或指定的bSPL。或者,栈底标签为指定的eSPL,当报文的标签栈中携带该eSPL时,标签栈还携带一个特殊标签,该特殊标签用于指示其后邻接的标签为eSPL。这种实现方式的具体解释可参考上述第一种实施场景下的第二种可能实现方式,本申请实施例在此不再赘述。值得区分的是,上述第一种实施场景下主机之间跨站点传输的报文为二层报文(基于MAC路由),而第二种实施场景下主机之间跨站点传输的报文为三层报文(基于IP路由)。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).

本申请实施例提供的上述报文传输方法的步骤的先后顺序能够进行适当调整,步骤也能够根据情况进行相应增减。任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化的方法,都应涵盖在本申请的保护范围之内。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 technical personnel 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.

图20是本申请实施例提供的另一种报文传输方法的流程示意图,该方法的应用场景至少包括第一设备和第二设备。举例来说,该应用场景例如可以是图5所示的应用场景,第一设备例如可以是图5所示的PE2或PE3,第二设备例如可以是图5所示的PE1。该方法具体可以用于实现图6对应实施例所示的方法600。如图20所示,该方法包括但不限于以下步骤2001至步骤2002。FIG20 is a flow chart of another message transmission method provided by 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, for example, the application scenario shown in FIG5 , the first device may be, for example, PE2 or PE3 shown in FIG5 , and the second device may be, for example, PE1 shown in FIG5 . The method may be specifically used to implement the method 600 shown in the corresponding embodiment of FIG6 . As shown in FIG20 , the method includes but is not limited to the following steps 2001 to 2002.

步骤2001、第一设备生成报文,该报文包括MPLS头、第一设备的设备标识和报文净荷,该设备标识封装在MPLS头与报文净荷之间。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.

步骤2002、第一设备通过第一设备和第二设备之间建立的LSP向第二设备发送报文。Step 2002: The first device sends a message to the second device through the LSP established between the first device and the second device.

当该方法具体用于实现上述图6所示的方法600时,第一设备例如可以是设备1,第二设备例如可以是设备2。步骤2001至步骤2002的具体实现过程,可参考方法600中的步骤601至步骤602,此处不再赘述。When the method is specifically used to implement the method 600 shown in Fig. 6, the first device may be, for example, device 1, and the second device may be, for example, device 2. The specific implementation process of steps 2001 to 2002 may refer to steps 601 to 602 in method 600, which will not be repeated here.

一种具体的实现中,第一设备的设备标识为第一设备的路由器标识。In a specific implementation, the device identifier of the first device is a router identifier of the first device.

一种具体的实现中,报文包括控制字,控制字用于携带设备标识。In a specific implementation, the message includes a control word, and the control word is used to carry a device identifier.

一种具体的实现中,报文包括控制字,设备标识与控制字邻接。In a specific implementation, the message includes a control word, and the device identifier is adjacent to the control word.

一种具体的实现中,MPLS头的栈底标签用于指示与栈底标签邻接的为设备标识。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.

一种具体的实现中,该方法还包括:第一设备接收第二设备发送的能力协商信息,能力协商信息用于在第一设备和第二设备之间协商在报文中携带第一设备的设备标识的能力。此步骤的具体实现过程可参考图6所示的实施例中的相关说明,此处不再赘述。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 refer to the relevant description in the embodiment shown in Figure 6, and will not be repeated here.

一种具体的实现中,能力协商信息用于在第一设备和第二设备之间协商在报文的控制字中携带第一设备的设备标识的能力。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.

一种具体的实现中,控制字为4字节的控制字。In a specific implementation, the control word is a 4-byte control word.

一种具体的实现中,控制字为8字节的长控制字,长控制字的4字节用于携带原始控制字,长控制字的其它4字节用于携带第一设备的设备标识。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.

一种具体的实现中,能力协商信息用于在第一设备和第二设备之间协商在报文的栈底标签之后携带第一设备的设备标识的能力。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.

一种具体的实现中,栈底标签为预先配置的静态标签,或第二设备分配的动态标签,或指定的bSPL。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.

一种具体的实现中,栈底标签为指定的eSPL,当报文的标签栈中携带eSPL时,标签栈还携带一个特殊标签,特殊标签用于指示其后邻接的标签为eSPL。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.

一种具体的实现中,第一设备接收第二设备发送的能力协商信息的实现方式,包括:第一设备接收第二设备发送的BGP EVPN路由,BGP EVPN路由包括能力协商扩展团体属性,能力协商扩展团体属性用于携带能力协商信息。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 the capability negotiation information.

一种具体的实现中,第一设备接收第二设备发送的能力协商信息的实现方式,包括:第一设备接收第 二设备发送的BGP L3VPN路由,BGP L3VPN路由包括能力协商扩展团体属性,能力协商扩展团体属性用于携带能力协商信息。In a specific implementation, a first device receives capability negotiation information sent by a second device, including: the first device receives the capability negotiation information sent by the second device. The BGP L3VPN route sent by the second device includes a capability negotiation extended community attribute, and the capability negotiation extended community attribute is used to carry capability negotiation information.

一种具体的实现中,第一设备为入运营商边缘设备ingress PE,第二设备为出运营商边缘设备egress PE。In a specific implementation, the first device is the ingress operator edge device ingress PE, and the second device is the egress operator edge device egress PE.

图21是本申请实施例提供的又一种报文传输方法的流程示意图,该方法的应用场景至少包括第一设备和第二设备。举例来说,该应用场景例如可以是图5所示的应用场景,第二设备例如可以是图5所示的PE1,第一设备例如可以是图5所示的PE2或PE3,第三设备例如可以是图5所示的P1或P2。该方法具体可以用于实现图6对应实施例所示的方法600。如图21所示,该方法包括但不限于以下步骤2101至步骤2102。FIG21 is a flow chart of another message transmission method provided by 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, for example, the application scenario shown in FIG5 , the second device may be, for example, PE1 shown in FIG5 , the first device may be, for example, PE2 or PE3 shown in FIG5 , and the third device may be, for example, P1 or P2 shown in FIG5 . The method may be specifically used to implement the method 600 shown in the corresponding embodiment of FIG6 . As shown in FIG21 , the method includes, but is not limited to, the following steps 2101 to 2102.

步骤2101、第二设备通过第二设备和第一设备之间建立的LSP接收第三设备发送的报文,第三设备是该LSP上位于第一设备和第二设备之间的标签交换设备,该报文包括MPLS头、第一设备的设备标识和报文净荷,该设备标识封装在MPLS头与报文净荷之间。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.

步骤2102、第二设备解析报文,得到第一设备的设备标识。Step 2102: The second device parses the message to obtain the device identification of the first device.

当该方法具体用于实现上述图6所示的方法600时,第二设备例如可以是设备2,第一设备例如可以是设备1。步骤2101至步骤2102的具体实现过程,可参考方法600中的步骤602至步骤603,此处不再赘述。When the method is specifically used to implement the method 600 shown in Fig. 6, the second device may be, for example, device 2, and the first device may be, for example, device 1. The specific implementation process of steps 2101 to 2102 may refer to steps 602 to 603 in method 600, and will not be repeated here.

一种具体的实现中,该方法还包括:第二设备根据第一设备的设备标识确定报文来自第一设备,以对来自第一设备的报文进行流量统计。此步骤的具体实现过程,可参考方法600中的步骤604,此处不再赘述。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.

一种具体的实现中,第一设备的设备标识为第一设备的路由器标识。In a specific implementation, the device identifier of the first device is a router identifier of the first device.

一种具体的实现中,报文包括控制字,控制字用于携带设备标识。In a specific implementation, the message includes a control word, and the control word is used to carry a device identifier.

一种具体的实现中,报文包括控制字,设备标识与控制字邻接。In a specific implementation, the message includes a control word, and the device identifier is adjacent to the control word.

一种具体的实现中,MPLS头的栈底标签用于指示与栈底标签邻接的为设备标识。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.

一种具体的实现中,该方法还包括:第二设备向第一设备发送能力协商信息,能力协商信息用于在第一设备和第二设备之间协商在报文中携带第一设备的设备标识的能力。此步骤的具体实现过程可参考图6所示的实施例中的相关说明,此处不再赘述。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. The specific implementation process of this step can be referred to the relevant description in the embodiment shown in Figure 6, and will not be repeated here.

一种具体的实现中,能力协商信息用于在第一设备和第二设备之间协商在报文的控制字中携带第一设备的设备标识的能力。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.

一种具体的实现中,控制字为4字节的控制字。In a specific implementation, the control word is a 4-byte control word.

一种具体的实现中,控制字为8字节的长控制字,长控制字的4字节用于携带原始控制字,长控制字的其它4字节用于携带第一设备的设备标识。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.

一种具体的实现中,能力协商信息用于在第一设备和第二设备之间协商在报文的栈底标签之后携带第一设备的设备标识的能力。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.

一种具体的实现中,栈底标签为预先配置的静态标签,或第一设备分配的动态标签,或指定的bSPL。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.

一种具体的实现中,栈底标签为指定的eSPL,当报文的标签栈中携带eSPL时,标签栈还携带一个特殊标签,特殊标签用于指示其后邻接的标签为eSPL。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.

一种具体的实现中,第二设备向第一设备发送能力协商信息的实现方式,包括:第二设备向第一设备发送BGP EVPN路由,BGP EVPN路由包括能力协商扩展团体属性,能力协商扩展团体属性用于携带能力协商信息。In a specific implementation, a method for a second device to send capability negotiation information to a 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.

一种具体的实现中,第二设备向第一设备发送能力协商信息的实现方式,包括:第二设备向第一设备发送BGP L3VPN路由,BGP L3VPN路由包括能力协商扩展团体属性,能力协商扩展团体属性用于携带能力协商信息。In a specific implementation, the method for the second device to send capability negotiation information to the first device includes: 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.

一种具体的实现中,第一设备为入运营商边缘设备,第二设备为出运营商边缘设备。In a specific implementation, the first device is an inbound operator edge device, and the second device is an outbound operator edge device.

图22是本申请实施例提供的再一种报文传输方法的流程示意图,该方法的应用场景至少包括第一设备和第二设备。举例来说,该应用场景例如可以是图5所示的应用场景,第一设备例如可以是图5所示的PE2或PE3,第二设备例如可以是图5所示的PE1。该方法具体可以用于实现图6对应实施例所示的方法600。如图22所示,该方法包括但不限于以下步骤2201。FIG22 is a flow chart of another message transmission method provided by 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, for example, the application scenario shown in FIG5 , the first device may be, for example, PE2 or PE3 shown in FIG5 , and the second device may be, for example, PE1 shown in FIG5 . The method may be specifically used to implement the method 600 shown in the corresponding embodiment of FIG6 . As shown in FIG22 , the method includes, but is not limited to, the following steps 2201.

步骤2201、第一设备接收第二设备发送的能力协商信息,该能力协商信息用于在第一设备和第二设备之间协商在第一设备向第二设备发送的MPLS报文中携带第一设备的设备标识的能力。 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.

一种具体的实现中,该能力协商信息用于在第一设备和第二设备之间协商在报文的控制字中携带第一设备的设备标识的能力。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.

一种具体的实现中,控制字为4字节的控制字。In a specific implementation, the control word is a 4-byte control word.

一种具体的实现中,控制字为8字节的长控制字,长控制字的4字节用于携带原始控制字,长控制字的其它4字节用于携带第一设备的设备标识。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.

一种具体的实现中,能力协商信息用于在第一设备和第二设备之间协商在报文的栈底标签之后携带第一设备的设备标识的能力。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.

一种具体的实现中,栈底标签为预先配置的静态标签,或第二设备分配的动态标签,或指定的bSPL。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.

一种具体的实现中,栈底标签为指定的eSPL,当报文的标签栈中携带该eSPL时,标签栈还携带一个特殊标签,特殊标签用于指示其后邻接的标签为eSPL。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.

一种具体的实现中,第一设备接收第二设备发送的能力协商信息的实现方式,包括:第一设备接收第二设备发送的BGP EVPN路由,该BGP EVPN路由包括能力协商扩展团体属性,该能力协商扩展团体属性用于携带能力协商信息。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 the capability negotiation information.

一种具体的实现中,第一设备接收第二设备发送的能力协商信息的实现方式,包括:第一设备接收第二设备发送的BGP L3VPN路由,该BGP L3VPN路由包括能力协商扩展团体属性,该能力协商扩展团体属性用于携带能力协商信息。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 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.

一种具体的实现中,第一设备向第二设备发送能力协商响应。In a specific implementation, the first device sends a capability negotiation response to the second device.

一种具体的实现中,第一设备为入运营商边缘设备,第二设备为出运营商边缘设备。In a specific implementation, the first device is an inbound operator edge device, and the second device is an outbound operator edge device.

图23是本申请实施例提供的还一种报文传输方法的流程示意图,该方法的应用场景至少包括第一设备和第二设备。举例来说,该应用场景例如可以是图5所示的应用场景,第二设备例如可以是图5所示的PE1,第一设备例如可以是图5所示的PE2或PE3。该方法具体可以用于实现图6对应实施例所示的方法600。如图23所示,该方法包括但不限于以下步骤2301至步骤2302。FIG23 is a flow chart of another message transmission method provided by 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, for example, the application scenario shown in FIG5 , the second device may be, for example, PE1 shown in FIG5 , and the first device may be, for example, PE2 or PE3 shown in FIG5 . The method may be specifically used to implement the method 600 shown in the corresponding embodiment of FIG6 . As shown in FIG23 , the method includes, but is not limited to, the following steps 2301 to 2302.

步骤2301、第二设备生成能力协商信息,该能力协商信息用于在第一设备和第二设备之间协商在第一设备向第二设备发送的MPLS报文中携带第一设备的设备标识的能力。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.

步骤2302、第二设备向第一设备发送该能力协商信息。Step 2302: The second device sends the capability negotiation information to the first device.

一种具体的实现中,能力协商信息用于在第一设备和第二设备之间协商在报文的控制字中携带第一设备的设备标识的能力。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.

一种具体的实现中,控制字为4字节的控制字。In a specific implementation, the control word is a 4-byte control word.

一种具体的实现中,控制字为8字节的长控制字,长控制字的4字节用于携带原始控制字,长控制字的其它4字节用于携带第一设备的设备标识。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.

一种具体的实现中,能力协商信息用于在第一设备和第二设备之间协商在报文的栈底标签之后携带第一设备的设备标识的能力。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.

一种具体的实现中,栈底标签为预先配置的静态标签,或第一设备分配的动态标签,或指定的bSPL。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.

一种具体的实现中,栈底标签为指定的eSPL,当报文的标签栈中携带eSPL时,标签栈还携带一个特殊标签,特殊标签用于指示其后邻接的标签为eSPL。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.

一种具体的实现中,第二设备向第一设备发送能力协商信息的实现方式,包括:第二设备向第一设备发送BGP EVPN路由,该BGP EVPN路由包括能力协商扩展团体属性,该能力协商扩展团体属性用于携带能力协商信息。In a specific implementation, the method for the second device to send capability negotiation information 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.

一种具体的实现中,第二设备向第一设备发送能力协商信息的实现方式,包括:第二设备向第一设备发送BGP L3VPN路由,该BGP L3VPN路由包括能力协商扩展团体属性,该能力协商扩展团体属性用于携带能力协商信息。In a specific implementation, the method for the second device to send capability negotiation information to the first device includes: the second device sends a BGP L3VPN route to the first device, and 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.

一种具体的实现中,第一设备接收第二设备发送的能力协商响应。In a specific implementation, the first device receives a capability negotiation response sent by the second device.

一种具体的实现中,第一设备为入运营商边缘设备,第二设备为出运营商边缘设备。In a specific implementation, the first device is an inbound operator edge device, and the second device is an outbound operator edge device.

以下对本申请实施例的虚拟装置举例说明。The following is an example of a virtual device according to an embodiment of the present application.

图24是本申请实施例提供的一种报文传输装置的结构示意图。该报文传输装置例如为第一设备。如图 24所示,该报文传输装置2400包括但不限于处理模块2401和发送模块2402。可选地,该报文传输装置2400还包括接收模块2403。FIG24 is a schematic diagram of the structure of a message transmission device provided in an embodiment of the present application. The message transmission device is, for example, a first device. As shown in FIG. 24 , 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.

处理模块2401,用于生成报文,报文包括MPLS头、第一设备的设备标识和报文净荷,设备标识封装在MPLS头与报文净荷之间。发送模块2402,用于通过第一设备和第二设备之间建立的LSP向第二设备发送报文。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.

一种具体的实现中,第一设备的设备标识为第一设备的路由器标识。In a specific implementation, the device identifier of the first device is a router identifier of the first device.

一种具体的实现中,报文包括控制字,控制字用于携带设备标识。In a specific implementation, the message includes a control word, and the control word is used to carry a device identifier.

一种具体的实现中,报文包括控制字,设备标识与控制字邻接。In a specific implementation, the message includes a control word, and the device identifier is adjacent to the control word.

一种具体的实现中,MPLS头的栈底标签用于指示与栈底标签邻接的为设备标识。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.

一种具体的实现中,接收模块2403,用于接收第二设备发送的能力协商信息,能力协商信息用于在第一设备和第二设备之间协商在报文中携带第一设备的设备标识的能力。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.

一种具体的实现中,能力协商信息用于在第一设备和第二设备之间协商在报文的控制字中携带第一设备的设备标识的能力。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.

一种具体的实现中,控制字为4字节的控制字。In a specific implementation, the control word is a 4-byte control word.

一种具体的实现中,控制字为8字节的长控制字,长控制字的4字节用于携带原始控制字,长控制字的其它4字节用于携带第一设备的设备标识。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.

一种具体的实现中,能力协商信息用于在第一设备和第二设备之间协商在报文的栈底标签之后携带第一设备的设备标识的能力。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.

一种具体的实现中,栈底标签为预先配置的静态标签,或第二设备分配的动态标签,或指定的bSPL。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.

一种具体的实现中,栈底标签为指定的eSPL,当报文的标签栈中携带eSPL时,标签栈还携带一个特殊标签,特殊标签用于指示其后邻接的标签为eSPL。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.

一种具体的实现中,接收模块2403,具体用于接收第二设备发送的BGP EVPN路由,BGP EVPN路由包括能力协商扩展团体属性,能力协商扩展团体属性用于携带能力协商信息。In a specific implementation, the receiving module 2403 is specifically used to receive the BGP EVPN route sent by the second device, and 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.

一种具体的实现中,接收模块2403,具体用于接收第二设备发送的BGP L3VPN路由,BGP L3VPN路由包括能力协商扩展团体属性,能力协商扩展团体属性用于携带能力协商信息。In a specific implementation, the receiving module 2403 is specifically used to receive the BGP L3VPN route sent by the second device, 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 a specific implementation, the first device is an inbound operator edge device, and the second device is an outbound operator edge device.

图25是本申请实施例提供的另一种报文传输装置的结构示意图。该报文传输装置例如为第一设备。如图25所示,该报文传输装置2500包括但不限于接收模块2501和处理模块2502。可选地,该报文传输装置2500还包括发送模块2503。FIG25 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. As shown in FIG25 , 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 also includes a sending module 2503.

接收模块2501,用于通过第二设备和第一设备之间建立的LSP接收第三设备发送的报文,第三设备是该LSP上位于第一设备和第二设备之间的标签交换设备,该报文包括MPLS头、第一设备的设备标识和报文净荷,该设备标识封装在MPLS头与报文净荷之间。处理模块2502,用于解析该报文,得到第一设备的设备标识。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.

一种具体的实现中,处理模块2502,还用于根据第一设备的设备标识确定报文来自第一设备,以对来自第一设备的报文进行流量统计。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.

一种具体的实现中,第一设备的设备标识为第一设备的路由器标识。In a specific implementation, the device identifier of the first device is a router identifier of the first device.

一种具体的实现中,报文包括控制字,控制字用于携带设备标识。In a specific implementation, the message includes a control word, and the control word is used to carry a device identifier.

一种具体的实现中,报文包括控制字,设备标识与控制字邻接。In a specific implementation, the message includes a control word, and the device identifier is adjacent to the control word.

一种具体的实现中,MPLS头的栈底标签用于指示与栈底标签邻接的为设备标识。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.

一种具体的实现中,发送模块2503,用于向第一设备发送能力协商信息,能力协商信息用于在第一设备和第二设备之间协商在报文中携带第一设备的设备标识的能力。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.

一种具体的实现中,能力协商信息用于在第一设备和第二设备之间协商在报文的控制字中携带第一设备的设备标识的能力。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.

一种具体的实现中,控制字为4字节的控制字。In a specific implementation, the control word is a 4-byte control word.

一种具体的实现中,控制字为8字节的长控制字,长控制字的4字节用于携带原始控制字,长控制字的其它4字节用于携带第一设备的设备标识。 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.

一种具体的实现中,能力协商信息用于在第一设备和第二设备之间协商在报文的栈底标签之后携带第一设备的设备标识的能力。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.

一种具体的实现中,栈底标签为预先配置的静态标签,或第一设备分配的动态标签,或指定的bSPL。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.

一种具体的实现中,栈底标签为指定的eSPL,当报文的标签栈中携带eSPL时,标签栈还携带一个特殊标签,特殊标签用于指示其后邻接的标签为eSPL。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.

一种具体的实现中,发送模块2503,具体用于向第一设备发送BGP EVPN路由,BGP EVPN路由包括能力协商扩展团体属性,能力协商扩展团体属性用于携带能力协商信息。In a specific implementation, the sending module 2503 is specifically used to send a BGP EVPN route to the first device, where 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.

一种具体的实现中,发送模块2503,具体用于向第一设备发送BGP L3VPN路由,BGP L3VPN路由包括能力协商扩展团体属性,能力协商扩展团体属性用于携带能力协商信息。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 group attribute, and the capability negotiation extended group attribute is used to carry capability negotiation information.

一种具体的实现中,第一设备为入运营商边缘设备,第二设备为出运营商边缘设备。In a specific implementation, the first device is an inbound operator edge device, and the second device is an outbound operator edge device.

图26是本申请实施例提供的又一种报文传输装置的结构示意图。该报文传输装置例如为第一设备。如图26所示,该报文传输装置2600包括但不限于接收模块2601。可选地,该报文传输装置2600还包括发送模块2602。FIG26 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. As shown in FIG26 , the message transmission device 2600 includes but is not limited to a receiving module 2601. Optionally, the message transmission device 2600 also includes a sending module 2602.

接收模块2601,用于接收第二设备发送的能力协商信息,该能力协商信息用于在第一设备和第二设备之间协商在第一设备向第二设备发送的MPLS报文中携带第一设备的设备标识的能力。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.

一种具体的实现中,能力协商信息用于在第一设备和第二设备之间协商在报文的控制字中携带第一设备的设备标识的能力。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.

一种具体的实现中,控制字为4字节的控制字。In a specific implementation, the control word is a 4-byte control word.

一种具体的实现中,控制字为8字节的长控制字,长控制字的4字节用于携带原始控制字,长控制字的其它4字节用于携带第一设备的设备标识。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.

一种具体的实现中,能力协商信息用于在第一设备和第二设备之间协商在报文的栈底标签之后携带第一设备的设备标识的能力。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.

一种具体的实现中,栈底标签为预先配置的静态标签,或第二设备分配的动态标签,或指定的bSPL。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.

一种具体的实现中,栈底标签为指定的eSPL,当报文的标签栈中携带该eSPL时,标签栈还携带一个特殊标签,特殊标签用于指示其后邻接的标签为eSPL。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.

一种具体的实现中,接收模块2601,具体用于接收第二设备发送的BGP EVPN路由,该BGP EVPN路由包括能力协商扩展团体属性,该能力协商扩展团体属性用于携带能力协商信息。In a specific implementation, the receiving module 2601 is specifically used to receive a BGP EVPN route sent by a second device, where 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.

一种具体的实现中,接收模块2601,具体用于接收第二设备发送的BGP L3VPN路由,该BGP L3VPN路由包括能力协商扩展团体属性,该能力协商扩展团体属性用于携带能力协商信息。In a specific implementation, the receiving module 2601 is specifically used to receive a BGP L3VPN route sent by a second device, where 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.

一种具体的实现中,发送模块2602,用于向第二设备发送能力协商响应。In a specific implementation, the sending module 2602 is configured to send a capability negotiation response to the second device.

一种具体的实现中,第一设备为入运营商边缘设备,第二设备为出运营商边缘设备。In a specific implementation, the first device is an inbound operator edge device, and the second device is an outbound operator edge device.

图27是本申请实施例提供的再一种报文传输装置的结构示意图。该报文传输装置例如为第一设备。如图27所示,该报文传输装置2700包括但不限于处理模块2701和发送模块2702。可选地,该报文传输装置2700还包括接收模块2703。FIG27 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. As shown in FIG27 , 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 also includes a receiving module 2703.

处理模块2701,用于生成能力协商信息,该能力协商信息用于在第一设备和第二设备之间协商在第一设备向第二设备发送的MPLS报文中携带第一设备的设备标识的能力。发送模块2702,用于向第一设备发送该能力协商信息。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.

一种具体的实现中,能力协商信息用于在第一设备和第二设备之间协商在报文的控制字中携带第一设备的设备标识的能力。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.

一种具体的实现中,控制字为4字节的控制字。In a specific implementation, the control word is a 4-byte control word.

一种具体的实现中,控制字为8字节的长控制字,长控制字的4字节用于携带原始控制字,长控制字的其它4字节用于携带第一设备的设备标识。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.

一种具体的实现中,能力协商信息用于在第一设备和第二设备之间协商在报文的栈底标签之后携带第一设备的设备标识的能力。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.

一种具体的实现中,栈底标签为预先配置的静态标签,或第一设备分配的动态标签,或指定的bSPL。 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.

一种具体的实现中,栈底标签为指定的eSPL,当报文的标签栈中携带eSPL时,标签栈还携带一个特殊标签,特殊标签用于指示其后邻接的标签为eSPL。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.

一种具体的实现中,发送模块2702,具体用于向第一设备发送BGP EVPN路由,该BGP EVPN路由包括能力协商扩展团体属性,该能力协商扩展团体属性用于携带能力协商信息。In a specific implementation, the sending module 2702 is specifically used to send a BGP EVPN route to the first device, where 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.

一种具体的实现中,发送模块2702,具体用于向第一设备发送BGP L3VPN路由,该BGP L3VPN路由包括能力协商扩展团体属性,该能力协商扩展团体属性用于携带能力协商信息。In a specific implementation, the sending module 2702 is specifically used to send 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 capability negotiation information.

一种具体的实现中,接收模块2703,用于接收第一设备发送的能力协商响应。In a specific implementation, the receiving module 2703 is configured to receive a capability negotiation response sent by the first device.

一种具体的实现中,第一设备为入运营商边缘设备,第二设备为出运营商边缘设备。In a specific implementation, the first device is an inbound operator edge device, and the second device is an outbound operator edge device.

关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。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.

以下对本申请实施例涉及的硬件结构举例说明。The following is an illustration of the hardware structure involved in the embodiments of the present application.

图28是本申请实施例提供的一种报文传输装置2800的框图。该报文传输装置2800为网络设备。一种实现方式,该报文传输装置2800可以是网络边缘设备。如图28所示,该装置2800包括:处理器2801和存储器2802。FIG28 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. As shown in FIG28 , the device 2800 includes: a processor 2801 and a memory 2802.

存储器2802,用于存储计算机可读指令;Memory 2802, for storing computer readable instructions;

处理器2801,用于调用所述计算机可读指令,按照所述计算机可读指令的指示,可以执行如图6所示的方法600中由设备1或设备2执行的全部操作。The processor 2801 is used to call the computer-readable instructions and execute all operations performed by the device 1 or the device 2 in the method 600 shown in FIG. 6 according to the instructions of the computer-readable instructions.

一种具体的实施方式,装置2800还可以包括通信接口2803。其中,存储器2802,处理器2801和通信接口2803相互通信连接。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.

图29是本申请实施例提供的另一种报文传输装置2900的框图。该报文传输装置2900为网络设备。一种实现方式,该报文传输装置2900可以是网络边缘设备。如图29所示,该装置2900包括:通信接口2901;以及与所述通信接口2901连接的处理器2902。根据所述通信接口2901和所述处理器2902,报文传输装置2900可以执行如图6所示的方法600中由设备1或设备2执行的全部操作。其中,通信接口2901用于实现收发操作,处理器2902用于实现收发以外的操作。举例来说,当装置2900为图6所示方法中的设备1时,通信接口2901用于向设备2发送报文,处理器2902用于生成报文。Figure 29 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. As shown in Figure 29, 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 all operations performed by device 1 or device 2 in the method 600 shown in Figure 6. Among them, the communication interface 2901 is used to implement the sending and receiving operations, and the processor 2902 is used to implement operations other than sending and receiving. For example, when the device 2900 is the device 1 in the method shown in Figure 6, the communication interface 2901 is used to send a message to the device 2, and the processor 2902 is used to generate a message.

在本申请实施例中,处理器可以是中央处理器(central processing unit,CPU)。处理器可以包括一个或者一个以上处理核心,处理器通过运行计算机程序执行各种功能应用以及数据处理。处理器可以通过通信总线和存储器、通信接口相连。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.

处理器还可以进一步包括硬件芯片。上述硬件芯片可以是专用集成电路(application specific integrated circuits,ASIC),可编程逻辑器件(programmable logic device,PLD)或其组合。上述PLD可以是复杂可编程逻辑器件(complex programmable logic device,CPLD),现场可编程逻辑门阵列(field-programmable gate array,FPGA),通用阵列逻辑(generic array logic,GAL)或其任意组合。一种具体的实施方式,该硬件芯片可用于实现加密/解密操作。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.

存储器可以包括易失性存储器(volatile memory),例如随机存取存储器(random access memory,RAM)。存储器也可以包括非易失性存储器(non-volatile memory),例如快闪存储器(flash memory),硬盘(hard disk drive,HDD)或固态硬盘(solid-state drive,SSD)。存储器还可以包括上述种类的存储器的组合。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.

通信接口可以为多个,通信接口用于与其它设备进行通信。通信接口可以包括有线通信接口,无线通信接口或其组合。其中,有线通信接口例如可以为以太网接口。以太网接口可以是光接口,电接口或其组合。无线通信接口可以为无线局域网(wireless local area network,WLAN)接口,蜂窝网络通信接口或其组合等。There may be multiple communication interfaces, and the communication interfaces are used to communicate with other devices. The communication interfaces may include wired communication interfaces, wireless communication interfaces, 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.

在上述实施例中,可以全部或部分地通过硬件、固件或者其任意组合来实现。当具体实现过程中涉及软件时,可以全部或部分地体现为计算机程序产品的形式。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可 以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,数字化视频光盘(digital video disc,DVD))、或者半导体介质(例如SSD)等。In the above embodiments, all or part of the embodiments may be implemented by hardware, firmware, or any combination thereof. When software is involved in the specific implementation process, it may 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 embodiments of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be The computer instructions may 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 may be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may 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 therein. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a digital video disc (DVD)), or a semiconductor medium (e.g., an SSD), etc.

以下对本申请实施例的系统举例说明。The following is an example of the system of the embodiment of the present application.

本申请实施例还提供了一种报文传输系统,包括:第一设备和第二设备,第一设备例如可以是图6示出的方法600中的设备1,第二设备例如可以是图6示出的方法600中的设备2。或者,第一设备例如可以是图24示出的报文传输装置2400,第二设备例如可以是图25示出的报文传输装置2500。又或者,第一设备例如可以是图26示出的报文传输装置2600,第二设备例如可以是图27示出的报文传输装置2700。The embodiment of the present application further provides a message transmission system, including: a first device and a second device, wherein the first device may be, for example, the device 1 in the method 600 shown in FIG6 , and the second device may be, for example, the device 2 in the method 600 shown in FIG6 . Alternatively, the first device may be, for example, the message transmission device 2400 shown in FIG24 , and the second device may be, for example, the message transmission device 2500 shown in FIG25 . Alternatively, the first device may be, for example, the message transmission device 2600 shown in FIG26 , and the second device may be, for example, the message transmission device 2700 shown in FIG27 .

本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。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.

在本申请实施例中,术语“第一”、“第二”和“第三”仅用于描述目的,而不能理解为指示或暗示相对重要性。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.

本申请中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。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.

需要说明的是,本申请所涉及的信息(包括但不限于用户设备信息、用户个人信息等)、数据(包括但不限于用于分析的数据、存储的数据、展示的数据等)以及信号,均为经用户授权或者经过各方充分授权的,且相关数据的收集、使用和处理需要遵守相关国家和地区的相关法律法规和标准。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.

以上所述仅为本申请的可选实施例,并不用以限制本申请,凡在本申请的构思和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。 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 (37)

一种报文传输方法,其特征在于,所述方法包括:A message transmission method, characterized in that the method comprises: 第一设备生成报文,所述报文包括多协议标签交换MPLS头、所述第一设备的设备标识和报文净荷,所述设备标识封装在所述MPLS头与所述报文净荷之间;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. 根据权利要求1所述的方法,其特征在于,所述第一设备的设备标识为所述第一设备的路由器标识router ID。The method according to claim 1 is characterized in that the device identifier of the first device is a router identifier router ID of the first device. 根据权利要求1或2所述的方法,其特征在于,所述报文包括控制字,所述控制字用于携带所述设备标识。The method according to claim 1 or 2 is characterized in that the message includes a control word, and the control word is used to carry the device identification. 根据权利要求1或2所述的方法,其特征在于,所述报文包括控制字,所述设备标识与所述控制字邻接。The method according to claim 1 or 2 is characterized in that the message includes a control word, and the device identifier is adjacent to the control word. 根据权利要求1或2所述的方法,其特征在于,所述MPLS头的栈底标签用于指示与所述栈底标签邻接的为所述设备标识。The method according to claim 1 or 2 is characterized in that the bottom label of the MPLS header is used to indicate that the device identifier is adjacent to the bottom label. 根据权利要求1-5任一项所述的方法,其特征在于,所述方法还包括: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. 根据权利要求6所述的方法,其特征在于,所述能力协商信息用于在所述第一设备和所述第二设备之间协商在报文的控制字中携带所述第一设备的设备标识的能力。The method according to claim 6 is characterized in that the capability negotiation information is used to negotiate between the first device and the second device the capability of carrying the device identification of the first device in a control word of a message. 根据权利要求7所述的方法,其特征在于,所述控制字为4字节的控制字。The method according to claim 7 is characterized in that the control word is a 4-byte control word. 根据权利要求7所述的方法,其特征在于,所述控制字为8字节的长控制字,所述长控制字的4字节用于携带原始控制字,所述长控制字的其它4字节用于携带所述第一设备的设备标识。The method according to claim 7 is 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. 根据权利要求6所述的方法,其特征在于,所述能力协商信息用于在所述第一设备和所述第二设备之间协商在报文的栈底标签之后携带所述第一设备的设备标识的能力。The method according to claim 6 is characterized in that 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. 根据权利要求10所述的方法,其特征在于,所述栈底标签为预先配置的静态标签,或所述第二设备分配的动态标签,或指定的基本特殊用途标签bSPL。The method according to claim 10 is characterized in that the bottom-of-stack label is a pre-configured static label, or a dynamic label allocated by the second device, or a designated basic special purpose label bSPL. 根据权利要求10所述的方法,其特征在于,所述栈底标签为指定的扩展特殊用途标签eSPL,当报文的标签栈中携带所述eSPL时,所述标签栈还携带一个特殊标签,所述特殊标签用于指示其后邻接的标签为所述eSPL。The method according to claim 10 is characterized in that the bottom label of the stack is a specified 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 subsequent adjacent label is the eSPL. 根据权利要求6-12任一项所述的方法,其特征在于,所述第一设备接收所述第二设备发送的能力协商信息,包括:The method according to any one of claims 6 to 12, wherein the first device receives the capability negotiation information sent by the second device, comprising: 所述第一设备接收所述第二设备发送的边界网关协议以太虚拟专用网BGP EVPN路由,所述BGP EVPN路由包括能力协商扩展团体属性,所述能力协商扩展团体属性用于携带所述能力协商信息。 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. 根据权利要求6、10-12任一项所述的方法,其特征在于,所述第一设备接收所述第二设备发送的能力协商信息,包括:The method according to any one of claims 6, 10-12, characterized in that the first device receives the capability negotiation information sent by the second device, comprising: 所述第一设备接收所述第二设备发送的边界网关协议三层虚拟专用网BGP L3VPN路由,所述BGP L3VPN路由包括能力协商扩展团体属性,所述能力协商扩展团体属性用于携带所述能力协商信息。The first device receives a Border Gateway Protocol Layer 3 Virtual Private Network BGP L3VPN route sent by the second device, wherein 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. 根据权利要求1-14任一项所述的方法,其特征在于,所述第一设备为入运营商边缘设备ingress PE,所述第二设备为出运营商边缘设备egress PE。The method according to any one of claims 1 to 14 is characterized in that the first device is an ingress operator edge device ingress PE, and the second device is an egress operator edge device egress PE. 一种报文传输方法,其特征在于,所述方法包括:A message transmission method, characterized in that the method comprises: 第二设备通过所述第二设备和第一设备之间建立的标签交换路径LSP接收第三设备发送的报文,所述第三设备是所述LSP上位于所述第一设备和所述第二设备之间的标签交换设备,所述报文包括多协议标签交换MPLS头、所述第一设备的设备标识和报文净荷,所述设备标识封装在所述MPLS头与所述报文净荷之间;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. 根据权利要求16所述的方法,其特征在于,所述方法还包括: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. 根据权利要求16或17所述的方法,其特征在于,所述第一设备的设备标识为所述第一设备的路由器标识router ID。The method according to claim 16 or 17 is characterized in that the device identifier of the first device is the router identifier router ID of the first device. 根据权利要求16-18任一项所述的方法,其特征在于,所述报文包括控制字,所述控制字用于携带所述设备标识。The method according to any one of claims 16 to 18 is characterized in that the message includes a control word, and the control word is used to carry the device identification. 根据权利要求16-18任一项所述的方法,其特征在于,所述报文包括控制字,所述设备标识与所述控制字邻接。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. 根据权利要求16-18任一项所述的方法,其特征在于,所述MPLS头的栈底标签用于指示与所述栈底标签邻接的为所述设备标识。The method according to any one of claims 16 to 18 is characterized in that the bottom label of the MPLS header is used to indicate that the device identifier is adjacent to the bottom label. 根据权利要求16-21任一项所述的方法,其特征在于,所述方法还包括: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. 根据权利要求22所述的方法,其特征在于,所述能力协商信息用于在所述第一设备和所述第二设备之间协商在报文的控制字中携带所述第一设备的设备标识的能力。The method according to claim 22 is characterized in that the capability negotiation information is used to negotiate between the first device and the second device the capability of carrying the device identification of the first device in the control word of the message. 根据权利要求23所述的方法,其特征在于,所述控制字为4字节的控制字。The method according to claim 23 is characterized in that the control word is a 4-byte control word. 根据权利要求23所述的方法,其特征在于,所述控制字为8字节的长控制字,所述长控制字的4字节用于携带原始控制字,所述长控制字的其它4字节用于携带所述第一设备的设备标识。The method according to claim 23 is 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. 根据权利要求22所述的方法,其特征在于,所述能力协商信息用于在所述第一设备和所述第二设备之间协商在报文的栈底标签之后携带所述第一设备的设备标识的能力。The method according to claim 22 is characterized in that 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 stack label of the message. 根据权利要求26所述的方法,其特征在于,所述栈底标签为预先配置的静态标签,或所述第二设备 分配的动态标签,或指定的基本特殊用途标签bSPL。The method according to claim 26, characterized in that the bottom label of the stack is a pre-configured static label, or the second device Assigned dynamic label, or designated basic special purpose label bSPL. 根据权利要求26所述的方法,其特征在于,所述栈底标签为指定的扩展特殊用途标签eSPL,当报文的标签栈中携带所述eSPL时,所述标签栈还携带一个特殊标签,所述特殊标签用于指示其后邻接的标签为所述eSPL。The method according to claim 26 is characterized in that the bottom label of the stack is a specified 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 subsequent adjacent label is the eSPL. 根据权利要求22-28任一项所述的方法,其特征在于,所述第二设备向所述第一设备发送能力协商信息,包括:The method according to any one of claims 22 to 28, wherein the second device sends capability negotiation information to the first device, comprising: 所述第二设备向所述第一设备发送边界网关协议以太虚拟专用网BGP EVPN路由,所述BGP EVPN路由包括能力协商扩展团体属性,所述能力协商扩展团体属性用于携带所述能力协商信息。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 group attribute, and the capability negotiation extended group attribute is used to carry the capability negotiation information. 根据权利要求22、26-28任一项所述的方法,其特征在于,所述第二设备向所述第一设备发送能力协商信息,包括:The method according to any one of claims 22, 26-28, characterized in that the second device sends capability negotiation information to the first device, comprising: 所述第二设备向所述第一设备发送边界网关协议三层虚拟专用网BGP L3VPN路由,所述BGP L3VPN路由包括能力协商扩展团体属性,所述能力协商扩展团体属性用于携带所述能力协商信息。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 group attribute, and the capability negotiation extended group attribute is used to carry the capability negotiation information. 根据权利要求16-30任一项所述的方法,其特征在于,所述第一设备为入运营商边缘设备ingress PE,所述第二设备为出运营商边缘设备egress PE。The method according to any one of claims 16-30 is characterized in that the first device is an ingress operator edge device (PE), and the second device is an egress operator edge device (PE). 一种报文传输方法,其特征在于,所述方法包括:A message transmission method, characterized in that the method comprises: 第一设备接收第二设备发送的能力协商信息,所述能力协商信息用于在所述第一设备和所述第二设备之间协商在所述第一设备向所述第二设备发送的多协议标签交换MPLS报文中携带所述第一设备的设备标识的能力。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. 一种报文传输方法,其特征在于,所述方法包括:A message transmission method, characterized in that the method comprises: 第二设备生成能力协商信息,所述能力协商信息用于在所述第一设备和所述第二设备之间协商在所述第一设备向所述第二设备发送的多协议标签交换MPLS报文中携带所述第一设备的设备标识的能力;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. 一种报文传输系统,其特征在于,包括:第一设备和第二设备,所述第一设备用于执行如权利要求1至15任一所述的方法,所述第二设备用于执行如权利要求16至31任一所述的方法;或者,所述第一设备用于执行如权利要求32所述的方法,所述第二设备用于执行如权利要求33所述的方法。A message transmission system, characterized in that it includes: a first device and a second device, the first device is used to execute the method as claimed in any one of claims 1 to 15, and the second device is used to execute the method as claimed in any one of claims 16 to 31; or, the first device is used to execute the method as claimed in claim 32, and the second device is used to execute the method as claimed in claim 33. 一种网络设备,其特征在于,包括:A network device, comprising: 通信接口;以及a communication interface; and 与所述通信接口连接的处理器;a processor connected to the communication interface; 根据所述通信接口和所述处理器,实现如权利要求1至33任一所述的方法。According to the communication interface and the processor, the method according to any one of claims 1 to 33 is implemented. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有指令,当所述指令被处理器执行时,实现如权利要求1至33任一所述的方法。A computer-readable storage medium, characterized in that instructions are stored on the computer-readable storage medium, and when the instructions are executed by a processor, the method described in any one of claims 1 to 33 is implemented. 一种计算机程序产品,其特征在于,包括计算机程序,所述计算机程序被处理器执行时,实现如权利要求1至33任一所述的方法。 A computer program product, characterized in that it comprises a computer program, and when the computer program is executed by a processor, it implements the method according to any one of claims 1 to 33.
PCT/CN2024/093302 2023-05-31 2024-05-15 Packet transmission method and apparatus, and system Pending WO2024244974A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202310638085.5A CN119071196A (en) 2023-05-31 2023-05-31 Message transmission method, device and system
CN202310638085.5 2023-05-31

Publications (1)

Publication Number Publication Date
WO2024244974A1 true WO2024244974A1 (en) 2024-12-05

Family

ID=93637571

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2024/093302 Pending WO2024244974A1 (en) 2023-05-31 2024-05-15 Packet transmission method and apparatus, and system

Country Status (2)

Country Link
CN (1) CN119071196A (en)
WO (1) WO2024244974A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102571601A (en) * 2012-02-13 2012-07-11 中兴通讯股份有限公司 Method for ensuring bidirectional forwarding detection reliability and label switching path equipment
CN102769552A (en) * 2012-07-31 2012-11-07 杭州华三通信技术有限公司 Method and apparatus for transmitting BFD (bidirectional forwarding detection) message during LSP (label switched path) detection by BFD
CN113973082A (en) * 2020-07-06 2022-01-25 华为技术有限公司 Message processing method and network equipment
WO2023039375A1 (en) * 2021-09-10 2023-03-16 Cisco Technology, Inc. Multiprotocol label switching (mpls) data plane header extensions

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102571601A (en) * 2012-02-13 2012-07-11 中兴通讯股份有限公司 Method for ensuring bidirectional forwarding detection reliability and label switching path equipment
CN102769552A (en) * 2012-07-31 2012-11-07 杭州华三通信技术有限公司 Method and apparatus for transmitting BFD (bidirectional forwarding detection) message during LSP (label switched path) detection by BFD
CN113973082A (en) * 2020-07-06 2022-01-25 华为技术有限公司 Message processing method and network equipment
WO2023039375A1 (en) * 2021-09-10 2023-03-16 Cisco Technology, Inc. Multiprotocol label switching (mpls) data plane header extensions

Also Published As

Publication number Publication date
CN119071196A (en) 2024-12-03

Similar Documents

Publication Publication Date Title
US11374862B2 (en) Packet sending and processing method and apparatus, PE node, and node
EP3863237B1 (en) Packet forwarding method, packet transmission device, and packet reception device
US11902049B2 (en) BIER packet sending method and apparatus
CN110832813B (en) Ethernet VPN using segment routing
CN109873760B (en) Method and device for processing route, and method and device for data transmission
US8098656B2 (en) Method and apparatus for implementing L2 VPNs on an IP network
US11895006B2 (en) Communication method, device, and system
US9843507B2 (en) Enhanced hierarchical virtual private local area network service (VPLS) system and method for ethernet-tree (E-tree) services
EP4024774B1 (en) Reverse path forwarding (rpf) check method and apparatus
CN110830352A (en) A kind of VPN cross-domain realization method, device and border node
WO2019105462A1 (en) Method and apparatus for sending packet, method and apparatus for processing packet, pe node, and node
WO2009021458A1 (en) Method, apparatus and system for connecting layer2 network and layer3 network
CN110417655B (en) Method and device for forwarding data message
CN106921573A (en) It is used to issue the method and device of tenant's route in NVo3 networks
CN114584509B (en) A communication method and related equipment
CN101232446A (en) Message processing method and device
WO2024244974A1 (en) Packet transmission method and apparatus, and system
CN100414919C (en) A Realization Method of Cross-Multi-Autonomous System Mixed Network Virtual Private Network
WO2021077991A1 (en) Message detection method, connectivity negotiation relationship establishment method, and related device
CN113542441A (en) Communication processing method and device
CN112866076B (en) Ethernet virtual private network, operator equipment and customer side equipment
Raszuk et al. RFC 9252: BGP Overlay Services Based on Segment Routing over IPv6 (SRv6)
CN119011692A (en) Information processing method and device
WO2024255870A1 (en) Information notification method and apparatus
CN120017581A (en) Routing publishing method, message transmission method, communication device, and communication system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 24814174

Country of ref document: EP

Kind code of ref document: A1