Sunday, January 31, 2016

CCIE 400-101: Layer 2 Technologies - LACP, PAgP, manual, load balancing, EtherChannel misconfiguration guard

Overview

  • EtherChannel allows multiple physical links to combine into one logical channel. 
  • This allows load sharing of traffic among the links in the channel as well as redundancy in the event that one or more links in the channel fail. 
  • Each EtherChannel can consist of up to eight compatibly configured Ethernet ports.
  • The following settings must be identical for all EtherChannel member ports :
    • Speed settings
    • Duplex settings
    • STP settings
    • VLAN membership (for access ports)
    • Native VLAN (for trunk ports)
    • Allowed VLANs (for trunk ports)
    • Trunking encapsulation protocol (for trunk ports) 
  • When an EtherChannel is configured in either PAgP or LACP mode, the system negotiates with the other end of the channel to determine which ports should become active. If the remote port cannot negotiate an EtherChannel, the local port is put into an independent state and continues to carry data traffic as would any other single link. 
  • When an EtherChannel is in the on mode, no negotiations take place. The switch forces all compatible ports to become active in the EtherChannel. 
  • After an EtherChannel is configured, the physical ports assigned to the port-channel inherit configuration changes applied to the port-channel. 
  • Configuration changes applied to the physical port affect only the port where you apply the configuration.

PAgP

  • PAgP is a Cisco-proprietary protocol. 
  • PAgP has two modes: auto and desirable. 
  • auto: Places a port into a passive negotiating state, in which the port responds to PAgP packets it receives but does not start PAgP packet negotiation. 
  • desirable: Places a port into an active negotiating state, in which the port starts negotiations with other ports by sending PAgP packets. 
  • A port in the auto mode cannot form an EtherChannel with another port that is also in the auto mode because neither port starts PAgP negotiation.
  • The PAgP silent/non-silent submode is a complete mystery. The documentation says that silent mode should be used for connections to servers that do not support PAgP. This silent mode would allow the channel to form without receiving any PAgP packets from the other side. This does not make any sense! How can a channel be negotiated if the other device does not speak PAgP? The documentation further states that if not specified, silent mode is assumed. In that case, auto and auto should be able to form an EtherChannel (not tested). 
  • Trunk ports send and receive PAgP protocol data units (PDUs) on the lowest numbered VLAN.  
  • In Layer 2 EtherChannels, the first port in the channel that comes up provides its MAC address to the EtherChannel. If this port is removed from the bundle, one of the remaining ports in the bundle provides its MAC address to the EtherChannel. 
  • For Layer 3 EtherChannels, the MAC address is allocated by the stack master as soon as the interface is created. 

LACP

  • LACP is the standards-based equivalent of PAgP, defined in IEEE 802.3ad. 
  • Two modes: active and passive. 
  • active: Places a port into an active negotiating state in which the port starts negotiations with other ports by sending LACP packets. 
  • passive: Places a port into a passive negotiating state in which the port responds to LACP packets that it receives, but does not start LACP packet negotiation. This setting minimizes the transmission of LACP packets. 
  • Ports can form an EtherChannel when they are in different LACP modes as long as the modes are compatible.
    • active and active/passive will form an EtherChannel 
    • passive and passive will not because neither port starts LACP negotiation. 
  • Configure a LACP EtherChannel with up to16 Ethernet ports of the same type. Up to eight ports can be active, and up to eight ports can be in standby mode. 
  • If you configure more than eight links for an EtherChannel group, the software automatically decides which of the hot-standby ports to make active.  
  • Four elements affect this decision:
    • LACP system priority
    • System ID (the switch MAC address)
    • LACP port priority
    • Port number 
  • Numerically lower values have higher priority. 
  • Determining which ports are active and which are hot standby is a two-step procedure. 
    • First, the system looks at the system priority and system ID to choose a "master" switch. 
    • Second, active and standby ports are decided based on the "master's" port priority and port number values. 
    • The port priority and port number of the other switch are not used.

Manual

  • EtherChannel on mode can be used to manually configure an EtherChannel.
  • The on mode forces a port to join an EtherChannel without negotiations.
  • Useful if the remote device does not support PAgP or LACP.
  • Caution: If the group is misconfigured, packet loss or spanning-tree loops can occur.
  • The command is channel-group <id> mode on.

Layer 2, Layer 3

  • The main difference between configuring a Layer 2 or Layer 3 EtherChannel is using the no switchport command to change the interfaces from Layer 2 to Layer 3 mode.
  • In Layer 3 EtherChannels, the IP address is configured under the logical port-channel interface.

Example:

-- Layer 2 --

interface range fa0/13 - 15
 switchport mode access
 switchport access vlan 10
 channel-group 1 mode active


S1# show etherchannel summary
Flags:  D - down        P - bundled in port-channel
        I - stand-alone s - suspended
        H - Hot-standby (LACP only)
        R - Layer3      S - Layer2
        U - in use      f - failed to allocate aggregator

