Basic MPLS and configuration: From JUNOS

  • MPLSs’ original goal was to increase the routers’ packet processing speed. But now, due to advancement in ASIC, it is primarily used for traffic engineering.
  • Terminologies:  LSP – Label switched path. A unidirectional logical link created by MPLS protocol.
  • LSR – Label switched Router. Each router participating in MPLS and can process MPLS header.
  • Ingress LSR –Entry point for user data traffic into MPLS. Upstream from perspective of data flow.
  • Egress LSR – End point of the LSP. Downstream to all other routers in the LSP.
  • Transit LSR – All routers in middle of LSP which performs label swap operation. 253 possible LSRs
  • Penultimate LSR – The immediate upstream of egress LSR. Typically perform label pop operation
  • Labels – 32 bit field between L2 and L3 header used by LSR.
    • First 20 bits has label value
    • Next 3 bits are Experimental bits used for Cos.
    • Next bit is Stacking bit[Bottom of stack]. 0 means other MPLS header follows and 1 if IP packet follows.
    • Next 8 bits: TTL. Used to prevent loop in MPLS network.
  • 0 to 15 labels are reserved:
    • 0 –Ipv4 Explicit NULL
    • 1 – Router Alert Label.
    • 2 – Ipv6 Explicit NULL
    • 3 – Implicit NULL. Used by egress LSR to notify its upstream to perform penultimate hop.
    • 4 – 15: Reserved for future.
  • LSPs can be established by either static configuration or by dynamic signaling protocols (RSVP,LDP)

RSVP Basics:

  • Resource Reservation protocol (RSVP) is method designed so that end hosts can reserve some capacity in network. But now it is primarily used within AS for MPLS LSP created.
  • The ingress router initiates ‘Path’ message towards egress router and each transit router process those message and creates a ‘soft state’ and forwards the path message towards egress router.
  • On receiving the path message, the egress router generates ‘Resv’ message and sent to upstream router. Actual resource reservation occurs at this point and each router forwards this to ingress LSR.
  • Once the ingress router receives the ‘Resv’ message, unidirectional LSP is established and maintained by sending Path and Resv messages every 30 seconds.
  • Other messages used by RSVP:
    • PathTear : Travels downstream towards egress router to remove the established soft state. Ingress router sends this when path is no longer needed. Transit router sends when outage.
    • ResvTear: Travels upstream towards ingress router to remove the established ‘Resv’ soft state. A transit router sends this when an outage occurs.
    • PathErr: Travels opposite to ‘Path’ message. Upstream to ingress router to denote error has occurred along established path. No soft state is removed by routers.
    • ResvErr: Travels opposite to ‘Resv’ message. Downstream to egress router to denote error has occurred along established path. No soft state is removed by routers.
    • ResvConf: Egress router might ask each node whether Resv message was received. This message act as ACK to above request.
  • RSVP extension:
    • Some TLVs are added to path/Resv messages to support MPLS. Above soft state database will be active for three minutes so if a router goes down, quicker response is unavailable.
    • Extended RSVP uses ‘hello mechanism’ to combat above problem. Each router sends hello message every 9 secs and if a router fails to receive the hello for 63 seconds, it assumes the other end is dead. Backward compatible with routers, not implementing hello mechanism.
    • ‘Message aggregation’ is supported where upto 30 RSVP messages can be bundled together.
    • Many ‘objects’ fields are added to RSVP to support MPLS LSP.
    • Explicit Route Object (ERO):
      • ERO allows path message to traverse the network using provided information that is independing of IGP shortest path. Two options are loose-hop and strict-hop.
      • Loose-hop allows routers to use a transit router which is not directly connected. IGP shortest path is consulted to reach the loose-hop.
      • Strict-hop allows us to make the LSP to traverse via specified transit routers. The next-hop router must be directly attached to local router for LSP to form.
      • Can have “strict-strict-loose” combination but not “strict-loose-strict”.
    • Label Request Object (LRP):
      • Encoded in path message so that transit routers allocates a label in ‘path soft state’. Once it receives Resv message, it advertise the label upstream via “Label Object”.
    • Record Route Object (RRO):
      • Used in both Path and Resv message for loop prevention. All routers adds its outgoing interface IP in RRO object while sending path/resv message. If it receives a message with its own IP address in this object, those RSVP messages are rejected.
    • Session Attribute object:
      • Used in ‘path’ message to control the priority, preemption, affinity class etc
    • Tspec object:
      • Used in ‘path’ messaged which has requested BW, max and min packet size supported along the path of LSP etc.
    • More objects and packets formats are discussed here.
  • Label Distribution protocol:
    • Neighbors are detected using hello mechanism. TCP session is established between neighbors on port 646 and labels are exchanged. More information here.

