Ccie en Part 01 Switch
Ccie en Part 01 Switch
802.1q Trunks
Si Si Si Si Si Si
Si Si Si Si
Si Si
VLAN Example
Consider the following
example:
Creating VLANs
By default, all interfaces belong to VLAN 1. To assign an interface to a different VLAN,
that VLAN must first be created:
Switch(config)# vlan 100
Switch(config-vlan)# name SERVERS
The first command creates VLAN 100, and enters VLAN configuration mode. The second
command assigns the name SERVERS to this VLAN.
Note that naming a VLAN is not required.
The standard range of VLAN numbers is 1 – 1005, with VLANs 1002-1005 reserved for
legacy Token Ring and FDDI purposes.
A switch operating in VTP transparent mode can additionally use the VLAN range of 1006
– 4094. These are known as extended-range VLANs.
Switch# show vlan
1 default active gi1/1-24
100 SERVERS active
1002 fddi-default suspended
1003 token-ring-default
1004 fddinet-default suspended
1005 trnet-default
suspended
Note that no interfaces have been assigned to the newly created VLAN 100 yet.
suspended
Statically Assigning VLANs
To statically assign an interface into a specific VLAN:
Switch(config)# interface gi1/10
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 100
The first command enters interface configuration mode. The second command indicates that
this is an access port, as opposed to a trunk port. This will be explained in detail shortly.
The third command assigns this access port to VLAN 100. Note that the VLAN number is
specified, and not the VLAN name.
The show vlan command should now reflect the new VLAN assignment:
Switch# show vlan
VLAN Name Status Ports
DTP has two modes to dynamically decide whether a port becomes a trunk:
Desirable – the port will actively attempt to form a trunk with the remote switch.
This is the default setting.
Auto – the port will passively wait for the remote switch to initiate the trunk.
To configure the DTP mode on an interface:
Switch(config)# interface gi2/24
Switch(config-if)# switchport mode dynamic desirable
Switch(config-if)# switchport mode dynamic auto
Trunk ports send out DTP frames every 30 seconds to indicate their configured
mode.
A trunk will form in the following configurations:
manual trunk € € manual trunk
manual trunk € € dynamic desirable
manual trunk € € dynamic auto
dynamic desirable € € dynamic desirable
dynamic desirable € € dynamic auto
A trunk will never form if the two sides of the trunk are set to dynamic auto, as both ports
are waiting for the other to initialize the trunk.
It is best practice to manually configure trunk ports, to avoid DTP negotiation errors.
DTP is also vulnerable to VLAN spoofing attacks.
To explicitly disable DTP:
Switch(config)# interface gi2/24
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport nonegotiate
DTP Dynamic Trunk Protocol
• Automatic formation of
Si
On/On Si
Note that VLANs 11-15 are not active. Most likely, no interfaces have been assigned to those VLANs.
If there are no interfaces in an active trunking state, the show interface trunk
command will return no output.
VTP VLAN Trunking Protocol
VLAN Trunking Protocol (VTP)
Maintaining a consistent VLAN database can be difficult in a large switching
environment.
Cisco’s proprietary VLAN Trunking Protocol (VTP) simplifies this management – updates
to the VLAN database are propagated to all switches using VTP advertisements.
VTP requires that all participating switches join a VTP domain. Switches must belong to
the same domain to share VLAN information, and a switch can only belong to a single
domain.
VTP Versions
There are three versions of VTP. VTP version 1 supports the standard 1 – 1005 VLAN
range. VTP version 1 is also default on Catalyst switches.
VTP version 2 introduces some additional features:
Token Ring support
VLAN consistency checks
Domain-independent transparent pass through
VTPv1 and v2 are not compatible. The VTP version is dictated by the VTP server,
discussed in detail shortly. If the VTP server is configured for VTPv2, all other switches in
the VTP domain will change to v2 as well.
Until recently, VTP Version 3 was supported on only limited Cisco switch platforms.
VTPv3 was built to be flexible, and can forward both VLAN and other database
information, such as Multiple Spanning Tree (MST) protocol.
Other enhancements provided by VTPv3 include:
Support for the extended 1006-4094 VLAN range.
Support for private VLANs.
Improved VTP authentication.
Protection from accidental database overwrites, by using VTP primary and secondary
servers.
Ability to enable VTP on a per-port basis.
VTP Modes
A switch using VTP must operate in one of three modes:
Server
Client
Transparent
VTP servers are responsible for creating, deleting, or modifying entries in the VLAN
database. Each VTP domain must have at least one VTP server, and this is the default
mode for Cisco switches.
Servers advertise the VLAN database to all other switches in the VTP domain, including
other servers. VTP servers can only advertise the standard 1-1005 VLAN range, and
advertisements are only sent out trunk ports.
VTP clients cannot modify the VLAN database, and rely on advertisements from other
switches to update VLAN information. A client will also forward VTP advertisements
out every trunk port.
VTP Virtual Trunk Protocol
• Centralised VLAN management
Set
• VTP server switch propagates VLAN VLAN 50 Pass
Through
Trun
Update
k
database to VTP client switches A Server
Transp Fare
• Runs only on trunks nt Ok, I
Trun Trun Just
• Four modes: k k Learned
Ok, I VLAN 50!
• Server: updates clients and servers Just
Learned
• Client: receive updates— cannot make changes
• Transparent: let updates pass through
VLAN 50! Client
Trun
Client B
Drop k
• Off: ignores VTP updates
VTP
Upd
ates
Off
C
Remember: switches must be in the same VTP Domain to share and accept updates to
the VLAN database. Only servers can change the VLAN database.
A VTP transparent switch maintains its own local VLAN database, and does not
directly participate in the VTP domain. A transparent switch will never accept VLAN
database information from another switch, even a server. Also, a transparent switch will
never advertise its local VLAN database to another switch.
Transparent switches will pass through advertisements from other switches in the VTP
domain. The VTP version dictates how the pass through is handled:
VTP version 1 – the transparent switch will only pass through advertisements from
the same VTP domain.
VTP version 2 – the transparent switch will pass through advertisements from
any VTP domain.
VTP Advertisements – Revision Number
Recall that updates to the VLAN database are propagated using VTP advertisements. VTP
advertisements are always sent out trunk ports, on VLAN 1.
VTP advertisements are marked with a 32-bit configuration revision number, to identify
the most current VLAN database revision. Any change to the VLAN database increments
the configuration revision number by 1. Thus, a higher number represents a newer database
revision.
A switch will only accept an advertisement if the revision number is higher than the current
VLAN database. Advertisements with a lower revision number are ignored.
Important note: While only VTP servers can change the VLAN database, VTP clients can
advertise updates, to other clients and even to a server! As long as the revision number is
higher, the switch will accept the update.
This can result in a newly-introduced switch advertising a blank or incorrect VLAN
database to all other switches in the domain. Switch ports would then lose their VLAN
memberships, resulting in a significant network outage.
This can be avoided when implementing a new switch into the VTP domain. Best practice
is to configure a new switch as a VTP client, and reset its revision number to zero before
deploying into a production network.
There are two methods of resetting the revision number to zero on a switch:
1.Change the VTP domain name, and then change it back to the original name.
2.Change the VTP mode to transparent, and then change it back to
either server or client. Transparent switches always a revision number of 0.
VTP has fallen out of favor, due to the risk of an unintentional overwrite of the VLAN
database. Until very recently, Cisco did not support VTP on the Nexus platform of
switches.
VTPv3 directly addresses this risk through the use of VTP primary and secondary servers.
Only the primary server is allowed to update the VLAN database on other switches. Only
one primary server is allowed per domain.
VTP Advertisements – Message Types
Three message types exist for VTP advertisements:
Summary Advertisement
Subset Advertisement
Advertisement Request
Both VTP servers and clients will send out a summary advertisement every 300 seconds.
Summary advertisements contain the following information about the VTP domain:
VTP version
Domain name
Configuration revision number
Time stamp
MD5 digest
Summary advertisements are also sent when a change occurs to the VLAN database. The
summary is then followed with a subset advertisement, which actually contains the full,
updated VLAN database.
A subset advertisement will contain the following information:
VTP version
Domain name
Configuration revision number
VLAN IDs for each VLAN in the database
VLAN-specific information, such as the VLAN name and MTU
Important note: Switches will only accept summary and subset advertisements if the
domain name and MD5 digest match. Otherwise, the advertisements are ignored.
If a switch receives a summary advertisement with a revision number higher than its own,
it will send out an advertisement request. VTP servers will then respond with an updated
summary and subset advertisement so that the switch can synchronize to the most current
VLAN database.
A switch that is reset or newly joined to the VTP domain will also send out an
advertisement request.
Configuring VTP
By default, a switch is in VTP server mode, and joined to a blank domain labeled NULL.
To change the VTP domain name:
Switch(config)# vtp domain MYDOMAIN
Note that the domain name is case sensitive. To configure the VTP mode:
2.5
Time to Converge in Seconds
1.5 Si
Two Seconds
1 of Delay/Loss
Tuned Away
0.5
Voice Data
0
Trunking Desirable Trunking Nonegotiate
Ether Channel
Configuration
•Typically deployed in distribution to core, and core
to core interconnections
peering complexity
• Tune L3/L4 load balancing hash to achieve
Layer 3 Layer 3 Equal
maximum utilisation of channel members Equal Cost Cost
Links Si Si
Links
• Deploy in powers of two (two, four, or
eight)
Si Si Si Si
The remote switch must also have the EtherChannel manually configured as on. Remember
that speed, duplex, VLAN, and STP configuration must be configured identically across all
participating ports on both switches.
The channel-group number identifies the EtherChannel on the local switch. This number does
not need to match on both switches, though for documentation purposes it should.
Adding switch ports to a channel-group creates a logical port-channel interface.
This interface can be configured by referencing the channelgroup number:
Physical port properties, such as speed and duplex, must be configured on the
physical interface, and not on the port-channel interface.
EtherChannel – Dynamic Configuration
Both PAgP and LACP exchange negotiation packets to form the EtherChannel.
When an EtherChannel is configured manually, no negotiation packets are
exchanged.
Thus, an EtherChannel will never form if one switch manually configured the
EtherChannel, and the other switch is using a dynamic aggregation protocol.
PAgP and LACP are not compatible – both sides of an EtherChannel must use the
same aggregation protocol.
EtherChannel - LACP
A channel will not form if both sides are set to passive. Also, LACP will not form a
channel if the remote side is running PAgP, or manually configured.
LACP also assigns a system-priority to each switch, dictated which switch becomes
the decision-maker if there is a conflict about active ports. The default system-
priority is 32768, and a lower priority is again preferred. If there is a tie in system-
priority, the lowest switch MAC address is preferred.
Note that both ports have a status of P, which indicates that they are up and active
in the EtherChannel.
On Cisco Nexus switches, the syntax for this command is slightly different:
Channel Channel
Si Si
On/Off Si
On/Off
Si
No Channel No Channel
Si Si
Auto/Desirable Si
Active/
Si
Channel Passive
Channel
Si Si
Si Si
10 GE and
Core Si Si
10-GE Channels
Typical 4:1
Data Over-
Subscription
Distribution
Si Si
Typical 20:1
Data Over-
Subscription Access
EtherChannels
Reduce Complexity/Peer Relationships
• More links = more routing peer
relationships and associated
overhead
Si Si Si Si Si Si • EtherChannels allow you to reduce
peers by creating single logical
interface to peer over
• On single link failure in a bundle
Layer 3 Layer 3 Equal
Equal Cost Cost • OSPF running on a Cisco
Links Links
IOS-based switch will reduce link cost
Si Si
path
WAN Data Centre Internet
RSTP
(Rapid
Spanning Tree
Protocol )
Rapid Spanning Tree Protocol (RSTP)
In modern networks, a 30 to 50 second convergence delay is unacceptable.
Enhancements were made to the original IEEE 802.1D standard to address this. The
result was 802.1w, or Rapid Spanning Tree Protocol (RSTP).
RSTP is similar in many respects to STP:
BPDUs are forwarded between switches
A Root Bridge is elected, based on the lowest Bridge ID.
Root and designated ports are elected and function identically to STP.
RSTP defines four port roles:
Root Port – Port on each switch that has the best path cost to the Root Bridge. A
switch can only have one root port.
Alternate Port – Backup root port that has a less desirable path cost.
Designated Port – Non-root port that represents the best path cost for each network
segment to the Root Bridge.
Backup Port – Backup designated port that has a less desirable path cost.
STP vs RSTP
1. 802.1 D STP supported five port states, while RSTP supports three:
Discarding
Learning
Forwarding
Initially, a switch port starts in a discarding state:
A discarding port will not forward frames or learn MAC addresses.
A discarding port will listen for BPDUs.
Alternate and backup ports will remain in a discarding state.
RSTP does not need a listening state. Instead, if a port is elected as a root or
designated port, it will transition from discarding to a learning state:
A learning port will begin to add MAC addresses to the CAM table.
However, a learning port cannot forward frames quite yet.
Finally, a learning port will transition to a forwarding state:
A forwarding port is fully functional – it will send and listen for BPDUs, learn
MAC addresses, and forward frames.
Root and designated ports will eventually transition to a forwarding state.
The key benefit of RSTP is faster convergence:
BPDUs are generated by every switch, and sent out at the hello interval.
Switches no longer require artificial forward delay timers.
In 802.1D, BPDUs are generated by the Root Bridge. If a switch receives a BPDU from
the Root Bridge on its root port, it will propagate the BPDU downstream to its neighbors.
This convergence process is slow, and STP relies on forward delay timers to ensure a
loop-free environment.
In RSTP, switches will handshake directly with their neighbors, allowing the topology to
be quickly synchronized. This allows ports to rapidly transition from a discarding state to a
forwarding state without a delay timer.
A key component of the RSTP process is the type of each port:
Edge – port that connects to a host. This port behaves exactly like a PortFast-enabled
port, transitioning to a forwarding state immediately.
Root – port that connects to another switch, and has the best path cost to the Root
Bridge.
Point-to-Point – port that connects to another switch, with the potential to
become the designated port for a segment.
Note: If an edge port receives a BPDU, it will lose its edge port status and transition
normally through the RSTP process. On Cisco switches, any port configured with PortFast
becomes an Edge Port.
The RSTP convergence process is as follows:
Switches exchange BPDUs to elect the Root Bridge.
Edge ports immediately transition into a forwarding state.
All potential root and point-to-point ports start in a discarding state.
If a port receives a superior BPDU, it will become a root port, and transition
immediately to a forwarding state.
For a point-to-point port, each switch will exchange a handshake
proposal to determine which port becomes designated.
Once the switches agree, the designated port is moved immediately into a
forwarding state.
Every switch will perform this handshaking process with each of its neighbors, until
all switches are synchronized. Complete convergence happens very quickly –
within seconds.
TCN Topology Change Notification
RSTP handles topology changes more efficiently than 802.1D STP, which generates a
Topology Change Notification (TCN) in two circumstances:
When a port transitions into a forwarding state.
When a port transitions into a blocking or down state.
The TCN will eventually reach the Root Bridge, which will then inform all other switches
of the change by sending a BPDU with the Topology Change (TC) bit set.
In RSTP, only a non-edge port transitioning to a forwarding state will generate a TCN.
The switch recognizing a topology change does not have to inform the Root Bridge first.
Any switch can generate and forward a TC BPDU, allowing the topology to quickly
converge via handshakes.
A switch receiving a TC BPDU will flush all MAC addresses learned on
designated
ports, except for the port that received the TC BPDU.
In the event of a topology change, RSTP will allow alternate or backup ports to
immediately enter a forwarding state. Additionally, RSTP does not have to wait an arbitrary
max age timer to accept an inferior BPDU, if there is an indirect failure in the topology.
Essentially, RSTP inherently supports the functionality of UplinkFast and BackboneFast.
RSTP is compatible with 802.1D STP. If a neighboring switch does not respond to an
RSTP handshake, a port reverts back to transitioning through 802.1D states. Note that
this
means that all RSTP benefits are lost on that port.
Two implementations of RSTP exist:
Rapid Per-VLAN Spanning Tree Protocol (RPVST+)
Multiple Spanning Tree (MST)
RPVST+ is Cisco proprietary, while MST is defined in the IEEE 802.1s standard.
To enable RPVST+ globally on a switch:
Switch(config)# spanning-tree mode rapid-pvst
Topolog
y
Multiple Spanning Tree (MST)
3 versions of 802.1D STP were described:
CST utilizes a single STP instance for all VLANs.
PVST and PVST+ employ a separate STP instance for each VLAN.
PVST and PVST+ are more efficient, and allow STP to load balance VLANs across links.
This comes at a cost – maintaining a separate STP instance for each VLAN adds overhead
to the CPU and memory on a switch.
Multiple Spanning Tree (MST), defined in IEEE 802.1s, allows a group
of VLANs to be mapped to an STP instance.
Each MST instance (MSTI) builds its own RSTP topology database, including electing
its own Root Bridge. A VLAN can only be assigned to one instance.
MST further separates the STP topology into regions. All switches in a region must be
configured with identical MST parameters:
32-byte configuration name
16-bit revision number
VLAN-to-instance mapping database
If two switches are configured with different MST parameters, they belong to different
MST regions.
For most Cisco platforms, a region can contain a maximum of 16 MST instances,
numbered 0 through 15. By default, all VLANs belong to instance 0.
The Internal Spanning Tree (IST) is responsible for maintaining the topology for the
entire region and all of the MSTIs. Only the IST can send and receive BPDUs, and
encapsulates the MSTI information within a BPDU as an MST record (M-record).
The IST is always mapped to instance 0.
MST is compatible with all other implementations of STP. An MST region is obfuscated
from non-MST switches, which will see the entire MST region as a single 802.1D or RSTP
switch.
Multiple Spanning Tree (MST) (continued)
To enable MST globally on a switch:
Switch(config)# spanning-tree mode mst