Juniper

Behavior of UHP and PHP on JunOS

The behavior of Penultimate Hop Popping (PHP) and Ultimate HOP Popping (UHP) in MPLS Networks

Functional Overview:

An MPLS-enabled network gives the network engineer precise control over how traffic flows from source to destination. To provide this control, MPLS allows packets to move independently of the IGP routing algorithms native to the network being crossed. To accomplish this, MPLS relies on predefined paths, known as LSPs.

LSPs are composed of connections between MPLS-enabled routers. A router that is running MPLS is known as a label-switching router (LSR). LSRs tag each packet passing through the LSP with a label. This label accomplishes several things, the most important of which is distinguishing the MPLS packet from a regular IP packet, thereby entitling the packet to continue crossing each LSR along the LSP without being subjected to Layer 3 scrutiny. The packet’s label is changed by the LSR at every hop, hence the name label-switching router.

JUNOS uses MPLS as the foundation for two types of services: traffic engineering and RFC 2547bis (BGP/MPLS) VPNs.

Labels

Labels are a way of marking packets destined for a specific address. Packets are assigned labels by LSRs. Once they are assigned labels, they can be forwarded through the network to the next LSR along a preconfigured path . When the packet arrives at an LSR, the label distinguishes this packet from other IP traffic and allows it to be handled by the MPLS protocol. This form of packet distinction permits the MPLS protocol to function on the same interfaces as the native IGP without interfering with the IGP’s routing calculations or processes.

The following list defines the label fields:

20-bit label field – This is the actual label value itself. This is where the label value is inserted.

3-bit experimental field – These bits are used for CoS. They are defined as experimental because a concrete decision has not yet been reached as to which version of CoS they will support (IP Precedence or Differentiated Services).

1-bit stacking field – This field value is either 1 or 0. A value of 1 denotes the label is the bottom of a label stack. A value of 0 indicates that there are multiple labels stacked on this packet.

8-bit TTL field – In some situations the value in this field is copied from the IP header TTL field. This is decremented as it passes through MPLS hops. When the label is popped, this value can overwrite the IP header TTL field.

mpls

MPLS Label Format

This above picture shows the positioning of the MPLS label with regard to a typical IP packet. The diagram shows that the label resides between the Layer 2 frame and Layer 3 packet.

The use and introduces two previously unmentioned terms, penultimate hop popping (PHP) and ultimate hop popping (UHP).

JUNOS MPLS Label Values

Label Value         Label Use
0 IPv4 Explicit NULL Label ”When receiving a label of level 0, the local system must pop the MPLS stack and route the packet by traditional IPv4 routing. This is known as ultimate hop popping (UHP).
1 Router Alert Label ”Similar use as the Router Alert Option in IP packets. This level would signal the local system to send the packet to a local software module for processing.
2 IPv6 Explicit NULL Label ”When receiving a label of level 2, the local system must pop the MPLS stack and route the packet by traditional IPv6 routing
3 Implicit NULL Label ”This label is used to signal the penultimate LSR (the one before the egress LSR) to pop the MPLS stack. This is known as penultimate hop popping (PHP).
4-15 This level is reserved by RFC standards.
16-1,023 These labels are not used by JUNOS in the automated process of creating labels for an LSP. The administrator uses these labels when defining static LSPs. This eliminates the possibility of dual assignments by JUNOS when establishing labels for LSPs.
1,024-99,999 This level is reserved in JUNOS for future support, but can currently be used by the administrator when defining static LSPs.
100,000-799,999 These are per-box labels assigned by JUNOS when establishing labels for LSPs.
800,000-1,048,575 JUNOS uses this level for per-interface labels.

 

Value Description Reference
0 IPv4 Explicit NULL Label [RFC3032]
1 Router Alert Label [RFC3032]
2 IPv6 Explicit NULL Label [RFC3032]
3 Implicit NULL Label [RFC3032]
  4-6 Unassigned
7 Entropy Label Indicator (ELI) [RFC6790]
8-12 Unassigned
13 GAL Label [RFC5586]
14 OAM Alert Label [RFC3429]
15 Unassigned

The combination of label number and inbound interface is cross-referenced against a table to determine the outbound interface and label. Once these have been determined, three common operations can be performed by LSRs on labels:

Push  = The MPLS label is added to packets and the packets are forwarded along the LSP. This operation is performed as the packet enters the LSP.

Swap  =  The MPLS label is changed as the packet carrying it passes through an LSR. This process is performed at each transit hop along the LSP.

Pop = The MPLS label is removed from the packet and a normal IP packet is forwarded by the LSR. This process is performed by the penultimate (second-to-last) LSR.