M - not in use, minimum links not met
        u - unsuitable for bundling
        w - waiting to be aggregated
        d - default port

Number of channel-groups in use: 1
Number of aggregators:           1

Group  Port-channel  Protocol    Ports
------+-------------+-----------+-----------------------------------------------
1      Po1(SU)         LACP      Fa0/13(P)   Fa0/14(P)   Fa0/15(P)   


-- Layer 3 --

interface range fa0/13 - 15
 no switchport
 channel-group 1 mode active
! 
interface Po1
 ip address 192.168.100.1 255.255.255.0
 no shutdown

S1# show etherchannel summary
Flags:  D - down        P - bundled in port-channel
        I - stand-alone s - suspended
        H - Hot-standby (LACP only)
        R - Layer3      S - Layer2
        U - in use      f - failed to allocate aggregator

M - not in use, minimum links not met
        u - unsuitable for bundling
        w - waiting to be aggregated
        d - default port

Number of channel-groups in use: 1
Number of aggregators:           1

Group  Port-channel  Protocol    Ports
------+-------------+-----------+-----------------------------------------------
1      Po1(RU)         LACP      Fa0/13(P)   Fa0/14(P)   Fa0/15(P)   


Load Balancing

  • EtherChannel frame distribution uses a Cisco-proprietary hashing algorithm.
  • The algorithm is deterministic; if you use the same addresses and session information, you always hash to the same port in the channel.
  • This method prevents out-of-order packet delivery.
  • The Cisco-proprietary hash algorithm computes a value in the range 0 to 7.
  • With this value as a basis, a particular port in the EtherChannel is chosen.
  • This table lists the ratios of the values that each port accepts, which depends on the number of ports in the EtherChannel: 

  • Hence, in essence, you can only achieve perfect load balancing, even with random addresses, if you have two, four, or eight ports in the port channel.
  • EtherChannel load balancing can use MAC addresses, IP addresses, or Layer 4 port numbers and either source mode, destination mode, or both.
  • The mode you select applies to all EtherChannels that you configure on the switch.
  • Use the option that provides the greatest variety in your configuration.
  • Issue the port-channel load-balance {src-mac | dst-mac | src-dst-mac | src-ip | dst-ip | src-dst-ip | src-port | dst-port | src-dst-port | mpls} global configuration command in order to configure the load balancing.

EtherChannel Misconfiguration Guard

  • A misconfiguration can occur if the interfaces on the local switch are configured in an EtherChannel, but the interfaces on the other device are not.
  • The misconfiguration is detected by comparing the source MAC address of the incoming BPDUs.
  • If the switch sees different source MAC addresses (correctly bundled ports share a common MAC address), the ports are put in the err-disabled state and an error message is logged.
  • Use the spanning-tree etherchannel guard misconfig command to enable the feature (enabled by default).

References

Configuring EtherChannels
Understanding EtherChannel Load Balancing and Redundancy on Catalyst Switches
EtherChannel Considerations

Monday, January 25, 2016

CCIE 400-101: Layer 2 Technologies - VTPv3

Overview 


VTPv3 extends and enhances the functionality of VTP from previous versions. The operation of VTP is improved in three major areas:
  • more secure administrative control: only a predefined device is allowed to update the VLAN topology
  • extended functionality: VTPv3 supports the advertisement of extended range and private VLAN information
  • support for MST

VTPv3 still retains the same core operation as previous versions.  A VTP update message can be sent over a trunk but not over access ports or Layer 3 interfaces. Only devices in the same VTP domain are able to exchange and process VTP information.

In previous versions a new switch with the default domain name of NULL used the domain name of the first VTP message that it received. This behavior has changed with VTP version 3, which now requires manual configuration prior to enabling VTPv3.

Catalyst6500-1(config)# vtp version 3
Cannot set the version to 3 because domain name is not configured.


VTP messages that include a mismatching domain name are ignored and dropped.

Since the functional base in VTP version 3 is left unchanged from VTP version 2, so backward compatibility is built in. It is possible, on a per link basis, to automatically discover and support VTP version 2 devices


VTPv3 Enhancements


VTP version 3 added a number of enhancements to VTP version 1 and 2, including the following:
  • support for extended range and private VLANs
  • feature enhancement beyond support for a single database or VTP instance (MST support)
  • protection from unintended database overrides
  • option for clear-text or hidden password protection
  • configuration option on a per-port basis instead of only on a global scheme
  • optimized resource handling and more efficient transfer of information

While VTP version 1 and 2 interacted with the VLAN process directly, VTP version 3 introduces the concept of transferring opaque databases. This approach provides expanded usability,  allowing independent databases (or tables) aka VTP instances that go beyond just serving the VLAN environment. VTP version 3 supports a VLAN instance and a separate MST instance.

