RFC 4385

Pseudowire Emulation Edge-to-Edge (PWE3) Control Word for Use over an MPLS PSN

๐Ÿ“… published February 2006, from ietf

RFC 4385: Pseudowire Emulation Edge-to-Edge (PWE3) Control Word for Use over an MPLS PSN ๐ŸŽ€

Okay bestie, this one is the Standards Track doc from February 2006 (the Network Working Group's "Pseudowire Emulation Edge-to-Edge" spec for the Control Word) ๐Ÿ’… It's by S. Bryant, G. Swallow, L. Martini (all at Cisco Systems) and D. McPherson (at Arbor Networks) ๐Ÿ‘‘ The title block doesn't list anything it obsoletes or updates, so it's standing on its own โœจ

Status of This Memo ๐Ÿ“œ

This document is an Internet standards track protocol for the Internet community, and it asks for discussion and suggestions for improvements ๐Ÿ’ฌ For the standardization state and status of this protocol, check the current edition of the "Internet Official Protocol Standards" (STD 1) ๐Ÿง Distribution of this memo is unlimited ๐ŸŒธ

Copyright (C) The Internet Society (2006). ๐Ÿซถ

Abstract โœจ

So this doc describes the preferred design of a Pseudowire Emulation Edge-to-Edge (PWE3) Control Word for use over an MPLS packet switched network ๐Ÿฆ‹ It also covers the Pseudowire Associated Channel Header ๐ŸŽ€ The whole point of how these fields are designed is that an MPLS Label Switching Router doing MPLS payload inspection won't mix up a PWE3 payload with an IP payload ๐Ÿ™ˆ Iconic, right?

1. Introduction ๐ŸŒˆ

Okay so the standard MPLS encapsulations don't have an explicit protocol identifier ๐Ÿค” For a pseudowire (PW) [RFC3985] to work properly over an MPLS packet switched network (PSN) that does MPLS payload inspection, a PW packet can't look to a label switching router (LSR) like an IP packet [BCP] ๐Ÿšซ A classic example of an LSR doing MPLS payload inspection is one doing equal-cost multiple-path load-balancing (ECMP) [RFC2992] ๐Ÿ”ฅ

Here's the tea โ˜• If ECMP happened on PW packets, the packets in the PW might not all take the same path through the PSN ๐Ÿ˜ญ That can lead to misordered packets showing up at the egress PE, and nobody wants that. Not being able to make sure every packet in a PW takes the same path can also stop the PW Operations and Management (OAM) [VCCV] mechanism from monitoring the PW properly ๐Ÿ’€

This document explains how the PW control word tells a PW payload apart from an IP payload carried over an MPLS PSN ๐Ÿ’– Then it describes the preferred design of a PW Control Word for use over an MPLS PSN, plus the Pseudowire Associated Channel Header ๐Ÿงš

1.1. Conventions Used in This Document ๐Ÿ“–

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [RFC2119] ๐ŸŽ€

2. Avoiding ECMP ๐Ÿšซ๐ŸŒ€

Lowkey important: a PW carried over an MPLS PSN that uses the contents of the MPLS payload to pick the ECMP path can get hit with packet misordering [BCP] ๐Ÿ˜ฌ If the application using the PW is sensitive to misordering, or if misordering would mess up the PW's operation, then you really need to stop the PW from being subjected to ECMP ๐Ÿ’…

Every IP packet [RFC791] [RFC2460] starts with a version number, and LSRs doing MPLS payload inspection check it ๐Ÿ‘€ So to stop packets carried inside a PW from getting processed incorrectly, PW packets carried over an MPLS PSN MUST NOT start with the value 4 (IPv4) or the value 6 (IPv6) in the first nibble [BCP], because those are assumed to be normal IP payloads ๐Ÿ™…โ€โ™€๏ธ

This document defines a PW header with two general formats ๐Ÿฆ‹ The first is the PW MPLS Control Word (PWMCW), which is for data passing across the PW โœจ The second is the PW Associated Channel Header (PWACH), which can be used for things like OAM ๐Ÿซถ

Here's how you tell them apart: if the first nibble of a PW packet carried over an MPLS PSN is 0, the packet starts with a PWMCW ๐Ÿ’œ If the first nibble of a packet carried over an MPLS PSN is 1, it starts with a PWACH ๐ŸŒธ Using any other first nibble value for a PW packet carried over an MPLS PSN is deprecated ๐Ÿ’€

โš ๏ธ If a PW is sensitive to packet misordering and it's carried over an MPLS PSN that uses the contents of the MPLS payload to pick the ECMP path, it MUST use a mechanism that prevents packet misordering. A suitable mechanism is the PWMCW (described in Section 3) for data, and the PWACH (described in Section 5) for channel-associated traffic. ๐Ÿ”ฅ

And one more: the PWMCW or the PWACH MUST immediately follow the bottom of the MPLS label stack ๐Ÿงš

3. Generic PW MPLS Control Word ๐ŸŽ€

The Generic PW MPLS Control Word (PWMCW) looks like this, bestie ๐Ÿ‘‡

    0                   1                   2                   3
    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
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |0 0 0 0|          Specified by PW Encapsulation                |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Figure 1: Generic PW MPLS Control Word

The PW set-up protocol or configuration mechanism decides whether a PW uses a PWMCW ๐Ÿค“ Bits 0..3 are different from the first four bits of an IP packet [BCP], so they give you the MPLS payload discrimination you need ๐Ÿซถ

When a PWMCW is used, it MUST adhere to the Generic format shown in Figure 1 above ๐Ÿ’… To keep the designs of different PW types consistent, it SHOULD also use this preferred format:

    0                   1                   2                   3
    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
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |0 0 0 0| Flags |FRG|  Length   | Sequence Number               |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Figure 2: Preferred PW MPLS Control Word

Here's what each field in the Preferred PW MPLS Control Word (Figure 2) means ๐Ÿ“

Flags (bits 4 to 7):

These bits MAY be used for per-payload signaling ๐Ÿšฉ Their semantics MUST be defined in the PW specification ๐Ÿ“œ

FRG (bits 8 and 9):

These bits are for fragmenting a PW payload ๐Ÿงฉ Their use is described in [FRAG], which is currently a work in progress ๐Ÿšง When the PW is of a type that will never need payload fragmentation, these bits MAY be used as general purpose flags ๐ŸŒˆ

Length (bits 10 to 15):

When the PSN path between the PEs includes an Ethernet segment, the PW packet arriving at the CE-bound PE from the PSN may have padding added by the Ethernet Data Link Layer ๐Ÿงฆ The CE-bound PE uses the length field to figure out how much padding the PSN added, so it can pull the PW payload out of the PW packet ๐Ÿซง

If the MPLS payload is less than 64 bytes, the length field MUST be set to the length of the PW payload plus the length of the PWMCW ๐Ÿ’– Otherwise it MUST be set to zero ๐Ÿ™ƒ

Sequence number (Bit 16 to 31):

The sequence number implements the sequencing function [RFC3985] ๐Ÿ”ข How this field gets used is described in Section 4 ๐ŸŽ€

4. Sequencing ๐Ÿ”ขโœจ

The sequence number mechanism is PW specific ๐Ÿซถ The PW encapsulation specification MAY define the sequence number mechanism to be used, or it may say that the mechanism described here is the one to use ๐Ÿง A pseudo-code description of this mechanism is in the non-normative Appendix ๐Ÿ“Ž

The sequence number mechanism described here uses a circular unsigned 16-bit number space that excludes the value zero ๐Ÿ”

4.1. Setting the Sequence Number ๐Ÿ–Š๏ธ

For a given PW, and a pair of routers PE1 and PE2, if PE1 supports packet sequencing and packet sequencing is enabled for the PW, then these procedures MUST be used ๐Ÿ’…

  • The initial packet transmitted on the PW MUST be sent with sequence number one. 1๏ธโƒฃ
  • Subsequent packets MUST increment the sequence number by one for each packet. โž•
  • The sequence number that follows 65535 (maximum unsigned 16-bit number) is one. ๐Ÿ”„

If the transmitting router PE1 doesn't support sequence number processing, or packet sequencing is disabled, then the sequence number field in the control word MUST be set to zero for all packets transmitted on the PW 0๏ธโƒฃ๐Ÿซง

4.2. Processing the Sequence Number ๐Ÿ“ฌ

If a router PE2 supports receive sequence number processing, and packet sequencing is enabled for this PW, then this procedure is used ๐Ÿ™Œ

When a PW is first set up, the "expected sequence number" associated with it MUST be initialized to one ๐ŸŒฑ

When a packet is received on that PW, the sequence number SHOULD be processed like this ๐Ÿ‘‡

  • If the sequence number on the packet is zero, the sequence integrity of the packets can't be determined. In this case, the received packet is considered to be in order. ๐Ÿคทโ€โ™€๏ธ
  • Otherwise, if the packet sequence number equals the expected sequence number, the packet is in order. โœ…
  • Otherwise, if the packet sequence number is greater than the expected sequence number, and the packet sequence number minus the expected sequence number is less than 32768, the packet is within the allowed receive sequence number window. The implementation MAY treat the packet as in order. ๐ŸชŸ
  • Otherwise, if the packet sequence number is less than the expected sequence number, and the expected sequence number minus the packet sequence number is greater than or equal to 32768, the packet is within the allowed receive sequence number window. The implementation MAY treat the packet as in order. ๐ŸชŸ
  • Otherwise, the packet is out of order. ๐Ÿ™ˆ

If the packet is in order, it MAY be delivered immediately โšก

If the packet sequence number wasn't zero, then the expected sequence number is set to the packet sequence number plus one ๐Ÿ”œ The expected sequence number that follows 65535 (maximum unsigned 16-bit number) is one ๐Ÿ”„

Packets received out of order MAY either be dropped or reordered ๐Ÿ—‘๏ธ๐Ÿ”€ Whether an out-of-sequence packet gets dropped or reordered is up to the receiver's discretion ๐Ÿซถ

๐Ÿšจ If a PE negotiated not to use receive sequence number processing, and it received a non-zero sequence number, then it SHOULD send a PW status message indicating a receive fault, and disable the PW. Big "no" from me ๐Ÿ’€

5. PW Associated Channel โœจ

okay so some PW features need an associated channel ๐Ÿฆ‹. It's a channel multiplexed right into the PW alongside the user traffic, so it takes the exact same path through the PSN as the user traffic does. Also, this is NOT a "PW channel type" in the sense of subsection 5.1.2 of [RFC3985], so don't mix those two up bestie ๐Ÿ™ˆ

When MPLS is the PSN, the PW Associated Channel (PWAC) gets identified by this header:

   0                   1                   2                   3
   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
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |0 0 0 1|Version|   Reserved    |         Channel Type          |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Figure 3: PW Associated Channel Header ๐ŸŽ€

so here's what each field in the PW Associated Channel Header (PWACH) (Figure 3) is giving:

  • Version: the version number of the PWACH. This spec defines version 0, so that's the one you'll see ๐Ÿ’…
  • Reserved: MUST be sent as 0, and ignored on reception. no drama, just zeros ๐Ÿซถ
  • Channel Type: this one is defined in the IANA PW Associated Channel Type registry [IANA] ๐ŸŒธ

and yesss, bits 0..3 MUST be 0001 ๐Ÿ’– that's the trick that lets the packet get told apart from an IP packet [BCP] and from a PW data packet. it's giving bouncer at the door ๐Ÿ˜ญ


6. IANA Considerations ๐ŸŒˆ

IANA has set up a registry of "Pseudowire Associated Channel Types" ๐Ÿ“‹ The values are 16-bit ones, and entries get assigned using the "IETF Consensus" policy defined in [RFC2434]. the value 0x21 says the Associated Channel is carrying an IPv4 packet, and 0x57 says it's carrying an IPv6 packet ๐Ÿงš


7. Security Considerations ๐Ÿ’€

ngl this section is SERIOUS, so read it twice bestie ๐Ÿ˜ญ An application using a PW Associated Channel has to be aware that the channel can potentially get misused. Any application using the Associated Channel MUST therefore fully consider the resultant security issues ๐Ÿ”ฅ and provide mechanisms that stop an attacker from using this as a way to disrupt the operation of the PW or the PE, and that stop the channel from being used as a conduit to deliver packets somewhere else. Picking a suitable security mechanism for an application using a PW Associated Channel is outside the scope of this document, so that's a whole other vibe ๐Ÿ™ˆ

โš ๏ธ If a PW has been configured to operate without a CW, the PW Associated Channel Type mechanism described in the document MUST NOT be used. The reason is that user payloads could get fabricated so they mimic the PW Associated Channel Header, and that would give an attacker a way to hit the application that's using the Associated Channel. not slay, not slay at all ๐Ÿ’€

8. Acknowledgements ๐Ÿซถ

The authors wanna thank David Allan, Thomas Nadeau, Yaakov Stein, and Mark Townsley for their input to this work. literally the best squad ๐Ÿ‘‘


9. Normative References ๐Ÿ“š

  • [RFC791] Postel, J., "Internet Protocol", STD 5, RFC 791, September 1981.
  • [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.
  • [RFC2460] Deering, S. and R. Hinden, "Internet Protocol, Version 6 (IPv6) Specification", RFC 2460, December 1998.

10. Informative References ๐Ÿ“

  • [BCP] Swallow, G., Bryant, S., and L. Andersson, "Avoiding Equal Cost Multipath Treatment in MPLS Networks", Work in Progress, September 2005.
  • [FRAG] Malis, A. and M. Townsley, "PWE3 Fragmentation and Reassembly", Work in Progress, November 2005.
  • [IANA] Martini, L., "IANA Allocations for Pseudowire Edge to Edge Emulation (PWE3)", Work in Progress, November 2005.
  • [RFC2434] Narten, T. and H. Alvestrand, "Guidelines for Writing an IANA Considerations Section in RFCs", BCP 26, RFC 2434, October 1998.
  • [RFC2992] Hopps, C., "Analysis of an Equal-Cost Multi-Path Algorithm", RFC 2992, November 2000.
  • [RFC3985] Bryant, S. and P. Pate, "Pseudo Wire Emulation Edge-to-Edge (PWE3) Architecture", RFC 3985, March 2005.
  • [VCCV] Nadeau, T. and R. Aggarwal, "Pseudowire Virtual Circuit Connectivity Verification (VCCV)", Work in Progress, August 2005.

Appendix. Sequence Number Processing ๐Ÿงฎ

This appendix is non-normative, so it's just here to help you vibe with the code ๐Ÿฆ‹

This appendix gives a pseudo-code description of the sequence number processing mechanism from Section 4.2. โœจ

   unsigned16 RECEIVED     /* packet sequence number
   unsigned16 EXPECTED = 1 /* expected sequence number
                           /* initialized to one
   boolean sequencingDisabled
   boolean dropOutOfOrder  /* policy on in-window out of sequence
                           /* packets

   updateExpected()
   begin
       EXPECTED := RECEIVED + 1;
       /* Because EXPECTED is an unsigned16 it will wrap
       /* from 65535 to 0
       /* zero is skipped
       if (EXPECTED = 0)
           EXPECTED := 1;
       return;
   end;

   On receipt of a PW packet from PSN:
   begin
       if (RECEIVED = 0) then begin
           processPacket();
           return;
       end;

       if (sequencingDisabled) then begin
           /* A packet was received with non-zero sequence number, but
           /* sequencing is disabled
           indicateReceiveFault();
           disablePW();
           return;
       end;

       /* The received sequence is the expected sequence number
       if ((RECEIVED = EXPECTED) then begin
           /* packet is in order
           processPacket();
           updateExpected();
           return;
       end;
       /* Test for received sequence number is greater than
       /* the expected sequence number and is within the
       /* allowed receive sequence number window
       if ((RECEIVED > EXPECTED) and
           ((RECEIVED - EXPECTED) < 32768) then begin
           /* packet is in the window, but there are late/missing
           /* packets
           if (dropOutOfOrder) then begin
               /* policy is to receive immediately, dropping
               /* out of sequence packets
               processPacket();
               updateExpected();
               return;
           end else begin
               /* policy is to wait for late packets
               processMissingPackets();
               return;
           end;
       end;

       /* Test for the received sequence is less than the
       /* expected sequence number and is within the allowed
       /* receive sequence number window
       if ((RECEIVED < EXPECTED) and
           ((EXPECTED - RECEIVED) >= 32768) then begin
           /* packet is in the window, but there are late/missing
           /* packets


           if (dropOutOfOrder) then begin
               /* policy is to receive immediately, dropping
               /* out of sequence packets
               processPacket();
               updateExpected();
               return;
           end else begin
               /* policy is to wait for late packets
               processMissingPackets();
               return;
           end;
       end;

       /* Received packet was outside the allowed receive
       /* sequence number window
       processOutOfWindow();
   end;

Authors' Addresses ๐Ÿ’Œ

   Stewart Bryant
   Cisco Systems,
   250, Longwater,
   Green Park,
   Reading, RG2 6GB,
   United Kingdom.

   EMail: stbryant@cisco.com


   George Swallow
   Cisco Systems, Inc.
   1414 Massachusetts Ave
   Boxborough, MA 01719

   EMail:  swallow@cisco.com


   Luca Martini
   Cisco Systems, Inc.
   9155 East Nichols Avenue, Suite 400
   Englewood, CO, 80112

   EMail: lmartini@cisco.com


   Danny McPherson
   Arbor Networks, Inc.

   EMail: danny@arbor.net

Copyright (C) The Internet Society (2006).

This document is subject to the rights, licenses and restrictions contained in BCP 78, and except as set forth therein, the authors retain all their rights.

This document and the information contained herein are provided on an "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.


Intellectual Property ๐Ÿ”

The IETF takes no position regarding the validity or scope of any Intellectual Property Rights or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; nor does it represent that it has made any independent effort to identify any such rights. Information on the procedures with respect to rights in RFC documents can be found in BCP 78 and BCP 79.

Copies of IPR disclosures made to the IETF Secretariat and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of this specification can be obtained from the IETF on-line IPR repository at http://www.ietf.org/ipr.

The IETF invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights that may cover technology that may be required to implement this standard. Please address the information to the IETF at ietf-ipr@ietf.org.


Acknowledgement ๐ŸŒท

Funding for the RFC Editor function is provided by the IETF Administrative Support Activity (IASA).

๐Ÿ“ฆ where this page comes from