The MPLS label on a switched packet is popped by either the egress router or the penultimate router, depending on your configuration.

The Main Difference in UHP and PHP:

If you use ultimate hop popping where the egress router pops the MPLS labels, all those flows and all those packets need to be processed by a single router. If you have a lot of LSPs with a lot of traffic, this step can be resource-intensive.

If you decide to use penultimate hop popping, you essentially terminate the LSP one hop earlier. The MPLS labels are popped by the routers that connect to the egress router, rather than all of them being popped by the same egress router. You can effectively divide and conquer when it comes to label popping, which helps avoid running out of resources during heavy loads.

Now, Lets discuss some of the working and non-working conditions using PHP and UHP in the MPLS Network:

Topology:

Screen Shot 2017-09-06 at 7.07.04 PM

Case Studies:

Case 1: 

Normal default setup  == PHP is happening on r2 (r5-r1) and r4 (r1-r5)

regress@r1:R4# run show route table mpls.0
mpls.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden)
+ = Active Route, – = Last Active, * = Both

0                  *[MPLS/0] 02:26:00, metric 1
Receive
1                  *[MPLS/0] 02:26:00, metric 1
Receive
2                  *[MPLS/0] 02:26:00, metric 1
Receive
13                 *[MPLS/0] 02:26:00, metric 1
Receive
299840             *[RSVP/7/1] 00:59:48, metric 1
> to 50.1.1.2 via ge-0/0/3.50, label-switched-path r1-to-r5
299840(S=0)        *[RSVP/7/1] 00:59:48, metric 1
> to 50.1.1.2 via ge-0/0/3.50, label-switched-path r1-to-r5
299856             *[RSVP/7/1] 00:59:48, metric 1
> to 40.1.1.2 via ge-0/0/2.40, label-switched-path r5-to-r1

regress@r1:R4# run show route table mpls.0 label 299840 extensive
mpls.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden)
299840 (1 entry, 1 announced)

TSI:

KRT in-kernel 299840 /52 -> {Pop       Flags acct}
*RSVP   Preference: 7/1
Next hop type: Router, Next hop index: 1067
Address: 0x95561dc
Next-hop reference count: 3
Next hop: 50.1.1.2 via ge-0/0/3.50 weight 0x1, selected
Label-switched-path r1-to-r5
Label operation: Pop                        <<<<  pop
Load balance label: None;
Session Id: 0x200001
State: <Active Int AckRequest Accounting>
Local AS: 65000
Age: 1:00:06    Metric: 1
Validation State: unverified
Task: RSVP
Announcement bits (1): 1-KRT
AS path: I

299840(S=0) (1 entry, 1 announced)
TSI:
KRT in-kernel 299840 /56 -> {Pop       Flags acct}
*RSVP   Preference: 7/1
Next hop type: Router, Next hop index: 1068
Address: 0x9555c9c
Next-hop reference count: 2
Next hop: 50.1.1.2 via ge-0/0/3.50 weight 0x1, selected
Label-switched-path r1-to-r5
Label operation: Pop                        <<<<  pop
Load balance label: None;
Session Id: 0x200001
State: <Active Int AckRequest Accounting>
Local AS: 65000
Age: 1:00:06    Metric: 1
Validation State: unverified
Task: RSVP
Announcement bits (1): 1-KRT
AS path: I

Case 2:

Explicit-null on egress  [ UHP is happening on r5 (r5-r1) and r1 (r1-r5)]

regress@r1:R5# set protocols mpls explicit-null
regress@r1:R1# set protocols mpls explicit-null

regress@r1:R5# run show route table mpls.0                        <<<<  on R5
mpls.0: 4 destinations, 4 routes (4 active, 0 holddown, 0 hidden)
+ = Active Route, – = Last Active, * = Both
0                  *[MPLS/0] 04:01:40, metric 1
Receive
1                  *[MPLS/0] 04:01:40, metric 1
Receive
2                  *[MPLS/0] 04:01:40, metric 1
Receive
13                 *[MPLS/0] 04:01:40, metric 1
Receive

regress@r1:R1# run show route table mpls.0                        <<<<  on R1
mpls.0: 4 destinations, 4 routes (4 active, 0 holddown, 0 hidden)
+ = Active Route, – = Last Active, * = Both
0                  *[MPLS/0] 03:54:28, metric 1
Receive
1                  *[MPLS/0] 03:54:28, metric 1
Receive
2                  *[MPLS/0] 03:54:28, metric 1
Receive
13                 *[MPLS/0] 03:54:28, metric 1
Receive