In VTP version 3, the configuration revision number works the same as in previous versions, but only a specific devices in the domain, a primary server, is allowed to update other devices.


VTPv3 Operation

 

In addition to the three well-known roles (server, client, and transparent), a fourth role (off) is now available.

Transparent: Holds a locally created configuration on permanent storage (NVRAM). Does not
originate or evaluate received VTP advertisements. Relays received VTP messages on trunks if the STP state for VLAN 1 is forwarding. A domain check, as in VTP version 1, is not implemented.

Client: Holds received VTP information in temporary storage space. Local configuration is not
possible. The default MST configuration will be used at boot time until a VTP version 3
message arrives.

Off: Contrary to the transparent mode, the switch will not relay received VTP messages. Off
mode can be configured globally or on a per port basis. Formerly available only in CAT OS.

Server: VTPv3 expands and enhances the server role. By default, the secondary server subtype is applied. Only one server per domain can be prompted to be a primary server. Manual configuration on a secondary server locally is not possible. The role of a primary server for the VLAN database and MST database can be divided among two different physical devices if desired. When a device is designated as the primary server, a sanity check is performed in the domain. A warning message is generated if a conflicting device is discovered. The sanity check can be skipped be issuing the force keyword. If a secondary server is promoted to become a primary server without specifying VLAN or MST, the VLAN isntance is assumed.


Message Protection and Security

 

With VTPv3, two password configuration options are available: hidden and secret. When the hidden option is used, the password is not stored in a readable format. The password can no longer be viewed by a show command or inspected in the vlan.dat file. If the hidden option is applied, the administrator will be prompted to enter the password, when promoting a secondary server to a primary server. A former primary server that is reconnected to a domain after a reload will automatically revert to secondary server mode.


VTP Interoperability

 

VTPv3 operates with VTPv2 but not with VTPv1.  Devices running VTPv1, and capable of running VTPv2, will be triggered to run VTPv2 by a VTPv3 device. There is no interaction available for VTPv1-only devices. Therefore, before implementing VTPv3, it is recommended to verify that all switches in the existing or prospective VTP domain will be capable of running VTPv2 at a minimum.  After receiving VTPv2 advertisements, a VTPv3 sends both VTPv3 and VTPv2-compatible messages.


Risks and Dependencies

 

The risks of using VTPv3 are minimal, practically none worth mentioning. The only major consideration involves the interoperability issues related to using different versions of VTP and the general design of the VTP domain.  Further, a software upgrade might be required because VTPv3 is available starting from the 12.2(33)SXI code version.


Further Reading

VTP Version 3

CCIE 400-101: Layer 2 Technologies - VTPv1, VTPv2, VTP pruning, manual pruning

VTPv1, VTPv2

  • Problem: As the Layer 2 network size grows, managing VLAN information involves large administrative overhead.  Modifying VLAN databases on each switch individually would require a considerable amount time and effort. 
  • VTP was introduced to automate the propagation of VLAN information throughout the switched network.  
  • VTP is a Cisco proprietary protocol that dynamically advertises the properties of VLANs (addition, removal, or other changes).  
  • VTP version 1 and version 2 support only normal-range VLANs (VLAN IDs 1 to 1005).  
  • Extended range VLANs (VLANs 1006 to 4094) are supported only in VTPv3. 
  • A switch can be in only one VTP domain. 
  • By default, the switch is in the VTP null domain until it receives an advertisement for a domain or until a domain name is configured. 
  • Until the management domain name is specified or learned, the VLAN information is not propagated over the network. 
  • The switch inherits the VTP domain name and the VTP configuration revision number. 
  • The switch then ignores advertisements with a different domain name or an earlier configuration revision number.  
  • Before adding a VTP client switch to a VTP domain, always verify that its VTP configuration revision number is lower than the configuration revision number of the other switches in the VTP domain. 
  • If you add a switch that has a revision number higher than the revision number in the VTP domain, it can erase all VLAN information from VTP domain. 
  • VTP Server: you can create, modify, and delete VLANs, and specify other configuration parameters (such as the VTP version) for the entire VTP domain. 
  • VTP Client: behaves like a VTP server and transmits and receives VTP updates on its trunks, but you cannot create, change, or delete VLANs. 
  • VTP Transparent: does not participate in VTP. A VTP transparent switch does not advertise its VLAN configuration and does not synchronize its VLAN configuration based on received advertisements but does forward them to other switches. 
  • VTP Off:  functions in the same manner as a VTP transparent switch, except that it does not forward VTP advertisements.  
  • Each switch in the VTP domain sends periodic advertisements from each trunk port to a reserved multicast address. 
  • VTP advertisements can only be sent over a trunk link.
  • There are four different VTP advertisement types: Summary Advertisement, Subset Advertisement, Advertisement Request, and Join message.
  • Summary Advertisement: By default, Catalyst switches send summary advertisements at 5-minute intervals. Summary advertisements inform adjacent switches of the current VTP domain name and the configuration revision number. When the switch receives a summary advertisement packet, the switch compares the VTP domain name to its own VTP domain name. If the name is different, the switch simply ignores the packet. If the name is the same, the switch then compares the configuration revision to its own revision. If its own configuration revision is higher or equal, the packet is ignored.  If it is lower, an advertisement request is sent.
  • Subset Advertisement: One or several subset advertisements follow the summary advertisement. A subset advertisement contains a list of VLAN information.
  • Advertisement Request: Sent if the switch has been reset, the VTP domain name has changed, or the switch has received a VTP summary advertisement with a higher configuration revision than its own. VTP summary advertisement and subsequent subset advertisements are sent in response.
  • Join Message: Originated by each VTP Server and Client switch periodically every 6 seconds if VTP pruning is enabled. Join messages contain a bit field that, for each VLAN in the normal range, indicates whether the VLAN is active or unused (that is, pruned). 
  • By default, VTP operates in version 1.
  • VTPv2 supports the following features that are not supported by VTPv1:
    • Token Ring
    • Unrecognized TLVs: VTP propagates advertisements even for TLVs it is not able to parse.
    • Version-Dependent Transparent mode: In VTP version 1, a VTP transparent switch inspects VTP messages for the domain name and version and forwards a message only if the version and domain name match. Because VTP version 2 supports only one domain, it forwards VTP messages in transparent mode without inspecting the version and domain name. (This is a myth! See: Old CCIE Myths: VTP.)
    • Consistency checks: things like VLAN names and values are checked only when new information is entered. Consistency checks are not performed when information is read from a new VTP advertisement or NVRAM.



