[BGPCEP-178] Processing of M flag is not correct for SR-ERO subobject Created: 23/Dec/14  Updated: 03/Mar/19  Resolved: 23/Jan/15

Status: Resolved
Project: bgpcep
Component/s: PCEP
Affects Version/s: Bugzilla Migration
Fix Version/s: Bugzilla Migration

Type: Bug
Reporter: Bin Pan Assignee: Milos Fabian
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


External issue ID: 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); }

}



 Comments   
Comment by Dana Kutenicsova [ 19/Jan/15 ]

https://git.opendaylight.org/gerrit/#/c/14246/

Comment by Dana Kutenicsova [ 19/Jan/15 ]

Resolved for stable/helium

Comment by Milos Fabian [ 21/Jan/15 ]

incorporated in draft-update patch for Lithium
https://git.opendaylight.org/gerrit/#/c/13716/

Generated at Wed Feb 07 19:12:16 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.