Operation, Administration, and Maintenance OAM Packet Processing Method and Device
20230208756 · 2023-06-29
Inventors
Cpc classification
H04L43/10
ELECTRICITY
H04L45/50
ELECTRICITY
International classification
Abstract
An OAM packet processing method includes generating, by a first network device, an OAM packet, where the OAM packet is an MPLS-TP packet that includes an identifier of the first network device and indication information indicating a type of the identifier of the first network device. The first network device sends the OAM packet to the second network device. After receiving the OAM packet, the second network device can determine, based on the indication information, the type of the identifier of the first network device that is carried in the OAM packet, and accurately read the identifier of the first network device from the OAM packet. Therefore, MPLS-TP OAM can be implemented 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.
Claims
1. A method implemented by a first network device, the method comprising: generating an operation, administration, and maintenance (OAM) packet comprising a first identifier of the first network device and indication information indicating a type of the first identifier; and sending the OAM packet to a second network device.
2. The method of claim 1, wherein the indication information indicates that the type of the first identifier is an Internet Protocol version 6 (IPv6) address.
3. The method of claim 1, wherein the indication information indicates that the type of the first identifier is an Internet Protocol version 4 (IPv4) address.
4. The method of claim 1, wherein the OAM packet further comprises a type field indicating a maintenance entity group (MEG) type, and wherein the type field carries the indication information.
5. The method of claim 4, wherein when the type field carries a first value, the indication information indicates that the type of the first identifier is an IPv6 address; and when the type field carries a second value, the indication information indicates that the type of the first identifier is an IPv4 address.
6. The method of claim 1, wherein the OAM packet comprises a reserved field carrying the indication information.
7. The method of claim 6, wherein when the reserved field comprises a first value, the indication information indicates that the type of the first identifier is an IPv6 address; and when the reserved field comprises a second value, the indication information indicates that the type of the first identifier is an IPv4 address.
8. The method of claim 1, wherein the OAM packet further comprises a second identifier of a path from the first network device to the second network device.
9. The method of claim 8, wherein the OAM packet further comprises a first field carrying the first identifier and a second field carrying the second identifier, and wherein the first field is adjacent to the second field.
10. The method of claim 8, wherein the second identifier is a label switched path (LSP) identifier, a section identifier, a pseudo wire (PW) identifier, or a ring identifier.
11. The method of claim 1, wherein the OAM packet corresponds to an Internet Protocol (IP) mode of multi-protocol label switching-transport profile (MPLS-TP) OAM.
12. A method implemented by a second network device, the method comprising: receiving, from a first network device, an OAM packet comprising a first identifier of the first network device and indication information indicating a type of the first identifier; and reading the first identifier in the OAM packet based on the indication information.
13. The method of claim 12, wherein the indication information indicates that the type of the first identifier is an Internet Protocol version 6 (IPv6) address, and wherein reading the first identifier comprises reading the IPv6 address of the first network device from the OAM packet.
14. The method of claim 12, wherein the indication information indicates that the type of the first identifier is an Internet Protocol version 4 (IPv4) address, and wherein reading the first identifier comprises: reading the IPv4 address of the first network device from the OAM packet.
15. The method of claim 12, wherein the OAM packet further comprises a type field indicating a maintenance entity group (MEG) type, and wherein the type field carries the indication information.
16. A first network device comprising: a memory configured to store instructions; and a processor coupled to the memory and configured to execute the instructions to cause the first network device to: generate an OAM packet comprising a first identifier of the first network device and indication information indicating a type of the first identifier; and send the OAM packet to a second network device.
17. The first network device of claim 16, wherein the indication information indicates that the type of the first identifier is an Internet Protocol version 6 (IPv6) address.
18. The first network device of claim 16, wherein the indication information indicates that the type of the first identifier is an Internet Protocol version 4 (IPv4) address.
19. The first network device of claim 16, wherein the OAM packet further comprises a type field indicating a maintenance entity group (MEG) type, and wherein the type field carries the indication information.
20. The first network device of claim 19, wherein the type field carries a first value indicating that the type of the first identifier is an IPv6 address; or wherein the type field carries a second value indicating that the type of the first identifier is an IPv4 address.
Description
BRIEF DESCRIPTION OF DRAWINGS
[0032]
[0033]
[0034]
[0035]
[0036]
[0037]
[0038]
[0039]
[0040]
[0041]
[0042]
[0043]
[0044]
[0045]
[0046]
[0047]
[0048]
[0049]
[0050]
[0051]
[0052]
[0053]
[0054]
[0055]
[0056]
[0057]
[0058]
[0059]
[0060]
[0061]
[0062]
[0063]
[0064]
[0065]
[0066]
DESCRIPTION OF EMBODIMENTS
[0067] 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.
[0068] 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.
[0069] 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.
[0070] 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.
[0071] 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.
[0072] The OAM packet may include, for example, a continuity check message (CCM), a loss measurement message (LMM), and a loss measurement reply (LMR) packet.
[0073] 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
[0074] A format of the CCM PDU in the IP mode is shown in
[0075] 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.
[0076] 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.
[0077] Currently, an OAM packet in the IP mode of MPLS-TP OAM is shown in
[0078] 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.
[0079] 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.
[0080] 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.
[0081] In an example, a format of a CCM PDU in a CCM generated by a network device in an IPv4 network is shown in
[0082] In another example, a format of a CCM PDU in a CCM generated by a network device in an IPv6 network is shown in
[0083] 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.
[0084] 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.
[0085] 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.
[0086] 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.
[0087] 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.
[0088] 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.
[0089] 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.
[0090] 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.
[0091] 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.
[0092] 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.
[0093] 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.
[0094] 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.
[0095] 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
[0096] 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
[0097] 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
[0098] 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
[0099] 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.
[0100] 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
[0101] 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
[0102] 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
[0103] 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
[0104] 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
[0105] 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.
[0106] S302: The network device 1 sends the OAM packet to the network device 2.
[0107] S303: The network device 2 receives the OAM packet sent by the network device 1.
[0108] 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.
[0109] S304: The network device 2 reads the identifier 1 of the network device 1 from the OAM packet based on the indication information.
[0110] 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.
[0111] For example, it is assumed that a format of an OAM PDU in the OAM packet is shown in
[0112] For example, it is assumed that a format of an OAM PDU in the OAM packet is shown in
[0113] 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.
[0114] 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.
[0115] 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.
[0116]
[0117] S701: A network device 1 generates an OAM packet, where the OAM packet includes an IPv6 address of the network device 1.
[0118] 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.
[0119] 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
[0120] 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
[0121] 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.
[0122] S702: The network device 1 sends the OAM packet to the network device 2.
[0123] S703: The network device 2 receives the OAM packet sent by the network device 1.
[0124] S704: The network device 2 reads the IPv6 address of the network device 1 from the OAM packet.
[0125] 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.
[0126] 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
[0127] 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.
[0128]
[0129] 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.
[0130] S902: The first network device sends the OAM packet to a second network device.
[0131] 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.
[0132] 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.
[0133] 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.
[0134] 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.
[0135] 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.
[0136] 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.
[0137] 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.
[0138] 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.
[0139]
[0140] 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.
[0141] S1002: The second network device reads the identifier of the first network device from the OAM packet based on the indication information.
[0142] 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.
[0143] 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.
[0144] 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.
[0145] 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.
[0146] 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.
[0147] 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.
[0148] 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.
[0149] 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.
[0150]
[0151] S1101: A first network device generates an OAM packet, where the OAM packet includes an IPv6 address of the first network device.
[0152] S1102: The first network device sends an OAM packet to a second network device.
[0153] 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.
[0154] 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.
[0155] 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.
[0156] 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.
[0157]
[0158] 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.
[0159] S1202: The second network device reads the IPv6 address of the first network device from the OAM packet.
[0160] 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.
[0161] 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.
[0162] 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.
[0163] 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.
[0164] In addition, as shown in
[0165] In addition, as shown in
[0166] In addition, as shown in
[0167] In addition, as shown in
[0168] In addition, as shown in
[0169] In addition, as shown in
[0170] 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.
[0171] 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.
[0172] In addition, as shown in
[0173] 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.
[0174] 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
[0175] 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
[0176] 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.
[0177] 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.
[0178] 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.