VTP Pruning

  • VTP pruning offers a dynamic mechanism that automatically configures the allowed VLAN lists on trunks within a VTP domain.
  • Based upon whether or not a switch has ports currently active within a VLAN, the switch dynamically indicates to the remote switch on the other side of a trunk that the traffic within the inactive VLAN not be forwarded across a trunk.
  • VTP pruning blocks unneeded flooded traffic to VLANs on trunk ports that are included in the pruning-eligible list.
  • Only VLANs included in the pruning-eligible list can be pruned (VLANs 2-1001 by default).
  • Extended-range VLANs are pruning-ineligible.
  • VTP pruning is supported in all VTP versions.
  • Enabling VTP pruning on a VTP server enables pruning for the entire management domain.
  • Making VLANs pruning-eligible or pruning-ineligible affects pruning eligibility for those VLANs on that trunk only (not on all switches in the VTP domain).
  • VTP pruning is not designed to function in VTP transparent mode.
  • VTP pruning is disabled by default.
  • Enable VTP pruning on the VTP server with the vtp pruning command. 
  • To configure VTP pruning on an interface, use the switchport trunk pruning vlan x,y-z.
  • VTP pruned VLANs on a trunk are still part of spanning tree. Effectively, VTP pruning does not decrease the number of spanning tree instances.

Manual Pruning

  • By default, trunk ports permit traffic for all VLANs. 
  • VTP pruning can only instruct a switch to not request traffic for specific VLANs. 
  • Manual pruning allows an administrator to explicitly decide which VLANs can traverse across the link. 
  • The command to do this is switchport trunk allowed vlan x,y-z.
  • This is the best method to prune VLANs because it limits the number of spanning tree instances to the number of VLANs allowed on the trunk.

Example:

interface FastEthernet0/3
 switchport trunk allowed vlan 10,20,99

S3# show interfaces trunk
Port        Mode    Encapsulation    Status    Native vlan
Fa0/3       on      802.1q           trunking  99
Port        Vlans allowed on trunk
Fa0/3       10,20,99
Port        Vlans allowed and active in management domain
Fa0/3       10,20,99
Port        Vlans in spanning tree forwarding state and not pruned
Fa0/3       10,20,99

References

Configuring VTP
Understanding VLAN Trunk Protocol (VTP)

Saturday, January 16, 2016

CCIE 400-101: Layer 2 Technologies - Access Ports, VLAN Database, Normal and Extended Range VLANs, Voice VLAN

Access Ports

  • An access port belongs to and carries the traffic of only one VLAN (unless it is configured as a voice VLAN port).  
  • Traffic is received and sent in native formats with no VLAN tagging.  
  • Traffic arriving on an access port is assumed to belong to the VLAN assigned to the port. 
  • If an access port receives an 802.1Q tagged packet, the packet is dropped, and the source MAC address is not learned.  
  • Two types of access ports: static and dynamic. 
  • Static access ports are manually assigned to a VLAN with the switchport access vlan <vlan-id> command. 
  • When a port is configured as dynamic, it receives VLAN information based on the MAC-address of incoming packets. A centralized VLAN Membership Policy Server (VMPS) is used to handle the VLAN assignment. The VMPS contains a database of VLAN-to-MAC address mappings, which it then references to send the correct VLAN information to the switch.

