Wednesday, September 18, 2019

Medium Dependent Interface Crossover (MDIX)

Medium Dependent Interface Crossover (MDIX) 


Definition - What does Medium Dependent Interface Crossover (MDIX) mean?
A medium dependent interface crossover (MDIX) is a version of the medium dependent interface (MDI) enabling a connection between corresponding devices. An MDI port or uplink port is a port on a switch, router or network hub connecting to another switch or hub using a straight-through cable rather than an Ethernet crossover cable. Generally, there are one to two ports on a switch or hub with an uplink switch, which can be used to alter between an MDI and MDIX interface.

An MDIX is a female 8 Position 8 Contact (8P8C or RJ45) modular port connector on a router, switch, hub or computer. It uses a straight-through cable which is a network cable that connects pins 1 and 2 (transmitting) on an MDI device to pins 1 and 2 (receiving) on an MDIX device. The “X” or crossover is in reference to the transmitting wires (MDI), which must be connected to the receiving (MDIX)wires to “crossover” signals.
This term is also known as MDI crossover (X).

Explains Medium Dependent Interface Crossover (MDIX)

Generally switches and hubs use an MDIX interface. Routers use an MDI interface in a workstation or PC environment. Newer technology for hubs, switches and routers automatically detect the appropriate cable connection type by the use of automatic medium-dependent interface crossover (Auto-MDIX) or Auto Uplink. With Auto-MDIX straight-through cable and Ethernet, crossover cable can be used. Switches and hubs not having Auto-MDIX will typically have one port that will not cross the line or crossover.

MDIX is a version of the medium dependent interface (MDI), which is a module of the media attachment unit (MAU). The MAU is a transceiver converting signals on an Ethernet cable for which it transmits and receives attachment unit interface (AUI) signals. The standard for the MDIX is the MDI standard. It uses straight through twisted pair cabling allowing crossover (X) signals to be transmitted and received without the need of crossover cable. Older switches and hubs use the MDIX interface. Routers use an MDI interface. Newer devices automatically detect the proper cable connection type by using automatic medium-dependent interface crossover (Auto-MDIX) or Auto Uplink. All 1 Gb or 10 Gb devices and some 10/100 (10Base-T, 10Base-TX) devices have Auto-MDIX. A device that has Auto-MDIX can use either Ethernet crossover cable or straight-through cable. A hub or switch that does not have an Auto-MDIX feature needs to have one port, which will not crossover or cross the line. However, a gigabit Ethernet typically has 2 Auto-MDIX ports connected together.

Auto-MDIX uses automatic line sensing in the ports called auto sensing. This feature eliminates the need for special crossover cable, separate MDI and MDIX ports, and switches requiring selection for particular devices. Auto-MDIX configures the cable connection automatically, allowing both crossover and straight-through cabling to be used. When the Auto-MDIX interface is connected, it will correct any improper cabling. To ensure the speed is correct, the duplex setting needs to be set to "auto.”

Wednesday, September 11, 2019

Types of Spanning Tree Protocol (STP)


Types of Spanning Tree Protocol (STP)



This section reviews the three traditional types of Spanning Tree Protocol (STP) that are encountered in switched networks and how they relate to one another. No specific configuration commands are associated with the various types of STP here. Instead, you need a basic understanding of how they interoperate in a network.

Common Spanning Tree

The IEEE 802.1Q standard specifies how VLANs are to be trunked between switches. It also specifies only a single instance of STP that encompasses all VLANs. This instance is referred to as the Common Spanning Tree (CST). All CST BPDUs are transmitted over trunk links using the native VLAN with untagged frames.

Having a single STP for many VLANs simplifies switch configuration and reduces switch CPU load during STP calculations. However, having only one STP instance can cause limitations, too. Redundant links between switches will be blocked with no capability for load balancing. Conditions also can occur that would cause CST to mistakenly enable forwarding on a link that does not carry a specific VLAN, whereas other links would be blocked.

Per-VLAN Spanning Tree

Cisco has a proprietary version of STP that offers more flexibility than the CST version. Per-VLAN Spanning Tree (PVST) operates a separate instance of STP for each individual VLAN. This allows the STP on each VLAN to be configured independently, offering better performance and tuning for specific conditions. Multiple spanning trees also make load balancing possible over redundant links when the links are assigned to different VLANs. One link might forward one set of VLANs, while another redundant link might forward a different set.