regress@r1:R4# run show route table mpls.0                        <<<<  on R4
mpls.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden)
+ = Active Route, – = Last Active, * = Both
0                  *[MPLS/0] 04:05:21, metric 1
Receive
1                  *[MPLS/0] 04:05:21, metric 1
Receive
2                  *[MPLS/0] 04:05:21, metric 1
Receive
13                 *[MPLS/0] 04:05:21, metric 1
Receive
299920             *[RSVP/7/1] 00:33:55, metric 1
> to 50.1.1.2 via ge-0/0/3.50, label-switched-path r1-to-r5
299920(S=0)        *[RSVP/7/1] 00:33:55, metric 1
> to 50.1.1.2 via ge-0/0/3.50, label-switched-path r1-to-r5
299936             *[RSVP/7/1] 00:33:31, metric 1
> to 40.1.1.2 via ge-0/0/2.40, label-switched-path r5-to-r1

 

regress@r1:R4# run show route table mpls.0 label 299920 extensive
mpls.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden)
299920 (1 entry, 1 announced)
TSI:

KRT in-kernel 299920 /52 -> {Swap 0 Flags acct}
*RSVP   Preference: 7/1
Next hop type: Router, Next hop index: 870
Address: 0x9555c9c
Next-hop reference count: 3
Next hop: 50.1.1.2 via ge-0/0/3.50 weight 0x1, selected
Label-switched-path r1-to-r5
Label operation: Swap 0                        <<<<  Sending label 0 (swap)
Load balance label: Label 0: None;
Session Id: 0x200001
State: <Active Int AckRequest Accounting>
Local AS: 65000
Age: 35:11      Metric: 1
Validation State: unverified
Task: RSVP
Announcement bits (1): 1-KRT
AS path: I

299920(S=0) (1 entry, 1 announced)
TSI:
KRT in-kernel 299920 /56 -> {Pop       Flags acct}
*RSVP   Preference: 7/1
Next hop type: Router, Next hop index: 871
Address: 0x9556284
Next-hop reference count: 2
Next hop: 50.1.1.2 via ge-0/0/3.50 weight 0x1, selected
Label-switched-path r1-to-r5
Label operation: Pop                        <<<<  POP
Load balance label: None;
Session Id: 0x200001
State: <Active Int AckRequest Accounting>
Local AS: 65000
Age: 35:11      Metric: 1
Validation State: unverified
Task: RSVP
Announcement bits (1): 1-KRT
AS path: I

 

regress@r1:R2# run show route table mpls.0 label 299936 extensive
mpls.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden)
299936 (1 entry, 1 announced)
TSI:

KRT in-kernel 299936 /52 -> {Swap 0 Flags acct}
*RSVP   Preference: 7/1
Next hop type: Router, Next hop index: 1069
Address: 0x9556620
Next-hop reference count: 3
Next hop: 10.1.1.1 via ge-0/0/3.10 weight 0x1, selected
Label-switched-path r5-to-r1
Label operation: Swap 0                        <<<<  Sending label 0 (swap)
Load balance label: Label 0: None;
Session Id: 0x100002
State: <Active Int AckRequest Accounting>
Local AS: 65000
Age: 37:50      Metric: 1
Validation State: unverified
Task: RSVP
Announcement bits (1): 1-KRT
AS path: I

299936(S=0) (1 entry, 1 announced)
TSI:

KRT in-kernel 299936 /56 -> {Pop       Flags acct}
*RSVP   Preference: 7/1
Next hop type: Router, Next hop index: 1070
Address: 0x95566c8
Next-hop reference count: 2
Next hop: 10.1.1.1 via ge-0/0/3.10 weight 0x1, selected
Label-switched-path r5-to-r1
Label operation: Pop                        <<<<  POP operation
Load balance label: None;
Session Id: 0x100002
State: <Active Int AckRequest Accounting>
Local AS: 65000
Age: 37:50      Metric: 1
Validation State: unverified
Task: RSVP
Announcement bits (1): 1-KRT
AS path: I

 Case 3  ::: Only “ultimate-hop-popping” on 2nd last router  == Not working

  regress@r1:R4# set protocols mpls ultimate-hop-popping
regress@r1:R4# run show route table mpls.0

mpls.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden)
+ = Active Route, – = Last Active, * = Both
0                  *[MPLS/0] 04:22:31, metric 1
Receive
1                  *[MPLS/0] 04:22:31, metric 1
Receive
2                  *[MPLS/0] 04:22:31, metric 1
Receive
13                 *[MPLS/0] 04:22:31, metric 1
Receive
299952             *[RSVP/7/1] 00:03:00, metric 1
> to 50.1.1.2 via ge-0/0/3.50, label-switched-path r1-to-r5
299952(S=0)        *[RSVP/7/1] 00:03:00, metric 1
> to 50.1.1.2 via ge-0/0/3.50, label-switched-path r1-to-r5
299968             *[RSVP/7/1] 00:02:56, metric 1
> to 40.1.1.2 via ge-0/0/2.40, label-switched-path r5-to-r1

