idnits 2.17.1 draft-smack-mpls-rfc4379bis-04.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- == There are 9 instances of lines with non-RFC6890-compliant IPv4 addresses in the document. If these are example addresses, they should be changed. == There are 1 instance of lines with multicast IPv4 addresses in the document. If these are generic example addresses, they should be changed to use the 233.252.0.x range defined in RFC 5771 == There are 8 instances of lines with private range IPv4 addresses in the document. If these are generic example addresses, they should be changed to use any of the ranges defined in RFC 6890 (or successor): 192.0.2.x, 198.51.100.x or 203.0.113.x. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (October 3, 2015) is 3121 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Missing Reference: 'FEC-stack-depth' is mentioned on line 1752, but not defined ** Downref: Normative reference to an Informational RFC: RFC 4026 ** Obsolete normative reference: RFC 4379 (Obsoleted by RFC 8029) ** Obsolete normative reference: RFC 5226 (Obsoleted by RFC 8126) -- Obsolete informational reference (is this intentional?): RFC 3107 (Obsoleted by RFC 8277) -- Obsolete informational reference (is this intentional?): RFC 4447 (Obsoleted by RFC 8077) Summary: 3 errors (**), 0 flaws (~~), 5 warnings (==), 4 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group C. Pignataro 3 Internet-Draft N. Kumar 4 Obsoletes: 4379 (if approved) Cisco 5 Intended status: Standards Track S. Aldrin 6 Expires: April 5, 2016 Google 7 M. Chen 8 Huawei 9 October 3, 2015 11 Detecting Multi-Protocol Label Switched (MPLS) Data Plane Failures 12 draft-smack-mpls-rfc4379bis-04 14 Abstract 16 This document describes a simple and efficient mechanism that can be 17 used to detect data plane failures in Multi-Protocol Label Switching 18 (MPLS) Label Switched Paths (LSPs). There are two parts to this 19 document: information carried in an MPLS "echo request" and "echo 20 reply" for the purposes of fault detection and isolation, and 21 mechanisms for reliably sending the echo reply. 23 This document obsoletes RFC 4379. 25 Status of This Memo 27 This Internet-Draft is submitted in full conformance with the 28 provisions of BCP 78 and BCP 79. 30 Internet-Drafts are working documents of the Internet Engineering 31 Task Force (IETF). Note that other groups may also distribute 32 working documents as Internet-Drafts. The list of current Internet- 33 Drafts is at http://datatracker.ietf.org/drafts/current/. 35 Internet-Drafts are draft documents valid for a maximum of six months 36 and may be updated, replaced, or obsoleted by other documents at any 37 time. It is inappropriate to use Internet-Drafts as reference 38 material or to cite them other than as "work in progress." 40 This Internet-Draft will expire on April 5, 2016. 42 Copyright Notice 44 Copyright (c) 2015 IETF Trust and the persons identified as the 45 document authors. All rights reserved. 47 This document is subject to BCP 78 and the IETF Trust's Legal 48 Provisions Relating to IETF Documents 49 (http://trustee.ietf.org/license-info) in effect on the date of 50 publication of this document. Please review these documents 51 carefully, as they describe your rights and restrictions with respect 52 to this document. Code Components extracted from this document must 53 include Simplified BSD License text as described in Section 4.e of 54 the Trust Legal Provisions and are provided without warranty as 55 described in the Simplified BSD License. 57 Table of Contents 59 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 60 1.1. Conventions . . . . . . . . . . . . . . . . . . . . . . 3 61 1.2. Structure of This Document . . . . . . . . . . . . . . . 4 62 1.3. Contributors . . . . . . . . . . . . . . . . . . . . . . 4 63 1.4. Scope of RFC4379bis work . . . . . . . . . . . . . . . . 4 64 1.5. ToDo . . . . . . . . . . . . . . . . . . . . . . . . . . 5 65 2. Motivation . . . . . . . . . . . . . . . . . . . . . . . . . 5 66 2.1. Use of Address Range 127/8 . . . . . . . . . . . . . . . 6 67 3. Packet Format . . . . . . . . . . . . . . . . . . . . . . . 7 68 3.1. Return Codes . . . . . . . . . . . . . . . . . . . . . . 12 69 3.2. Target FEC Stack . . . . . . . . . . . . . . . . . . . . 12 70 3.2.1. LDP IPv4 Prefix . . . . . . . . . . . . . . . . . . 14 71 3.2.2. LDP IPv6 Prefix . . . . . . . . . . . . . . . . . . 14 72 3.2.3. RSVP IPv4 LSP . . . . . . . . . . . . . . . . . . . 14 73 3.2.4. RSVP IPv6 LSP . . . . . . . . . . . . . . . . . . . 15 74 3.2.5. VPN IPv4 Prefix . . . . . . . . . . . . . . . . . . 15 75 3.2.6. VPN IPv6 Prefix . . . . . . . . . . . . . . . . . . 16 76 3.2.7. L2 VPN Endpoint . . . . . . . . . . . . . . . . . . 17 77 3.2.8. FEC 128 Pseudowire (Deprecated) . . . . . . . . . . 17 78 3.2.9. FEC 128 Pseudowire (Current) . . . . . . . . . . . . 18 79 3.2.10. FEC 129 Pseudowire . . . . . . . . . . . . . . . . . 19 80 3.2.11. BGP Labeled IPv4 Prefix . . . . . . . . . . . . . . 20 81 3.2.12. BGP Labeled IPv6 Prefix . . . . . . . . . . . . . . 20 82 3.2.13. Generic IPv4 Prefix . . . . . . . . . . . . . . . . 21 83 3.2.14. Generic IPv6 Prefix . . . . . . . . . . . . . . . . 21 84 3.2.15. Nil FEC . . . . . . . . . . . . . . . . . . . . . . 22 85 3.3. Downstream Mapping . . . . . . . . . . . . . . . . . . . 22 86 3.3.1. Multipath Information Encoding . . . . . . . . . . . 26 87 3.3.2. Downstream Router and Interface . . . . . . . . . . 28 88 3.4. Pad TLV . . . . . . . . . . . . . . . . . . . . . . . . 29 89 3.5. Vendor Enterprise Number . . . . . . . . . . . . . . . . 29 90 3.6. Interface and Label Stack . . . . . . . . . . . . . . . 29 91 3.7. Errored TLVs . . . . . . . . . . . . . . . . . . . . . . 31 92 3.8. Reply TOS Byte TLV . . . . . . . . . . . . . . . . . . . 31 93 4. Theory of Operation . . . . . . . . . . . . . . . . . . . . 31 94 4.1. Dealing with Equal-Cost Multi-Path (ECMP) . . . . . . . 32 95 4.2. Testing LSPs That Are Used to Carry MPLS Payloads . . . 33 96 4.3. Sending an MPLS Echo Request . . . . . . . . . . . . . . 33 97 4.4. Receiving an MPLS Echo Request . . . . . . . . . . . . . 34 98 4.4.1. FEC Validation . . . . . . . . . . . . . . . . . . . 40 99 4.5. Sending an MPLS Echo Reply . . . . . . . . . . . . . . . 41 100 4.6. Receiving an MPLS Echo Reply . . . . . . . . . . . . . . 42 101 4.7. Issue with VPN IPv4 and IPv6 Prefixes . . . . . . . . . 42 102 4.8. Non-compliant Routers . . . . . . . . . . . . . . . . . 42 103 5. Security Considerations . . . . . . . . . . . . . . . . . . 43 104 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . 44 105 6.1. Message Types, Reply Modes, Return Codes . . . . . . . . 44 106 6.2. TLVs . . . . . . . . . . . . . . . . . . . . . . . . . . 45 107 7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 46 108 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 47 109 8.1. Normative References . . . . . . . . . . . . . . . . . . 47 110 8.2. Informative References . . . . . . . . . . . . . . . . . 48 111 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 48 113 1. Introduction 115 This document describes a simple and efficient mechanism that can be 116 used to detect data plane failures in MPLS Label Switched Paths 117 (LSPs). There are two parts to this document: information carried in 118 an MPLS "echo request" and "echo reply", and mechanisms for 119 transporting the echo reply. The first part aims at providing enough 120 information to check correct operation of the data plane, as well as 121 a mechanism to verify the data plane against the control plane, and 122 thereby localize faults. The second part suggests two methods of 123 reliable reply channels for the echo request message for more robust 124 fault isolation. 126 An important consideration in this design is that MPLS echo requests 127 follow the same data path that normal MPLS packets would traverse. 128 MPLS echo requests are meant primarily to validate the data plane, 129 and secondarily to verify the data plane against the control plane. 130 Mechanisms to check the control plane are valuable, but are not 131 covered in this document. 133 This document makes special use of the address range 127/8. This is 134 an exception to the behavior defined in RFC 1122 [RFC1122] and 135 updates that RFC. The motivation for this change and the details of 136 this exceptional use are discussed in section 2.1 below. 138 1.1. Conventions 140 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 141 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 142 document are to be interpreted as described in RFC 2119 [RFC2119]. 144 The term "Must Be Zero" (MBZ) is used in object descriptions for 145 reserved fields. These fields MUST be set to zero when sent and 146 ignored on receipt. 148 Terminology pertaining to L2 and L3 Virtual Private Networks (VPNs) 149 is defined in [RFC4026]. 151 Since this document refers to the MPLS Time to Live (TTL) far more 152 frequently than the IP TTL, the authors have chosen the convention of 153 using the unqualified "TTL" to mean "MPLS TTL" and using "IP TTL" for 154 the TTL value in the IP header. 156 1.2. Structure of This Document 158 The body of this memo contains four main parts: motivation, MPLS echo 159 request/reply packet format, LSP ping operation, and a reliable 160 return path. It is suggested that first-time readers skip the actual 161 packet formats and read the Theory of Operation first; the document 162 is structured the way it is to avoid forward references. 164 1.3. Contributors 166 A mechanism used to detect data plane failures in Multi-Protocol 167 Label Switching (MPLS) Label Switched Paths (LSPs) was originally 168 published as RFC 4379 in February 2006. It was produced by the MPLS 169 Working Group of the IETF and was jointly authored by Kireeti 170 Kompella and George Swallow. 172 The following made vital contributions to all aspects of the original 173 RFC 4379, and much of the material came out of debate and discussion 174 among this group. 176 Ronald P. Bonica, Juniper Networks, Inc. 177 Dave Cooper, Global Crossing 178 Ping Pan, Hammerhead Systems 179 Nischal Sheth, Juniper Networks, Inc. 180 Sanjay Wadhwa, Juniper Networks, Inc. 182 1.4. Scope of RFC4379bis work 184 The goal of this document is to take LSP Ping to an Internet 185 Standard. 187 [RFC4379] defines the basic mechanism for MPLS LSP validation that 188 can be used for fault detection and isolation. The scope of this 189 document also is to address various updates to MPLS LSP Ping, 190 including: 192 1. Updates to all references and citations. Obsoleted RFCs 2434, 193 2030, and 3036 are respectively replaced with RFCs 5226, 5905, 194 and 5036. Additionally, these three documents published as RFCs: 195 RFCs 4447, 5085, and 4761. 196 2. Incorporate all outstanding Errata. These include Erratum with 197 IDs: 108, 1418, 1714, 1786, 3399, 742, and 2978. 198 3. Replace EXP with Traffic Class (TC), based on the update from RFC 199 5462. 201 1.5. ToDo 203 This section should be empty, and removed, prior to publication. 204 ToDos: 206 1. Evaluation of which of the RFCs that updated RFC 4379 need to be 207 incorporated into this 4379bis document. Specifically, these 208 RFCs updated RFC 4379: 6424, 6425, 6426, 6829, 7506, and 7537. 209 RFCs that updated RFC 4379 and are incorporated into this 210 4379bis, will be Obsoleted by 4379bis. 211 2. Review IANA Allocations 212 3. Fix pending figure mis-alignments 214 2. Motivation 216 When an LSP fails to deliver user traffic, the failure cannot always 217 be detected by the MPLS control plane. There is a need to provide a 218 tool that would enable users to detect such traffic "black holes" or 219 misrouting within a reasonable period of time, and a mechanism to 220 isolate faults. 222 In this document, we describe a mechanism that accomplishes these 223 goals. This mechanism is modeled after the ping/traceroute paradigm: 224 ping (ICMP echo request [RFC0792]) is used for connectivity checks, 225 and traceroute is used for hop-by-hop fault localization as well as 226 path tracing. This document specifies a "ping" mode and a 227 "traceroute" mode for testing MPLS LSPs. 229 The basic idea is to verify that packets that belong to a particular 230 Forwarding Equivalence Class (FEC) actually end their MPLS path on a 231 Label Switching Router (LSR) that is an egress for that FEC. This 232 document proposes that this test be carried out by sending a packet 233 (called an "MPLS echo request") along the same data path as other 234 packets belonging to this FEC. An MPLS echo request also carries 235 information about the FEC whose MPLS path is being verified. This 236 echo request is forwarded just like any other packet belonging to 237 that FEC. In "ping" mode (basic connectivity check), the packet 238 should reach the end of the path, at which point it is sent to the 239 control plane of the egress LSR, which then verifies whether it is 240 indeed an egress for the FEC. In "traceroute" mode (fault 241 isolation), the packet is sent to the control plane of each transit 242 LSR, which performs various checks that it is indeed a transit LSR 243 for this path; this LSR also returns further information that helps 244 check the control plane against the data plane, i.e., that forwarding 245 matches what the routing protocols determined as the path. 247 One way these tools can be used is to periodically ping an FEC to 248 ensure connectivity. If the ping fails, one can then initiate a 249 traceroute to determine where the fault lies. One can also 250 periodically traceroute FECs to verify that forwarding matches the 251 control plane; however, this places a greater burden on transit LSRs 252 and thus should be used with caution. 254 2.1. Use of Address Range 127/8 256 As described above, LSP ping is intended as a diagnostic tool. It is 257 intended to enable providers of an MPLS-based service to isolate 258 network faults. In particular, LSP ping needs to diagnose situations 259 where the control and data planes are out of sync. It performs this 260 by routing an MPLS echo request packet based solely on its label 261 stack. That is, the IP destination address is never used in a 262 forwarding decision. In fact, the sender of an MPLS echo request 263 packet may not know, a priori, the address of the router at the end 264 of the LSP. 266 Providers of MPLS-based services also need the ability to trace all 267 of the possible paths that an LSP may take. Since most MPLS services 268 are based on IP unicast forwarding, these paths are subject to 269 equal-cost multi-path (ECMP) load sharing. 271 This leads to the following requirements: 273 1. Although the LSP in question may be broken in unknown ways, the 274 likelihood of a diagnostic packet being delivered to a user of an 275 MPLS service MUST be held to an absolute minimum. 277 2. If an LSP is broken in such a way that it prematurely terminates, 278 the diagnostic packet MUST NOT be IP forwarded. 280 3. A means of varying the diagnostic packets such that they exercise 281 all ECMP paths is thus REQUIRED. 283 Clearly, using general unicast addresses satisfies neither of the 284 first two requirements. A number of other options for addresses were 285 considered, including a portion of the private address space (as 286 determined by the network operator) and the newly designated IPv4 287 link local addresses. Use of the private address space was deemed 288 ineffective since the leading MPLS-based service is an IPv4 Virtual 289 Private Network (VPN). VPNs often use private addresses. 291 The IPv4 link local addresses are more attractive in that the scope 292 over which they can be forwarded is limited. However, if one were to 293 use an address from this range, it would still be possible for the 294 first recipient of a diagnostic packet that "escaped" from a broken 295 LSP to have that address assigned to the interface on which it 296 arrived and thus could mistakenly receive such a packet. 297 Furthermore, the IPv4 link local address range has only recently been 298 allocated. Many deployed routers would forward a packet with an 299 address from that range toward the default route. 301 The 127/8 range for IPv4 and that same range embedded in as 302 IPv4-mapped IPv6 addresses for IPv6 was chosen for a number of 303 reasons. 305 RFC 1122 allocates the 127/8 as "Internal host loopback address" and 306 states: "Addresses of this form MUST NOT appear outside a host." 307 Thus, the default behavior of hosts is to discard such packets. This 308 helps to ensure that if a diagnostic packet is misdirected to a host, 309 it will be silently discarded. 311 RFC 1812 [RFC1812] states: 313 A router SHOULD NOT forward, except over a loopback interface, any 314 packet that has a destination address on network 127. A router 315 MAY have a switch that allows the network manager to disable these 316 checks. If such a switch is provided, it MUST default to 317 performing the checks. 319 This helps to ensure that diagnostic packets are never IP forwarded. 321 The 127/8 address range provides 16M addresses allowing wide 322 flexibility in varying addresses to exercise ECMP paths. Finally, as 323 an implementation optimization, the 127/8 provides an easy means of 324 identifying possible LSP packets. 326 3. Packet Format 328 An MPLS echo request is a (possibly labeled) IPv4 or IPv6 UDP packet; 329 the contents of the UDP packet have the following format: 331 0 1 2 3 332 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 333 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 334 | Version Number | Global Flags | 335 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 336 | Message Type | Reply mode | Return Code | Return Subcode| 337 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 338 | Sender's Handle | 339 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 340 | Sequence Number | 341 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 342 | TimeStamp Sent (seconds) | 343 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 344 | TimeStamp Sent (seconds fraction) | 345 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 346 | TimeStamp Received (seconds) | 347 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 348 | TimeStamp Received (seconds fraction) | 349 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 350 | TLVs ... | 351 . . 352 . . 353 . . 354 | | 355 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 357 The Version Number is currently 1. (Note: the version number is to 358 be incremented whenever a change is made that affects the ability of 359 an implementation to correctly parse or process an MPLS echo 360 request/reply. These changes include any syntactic or semantic 361 changes made to any of the fixed fields, or to any Type-Length-Value 362 (TLV) or sub-TLV assignment or format that is defined at a certain 363 version number. The version number may not need to be changed if an 364 optional TLV or sub-TLV is added.) 366 The Global Flags field is a bit vector with the following format: 368 0 1 369 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 370 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 371 | MBZ |V| 372 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 374 One flag is defined for now, the V bit; the rest MUST be set to zero 375 when sending and ignored on receipt. 377 The V (Validate FEC Stack) flag is set to 1 if the sender wants the 378 receiver to perform FEC Stack validation; if V is 0, the choice is 379 left to the receiver. 381 The Message Type is one of the following: 383 Value Meaning 384 ----- ------- 385 1 MPLS echo request 386 2 MPLS echo reply 388 The Reply Mode can take one of the following values: 390 Value Meaning 391 ----- ------- 392 1 Do not reply 393 2 Reply via an IPv4/IPv6 UDP packet 394 3 Reply via an IPv4/IPv6 UDP packet with Router Alert 395 4 Reply via application level control channel 397 An MPLS echo request with 1 (Do not reply) in the Reply Mode field 398 may be used for one-way connectivity tests; the receiving router may 399 log gaps in the Sequence Numbers and/or maintain delay/jitter 400 statistics. An MPLS echo request would normally have 2 (Reply via an 401 IPv4/IPv6 UDP packet) in the Reply Mode field. If the normal IP 402 return path is deemed unreliable, one may use 3 (Reply via an IPv4/ 403 IPv6 UDP packet with Router Alert). Note that this requires that all 404 intermediate routers understand and know how to forward MPLS echo 405 replies. The echo reply uses the same IP version number as the 406 received echo request, i.e., an IPv4 encapsulated echo reply is sent 407 in response to an IPv4 encapsulated echo request. 409 Some applications support an IP control channel. One such example is 410 the associated control channel defined in Virtual Circuit 411 Connectivity Verification (VCCV) [RFC5085]. Any application that 412 supports an IP control channel between its control entities may set 413 the Reply Mode to 4 (Reply via application level control channel) to 414 ensure that replies use that same channel. Further definition of 415 this codepoint is application specific and thus beyond the scope of 416 this document. 418 Return Codes and Subcodes are described in the next section. 420 The Sender's Handle is filled in by the sender, and returned 421 unchanged by the receiver in the echo reply (if any). There are no 422 semantics associated with this handle, although a sender may find 423 this useful for matching up requests with replies. 425 The Sequence Number is assigned by the sender of the MPLS echo 426 request and can be (for example) used to detect missed replies. 428 The TimeStamp Sent is the time-of-day (according to the sender's 429 clock) in NTP format [RFC5905] when the MPLS echo request is sent. 430 The TimeStamp Received in an echo reply is the time-of-day (according 431 to the receiver's clock) in NTP format that the corresponding echo 432 request was received. 434 TLVs (Type-Length-Value tuples) have the following format: 436 0 1 2 3 437 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 438 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 439 | Type | Length | 440 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 441 | Value | 442 . . 443 . . 444 . . 445 | | 446 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 448 Types are defined below; Length is the length of the Value field in 449 octets. The Value field depends on the Type; it is zero padded to 450 align to a 4-octet boundary. TLVs may be nested within other TLVs, 451 in which case the nested TLVs are called sub-TLVs. Sub-TLVs have 452 independent types and MUST also be 4-octet aligned. 454 Two examples follow. The Label Distribution Protocol (LDP) IPv4 FEC 455 sub-TLV has the following format: 457 0 1 2 3 458 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 459 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 460 | Type = 1 (LDP IPv4 FEC) | Length = 5 | 461 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 462 | IPv4 prefix | 463 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 464 | Prefix Length | Must Be Zero | 465 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 467 The Length for this TLV is 5. A Target FEC Stack TLV that contains 468 an LDP IPv4 FEC sub-TLV and a VPN IPv4 prefix sub-TLV has the 469 following format: 471 0 1 2 3 472 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 473 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 474 | Type = 1 (FEC TLV) | Length = 32 | 475 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 476 | sub-Type = 1 (LDP IPv4 FEC) | Length = 5 | 477 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 478 | IPv4 prefix | 479 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 480 | Prefix Length | Must Be Zero | 481 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 482 | sub-Type = 6 (VPN IPv4 prefix)| Length = 13 | 483 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 484 | Route Distinguisher | 485 | (8 octets) | 486 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 487 | IPv4 prefix | 488 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 489 | Prefix Length | Must Be Zero | 490 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 492 A description of the Types and Values of the top-level TLVs for LSP 493 ping are given below: 495 Type # Value Field 496 ------ ----------- 497 1 Target FEC Stack 498 2 Downstream Mapping 499 3 Pad 500 4 Not Assigned 501 5 Vendor Enterprise Number 502 6 Not Assigned 503 7 Interface and Label Stack 504 8 Not Assigned 505 9 Errored TLVs 506 10 Reply TOS Byte 508 Types less than 32768 (i.e., with the high-order bit equal to 0) are 509 mandatory TLVs that MUST either be supported by an implementation or 510 result in the return code of 2 ("One or more of the TLVs was not 511 understood") being sent in the echo response. 513 Types greater than or equal to 32768 (i.e., with the high-order bit 514 equal to 1) are optional TLVs that SHOULD be ignored if the 515 implementation does not understand or support them. 517 3.1. Return Codes 519 The Return Code is set to zero by the sender. The receiver can set 520 it to one of the values listed below. The notation refers to 521 the Return Subcode. This field is filled in with the stack-depth for 522 those codes that specify that. For all other codes, the Return 523 Subcode MUST be set to zero. 525 Value Meaning 526 ----- ------- 527 0 No return code 528 1 Malformed echo request received 529 2 One or more of the TLVs was not understood 530 3 Replying router is an egress for the FEC at stack- 531 depth 532 4 Replying router has no mapping for the FEC at stack- 533 depth 534 5 Downstream Mapping Mismatch (See Note 1) 535 6 Upstream Interface Index Unknown (See Note 1) 536 7 Reserved 537 8 Label switched at stack-depth 538 9 Label switched but no MPLS forwarding at stack-depth 539 540 10 Mapping for this FEC is not the given label at stack- 541 depth 542 11 No label entry at stack-depth 543 12 Protocol not associated with interface at FEC stack- 544 depth 545 13 Premature termination of ping due to label stack 546 shrinking to a single label 548 Note 1 550 The Return Subcode contains the point in the label stack where 551 processing was terminated. If the RSC is 0, no labels were 552 processed. Otherwise the packet would have been label switched at 553 depth RSC. 555 3.2. Target FEC Stack 557 A Target FEC Stack is a list of sub-TLVs. The number of elements is 558 determined by looking at the sub-TLV length fields. 560 Sub-Type Length Value Field 561 -------- ------ ----------- 562 1 5 LDP IPv4 prefix 563 2 17 LDP IPv6 prefix 564 3 20 RSVP IPv4 LSP 565 4 56 RSVP IPv6 LSP 566 5 Not Assigned 567 6 13 VPN IPv4 prefix 568 7 25 VPN IPv6 prefix 569 8 14 L2 VPN endpoint 570 9 10 "FEC 128" Pseudowire (deprecated) 571 10 14 "FEC 128" Pseudowire 572 11 16+ "FEC 129" Pseudowire 573 12 5 BGP labeled IPv4 prefix 574 13 17 BGP labeled IPv6 prefix 575 14 5 Generic IPv4 prefix 576 15 17 Generic IPv6 prefix 577 16 4 Nil FEC 579 Other FEC Types will be defined as needed. 581 Note that this TLV defines a stack of FECs, the first FEC element 582 corresponding to the top of the label stack, etc. 584 An MPLS echo request MUST have a Target FEC Stack that describes the 585 FEC Stack being tested. For example, if an LSR X has an LDP mapping 586 [RFC5036] for 192.168.1.1 (say, label 1001), then to verify that 587 label 1001 does indeed reach an egress LSR that announced this prefix 588 via LDP, X can send an MPLS echo request with an FEC Stack TLV with 589 one FEC in it, namely, of type LDP IPv4 prefix, with prefix 590 192.168.1.1/32, and send the echo request with a label of 1001. 592 Say LSR X wanted to verify that a label stack of <1001, 23456> is the 593 right label stack to use to reach a VPN IPv4 prefix [see section 594 3.2.5] of 10/8 in VPN foo. Say further that LSR Y with loopback 595 address 192.168.1.1 announced prefix 10/8 with Route Distinguisher 596 RD-foo-Y (which may in general be different from the Route 597 Distinguisher that LSR X uses in its own advertisements for VPN foo), 598 label 23456 and BGP next hop 192.168.1.1 [RFC4271]. Finally, suppose 599 that LSR X receives a label binding of 1001 for 192.168.1.1 via LDP. 600 X has two choices in sending an MPLS echo request: X can send an MPLS 601 echo request with an FEC Stack TLV with a single FEC of type VPN IPv4 602 prefix with a prefix of 10/8 and a Route Distinguisher of RD-foo-Y. 603 Alternatively, X can send an FEC Stack TLV with two FECs, the first 604 of type LDP IPv4 with a prefix of 192.168.1.1/32 and the second of 605 type of IP VPN with a prefix 10/8 with Route Distinguisher of RD-foo- 606 Y. In either case, the MPLS echo request would have a label stack of 607 <1001, 23456>. (Note: in this example, 1001 is the "outer" label and 608 23456 is the "inner" label.) 610 3.2.1. LDP IPv4 Prefix 612 The IPv4 Prefix FEC is defined in [RFC5036]. When an LDP IPv4 prefix 613 is encoded in a label stack, the following format is used. The value 614 consists of 4 octets of an IPv4 prefix followed by 1 octet of prefix 615 length in bits; the format is given below. The IPv4 prefix is in 616 network byte order; if the prefix is shorter than 32 bits, trailing 617 bits SHOULD be set to zero. See [RFC5036] for an example of a 618 Mapping for an IPv4 FEC. 620 0 1 2 3 621 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 622 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 623 | IPv4 prefix | 624 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 625 | Prefix Length | Must Be Zero | 626 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 628 3.2.2. LDP IPv6 Prefix 630 The IPv6 Prefix FEC is defined in [RFC5036]. When an LDP IPv6 prefix 631 is encoded in a label stack, the following format is used. The value 632 consists of 16 octets of an IPv6 prefix followed by 1 octet of prefix 633 length in bits; the format is given below. The IPv6 prefix is in 634 network byte order; if the prefix is shorter than 128 bits, the 635 trailing bits SHOULD be set to zero. See [RFC5036] for an example of 636 a Mapping for an IPv6 FEC. 638 0 1 2 3 639 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 640 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 641 | IPv6 prefix | 642 | (16 octets) | 643 | | 644 | | 645 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 646 | Prefix Length | Must Be Zero | 647 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 649 3.2.3. RSVP IPv4 LSP 651 The value has the format below. The value fields are taken from RFC 652 3209, sections 4.6.1.1 and 4.6.2.1. See [RFC3209]. 654 0 1 2 3 655 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 656 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 657 | IPv4 tunnel end point address | 658 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 659 | Must Be Zero | Tunnel ID | 660 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 661 | Extended Tunnel ID | 662 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 663 | IPv4 tunnel sender address | 664 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 665 | Must Be Zero | LSP ID | 666 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 668 3.2.4. RSVP IPv6 LSP 670 The value has the format below. The value fields are taken from RFC 671 3209, sections 4.6.1.2 and 4.6.2.2. See [RFC3209]. 673 0 1 2 3 674 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 675 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 676 | IPv6 tunnel end point address | 677 | | 678 | | 679 | | 680 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 681 | Must Be Zero | Tunnel ID | 682 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 683 | Extended Tunnel ID | 684 | | 685 | | 686 | | 687 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 688 | IPv6 tunnel sender address | 689 | | 690 | | 691 | | 692 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 693 | Must Be Zero | LSP ID | 694 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 696 3.2.5. VPN IPv4 Prefix 698 VPN-IPv4 Network Layer Routing Information (NLRI) is defined in 699 [RFC4365]. This document uses the term VPN IPv4 prefix for a VPN- 700 IPv4 NLRI that has been advertised with an MPLS label in BGP. See 701 [RFC3107]. 703 When a VPN IPv4 prefix is encoded in a label stack, the following 704 format is used. The value field consists of the Route Distinguisher 705 advertised with the VPN IPv4 prefix, the IPv4 prefix (with trailing 0 706 bits to make 32 bits in all), and a prefix length, as follows: 708 0 1 2 3 709 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 710 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 711 | Route Distinguisher | 712 | (8 octets) | 713 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 714 | IPv4 prefix | 715 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 716 | Prefix Length | Must Be Zero | 717 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 719 The Route Distinguisher (RD) is an 8-octet identifier; it does not 720 contain any inherent information. The purpose of the RD is solely to 721 allow one to create distinct routes to a common IPv4 address prefix. 722 The encoding of the RD is not important here. When matching this 723 field to the local FEC information, it is treated as an opaque value. 725 3.2.6. VPN IPv6 Prefix 727 VPN-IPv6 Network Layer Routing Information (NLRI) is defined in 728 [RFC4365]. This document uses the term VPN IPv6 prefix for a VPN- 729 IPv6 NLRI that has been advertised with an MPLS label in BGP. See 730 [RFC3107]. 732 When a VPN IPv6 prefix is encoded in a label stack, the following 733 format is used. The value field consists of the Route Distinguisher 734 advertised with the VPN IPv6 prefix, the IPv6 prefix (with trailing 0 735 bits to make 128 bits in all), and a prefix length, as follows: 737 0 1 2 3 738 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 739 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 740 | Route Distinguisher | 741 | (8 octets) | 742 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 743 | IPv6 prefix | 744 | | 745 | | 746 | | 747 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 748 | Prefix Length | Must Be Zero | 749 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 751 The Route Distinguisher is identical to the VPN IPv4 Prefix RD, 752 except that it functions here to allow the creation of distinct 753 routes to IPv6 prefixes. See section 3.2.5. When matching this 754 field to local FEC information, it is treated as an opaque value. 756 3.2.7. L2 VPN Endpoint 758 VPLS stands for Virtual Private LAN Service. The terms VPLS BGP NLRI 759 and VE ID (VPLS Edge Identifier) are defined in [RFC4761]. This 760 document uses the simpler term L2 VPN endpoint when referring to a 761 VPLS BGP NLRI. The Route Distinguisher is an 8-octet identifier used 762 to distinguish information about various L2 VPNs advertised by a 763 node. The VE ID is a 2-octet identifier used to identify a 764 particular node that serves as the service attachment point within a 765 VPLS. The structure of these two identifiers is unimportant here; 766 when matching these fields to local FEC information, they are treated 767 as opaque values. The encapsulation type is identical to the PW Type 768 in section 3.2.8 below. 770 When an L2 VPN endpoint is encoded in a label stack, the following 771 format is used. The value field consists of a Route Distinguisher (8 772 octets), the sender (of the ping)'s VE ID (2 octets), the receiver's 773 VE ID (2 octets), and an encapsulation type (2 octets), formatted as 774 follows: 776 0 1 2 3 777 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 778 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 779 | Route Distinguisher | 780 | (8 octets) | 781 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 782 | Sender's VE ID | Receiver's VE ID | 783 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 784 | Encapsulation Type | Must Be Zero | 785 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 787 3.2.8. FEC 128 Pseudowire (Deprecated) 789 FEC 128 (0x80) is defined in [RFC4447], as are the terms PW ID 790 (Pseudowire ID) and PW Type (Pseudowire Type). A PW ID is a non-zero 791 32-bit connection ID. The PW Type is a 15-bit number indicating the 792 encapsulation type. It is carried right justified in the field below 793 termed encapsulation type with the high-order bit set to zero. Both 794 of these fields are treated in this protocol as opaque values. 796 When an FEC 128 is encoded in a label stack, the following format is 797 used. The value field consists of the remote PE address (the 798 destination address of the targeted LDP session), the PW ID, and the 799 encapsulation type as follows: 801 0 1 2 3 802 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 803 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 804 | Remote PE Address | 805 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 806 | PW ID | 807 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 808 | PW Type | Must Be Zero | 809 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 811 This FEC is deprecated and is retained only for backward 812 compatibility. Implementations of LSP ping SHOULD accept and process 813 this TLV, but SHOULD send LSP ping echo requests with the new TLV 814 (see next section), unless explicitly configured to use the old TLV. 816 An LSR receiving this TLV SHOULD use the source IP address of the LSP 817 echo request to infer the sender's PE address. 819 3.2.9. FEC 128 Pseudowire (Current) 821 FEC 128 (0x80) is defined in [RFC4447], as are the terms PW ID 822 (Pseudowire ID) and PW Type (Pseudowire Type). A PW ID is a non-zero 823 32-bit connection ID. The PW Type is a 15-bit number indicating the 824 encapsulation type. It is carried right justified in the field below 825 termed encapsulation type with the high-order bit set to zero. 827 Both of these fields are treated in this protocol as opaque values. 828 When matching these field to the local FEC information, the match 829 MUST be exact. 831 When an FEC 128 is encoded in a label stack, the following format is 832 used. The value field consists of the sender's PE address (the 833 source address of the targeted LDP session), the remote PE address 834 (the destination address of the targeted LDP session), the PW ID, and 835 the encapsulation type as follows: 837 0 1 2 3 838 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 839 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 840 | Sender's PE Address | 841 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 842 | Remote PE Address | 843 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 844 | PW ID | 845 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 846 | PW Type | Must Be Zero | 847 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 849 3.2.10. FEC 129 Pseudowire 851 FEC 129 (0x81) and the terms PW Type, Attachment Group Identifier 852 (AGI), Attachment Group Identifier Type (AGI Type), Attachment 853 Individual Identifier Type (AII Type), Source Attachment Individual 854 Identifier (SAII), and Target Attachment Individual Identifier (TAII) 855 are defined in [RFC4447]. The PW Type is a 15-bit number indicating 856 the encapsulation type. It is carried right justified in the field 857 below PW Type with the high-order bit set to zero. All the other 858 fields are treated as opaque values and copied directly from the FEC 859 129 format. All of these values together uniquely define the FEC 860 within the scope of the LDP session identified by the source and 861 remote PE addresses. 863 When an FEC 129 is encoded in a label stack, the following format is 864 used. The Length of this TLV is 16 + AGI length + SAII length + TAII 865 length. Padding is used to make the total length a multiple of 4; 866 the length of the padding is not included in the Length field. 868 0 1 2 3 869 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 870 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 871 | Sender's PE Address | 872 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 873 | Remote PE Address | 874 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 875 | PW Type | AGI Type | AGI Length | 876 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 877 ~ AGI Value ~ 878 | | 879 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 880 | AII Type | SAII Length | SAII Value | 881 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 882 ~ SAII Value (continued) ~ 883 | | 884 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 885 | AII Type | TAII Length | TAII Value | 886 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 887 ~ TAII Value (continued) ~ 888 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 889 | TAII (cont.) | 0-3 octets of zero padding | 890 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 892 3.2.11. BGP Labeled IPv4 Prefix 894 BGP labeled IPv4 prefixes are defined in [RFC3107]. When a BGP 895 labeled IPv4 prefix is encoded in a label stack, the following format 896 is used. The value field consists the IPv4 prefix (with trailing 0 897 bits to make 32 bits in all), and the prefix length, as follows: 899 0 1 2 3 900 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 901 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 902 | IPv4 Prefix | 903 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 904 | Prefix Length | Must Be Zero | 905 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 907 3.2.12. BGP Labeled IPv6 Prefix 909 BGP labeled IPv6 prefixes are defined in [RFC3107]. When a BGP 910 labeled IPv6 prefix is encoded in a label stack, the following format 911 is used. The value consists of 16 octets of an IPv6 prefix followed 912 by 1 octet of prefix length in bits; the format is given below. The 913 IPv6 prefix is in network byte order; if the prefix is shorter than 914 128 bits, the trailing bits SHOULD be set to zero. 916 0 1 2 3 917 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 918 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 919 | IPv6 prefix | 920 | (16 octets) | 921 | | 922 | | 923 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 924 | Prefix Length | Must Be Zero | 925 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 927 3.2.13. Generic IPv4 Prefix 929 The value consists of 4 octets of an IPv4 prefix followed by 1 octet 930 of prefix length in bits; the format is given below. The IPv4 prefix 931 is in network byte order; if the prefix is shorter than 32 bits, 932 trailing bits SHOULD be set to zero. This FEC is used if the 933 protocol advertising the label is unknown or may change during the 934 course of the LSP. An example is an inter-AS LSP that may be 935 signaled by LDP in one Autonomous System (AS), by RSVP-TE [RFC3209] 936 in another AS, and by BGP between the ASes, such as is common for 937 inter-AS VPNs. 939 0 1 2 3 940 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 941 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 942 | IPv4 prefix | 943 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 944 | Prefix Length | Must Be Zero | 945 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 947 3.2.14. Generic IPv6 Prefix 949 The value consists of 16 octets of an IPv6 prefix followed by 1 octet 950 of prefix length in bits; the format is given below. The IPv6 prefix 951 is in network byte order; if the prefix is shorter than 128 bits, the 952 trailing bits SHOULD be set to zero. 954 0 1 2 3 955 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 956 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 957 | IPv6 prefix | 958 | (16 octets) | 959 | | 960 | | 961 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 962 | Prefix Length | Must Be Zero | 963 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 965 3.2.15. Nil FEC 967 At times, labels from the reserved range, e.g., Router Alert and 968 Explicit-null, may be added to the label stack for various diagnostic 969 purposes such as influencing load-balancing. These labels may have 970 no explicit FEC associated with them. The Nil FEC Stack is defined 971 to allow a Target FEC Stack sub-TLV to be added to the Target FEC 972 Stack to account for such labels so that proper validation can still 973 be performed. 975 The Length is 4. Labels are 20-bit values treated as numbers. 977 0 1 2 3 978 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 979 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 980 | Label | MBZ | 981 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 983 Label is the actual label value inserted in the label stack; the MBZ 984 fields MUST be zero when sent and ignored on receipt. 986 3.3. Downstream Mapping 988 The Downstream Mapping object is a TLV that MAY be included in an 989 echo request message. Only one Downstream Mapping object may appear 990 in an echo request. The presence of a Downstream Mapping object is a 991 request that Downstream Mapping objects be included in the echo 992 reply. If the replying router is the destination of the FEC, then a 993 Downstream Mapping TLV SHOULD NOT be included in the echo reply. 994 Otherwise the replying router SHOULD include a Downstream Mapping 995 object for each interface over which this FEC could be forwarded. 996 For a more precise definition of the notion of "downstream", see 997 section 3.3.2, "Downstream Router and Interface". 999 The Length is K + M + 4*N octets, where M is the Multipath Length, 1000 and N is the number of Downstream Labels. Values for K are found in 1001 the description of Address Type below. The Value field of a 1002 Downstream Mapping has the following format: 1004 0 1 2 3 1005 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 1006 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1007 | MTU | Address Type | DS Flags | 1008 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1009 | Downstream IP Address (4 or 16 octets) | 1010 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1011 | Downstream Interface Address (4 or 16 octets) | 1012 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1013 | Multipath Type| Depth Limit | Multipath Length | 1014 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1015 . . 1016 . (Multipath Information) . 1017 . . 1018 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1019 | Downstream Label | Protocol | 1020 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1021 . . 1022 . . 1023 . . 1024 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1025 | Downstream Label | Protocol | 1026 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1028 Maximum Transmission Unit (MTU) 1030 The MTU is the size in octets of the largest MPLS frame (including 1031 label stack) that fits on the interface to the Downstream LSR. 1033 Address Type 1035 The Address Type indicates if the interface is numbered or 1036 unnumbered. It also determines the length of the Downstream IP 1037 Address and Downstream Interface fields. The resulting total for 1038 the initial part of the TLV is listed in the table below as "K 1039 Octets". The Address Type is set to one of the following values: 1041 Type # Address Type K Octets 1042 ------ ------------ -------- 1043 1 IPv4 Numbered 16 1044 2 IPv4 Unnumbered 16 1045 3 IPv6 Numbered 40 1046 4 IPv6 Unnumbered 28 1048 DS Flags 1050 The DS Flags field is a bit vector with the following format: 1052 0 1 2 3 4 5 6 7 1053 +-+-+-+-+-+-+-+-+ 1054 | Rsvd(MBZ) |I|N| 1055 +-+-+-+-+-+-+-+-+ 1057 Two flags are defined currently, I and N. The remaining flags MUST 1058 be set to zero when sending and ignored on receipt. 1060 Flag Name and Meaning 1061 ---- ---------------- 1062 I Interface and Label Stack Object Request 1064 When this flag is set, it indicates that the replying 1065 router SHOULD include an Interface and Label Stack 1066 Object in the echo reply message. 1068 N Treat as a Non-IP Packet 1070 Echo request messages will be used to diagnose non-IP 1071 flows. However, these messages are carried in IP 1072 packets. For a router that alters its ECMP algorithm 1073 based on the FEC or deep packet examination, this flag 1074 requests that the router treat this as it would if the 1075 determination of an IP payload had failed. 1077 Downstream IP Address and Downstream Interface Address 1079 IPv4 addresses and interface indices are encoded in 4 octets; IPv6 1080 addresses are encoded in 16 octets. 1082 If the interface to the downstream LSR is numbered, then the 1083 Address Type MUST be set to IPv4 or IPv6, the Downstream IP 1084 Address MUST be set to either the downstream LSR's Router ID or 1085 the interface address of the downstream LSR, and the Downstream 1086 Interface Address MUST be set to the downstream LSR's interface 1087 address. 1089 If the interface to the downstream LSR is unnumbered, the Address 1090 Type MUST be IPv4 Unnumbered or IPv6 Unnumbered, the Downstream IP 1091 Address MUST be the downstream LSR's Router ID, and the Downstream 1092 Interface Address MUST be set to the index assigned by the 1093 upstream LSR to the interface. 1095 If an LSR does not know the IP address of its neighbor, then it 1096 MUST set the Address Type to either IPv4 Unnumbered or IPv6 1097 Unnumbered. For IPv4, it must set the Downstream IP Address to 1098 127.0.0.1; for IPv6 the address is set to 0::1. In both cases, 1099 the interface index MUST be set to 0. If an LSR receives an Echo 1100 Request packet with either of these addresses in the Downstream IP 1101 Address field, this indicates that it MUST bypass interface 1102 verification but continue with label validation. 1104 If the originator of an Echo Request packet wishes to obtain 1105 Downstream Mapping information but does not know the expected 1106 label stack, then it SHOULD set the Address Type to either IPv4 1107 Unnumbered or IPv6 Unnumbered. For IPv4, it MUST set the 1108 Downstream IP Address to 224.0.0.2; for IPv6 the address MUST be 1109 set to FF02::2. In both cases, the interface index MUST be set to 1110 0. If an LSR receives an Echo Request packet with the all-routers 1111 multicast address, then this indicates that it MUST bypass both 1112 interface and label stack validation, but return Downstream 1113 Mapping TLVs using the information provided. 1115 Multipath Type 1117 The following Multipath Types are defined: 1119 Key Type Multipath Information 1120 --- ---------------- --------------------- 1121 0 no multipath Empty (Multipath Length = 0) 1122 2 IP address IP addresses 1123 4 IP address range low/high address pairs 1124 8 Bit-masked IP IP address prefix and bit mask 1125 address set 1126 9 Bit-masked label set Label prefix and bit mask 1128 Type 0 indicates that all packets will be forwarded out this one 1129 interface. 1131 Types 2, 4, 8, and 9 specify that the supplied Multipath Information 1132 will serve to exercise this path. 1134 Depth Limit 1136 The Depth Limit is applicable only to a label stack and is the 1137 maximum number of labels considered in the hash; this SHOULD be 1138 set to zero if unspecified or unlimited. 1140 Multipath Length 1142 The length in octets of the Multipath Information. 1144 Multipath Information 1146 Address or label values encoded according to the Multipath Type. 1147 See the next section below for encoding details. 1149 Downstream Label(s) 1151 The set of labels in the label stack as it would have appeared if 1152 this router were forwarding the packet through this interface. 1153 Any Implicit Null labels are explicitly included. Labels are 1154 treated as numbers, i.e., they are right justified in the field. 1156 A Downstream Label is 24 bits, in the same format as an MPLS label 1157 minus the TTL field, i.e., the MSBit of the label is bit 0, the 1158 LSBit is bit 19, the Traffic Class (TC) bits are bits 20-22, and 1159 bit 23 is the S bit. The replying router SHOULD fill in the TC 1160 and S bits; the LSR receiving the echo reply MAY choose to ignore 1161 these bits. Protocol 1163 The Protocol is taken from the following table: 1165 Protocol # Signaling Protocol 1166 ---------- ------------------ 1167 0 Unknown 1168 1 Static 1169 2 BGP 1170 3 LDP 1171 4 RSVP-TE 1173 3.3.1. Multipath Information Encoding 1175 The Multipath Information encodes labels or addresses that will 1176 exercise this path. The Multipath Information depends on the 1177 Multipath Type. The contents of the field are shown in the table 1178 above. IPv4 addresses are drawn from the range 127/8; IPv6 addresses 1179 are drawn from the range 0:0:0:0:0:FFFF:7F00/104. Labels are treated 1180 as numbers, i.e., they are right justified in the field. For Type 4, 1181 ranges indicated by Address pairs MUST NOT overlap and MUST be in 1182 ascending sequence. 1184 Type 8 allows a more dense encoding of IP addresses. The IP prefix 1185 is formatted as a base IP address with the non-prefix low-order bits 1186 set to zero. The maximum prefix length is 27. Following the prefix 1187 is a mask of length 2^(32-prefix length) bits for IPv4 and 1188 2^(128-prefix length) bits for IPv6. Each bit set to 1 represents a 1189 valid address. The address is the base IPv4 address plus the 1190 position of the bit in the mask where the bits are numbered left to 1191 right beginning with zero. For example, the IPv4 addresses 1192 127.2.1.0, 127.2.1.5-127.2.1.15, and 127.2.1.20-127.2.1.29 would be 1193 encoded as follows: 1195 0 1 2 3 1196 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 1197 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1198 |0 1 1 1 1 1 1 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0| 1199 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1200 |1 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 1 1 1 1 1 1 0 0| 1201 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1203 Those same addresses embedded in IPv6 would be encoded as follows: 1205 0 1 2 3 1206 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 1207 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1208 |0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0| 1209 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1210 |0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0| 1211 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1212 |0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1| 1213 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1214 |0 1 1 1 1 1 1 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0| 1215 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1216 |1 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 1 1 1 1 1 1 0 0| 1217 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1219 Type 9 allows a more dense encoding of labels. The label prefix is 1220 formatted as a base label value with the non-prefix low-order bits 1221 set to zero. The maximum prefix (including leading zeros due to 1222 encoding) length is 27. Following the prefix is a mask of length 1223 2^(32-prefix length) bits. Each bit set to one represents a valid 1224 label. The label is the base label plus the position of the bit in 1225 the mask where the bits are numbered left to right beginning with 1226 zero. Label values of all the odd numbers between 1152 and 1279 1227 would be encoded as follows: 1229 0 1 2 3 1230 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 1231 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1232 |0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0| 1233 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1234 |0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1| 1235 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1236 |0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1| 1237 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1238 |0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1| 1239 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1240 |0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1| 1241 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1242 If the received Multipath Information is non-null, the labels and IP 1243 addresses MUST be picked from the set provided. If none of these 1244 labels or addresses map to a particular downstream interface, then 1245 for that interface, the type MUST be set to 0. If the received 1246 Multipath Information is null (i.e., Multipath Length = 0, or for 1247 Types 8 and 9, a mask of all zeros), the type MUST be set to 0. 1249 For example, suppose LSR X at hop 10 has two downstream LSRs, Y and 1250 Z, for the FEC in question. The received X could return Multipath 1251 Type 4, with low/high IP addresses of 127.1.1.1->127.1.1.255 for 1252 downstream LSR Y and 127.2.1.1->127.2.1.255 for downstream LSR Z. 1253 The head end reflects this information to LSR Y. Y, which has three 1254 downstream LSRs, U, V, and W, computes that 127.1.1.1->127.1.1.127 1255 would go to U and 127.1.1.128-> 127.1.1.255 would go to V. Y would 1256 then respond with 3 Downstream Mappings: to U, with Multipath Type 4 1257 (127.1.1.1->127.1.1.127); to V, with Multipath Type 4 1258 (127.1.1.127->127.1.1.255); and to W, with Multipath Type 0. 1260 Note that computing Multipath Information may impose a significant 1261 processing burden on the receiver. A receiver MAY thus choose to 1262 process a subset of the received prefixes. The sender, on receiving 1263 a reply to a Downstream Mapping with partial information, SHOULD 1264 assume that the prefixes missing in the reply were skipped by the 1265 receiver, and MAY re-request information about them in a new echo 1266 request. 1268 3.3.2. Downstream Router and Interface 1270 The notion of "downstream router" and "downstream interface" should 1271 be explained. Consider an LSR X. If a packet that was originated 1272 with TTL n>1 arrived with outermost label L and TTL=1 at LSR X, X 1273 must be able to compute which LSRs could receive the packet if it was 1274 originated with TTL=n+1, over which interface the request would 1275 arrive and what label stack those LSRs would see. (It is outside the 1276 scope of this document to specify how this computation is done.) The 1277 set of these LSRs/interfaces consists of the downstream routers/ 1278 interfaces (and their corresponding labels) for X with respect to L. 1279 Each pair of downstream router and interface requires a separate 1280 Downstream Mapping to be added to the reply. 1282 The case where X is the LSR originating the echo request is a special 1283 case. X needs to figure out what LSRs would receive the MPLS echo 1284 request for a given FEC Stack that X originates with TTL=1. 1286 The set of downstream routers at X may be alternative paths (see the 1287 discussion below on ECMP) or simultaneous paths (e.g., for MPLS 1288 multicast). In the former case, the Multipath Information is used as 1289 a hint to the sender as to how it may influence the choice of these 1290 alternatives. 1292 3.4. Pad TLV 1294 The value part of the Pad TLV contains a variable number (>= 1) of 1295 octets. The first octet takes values from the following table; all 1296 the other octets (if any) are ignored. The receiver SHOULD verify 1297 that the TLV is received in its entirety, but otherwise ignores the 1298 contents of this TLV, apart from the first octet. 1300 Value Meaning 1301 ----- ------- 1302 1 Drop Pad TLV from reply 1303 2 Copy Pad TLV to reply 1304 3-255 Reserved for future use 1306 3.5. Vendor Enterprise Number 1308 SMI Private Enterprise Numbers are maintained by IANA. The Length is 1309 always 4; the value is the SMI Private Enterprise code, in network 1310 octet order, of the vendor with a Vendor Private extension to any of 1311 the fields in the fixed part of the message, in which case this TLV 1312 MUST be present. If none of the fields in the fixed part of the 1313 message have Vendor Private extensions, inclusion of this TLV is 1314 OPTIONAL. Vendor Private ranges for Message Types, Reply Modes, and 1315 Return Codes have been defined. When any of these are used, the 1316 Vendor Enterprise Number TLV MUST be included in the message. 1318 3.6. Interface and Label Stack 1320 The Interface and Label Stack TLV MAY be included in a reply message 1321 to report the interface on which the request message was received and 1322 the label stack that was on the packet when it was received. Only 1323 one such object may appear. The purpose of the object is to allow 1324 the upstream router to obtain the exact interface and label stack 1325 information as it appears at the replying LSR. 1327 The Length is K + 4*N octets; N is the number of labels in the label 1328 stack. Values for K are found in the description of Address Type 1329 below. The Value field of a Downstream Mapping has the following 1330 format: 1332 0 1 2 3 1333 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 1334 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1335 | Address Type | Must Be Zero | 1336 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1337 | IP Address (4 or 16 octets) | 1338 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1339 | Interface (4 or 16 octets) | 1340 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1341 . . 1342 . . 1343 . Label Stack . 1344 . . 1345 . . 1346 . . 1347 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1349 Address Type 1351 The Address Type indicates if the interface is numbered or 1352 unnumbered. It also determines the length of the IP Address and 1353 Interface fields. The resulting total for the initial part of the 1354 TLV is listed in the table below as "K Octets". The Address Type 1355 is set to one of the following values: 1357 Type # Address Type K Octets 1358 ------ ------------ -------- 1359 1 IPv4 Numbered 12 1360 2 IPv4 Unnumbered 12 1361 3 IPv6 Numbered 36 1362 4 IPv6 Unnumbered 24 1364 IP Address and Interface 1366 IPv4 addresses and interface indices are encoded in 4 octets; IPv6 1367 addresses are encoded in 16 octets. 1369 If the interface upon which the echo request message was received 1370 is numbered, then the Address Type MUST be set to IPv4 or IPv6, 1371 the IP Address MUST be set to either the LSR's Router ID or the 1372 interface address, and the Interface MUST be set to the interface 1373 address. 1375 If the interface is unnumbered, the Address Type MUST be either 1376 IPv4 Unnumbered or IPv6 Unnumbered, the IP Address MUST be the 1377 LSR's Router ID, and the Interface MUST be set to the index 1378 assigned to the interface. 1380 Label Stack 1382 The label stack of the received echo request message. If any TTL 1383 values have been changed by this router, they SHOULD be restored. 1385 3.7. Errored TLVs 1387 The following TLV is a TLV that MAY be included in an echo reply to 1388 inform the sender of an echo request of mandatory TLVs either not 1389 supported by an implementation or parsed and found to be in error. 1391 The Value field contains the TLVs that were not understood, encoded 1392 as sub-TLVs. 1394 0 1 2 3 1395 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 1396 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1397 | Type = 9 | Length | 1398 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1399 | Value | 1400 . . 1401 . . 1402 . . 1403 | | 1404 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1406 3.8. Reply TOS Byte TLV 1408 This TLV MAY be used by the originator of the echo request to request 1409 that an echo reply be sent with the IP header TOS byte set to the 1410 value specified in the TLV. This TLV has a length of 4 with the 1411 following value field. 1413 0 1 2 3 1414 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 1415 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1416 | Reply-TOS Byte| Must Be Zero | 1417 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1419 4. Theory of Operation 1421 An MPLS echo request is used to test a particular LSP. The LSP to be 1422 tested is identified by the "FEC Stack"; for example, if the LSP was 1423 set up via LDP, and is to an egress IP address of 10.1.1.1, the FEC 1424 Stack contains a single element, namely, an LDP IPv4 prefix sub-TLV 1425 with value 10.1.1.1/32. If the LSP being tested is an RSVP LSP, the 1426 FEC Stack consists of a single element that captures the RSVP Session 1427 and Sender Template that uniquely identifies the LSP. 1429 FEC Stacks can be more complex. For example, one may wish to test a 1430 VPN IPv4 prefix of 10.1/8 that is tunneled over an LDP LSP with 1431 egress 10.10.1.1. The FEC Stack would then contain two sub-TLVs, the 1432 bottom being a VPN IPv4 prefix, and the top being an LDP IPv4 prefix. 1433 If the underlying (LDP) tunnel were not known, or was considered 1434 irrelevant, the FEC Stack could be a single element with just the VPN 1435 IPv4 sub-TLV. 1437 When an MPLS echo request is received, the receiver is expected to 1438 verify that the control plane and data plane are both healthy (for 1439 the FEC Stack being pinged) and that the two planes are in sync. The 1440 procedures for this are in section 4.4 below. 1442 4.1. Dealing with Equal-Cost Multi-Path (ECMP) 1444 LSPs need not be simple point-to-point tunnels. Frequently, a single 1445 LSP may originate at several ingresses, and terminate at several 1446 egresses; this is very common with LDP LSPs. LSPs for a given FEC 1447 may also have multiple "next hops" at transit LSRs. At an ingress, 1448 there may also be several different LSPs to choose from to get to the 1449 desired endpoint. Finally, LSPs may have backup paths, detour paths, 1450 and other alternative paths to take should the primary LSP go down. 1452 To deal with the last two first: it is assumed that the LSR sourcing 1453 MPLS echo requests can force the echo request into any desired LSP, 1454 so choosing among multiple LSPs at the ingress is not an issue. The 1455 problem of probing the various flavors of backup paths that will 1456 typically not be used for forwarding data unless the primary LSP is 1457 down will not be addressed here. 1459 Since the actual LSP and path that a given packet may take may not be 1460 known a priori, it is useful if MPLS echo requests can exercise all 1461 possible paths. This, although desirable, may not be practical, 1462 because the algorithms that a given LSR uses to distribute packets 1463 over alternative paths may be proprietary. 1465 To achieve some degree of coverage of alternate paths, there is a 1466 certain latitude in choosing the destination IP address and source 1467 UDP port for an MPLS echo request. This is clearly not sufficient; 1468 in the case of traceroute, more latitude is offered by means of the 1469 Multipath Information of the Downstream Mapping TLV. This is used as 1470 follows. An ingress LSR periodically sends an MPLS traceroute 1471 message to determine whether there are multipaths for a given LSP. 1472 If so, each hop will provide some information how each of its 1473 downstream paths can be exercised. The ingress can then send MPLS 1474 echo requests that exercise these paths. If several transit LSRs 1475 have ECMP, the ingress may attempt to compose these to exercise all 1476 possible paths. However, full coverage may not be possible. 1478 4.2. Testing LSPs That Are Used to Carry MPLS Payloads 1480 To detect certain LSP breakages, it may be necessary to encapsulate 1481 an MPLS echo request packet with at least one additional label when 1482 testing LSPs that are used to carry MPLS payloads (such as LSPs used 1483 to carry L2VPN and L3VPN traffic. For example, when testing LDP or 1484 RSVP-TE LSPs, just sending an MPLS echo request packet may not detect 1485 instances where the router immediately upstream of the destination of 1486 the LSP ping may forward the MPLS echo request successfully over an 1487 interface not configured to carry MPLS payloads because of the use of 1488 penultimate hop popping. Since the receiving router has no means to 1489 differentiate whether the IP packet was sent unlabeled or implicitly 1490 labeled, the addition of labels shimmed above the MPLS echo request 1491 (using the Nil FEC) will prevent a router from forwarding such a 1492 packet out unlabeled interfaces. 1494 4.3. Sending an MPLS Echo Request 1496 An MPLS echo request is a UDP packet. The IP header is set as 1497 follows: the source IP address is a routable address of the sender; 1498 the destination IP address is a (randomly chosen) IPv4 address from 1499 the range 127/8 or IPv6 address from the range 1500 0:0:0:0:0:FFFF:7F00/104. The IP TTL is set to 1. The source UDP 1501 port is chosen by the sender; the destination UDP port is set to 3503 1502 (assigned by IANA for MPLS echo requests). The Router Alert option 1503 MUST be set in the IP header. 1505 An MPLS echo request is sent with a label stack corresponding to the 1506 FEC Stack being tested. Note that further labels could be applied 1507 if, for example, the normal route to the topmost FEC in the stack is 1508 via a Traffic Engineered Tunnel [RFC3209]. If all of the FECs in the 1509 stack correspond to Implicit Null labels, the MPLS echo request is 1510 considered unlabeled even if further labels will be applied in 1511 sending the packet. 1513 If the echo request is labeled, one MAY (depending on what is being 1514 pinged) set the TTL of the innermost label to 1, to prevent the ping 1515 request going farther than it should. Examples of where this SHOULD 1516 be done include pinging a VPN IPv4 or IPv6 prefix, an L2 VPN endpoint 1517 or a pseudowire. Preventing the ping request from going too far can 1518 also be accomplished by inserting a Router Alert label above this 1519 label; however, this may lead to the undesired side effect that MPLS 1520 echo requests take a different data path than actual data. For more 1521 information on how these mechanisms can be used for pseudowire 1522 connectivity verification, see [RFC5085]. 1524 In "ping" mode (end-to-end connectivity check), the TTL in the 1525 outermost label is set to 255. In "traceroute" mode (fault isolation 1526 mode), the TTL is set successively to 1, 2, and so on. 1528 The sender chooses a Sender's Handle and a Sequence Number. When 1529 sending subsequent MPLS echo requests, the sender SHOULD increment 1530 the Sequence Number by 1. However, a sender MAY choose to send a 1531 group of echo requests with the same Sequence Number to improve the 1532 chance of arrival of at least one packet with that Sequence Number. 1534 The TimeStamp Sent is set to the time-of-day in NTP format that the 1535 echo request is sent. The TimeStamp Received is set to zero. 1537 An MPLS echo request MUST have an FEC Stack TLV. Also, the Reply 1538 Mode must be set to the desired reply mode; the Return Code and 1539 Subcode are set to zero. In the "traceroute" mode, the echo request 1540 SHOULD include a Downstream Mapping TLV. 1542 4.4. Receiving an MPLS Echo Request 1544 Sending an MPLS echo request to the control plane is triggered by one 1545 of the following packet processing exceptions: Router Alert option, 1546 IP TTL expiration, MPLS TTL expiration, MPLS Router Alert label, or 1547 the destination address in the 127/8 address range. The control 1548 plane further identifies it by UDP destination port 3503. 1550 For reporting purposes the bottom of stack is considered to be stack- 1551 depth of 1. This is to establish an absolute reference for the case 1552 where the actual stack may have more labels than there are FECs in 1553 the Target FEC Stack. 1555 Furthermore, in all the error codes listed in this document, a stack- 1556 depth of 0 means "no value specified". This allows compatibility 1557 with existing implementations that do not use the Return Subcode 1558 field. 1560 An LSR X that receives an MPLS echo request then processes it as 1561 follows. 1563 1. General packet sanity is verified. If the packet is not well- 1564 formed, LSR X SHOULD send an MPLS Echo Reply with the Return Code 1565 set to "Malformed echo request received" and the Subcode to zero. 1566 If there are any TLVs not marked as "Ignore" that LSR X does not 1567 understand, LSR X SHOULD send an MPLS "TLV not understood" (as 1568 appropriate), and the Subcode set to zero. In the latter case, 1569 the misunderstood TLVs (only) are included as sub-TLVs in an 1570 Errored TLVs TLV in the reply. The header fields Sender's 1571 Handle, Sequence Number, and Timestamp Sent are not examined, but 1572 are included in the MPLS echo reply message. 1574 The algorithm uses the following variables and identifiers: 1576 Interface-I: the interface on which the MPLS echo request was 1577 received. 1579 Stack-R: the label stack on the packet as it was received. 1581 Stack-D: the label stack carried in the Downstream Mapping 1582 TLV (not always present) 1584 Label-L: the label from the actual stack currently being 1585 examined. Requires no initialization. 1587 Label-stack-depth: the depth of label being verified. Initialized 1588 to the number of labels in the received label 1589 stack S. 1591 FEC-stack-depth: depth of the FEC in the Target FEC Stack that 1592 should be used to verify the current actual 1593 label. Requires no initialization. 1595 Best-return-code: contains the return code for the echo reply 1596 packet as currently best known. As the algorithm 1597 progresses, this code may change depending on the 1598 results of further checks that it performs. 1600 Best-rtn-subcode: similar to Best-return-code, but for the Echo 1601 Reply Subcode. 1603 FEC-status: result value returned by the FEC Checking 1604 algorithm described in section 4.4.1. 1606 /* Save receive context information */ 1608 2. If the echo request is good, LSR X stores the interface over 1609 which the echo was received in Interface-I, and the label stack 1610 with which it came in Stack-R. 1612 /* The rest of the algorithm iterates over the labels in Stack-R, 1613 verifies validity of label values, reports associated label switching 1614 operations (for traceroute), verifies correspondence between the 1615 Stack-R and the Target FEC Stack description in the body of the echo 1616 request, and reports any errors. */ 1618 /* The algorithm iterates as follows. */ 1619 3. Label Validation: 1621 If Label-stack-depth is 0 { 1623 /* The LSR needs to report its being a tail-end for the LSP */ 1625 Set FEC-stack-depth to 1, set Label-L to 3 (Implicit Null). 1626 Set Best-return-code to 3 ("Replying router is an egress for 1627 the FEC at stack depth"), set Best-rtn-subcode to the value of 1628 FEC-stack-depth (1) and go to step 5 (Egress Processing). 1630 } 1632 /* This step assumes there is always an entry for well-known label 1633 values */ 1635 Set Label-L to the value extracted from Stack-R at depth Label- 1636 stack-depth. Look up Label-L in the Incoming Label Map (ILM) to 1637 determine if the label has been allocated and an operation is 1638 associated with it. 1640 If there is no entry for L { 1642 /* Indicates a temporary or permanent label synchronization 1643 problem the LSR needs to report an error */ 1645 Set Best-return-code to 11 ("No label entry at stack-depth") 1646 and Best-rtn-subcode to Label-stack-depth. Go to step 7 (Send 1647 Reply Packet). 1649 } 1651 Else { 1653 Retrieve the associated label operation from the corresponding 1654 NHLFE and proceed to step 4 (Label Operation check). 1656 } 1658 4. Label Operation Check 1660 If the label operation is "Pop and Continue Processing" { 1662 /* Includes Explicit Null and Router Alert label cases */ 1664 Iterate to the next label by decrementing Label-stack-depth and 1665 loop back to step 3 (Label Validation). 1667 } 1669 If the label operation is "Swap or Pop and Switch based on Popped 1670 Label" { 1672 Set Best-return-code to 8 ("Label switched at stack-depth") and 1673 Best-rtn-subcode to Label-stack-depth to report transit 1674 switching. 1676 If a Downstream Mapping TLV is present in the received echo 1677 request { 1679 If the IP address in the TLV is 127.0.0.1 or 0::1 { 1681 Set Best-return-code to 6 ("Upstream Interface Index 1682 Unknown"). An Interface and Label Stack TLV SHOULD be 1683 included in the reply and filled with Interface-I and 1684 Stack-R. 1686 } 1688 Else { 1690 Verify that the IP address, interface address, and label 1691 stack in the Downstream Mapping TLV match Interface-I and 1692 Stack-R. If there is a mismatch, set Best-return-code to 1693 5, "Downstream Mapping Mismatch". An Interface and Label 1694 Stack TLV SHOULD be included in the reply and filled in 1695 based on Interface-I and Stack-R. Go to step 7 (Send 1696 Reply Packet). 1698 } 1700 } 1702 For each available downstream ECMP path { 1704 Retrieve output interface from the NHLFE entry. 1706 /* Note: this return code is set even if Label-stack-depth 1707 is one */ 1709 If the output interface is not MPLS enabled { 1711 Set Best-return-code to Return Code 9, "Label switched 1712 but no MPLS forwarding at stack-depth" and set Best-rtn- 1713 subcode to Label-stack-depth and goto Send_Reply_Packet. 1715 } 1717 If a Downstream Mapping TLV is present { 1719 A Downstream Mapping TLV SHOULD be included in the echo 1720 reply (see section 3.3) filled in with information about 1721 the current ECMP path. 1723 } 1725 } 1727 If no Downstream Mapping TLV is present, or the Downstream IP 1728 Address is set to the ALLROUTERS multicast address, go to step 1729 7 (Send Reply Packet). 1731 If the "Validate FEC Stack" flag is not set and the LSR is not 1732 configured to perform FEC checking by default, go to step 7 1733 (Send Reply Packet). 1735 /* Validate the Target FEC Stack in the received echo request. 1737 First determine FEC-stack-depth from the Downstream Mapping 1738 TLV. This is done by walking through Stack-D (the Downstream 1739 labels) from the bottom, decrementing the number of labels for 1740 each non-Implicit Null label, while incrementing FEC-stack- 1741 depth for each label. If the Downstream Mapping TLV contains 1742 one or more Implicit Null labels, FEC-stack-depth may be 1743 greater than Label-stack-depth. To be consistent with the 1744 above stack-depths, the bottom is considered to be entry 1. 1745 */ 1747 Set FEC-stack-depth to 0. Set i to Label-stack-depth. 1749 While (i > 0 ) do { 1751 ++FEC-stack-depth. 1752 if Stack-D[FEC-stack-depth] != 3 (Implicit Null) 1753 --i. 1754 } 1756 If the number of FECs in the FEC stack is greater than or equal 1757 to FEC-stack-depth { 1758 Perform the FEC Checking procedure (see subsection 4.4.1 1759 below). 1761 If FEC-status is 2, set Best-return-code to 10 ("Mapping for 1762 this FEC is not the given label at stack-depth"). 1764 If the return code is 1, set Best-return-code to FEC-return- 1765 code and Best-rtn-subcode to FEC-stack-depth. 1766 } 1768 Go to step 7 (Send Reply Packet). 1769 } 1771 5. Egress Processing: 1773 /* These steps are performed by the LSR that identified itself as 1774 the tail-end LSR for an LSP. */ 1776 If received echo request contains no Downstream Mapping TLV, or 1777 the Downstream IP Address is set to 127.0.0.1 or 0::1 go to step 6 1778 (Egress FEC Validation). 1780 Verify that the IP address, interface address, and label stack in 1781 the Downstream Mapping TLV match Interface-I and Stack-R. If not, 1782 set Best-return-code to 5, "Downstream Mapping Mis-match". A 1783 Received Interface and Label Stack TLV SHOULD be created for the 1784 echo response packet. Go to step 7 (Send Reply Packet). 1786 6. Egress FEC Validation: 1788 /* This is a loop for all entries in the Target FEC Stack starting 1789 with FEC-stack-depth. */ 1791 Perform FEC checking by following the algorithm described in 1792 subsection 4.4.1 for Label-L and the FEC at FEC-stack-depth. 1794 Set Best-return-code to FEC-code and Best-rtn-subcode to the value 1795 in FEC-stack-depth. 1797 If FEC-status (the result of the check) is 1, 1798 go to step 7 (Send Reply Packet). 1800 /* Iterate to the next FEC entry */ 1802 ++FEC-stack-depth. 1803 If FEC-stack-depth > the number of FECs in the FEC-stack, 1804 go to step 7 (Send Reply Packet). 1806 If FEC-status is 0 { 1808 ++Label-stack-depth. 1809 If Label-stack-depth > the number of labels in Stack-R, 1810 Go to step 7 (Send Reply Packet). 1812 Label-L = extracted label from Stack-R at depth 1813 Label-stack-depth. 1814 Loop back to step 6 (Egress FEC Validation). 1815 } 1817 7. Send Reply Packet: 1819 Send an MPLS echo reply with a Return Code of Best-return-code, 1820 and a Return Subcode of Best-rtn-subcode. Include any TLVs 1821 created during the above process. The procedures for sending the 1822 echo reply are found in subsection 4.5. 1824 4.4.1. FEC Validation 1826 /* This subsection describes validation of an FEC entry within the 1827 Target FEC Stack and accepts an FEC, Label-L, and Interface-I. The 1828 algorithm performs the following steps. */ 1830 1. Two return values, FEC-status and FEC-return-code, are 1831 initialized to 0. 1833 2. If the FEC is the Nil FEC { 1835 If Label-L is either Explicit_Null or Router_Alert, return. 1837 Else { 1839 Set FEC-return-code to 10 ("Mapping for this FEC is not the 1840 given label at stack-depth"). 1841 Set FEC-status to 1 1842 Return. 1843 } 1845 } 1847 3. Check the FEC label mapping that describes how traffic received 1848 on the LSP is further switched or which application it is 1849 associated with. If no mapping exists, set FEC-return-code to 1850 Return 4, "Replying router has no mapping for the FEC at stack- 1851 depth". Set FEC-status to 1. Return. 1853 4. If the label mapping for FEC is Implicit Null, set FEC-status to 1854 2 and proceed to step 5. Otherwise, if the label mapping for FEC 1855 is Label-L, proceed to step 5. Otherwise, set FEC-return-code to 1856 10 ("Mapping for this FEC is not the given label at stack- 1857 depth"), set FEC-status to 1, and return. 1859 5. This is a protocol check. Check what protocol would be used to 1860 advertise FEC. If it can be determined that no protocol 1861 associated with Interface-I would have advertised an FEC of that 1862 FEC-Type, set FEC-return-code to 12 ("Protocol not associated 1863 with interface at FEC stack-depth"). Set FEC-status to 1. 1865 6. Return. 1867 4.5. Sending an MPLS Echo Reply 1869 An MPLS echo reply is a UDP packet. It MUST ONLY be sent in response 1870 to an MPLS echo request. The source IP address is a routable address 1871 of the replier; the source port is the well-known UDP port for LSP 1872 ping. The destination IP address and UDP port are copied from the 1873 source IP address and UDP port of the echo request. The IP TTL is 1874 set to 255. If the Reply Mode in the echo request is "Reply via an 1875 IPv4 UDP packet with Router Alert", then the IP header MUST contain 1876 the Router Alert IP option. If the reply is sent over an LSP, the 1877 topmost label MUST in this case be the Router Alert label (1) (see 1878 [RFC3032]). 1880 The format of the echo reply is the same as the echo request. The 1881 Sender's Handle, the Sequence Number, and TimeStamp Sent are copied 1882 from the echo request; the TimeStamp Received is set to the time-of- 1883 day that the echo request is received (note that this information is 1884 most useful if the time-of-day clocks on the requester and the 1885 replier are synchronized). The FEC Stack TLV from the echo request 1886 MAY be copied to the reply. 1888 The replier MUST fill in the Return Code and Subcode, as determined 1889 in the previous subsection. 1891 If the echo request contains a Pad TLV, the replier MUST interpret 1892 the first octet for instructions regarding how to reply. 1894 If the replying router is the destination of the FEC, then Downstream 1895 Mapping TLVs SHOULD NOT be included in the echo reply. 1897 If the echo request contains a Downstream Mapping TLV, and the 1898 replying router is not the destination of the FEC, the replier SHOULD 1899 compute its downstream routers and corresponding labels for the 1900 incoming label, and add Downstream Mapping TLVs for each one to the 1901 echo reply it sends back. 1903 If the Downstream Mapping TLV contains Multipath Information 1904 requiring more processing than the receiving router is willing to 1905 perform, the responding router MAY choose to respond with only a 1906 subset of multipaths contained in the echo request Downstream 1907 Mapping. (Note: The originator of the echo request MAY send another 1908 echo request with the Multipath Information that was not included in 1909 the reply.) 1911 Except in the case of Reply Mode 4, "Reply via application level 1912 control channel", echo replies are always sent in the context of the 1913 IP/MPLS network. 1915 4.6. Receiving an MPLS Echo Reply 1917 An LSR X should only receive an MPLS echo reply in response to an 1918 MPLS echo request that it sent. Thus, on receipt of an MPLS echo 1919 reply, X should parse the packet to ensure that it is well-formed, 1920 then attempt to match up the echo reply with an echo request that it 1921 had previously sent, using the destination UDP port and the Sender's 1922 Handle. If no match is found, then X jettisons the echo reply; 1923 otherwise, it checks the Sequence Number to see if it matches. 1925 If the echo reply contains Downstream Mappings, and X wishes to 1926 traceroute further, it SHOULD copy the Downstream Mapping(s) into its 1927 next echo request(s) (with TTL incremented by one). 1929 4.7. Issue with VPN IPv4 and IPv6 Prefixes 1931 Typically, an LSP ping for a VPN IPv4 prefix or VPN IPv6 prefix is 1932 sent with a label stack of depth greater than 1, with the innermost 1933 label having a TTL of 1. This is to terminate the ping at the egress 1934 PE, before it gets sent to the customer device. However, under 1935 certain circumstances, the label stack can shrink to a single label 1936 before the ping hits the egress PE; this will result in the ping 1937 terminating prematurely. One such scenario is a multi-AS Carrier's 1938 Carrier VPN. 1940 To get around this problem, one approach is for the LSR that receives 1941 such a ping to realize that the ping terminated prematurely, and send 1942 back error code 13. In that case, the initiating LSR can retry the 1943 ping after incrementing the TTL on the VPN label. In this fashion, 1944 the ingress LSR will sequentially try TTL values until it finds one 1945 that allows the VPN ping to reach the egress PE. 1947 4.8. Non-compliant Routers 1949 If the egress for the FEC Stack being pinged does not support MPLS 1950 ping, then no reply will be sent, resulting in possible "false 1951 negatives". If in "traceroute" mode, a transit LSR does not support 1952 LSP ping, then no reply will be forthcoming from that LSR for some 1953 TTL, say, n. The LSR originating the echo request SHOULD try sending 1954 the echo request with TTL=n+1, n+2, ..., n+k to probe LSRs further 1955 down the path. In such a case, the echo request for TTL > n SHOULD 1956 be sent with Downstream Mapping TLV "Downstream IP Address" field set 1957 to the ALLROUTERs multicast address until a reply is received with a 1958 Downstream Mapping TLV. The label stack MAY be omitted from the 1959 Downstream Mapping TLV. Furthermore, the "Validate FEC Stack" flag 1960 SHOULD NOT be set until an echo reply packet with a Downstream 1961 Mapping TLV is received. 1963 5. Security Considerations 1965 Overall, the security needs for LSP ping are similar to those of ICMP 1966 ping. 1968 There are at least three approaches to attacking LSRs using the 1969 mechanisms defined here. One is a Denial-of-Service attack, by 1970 sending MPLS echo requests/replies to LSRs and thereby increasing 1971 their workload. The second is obfuscating the state of the MPLS data 1972 plane liveness by spoofing, hijacking, replaying, or otherwise 1973 tampering with MPLS echo requests and replies. The third is an 1974 unauthorized source using an LSP ping to obtain information about the 1975 network. To avoid potential Denial-of-Service attacks, it is 1976 RECOMMENDED that implementations regulate the LSP ping traffic going 1977 to the control plane. A rate limiter SHOULD be applied to the well- 1978 known UDP port defined below. 1980 Unsophisticated replay and spoofing attacks involving faking or 1981 replaying MPLS echo reply messages are unlikely to be effective. 1982 These replies would have to match the Sender's Handle and Sequence 1983 Number of an outstanding MPLS echo request message. A non-matching 1984 replay would be discarded as the sequence has moved on, thus a spoof 1985 has only a small window of opportunity. However, to provide a 1986 stronger defense, an implementation MAY also validate the TimeStamp 1987 Sent by requiring an exact match on this field. 1989 To protect against unauthorized sources using MPLS echo request 1990 messages to obtain network information, it is RECOMMENDED that 1991 implementations provide a means of checking the source addresses of 1992 MPLS echo request messages against an access list before accepting 1993 the message. 1995 It is not clear how to prevent hijacking (non-delivery) of echo 1996 requests or replies; however, if these messages are indeed hijacked, 1997 LSP ping will report that the data plane is not working as it should. 1999 It does not seem vital (at this point) to secure the data carried in 2000 MPLS echo requests and replies, although knowledge of the state of 2001 the MPLS data plane may be considered confidential by some. 2003 Implementations SHOULD, however, provide a means of filtering the 2004 addresses to which echo reply messages may be sent. 2006 Although this document makes special use of 127/8 address, these are 2007 used only in conjunction with the UDP port 3503. Furthermore, these 2008 packets are only processed by routers. All other hosts MUST treat 2009 all packets with a destination address in the range 127/8 in 2010 accordance to RFC 1122. Any packet received by a router with a 2011 destination address in the range 127/8 without a destination UDP port 2012 of 3503 MUST be treated in accordance to RFC 1812. In particular, 2013 the default behavior is to treat packets destined to a 127/8 address 2014 as "martians". 2016 6. IANA Considerations 2018 The TCP and UDP port number 3503 has been allocated by IANA for LSP 2019 echo requests and replies. 2021 The following sections detail the new name spaces to be managed by 2022 IANA. For each of these name spaces, the space is divided into 2023 assignment ranges; the following terms are used in describing the 2024 procedures by which IANA allocates values: "Standards Action" (as 2025 defined in [RFC5226]), "Specification Required", and "Vendor Private 2026 Use". 2028 Values from "Specification Required" ranges MUST be registered with 2029 IANA. The request MUST be made via an Experimental RFC that 2030 describes the format and procedures for using the code point; the 2031 actual assignment is made during the IANA actions for the RFC. 2033 Values from "Vendor Private" ranges MUST NOT be registered with IANA; 2034 however, the message MUST contain an enterprise code as registered 2035 with the IANA SMI Private Network Management Private Enterprise 2036 Numbers. For each name space that has a Vendor Private range, it 2037 must be specified where exactly the SMI Private Enterprise Number 2038 resides; see below for examples. In this way, several enterprises 2039 (vendors) can use the same code point without fear of collision. 2041 6.1. Message Types, Reply Modes, Return Codes 2043 The IANA has created and will maintain registries for Message Types, 2044 Reply Modes, and Return Codes. Each of these can take values in the 2045 range 0-255. Assignments in the range 0-191 are via Standards 2046 Action; assignments in the range 192-251 are made via "Specification 2047 Required"; values in the range 252-255 are for Vendor Private Use, 2048 and MUST NOT be allocated. 2050 If any of these fields fall in the Vendor Private range, a top-level 2051 Vendor Enterprise Number TLV MUST be present in the message. 2053 Message Types defined in this document are the following: 2055 Value Meaning 2056 ----- ------- 2057 1 MPLS echo request 2058 2 MPLS echo reply 2060 Reply Modes defined in this document are the following: 2062 Value Meaning 2063 ----- ------- 2064 1 Do not reply 2065 2 Reply via an IPv4/IPv6 UDP packet 2066 3 Reply via an IPv4/IPv6 UDP packet with Router Alert 2067 4 Reply via application level control channel 2069 Return Codes defined in this document are listed in section 3.1. 2071 6.2. TLVs 2073 The IANA has created and will maintain a registry for the Type field 2074 of top-level TLVs as well as for any associated sub-TLVs. Note the 2075 meaning of a sub-TLV is scoped by the TLV. The number spaces for the 2076 sub-TLVs of various TLVs are independent. 2078 The valid range for TLVs and sub-TLVs is 0-65535. Assignments in the 2079 range 0-16383 and 32768-49161 are made via Standards Action as 2080 defined in [RFC5226]; assignments in the range 16384-31743 and 2081 49162-64511 are made via "Specification Required" as defined above; 2082 values in the range 31744-32767 and 64512-65535 are for Vendor 2083 Private Use, and MUST NOT be allocated. 2085 If a TLV or sub-TLV has a Type that falls in the range for Vendor 2086 Private Use, the Length MUST be at least 4, and the first four octets 2087 MUST be that vendor's SMI Private Enterprise Number, in network octet 2088 order. The rest of the Value field is private to the vendor. TLVs 2089 and sub-TLVs defined in this document are the following: 2091 Type Sub-Type Value Field 2092 ---- -------- ----------- 2093 1 Target FEC Stack 2094 1 LDP IPv4 prefix 2095 2 LDP IPv6 prefix 2096 3 RSVP IPv4 LSP 2097 4 RSVP IPv6 LSP 2098 5 Not Assigned 2099 6 VPN IPv4 prefix 2100 7 VPN IPv6 prefix 2101 8 L2 VPN endpoint 2102 9 "FEC 128" Pseudowire (Deprecated) 2103 10 "FEC 128" Pseudowire 2104 11 "FEC 129" Pseudowire 2105 12 BGP labeled IPv4 prefix 2106 13 BGP labeled IPv6 prefix 2107 14 Generic IPv4 prefix 2108 15 Generic IPv6 prefix 2109 16 Nil FEC 2110 2 Downstream Mapping 2111 3 Pad 2112 4 Not Assigned 2113 5 Vendor Enterprise Number 2114 6 Not Assigned 2115 7 Interface and Label Stack 2116 8 Not Assigned 2117 9 Errored TLVs 2118 Any value The TLV not understood 2119 10 Reply TOS Byte 2121 7. Acknowledgements 2123 The original acknowledgements from RFC 4379 state the following: 2125 This document is the outcome of many discussions among many 2126 people, including Manoj Leelanivas, Paul Traina, Yakov Rekhter, 2127 Der-Hwa Gan, Brook Bailey, Eric Rosen, Ina Minei, Shivani 2128 Aggarwal, and Vanson Lim. 2130 The description of the Multipath Information sub-field of the 2131 Downstream Mapping TLV was adapted from text suggested by Curtis 2132 Villamizar. 2134 We would like to thank Loa Andersson for motivating the advancement 2135 of this bis specification. 2137 8. References 2139 8.1. Normative References 2141 [RFC1122] Braden, R., Ed., "Requirements for Internet Hosts - 2142 Communication Layers", STD 3, RFC 1122, DOI 10.17487/ 2143 RFC1122, October 1989, 2144 . 2146 [RFC1812] Baker, F., Ed., "Requirements for IP Version 4 Routers", 2147 RFC 1812, DOI 10.17487/RFC1812, June 1995, 2148 . 2150 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2151 Requirement Levels", BCP 14, RFC 2119, March 1997. 2153 [RFC3032] Rosen, E., Tappan, D., Fedorkow, G., Rekhter, Y., 2154 Farinacci, D., Li, T., and A. Conta, "MPLS Label Stack 2155 Encoding", RFC 3032, DOI 10.17487/RFC3032, January 2001, 2156 . 2158 [RFC4026] Andersson, L. and T. Madsen, "Provider Provisioned Virtual 2159 Private Network (VPN) Terminology", RFC 4026, DOI 2160 10.17487/RFC4026, March 2005, 2161 . 2163 [RFC4271] Rekhter, Y., Ed., Li, T., Ed., and S. Hares, Ed., "A 2164 Border Gateway Protocol 4 (BGP-4)", RFC 4271, DOI 2165 10.17487/RFC4271, January 2006, 2166 . 2168 [RFC4379] Kompella, K. and G. Swallow, "Detecting Multi-Protocol 2169 Label Switched (MPLS) Data Plane Failures", RFC 4379, 2170 February 2006. 2172 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 2173 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 2174 DOI 10.17487/RFC5226, May 2008, 2175 . 2177 [RFC5905] Mills, D., Martin, J., Ed., Burbank, J., and W. Kasch, 2178 "Network Time Protocol Version 4: Protocol and Algorithms 2179 Specification", RFC 5905, DOI 10.17487/RFC5905, June 2010, 2180 . 2182 8.2. Informative References 2184 [RFC0792] Postel, J., "Internet Control Message Protocol", STD 5, 2185 RFC 792, September 1981. 2187 [RFC3107] Rekhter, Y. and E. Rosen, "Carrying Label Information in 2188 BGP-4", RFC 3107, DOI 10.17487/RFC3107, May 2001, 2189 . 2191 [RFC3209] Awduche, D., Berger, L., Gan, D., Li, T., Srinivasan, V., 2192 and G. Swallow, "RSVP-TE: Extensions to RSVP for LSP 2193 Tunnels", RFC 3209, DOI 10.17487/RFC3209, December 2001, 2194 . 2196 [RFC4365] Rosen, E., "Applicability Statement for BGP/MPLS IP 2197 Virtual Private Networks (VPNs)", RFC 4365, DOI 10.17487/ 2198 RFC4365, February 2006, 2199 . 2201 [RFC4447] Martini, L., Ed., Rosen, E., El-Aawar, N., Smith, T., and 2202 G. Heron, "Pseudowire Setup and Maintenance Using the 2203 Label Distribution Protocol (LDP)", RFC 4447, DOI 2204 10.17487/RFC4447, April 2006, 2205 . 2207 [RFC4761] Kompella, K., Ed. and Y. Rekhter, Ed., "Virtual Private 2208 LAN Service (VPLS) Using BGP for Auto-Discovery and 2209 Signaling", RFC 4761, DOI 10.17487/RFC4761, January 2007, 2210 . 2212 [RFC5036] Andersson, L., Ed., Minei, I., Ed., and B. Thomas, Ed., 2213 "LDP Specification", RFC 5036, DOI 10.17487/RFC5036, 2214 October 2007, . 2216 [RFC5085] Nadeau, T. and C. Pignataro, "Pseudowire Virtual Circuit 2217 Connectivity Verification (VCCV): A Control Channel for 2218 Pseudowires", RFC 5085, December 2007. 2220 Authors' Addresses 2222 Carlos Pignataro 2223 Cisco Systems, Inc. 2225 Email: cpignata@cisco.com 2226 Nagendra Kumar 2227 Cisco Systems, Inc. 2229 Email: naikumar@cisco.com 2231 Sam Aldrin 2232 Google 2234 Email: aldrin.ietf@gmail.com 2236 Mach(Guoyi) Chen 2237 Huawei 2239 Email: mach.chen@huawei.com