r/networking 1d ago

Switching MPLS FEC

Hi

I`m review now MPLS FEC topic.

 

R1----R2----R3----R4----R5----10/8,20/8

 

FEC is a group of packet one or more packet are treated the exact same way. Does that means if R1 received :

10.1.1.1,10.2.2.2,20.1.1.1,20.2.2.2

and these 4 packets are treated on R1 the exact same way

and on R2 are treated a different way, R3 another way,R4 another way. Does that mean each hop must treat these 4 packets as the exact same way like R1 in order to be on the same MPLS FEC ?

OR

It`s normal for each hop to treat them on a different way and still on the same MPLS FEC?

What i mean does the MPLS FEC is controlled on the ingress PE only ?

OR

MPLS FEC could be controlled on each hop and the FEC is locally significant?

5 Upvotes

7 comments sorted by

3

u/eli5questions CCNP / JNCIE-SP 12h ago

First thing is let's breakdown what MPLS FEC is trying to solve. Let's take R5 and say it is configured with any routing protocol you like (OSPF, IS-IS, BGP) and no MPLS at this time. R5 builds it's routing table and distributes the routes into the network.

R1-R4 takes what R5 advertised, recursively resolves the routes to next-hop + egress interface and adds them to their RIB/FIB. While R5's adv. routes are globally significant, each router's resolved routes are locally significant meaning each router decides which next-hop it's forwarding to (this is related to your question later).

Now lets turn up MPLS and LDP (keep it simple). R5 first needs to build it's label mappings for it's routes by assigning a label to each route. This label mapping is the FEC and is essentially "To reach X use label Z" (note that multiple prefixes with the same next-hop + egress interface are usually assigned the same label).

R5 will repeat this for all it's routes and the same will be dome for R1-R4. All routers exchange their locally significant label mappings so they can add their pop/swap label actions to their RIB/FIB. Each router decides which next-hop it's forwarding to and action based on the label in the MPLS header of the ingress traffic.

FEC is simply a label mapping for a prefix/destination that is exchanged and agreed on from the ingress PE to the egress PE.

these 4 packets are treated on R1 the exact same way

In general, yes.

Does that mean each hop must treat these 4 packets as the exact same way like R1 in order to be on the same MPLS FEC ?

As mentioned, how they are treated is done when they exchange their label mappings which is basically each router saying "if you want to reach 10/8 use label X". Because of this each router will treat packets the same for that FEC.

It`s normal for each hop to treat them on a different way and still on the same MPLS FEC?

Each hop will treat them the same as stated above.

With MPLS tunnels (T-LDP/RSVP/SR-MPLS/BGP-LU) they still treat the FEC the same, but the path can be different.

What i mean does the MPLS FEC is controlled on the ingress PE only ? OR MPLS FEC could be controlled on each hop and the FEC is locally significant?

I have read plenty of discussions in the past where they focus on the ingress PE and ignore the egress PE when explaining FEC. IMO that is a poor approach that frames the ingress PE as in control

The FEC is advertised by the egress PE and advertised downstream towards the ingress PE. Along the way the LSRs exchange their mappings which builds the forwarding path. The originator of the FEC (the egress PE) is ultimately in control. Especially with RSVP/SR-MPLS.

Is the FEC locally significant for each router? Yes, but it's meaningless in this context.

Many arguments of the ingress PEs being in control twist FEC to analogous to FBF or QoS. The ingress PE simply determines which FEC to forward the packets to.

1

u/Inside-Finish-2128 1d ago

R1's FIB is going to have the same forwarding entry for everything external to R5 that leaves through the same egress interface. Packet comes in, FIB sees it's going to R5, packet gets a label pushed in that corresponds with getting it to R5. Every similar packet gets the same label (until there's an event that forces FIB activity, blah blah blah), so each intermediate hop does the same thing with it.

1

u/Inside-Finish-2128 1d ago

Here's two different routes that leave via the same transit to Cogent:

Core1#sh ip cef 1.0.64.1

1.0.64.0/18

nexthop <redacted> TenGigabitEthernet4/4 label 696-(local:19)

Core1#sh ip cef 1.6.92.1

1.6.92.0/22

nexthop <redacted> TenGigabitEthernet4/4 label 696-(local:19)

Same egress label. (The redacted nexthop addresses were the same.)

1

u/idlysambardip 1d ago edited 1d ago

It helps to imagine a MPLS network as two separate roles

First is headend role( also called ingress node ) where incoming traffic( MPLS, IP, IPV6 ) is mapped to a FEC. This could be a RSVP tunnel, a SR-TE policy, an ISIS-SR tunnel, some CBF policy etc. These will map the traffic to a 'FEC' mapped to a MPLS label. In a way the forwarding fate of the packet has been decided.

The intermediate hops are 'transit' routers which base the forwarding decision on this MPLS label. The label may swap at each node or stay the same or might even push more labels in a binding SID case; but all of it is same FEC.

The last hop is tailend( or termination router or egress ) where the node examines the MPLS label, decides that it is to be terminated and chooses to forward packet based on inner content. With PHP( everywhere ), the termination router will not even see the MPLS label.

1

u/Wild_Criticism7242 CCDA 18h ago

i think the key is that the FEC is defined by the ingress PE, while each hop can handle the packet differently as long as the label mapping stays consistent

0

u/oddchihuahua JNCIP-SP-DC 1d ago

According to Claude because even I wondered about this-

The ingress LER looks at the packet (destination prefix, VPN, QoS class, etc.), decides which FEC it belongs to, and pushes the label that corresponds to that FEC.

Every downstream router (LSR) forwards purely based on the label value, not by re-examining the original packet header.

At each hop, the label gets swapped for a new, locally significant label — but that new label still maps to the same FEC as far as that router’s forwarding table is concerned.

So the FEC “identity” persists across the whole LSP (Label Switched Path) in the sense that all routers along the path agree “this label represents that FEC” — that agreement is exactly what protocols like LDP or RSVP-TE establish when they distribute label bindings. But the literal label number is only locally significant and changes hop-by-hop; it’s not the same value end-to-end (unlike, say, a VLAN tag).

1

u/DepinderCarolina 8h ago

FEC is locally significant per router. Each hop makes its own independent forwarding decision based on the label it receives, so yes, R2 can treat those packets differently than R1 and they're still part of the same FEC end-to-end