regress@r1:R4# run show route table mpls.0 label 299952 extensive
mpls.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden)
299952 (1 entry, 1 announced)
TSI:

KRT in-kernel 299952 /52 -> {Pop       Flags acct}
*RSVP   Preference: 7/1
Next hop type: Router, Next hop index: 872
Address: 0x9556428
Next-hop reference count: 3
Next hop: 50.1.1.2 via ge-0/0/3.50 weight 0x1, selected
Label-switched-path r1-to-r5
Label operation: Pop                        <<<<  pop operation
Load balance label: None;
Session Id: 0x200001
State: <Active Int AckRequest Accounting>
Local AS: 65000
Age: 3:19       Metric: 1
Validation State: unverified
Task: RSVP
Announcement bits (1): 1-KRT
AS path: I

299952(S=0) (1 entry, 1 announced)

TSI:
KRT in-kernel 299952 /56 -> {Pop       Flags acct}
*RSVP   Preference: 7/1
Next hop type: Router, Next hop index: 871
Address: 0x9556284
Next-hop reference count: 2
Next hop: 50.1.1.2 via ge-0/0/3.50 weight 0x1, selected
Label-switched-path r1-to-r5
Label operation: Pop                        <<<<  pop operation (no swap)
Load balance label: None;
Session Id: 0x200001
State: <Active Int AckRequest Accounting>
Local AS: 65000
Age: 3:19       Metric: 1
Validation State: unverified
Task: RSVP
Announcement bits (1): 1-KRT

 

regress@r1:R5# run show route table mpls.0
mpls.0: 4 destinations, 4 routes (4 active, 0 holddown, 0 hidden)
+ = Active Route, – = Last Active, * = Both
0                  *[MPLS/0] 04:35:42, metric 1
Receive
1                  *[MPLS/0] 04:35:42, metric 1
Receive
2                  *[MPLS/0] 04:35:42, metric 1
Receive
13                 *[MPLS/0] 04:35:42, metric 1
Receive

 Case4 :: Explicit-null on egress routers n ultimate-hop-popping   ” on 2nd last router  == working fine…

With explicit on the egress router last routers and configure “ultimate-hop-popping ” on 2nd last router ==>> Works fine -> 2nd last router swapping with label 0

 regress@r1:R4# run show route table mpls.0                        <<<<  on R4
mpls.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden)
+ = Active Route, – = Last Active, * = Both
0                  *[MPLS/0] 04:38:57, metric 1
Receive
1                  *[MPLS/0] 04:38:57, metric 1
Receive
2                  *[MPLS/0] 04:38:57, metric 1
Receive
13                 *[MPLS/0] 04:38:57, metric 1
Receive
299984             *[RSVP/7/1] 00:00:13, metric 1
> to 50.1.1.2 via ge-0/0/3.50, label-switched-path r1-to-r5
299984(S=0)        *[RSVP/7/1] 00:00:13, metric 1
> to 50.1.1.2 via ge-0/0/3.50, label-switched-path r1-to-r5
300000             *[RSVP/7/1] 00:00:04, metric 1
> to 40.1.1.2 via ge-0/0/2.40, label-switched-path r5-t

regress@r1:R4# run show route table mpls.0 label 299984 extensive
mpls.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden)
299984 (1 entry, 1 announced)
TSI:

KRT in-kernel 299984 /52 -> {Swap 0 Flags acct}
*RSVP   Preference: 7/1
Next hop type: Router, Next hop index: 877
Address: 0x9556524
Next-hop reference count: 3
Next hop: 50.1.1.2 via ge-0/0/3.50 weight 0x1, selected
Label-switched-path r1-to-r5
Label operation: Swap 0                        <<<<  swap 0
Load balance label: Label 0: None;
Session Id: 0x200001
State: <Active Int AckRequest Accounting>
Local AS: 65000
Age: 2:03       Metric: 1
Validation State: unverified
Task: RSVP
Announcement bits (1): 1-KRT
AS path: I

299984(S=0) (1 entry, 1 announced)

