Uploaded image for project: 'bgpcep'
  1. bgpcep
  2. BGPCEP-178

Processing of M flag is not correct for SR-ERO subobject

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Resolution: Done
    • Bugzilla Migration
    • Bugzilla Migration
    • PCEP
    • None
    • Operating System: All
      Platform: All

    • 2534

    Description

      As per the PCEP drafts(https://tools.ietf.org/html/draft-sivabalan-pce-segment-routing-03#page-9), SID value represents an MPLS label stack entry as specified as RFC5462.

      M: When this bit is set, the SID value represents an MPLS label
      stack entry as specified in [RFC5462] where only the label
      value is specified by the PCE. Other fields (TC, S, and TTL)
      fields MUST be considered invalid, and PCC MUST set these
      fields according to its local policy and MPLS forwarding rules

      This means MPLS label stack entry has the following 32 bit format where first 20 bits are the label and other 12 bits are the TC, S and TTL values.

      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
      + Label

      Label TC S TTL Stack
      + Entry

      Label: Label Value, 20 bits
      TC: Traffic Class field, 3 bits
      S: Bottom of Stack, 1 bit
      TTL: Time to Live, 8 bits

      But the code(SrEroSubobjectParser.java) does not process the M flag correctly.

      I correct it as following, please review.
      public void serializeSubobject(Subobject subobject, final ByteBuf buffer) {
      if (srEroSubobject.getSid() != null && !flags.isS())

      { long sid = srEroSubobject.getSid(); if (flags.isM()) sid = sid << 12; writeUnsignedInt(sid, body); }

      }

      public Subobject parseSubobject(ByteBuf buffer, boolean loose) throws PCEPDeserializerException {
      if (!flags.isS())

      { long sid = buffer.readUnsignedInt(); if (flags.isM()) sid = sid >> 12; srEroSubobjectBuilder.setSid(sid); }

      }

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            milos.fabian@pantheon.tech Milos Fabian
            bin.b.pan@ericsson.com Bin Pan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: