How come MPLS header has no next protocol ID field? How can a parser tell for sure which protocol is next?

BOS field only indicates that the next header is not MPLS, which is not enough to distinguish between IPv4 and Ethernet for example.

Parsing the next protocol header itself for protocol ID is also prone to errors. (Might easily confuse IP header with Ethernet header - since Destination MAC addresses are quite random).

2 Answers 2


The next protocol ID is used by hosts when processing a datagram so they know which process to hand the datagram to. But hosts never process MPLS datagrams. The MPLS header is stripped off before it reaches them.

LSR routers do not process datagrams beyond the MPLS header, so there is no need for a next protocol ID.

  • I have a concrete example of a case where an LSR should know the next protocol ID of MPLS. Suppose I want to load balance L3VPN (or VPLS) traffic within an MPLS core. How will the LSR calculate the hash value for the loadbalancing function if it doesn't know the exact header structure? In case it will take into account only label information all traffic will flow out the same interface, wouldn't it?
    – manish ma
    Commented Mar 1, 2019 at 13:45
  • 2
    You can't load balance that way. You would have to create two TE tunnels (two LSPs) in order to load balance. In that case the ingress router does the hashing.
    – Ron Trunk
    Commented Mar 1, 2019 at 13:58
  • Cool thanks. So as of today, load balancing for all VPN traffic can be acomplished only by using TE tunnels?
    – manish ma
    Commented Mar 1, 2019 at 14:06
  • Today and the foreseeable future.
    – Ron Trunk
    Commented Mar 1, 2019 at 14:08
  • Mmm ok. How about load balancing over LAG??
    – manish ma
    Commented Mar 2, 2019 at 5:04

The next header after MPLS BOS can be determined without the "next protocol" field since the router that originated this label knows to which service it belongs.

L2VPN(VPLS, VPWS): next header is ETH. L3VPNv4: next header is IPv4.
6PE, 6VPE: next header is IPv6.

So after terminating the service label (VPN label) it knows what header to expect next.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.