VLAN Database

  • By default, VLAN information is saved into the vlan.dat file, which is stored in NVRAM. 
  • This means that even if the startup configuration is erased and the switch is reloaded, the VLANs are still there (as viewed with the show vlan brief command). 
  • VLANs have a variety of configurable parameters, including name, type, and state. 
  • Most commonly, VLANs are given an ID and a name. 

Example:

vlan 10
 name CCIE


  • VLANs can be configured either in global configuration mode (above) or VLAN database configuration mode.
  • The VLAN database mode is deprecated and does not support the creation of extended range VLANs.
  • In VTP Transparent mode, the VLANs will also be saved in the running/startup configuration.
  • The vtp file <name> command specifies the VLAN database file. 
  • During boot up, the switch compares the content in the vlan.dat file and the configuration in startup-config to determine if it should use the configuration in vlan.dat or startup-config. 
  • The VTP and VLAN configurations are selected by these conditions: 
    • If both the VLAN database and the configuration file show the VTP mode as transparent and the VTP domain names match, the VLAN database is ignored. The VTP and VLAN configurations in the startup configuration file are used. The VLAN database revision number remains unchanged in the VLAN database. 
    • If the startup VTP mode is server mode, or the startup VTP mode or domain names do not match the VLAN database, VTP mode and VLAN configuration for the first 1005 VLANs are selected by VLAN database information, such as the vlan.dat file. VLANs greater than 1005 are configured from the switch configuration file. 
  • If there is no vlan.dat file, or if the vlan.dat cannot be read, the switch boots with these characteristics:
    • VTP Mode: Server
    • VTP Domain: (no name / empty)
    • VLANs: 1, 1002-1005

Normal and Extended Range VLANs

  • Switches support 4096 VLANs in accordance with the IEEE 802.1Q standard. 
  • These VLANs are organized into two distinct ranges: normal range and extended range. 
  • There are also special purpose VLANs. 
  • VLANs 0 and 4095 are reserved for sytem use only. You cannot see or use these VLANs. 
  • VLAN 1 and VLANs 1002-1005 are default VLANs. Default VLANs are created automatically and cannot be configured or deleted by users. 
  • Extended range VLANs are not stored in the VLAN database.  
  • The switch must be in VTP transparent mode when you create extended range VLANs (except VTPv3). 
  • Before configuring extended-range VLANs, enter the show vlan internal usage privileged EXEC command to see which VLANs have been allocated as internal VLANs.  
  • If you configure a VLAN number that matches the number of an existing internal VLAN, an error message appears and the extended VLAN configuration is denied.  
  • VLANs in the extended range cannot be pruned. The VLAN range for the switchport trunk pruning vlan command remains 1-1005. 

Voice VLAN

  • The voice VLAN feature enables access ports to carry IP voice traffic from an IP phone.
  • You can configure an access port with an attached Cisco IP Phone to use one VLAN for voice traffic and another VLAN for data traffic from a device attached to the phone.
  • The interface supporting a voice VLAN is a mystical case between an access port and a trunk port. Cisco officially calls it a multi-VLAN access port.
  • Sometimes it is referred to as "special 802.1Q trunk" or "mini-trunk".
  • This "multi-VLAN access port" allows only two distinct VLANs (voice and data).
  • The data traffic is untagged.
  • The voice traffic is tagged.
  • The switch communicates the voice VLAN ID to the IP phone using CDP.
  • Voice VLAN support is enabled by adding a single command: switchport voice vlan <vlan-id>.

Example:

interface FastEthernet0/1
 switchport mode access
 switchport access vlan 100
 switchport voice vlan 200

sw1#sh int f0/1 switchport
Name: Fa0/1
Switchport: Enabled
Administrative Mode: static access
Operational Mode: static access

Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: native
Negotiation of Trunking: Disabled
Access Mode VLAN: 100 (VLAN0100)
Trunking Native Mode VLAN: 1 (default)
Trunking VLANs Enabled: ALL
Trunking VLANs Active: 100
Priority for untagged frames: 0
Override vlan tag priority: FALSE
Voice VLAN: 200
Appliance trust: none



References 

Managing vlan.dat in Cisco IOS
Extended VLAN ID
Good Explanation of the Voice VLAN

Friday, January 15, 2016

CCIE 400-101: Layer 2 Technologies - dot1q, Native VLAN

dot1Q

  • IEEE 802.1Q (dot1q) is a industry standards based implementation of carrying traffic for multiple VLANs over a single trunk link between two Ethernet switches.
  • This means adding an identifier (tag) to frames to indicate what VLAN the frame belongs to.
  • 802.1Q does not encapsulate the original frame. Instead, for Ethernet frames, it adds a 32-bit (4-byte) field between the source MAC address and the EtherType/Length fields of the original frame.

  • TPID - Tag Protocol Identifier (16 bits): set to a value of 0x8100 to identify the frame as an IEEE 802.1Q tagged frame. 
  • Priority (3 bits): indicates the priority level (0 through 7) used for QoS. 
  • CFI - Canonical Format Indicator (1 bit): specifies if the MAC address is in noncanonical (1) or canonical (0) format. 
  • VID - VLAN Identifier (12 bits): uniquely identifies the VLAN which the frame belongs to.

 

