The present disclosure relates to the field of communications technologies, and in particular, to an operation, administration, and maintenance (OAM) packet processing method and a device.
A multi-protocol label switching transport profile (MPLS-TP) is a strict subset of MPLS. To adapt to a requirement of a transport network, some features that are not applicable to a transport network scenario and that are of MPLS are excluded, and a connection-oriented transmission technology that integrates MPLS packet switching and a transport network feature is used. OAM mainly includes three aspects: fault management, performance monitoring, and protection switching, can reflect a running status of a network, and is a most important network management means of an operator. An MPLS-TP OAM mechanism learns from and reuses the Y.1731 standard, and mainly includes OAM functions at a label switched path (LSP) layer, a pseudo wire (PW) layer, a section (Sec) layer, and a ring layer.
Currently, in an IP mode of MPLS-TP OAM, an existing network device identifier and an existing path identifier are used to respectively identify a sender network device and a to-be-detected path, and a maintenance entity group (MEG) identifier and a maintenance entity group end point (MEP) identifier do not need to be additionally configured on the network device, so that fault management, performance monitoring, and protection switching can be implemented, which greatly reduces configuration costs and improves detection efficiency. Therefore, MPLS-TP OAM is favored by many carriers.
However, the IP mode of MPLS-TP OAM is applicable only to Internet Protocol version 4 (IPv4), and a field that is in an OAM packet and that is used to carry an identifier of the network device is only 32-bit space corresponding to IPv4. With evolution from IPv4 to Internet Protocol version 6 (IPv6), to urgently resolve a problem that IPv6 cannot be applied in an MPLS-TP OAM scenario, an MPLS-TP OAM mechanism that can be applied to IPv4 and IPv6 is provided.
Based on this, embodiments of the present disclosure provide an OAM packet processing method and a device, to expand an application scope based on advantages of MPLS-TP OAM, so that IPv4 and IPv6 are applicable, an MPLS-TP OAM mechanism is improved, and better use experience is provided for an operator.
According to a first aspect, an embodiment of the present disclosure provides an MPLS-TP-based OAM packet processing method. The method may include generating, by a first network device, an OAM packet that includes indication information and an identifier of the first network device. The indication information is used to indicate a type of an identifier of the first network device. For example, the indication information may be specifically used to indicate whether the OAM packet is an IPv4 network packet or an IPv6 network packet, so that the first network device sends the OAM packet to a second network device. In this way, the indication information in the OAM packet generated by the first network device indicates whether the identifier of the first network device is an IPv4 address or an IPv6 address. When the indication information carried in the OAM packet indicates that an IP address of the first network device is the IPv4 address, the identifier that is of the first network device and that is included in the OAM packet is the IPv4 address of the first network device. When the indication information carried in the OAM packet indicates that an IP address of the first network device is the IPv6 address, the identifier that is of the first network device and that is included in the OAM packet is the IPv6 address of the first network device. In this way, it can be ensured that a receiver network device that receives the OAM packet determines, based on the indication information, the type of the identifier that is of the first network device and that is carried in the OAM packet, and accurately reads the identifier of the first network device from the OAM packet. Therefore, a user can perform MPLS-TP OAM to reduce a configuration workload, and can also implement MPLS-TP OAM in a plurality of scenarios such as an IPv4 network, an IPv6 network, and a network including IPv4 and IPv6, to expand an application scope of MPLS-TP OAM, and improve use experience of the user.
In an example, the indication information in the OAM packet is used to indicate that the type of the identifier of the first network device is an IPv6 address. This ensures that the method is applicable to an IPv6 network.
In another example, the indication information in the OAM packet is used to indicate that the type of the identifier of the first network device is an IPv4 address. This ensures that the method is applicable to an IPv4 network.
In some possible implementations, the OAM packet includes a type field used to indicate an MEG type, and the type field may be used to carry the indication information. In a specific implementation, if a value of the type field is a first value, the indication information is used to indicate that the type of the identifier of the first network device is the IPv6 address; or if a value of the type field is a second value, the indication information is used to indicate that the type of the identifier of the first network device is the IPv4 address.
In some other possible implementations, the OAM packet includes a reserved field, and at least one bit in the reserved field may be used to carry the indication information. In a specific implementation, if the at least one bit in the reserved field is a first value, the indication information is used to indicate that the type of the identifier of the first network device is the IPv6 address; or if the at least one bit in the reserved field is a second value, the indication information is used to indicate that the type of the identifier of the first network device is the IPv4 address.
According to a second aspect, an embodiment of the present disclosure provides an MPLS-TP-based OAM packet processing method. The method may include: After a first network device sends an OAM packet to a second network device, the second network device receives the OAM packet sent by the first network device, where the OAM packet includes indication information and an identifier of the first network device, and the indication information is used to indicate a type of the identifier of the first network device, and is specifically used to indicate whether the OAM packet is an IPv4 network packet or an IPv6 network packet, so that the second network device can read the identifier of the first network device from the OAM packet based on the indication information. In this way, the OAM packet received by the second network device includes the indication information, and the indication information is used to indicate the type of the identifier of the first network device, that is, indicate whether the identifier of the first network device is an IPv4 address or an IPv6 address. In this way, the second network device can determine, based on the indication information, the type of the identifier that is of the first network device and that is carried in the OAM packet, and accurately read the identifier of the first network device from the OAM packet. Therefore, a user can perform MPLS-TP OAM to reduce a configuration workload, and can also implement MPLS-TP OAM in a plurality of scenarios such as an IPv4 network, an IPv6 network, and a network including IPv4 and IPv6, to expand an application scope of MPLS-TP OAM, and improve use experience of the user.
In an example, the indication information in the OAM packet may be used to indicate that the type of the identifier of the first network device is an IPv6 address. In this case, for example, S1002 may include: The second network device reads the IPv6 address of the first network device from the OAM packet. This ensures that the method is applicable to an IPv6 network.
In another example, the indication information in the OAM packet is used to indicate that the type of the identifier of the first network device is an IPv4 address. In this case, for example, S1002 may include: The second network device reads the IPv4 address of the first network device from the OAM packet. This ensures that the method is applicable to an IPv4 network.
In some possible implementations, the OAM packet includes a type field used to indicate an MEG type, and the type field may be used to carry the indication information. In a specific implementation, if a value of the type field is a first value, the indication information is used to indicate that the type of the identifier of the first network device is the IPv6 address; or if a value of the type field is a second value, the indication information is used to indicate that the type of the identifier of the first network device is the IPv4 address.
In some other possible implementations, the OAM packet includes a reserved field, and at least one bit in the reserved field may be used to carry the indication information. In a specific implementation, if the at least one bit in the reserved field is a first value, the indication information is used to indicate that the type of the identifier of the first network device is the IPv6 address; or if the at least one bit in the reserved field is a second value, the indication information is used to indicate that the type of the identifier of the first network device is the IPv4 address.
According to a third aspect, an embodiment of the present disclosure provides an MPLS-TP-based OAM packet processing method. The method is applicable to an IPv6 network. For example, the method may include: A first network device generates an OAM packet, where the OAM packet includes an IPv6 address of the first network device. The first network device sends the OAM packet to a second network device. This ensures that the second network device can accurately read the identifier of the first network device from the OAM packet after receiving the OAM packet. Therefore, a user can perform MPLS-TP OAM in an IP mode to reduce a configuration workload, and can also implement MPLS-TP OAM in an IPv6 network scenario to improve use experience of the user.
According to a fourth aspect, an embodiment of the present disclosure provides an MPLS-TP-based OAM packet processing method. The method is applicable to an IPv6 network. For example, the method may include a second network device receives an OAM packet sent by a first network device, where the OAM packet includes an IPv6 address of the first network device. The second network device reads the IPv6 address of the first network device from the OAM packet. In this way, the OAM packet received by the second network device includes the IPv6 address of the first network device, so that the second network device can accurately read the identifier of the first network device from the OAM packet. Therefore, a user can perform MPLS-TP OAM in an IP mode to reduce a configuration workload, and can also implement MPLS-TP OAM in an IPv6 network scenario to improve use experience of the user.
In the methods provided in the third aspect and the fourth aspect, the OAM packet may further include indication information, which is used to indicate a type of the identifier of the first network device, and is specifically used to indicate whether the OAM packet is an IPv4 network packet or an IPv6 network packet. For a manner of carrying the indication information in the OAM packet, refer to related descriptions of the indication information in the first aspect or the second aspect.
It should be noted that, in the methods provided in the first aspect to the fourth aspect, the OAM packet may further include an identifier of a path from the first network device to the second network device. The identifier of the path may be any one of the following identifiers: a label switched path LSP identifier, a section identifier, a PW identifier, or a ring identifier. In an embodiment, a field that is in the OAM packet and that is used to carry the identifier of the path may be adjacent to a field used to carry the identifier of the first network device. In this way, the receiver can accurately complete OAM detection based on the identifier of the path and the identifier of the first network device.
It should be noted that in the methods provided in the first aspect to the fourth aspect, the OAM packet may be a packet corresponding to an IP mode of MPLS-TP OAM. Alternatively, the OAM packet may be a packet corresponding to another mode of MPLS-TP OAM. An ICC mode of MPLS-TP OAM is used as an example. Indication information in an OAM packet corresponding to the ICC mode may also be used to indicate a type of an identifier (that is, an MEP ID) of the first network device, and is specifically used to indicate whether the OAM packet is an IPv4 network packet or an IPv6 network packet. To be specific, a mode corresponding to the OAM packet mentioned in this embodiment of the present disclosure is not specifically limited in this embodiment of the present disclosure.
According to a fifth aspect, the present disclosure further provides a first communications apparatus, including a transceiver unit and a processing unit. The transceiver unit is configured to perform a receiving and sending operation in the method according to any one of the first aspect or the possible implementations of the first aspect or any one of the third aspect or the possible implementations of the third aspect. The processing unit is configured to perform an operation other than the receiving and sending operation in the method according to any one of the first aspect or the possible implementations of the first aspect or any one of the third aspect or the possible implementations of the third aspect. For example, when the first communications apparatus performs the method according to the first aspect, the transceiver unit is configured to send an OAM packet to a second network device; and the processing unit is configured to generate the OAM packet.
According to a sixth aspect, an embodiment of the present disclosure further provides a second communications apparatus. The second communications apparatus includes a transceiver unit and a processing unit. The transceiver unit is configured to perform a receiving and sending operation in the method according to any one of the second aspect or the possible implementations of the second aspect or any one of the fourth aspect or the possible implementations of the fourth aspect. The processing unit is configured to perform an operation other than the receiving and sending operation in the method according to any one of the second aspect or the possible implementations of the second aspect or any one of the fourth aspect or the possible implementations of the fourth aspect. For example, when the second communications apparatus performs the method according to the second aspect, the transceiver unit is configured to receive an OAM packet sent by a first network device; and the processing unit is configured to read an identifier of the first network device in the OAM packet based on indication information.
According to a seventh aspect, an embodiment of the present disclosure further provides a first communications apparatus, including a first communications interface and a processor. The first communications interface is configured to perform a sending operation in the method according to any one of the first aspect or the possible implementations of the first aspect or any one of the third aspect or the possible implementations of the third aspect. The processor is configured to perform an operation other than the receiving and sending operation in the method according to any one of the first aspect or the possible implementations of the first aspect or any one of the third aspect or the possible implementations of the third aspect. The first communications apparatus may further include a second communications interface, and the second communications interface is configured to perform a receiving operation of the first network device.
According to an eighth aspect, an embodiment of the present disclosure further provides a second communications apparatus, including a first communications interface and a processor. The first communications interface is configured to perform a receiving operation in the method according to any one of the second aspect or the possible implementations of the second aspect or any one of the fourth aspect or the possible implementations of the fourth aspect. The processor is configured to perform an operation other than the receiving and sending operation in the method according to any one of the second aspect or the possible implementations of the second aspect or any one of the fourth aspect or the possible implementations of the fourth aspect. The second communications apparatus may further include a second communications interface, and the second communications interface is configured to perform a sending operation of the second network device.
According to a ninth aspect, an embodiment of the present disclosure further provides a first communications apparatus. The first communications apparatus includes a memory and a processor. The memory includes computer-readable instructions, and the processor communicating with the memory is configured to execute the computer-readable instructions, so that the first communications apparatus is configured to perform the method according to any one of the first aspect or the possible implementations of the first aspect or any one of the third aspect or the possible implementations of the third aspect.
According to a tenth aspect, an embodiment of the present disclosure further provides a second communications apparatus, and the second communications apparatus includes a memory and a processor. The memory includes computer-readable instructions, and the processor communicating with the memory is configured to execute the computer-readable instructions, so that the second communications apparatus is configured to perform the method according to any one of the second aspect or the possible implementations of the second aspect or any one of the fourth aspect or the possible implementations of the fourth aspect.
According to an eleventh aspect, an embodiment of the present disclosure further provides a computer-readable storage medium. The computer-readable storage medium stores instructions, and when the instructions are run on a computer, the computer is enabled to perform the method according to any one of the first aspect or the possible implementations of the first aspect, the method according to any one of the second aspect or the possible implementations of the second aspect, the method according to any one of the third aspect or the possible implementations of the third aspect, or the method according to any one of the fourth aspect or the possible implementation of the fourth aspect.
According to a twelfth aspect, an embodiment of the present disclosure further provides a computer program product, including a computer program or computer-readable instructions. When the computer program or the computer-readable instructions are run on a computer, the computer is enabled to perform the method according to any one of the first aspect or the possible implementations of the first aspect, the method according to any one of the second aspect or the possible implementations of the second aspect, the method according to any one of the third aspect or the possible implementations of the third aspect, or the method according to any one of the fourth aspect or the possible implementation of the fourth aspect.
According to a thirteenth aspect, an embodiment of the present disclosure further provides a communications system. The communications system includes the first communications apparatus according to the fifth aspect, the seventh aspect, or the ninth aspect and the second communications apparatus according to the sixth aspect, the eighth aspect, or the tenth aspect.
It should be noted that the communications apparatus in the foregoing embodiments may be a network device configured to perform the foregoing method, or may be a board, a line card, a chip, or the like configured to perform the foregoing method.
The following describes technical solutions of embodiments in the present disclosure with reference to accompanying drawings. A network architecture and a service scenario described in embodiments of the present disclosure are intended to describe the technical solutions in embodiments of the present disclosure more clearly, and do not constitute a limitation on the technical solutions provided in embodiments of the present disclosure. A person of ordinary skill in the art may know that with evolution of the network architecture and emergence of new service scenarios, the technical solutions provided in embodiments of the present disclosure are also applicable to similar technical problems.
Ordinal numbers such as “1”, “2”, “3”, “first”, “second”, and “third” in the present disclosure are used to distinguish between a plurality of objects, but are not intended to limit a sequence of the plurality of objects.
It should be understood that “A and/or B” mentioned in the present disclosure includes the following cases: Only A is included, only B is included, or both A and B are included.
Based on an actual requirement of an operator network, management work of the network usually includes three categories: operation, administration, and maintenance, OAM for short. MPLS-TP OAM is an OAM mechanism defined in MPLS-TP. MPLS-TP OAM is compatible with MPLS OAM functions and is correspondingly extended for transport network characteristics. Therefore, MPLS-TP OAM is widely concerned by carriers.
Currently, there are two modes of MPLS-TP OAM: an international telecommunication union carrier code (ICC) mode and an Internet Protocol (IP) mode. The ICC mode is a mode defined in Y.1731. In the ICC mode, a maintenance entity group end point identifier (MEP ID) and a maintenance entity group identifier (MEG ID) need to be configured on a network device, and the MEP ID and the MEG ID is carried in an OAM packet, to manage a network. In the IP mode, an MEP ID and an MEG ID do not need to be additionally configured on a network device, but an identifier of the network device and an identifier of a path are carried in an OAM packet, to manage a network.
The OAM packet may include, for example, a continuity check message (CCM), a loss measurement message (LMM), and a loss measurement reply (LMR) packet.
A CCM of MPLS-TP OAM is used as an example. A format of a (PDU of the CCM in an ICC mode is shown in
A format of the CCM PDU in the IP mode is shown in
It should be noted that an MPLS-TP OAM operation is performed based on a maintenance entity (ME). One ME may be understood as two endpoints of a path, that is, a pair of MEPs and an intermediate MEG intermediate point (MIP). An OAM function mainly runs between the two MEPs. One or more MEs that belong to a same transmission path form one MEG. The MEP has a capability of initiating and terminating an OAM packet, and can perform fault management and performance monitoring. The MIP is an intermediate point of the MEG, can forward an OAM packet, and respond to a part of the OAM packet, but cannot initiate the OAM packet.
In an ICC mode, to uniquely identify a sender network device and a transmission path of OAM detection, an MEP ID and an MEG ID are configured on the network device, and the MEP ID and MEG ID are carried in the OAM packet. In this way, if there are a large quantity of network devices on a network, a large quantity of configurations need to be performed. In addition, to ensure effectiveness of OAM detection, configuring repeated MEP IDs and MEG IDs on a large quantity of network devices further need to be avoided, which is not simple and convenient for a user. In the IP mode, known information on the network device, that is, an identifier of the network device and an identifier of a path, is used to replace functions of the MEP ID and the MEG ID in the OAM packet, that is, uniquely identify the sender network device and the transmission path of OAM detection. Therefore, in the IP mode of MPLS-TP OAM, the MEP ID and the MEG ID do not need to be configured on the network device, so that a configuration workload of a user can be reduced and repeated configuration does not need to be considered. Therefore, the IP mode has significant advantages and is favored by users.
Currently, an OAM packet in the IP mode of MPLS-TP OAM is shown in
Based on this, an embodiment of the present disclosure provides an OAM packet processing method. An OAM packet generated by a sender network device includes indication information, and the indication information is used to indicate a type of an identifier of the sender network device, that is, indicate whether the identifier of the sender network device is an IPv4 address or an IPv6 address. When the indication information carried in the OAM packet indicates that an IP address of the sender network device is the IPv4 address, the identifier that is of the first network device and that is included in the OAM packet is the IPv4 address of the first network device. When the indication information carried in the OAM packet indicates that an IP address of the sender network device is the IPv6 address, the identifier that is of the first network device and that is included in the OAM packet is the IPv6 address of the first network device. In this way, a second network device that receives the OAM packet can determine, based on the indication information, the type of the identifier that is of the sender network device and that is carried in the OAM packet, and accurately read the identifier of the sender network device from the OAM packet. Therefore, a user can perform MPLS-TP OAM to reduce a configuration workload, and can also implement MPLS-TP OAM in a plurality of scenarios such as an IPv4 network, an IPv6 network, and a network including IPv4 and IPv6, to expand an application scope of MPLS-TP OAM, and improve use experience of the user.
It should be noted that the OAM packet in this embodiment of the present disclosure may be a packet corresponding to any mode of MPLS-TP OAM. For example, if the OAM packet is a packet corresponding to an ICC mode of MPLS-TP OAM, the indication information in the OAM packet may also be used to indicate a type of an identifier (that is, an MEP ID) of the first network device, and is specifically used to indicate whether the OAM packet is an IPv4 network packet or an IPv6 network packet. In the IP mode of MPLS-TP OAM, the MEP ID and the MEG ID do not need to be configured on the network device, so that configuration resources can be saved. Therefore, the IP mode provides better user experience. Based on this, in this embodiment of the present disclosure, the OAM packet corresponding to the IP mode of MPLS-TP OAM is used as an example for related description.
For example, the CCM is still used as an example. In this embodiment of the present disclosure, a value of the type field is set to indicate an MEG type detected by the CCM and an applicable IP network. For example, values 1 to 4 of the type field respectively indicate that the CCM detects MEGs of an LSP type, a PW type, a section type, and a ring type, and is applicable to an IPv4 network; and values 5 to 8 of the type field respectively indicate that the CCM detects MEGs of an LSP type, a PW type, a section type, and a ring type, and is applicable to an IPv6 network.
In an example, a format of a CCM PDU in a CCM generated by a network device in an IPv4 network is shown in
In another example, a format of a CCM PDU in a CCM generated by a network device in an IPv6 network is shown in
In this way, the receiver network device can accurately read the identifier of the sender network device based on the indication information in the received OAM packet, to effectively implement an OAM function.
It should be noted that the network device in this embodiment of the present disclosure is any network device that can implement an OAM function, for example, may be a packet transport network (PTN) device, a switch, or a router. This is not specifically limited in this embodiment of the present disclosure.
It may be understood that, the scenario is merely a scenario example provided in embodiments of the present disclosure, but embodiments of the present disclosure are not limited to the scenario.
With reference to the accompanying drawings, the following describes in detail a specific implementation of an OAM packet processing method in embodiments of the present disclosure by using embodiments.
An embodiment of the present disclosure provides an OAM packet processing method 100. An IP mode of MPLS-TP OAM is used as an example. The method 100 is applicable to an IPv4 network, an IPv6 network, and a network including both IPv4 and IPv6.
S301: A network device 1 generates an OAM packet, where the OAM packet includes indication information and an identifier 1 of the network device 1, and the indication information is used to indicate a type of the identifier 1 of the network device 1.
The network device 1 is an MEP that initiates an OAM packet in an MEG, and an MEP that receives and terminates the OAM packet in the MEG is a network device 2. The OAM packet is specifically a packet corresponding to an IP mode of MPLS-TP OAM.
The OAM packet includes an identifier 1 of a network device 1 and a path identifier 1, which are respectively used to notify a network device 2 that a network device that initiates OAM detection is the network device 1 and a path of OAM detection is a path 1, to ensure that effective OAM detection can be implemented based on the OAM packet. For example, the network device 1 is an LSR. The identifier 1 of the network device 1 may be an LSR ID, and the LSR ID is used to uniquely identify an LSR. The LSR ID may be, for example, an IP address of the LSR. If the LSR belongs to an IPv4 network, the LSR ID is an IPv4 address of the LSR. If the LSR belongs to an IPv6 network, the LSR ID is an IPv6 address of the LSR.
If the identifier 1 of the network device 1 is an IPv4 address, a field used to carry the identifier 1 of the network device 1 occupies at least 32-bit space in the OAM packet; or if the identifier 1 of the network device 1 is an IPv6 address, a field used to carry the identifier 1 of the network device 1 occupies at least 128-bit space in the OAM packet, to expand an application scope of MPLS-TP OAM, so that an OAM function is applicable to a plurality of scenarios such as an IPv4 network, an IPv6 network, and a network including an IPv4 and an IPv6. To enable the receiver network device to effectively obtain the identifier 1 of the network device 1, the OAM packet also carries indication information. The indication information is used to indicate a type of the identifier 1 of the network device 1, that is, the indication information may be used to indicate whether the OAM packet is an IPv4 network packet or an IPv6 network packet, or the indication information may indicate whether the identifier 1 of the network device 1 is an IPv6 address or an IPv4 address. In this way, the receiver network device can accurately obtain the identifier 1 of the network device 1 from the OAM packet based on the indication information, to implement effective OAM detection.
In an example, the indication information may be carried in a type field, and the type field is further used to indicate a type of an MEG. For example, if a value of the type field is 1, it indicates that the OAM detects an MEG of an LSP type, and the identifier 1 of the network device 1 initiating OAM detection is an IPv4 address; if a value of the type field is 2, it indicates that the OAM detects an MEG of a PW type, and the identifier 1 of the network device 1 initiating OAM detection is an IPv4 address; if a value of the type field is 3, it indicates that the OAM detects an MEG of a section type, and the identifier 1 of the network device 1 initiating OAM detection is an IPv4 address; if a value of the type field is 4, it indicates that the OAM detects an MEG of a ring type, and the identifier 1 of the network device 1 initiating OAM detection is an IPv4 address; if a value of the type field is 5, it indicates that the OAM detects an MEG of an LSP type, and the identifier 1 of the network device 1 initiating OAM detection is an IPv6 address; if a value of the type field is 6, it indicates that the OAM detects an MEG of a PW type, and the identifier 1 of the network device 1 initiating OAM detection is an IPv6 address; if a value of the type field is 7, it indicates that the OAM detects an MEG of a section type, and the identifier 1 of the network device 1 initiating OAM detection is an IPv6 address; or if a value of the type field is 8, it indicates that the OAM detects an MEG of a ring type, and the identifier 1 of the network device 1 initiating OAM detection is an IPv6 address. Based on this, when the value of the type field is any value in 1 to 4, it may indicate that the type of the identifier 1 of the network device 1 is the IPv4 address; and when the value of the type field is any value in 5 to 8, it may indicate that the type of the identifier 1 of the network device 1 is the IPv6 address.
In another example, the indication information may alternatively be carried in a reserved field. For example, at least one unoccupied bit in the reserved field is used to carry the indication information. It should be noted that the reserved field is a space of 16 bits (a zeroth bit to a fifteenth bit), and currently an eighth bit and a twelfth bit are occupied to represent a service type of a PW. Based on this, the indication information may be specifically at least one of an eighth bit, a ninth bit, a tenth bit, an eleventh bit, a thirteenth bit, a fourteenth bit, and a fifteenth bit. When the at least one bit is a first value, it indicates that the type of the identifier 1 of the network device 1 is an IPv4 address; or when the at least one bit is a second value, it indicates that the type of the identifier 1 of the network device 1 is an IPv6 address. In a case, for example, an eighth bit of the reserved field carries the indication information. The first value is 0, and the second value is 1. In this case, when a value of the eighth bit of the reserved field is 0, it indicates that the type of the identifier 1 of the network device 1 is an IPv4 address; or when a value of the eighth bit of the reserved field is 1, it indicates that the type of the identifier 1 of the network device 1 is an IPv6 address. In another case, for example, the eighth bit and the ninth bit of the reserved field carry the indication information. The first value is 00, and the second value is 11. In this case, when values of the eighth bit and the ninth bit of the reserved field are 00, it indicates that the type of the identifier 1 of the network device 1 is an IPv4 address; or when values of the eighth bit and the ninth bit of the reserved field are 11, it indicates that the type of the identifier 1 of the network device 1 is an IPv6 address. In still another case, for example, the eighth bit to the eleventh bit of the reserved field carry the indication information. The first value is 0, and the second value is 1. In this case, when the eighth bit to the eleventh bit of the reserved field are 0000 (a value of 0), it indicates that the type of the identifier 1 of the network device 1 is an IPv4 address; or when the eighth bit to the eleventh bit of the reserved field are 0001 (a value of 1), it indicates that the type of the identifier 1 of the network device 1 is an IPv6 address.
In a case in which the type field carries the indication information, a format of the OAM PDU is described by using an example in which a path type detected in the CCM is an LSP type, a section type, a PW type, or a ring type.
When the detected path type is the LSP type, if the identifier 1 of the network device 1 is an IPv4 address of the network device 1, for details about the OAM PDU, reference is made to
When the detected path type is the PW type, if the identifier 1 of the network device 1 is an IPv4 address of the network device 1, for details about the OAM PDU, reference is made to
When the detected path type is the section type, if the identifier 1 of the network device 1 is an IPv4 address of the network device 1, for details about the OAM PDU, reference is made to
When the detected path type is the ring type, if the identifier 1 of the network device 1 is an IPv4 address of the network device 1, for details about the OAM PDU, reference is made to
In a case in which the reserved field carries the indication information, it is assumed that the eighth bit of the reserved field is used to carry the indication information. A format of the OAM PDU is described by using an example in which a path type detected in the CCM is an LSP type, a section type, a PW type, and a ring type.
When the detected path type is an LSP, if Type field=1, it indicates that the OAM detects an MEG of an LSP type. If the identifier 1 of the network device 1 is an IPv4 address of the network device 1, for details about the OAM PDU, reference is made to
When the detected path type is the PW type, if Type field=2, it indicates that the OAM detects an MEG of the PW type. If the identifier 1 of the network device 1 is an IPv4 address of the network device 1, for details about the OAM PDU, reference is made to
When the detected path type is a section type, if Type field=3, it indicates that the OAM detects an MEG of the section type. If the identifier 1 of the network device 1 is an IPv4 address of the network device 1, for details about the OAM PDU, reference is made to
When the detected path type is a ring type, if Type field=4, it indicates that the OAM detects an MEG of the ring type. If the identifier 1 of the network device 1 is an IPv4 address of the network device 1, for details about the OAM PDU, reference is made to
It should be noted that, in the foregoing example, the identifier 1 of the network device 1 occupies continuous space of the OAM PDU in the OAM packet, and a field that carries the identifier 1 of the network device 1 is adjacent to a field that carries the path identifier 1. In some other possible implementations, in order not to extend a length of the field that carries the identifier 1 of the network device 1 in the current IP mode, when the network device 1 is a network device in an IPv6 network, the 128-bit identifier 1 of the network device 1 may be segmented into the first 32 bits and the last 96 bits, where the first 32 bits are stored in the field that carries the identifier 1 of the network device 1 in the current IP mode, and the last 96 bits of the IPv6 address are stored in a reserved field after a field that carries the path identifier 1. The scenario shown in
In this way, the network device 1 generates the OAM packet that carries the indication information, so that it is possible that an OAM mechanism is applicable to more extensive application scenarios.
S302: The network device 1 sends the OAM packet to the network device 2.
S303: The network device 2 receives the OAM packet sent by the network device 1.
In this embodiment of the present disclosure, an occasion, a rule, and a specific sending manner of sending the OAM packet by the network device 1 to the network device 2 are not limited.
S304: The network device 2 reads the identifier 1 of the network device 1 from the OAM packet based on the indication information.
In a specific implementation, after receiving the OAM packet, the network device 2 obtains the indication information from the OAM packet, and accurately reads the identifier 1 of the network device 1 from the OAM packet based on an indication of the indication information. In an example, when the indication information is used to indicate that the type of the identifier 1 of the network device 1 is an IPv6 address, S304 may be that the network device 2 reads the IPv6 address of the network device 1 from the OAM packet. In another example, when the indication information is used to indicate that the type of the identifier 1 of the network device 1 is an IPv4 address, S304 may be that the network device 2 reads the IPv4 address of the network device 1 from the OAM packet.
For example, it is assumed that a format of an OAM PDU in the OAM packet is shown in
For example, it is assumed that a format of an OAM PDU in the OAM packet is shown in
It should be noted that in this embodiment of the present disclosure, an example in which the OAM packet is a CCM is used for description. Other OAM packets such as an LMM and an LMR packet are all applicable to the OAM packet processing method provided in this embodiment of the present disclosure. To be specific, the indication information used to indicate the type of the identifier of the network device is carried in the OAM packet, so that an OAM mechanism is applicable to more network scenarios. For specific implementations of all types of OAM packets, refer to related descriptions of the CCM packet. Details are not described again in this embodiment of the present disclosure.
It should be noted that the network device 2 may implement OAM detection on the MEG from the network device 1 to the network device 2 based on the received OAM packet. A specific detection principle and implementation are not improvement points in this embodiment of the present disclosure, and are not described in detail in this embodiment of the present disclosure.
It can be learned that, according to the method 100 provided in this embodiment of the present disclosure, the OAM packet generated by the sender network device includes the indication information, and the indication information is used to indicate the type of the identifier of the sender network device, that is, indicate whether the identifier of the sender network device is an IPv4 address or an IPv6 address. When the indication information carried in the OAM packet indicates that an IP address of the sender network device is the IPv4 address, the identifier that is of the sender network device and that is included in the OAM packet is the IPv4 address of the sender network device. When the indication information carried in the OAM packet indicates that an IP address of the sender network device is the IPv6 address, the identifier that is of the sender network device and that is included in the OAM packet is the IPv6 address of the sender network device. In this way, a receiver network device that receives the OAM packet can determine, based on the indication information, the type of the identifier that is of the sender network device and that is carried in the OAM packet, and accurately read the identifier of the sender network device from the OAM packet. Therefore, a user can perform MPLS-TP OAM to reduce a configuration workload, and can also implement MPLS-TP OAM in a plurality of scenarios such as an IPv4 network, an IPv6 network, and a network including IPv4 and IPv6, to expand an application scope of MPLS-TP OAM, and improve use experience of the user.
S701: A network device 1 generates an OAM packet, where the OAM packet includes an IPv6 address of the network device 1.
Because a type of an identifier of the network device 1 is the IPv6 address, an identifier 1 that is of the network device 1 and that is carried in the OAM packet needs to occupy 128-bit space. To be applicable to an MPLS-TP OAM mechanism in an IPv6 network, the OAM packet generated by the network device 1 needs to include 128-bit space used to carry the identifier 1 of the network device 1.
In an example, a field that carries the identifier 1 of the network device 1 may be extended in the OAM packet, and is extended from 32 bits to 128 bits, to carry the IPv6 address of the network device 1. The scenario corresponding to
In another example, in the OAM packet, a field that carries the identifier 1 of the network device 1 is not extended, but 96 bits of the reserved field after the field used to carry the path identifier 1 are used to carry the last 96 bits of the IPv6 address of the network device 1, or 128 bits of the reserved field after the field used to carry the path identifier 1 are used to carry the IPv6 address of the network device 1. The scenario corresponding to
It should be noted that the OAM packet may further include a path identifier 1, used to indicate a path type of OAM detection. The path type may be, for example, an LSP type, a PW type, a section type, or a ring type. In this case, the path identifier 1 may be any one of the following identifiers: an LSP identifier, a section identifier, a PW identifier, or a ring identifier.
S702: The network device 1 sends the OAM packet to the network device 2.
S703: The network device 2 receives the OAM packet sent by the network device 1.
S704: The network device 2 reads the IPv6 address of the network device 1 from the OAM packet.
In a specific implementation, after receiving the OAM packet, the network device 2 reads the identifier 1 of the network device 1 from the OAM packet, that is, reads the 128-bit IPv6 address of the network device 1 from the OAM packet.
In this embodiment, the OAM packet may further include indication information, which is used to indicate a type of the identifier of the network device 1, and is specifically used to indicate whether the OAM packet is an IPv4 network packet or an IPv6 network packet. For a manner of carrying the indication information in the OAM packet, refer to related descriptions of the indication information in the embodiment shown in
It can be learned that, according to the method 200 provided in this embodiment of the present disclosure, the OAM packet generated by the sender network device includes the IPv6 address of the network device 1 that is used as the identifier 1 of the network device 1. In this way, a receiver network device that receives the OAM packet can accurately read the identifier of the sender network device from the OAM packet. Therefore, a user can perform MPLS-TP OAM in an IP mode to reduce a configuration workload, and can also implement MPLS-TP OAM in an IPv6 network scenario to improve use experience of the user.
S901: A first network device generates an OAM packet, where the OAM packet includes indication information and an identifier of the first network device, and the indication information is used to indicate a type of the identifier of the first network device.
S902: The first network device sends the OAM packet to a second network device.
The first network device may be the network device 1 in the method 100, and the second network device is the network device 2 in the method 100. For specific operations performed by the first network device, refer to the operations performed by the network device 1 in the method 100. The OAM packet may be the OAM packet in the method 100, the indication information may be the indication information in the method 100, and the identifier of the first network device may be the identifier 1 of the network device 1 in the method 100.
In an example, the indication information in the OAM packet is used to indicate that the type of the identifier of the first network device is an IPv6 address. This ensures that the method 300 is applicable to an IPv6 network.
In another example, the indication information in the OAM packet is used to indicate that the type of the identifier of the first network device is an IPv4 address. This ensures that the method 300 is applicable to an IPv4 network.
In some possible implementations, the OAM packet includes a type field used to indicate an MEG type, and the type field may be used to carry the indication information. In a specific implementation, if a value of the type field is a first value, the indication information is used to indicate that the type of the identifier of the first network device is the IPv6 address; or if a value of the type field is a second value, the indication information is used to indicate that the type of the identifier of the first network device is the IPv4 address.
In some other possible implementations, the OAM packet includes a reserved field, and at least one bit in the reserved field may be used to carry the indication information. In a specific implementation, if the at least one bit in the reserved field is a first value, the indication information is used to indicate that the type of the identifier of the first network device is the IPv6 address; or if the at least one bit in the reserved field is a second value, the indication information is used to indicate that the type of the identifier of the first network device is the IPv4 address.
In an example, the OAM packet may further include an identifier of a path from the first network device to the second network device. The identifier of the path may be any one of the following identifiers: a label switched path LSP identifier, a section identifier, a PW identifier, or a ring identifier. In an embodiment, a field that is in the OAM packet and that is used to carry the identifier of the path may be adjacent to a field used to carry the identifier of the first network device. In this way, the receiver can accurately complete OAM detection based on the identifier of the path and the identifier of the first network device.
It should be noted that the OAM packet in this embodiment of the present disclosure is specifically a packet corresponding to an IP mode of MPLS-TP OAM.
It can be learned that, according to the method 300 provided in this embodiment of the present disclosure, the OAM packet generated by the first network device includes the indication information, and the indication information is used to indicate the type of the identifier of the first network device, that is, indicate whether the identifier of the first network device is an IPv4 address or an IPv6 address. When the indication information carried in the OAM packet indicates that an IP address of the first network device is the IPv4 address, the identifier that is of the first network device and that is included in the OAM packet is the IPv4 address of the first network device. When the indication information carried in the OAM packet indicates that an IP address of the first network device is the IPv6 address, the identifier that is of the first network device and that is included in the OAM packet is the IPv6 address of the first network device. In this way, it can be ensured that a receiver network device that receives the OAM packet determines, based on the indication information, the type of the identifier that is of the first network device and that is carried in the OAM packet, and accurately reads the identifier of the first network device from the OAM packet. Therefore, a user can perform MPLS-TP OAM in an IP mode to reduce a configuration workload, and can also implement MPLS-TP OAM in a plurality of scenarios such as an IPv4 network, an IPv6 network, and a network including IPv4 and IPv6, to expand an application scope of MPLS-TP OAM, and improve use experience of the user.
S1001: A second network device receives an OAM packet sent by a first network device, where the OAM packet includes indication information and an identifier of the first network device, and the indication information is used to indicate a type of the identifier of the first network device.
S1002: The second network device reads the identifier of the first network device from the OAM packet based on the indication information.
The second network device may be the network device 2 in the method 100, and the first network device is the network device 1 in the method 100. For specific operations performed by the second network device, refer to the operations performed by the network device 2 in the method 100. The OAM packet may be the OAM packet in the method 100, the indication information may be the indication information in the method 100, and the identifier of the first network device may be the identifier 1 of the network device 1 in the method 100.
In an example, the indication information in the OAM packet may be used to indicate that the type of the identifier of the first network device is an IPv6 address. In this case, for example, S1002 may include: The second network device reads the IPv6 address of the first network device from the OAM packet. This ensures that the method 400 is applicable to an IPv6 network.
In another example, the indication information in the OAM packet is used to indicate that the type of the identifier of the first network device is an IPv4 address. In this case, for example, S1002 may include: The second network device reads the IPv4 address of the first network device from the OAM packet. This ensures that the method 400 is applicable to an IPv4 network.
In some possible implementations, the OAM packet includes a type field used to indicate a MEG type, and the type field may be used to carry the indication information. In a specific implementation, if a value of the type field is a first value, the indication information is used to indicate that the type of the identifier of the first network device is the IPv6 address; or if a value of the type field is a second value, the indication information is used to indicate that the type of the identifier of the first network device is the IPv4 address.
In some other possible implementations, the OAM packet includes a reserved field, and at least one bit in the reserved field may be used to carry the indication information. In a specific implementation, if the at least one bit in the reserved field is a first value, the indication information is used to indicate that the type of the identifier of the first network device is the IPv6 address; or if the at least one bit in the reserved field is a second value, the indication information is used to indicate that the type of the identifier of the first network device is the IPv4 address.
In an example, the OAM packet may further include an identifier of a path from the first network device to the second network device. The identifier of the path may be any one of the following identifiers: a label switched path LSP identifier, a section identifier, a PW identifier, or a ring identifier. In an embodiment, a field that is in the OAM packet and that is used to carry the identifier of the path may be adjacent to a field used to carry the identifier of the first network device. In this way, the receiver can accurately complete OAM detection based on the identifier of the path and the identifier of the first network device.
It should be noted that the OAM packet in this embodiment of the present disclosure is specifically a packet corresponding to an IP mode of MPLS-TP OAM.
It can be learned that, according to the method 400 provided in this embodiment of the present disclosure, the OAM packet received by the second network device includes the indication information, and the indication information is used to indicate the type of the identifier of the first network device, that is, indicate whether the identifier of the first network device is an IPv4 address or an IPv6 address. In this way, the second network device can determine, based on the indication information, the type of the identifier that is of the first network device and that is carried in the OAM packet, and accurately read the identifier of the first network device from the OAM packet. Therefore, a user can perform MPLS-TP OAM in an IP mode to reduce a configuration workload, and can also implement MPLS-TP OAM in a plurality of scenarios such as an IPv4 network, an IPv6 network, and a network including IPv4 and IPv6, to expand an application scope of MPLS-TP OAM, and improve use experience of the user.
S1101: A first network device generates an OAM packet, where the OAM packet includes an IPv6 address of the first network device.
S1102: The first network device sends an OAM packet to a second network device.
The first network device may be the network device 1 in the method 200, and the second network device is the network device 2 in the method 200. For specific operations performed by the first network device, refer to the operations performed by the network device 1 in the method 200. The OAM packet may be the OAM packet in the method 200, and the IPv6 address of the first network device may be the IPv6 address of the network device 1 in the method 200.
In an example, the OAM packet may further include an identifier of a path from the first network device to the second network device. The identifier of the path may be any one of the following identifiers: a label switched path LSP identifier, a section identifier, a PW identifier, or a ring identifier. In an embodiment, a field that is in the OAM packet and that is used to carry the identifier of the path may be adjacent to a field used to carry the identifier of the first network device. In this way, the receiver can accurately complete OAM detection based on the identifier of the path and the identifier of the first network device.
It should be noted that the OAM packet in this embodiment of the present disclosure is specifically a packet corresponding to an IP mode of MPLS-TP OAM.
It can be learned that, according to the method 500 provided in this embodiment of the present disclosure, the OAM packet generated by the first network device includes the IPv6 address of the first network device that is used as the identifier of the first network device. In this way, after receiving the OAM packet, the second network device can accurately read the identifier of the first network device from the OAM packet. Therefore, a user can perform MPLS-TP OAM in an IP mode to reduce a configuration workload, and can also implement MPLS-TP OAM in an IPv6 network scenario to improve use experience of the user.
S1201: A second network device receives an OAM packet sent by a first network device, where the OAM packet includes an IPv6 address of the first network device.
S1202: The second network device reads the IPv6 address of the first network device from the OAM packet.
The second network device may be the network device 2 in the method 200, and the first network device is the network device 1 in the method 200. For specific operations performed by the second network device, refer to the operations performed by the network device 2 in the method 200. The OAM packet may be the OAM packet in the method 200, and the IPv6 address of the first network device may be the IPv6 address of the network device 1 in the method 200.
In an example, the OAM packet may further include an identifier of a path from the first network device to the second network device. The identifier of the path may be any one of the following identifiers: a label switched path LSP identifier, a section identifier, a PW identifier, or a ring identifier. In an embodiment, a field that is in the OAM packet and that is used to carry the identifier of the path may be adjacent to a field used to carry the identifier of the first network device. In this way, the receiver can accurately complete OAM detection based on the identifier of the path and the identifier of the first network device.
It should be noted that the OAM packet in this embodiment of the present disclosure is specifically a packet corresponding to an IP mode of MPLS-TP OAM.
It can be learned that, according to the method 600 provided in this embodiment of the present disclosure, the OAM packet received by the second network device includes the IPv6 address of the first network device, so that the second network device can accurately read the identifier of the first network device from the OAM packet. Therefore, a user can perform MPLS-TP OAM in an IP mode to reduce a configuration workload, and can also implement MPLS-TP OAM in an IPv6 network scenario to improve use experience of the user.
In addition, as shown in
In addition, as shown in
In addition, as shown in
In addition, as shown in
In addition, as shown in
In addition, as shown in
It may be understood that, in the foregoing embodiment, the processor may be a central processing unit (CPU), a network processor (NP), or a combination of a CPU and an NP. Alternatively, the processor 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), generic array logic (GAL), or any combination thereof. The processor may be one processor, or may include a plurality of processors. The memory may include a volatile memory, for example, a random-access memory (RAM). Alternatively, the memory may include a non-volatile memory, for example, a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid-state drive SSD). Alternatively, the memory may include a combination of the foregoing memories. The memory may be one memory, or may include a plurality of memories. In a specific implementation, the memory stores computer-readable instructions, and the computer-readable instructions include a plurality of software modules, for example, a sending module, a processing module, and a receiving module. After executing each software module, the processor may perform a corresponding operation according to an indication of each software module. In this embodiment, an operation performed by a software module is actually an operation performed by the processor according to an indication of the software module. After executing the computer-readable instructions in the memory, the processor may perform, according to an indication of the computer-readable instructions, all operations that can be performed by each network node in OAM detection.
It may be understood that, in the foregoing embodiment, the second communications apparatus 1502 in the first communications apparatus 1500 may be specifically used as the sending unit 1302 in the first communications apparatus 1300 to implement data communication between the first network device and the second network device. The first communications interface 1501 in the first communications apparatus 1500 may be specifically used as the receiving unit in the first communications apparatus 1300, for example, may be configured to receive another OAM packet sent by an upstream network device. Similarly, the first communications interface 1601 in the second communications apparatus 1600 may be specifically used as the receiving unit 1401 in the second communications apparatus 1400 to implement data communication between the first network device and the second network device. The second communications interface 1602 in the second communications apparatus 1600 may be specifically used as the sending unit in the second communications apparatus 1400 to implement data communication between the second network device and a downstream network device.
In addition, as shown in
It should be noted that each communications apparatus in the foregoing embodiments may be a network device configured to perform the foregoing method, or may be a board, a line card, a chip, or the like configured to perform the foregoing method.
In addition, an embodiment of the present disclosure further provides a computer-readable storage medium. The computer-readable storage medium stores instructions, and when the instructions are run on a computer, the computer is enabled to perform the OAM packet processing methods in the embodiments shown in
In addition, an embodiment of the present disclosure further provides a computer program product, including a computer program or computer-readable instructions. When the computer program or the computer-readable instructions are run on a computer, the computer is enabled to perform the OAM packet processing methods in the embodiments shown in
It can be learned from the foregoing descriptions of the implementations that, a person skilled in the art may clearly understand that some or all steps of the methods in embodiments may be implemented by software in addition to a universal hardware platform. Based on such an understanding, the technical solutions of the present disclosure may be implemented in a form of a software product. The computer software product may be stored in a storage medium, for example, a ROM/RAM, a magnetic disk, or a compact disc, and includes several instructions for instructing a computer device (which may be a personal computer, a server, or a network communications device such as a router) to perform the methods described in embodiments or some parts of embodiments of the present disclosure.
Embodiments in this specification are all described in a progressive manner, for same or similar parts in embodiments, reference may be made to these embodiments, and each embodiment focuses on a difference from other embodiments. Especially, system and device embodiments are basically similar to the method embodiments, and therefore are described briefly. For related parts, refer to partial descriptions in the method embodiments. The described device and system embodiments are merely examples. The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical modules, and may be located in one position, or may be distributed on a plurality of network units. Some or all of the modules may be selected based on actual requirements to achieve the objectives of the solutions of embodiments. A person of ordinary skill in the art may understand and implement embodiments of the present disclosure without creative efforts.
The foregoing descriptions are merely example implementations of the present disclosure, but are not intended to limit the protection scope of the present disclosure. It should be noted that a person of ordinary skill in the art may make some improvements and polishing without departing from the present disclosure and the improvements and polishing shall fall within the protection scope of the present disclosure.
Number | Date | Country | Kind |
---|---|---|---|
202010917057.3 | Sep 2020 | CN | national |
This application is a continuation of International Patent Application No. PCT/CN2021/113974, filed on Aug. 23, 2021, which claims priority to Chinese Patent Application No. 202010917057.3, filed on Sep. 3, 2020. The disclosures of the aforementioned applications are hereby incorporated by reference in their entireties.
Number | Date | Country | |
---|---|---|---|
Parent | PCT/CN2021/113974 | Aug 2021 | US |
Child | 18176718 | US |