It’s been a while since I wrote a Junos post… there are a few things that I’ve been meaning to write up for a while, so this series will focus on MPLS label switched paths (LSP) and how to put traffic on to an LSP.
By default IGPs won’t use an LSP, so this 1st part focuses on what you’ll need to configure should you want both BGP and IGP traffic forwarding to use LSPs.
Later parts will look at other options available in Junos to forward traffic via an LSP, and more advanced topics e.g. LSP selection based on BGP extended community.
I’ll start with a quick recap of the Junos routing tables – inet.0, inet.3 and mpls.0
Junos Routing Tables (IPv4)
inet.0
Table inet.0 is the primary unicast routing table used by IPv4. It’s where IGPs will resolve next hops.
inet.3
Table inet.3 is the routing table populated by MPLS protocols such as RSVP or LDP. A lookup here will result in a label being pushed.
It’s also worth noting that inet.3 is used by BGP to resolve BGP next-hops. BGP examines both inet.3 and inet.0, choosing a next-hop based on the lowest Junos preference value. In case of a tie, inet.3 is used.
mpls.0
This is the MPLS label switching table and is used by label switch routers. Routers along the LSP will use this table to swap and pop labels as appropriate.
Lab Topology
For this lab, I’ll be using the topology below.
Software revisions are as follows
- CE Routers (CE1, CE2): IOS (Cisco 7200 12.4(24)T)
- P Routers (R1, R2, R3, R4, R5): IOS (Cisco 7200 12.4(24)T)
- PE Routers (Junos1, Junos2): Junos (Olive 12.3R5.7)
The base configurations are using OSPF as the routing protocol and LDP to exchange transport labels.
LSP Traffic Forwarding
Default MPLS forwarding on Cisco and Juniper
Let’s have a look at Junos1 and R4 and see how traffic would be forwarded by default.
Junos1
102.102.102.102 is an IP address assigned to the Looback0 on CE2. Let’s take a look at the routing table on Junos1:
root@R6-Junos1> show route 102.102.102.102 inet.0: 21 destinations, 21 routes (21 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 102.102.102.102/32 *[OSPF/150] 00:08:21, metric 0, tag 0 > to 192.168.46.4 via em0.0 inet.3: 14 destinations, 14 routes (14 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 102.102.102.102/32 *[LDP/9] 00:04:32, metric 1 > to 192.168.46.4 via em0.0, Push 28
Table inet.0 contains only the OSPF leant route. Remember that although there is a LDP route in table inet.3, it won’t be used for IGP route lookups, and we can verify this with a look at the forwarding table for prefix 102.102.102.102.
root@R6-Junos1> show route forwarding-table destination 102.102.102.102 Routing table: default.inet Internet: Destination Type RtRef Next hop Type Index NhRef Netif 102.102.102.102/32 user 0 192.168.46.4 ucst 555 30 em0.0
Note that type is “ucst”, if the traffic was to be labelled it would say “Push” followed by the label number to be pushed.
Therefore IPv4 unicast traffic by default on Junos will not be labelled.
R4
Now let’s take a look at R4
R4#show mpls forwarding-table 102.102.102.102 Local Outgoing Prefix Bytes Label Outgoing Next Hop Label Label or VC or Tunnel Id Switched interface 28 29 102.102.102.102/32 \ 0 Fa1/0 192.168.34.3 R4#sh ip cef 102.102.102.102 detail 102.102.102.102/32, epoch 0 local label info: global/28 nexthop 192.168.34.3 FastEthernet1/0 label 29
R4 shows a very different story – traffic will be labelled, and will push label 29.
Also note that R4 expects labelled traffic going to 102.102.102.102 to be received with label 28.
Verification
Let’s verify this situation with a traceroute on Junos1
root@R6-Junos1> traceroute 102.102.102.102 traceroute to 102.102.102.102 (102.102.102.102), 30 hops max, 40 byte packets 1 192.168.46.4 (192.168.46.4) 8.855 ms 2.253 ms 4.572 ms 2 192.168.34.3 (192.168.34.3) 28.783 ms 26.034 ms 28.780 ms MPLS Label=29 CoS=0 TTL=1 S=1 3 192.168.35.5 (192.168.35.5) 27.265 ms 25.306 ms 28.669 ms MPLS Label=28 CoS=0 TTL=1 S=1 4 192.168.57.7 (192.168.57.7) 29.321 ms 26.853 ms 28.707 ms 5 192.168.102.1 (192.168.102.1) 34.871 ms 30.649 ms 33.596 ms
Well that’s pretty clear that the 1st hop traffic from Junos was not labelled, and traffic from the IOS box R4 was labelled. The egress label applied for the R4->R3 traffic was label 29 as expected.
So what if we want Junos to forward IGP traffic via an LSP? Well there are a couple of MPLS configuration options: traffic-engineering bgp-igp and mpls-forwarding.
traffic-engineering bgp-igp
Traffic-engineering bgp-igp configures BGP and the IGPs to use LSPs for forwarding traffic destined for egress routers. The bgp-igp option causes all inet.3 routes to be moved to the inet.0 routing table.
root@R6-Junos1# show | compare [edit protocols mpls] + traffic-engineering bgp-igp; root@R6-Junos1> show route 102.102.102.102 inet.0: 21 destinations, 35 routes (21 active, 0 holddown, 0 hidden) @ = Routing Use Only, # = Forwarding Use Only + = Active Route, - = Last Active, * = Both 102.102.102.102/32 *[LDP/9] 00:00:33, metric 1 > to 192.168.46.4 via em0.0, Push 28 [OSPF/150] 00:00:33, metric 0, tag 0 > to 192.168.46.4 via em0.0
The LDP route and the OSPF route are now in table inet.0, and the LDP route with preference 9 is now the best route.
The traceroute should now show the 1st hop being labelled – let’s see:
root@R6-Junos1> traceroute 102.102.102.102 traceroute to 102.102.102.102 (102.102.102.102), 30 hops max, 40 byte packets 1 192.168.46.4 (192.168.46.4) 30.523 ms 28.792 ms 28.561 ms MPLS Label=28 CoS=0 TTL=1 S=1 2 192.168.34.3 (192.168.34.3) 28.502 ms 26.692 ms 28.756 ms MPLS Label=29 CoS=0 TTL=1 S=1 3 192.168.35.5 (192.168.35.5) 28.296 ms 26.501 ms 28.403 ms MPLS Label=28 CoS=0 TTL=1 S=1 4 192.168.57.7 (192.168.57.7) 28.205 ms 26.365 ms 28.581 ms 5 192.168.102.1 (192.168.102.1) 33.717 ms 30.332 ms 33.996 ms
Spot on – and the 1st hop label is 28, as expected.
traffic-engineering mpls-forwarding
traffic-engineering bgp-igp will allow high-priority LSPs to supersede IGP routes in the inet.0 routing table. Essentially this means that the active route might not be the IGP route, and therefore IGP routing might not be as expected, e.g. routing policy routes may not be matched.
The mpls-forwarding option enables LSPs to be used for forwarding but not route selection. Routes are added to both the inet.0 and inet.3 routing tables.
Let’s take a look at the routing table with the mpls-forwarding option in place:
root@R6-Junos1> show route 102.102.102.102 inet.0: 21 destinations, 35 routes (21 active, 0 holddown, 0 hidden) @ = Routing Use Only, # = Forwarding Use Only + = Active Route, - = Last Active, * = Both 102.102.102.102/32 @[OSPF/150] 00:03:56, metric 0, tag 0 > to 192.168.46.4 via em0.0 #[LDP/9] 00:00:02, metric 1 > to 192.168.46.4 via em0.0, Push 28 inet.3: 14 destinations, 14 routes (14 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 102.102.102.102/32 *[LDP/9] 00:00:02, metric 1 > to 192.168.46.4 via em0.0, Push 28
Note that both the OSPF routes and the LDP routes a present in table inet.0 but the OSPF route is marked “Routing Use Only” and the LDP route “Forwarding Use Only”.
Therefore the outcome for traffic forwarding will be the identical to “bgp-igp”:
root@R6-Junos1> traceroute 102.102.102.102 traceroute to 102.102.102.102 (102.102.102.102), 30 hops max, 40 byte packets 1 192.168.46.4 (192.168.46.4) 28.526 ms 28.594 ms 29.658 ms MPLS Label=28 CoS=0 TTL=1 S=1 2 192.168.34.3 (192.168.34.3) 28.161 ms 26.584 ms 28.419 ms MPLS Label=29 CoS=0 TTL=1 S=1 3 192.168.35.5 (192.168.35.5) 28.882 ms 25.807 ms 28.394 ms MPLS Label=28 CoS=0 TTL=1 S=1 4 192.168.57.7 (192.168.57.7) 28.521 ms 26.170 ms 28.564 ms 5 192.168.102.1 (192.168.102.1) 34.301 ms 31.283 ms 34.266 ms
The difference can be noted when we are matching against a protocol in a routing policy.
In the second part in this series, I will look at BGP forwarding via an LSP, and will also demonstrate how these two MPLS options affect route redistribution from OSPF to BGP.