Native VLAN

  • In short, the ONLY difference between a regular VLAN and the native VLAN is that frames from/to the native VLAN are carried untagged. 
  • As explained in dot1q section, VLANs are identified by adding a tag to the frame. 
  • What happens if a trunk port receives a frame without this tag? Which VLAN does the frame belong to? 
  • Answer: the native VLAN. 
  • If a switch receives an untagged frame, it associates that frame to the native VLAN. 
  • When a switch sends out a frame belonging to the native VLAN, it removes the tag. 
  • The native VLAN is configurable on a per port basis with the switchport trunk native vlan <vlan-id> command. 
  • The default native VLAN is VLAN 1.

References

ISL and IEEE 802.1Q Frame Format
VLAN Trunking Using IEEE 802.1Q
Network Engineering Stack Exchange - 19377

Sunday, January 10, 2016

CCIE 400-101: Layer 2 Technologies - CDP, LLDP, UDLD

CDP 

  • The Cisco Discovery Protocol (CDP) is a proprietary Layer 2 protocol used to share information about other directly connected Cisco equipment.
  • CDP runs on all of the following Cisco manufactured equipment: routers, switches, bridges, and access servers.
  • A Cisco device enabled with CDP sends out periodic interface updates every 60 seconds to a multicast address 01-00-0c-cc-cc-cc in order to make itself known to neighbors.
  • The holdtime specifies the lifetime of an entry in the table - if no announcements are received from a device for a period in excess of the holdtime, the device information is discarded (default 180 seconds).
  • Cisco devices never forward CDP packets.
  • CDP can also be used for On-Demand Routing (ODR), which is a method of including routing information in CDP announcements so that dynamic routing protocols do not need to be used in simple networks.
  • CDP is enabled by default, but can be globally disabled with the no cdp run command or per interface with the no cdp enable command.
  • The show cdp neighbors command displays this information:
    • type of device that is discovered
    • name of the device
    • number and type of the local interface (port)
    • number of seconds the CDP advertisement is valid for the port
    • device type
    • device product number
    • port ID
  • The details contained in CDP announcements is easily extended due to the use of the type-length-value (TLV) frame format.

Example:

Router#show cdp neighbors
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
                  S - Switch, H - Host, I - IGMP, r - Repeater

Device ID        Local Intrfce     Holdtme    Capability  Platform  Port ID
R2-AGS           Ser 1              129          R        2500      Ser 0
R6-2500          Eth 0              144          R        4000      Eth 0
Router#


  • The show cdp neighbors detail and show cdp entry commands displays additional information about the neighboring devices that include network-layer protocol information and version.

Example:

router#show cdp neighbors detail
-------------------------
Device ID: lab-7206
Entry address(es):
IP address: 172.19.169.83
Platform: cisco 7206VXR, Capabilities: Router
Interface: Ethernet0, Port ID (outgoing port): FastEthernet0/0/0
Holdtime : 123 sec
Version :
Cisco Internetwork Operating System Software
IOS (tm) 5800 Software (C5800-P4-M), Version 12.1(2)
Copyright (c) 1986-2002 by Cisco Systems, Inc.
advertisement version: 2
Duplex: half
-------------------------
Device ID: lab-as5300-1
Entry address(es):
IP address: 172.19.169.87
Platform: cisco AS5300, Capabilities: Router
--More--

 

router#show cdp entry lab-7206
-------------------------
Device ID: lab-7206
Entry address(es):
IP address: 172.19.169.83
Platform: cisco 7206VXR, Capabilities: Router
Interface: Ethernet0, Port ID (outgoing port): FastEthernet0/0/0
Holdtime : 123 sec
Version :
Cisco Internetwork Operating System Software
IOS (tm) 5800 Software (C5800-P4-M), Version 12.1(2)
Copyright (c) 1986-2002 by Cisco Systems, Inc.
advertisement version: 2
Duplex: half



  • CDP can also be enabled/disabled per interface with the [no] cdp enable command.
  • To enable Cisco Discovery Protocol Version 2 (CDPv2) advertising functionality on a device, use the cdp advertise-v2 command.
  • CDPv2 has three additional type-length values (TLVs): VTP Management Domain Name, Native VLAN, and full/half-Duplex.

