Cisco vs Juniper MPLS

Genel olarak etiket atama, anons etme ve routing/adj tablolarında farklar vardır. Cisco BGP hariç IGP tablosundaki tüm prefixler için etiket atar ve anons eder. Ayrıca L3MPLS VPN için her prefix için bir etiket atar. Juniper ise, local/loopback interfaceleri için yerel etiket atması yapar. Ayrıca LDP altında egress policy ile belirtilen prefixler için atama yapar.  L3MPLS VPN’de ise per-nexthop bazında etiket atar (nexthop aynı olan prefixler için tek bir etiket). Bu’da nexthop’un bilinmediği veya adj tablosunda olmaması (ethernet için mac adresinin bilinmemesi) gibi durumlarda etiket atanmamasına yol açar (genellikle multiaccess networklere bağle CE bağlantılarında). Bu durum egress PE’de vrf-table-label komutu ile per-vrf tabanlı etikeket atanması sağlanıp, çıkış PE’sinde ip lookep yapılması ve nexthobun resolve edilmesi sağlanır.


  •  RIB,LFIB,FIB,FEC arasındaki farklar, label distribution arasındaki farklar.
  • L3MPLSVPN inner label atama farkları

1 – RIB,LFIB,FIB,FEC arasındaki farklar :

Label distribution için;

Cisco IOS uses independent label distribution control – every LSR advertises a label for every IP prefix in its routing table that matches its label allocation policy (see also Label Allocation Rules below).

Junos uses ordered label distribution control – LSR allocates and advertises labels for prefixes configured with egress policy (see Label Allocation Rules below) and for prefixes in its IP routing table for which it’s already received a label mapping from the next-hop LSR.


The fundamental reason for widely different MPLS implementation is the first use case: Cisco IOS started with tag switching targeted at IP-over-ATM transport, where every IP prefix needs an end-to-end LSP; Junos started with layer-3 MPLS/VPNs, where you need LSPs only toward BGP next hops (or was it MPLS-TE? See the comments).

MPLS in Cisco IOS

Let’s revisit how LDP-based MPLS works in Cisco IOS and what its data structures are:

  • Every routing protocol has its own data structures (OSPF or IS-IS topology databases) and its own routing table (SPF results in OSPF or IS-IS or Routing Information Base – RIB – in BGP);
  • Routes from per-protocol routing tables are copied into the main IP routing table usingadministrative distance as the criterion to prefer routes from one routing protocol over routes from another one;
  • Fully evaluated entries from the main routing table are copied into IP forwarding table (FIB or CEF table);
  • LDP assigns a label to every non-BGP entry in the FIB, stores those labels in LFIB and in its LDP database and advertises them to LDP neighbors;
  • CEF table and LDP database are combined to find outbound labels (labels assigned to IP prefixes by next-hop routers) that are then used in CEF table (FIB) and LFIB.

The following diagram illustrates the protocols, data structures and their relationships.

MPLS in Junos

Junos has a completely different approach to MPLS. Let’s start with IP routing tables:

  • Some routing protocols still have their own data structures (OSPF or IS-IS topology database), others don’t (BGP and RIP).
  • There are no per-protocol IP routing tables (or BGP RIB); entries from different routing protocols are stored directly in the main IP routing table (inet.0);
  • Active routes from the IP routing table are copied into the IP forwarding table (because inet.0 serves both as IP routing table and BGP RIB, you might have inactive routes in the inet.0 table);

LDP and other label distribution protocols (for example, MPLS-TE) create local labels and FEC-to-label mappings:

  • Labels received LDP neighbors are stored in the LDP database;
  • Labels received from next-hop routers are also stored in the FEC mapping table (inet.3);
  • Local LDP labels are created for all entries in the inet.3 table (thus implementing ordered label distribution control) and stored in the LDP database;
  • Local labels are also created for loopback interfaces (default behavior) or IP prefixes matched by the egress-policy routing policy;
  • Local-to-next-hop label mappings are stored in Label Routing Table (mpls.0) and copied into Label Forwarding Table (LFIB).

