Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Cisco Switching Black Book - Sean Odom, Hanson Nottingham.pdf
Скачиваний:
87
Добавлен:
24.05.2014
Размер:
2.89 Mб
Скачать

Broadcast frames

Multicast frames

Unknown unicasts

Broadcast and Multicast Frames

Broadcast and multicast frames are unique in that neither has a specified destination hardware address. The source address is also the hardware address of the device that sent the frame. In the case of broadcasts, the destination address shown in the header is all 1s, indicating that the broadcast goes to all nodes in a network. A multicast specifies a network but changes all the host address bits to all 1s. For example, a broadcast and multicast in binary would appear as shown in Table 10.1.

Table 10.1: Broadcast and multicast destination addresses.

Frame Type

Binary Value

Broadcast Address

Broadcast

11111111.11111111.11111111.11111111

255.255.255.255

Multicast

00001010.00000001.11111111.11111111

10.1.255.255

When a switch receives a broadcast or a multicast, the frame is sent out all the ports of the switch by default, with the exception of the port on which the frame arrived. VLANs can be used to break down the broadcasts into smaller broadcast domains. In the case of a VLAN, if a broadcast arrives on a port assigned to VLAN 5, only ports assigned to VLAN 5 will receive the broadcast.

Unknown Unicasts

An unknown unicast is similar to a broadcast. This type of unicast is sent when a destination address is unknown by the switch. In this case, the bridge forwards the frame just like a broadcast; the frame is sent out all ports except the port on which it arrived.

Layer 2 Network Loops

To sum up STP in one sentence, Spanning Tree Protocol is used to allow the Layer 2 network to have more than one path to a destination by blocking ports that can cause a packet to make a complete circle through the network. This circle, shown in Figure 10.1, is known as a data loop. The data will move in a continuous circle unless some protocol or algorithm is used to stop the data or a maximum time to live is assigned to the data packet. STP reliably monitors the network topology to find all the links and make sure that data loops do not occur.

Figure 10.1: A network with more than one path in the network. Data can return to the source node on a second link, causing a data loop.

Manufacturers needed a consistent standard that they all could use to block redundant paths through a network. Digital Equipment Corporation (DEC) answered the call and submitted to the Institute of Electrical

200

and Electronics Engineers (IEEE) a protocol similar to STP to become a networking standard. However, after the IEEE 802 committee revised it into what is now known as the IEEE 802.1D standard (Spanning Tree Protocol), the protocol differed just enough from DEC’s version that they were incompatible.

Danger! Data Loops!

Data loops can easily become a network disaster. A transparent bridge always likes to retransmit a broadcast it receives and never mark the frame with a time to live (TTL) or an identifier that says “Hey I started here!” or “I’ve been around here a few times already.” The result? Your transparent bridge keeps re−creating broadcasts in an expanding fashion. The bridge actually begins rebroadcasting broadcasts. Think this situation will last forever? Not likely—the bridges will eventually cause a broadcast storm and bring down the entire network.

STP fixes this problem and forces all the redundant data paths into a blocked state. By blocking the paths to destinations other than the given root path, STP creates only one path through the network. If any of the forwarding paths through one of the network segments in the spanning tree become unreachable, STP will reconfigure the spanning−tree topology and use the once blocked links in the network. STP calculates the network topology using the Spanning−Tree Algorithm (STA).

To avoid confusion, let me clarify that the Spanning−Tree Protocol and the Spanning−Tree Algorithm are two separate entities. STA chooses a reference point in the network and calculates the redundant paths to that reference point. If the STA finds a redundant path, it will choose one path to forward and the redundant paths to block. Using this process, STP and the STA effectively sever all the redundant links within the network.

STA is based on the graph theory developed by Edsger Dijkstra to construct a loop−free subset of the network topology. Let’s take a look at this theory.

Edsger Dijkstra’s Graph Theory

The STA uses solutions obtained by a graph theory also known as the Shortest Path Algorithm. As I mentioned earlier, this algorithm is used to construct a loop−free subset of the network’s topology. The same theory is also used in other link state protocols, such as Open Shortest Path First (OSPF), to calculate routing solutions. The theory states that for a connected graph consisting of interfaces and edges connecting pairs of interfaces, a spanning tree of the edges maintains the connectivity of the graph while containing no loops.

The algorithm provides a directed graph where each link is represented by vertices and weighted edges, as shown in Figure 10.2. Each link represents a cost. The weighted edges, which usually have more hops in the link than do the straight−through points, are assigned higher values. Each link in the path has a value, and the total of the values to a given point or destination is the total weighted value of the path. The lowest total weighted value represents the most efficient path from one point to another point.

201

Figure 10.2: An example of a directed graph.

STA assigns each switch in the network a unique identifier. This identifier is one of the switch’s MAC addresses, as well as an assigned priority (explained in more detail later in this chapter in “The Selection Process”). After STA assigns each switch this unique identifier, it then assigns each port in every switch a unique identifier. This port identifier is typically the port’s own individual interface MAC address. Each bridge port is then associated with a path cost, which represents the cost of transmitting a frame onto the network through the port. Path costs are assigned by default, but can be assigned manually by a network administrator.

As I stated in the last section, the graph theory chooses a reference point in the network and calculates the redundant paths to that particular point in the network topology. After STP discovers all the links in the network, the STA chooses a single path through the network and blocks the redundant links. It does so by electing a root bridge. Let’s take a look at root bridges in the next section.

STP Root Bridges