TSI:
KRT in-kernel 299984 /56 -> {Pop       Flags acct}
*RSVP   Preference: 7/1
Next hop type: Router, Next hop index: 871
Address: 0x9556284
Next-hop reference count: 2
Next hop: 50.1.1.2 via ge-0/0/3.50 weight 0x1, selected
Label-switched-path r1-to-r5
Label operation: Pop                        <<<<  POP
Load balance label: None;
Session Id: 0x200001
State: <Active Int AckRequest Accounting>
Local AS: 65000
Age: 2:03       Metric: 1
Validation State: unverified
Task: RSVP
Announcement bits (1): 1-KRT
AS path: I

regress@r1:R5# run show route table mpls.0
mpls.0: 4 destinations, 4 routes (4 active, 0 holddown, 0 hidden)
+ = Active Route, – = Last Active, * = Both
0                  *[MPLS/0] 04:37:55, metric 1
Receive
1                  *[MPLS/0] 04:37:55, metric 1
Receive
2                  *[MPLS/0] 04:37:55, metric 1
Receive
13                 *[MPLS/0] 04:37:55, metric 1
Receive

Case5:: UHP n explicit null on R5 ==>>  Works fine  

regress@r1:R5# run show route table mpls.0
mpls.0: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden)
+ = Active Route, – = Last Active, * = Both
0                  *[MPLS/0] 04:51:26, metric 1
Receive
1                  *[MPLS/0] 04:51:26, metric 1
Receive
2                  *[MPLS/0] 04:51:26, metric 1
Receive
13                 *[MPLS/0] 04:51:26, metric 1
Receive
299792             *[RSVP/0] 00:01:27
to table inet.0, label-switched-path r1-to-r5
299792(S=0)        *[RSVP/0] 00:01:27
to table mpls.0

regress@r1:R5# run show route table mpls.0 label 299792 extensive
mpls.0: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden)
299792 (1 entry, 1 announced)

TSI:
KRT in-kernel 299792 /52 -> {Table Flags acct}
*RSVP   Preference: 0
Next hop:
Next table: inet.0
Label-switched-path r1-to-r5
Label operation: Pop                        <<<<  POP on R5
Load balance label: None;
Address: 0x9556674
Next-hop reference count: 4
State: <Active Int Accounting>
Local AS: 65000
Age: 2:16
Validation State: unverified
Task: RSVP
Announcement bits (1): 1-KRT
AS path: I

299792(S=0) (1 entry, 1 announced)

TSI:
KRT queued (deferred) add
299792 /56 -> {Table}
*RSVP   Preference: 0
Next hop:
Next table: mpls.0
Address: 0x95566c8
Next-hop reference count: 2
State: <Active Int Accounting>
Local AS: 65000|
Age: 2:16
Validation State: unverified
Task: RSVP
Announcement bits (1): 1-KRT
AS path: I

regress@r1:R4# run show route table mpls.0
mpls.0: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden)
+ = Active Route, – = Last Active, * = Both
0                  *[MPLS/0] 04:54:29, metric 1
Receive
1                  *[MPLS/0] 04:54:29, metric 1
Receive
2                  *[MPLS/0] 04:54:29, metric 1
Receive
13                 *[MPLS/0] 04:54:29, metric 1
Receive
300016             *[RSVP/7/1] 00:02:00, metric 1
> to 40.1.1.2 via ge-0/0/2.40, label-switched-path r5-to-r1
300032             *[RSVP/7/1] 00:01:53, metric 1
> to 50.1.1.2 via ge-0/0/3.50, label-switched-path r1-to-r5

regress@r1:R4# run show route table mpls.0 label 300032 extensive
mpls.0: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden)
300032 (1 entry, 1 announced)
TSI:
KRT in-kernel 300032 /52 -> {Swap 299792 Flags acct}
*RSVP   Preference: 7/1
Next hop type: Router, Next hop index: 1069
Address: 0x95566c8
Next-hop reference count: 3
Next hop: 50.1.1.2 via ge-0/0/3.50 weight 0x1, selected
Label-switched-path r1-to-r5                Label operation: Swap 299792                         <<<<  swapping Operation
Load balance label: Label 299792: None;
Session Id: 0x200001
State: <Active Int AckRequest Accounting>
Local AS: 65000
Age: 3:49       Metric: 1
Validation State: unverified
Task: RSVP
Announcement bits (1): 1-KRT
AS path: I

Result of the above tests performed to check the behvior of PHP and UHP on Juniper Junos Platform in MPLS Network:

  1. PHP default = works fine  
  1. Explicit null on R5 = works fine  
  1. Explicit null on R5 and UHP on R4 = works fine 
  1. UHP on R4 = Does not work    
  1. UHP n explicit null on R5  = works fine  

 

Advertisements

Categories: Juniper, MPLS

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s