- Cisco Express Forwarding (CEF) is a packet forwarding or switching method that Cisco IOS uses.
- It is the latest IP switching method developed in Cisco IOS, and it is the default packet forwarding method being used now.
- MPLS requires CEF.
- Packets can be forwarded through the router in three basic ways: process switching, interrupt switching, or through an application-specific integrated circuit (ASIC).
- In process switching, a special Cisco IOS process that is scheduled to run when the router receives packets is what performs the switching of packets.
- A Cisco IOS process does not perform the switching of packets in Interrupt mode. Rather, when packets arrive to the router, the interface processor interrupts the central CPU and asks it to switch the packet according to a route cache or switching table. That cache or table can be built in several ways.
- Finally, the router can program the switching table into an ASIC so that the packets can be switched in hardware. Several Cisco platforms can program the CEF table into ASICs.
Process Switching
- Process switching is the slowest of all switching methods.
- When switching a packet through the router, a Cisco IOS process copies the packet to the CPU memory and looks up the destination IP address in the IP routing table.
- The central CPU of the router always looks at the packet; no other intelligent hardware decides how the packet is forwarded.
Fast Switching
- Fast switching is a switching method that builds an on-demand forwarding table.
- The first packet for a destination that arrives is process switched.
- This cache is not permanent. Some timers govern the fast switching route cache, and from time to time, some entries are deleted, freeing memory.
- As long as packets are switched for certain destinations, these destinations remain in the route cache.
- Each IP prefix entry in the route cache has an outgoing interface, next hop, and Layer 2 rewrite field.
CEF Switching
- The switching table is no longer built on demand, but it is built in advance.
- As such, each prefix in the routing table has an entry in the CEF switching table at the same time.
- When the routing table changes, the CEF switching table is updated.
- In some cases, the other switching methods might still be needed. For example, packets that have IP options - then it is process-switched.
CEF in MPLS Networks
- Labeled packets that enter the router are switched according to the label forwarding information base (LFIB) on the router.
- IP packets that enter the router are switched according to the CEF table on the router.
- Regardless of whether the packet is switched according to the LFIB or the CEF table, the outgoing packet can be a labeled packet or an IP packet.
- CEF is the only switching method in Cisco IOS that can label an incoming IP packet and forward it.
- CEF has two main data structures: the Forwarding Information Base (FIB) and the adjacency table. (The FIB is also referred to as just the CEF table.)

- The adjacency table is the CEF component that is responsible for the MAC or Layer 2 rewrite.
- The adjacency table holds one adjacency or Layer 2 rewrite structure per router that is connected to that multipoint interface. This adjacency can be built from information learned from Address Resolution Protocol (ARP), ATM, or Frame Relay map statements, and inverse ARP on ATM or Frame Relay.
- Interpreting the Ethernet3/3 adjacency: The first twelve characters are the MAC address of the destination next-hop interface. The next twelve characters represent the MAC address of the source interface of the packet (Ethernet3/3). The last four characters represent the well-known Ethertype value 0x0800 for IP.

- The CEF table or FIB is the CEF component that is responsible for the Layer 3 forwarding decision that is made.
- The CEF table looks similar to the IP routing table on the router. In fact, each prefix in the routing table has the same prefix in the CEF table.
- The CEF table holds essential information to make a forwarding decision, i.e. the IP prefix, the recursively evaluated next hop, and the outgoing interface.
- An important aspect of the CEF table is that recursive prefixes are immediately resolved. If, for instance, a BGP prefix is in the routing table, and it points to a BGP next hop—which is learned via an IGP—the BGP prefix is inserted into the CEF table with a next hop that is learned from recursing to the BGP next hop.
Distributed CEF (dCEF)
- Some Cisco routers use a central CPU without any form of decentralized or distributed intelligence.
- Other routers can distribute the burden of forwarding traffic through CEF by using the distributed CPUs to forward traffic without interrupting the central CPU.
- To achieve the distributed forwarding, both the CEF and adjacency table have to be distributed to these distributed CPUs.
- The redistributed intelligence can be present on Versatile Interface Processor (VIP) or line cards, depending on the router platform. They are all interconnected by means of a bus or switching fabric architecture, which can distribute the CEF and adjacency table.
- To enable distributed CEF on a router, configure the command ip cef distributed.
- If you use CEF in the Distributed mode, LFIB is also distributed.
- To achieve high rate packet forwarding, the router can use ASICs (specifically built chips) on the boards or line cards. To have the ASICs forward the packets per the routing table, the router distills the CEF table into the ASIC so that it is correctly programmed to forward the packets.
Load Balancing in CEF
- CEF allows for load balancing or load sharing of traffic among multiple outgoing links.
- CEF needs multiple outgoing links as next hops in the routing table to perform load balancing.
- The command maximum-paths specifies how many paths or next hops are allowed per prefix in the routing table.
- Two main load balancing schemes: per-packet or per-destination.
- The per-packet load balancing scheme sends packets in round-robin on the outgoing links.
- The default CEF load balancing scheme is per-destination.
- The per-destination load balancing is actually done by hashing the destination and source IP address.
- The per-destination load balancing is the default load sharing method for CEF because the per-packet load sharing scheme can send consecutive packets of the same flow (this means the same source/destination IP address pair) across different paths and hence might lead to a reordering problem of the IP packets at the destination. This can lead to problems for traffic such as VoIP because a performance hit or quality degradation can occur if the packets arrive out of sequence, as packets might be considered lost. In addition, it adds jitter.
- Per-packet load sharing, however, gives a perfect load sharing distribution on the outgoing paths, whereas the per-destination load sharing is only a statistical method of distributing flows per pairs of (source IP address, destination IP address).
- Cisco IOS can load-balance in CEF by hashing the source and destination IP address and pointing the result of that hash to a load sharing table. This table holds 16 hash buckets. Each of the 16 hash buckets points to one adjacency, and multiple buckets can point to the same adjacency.
- Sixteen hash buckets exist. These hash buckets distribute the load of traffic among all possible outgoing paths in the best possible way. For example, in the case of two outgoing paths, eight hash buckets are assigned to each outgoing path. In the case of three outgoing paths, five hash buckets are assigned to each outgoing path, and one hash bucket is unassigned. In short, if 16 is not divisible by the number of paths, the remainder hash buckets are not used and are disabled.