LLDP

  • The Link Layer Discovery Protocol (LLDP) is basically a standards-based (IEEE 802.1AB) equivalent of the Cisco proprietary CDP. 
  • Similar to CDP, LLDP also advertises and receives information about identity and capabilities between Layer 2 peers. 
  • LLDP Data Units (LLDPDUs) are sent to the multicast destination MAC address01:80:c2:00:00:0e.
    This address is defined within a range of addresses reserved by the IEEE for protocols that are to be constrained to an individual LAN. 
  • LLPDUs are not forwarded to other switches. 
  • See: Tutorial on the Link Layer Discovery Protocol.

UDLD

  • Problem:  If a blocking port stops receiving BPDUs from its upstream (designated) switch on the port, STP eventually ages out the STP information for the port and moves it to the forwarding state. This creates a forwarding loop. 
  • How is it possible for the switch to stop receiving BPDUs while the port is up? The reason is unidirectional link. 
  • A link is unidirectional when both sides of the connection are up but the local side is not receiving the packets sent by the remote side while remote side receives packets sent by local side. 
  • To detect a unidirectional link before a forwarding loop is created, Cisco developed the (aptly named) UDLD protocol. 
  • UDLD is a Layer 2 protocol that works with the Layer 1 mechanisms to determine the physical status of a link. At Layer 1, auto-negotiation takes care of physical signaling and fault detection. UDLD performs tasks that auto-negotiation cannot perform, such as detecting the identities of neighbors and shutting down misconnected ports. 
  • UDLD works by exchanging protocol packets between the neighboring devices using the multicast MAC address 01:00:0C:CC:CC:CC. 
  • Both devices on the link must support UDLD and have it enabled on respective ports. 
  • Each switch port configured for UDLD sends UDLD protocol packets that contain the port's own device/port ID, and the neighbor's device/port IDs seen by UDLD on that port.  
  • Neighboring ports should see their own device/port ID (echo) in the packets received from the other side. 
  • If the port does not see its own device/port ID in the incoming UDLD packets for a specific duration of time, the link is considered unidirectional. 
  • UDLD can operate in two modes: normal and aggressive. 
  • In normal mode, if the link state of the port was determined to be bi-directional and the UDLD information times out, no action is taken by UDLD. The port state for UDLD is marked as undetermined. The port behaves according to its STP state. 
  • In aggressive mode, if the link state of the port is determined to be bi-directional and the UDLD information times out while the link on the port is still up, UDLD tries to re-establish the state of the port by sending a UDLD frame 8 times every 1 second. If not successful, the port is put into the errdisable state. 
  • UDLD should be able to detect an unidirectional link before STP would unblock the port due to missed BPDUs. Thus, when you configure UDLD timers, make sure your values are set so that unidirectional link is detected before “STP MaxAge + 2xForwardDelay” expires.
  • In order for a link to become “Bidirectional”, UDLD process should first hear an echo packet with it’s own ID from a peer on the other side.
  • This prevents link from becoming errdisabled when you configure aggresive mode just on one side. The UDLD state of such link will be “Unknown”.

Example:

Switch# show udld f0/13

Interface Fa0/13
---
Port enable administrative configuration setting: Enabled
Port enable operational state: Enabled
Current bidirectional state: Unknown
Current operational state: Advertisement
Message interval: 7
Time out interval: 5
No neighbor cache information stored


  • The problem of unidirectional links usually occurs on fiber-optic links and is not common on copper connections.
  • To enable UDLD on all fiber-optic interfaces, use the global command udld enable (normal mode) or udld aggressive (aggressive mode).
  • To enable UDLD individually on specific ports (copper or fiber), use the udld port [aggressive] command.

Example:

Switch(config)# interface f0/13
Switch(config-if)# udld port aggressive

 

Switch# show udld f0/13

Interface Fa0/13
---
Port enable administrative configuration setting: Enabled / in aggressive mode
Port enable operational state: Enabled / in aggressive mode
Current bidirectional state: Bidirectional
Current operational state: Advertisement - Single neighbor detected
Message interval: 7
Time out interval: 5



  • To restore interfaces from the error-disabled state, you can use either the udld reset command or configure errdisable autorecovery as described in a previous post.

References
CDP on Cisco Routers and Switches Running IOS
Link Layer Discovery Protocol (LLDP, IEEE 802.1AB)
Understanding and Configuring UDLD 
UDLD Modes of Operation
UDLD

Wednesday, January 6, 2016

CCIE 400-101: Layer 2 Technologies - Managing MAC address table, errdisable recovery, L2 MTU

Managing MAC address table

  • The MAC address table contains address information that the switch uses to forward traffic between ports. 
  • Two types of addresses: 
    • Dynamic: a source MAC address that the switch learns from incoming frames and then ages out when it is not in use. 
    • Static: a manually entered address that does not age and is not lost when the switch reloads. 
  • The MAC address table also lists the associated VLAN ID and the port number with the MAC address. 
  • By default, MAC address learning is enabled on all interfaces and VLANs on the switch. 
  • MAC address learning can be disabled (except for internal VLANs) but it is not recommended. 
  • Cisco guides that you should disable MAC address learning only in VLANs with two ports. If you disable MAC address learning on a VLAN with more than two ports, every packet entering the switch is flooded in that VLAN domain. 
  • MAC address learning can be disabled for a single VLAN or a range of VLANs with one command. 
  • The same principle applies to interfaces. 
  • Example: no mac address-table learning vlan 223 or no mac address-table learning vlan 1-10,15.
  • The show mac address-table command with different parameters displays information about the MAC address table.