Configuration:

  • MPLS configuration involves two basic configuration followed by static/dynamic LSP configuration.
  • All interfaces are enabled to process MPLS headers by including “family mpls” command.
  • MPLS protocol is enabled and interfaces are added. “set protocols mpls interface all”. Once committed, three entries (reserved lables) are added to mpls.0 table. “show route table mpls.0”
  • Static LSP:
    • JUNOS set aside label values 16 through 1023 for static LSP.
    • Configuration required on both ingress and transit routers.
    • On ingress router inside “protocols mpls” hierarchy, configure the “static-path inet”. Example: “set static-path inet 1.1.1/24 push 100 next-hop 10.1.1.1”. This makes router to use label 100 and forwards it to it directly connected next-hop for prefix 1.1.1.0/24.
    • On transit routers, create a label-map on the interface to make swap operation. Example: “set interface e0.0 label-map 100 next-hop 10.1.2.2 swap 0”. This makes router to swap 100 with 0(null label) label received on interface e0.0 and forward it to 10.1.2.2 as IP packet.
  • Dynamic LSP:
    • Requires configuration only on ingress router.
    • Enable RSVP protocol and add all interfaces (only which has ‘family mpls’ command). “set protocols rsvp interfaces all”
    • On ingress router, we need minimum configuration of LSP name and address of egress router. Inside MPLS mode, configure “set label-switched-path <name> to <egress router >”
    • By default, JUNOS use information from traffic engineering database (TED) and constrained shortest path first (CSPF) algorithm to calculate path for dynamic LSP. To disable this, configure “set label-switched-path <name> no-cspf >”
    • To configure ERO, create a named-path and include in LSP config. “set path <path-name> <IP address> loose” and “set label-switched-path <name> primary < path-name>”
    • To set bandwidth for an LSP, configure “set label-switched-path <name> bandwidth <bps>”
  • Altering RSVP protocol parameters:
    • Below options are available within RSVP protocol configuration mode.
    • Hello interval: By default RSVP uses 9 seconds as hello-interval. Can be modified on interface basis using “set rsvp interface em0 hello-interval xx”
    • Hold timer = (2 x keep-multiplier + 1) hello intervals.
      • Default keep-multiplier value is 3. Can be set by “set rsvp keep-multiplier xx”
      • So, default hold timer calculates to 63 seconds.
      • RSVP neighbor loss also detected by interface status change.
    • For every ‘refresh-time’ period, routers will generate path/resv message to maintain soft state. By default, it is set to 30 seconds. Can be changed by “set rsvp refresh-time xx”
    • To enable aggregate negotiation with neighbor set “set rsvp interface em0 aggregate”
    • MD5 authentication can be enabled by “set rsvp interface em0 authentication-key xxx
    • By default 100% of physical interface bandwidth is allocated for RSVP reservation. To set an actual value “set rsvp interface em0 bandwidth 100m” or to set percentage of total bandwidth, configure “set rsvp interface em0 subscription 50” to allocate 50% of BW.
  • Routing table integration:
    • By default, JUNOS associates IP routes to established dynamic LSP.
    • RSVP information is installed in inet.3 table
    • When BGP attempts to place a router in inet.0, it examines both inet.3 (populated by RSVP) as well as inet.0 (populated by IGP) for next-hop resolution.
    • JUNOS uses lowest preference match route. RSVP installs route with preference value of 7, OSPF with value of 10 and ISIS with values of both 15 and 18. So, RSVPs’ dynamic LSPs will be used by default. Even if the preference values are same, JUNOS prefers inet.3 table.
    • To assign LSP as next-hop to reach a BGP prefix. “set label-switched-path <name> install 3.3.3.3”. This will install the LSP as next-hop to reach 3.3.3.3 in inet.3 table so that it can be used for BGP next-hop resolution.
    • To assign LSP as next-hop to reach a non-BGP prefix. ““set label-switched-path <name> install 3.3.3.3 active”. The ‘active’ option installs the LSP as next-hop in inet.0 table.
  • Commonly used show commands:
    • Show mpls interface – to view mpls state and administrative group of all interfaces.
    • Show mpls lsp extensive – for detailed view of MPLS LSP
    • show rsvp interface – to view rsvp state, available and reserved BW for all interfaces.
    • show rsvp neighbor – to view RSVP neighbors
    • show rsvp version – to view keep-multiplier, refresh-timer value and protocol status
    • show route table inet.3 – to view RSVP installed LSPs
    • show route table mpls – to view mpls label map.

Basic MPLS Sample Configuration:

root> show configuration interfaces

em0 {

unit 0 {

family inet {

address 10.1.2.2/24;

}

family mpls; ##  MPLS enabled on physical interface

}

}

lo0 {

unit 0 {

family inet {

address 2.2.2.2/32;

}

}

}

root> show configuration protocols

rsvp {

refresh-time 10; ##Refresh timer set to 10. Default 30.

keep-multiplier 2; ## Keep-multiplier set to 2. Default 3.

interface em0.0 {

hello-interval 10; ## Hello interface set to 10. Default 3 seconds

bandwidth 700m;  ## 700m of total interface BW is allocated for RSVP

}

interface em1.0 {

aggregate; ## To support message aggregation

subscription 50; ## 50% of total interface BW is allocated for RSVP

}

interface em2.0 {

authentication-key “$9$O1juIEyVb2oZjlKX-Vb2gfTQ”; ## SECRET-DATA # MD5

}

}

mpls {

label-switched-path to-R1 { ### Created LSP with name “to-R1”

to 1.1.1.1; ## Egress router IP is set. Reachable via IGP.

install 5.5.5.5/32 active; ### Make this LSP as next-hop in inet.0 table

no-cspf;  ### No CSPF to calculate path

primary via-R0; ## ERO

}

path via-R0 { ## Path name list with ‘loose’ option

100.100.100.100 loose;

}

static-path inet { ## configure static LSP

10.2.1.0/24 {

next-hop 10.2.2.1;

push 20; ## Push label 20 for packets destined to 10.2.1.0 with next-hop as above

}

}

interface all; ## all interfaces are included in MPLS protocol

interface em0.0 {

label-map 1000100 {

next-hop 10.2.2.1; ### transit router configuration in static LSP

swap 300;

}

}

}

ospf {

traffic-engineering;

export to-ospf;

area 0.0.0.0 {

interface all;

}

}

Advertisements
This entry was posted in jncis, Junos, ldp, mpls, rsvp and tagged , . Bookmark the permalink.

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s