Finally, Junos uses the FEC mapping table to insert outbound labels into the IP routing table (not just FIB). The FEC mapping table is (by default) used only for BGP destinations. Traffic toward BGP next hop (for example, SNMP traffic sent to a PE-router’s loopback interface) is thus not labeled, traffic for BGP destinations using the same next hop is.

The interactions between OSPF, BGP, LDP, and various Junos data structures are shown in the following diagram:

Default behavior

If you enable MPLS (using the default settings) in a Cisco IOS-based network, every router generates labels for all non-BGP IP prefixes, and all the traffic is labeled by the first-hop routers.

If you enable MPLS (yet again using default settings) in a Junos-based network, the routers generate labels only for the loopback interfaces, and label only the traffic sent toward BGP destinations reachable through loopback-based BGP next hops.

In a multi-vendor network, you’ll get a mixture of both behaviors:

  • Labels will be assigned to most prefixes by most routers. Once a Cisco IOS router allocates a label to an IGP prefix, all upstream Junos routers will allocate labels to the same prefix;
  • IP traffic received by a Cisco IOS router will be labeled if at all possible (outbound label is entered in the FIB whenever there’s a corresponding mapping in LDP database);
  • Junos routers will label only IP traffic for BGP destinations.

Yet again, remember that this section describes default behavior; you can change it on both Cisco IOS and Junos.

An example is worth more than a thousand words

To illustrate the Junos MPLS behavior, let’s look at data structures in a small OSPF/BGP/LDP network. I took a sample MPLS network created by Dan Backman, disabled RSVP, enabled LDP, and added a global EBGP connection (to test global BGP behavior):

The IP routing table on R3 contains all directly connected, IGP and BGP destinations:

IP routing table @ R3

FEC mapping table (inet.3) is much shorter than the IP routing table. It contains only the loopback addresses (the /32 prefixes), and an IP prefix for external BGP next hop that I added to LDP using egress-policy on R7 (the /30 prefix). Prefixes advertised by adjacent routers (R1, R2, R4 and R5) don’t have an outbound label (due to penultimate hop popping), R7’s loopback and EBGP next hop do.

FEC mapping table @ R3

Local labels are created for all prefixes in inet.3 table; locally-originated prefixes don’t need labels; they are associated with label 3 (POP).

LDP-generated part of the LFIB table on R3

If you display detailed information from the mpls.0 table, you can also see the IP prefixes associated with the label entry (note that there are two IP prefixes associated with the same label):

A single entry in the LFIB table

LDP database contains all the information received from LDP neighbors or advertised to them; you can inspect the whole LDP database or entries received or sent to an individual neighbor. As expected, output label database contains labels for all entries in inet.3 table and label 3 (POP) for all locally-originated LDP prefixes.

Parts of LDP database on R3 (limited to R5)

Last but definitely not least, let’s inspect the routing table entry for the external BGP next hop. You won’t find a label in this entry.

Route toward BGP next-hop on R3

Just to ensure there’s no other magic going on behind the scenes, let’s inspect the forwarding table entry for the same prefix. Yet again, no label.

Forwarding entry for BGP next-hop on R3

On the other hand, the routing table entry for a BGP destination using that same BGP next hop has two labels (because R3 can reach the EBGP next hop through two next-hop routers, R4 and R5.

BGP route on R3

The outgoing label is also copied into the forwarding table. By default, Junos doesn’t perform load balancing toward BGP destinations; the forwarding table thus contains only a single outgoing label.

Forwarding entry for a BGP route on R3


2 -L3MPLSVPN inner label atama farkları

Genel olarak 3 tip inner label atama methodu vardır.

1 – Per-Prefix : Cisco default. Juniperde bunu yapmak için mpls ldp deaggregate. FEC deaggregation yapılmalı.

2 – Per-Nexthop : Juniper default.

3 – Per-Table : vrf-table-label junos’da.