errdisable recovery

  • Errdisable is a feature that automatically disables a port if the software detects an error situation on the port.
  • This means that the configuration shows the port to be enabled but IOS has effectively shut it down and no traffic is sent or received on the port.
  • To determine if a port has been error disabled, use the show interfaces command.

cat6knative#show interfaces gigabitethernet 4/1 status

Port    Name       Status       Vlan       Duplex  Speed Type
Gi4/1              err-disabled 100          full   1000 1000BaseSX


  • There are various reasons for the interface to go into errdisable. The reason can be:
    • Duplex mismatch
    • Port channel misconfiguration
    • BPDU guard violation
    • UniDirectional Link Detection (UDLD) condition
    • Late-collision detection
    • Link-flap detection
    • Security violation
    • Port Aggregation Protocol (PAgP) flap
    • Layer 2 Tunneling Protocol (L2TP) guard
    • DHCP snooping rate-limit
    • Incorrect GBIC / Small Form-Factor Pluggable (SFP) module or cable
    • Address Resolution Protocol (ARP) inspection
    • Inline power
  • To disable error-disable detection, use the no errdisable detect cause command.
  • The show errdisable detect command displays the error-disable detection status.
  • When the switch puts a port in the error-disabled state, the switch sends a message to the console that describes why it disabled the port.

Example:

%SPANTREE-SP-2-BLOCK_BPDUGUARD:
   Received BPDU on port GigabitEthernet4/1 with BPDU Guard enabled. Disabling port.


  • To recover a port in the errdisabled state, manual intervention is required. The administrator must issue shutdown and no shutdown on the port.
  • If enabled, errdisable recovery can automatically re-enable a port after a timeout period.
  • The errdisable recovery feature is disabled by default.
  • The default timeout interval is 300 seconds and, by default, the timeout feature is disabled. If any one of the errdisable recovery conditions is enabled, the ports with this condition are reenabled after 300 seconds.
  • To simultaneously enable errdisable autorecovery for all supported features, use errdisable recovery cause all. The timeout period can be adjusted with the errdisable recovery interval <sec> command.

cat6knative#show errdisable recovery
ErrDisable Reason    Timer Status
-----------------    --------------
udld                 Enabled
bpduguard            Enabled
security-violatio    Enabled
channel-misconfig    Enabled
pagp-flap            Enabled
dtp-flap             Enabled
link-flap            Enabled
l2ptguard            Enabled
psecure-violation    Enabled
gbic-invalid         Enabled
dhcp-rate-limit      Enabled
mac-limit            Enabled
unicast-flood        Enabled
arp-inspection       Enabled

Timer interval: 300 seconds

Interfaces that will be enabled at the next timeout:

Interface      Errdisable reason      Time left(sec)
---------    ---------------------    --------------
  Fa2/4                bpduguard          273


  • If any ports have been errdisabled, they will be shown at the end of show errdisable recovery output with the timeout left.
  • To fully recover a port from the errdisabled state is to find and correct the root cause.
  • If you reenable the port before you fix the root problem, the port just becomes error disabled again.

L2 MTU

  • MTU is the maximum size of the packet that can still be sent on a data link, without fragmentation. 
  • Encapsulations and type of transmission medium affect the MTU. 
  • The MTU of a higher layer must fit within the payload of the lower layer. 
  • Classic IOS and IOS XR configure the MTU differently. 
  • For instance, on IOS XR the mtu command, which sets the L2 MTU, includes the 14-byte L2 header (6-byte src MAC, 6-byte dst MAC, and 2-byte EtherType) for an Ethernet interface (without dot1q), or 4 bytes for Point-to-Point Protocol (PPP) or high-level data link control (HDLC). 
  • If the interface MTU of a non-dot1q Ethernet interface is the default of 1514 bytes, then higher layer protocols such MPLS can have a maximum MTU of 1500 bytes on that interface. This means you can fit only a 1500 byte MPLS frame (including labels) inside the Ethernet frame. You cannot configure a 1508 byte MPLS MTU on that interface if you want to allow two MPLS tags on top of a 1500 byte IPv4 packet. In order to transmit a 1508 byte MPLS frame on an Ethernet interface, the interface MTU must be increased to 1522, or higher value, in order to ensure that the L2 interface payload is large enough to carry the MPLS frame. 
  • See: MTU Behavior on Cisco IOS XR and Cisco IOS Routers.

References

Errdisable Port State Recovery on the Cisco IOS Platforms.