Unequal Cost Load Balancing
- Possible - In that case, the 16 hash buckets are not evenly distributed among all possible paths.
- EIGRP variance allows unequal cost load balancing because it enables routes to be installed in the routing table that are not the best.
- The traffic share counters represent how traffic is distributed between the paths.
- For example, for two unequal cost EIGRP paths with metrics 16640 and 5120, the traffic share count is almost the same ratio 120:37 (inversely proportional to the path's metric).
- Based on the traffic share count, CEF assigns 12 buckets to the faster path and 4 buckets to the slower path (12:4 is very close to 120:37).
- A perfect distribution of the hash buckets according to the metric is not always possible. The distribution will always be approximate.
- See: Understanding Unequal-Cost Load-Balancing
Labeling IP Packets by CEF
- A stack of at least one label is imposed on the IP packet on the ingress LSR at the edge of the MPLS network.
- The CEF table shows the imposed label stack for each prefix.
- The labels are top label to bottom label when read from left to right.
- An LSR can add labels to an already labeled packet, but the LSR performs that function according to the LFIB and not the CEF table. CEF labels only IP packets.
- Recursion can also be used to assign the label to a prefix.
- For example, when the recursion of the BGP prefix 10.99.1.1/32 to the IGP prefix 10.200.254.4 (the BGP next hop) is done, the label 23 is inherited from the IGP prefix and shows up in the CEF table as the imposed label for the BGP prefix 10.99.1.1/32.
- This is an extremely important feature of MPLS. All the packets that are flowing along the same LSP (in this case, all the packets that are destined for prefixes with the same BGP next hop) are imposed with the same label.
Load Balancing Labeled Packets
- If the MPLS payload is an IPv4 or IPv6 packet, Cisco IOS uses the CEF hashing algorithm to determine the outgoing interface (per-destination load balancing).
- The load balancing is done only between labeled paths. This means that if an IP (unlabeled) and a labeled path have the same cost, only the labeled path is used to forward the packets.
- The algorithm for load balancing the MPLS packets is as follows:
- If the MPLS payload is an IPv4 packet, the load balancing is done by hashing the source and destination IP address of the IPv4 header.
- If the MPLS payload is an IPv6 packet, the load balancing is done by hashing the source and destination IP address of the IPv6 header.
- If the MPLS payload is not an IPv4 or IPv6 packet, the load balancing is done by looking at the value of the bottom label.
References
MPLS Fundamentals
- All LSRs must run a label distribution protocol and exchange label bindings.
- All directly connecdted LSRs must establish an LDP peer relationship (LDP session) between them.
- The label bindings received from neighbor routers, locally assigned, or statically configured label bindings are stored in label information base (LIB).
- The label forwarding information base (LFIB), which is the table that forwards labeled packets, is fed by the LIB.
- LDP has four major functions:
- the discovery of LSRs that are running LDP
- session establishment and maintenance
- advertising of label mappings
- housekeeping by means of notification
- Two LSRs discover each other by means of Hello messages and then establish a session across a TCP connection.
- LSRs send LDP Hello messages on all links that are LDP enabled.
- LDP is automatically enabled with the mpls ip command.
- LDP Hello messages are UDP messages that are sent to the "all routers" multicast IP address 224.0.0.2. The UDP port for LDP is 646.
- The LDP Hello message contains a Hold time, and if no Hello message is received within that time, the LDP neighbor is removed.
- By default, the Hello interval is 5 seconds and the Hold time is 15 seconds.
- If the two LDP peers have different LDP Hold times configured, the smaller of the two values is used as the Hold time.
- Cisco IOS might overwrite the configured LDP Hello interval. It will choose a smaller LDP Hello interval than configured so that it can send at least three LDP Hellos before the Hold time expires. (At least nine Hellos are sent in the case of a targeted LDP session.)
- LSRs have an LDP Identifier, or LDP ID. This LDP ID is a 6-byte field that consists of 4 bytes identifying the LSR uniquely and 2 bytes identifying the label space that the LSR is using (per-platform or per-interface).
- The first 4 bytes of the LDP ID are an IP address taken from an operational interface on the router. If Loopback interfaces exist, the highest IP address of the Loopback interfaces is taken for the LDP ID or LDP router ID. If no Loopback interfaces exist, the highest IP address of an interface is taken. The LDP router ID can also be configured manually (mpls ldp router-id interface [force]).
- In Cisco IOS, the MPLS LDP router ID needs to be present in the routing table of the LDP neighboring routers. If it is not, the LDP session is not formed.
- When two LSRs have discovered each other by means of the LDP Hellos, they attempt to establish an LDP session between them.
- One LSR tries to open a TCP (646) connection to the other LSR.
- Once the TCP connection is set up, both LSRs negotiate LDP session parameters, which include:
- timer values
- label distribution method
- VPI/VCI ranges for LC-ATM
- DLCI ranges for LC-Frame Relay
- If the peers don't agree on the parameters, they retry to create the LDP session between them, but at a throttled rate.
- After the LDP session has been set up, it is maintained by either the receipt of LDP packets or a periodic keepalive message.
- Usually the IP addresses used to create the LDP session are the LDP router Identifiers on each router. However, if you do not want to use this IP address to create the LDP session, you can change it (mpls ldp discovery transport-address {interface | ip address}).
- When a router has multiple links toward another LDP router, the same transport address must be advertised on all the parallel links that use the same label space.
- Normally one LDP session between a pair of LSRs is enough but with per-interface label space one LDP session must exist per interface.
- The advantage of show mpls ip binding vs. show mpls ldp bindings is that it also shows which label from all possible remote bindings is used to forward traffic by indicating in use. In use indicates the outgoing label in the LFIB for that prefix.
- Note that LDP assigns local labels to all IGP prefixes and advertises the bindings to all LDP peers.
- The concept of split horizon does not exist; an LDP peer assigns its own local label to a prefix and advertises that back to the other LDP peer.

Targeted LDP Session
- This is an LDP session between LSRs that are not directly connected.
- For example, AToM networks and TE tunnels in an MPLS VPN need targeted LDP sessions.
- For directly connected neighbors, you only need to enable mpls ip on the interface; the LDP peers discover each other and create the LDP TCP session between them.
- For LDP neighbors that are not directly connected, the LDP neighborship needs to be configured manually on both the routers with the mpls ldp neighbor targeted command.
LDP Authentication
- LDP can use Message Digest 5 (MD5) authentication.
- MD5 adds a signature—called the MD5 digest—to the TCP segments. The MD5 digest is calculated for the particular TCP segment using the configured password on both ends of the connection and the MD5 digest is checked for every segment received from the TCP connection.
- The configured MD5 password is never transmitted.
- To enable authentication, issue the mpls ldp neighbor command with the password keyword.
LDP Autoconfiguration
- The MPLS LDP Autoconfiguration feature enables you to globally enable LDP on every interface associated with an IGP instance.
- This feature is supported on OSPF and IS-IS IGPs.
- The goal of the MPLS LDP Autoconfiguration feature is to make configuration easier, faster, and error free.
- You issue the mpls ldp autoconfig command to enable LDP on each interface that is running an OSPF or IS-IS process.
- If you do not want some of the interfaces to have LDP enabled, you can issue the no mpls ldp igp autoconfig command on those interfaces.
MPLS LDP-IGP Synchronization
- Packet loss due to LDP and IGP not being synchronized can occur in the following situations:
- When an IGP adjaceny is established, the router begins forwarding packets before the LDP label exchange completes.
- If the LDP session closes, the router continues to forward traffic using that link.
- At the point where LDP is broken, the packets become unlabeled. The packets are forwarded as IPv4 packets until they become labeled again on the next LSR.
- With MPLS VPN, AToM, Virtual Private LAN Switching (VPLS), or IPv6 over MPLS, the packets must not become unlabeled in the MPLS network. If they do become unlabeled, the LSR does not know how to forward the packets anymore and drop them.
- In the case of MPLS VPN, the packets are IPv4 packets, but they should be forwarded according to a VRF routing table. This table is private for one customer and is present only on the edge LSRs or PE routers. Therefore, when the MPLS VPN packets become unlabeled on the core LSRs—the P routers—they are dropped.
- The same problem can occur when LSRs restart. The IGP can be quicker in establishing the adjacencies than LDP can establish its sessions. This means that the IGP forwarding is already happening before the LFIB has the necessary information to start the correct label forwarding. The packets are incorrectly forwarded (unlabeled) or dropped until the LDP session is established.
- The solution is MPLS LDP-IGP Synchronization. This feature ensures that LDP is fully established before the IGP path is used for switching.
- This feature is only supported on interfaces running OSPF or IS-IS.
- This feature works when LDP is enabled on interfaces with either mpls ip or mpls ldp autoconfig command.
- MPLS LDP-IGP Synchronization is enabled for the IGP process. This means that it is configured for an IGP, and it applies to all the interfaces on which the IGP is running. The command to enable it for the IGP is mpls ldp sync, configured under the router process.
- When the MPLS LDP-IGP synchronization is active for an interface, the IGP announces that link with maximum metric until the synchronization is achieved, or until the LDP session is running across that interface.
- After the LDP session is established and label bindings have been exchanged, the IGP advertises the link with its normal IGP metric.
- Basically, OSPF does not form an adjacency across a link if the LDP session is not established first across that link. (OSPF does not send out Hellos on the link.)
- Until the LDP session is established or until the synchronization Holddown timer has expired, the OSPF adjacency is not established. Synchronized here means that the local label bindings have been sent over the LDP session to the LDP peer.
MPLS LDP Session Protection
- A common problem in networks is flapping links.
- Because the IGP adjacency and the LDP session are running across the link, they go down when the link goes down.
- The impact is pretty severe though, because the routing protocol and LDP can take time to rebuild the neighborship. LDP has to rebuild the LDP session and must exchange the label bindings again.
- When the LDP session between two directly connected LSRs is protected, a targeted LDP session is built between the two LSRs.
- When the directly connected link does go down between the two LSRs, the targeted LDP session is kept up as long as an alternative path exists between the two LSRs.
- The global command to enable LDP Session Protection is this: mpls ldp session protection [vrf vpn-name] [for acl] [duration seconds]
- The access list (acl) you can configure lets you specify the LDP peers that should be protected. It should hold the LDP Router Identifier of the LDP neighbors that need protection.
- The duration is the time that the protection (the targeted LDP session) should remain in place after the LDP link adjacency has gone down. The default value is infinite.
- For the protection to work, you need to enable it on both the LSRs. If this is not possible, you can enable it on one LSR, and the other LSR can accept the targeted LDP Hellos by configuring the command mpls ldp discovery targeted-hello accept.
References
MPLS Fundamentals
Introduction
- MPLS labels are advertised between routers.
- Routers build label-to-label mappings.
- The labels are attached to the IP packets (between Layer 2 and Layer 3 headers).
- Routers forward packets by looking at the label and not the destination IP address.
- Faster switching is often mistakenly mentioned as a reason to implelemt MPLS - it is not. The switching of the packets—or the forwarding plane—these days is done on specifically built hardware, or application-specific integrated circuits (ASIC). The use of ASICs in the forwarding plane of a router has led to IP packets being switched as fast as labeled packets.
- In Cisco IOS, CEF switching is the only IP switching mode that you can use to label packets. Other IP switching modes, such as fast switching, cannot be used, because the fast switching cache does not hold information on labels. Because CEF switching is the only IP switching mode that is supported in conjunction with MPLS, you must turn on CEF when you enable MPLS on the router.
MPLS Labels
++++++++++++++++++++++++++++++++++++++++++++++++
| Label | EXP | BoS | TTL |
++++++++++++++++++++++++++++++++++++++++++++++++
- Label (first 20 bits): first 16 values are exempted from normal use, and they have a special meaning.
- EXP (bits 20 to 22): used for QoS.
- BoS (bit 23): indicates if the label is the bottom of stack (1) or not (0). Limitless stack space but usually no more than four labels are used.
- TTL (bits 24 to 31): same function as the TTL in the IP header.
- Labels 0 through 15 are reserved labels. An LSR cannot use them in the normal case for forwarding packets.
- Label 0 is the explicit NULL label, whereas label 3 is the implicit NULL label.
- Label 1 is the router alert label, whereas label 14 is the OAM alert label.
- The other reserved labels between 0 and 15 have not been assigned yet.
- Except for the reserved labels of 0 through 15, you can use all the label values for normal packet forwarding.
- Because the label value has 20 bits, the labels from 16 through 1,048,575 (220 – 1) are used for normal packet forwarding.
- In Cisco IOS, the default range is 16 through 100,000.
Implicit NULL Label
- Has a value of 3.
- An egress LSR advertises the implicit NULL label when it wants the upstream LSR to perform a pop operation.
- The egress LSR assings the implicit NULL label to its connected and summarized prefixes.
- Without the implicit NULL label, the router would have to do two lookups, First, it would have to look up the label in the LFIB, just to figure out the label needs to be removed. Second, it would have to perform an IP lookup.
- To remove the double lookup, the router signals the last but one (penultimate) LSR to send packets without a label by advertising the implicit NULL label instead of a regular MPLS label.
- The use of the implicit NULL label at the end of a label switched path (LSP) is called penultimate hop popping (PHP).
- The use of the implicit NULL label does not mean that all labels of the label stack must be removed. Only one label is popped off.
- In any case, the use of the implicit NULL label removes an extra lookup and increases performance.
Explicit NULL Label
- Has a value of 0.
- Besides the label value itself, the MPLS label also holds the Experimental (EXP) bits.
- When a label is removed, the EXP bits are also removed. Because the EXP bits are exclusively used for quality of service (QoS), the QoS part of the packet is lost when the top label is removed.
- In some cases, you might want to keep this QoS information and have it delivered to the egress LSR. Implicit NULL cannot be used in that case. The explicit NULL label must be used instead.
- The egrees LSR just removes the explicit NULL label but it can derive the QoS information of the received packet by looking at the EXP bits.
- The EXP bits value can be copied to the precedence or DiffServ bits when performing PHP, or, if the label stack has multiple labels and the top label is popped off, the EXP bits value can be copied to the EXP field of the new top label.
- The explicit NULL label for IPv6 has the value 2.
Router Alert Label
- Has a value of 1.
- This label can be present anywhere in the label stack except at the bottom.
- When the Router Alert label is the top label, it alerts the LSR that the packet needs to be punted to the software process for a closer look.
OAM Alert Label
- Has a value of 14.
- Basically used for failure detection, localization, and performance monitoring. This label differentiates OAM packets from normal user data packets.
- Cisco IOS does not use label 14. It does perform MPLS OAM, but not by using label 14.
MPLS Operations
- A label switch router (LSR) is a router that supports MPLS. It is capable of understanding MPLS labels and of receiving and transmitting a labeled packet on a data link.
- An LSR can do these three operations: pop, push, or swap.
- Pop: The top label is removed. The packet is forwarded with the remaining label stack or as an unlabeled packet.
- Push: The top label is replaced with a new label (swapped), and one or more labels are added (pushed) on top of the swapped label.
- Swap: The top label is removed and replaced with a new label.
- An LSR that pushes labels onto a packet that was not labeled yet is called an imposing LSR because it is the first LSR to impose one or more labels onto the packet. One that is doing imposition is an ingress LSR.
- An LSR that removes all labels from the labeled packet before switching out the packet is a disposing LSR. One that does disposition is an egress LSR.
- In the case of MPLS VPN, the ingress and egress LSRs are referred to as provider edge (PE) routers. Intermediate LSRs are referred to as provider (P) routers. The terms PE and Prouters have become so popular that they are also used when the MPLS network does not run MPLS VPN.
- The ingress LSR classifies and labels the packets.
- All that changes is that the top label in the label stack is swapped at each hop.
- The intermediate LSRs swap the top label (the incoming label) of the received labeled packet with another label (the outgoing label) and transmit the packet on the outgoing link.
Label Distribution
- Each intermediate LSR must be able to figure out with which outgoing label the incoming label should be swapped.
- This means that you need a mechanism to tell the routers which labels to use when forwarding a packet. A label distribution protocol is needed.
- You can distribute labels in two ways:
- Piggyback the labels on an existing IP routing protocol.
- Have a separate protocol distribute labels.
- The first method has the advantage that a new protocol is not needed to run on the LSRs and routing/label distribution would always be in sync, but every existing IP routing protocol would need to be extended to carry the labels. This is not an easy thing to do, which is why none of the IGPs have been changed to deploy the first method.
- The second method - running a separate protocol for label distribution - has been adopted by all router vendors. This is the Label Distribution Protocol (LDP). However, LDP is not the only protocol that can distribute MPLS labels - others are Tag Distribution Protocol (TDP), which is now obsolete, and Resource Reservation Protocol (RSVP), which is used for MPLS TE only.
- For every IGP IP prefix in its IP routing table, each LSR creates a local binding—that is, it binds a label to the IPv4 prefix.
- The LSR then distributes this binding to all its LDP neighbors.
- The neighbors then store remote (received) and local bindings in a special table, the label information base (LIB).
- Each LSR has only one local binding per prefix when the label space is per platform.
- If the label space is per interface, one local label binding can exist per prefix per interface.
MPLS Forwarding
- When a router receives an IP packet, the lookup is done in the CEF table.
Router#show ip cef 10.200.254.4
10.200.254.4/32, version 44, epoch 0, cached adjacency 10.200.200.2
0 packets, 0 bytes
tag information set, all rewrites owned
local tag: 20
fast tag rewrite with Et0/0/0, 10.200.200.2, tags imposed {18}
via 10.200.200.2, Ethernet0/0/0, 0 dependencies
next hop 10.200.200.2, Ethernet0/0/0
valid cached adjacency
tag rewrite with Et0/0/0, 10.200.200.2, tags imposed {18}
- When a router receives a labeled packet, the lookup is done in the LFIB.
- The LSR sees the 20-bit field in the top label, looks up this value in the LFIB, and tries to match it with a local label value, and perform the listed operation.
Router# show mpls forwarding-table
Local Outgoing Prefix Bytes tag Outgoing Next Hop
tag tag or VC or Tunnel Id switched interface
16 Untagged 10.1.1.0/24 0 Et0/0/0 10.200.200.2
17 16 10.200.202.0/24 0 Et0/0/0 10.200.200.2
18 Pop tag 10.200.203.0/24 0 Et0/0/0 10.200.200.2
19 Pop tag 10.200.201.0/24 0 Et0/0/0 10.200.200.2
20 18 10.200.254.4/32 0 Et0/0/0 10.200.200.2
21 Pop tag 10.200.254.2/32 0 Et0/0/0 10.200.200.2
22 17 10.200.254.3/32 0 Et0/0/0 10.200.200.2
24 Untagged l2ckt(100) 4771050 Fa9/0/0 point2point
- If the router receives labeled packets with a top label that the LSR does not find in its LFIB, the LSR can theoretically try two things: strip off the labels and try to forward the IP packet, or drop the packet. The Cisco LSR drops the packet.
References
MPLS Fundamentals
IGMP snooping
- IGMP snooping examines IGMP protocol messages within a VLAN to discover which interfaces are connected to devices interested in receiving multicast traffic.
- By default, a switch would flood a multicast frame throughout the VLAN, just like it would do for a broadcast or unknown unicast frame. The reason is because a switch would never find a multicast MAC address in its CAM table because it is never used a source address.
- The term snooping is used because Layer 3 control plane packets are intercepted and influence Layer 2 forwarding decisions.
- When IGMP snooping is enabled, the switch monitors IGMP packets between receivers and multicast routers and uses the content of the packets to build a multicast cache table—a database of multicast groups and the interfaces that are connected to members of the groups.
- When the switch receives multicast packets, it uses the cache table to selectively forward the traffic to only the interfaces that are connected to members of the appropriate multicast groups.
Forwarding Interfaces and Rules
- Two types of interfaces:
- Multicast-router interfaces—These interfaces lead toward multicast routers or IGMP queriers.
- Group-member interfaces—These interfaces lead toward hosts that are members of multicast groups.
- The switch learns about these interfaces by monitoring IGMP traffic.
- If an interface receives IGMP queries or PIM updates, the switch adds the interface to its multicast forwarding table as a multicast-router interface.
- If an interface receives membership reports for a multicast group, the switch adds the interface to its multicast forwarding table as a group-member interface.
- The multicast-router interface or a group-member interface can also be statically configured.
- Note: For a switch to learn multicast-router interfaces and group-member interfaces, an IGMP querier must exist in the network. This is often a multicast router, but if there is no multicast router on the local network, the switch itself can be configured to be an IGMP querier.
- Multicast traffic received on a switch interface in a VLAN on which IGMP snooping is enabled is forwarded according to specific rules.
- IGMP traffic is forwarded as follows:
- IGMP general queries received on a multicast-router interface are forwarded to all other interfaces in the VLAN.
- IGMP group-specific queries received on a multicast-router interface are forwarded to only those interfaces in the VLAN that are members of the group.
- IGMP reports received on a host interface are forwarded to multicast-router interfaces in the same VLAN, but not to the other host interfaces in the VLAN.
- Multicast traffic that is not IGMP traffic is forwarded as follows:
- A multicast packet with a destination address of 224.0.0.0/24 is flooded to all other interfaces on the VLAN.
- An unregistered multicast packet—that is, a packet for a group that has no current members—is forwarded to all multicast-router interfaces in the VLAN.
- A registered multicast packet is forwarded only to those host interfaces in the VLAN that are members of the multicast group and to all multicast-router interfaces in the VLAN.
IGMP querier
- When there is no multicast router in the VLAN to originate the queries, you must configure an IGMP snooping querier to send membership queries.
- The presence of at least one mrouter port is absolutely essential for the IGMP snooping operation to work across switches.
- You must have the switches somehow learn or know of an mrouter port.
- When a network/VLAN does not have a router that can take on the multicast router role and provide the mrouter discovery on the switches, you can turn on the IGMP querier feature.
- The feature allows the Layer 2 switch to proxy for a multicast router and send out periodic IGMP queries in that network.
- This action causes the switch to consider itself an mrouter port.
- The remaining switches in the network simply define their respective mrouter ports as the interface on which they received this IGMP query.
IGMP filter
- IGMP filtering allows users to configure filters on a switch virtual interface (SVI), a per-port, or a per-port per-VLAN basis to control the propagation of IGMP traffic through the network.
- IGMP filtering provides the capability to manage IGMP snooping, which in turn controls the forwarding of multicast traffic.
- When an IGMP packet is received, IGMP filtering uses the filters configured by the user to determine whether the IGMP packet should be discarded or allowed to be processed by IGMP snooping.
- With a IGMPv1 or IGMPv2 packet, the entire packet is discarded.
- With a IGMPv3 packet, the packet is rewritten to remove message elements that were denied by the filters.
- Access can be restricted based on the following:
- Which multicast groups or channels can be joined on a port. Channels are joined by IGMPv3 hosts that specify both the group and the source of the multicast traffic (ip igmp snooping access-group acl [vlan vlan_id]).
- Maximum number of groups or channels allowed on a specific port or interface (regardless of the number of hosts requesting service) (ip igmp snooping limit n [except acl] [vlan vlan_id]).
- IGMP protocol versions (for example, disallow all IGMPv1 messages) (ip igmp snooping minimum-version 2 | 3).
IGMP proxy
- In certain topologies, it is not necessary to run a multicast routing protocol (like PIM). It is sufficient for a device to learn and proxy group membership information and simply forward multicast packets based upon that information.
- A proxy device performing IGMP forwarding has a single upstream interface and one or more downstream interfaces.
- These designations are explicitly configured; there is no protocol to determine what type each interface is.
- It performs the router portion of the IGMP on its downstream interfaces, and the host portion of IGMP on its upstream interface.
References
Multicast in Campus Network: CGMP and IGMP Snooping
IGMP Snooping Overview
IGMP Filtering
IGMP Proxying
IP Multicast Basics
- Simplified: unicast = one-to-one, broadcast = one-to-all, multicast = one-to-many (or many-to-many).
- Multicast is simultaneously delivering a single stream of information to multiple receivers.
- The receivers indicate their interest in participating in a multicast group by sending an IGMP host report (join message).
- A multicast group is an arbitrary group of receivers that want to receive a particular data stream. This group has no physical or geographical boundaries - the hosts can be located anywhere.
- The routers use PIM to dynamically create a multicast distribution tree. The multicast stream will then be delivered only to the network segments that are in the path between the source and the receivers.
- IPv4 class D address space is used for IP multicast. The range is 224.0.0.0 through 239.255.255.255.
- Some addresses in the 224.0.0.0/24 range have been reserved for network protocols on the local network segment. Packets to these addresses are typically sent with a TTL of 1 and are not forwarded by a router. For example, 224.0.0.1 is the 'all systems on this subnet' multicast address, and 224.0.0.2 is the 'all routers on this subnet' multicast address.
- Addresses in the 239.0.0.0/8 range are limited scope addresses and constrained to a local multicast applications that will not be forwarded outside the domain. Routers typically use filters to prevent multicast traffic in this address range from flowing outside the AS.
- There are also other reserved multicast addresses, which are not discussed here.
Layer 2 Multicast Addresses
- IP multicast address maps directly to a MAC address.
- NICs can receive packets destined to many different MAC addresses - their own unicast, broadcast, and a range of multicast addresses.
- In the 802.3 standard, bit 0 of the first octet is used to indicate a broadcast or multicast frame.
- The range 0100.5e00.0000 through 0100.5e7f.ffff is used for MAC addresses for IP multicast.
- The mapping places the lower 23 bits in the IP multicast group address into the 23 bits in the MAC address.
- Because the upper five bits of the IP multicast address are dropped in this mapping, the resulting address is not unique. In fact, 32 (2^5) different multicast IP addresses map to the same MAC address.
- This has to be considered when assigning IP multicast addresses.
- For example, 224.1.1.1 and 225.1.1.1 map to the same multicast MAC address.
Internet Group Management Protocol (IGMP)
- IGMP is used to dynamically register individual hosts in a multicast group on a particular LAN.
- Hosts identify group memberships by sending IGMP messages to their local multicast router.
- IGMPv2 improves over IGMPv1 by adding the ability for a host to signal desire to leave a multicast group and IGMPv3 improves over IGMPv2 mainly by adding the ability to listen to multicast originating from a set of source IP addresses only.
- Note: By default, enabling a PIM on an interface enables IGMPv2 on that device.
IGMP Version 1
- Only the following two types of IGMP messages exist:
- Membership query
- Membership report
- Hosts send out IGMP membership reports corresponding to a particular multicast group to indicate that they are interested in joining that group.
- IGMPv1 has no special mechanism by which the hosts can leave the group.
- If the hosts are no longer interested in receiving multicast packets for a particular group, they simply do not reply to the IGMP query packets sent from the router.
- The router periodically sends out an IGMP membership query to verify that at least one host on the subnet is still interested in receiving traffic directed to that group.
- When there is no reply to three consecutive IGMP membership queries, the router times out the group and stops forwarding traffic directed toward that group.
- If the host later wants to receive multicast packets after the timeout period, the host simply sends a new IGMP join to the router, and the router begins to forward the multicast packet again.
- If more than one multicast receiver exists for the same multicast group, only one of these hosts sends an IGMP report message; the other hosts suppress their report messages.
- In IGMPv1, there is no election of an IGMP querier. If more than one router on the segment exists, all the routers send periodic IGMP queries.
IGMP Version 2
- IGMPv1 has been superceded by IGMPv2 (backward compatible with IGMPv1).
- Four types of IGMP messages exist:
- Membership query
- Version 1 membership report
- Version 2 membership report
- Leave group
- IGMPv2 works basically the same way as IGMPv1. The main difference is that there is a leave group message. With this message, the hosts can actively communicate to the local multicast router that they intend to leave the group.
- The router still sends out a group-specific query and determines if any remaining hosts are interested in receiving the traffic.
- If there are no replies, the router times out the group and stops forwarding the traffic.
- The leave group message guarantees that unwanted and unnecessary traffic can be stopped much sooner.
IGMP Version 3
- IGMPv3 is the next step in the evolution of IGMP.
- IGMPv3 adds support for "source filtering," which enables a multicast receiver host to signal to a router the groups from which it wants to receive multicast traffic, and from which sources this traffic is expected.
- The following types of IGMP messages exist:
- Version 3 membership query
- Version 3 membership report
- Receivers signal membership to a multicast host group in the following two modes:
- INCLUDE mode—In this mode, the receiver announces membership to a host group and provides a list of source addresses (the INCLUDE list) from which it wants to receive traffic.
- EXCLUDE mode—In this mode, the receiver announces membership to a multicast group and provides a list of source addresses (the EXCLUDE list) from which it does not want to receive traffic. The host will receive traffic only from sources whose IP addresses are not listed in the EXCLUDE list. To receive traffic from all sources, which is the behavior of IGMPv2, a host uses EXCLUDE mode membership with an empty EXCLUDE list.
- In IGMPv3, hosts send their membership reports to 224.0.0.22; all IGMPv3 routers, therefore, must listen to this address. Hosts, however, do not listen or respond to 224.0.0.22; they only send their reports to that address.
- In addition, in IGMPv3, there is no membership report suppression because IGMPv3 hosts do not listen to the reports sent by other hosts. Therefore, when a general query is sent out, all hosts on the wire respond.
IGMP Join Process
- When a host wants to join a multicast group, the host sends one or more unsolicited membership reports for the multicast group it wants to join. The IGMP join process is the same for IGMPv1 and IGMPv2 hosts.
- In IGMPv3, the join process for hosts proceeds as follows:
- When a hosts wants to join a group, it sends an IGMPv3 membership report to 224.0.0.22 with an empty EXCLUDE list.
- When a host wants to join a specific channel, it sends an IGMPv3 membership report to 224.0.0.22 with the address of the specific source included in the INCLUDE list.
- When a host wants to join a group excluding particular sources, it sends an IGMPv3 membership report to 224.0.0.22 excluding those sources in the EXCLUDE list.
IGMP Leave Process
IGMPv1 Leave Process
- There is no leave-group message in IGMPv1 to notify the router that a host no longer wants to receive multicast traffic for a specific group.
- The host simply stops processing traffic for the multicast group and ceases responding to IGMP queries with IGMP membership reports for the group.
- The only way IGMP routers know that there are no active receivers for a particular multicast group is when they stop receiving membership reports.
- A countdown timer is used to facilitate this process. When a membership report is received, the timer is reset. This timeout interval is typically three times the query interval (3 minutes).
- This timeout interval means that the router may continue to forward multicast traffic onto the subnet for up to 3 minutes after all hosts have left the multicast group.
IGMPv2 Leave Process
- IGMPv2 incorporates a leave-group message to notify the router to stop receiving multicast traffic for a specific group.
- When an IGMPv2 host leaves a multicast group, if it was the last host to respond to a query with a membership report for that group, it sends a leave-group message to the all-devices multicast group (224.0.0.2).
IGMPv3 Leave Process
- IGMPv3 enhances the leave process by introducing the capability for a host to stop receiving traffic from a particular group, source, or channel in IGMP by including or excluding sources, groups, or channels in IGMPv3 membership reports.
References
IP Multicast Technology Overview
IP Multicast: IGMP Configuration Guide, Cisco IOS Release 15M&T
STP Dispute
- The software checks the consistency of the port role and state in the received BPDUs to detect unidirectional link failures that could cause a loop.
- When a designated port detects a conflict (receives an inferior BPDU), it keeps its role, but reverts to a discarding state.
- Rapid PVST+ (802.1w) and MST BPDUs include the role and state of the sending port. With this information, switch A (root) can detect that switch B does not react to its superior BPDUs and that switch B is the designated, not root port. As a result, switch A blocks the port.
- The block is shown as an STP dispute.
STP Bridge Assurance
- Bridge Assurance is enabled by default and can only be disabled globally (available on Cisco IOS Release 12.2(33)SXI and later).
- Only enabled on STP network ports that are point-to-point links.
- Both ends of the link must have Bridge Assurance enabled.
- If the device on one side of the link has Bridge Assurance enabled and the device on the other side either does not support Bridge Assurance or does not have this feature enabled, the connecting port is blocked.
- With Bridge Assurance enabled, BPDUs are sent out on all operational network ports, including alternate and backup ports, for each hello time period.
- If the port does not receive a BPDU for a specified period, the port moves into an inconsistent state (blocking). and is not used in the root port calculation.
- Once that port receives a BPDU, it resumes the normal spanning tree transitions.
- Recommended to enable Bridge Assurance throughout the network.
References
Spanning-Tree Dispute Mechanism
Understanding Bridge Assurance
Loop Guard
- When a redundant port no longer receives BPDUs, the STP conceives that the topology is loop free. Eventually, the blocking port (alternate or backup port) becomes designated and moves to a forwarding state. This situation creates a loop.
- The loop guard feature makes additional checks.
- If BPDUs are not received on a non-designated port, and loop guard is enabled, that port is moved into the STP loop-inconsistent blocking state, instead of the listening / learning / forwarding state.
- Once the BPDU is received on a port in a loop-inconsistent STP state, the port transitions into another STP state. According to the received BPDU, this means that the recovery is automatic and intervention is not necessary.
- Loop guard must be enabled on the non-designated ports (more precisely, on root and alternate ports) for all possible combinations of active topologies.
- Loop guard can only be enabled on point-to-point links.
- Loop guard does not work with PortFast or root guard.
- Loop guard and UDLD functionality overlap.
- Both protect against STP failures caused by unidirectional links.
- The highest level of protection is provided when both UDLD and loop guard are enabled.
- Enable with the spanning-tree guard loop command.

Root Guard
- The administrator can set the root bridge priority to 0 in an effort to secure the root bridge position. But there is no guarantee against a bridge with a priority of 0 and a lower MAC address.
- The root guard feature provides a way to enforce the root bridge placement in the network.
- The root guard ensures that the port on which root guard is enabled is the designated port.
- If the bridge receives superior BPDUs on a root guard-enabled port, root guard moves this port to a root-inconsistent STP state, which is effectively equal to a listening state. No traffic is forwarded across this port.
- Root guard is mutually exclusive with loop guard.
- Root guard is used on designated ports, and it does not allow the port to become non-designated. Loop guard works on non-desginated ports and does not allow the port to become designated through the expiration of MaxAge.
- When loop guard is configured on the port, it disables root guard configured on the same port.
- You must enable root guard (spanning-tree guard root) on all ports where the root bridge should not appear.
References
STP Enhancements Using Loop Guard and BPDU Skew Detection Features
STP Root Guard Enhancement