Because of its proprietary nature, PVST requires the use of Cisco Inter-Switch Link (ISL) trunking encapsulation between switches. In networks where PVST and CST coexist, interoperability problems occur. Each requires a different trunking method, so BPDUs are never exchanged between STP types.

Per-VLAN Spanning Tree Plus

Cisco has a second proprietary version of STP that allows devices to interoperate with both PVST and CST. Per-VLAN Spanning Tree Plus (PVST+) effectively supports three groups of STP operating in the same campus network:

Catalyst switches running PVST
Catalyst switches running PVST+
Switches running CST over 802.1Q

Table 2-14 summarizes the three STP types and their basic functions.
Type of STP
Function
CST
1 instance of STP, over the native VLAN; 802.1Q based
PVST
1 instance of STP per VLAN; Cisco ISL based
PVST+
Provides interoperability between CST and PVST; operates over both 802.1Q and ISL

To do this, PVST+ acts as a translator between groups of CST switches and groups of PVST switches. PVST+ can communicate directly with PVST by using ISL trunks. To communicate with CST, however, PVST+ exchanges BPDUs with CST as untagged frames over the native VLAN. BPDUs from other instances of STP (other VLANs) are propagated across the CST portions of the network by tunneling. PVST+ sends these BPDUs by using a unique multicast address so that the CST switches forward them on to downstream neighbors without interpreting them first. Eventually, the tunneled BPDUs reach other PVST+ switches where they are understood.

Monday, September 9, 2019

Switch Topology Changes


Switch Topology Changes

To announce a change in the active network topology, switches send a TCN BPDU. Table 2.10 shows the format of these messages.

Table 2-10 Topology Change Notification BPDU Message Content

Field Description
Number of Bytes
Protocol ID (always 0)
2
Version (always 0)
1
Message Type (Configuration or TCN BPDU)
1

A topology change occurs when a switch either moves a port into the Forwarding state or moves a port from the Forwarding or Learning states into the Blocking state. In other words, a port on an active switch comes up or goes down. The switch sends a TCN BPDU out its root port so that, ultimately, the root bridge receives news of the topology change. Notice that the TCN BPDU carries no data about the change but informs recipients only that a change has occurred. Also notice that the switch will not send TCN BPDUs if the port has been configured with PortFast enabled.

The switch continues sending TCN BPDUs every hello time interval until it gets an acknowledgment from its upstream neighbor. As the upstream neighbors receive the TCN BPDU, they propagate it on toward the root bridge and send their own acknowledgments. When the root bridge receives the TCN BPDU, it also sends out an acknowledgment. However, the root bridge sets the Topology Change flag in its Configuration BPDU, which is relayed to every other bridge in the network. This is done to signal the topology change and cause all other switches to shorten their switch table aging times from the default (300 seconds) to the forward delay value (default 15 seconds).

This condition causes the learned locations of MAC addresses to be flushed out much sooner than they normally would, easing the bridge table corruption that might occur because of the change in topology. However, any stations that are actively communicating during this time are kept in the bridge table. This condition lasts for the sum of the forward delay and the max age (default 15 + 20 seconds).

The theory behind topology changes is fairly straightforward, but it is often difficult to grasp how a working network behaves during a change. For example, suppose that you have a Layer 2 network (think of a single VLAN or a single instance of STP) that is stable and loop free. If a switch uplink suddenly failed or a new uplink was added, how would the various switches in the network react? Would users all over the network lose connectivity while the STP “recomputes” or reconverges?

Examples of different types of topology changes are presented in the following sections, along with the sequence of STP events. Each type has a different cause and a different effect. To provide continuity as the STP concepts are presented, the same network previously shown in Figures 2.3 through 2.5 is used in each of these examples.

Direct Topology Changes

A direct topology change is one that can be detected on a switch interface. For example, if a trunk link suddenly goes down, the switch on each end of the link can immediately detect a link failure. The absence of that link changes the bridging topology, so other switches should be notified.

Figure 2.11 shows a network that has converged into a stable STP topology. The VLAN is forwarding on all trunk links except port gi1/0/2 on Switch C, where it is in the Blocking state.

This network has just suffered a link failure between Switch A and Switch C. The sequence of events unfolds as follows:

1.Switch C detects a link down on its port gi1/0/1; Switch A detects a link down on its port gi1/0/2.

2.Switch C removes the previous “best” BPDU it had received from the root over port gi1/0/1. Port gi1/0/1 is now down so that BPDU is no longer valid. Normally, Switch C would try to send a TCN message out its root port, to reach the root bridge. Here, the root port is broken, so that is not possible. Without an advanced feature such as STP UplinkFast, Switch C is not yet aware that another path exists to the root. Also, Switch A is aware of the link down condition on its own port gi1/0/2. It normally would try to send a TCN message out its root port to reach the root bridge. Here, Switch A is the root, so that is not really necessary.

3.The root bridge, Switch A, sends a Configuration BPDU with the TCN bit set out its port gi1/0/1. This is received and relayed by each switch along the way, informing each one of the topology change.

4.Switches B and C receive the TCN message. The only reaction these switches take is to shorten their bridging table aging times to the forward delay time. At this point, they do not know how the topology has changed; they only know to force fairly recent bridging table entries to age out.

5.Switch C basically just sits and waits to hear from the root bridge again. The Configuration BPDU TCN message is received on port gi1/0/2, which was previously in the Blocking state. This BPDU becomes the “best” one received from the root, so port gi1/0/2 becomes the new root port. Switch C now can progress port gi1/0/2 from Blocking through the Listening, Learning, and Forwarding states.


Figure 2.11 Effects of a Direct Topology Change


As a result of a direct link failure, the topology has changed and STP has converged again. Notice that only Switch C has undergone any real effects from the failure. Switches A and B heard the news of the topology change but did not have to move any links through the STP states. In other words, the whole network did not go through a massive STP reconvergence.

The total time that users on Switch C lost connectivity was roughly the time that port gi1/0/2 spent in the Listening and Learning states. With the default STP timers, this amounts to about two times the forward delay period (15 seconds), or 30 seconds total.

Indirect Topology Changes

Figure 2.12 shows the same network as Figure 2.11, but this time the link failure indirectly involves Switches A and C. The link status at each switch stays up, but something between them has failed or is filtering traffic. This could be another device, such as a service provider’s switch, a firewall, and so on. As a result, no data (including BPDUs) can pass between those switches.


Figure 2.12 Effects of an Indirect Topology Change

STP can detect and recover from indirect failures, thanks to timer mechanisms. The sequence of events unfolds as follows:

1. Switches A and C both show a link up condition; data begins to be filtered elsewhere on the link.

2. No link failure is detected, so no TCN messages are sent.

3. Switch C already has stored the “best” BPDU it had received from the root over port gi1/0/1. No further BPDUs are received from the root over that port. After the Max Age timer expires, no other BPDU is available to refresh the “best” entry, so it is flushed. Switch C now must wait to hear from the Root again on any of its ports.

4. The next Configuration BPDU from the root is heard on Switch C port gi1/0/2. This BPDU becomes the new “best” entry, and port gi1/0/2 becomes the root port. Now the port is progressed from Blocking through the Listening, Learning, and finally Forwarding states.

As a result of the indirect link failure, the topology does not change immediately. The absence of BPDUs from the root causes Switch C to take some action. Because this type of failure relies on STP timer activity, it generally takes longer to detect and mitigate.

In this example, the total time that users on Switch C lost connectivity was roughly the time until the max age timer expired (20 seconds), plus the time until the next Configuration BPDU was received (2 seconds) on port gi1/0/2, plus the time that port gi1/0/2 spent in the Listening (15 seconds) and Learning (15 seconds) states. In other words, 52 seconds elapse if the default timer values are used.

Insignificant Topology Changes

Figure 2.13 shows the same network topology as Figure 2.11 and Figure 2.12, with the addition of a user PC on access layer switch Switch C. The user’s switch port, gi1/0/33/, is just another link as far as the switch is concerned. If the link status goes up or down, the switch must view that as a topology change and inform the root bridge.


Figure 2.13 Effects of an Insignificant Topology Change

Obviously, user ports are expected to go up and down as the users reboot their machines, turn them on and off as they go to and from work, and so on. Regardless, TCN messages are sent by the switch, just as if a trunk link between switches had changed state. To see what effect this has on the STP topology and the network, consider the following sequence of events:

1. The PC on switch port gi1/0/33 is turned off. The switch detects the link status going down.


2. Switch C begins sending TCN BPDUs toward the root, over its root port (gi1/0/1).

3. The root sends a TCN acknowledgment back to Switch C and then sends a Configuration BPDU with the TCN bit set to all downstream switches. This is done to inform every switch of a topology change somewhere in the network.

4. The TCN flag is received from the root, and both Switches B and C shorten their bridge table aging times. This causes recently idle entries to be flushed, leaving only the actively transmitting stations in the table. The aging time stays short for the duration of the Forward Delay and Max Age timers.

Notice that this type of topology change is mostly cosmetic. No actual topology change occurred because none of the switches had to change port states to reach the root bridge. Instead, powering off the PC caused all the switches to age out entries from their bridge or CAM tables much sooner than normal.

At first, this does not seem like a major problem because the PC link state affects only the “newness” of the CAM table contents. If CAM table entries are flushed as a result, they probably will be learned again. This becomes a problem when every user PC is considered. Now every time any PC in the network powers up or down, every switch in the network must age out CAM table entries.

Given enough PCs, the switches could be in a constant state of flushing bridge tables. Also remember that when a switch does not have a CAM entry for a destination, the packet must be flooded out all its ports. Flushed tables mean more unknown unicasts, which mean more broadcasts or flooded packets throughout the network.

Fortunately, Catalyst switches have a feature that can designate a port as a special case. You can enable the STP PortFast feature on a port with a single attached PC. As a result, TCNs are not sent when the port changes state, and the port is brought right into the Forwarding state when the link comes up.

Friday, September 6, 2019

Spanning Tree Protocol (STP) Timers


 Spanning Tree Protocol (STP) Timers


Spanning Tree Protocol (STP) operates as switches send BPDUs to each other in an effort to form a loop-free topology. The BPDUs take a finite amount of time to travel from switch to switch. In addition, news of a topology change (such as a link or root bridge failure) can suffer from propagation delays as the announcement travels from one side of a network to the other. Because of the possibility of these delays, keeping the spanning-tree topology from settling out or converging until all switches have had time to receive accurate information is important.

STP uses three timers to make sure that a network converges properly before a switching loop can form. The timers and their default values are as follows:

Hello timer : The time interval between Configuration BPDUs sent by the root bridge. The hello time value configured in the root bridge switch determines the hello time for all nonroot switches because they just relay the Configuration BPDUs as they are received from the root. However, all switches have a locally configured hello time that is used to time TCN BPDUs when they are retransmitted. The IEEE 802.1D standard specifies a default hello time value of 2 seconds.

Forward Delay timer : The time interval that a switch port spends in both the Listening and Learning states. The default value is 15 seconds.

Max (Maximum) Age timer : The time interval that a switch stores a BPDU before discarding it. While executing the STP, each switch port keeps a copy of the “best” BPDU that it has heard. If the switch port loses contact with the BPDU’s source (no more BPDUs are received from it), the switch assumes that a topology change must have occurred after the max age time elapsed and so the BPDU is aged out. The default Max Age timer value is 20 seconds.

The STP timers can be configured or adjusted from the switch command line. However, the timer values never should be changed from the defaults without careful consideration. Then the values should be changed only on the root bridge switch. Recall that the timer values are advertised in fields within the BPDU. The root bridge ensures that the timer values propagate to all other switches.

The network diameter can be configured on the root bridge switch to more accurately reflect the true size of the physical network. Making that value more accurate reduces the total STP convergence time during a topology change. Cisco also recommends that if changes need to be made, only the network diameter value should be modified on the root bridge switch. When the diameter is changed, the switch calculates new values for all three timers automatically.

Table 2.9 summarizes the STP timers, their functions, and their default values.

Table 2.9 STP Timers

Timer
Function
Default Value
Hello
Interval between configuration BPDUs.
2 seconds
Forward
delay
Time spent in Listening and Learning states before transitioning toward Forwarding state.
15 seconds
Max age
Maximum length of time a BPDU can be stored without receiving an update. Timer expiration signals an indirect failure with designated or root bridge.
20 seconds

Thursday, September 5, 2019

STP States


STP States



To participate in STP, each port of a switch must progress through several states. A port begins its life in a Disabled state, moving through several passive states and, finally, into an active state if allowed to forward traffic. The STP port states are as follows:

Disabled: Ports that are administratively shut down by the network administrator, or by the system because of a fault condition, are in the Disabled state. This state is special and is not part of the normal STP progression for a port.

Blocking: After a port initializes, it begins in the Blocking state so that no bridging loops can form. In the Blocking state, a port cannot receive or transmit data and cannot add MAC addresses to its address table. Instead, a port is allowed to receive only BPDUs so that the switch can hear from other neighboring switches. In addition, ports that are put into standby mode to remove a bridging loop enter the Blocking state.

Listening: A port is moved from Blocking to Listening if the switch thinks that the port can be selected as a root port or designated port. In other words, the port is on its way to begin forwarding traffic.

In the Listening state, the port still cannot send or receive data frames. However, the port is allowed to receive and send BPDUs so that it can actively participate in the Spanning Tree topology process. Here, the port finally is allowed to become a root port or designated port because the switch can advertise the port by sending BPDUs to other switches. If the port loses its root port or designated port status, it returns to the Blocking state.

Learning: After a period of time called the forward delay in the Listening state, the port is allowed to move into the Learning state. The port still sends and receives BPDUs as before. In addition, the switch now can learn new MAC addresses to add to its address table. This gives the port an extra period of silent participation and allows the switch to assemble at least some address information. The port cannot yet send any data frames, however.

Forwarding: After another forward delay period of time in the Learning state, the port is allowed to move into the Forwarding state. The port now can send and receive data frames, collect MAC addresses in its address table, and send and receive BPDUs. The port is now a fully functioning switch port within the spanning-tree topology.

Remember that a switch port is allowed into the Forwarding state only if no redundant links (or loops) are detected and if the port has the best path to the root bridge as the root port or designated port.

Table 2.7 summarizes the STP port states and what can and cannot be done in those
states.

Table 2.7 STP States and Port Activity

STP State
The Port Can…
The Port Cannot...
Duration             
Disabled
N/A
Send or receive data
N/A
Blocking             
Receive BPDUs
Send or receive data or
learn MAC addresses
Indefinite if loop has
been detected
Listening
Send and receive BPDUs
Send or receive data or
learn MAC addresses
Forward Delay timer (15
seconds)
Learning
Send and receive BPDUs
and learn MAC addresses
Send or receive data
Forward Delay timer (15
seconds)
Forwarding
Send and receive BPDUs,
learn MAC addresses,
and send and receive data

Indefinite as long as port
is up and loop is not
detected



Example 2.8 shows the output from a switch as one of its ports progresses through
 the STP port states.

Example 2.8 Switch Port Progressing Through the STP Port States

Switch(config)# interface gigabitethernet1/0/1
Switch(config-if)# no shutdown
Switch(config-if)# ^Z
Switch#

Mar 30 08:12:11.199: STP SW: Gi1/0/1 new blocking req for 1 vlans
Mar 30 08:12:13.196: %LINK-3-UPDOWN: Interface GigabitEthernet1/0/1, changed state
to up
Mar 30 08:12:14.203: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/1, changed state to up

Switch# show spanning interface gigabitethernet1/0/1
Vlan Role Sts Cost Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
VLAN0001 Desg LIS 4 128.1 P2p
Mar 30 08:12:26.207: STP SW: Gi1/0/1 new learning req for 1 vlans

Switch# show spanning interface gigabitethernet1/0/1
Vlan Role Sts Cost Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
VLAN0001 Desg LRN 4 128.1 P2p
Mar 30 08:12:41.214: STP SW: Gi1/0/1 new forwarding req for 1 vlans

Switch# show spanning interface gigabitethernet1/0/1
Vlan Role Sts Cost Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
VLAN0001 Desg FWD 4 128.1 P2p
Switch#

The example begins as the port is administratively disabled from the command line. When the port is enabled, successive show spanning-tree interface type member/ module/number commands display the port state as Listening, Learning, and then Forwarding. These are shown in the shaded text of the example. Notice also the time stamps and port states provided by the debug spanning-tree switch state command, which give a sense of the timing between port states. Because this port was eligible as a root port, the show command never could execute fast enough to show the port in the Blocking state.

Tables Used in Switching

Tables Used in Switching Catalyst switches maintain several types of tables to be used in the switching process. The tables are tailo...