When STP initially comes online in a network, one of its first actions is to use the STA to select a root bridge and a root port. The root bridge is the bridge with the lowest−value bridge identifier. Switches or bridges using STP exchange multicast frames called Bridge Protocol Data Units (BPDUs) (discussed in the next section). All the switches on the network use these BPDUs to broadcast their bridge IDs to the other switches in the network. After the root bridge is selected, the root ports on all other bridges are determined.

Switch A in Figure 10.3 is acting as the root bridge, calculating the least−cost path to switch D. Notice the numbers associated with the root bridge’s path to each individual destination; the path with the lowest number has the highest priority. The higher the number between individual segments, the higher the cost of transmitting a frame between those two segments. The port through which the root bridge can be reached with the least amount of hops or cost determines a bridge’s root port; this is referred to as the least path cost.

202

Figure 10.3: The root bridge calculating the path cost to switch D.

The lowest calculated path is not always the most ideal path. For example, if multiple high−speed links to a destination exist, the links may total more than the cost of a very slow link, such as a modem. Even though the straight path has the fewest hops, it is much slower than using a high−speed, longer path. To overcome this problem, you as the administrator can manually change a slower−speed link to have a higher port cost, which STP will use to calculate a higher path cost. The goal is to make changes to the network so that the fastest, most efficient route to the root port is designated for the switch to use. The fastest links should always have the lowest port costs.

A designated bridge is the bridge or switch on each LAN that provides the shortest route with the least path cost. The designated bridge is the only bridge that is allowed to forward frames to and from the other bridges. A designated port on the switch is the port that connects the switch to the physical interface of the designated bridge.

Bridge Protocol Data Units

BPDUs are messages passed between bridges and switches to help STP calculate and learn the topology of the network. The multicast messages contain information that identifies the network link, the bridge presumed to be the root bridge, the calculated root path cost, other STP bridges, port identifiers, and the age of the information contained in the message.

STP member bridges and switches exchange BPDU messages at configurable intervals—typically, every one to four seconds. By default, BPDUs are sent out every two seconds on every port to ensure a stable network without accidental data loops. Should one or more bridges fail or another STP member join the network, BPDU messages will help the other STP member bridges and switches to notice this change in the network topology. The neighboring bridges will detect the lack of configuration messages and initiate an immediate STA recalculation.

Note BPDU messages are never forwarded by any member. Instead, each STP bridge or switch makes a decision locally based on BPDU messages received. The switch or bridge then creates a new BPDU message based on the new information and sends that message out its ports.

Let’s take a look at the fields of a BPDU, as shown in Figure 10.4:

Figure 10.4: The 12 fields of a BPDU message.

Protocol Identifier—Contains 2 bytes and the value of zero.

203

Version—Contains 1 byte and the value of zero.

Message Type—Contains 1 byte and the value of zero.

Flag—Contains 1 byte; only the first 2 bits are used. The topology change (TC) bit signals that there has been a topology change. The topology change acknowledgment (TCA) bit is then set to acknowledge receipt of a configuration message with the TC signal bit set.

Root ID—Contains 8 bytes that identify the root bridge by listing a 2−byte priority followed by a 6−byte ID.

Root Path Cost—Contains 4 bytes containing the cost of the path from the bridge sending the configuration message to the root bridge.

Bridge ID—Contains 8 bytes identifying the priority and ID of the bridge sending the message.

Port ID—Contains 2 bytes identifying the port from which the configuration message was sent. This field allows loops created by multiple attached bridges to be detected immediately by STP.

Message Age—Contains 2 bytes specifying the amount of time since the root sent the configuration message on which the current configuration message is based.

MaxAge—Contains 2 bytes indicating when the current configuration message should be discarded.

Hello Time—Contains 2 bytes indicating the time period between root bridge configuration messages.

FwdDelay—Contains 2 bytes indicating the length of time that the bridge should wait before transitioning to a new state following a topology change in the network.

Timer’s affect the way BPDUs operate in a network and converge in the event of a data loop or network topology change. Let’s take a look at these timers.

BPDU Timers

STP uses timers to prevent data loops and to determine how long it will take STP to converge after a link failure or change in the network topology. As frames and packets travel through the switched network, this data faces propagation delays. Propagation delays occur due to such things as bandwidth utilization, packet length, switch processing, or any other port−to−port delay encountered as data traverses the network.

As a result of propagation delays, BPDUs can be late to their destinations, making the switch think that a network topology change has occurred. Because propagation delays can occur at any time in the network, when a switch port converts from a blocked state to a forwarding state, the port can inadvertently create temporary data loops because it has not received a complete picture of the network topology.

To overcome network propagation delays, STP members use timers to force the ports to wait for the correct topology information. The timers are set by default on the switch. Table 10.2 shows the three different STP timers and the default timer settings based on a default setting of 2 for the Hello Time and 7 for the switch diameter. Based on these assumptions, the network should always form a stable topology.

Table 10.2: The default STP timers and their default settings.

STP Timer Variable

Description

Default

Hello Time

Determines how often the switch

2 seconds

 

will broadcast hello messages to

 

 

other switches

 

Maximum Time/MaxAge

Determines how long protocol

20 seconds

 

information received on a port is

 

 

stored by the switch

 

FwdDelay

Determines how long listening and

15 seconds

 

learning will last before the port

 

 

begins forwarding

 

Selecting the root bridge is important in calculating the port cost in the network. The port cost from each child switch in the network is calculated from the network’s root bridge. In the next section, we’ll take a look at how the BPDUs are used in the process of selecting a root bridge.

204

Соседние файлы в предмете Программирование