Sunday, July 31, 2016

CCIE 400-101: Layer 2 Technologies - IGMPv1, IGMPv2, IGMPv3

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

Sunday, July 24, 2016

CCIE 400-101: Layer 2 Technologies - STP Dispute, STP Bridge Assurance

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

Saturday, July 23, 2016

CCIE 400-101: Layer 2 Technologies - Loop Guard, Root Guard

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

Thursday, July 21, 2016

CCIE 400-101: Layer 2 Technologies - PortFast, BPDU Guard, BPDU Filter

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