- 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
PortFast
- The PortFast feature was originally developed to overcome a situation where a PC was unable to obtain a DHCP address due to the port failing to transition into the forwarding state in time.
- This results from STP going through the listening and learning states, which would normally take 30 seconds.
- The PortFast feature allows the port to enter the forwarding state immediately, bypassing the listening and learning states.
- Should be configured only on edge ports connecting to end devices.
- A PortFast enabled port will continue to transmit BPDUs and participate in STP.
- If the port receives BPDUs, the PortFast feature is disabled.
- Two ways to enable PortFast: globally (spanning-tree portfast default) or per interface (spanning-tree portfast).
- Both commands enable PortFast on operational access ports.
- To enable PortFast on both access and trunk ports, use the spanning-tree portfast trunk command.
BPDU Guard
- BPDU guard prevents a port from receiving BPDUs.
- If the port still receives a BPDU, it is put in the error-disabled state.
- Much like the PortFast feature, BPDU Guard has two configuration options: globally (spanning-tree portfast bpduguard default) and per interface (spanning-tree bpduguard enable).
- If configured globally, BPDU Guard is dependent on the operational PortFast state.
- The per interface configuration unconditionally enables BPDU Guard on the port, independent of PortFast or access/trunk mode.
- There are two ways to recover an err-disabled port, either by manually re-enabling with shutdown and no shutdown commands or by configuring automatic err-disable recovery with errdisable recovery cause bpduguard.
BPDU Filter
- BPDU Filter prevents specified ports from sending or receiving BPDUs.
- Again, there are two methods to configure this feature: globally (spanning-tree portfast bpdufilter default) and per interface (spanning-tree bpdufilter enable).
- The interface configuration filters both incoming and outgoing BPDUs unconditionally – independent of the operational PortFast state or access/trunk mode. This is effectively the equivalent of turning off STP.
- The global BPDU Filter is enabled on interfaces in operational PortFast state.
- In global mode, the switch does not filter incoming BPDUs, but most (though not all) outgoing BPDUs are filtered. When a port comes up, 11 BPDUs are sent out.
- If BPDUs are received, the PortFast and BPDU Filter features are disabled.
Summary
- PortFast immediately moves the port into the forwarding state, bypassing listening and learning states.
- A PortFast enabled port will continue to transmit BPDUs.
- If a BPDU is received, PortFast is disabled.
- The switch never generates a TCN when a PortFast enabled port goes up or down.
- There is a difference between administrative and operational state.
- The spanning-tree portfast trunk command enables PortFast on both access and trunk ports.
- BPDU Guard and BPDU Filter global mode is dependent on operational PortFast.
- BPDU Guard and BPDU Filter interface mode is unconditional.
- Misconfigured BPDU Filter is much more dangerous than misconfigured PortFast, yet IOS does not generate a warning message about that.
- PortFast can create a temporary loop of max. 2 seconds (default Hello interval) until the next BPDU is received and PortFast is disabled. BPDU Filter can create a permanent loop, because all BPDUs are ignored.
- Remember the operation of STP - when BPDUs are sent and not sent.
References
Advanced STP Features: PortFast, BPDU Guard, and BPDU Filter