Spanning Tree Protocol for Bridges/Switches 8-1. Bridge = Switch Bridge/switches are layer-2 switching device (look at the Ethernet destination address.

Slides:



Advertisements
Similar presentations
Communication Networks Recitation 3 Bridges & Spanning trees.
Advertisements

University of Calgary – CPSC 441.  We need to break down big networks to sub-LANs  Limited amount of supportable traffic: on single LAN, all stations.
Introduction to Computer Networks Spanning Tree 1.
Connecting LANs: Section Figure 15.1 Five categories of connecting devices.
Bridging. Bridge Functions To extend size of LANs either geographically or in terms number of users. − Protocols that include collisions can be performed.
1 CCNA 3 v3.1 Module 7. 2 CCNA 3 Module 7 Spanning Tree Protocol (STP)
STP Spanning tree protocol. Trunk port : A trunk port is a port that is assigned to carry traffic for all the VLANs that are accessible by a specific.
5/31/05CS118/Spring051 twisted pair hub 10BaseT, 100BaseT, hub r T= Twisted pair (copper wire) r Nodes connected to a hub, 100m max distance r Hub: physical.
Internetworking Different networks –Different bit rates –Frame lengths –Protocols.
Sept 21, 2004CS573: Network Protocols and Standards1 Reconfigurations Network Protocols and Standards Autumn
Dec 6, 2007CS573: Network Protocols and Standards1 Transparent Bridging Network Protocols and Standards Winter
TCP/IP Bridging, Switching and Routing in LANs Alvin Kwan.
Ethernet: Bridging Based on Radia Perlman’s Interconnections.
CSEE W4140 Networking Laboratory Lecture 8: LAN Switching Jong Yul Kim
Internetworking Devices that connect networks are called Internetworking devices. A segment is a network which does not contain Internetworking devices.
Sept 14, 2004CS573: Network Protocols and Standards1 Spanning Tree Algorithm Network Protocols and Standards Autumn
1 LAN switching and Bridges Relates to Lab 6. Covers interconnection devices (at different layers) and the difference between LAN switching (bridging)
1 K. Salah Module 4.3: Repeaters, Bridges, & Switches Repeater Hub NIC Bridges Switches VLANs GbE.
Introduction to Computer Networks 09/23 Presenter: Fatemah Panahi.
1 LAN switching and Bridges Relates to Lab 6. Covers interconnection devices (at different layers) and the difference between LAN switching (bridging)
1 Computer Networks LAN Bridges and Switches. 2 Where are we?
Layer 2 Switch  Layer 2 Switching is hardware based.  Uses the host's Media Access Control (MAC) address.  Uses Application Specific Integrated Circuits.
Connecting LANs, Backbone Networks, and Virtual LANs
Introduction to IT and Communications Technology Justin Champion C208 – 3292 Ethernet Switching CE
1 Token Passing: IEEE802.5 standard  4 Mbps  maximum token holding time: 10 ms, limiting packet length  packet (token, data) format:  SD, ED mark start,
Chapter 4: Managing LAN Traffic
Transparent Bridging. Chapter Goals Understand transparent bridge processes of learning, filtering, forwarding, and flooding. Explain the purpose of the.
1 CS 4396 Computer Networks Lab LAN Switching and Bridges.
1 © 2003, Cisco Systems, Inc. All rights reserved. CCNA 3 v3.0 Module 7 Spanning-Tree Protocol Cisco Networking Academy.
1 Spanning Tree Algorithm Advanced Computer Networks.
 Network Segments  NICs  Repeaters  Hubs  Bridges  Switches  Routers and Brouters  Gateways 2.
NUS.SOC.CS2105 Ooi Wei Tsang Application Transport Network Link Physical you are here.
© 2006 Cisco Systems, Inc. All rights reserved.Cisco PublicITE I Chapter 6 1 LAN Switching and Wireless Implement Spanning Tree Protocols (STP) Chapter.
1 Transparent Bridging Advanced Computer Networks.
Token Passing: IEEE802.5 standard  4 Mbps  maximum token holding time: 10 ms, limiting packet length  packet (token, data) format:  SD, ED mark start,
Bridging. Bridge Functions To extend size of LANs either geographically or in terms number of users. − Protocols that include collisions can be performed.
Module 8: Ethernet Switching
Cisco 3 – Switching STP Perrine. J Page 110/19/2015 Chapter 8 Spanning Tree Protocol (STP) Having redundancy in a network is important, and allows the.
Review: –Ethernet What is the MAC protocol in Ethernet? –CSMA/CD –Binary exponential backoff Is there any relationship between the minimum frame size and.
15.1 Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANs Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or.
OSI Model. Switches point to point bridges two types store & forward = entire frame received the decision made, and can handle frames with errors cut-through.
Sem1 - Module 8 Ethernet Switching. Shared media environments Shared media environment: –Occurs when multiple hosts have access to the same medium. –For.
STORE AND FORWARD & CUT THROUGH FORWARD Switches can use different forwarding techniques— two of these are store-and-forward switching and cut-through.
1 Data Link Layer Lecture 23 Imran Ahmed University of Management & Technology.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Connecting Devices CORPORATE INSTITUTE OF SCIENCE & TECHNOLOGY, BHOPAL Department of Electronics and.
1 © 2003, Cisco Systems, Inc. All rights reserved. CCNA 3 v3.0 Module 7 Spanning Tree Protocol.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Chapter 16 Connecting LANs, Backbone Networks, and Virtual LANs.
M. Veeraraghavan (originals by J. Liebeherr) 1 Need for Routing in Ethernet switched networks What do bridges do if some LANs are reachable only in multiple.
1 Version 3.0 Module 7 Spanning Tree Protocol. 2 Version 3.0 Redundancy Redundancy in a network is needed in case there is loss of connectivity in one.
ICS 156: Networking Lab Magda El Zarki Professor, ICS UC, Irvine.
5: DataLink Layer 5a-1 Bridges and spanning tree protocol Reference: Mainly Peterson-Davie.
Ch. 15 Connecting LANs.
1 Chapter 3: Packet Switching (Switched LANs) Dr. Rocky K. C. Chang 23 February 2004.
4: DataLink Layer1 Hubs r Physical Layer devices: essentially repeaters operating at bit levels: repeat received bits on one interface to all other interfaces.
© 2006 Cisco Systems, Inc. All rights reserved.Cisco PublicITE I Chapter 6 1 Implement Spanning Tree Protocols (STP) LAN Switching and Wireless – Chapter.
1 LAN switching and Bridges Relates to Lab Outline Interconnection devices Bridges/LAN switches vs. Routers Bridges Learning Bridges Transparent.
Lec # 25 Computer Network Muhammad Waseem Iqbal. Learn about the Internetworking Devices – Repeaters – Hubs – Switches – Bridges – Routers.
Ethernet switches and IP routers
Networking Devices.
Transparent Bridging.
3. Internetworking (part 2: switched LANs)
Chapter 4 Data Link Layer Switching
Spanning Tree Algorithm
Lecture 7: Transparent Bridges.
LAN switching and Bridges
Chapter 16 Connecting LANs, Backbone Networks, and Virtual LANs
LAN switching and Bridges
Dr. Rocky K. C. Chang 23 February 2004
Connections Johan Lukkien
LAN switching and Bridges
Presentation transcript:

Spanning Tree Protocol for Bridges/Switches 8-1

Bridge = Switch Bridge/switches are layer-2 switching device (look at the Ethernet destination address to decide how to forward a frame) Used to separate collision domains (segment) –Reduce collision probability –Increase aggregate bandwidth –Extend LAN’s length Can form a large and complicated network topology. 8- 2

Bridge ≠ Router Routers are layer-3 switching device. (Look at the IP destination address to decide how to forward a packet) Routers use a routing protocol (RIP or OSPF) to explicitly exchange routing information. –Bridges/switches do not use a protocol to exchange routing information. –Instead, bridges/switches implicitly learn how to forward packets. Bridge/switches are transparent to layer

A Topology Example Bridge/switch Router Same subnet 8- 4

Bridge’s Features Listen promiscuously Store and forward packets (not cut-through) Learn where a packet should be forwarded to Use spanning tree algorithm to avoid loops 8- 5

Simplest Bridge Promiscuously listen to every packet transmitted Forward a received packet to all of other segments Does not increase the total bandwidth, though. 8- 6

Desired Improvements If the source and destination hosts are on the same segment (port), the bridge need not forward a received packet to all of other segments (ports). If the source and destination hosts are on different segments (ports) and the destination host is on port i, the received packet should be forwarded to port i only, rather than all of other ports. 8- 7

Simple Method 1 Humane type in addresses for each port and this database is keep at the bridge. 8- 8

Simple Method 2 Place stations so that each LAN has only stations whose addresses were within a certain range. 8- 9

Simple Method 3 Let layer 2 addresses embed layer-3 addresses (LAN)

Management headache All these simple methods cause management headache. –In method 1 and 2, the manager needs to key in many layer-2 address or range. –In method 2, the hosts need to be placed in a particular way. –In method 3, the hosts need to be able to configure its own layer-2 address. This may generate the same layer- 2 addresses by error. The best method is that a bridge can learn which host is on which port itself

Learning Bridge Listen promiscuously to every packet. Store the layer-2 source address of the received packet with the port on which it is received in a cache. (learn) Check the layer-2 destination address of the received packet in the cache: –If not found, forward this packet to all ports except the one from which it was received. –If found (support port i), forward the packet only onto port i. If port i is the port from which this packet is received, the received packet is dropped. (filtered) The bridge ages each entry in the cache and delete it after a period of time

Example

Example

Example

Example 1 The bridge concludes that Q and A are on the same segment, therefore the Q to A packet can be discarded

Example 2 Bridge B1 cannot distinguish between hosts that are on LAN 2 and LAN 3 because B2 connect LAN 2 and LAN 3 transparently

Example 2 After every host has transmitted some packets, B1 and B2 know which host resides on which port

Example 2 From B1’s point of view, the network topology looks like this

Example 2 From B2’s point of view, the network topology looks like this. The learning bridge concept works for any tree topology! 8- 20

Learning Bridges Will Fail under Loops When there are loops in the topology, packets will spawn themselves and loop indefinitely

A Possible Scenario 1.On LAN 1, A sends a packet to R. So far, because B1, B2, and B1 do not know which LAN R is on, they forward the received packet to LAN 2. At the same time, B1, B2, and B3 note that A is on LAN 1. 2.Suppose that the packet forwarded by B3 reaches B1 and B2, B1 and B1 and B2 will note that A now moves from LAN1 to LAN2. (very strange!) 3.Suppose that B2 forwards the packet received in step 1 onto LAN2, then this packet will reach B1 and B3. B1 and B3 will note that now A is no LAN1. (very strange!) 8- 22

Spawn and Loop Problems From the above example, we see that when there is a loop in the network topology, packet will loop forever -- wasting network bandwidth. Worst of all, a packet will spawn itself many time whenever it is forwarded by a bridge -- drastically wasting network bandwidth! 8- 23

The Bridge’s Problem is Worse than That of the Router If there is a loop among routers, packet will be trapped in the loop. However, since a router only forwards a packet to one specific router, packets will not spawn themselves. In addition, the TTL field in the IP header limits the maximum number of transmissions that a packet can have. –However, in the layer-2 header, there is no such field. So, the lesson is that we should never let loops occur even if we need to sacrifice some performance

What Can We Do? Decide that using bridges is a bad idea ? –But clearly it has many advantages. Document that when using bridges, the network topology must be a tree. –However, when the network becomes large and complicated, it is hard to know if adding a link will cause a loop. –Also, for fault tolerance concerns, loops are good. Design bridges so that they can detect the existence of loops and issue people a warning. –Better than nothing. Design bridges so that they can prune the topology into a tree. –The best

A Spanning Tree Algorithm Is Needed Bridges will need to use a distributed spanning tree algorithm to shut off some ports so that the resulting topology is a loop-free tree

The Way Spanning Tree Works Bridges transmit special messages (called configuration message) to each other. A bridge will be elected as the root bridge. Every bridge calculates the distance of the shortest path from itself to the root bridge. For each LAN, select a designated bridge among the bridges residing on the LAN. For each bridge, choose a port (root port) that lead to the root bridge. Ports to be included in a spanning tree are the root ports and the ports on which self has been elected as designated bridge

Configuration Message 8- 28

Configuration Message A configuration message is transmitted by a bridge onto a port. It is received by all the other bridges on the LAN attached to the port. It is not forwarded outside the LAN. Root ID: ID of the bridge assumed to be the root. Bridge ID: ID of the bridge transmitting this configuration message. Cost: Cost of the shortest path from the transmitting bridge to the root bridge. Port ID: ID of the port from which the configuration message is transmitted

Configuration Message A bridge initially assume itself to be to root and transmits configuration messages on each of its ports with its ID as root and as transmitting bridge and 0 as cost. A bridge continuously receives configuration messages on each of its ports and save the best configuration messages from each port. The bridge determines the “best” configuration message by comparing not only the configuration messages received from a particular port but also the configuration message that the bridge would transmit on that port

Compare Two Configuration Messages C1 and C2 C1 is better than C2 if the root ID in C1 is lower than that in C2. If the root IDs are equal, then C1 is better than C2 if the cost in C1 is lower than that in C2. If the root ID and cost are equal, then C1 is better than C2 if its transmitting ID is lower than that in C2. If the root ID, cost, and transmitting IDs are equal, then then C1 is better than C2 if its port ID is lower than that in C

Compare Two Configuration Messages C1 and C2 In the above three cases, C1 is better than C2. If a bridge receives a better configuration message on a LAN than it would transmit, it no longer transmits configuration messages on that LAN

Calculation Root ID and Cost to the Root Each bridge independently determines the ID of root bridge. It is the minimum of the received root IDs and the ID of the bridge. Assume the ID of the bridge B is 18 and the following is the received messages: 8- 33

Calculation Root ID and Cost to the Root The best configuration message is from port 2. Therefore, the best root heard about by B is 12. And, the distance to the root bridge from B is = 86. And, the root port (and port leading to the root bridge) is port 2. B’s own configuration message now is It is better than those received from port 1, 3, and 4. B now is the designated bridge on port 1, 3, and 4 and transmit its configuration message onto port 1, 3, and

Select Spanning Tree Ports For bridge B, the following ports are selected for inclusion into the spanning tree: –B’s root port (port 2). –All ports for which B is the designated bridge. (port 1, 3, and 4) Selected ports are placed in the forwarding state, meaning that B will forward packets to and from those ports. All other ports are placed in the blocking state, meaning that B will NOT forward packet to and from them

Spanning Tree Example The best known root is 41 and the best cost to 41 is 12+1 = 13. The root port selected is port 4 because 111 <

Spanning Tree Example The configuration message (CM) that bridge 92 will transmit is It is better than those received from port 1 and 2. Therefore, B92 is the designated bridge on port 1 and 2 and B92 transmits its CM onto port 1 and

Spanning Tree Example Because B92’s CM ( ) is not better than , B92 is not designated bridge on port 5 and will not transmit its CM onto port 5. Port 1, 2, and 4 will be included in the spanning tree. Port 3 and 5 will be shut off

Detect Bridge Failure We need to handle the case when a bridge fails or is shut down. Because at that time, a new spanning tree should be constructed. The stored configuration message for each port contains a message age field, which is incremented after each unit of time. If the message reaches a certain threshold (maxage), the CM is discarded and the bridge recalculates as if it had never received a CM from that port. –This is to detect if designated bridge on a port is dead or not

Refresh the Configuration Messages The root bridge periodically transmits configuration message (every hello time) down the spanning tree. The message age field is set to 0. Every bridge on the spanning tree transmits the received configuration messages down the spanning tree. The message age is set to

Example Port 4’s CM times out. The root port switches to port 3. B92 is still the designated bridge on port 1 and

Example Assume that the CM on port 3 also times out. B92 will choose port 5 as the root port and send its new CM onto port 1 and

Recalculation Spanning tree Receipt of a configuration message on port X. –The bridge then compare the received CM with the stored CM. If the received CM is better, the bridge recalculates its own CM. Timer tick –If a CM expires, the bridge discards the CM and recalculate its own CM

Avoiding Temporary Loops After a topology change, the news will take sometime to spread to all part of the network. Until then, the spanning tree algorithm will operate on inconsistent data. This will have two possible outcomes: –Temporary loss of connectivity –Temporary loops Because loops may cause disaster in a bridged network, the spanning tree algorithm prefers loss of connectivity to loops

Avoiding Temporary Loops To prevent loops from happening, we can require a bridge to wait some time before allowing a bridge port that was in the blocking state to transition to the the forwarding state. The timer should be at least twice the maximum transmit time across the networks (forward delay) so that the topology change news can spread over all parts of the network. Basically, the idea is that transition ports from the forwarding state to the blocking state should be done ASAP. However, transition ports from the blocking state to the forwarding state should be deferred by some time so that no temporary loop will form

Why Do We Need Port ID? To select a unique path to the root bridge

Host Cache Timeout Value Bridges learn and cache the location of hosts. Because a host may move, it is important for a bridge to “forget” host locations unless its is frequently reassured that the learned information is correct. This is done by timing out entries that have not been recently verified. However, choosing a suitable timeout value is difficult: 8- 47

Host Cache Timeout Value If the chosen timeout value is too long and a host has moved to other place, traffic may not be correctly delivered to the host at the new place. Rather, traffic for that host is still delivered to the old place. (This is bad for roaming over multiple wireless access points.) If the chosen timeout value is too short (i.e., a cache entry be deleted) and a host has not moved, then the bridge unnecessarily needs to forward a received packet destined for that host to all other ports, which wastes a lot of network bandwidth

Host Cache Timeout Value A long value (e.g., 15 seconds) is used in the usual case to reduce wasted network bandwidth. –Usually, hosts do not move. A shorter value (e.g., forward delay) is used following a reconfiguration of the spanning tree algorithm. –When a spanning tree reconfigures, it may change which bridge should serve which LAN (the hosts on that LAN). –For this case, the timeout value should be short. Otherwise, hosts that change their designated bridge may not receive traffic for them for a long time. –Hosts may feel strange why every now and then, their network paths are broken without any reason

Detecting and Informing Topology Change We need a reliable way of informing bridges that the network topology has changed and they should use the shorter timeout value. The bridge that detects a topology change will send a message to its parent. This message will in turn be forwarded to the root bridge. The root bridge then set the topology change flag bit in its configuration messages that are sent (every hello time) downstream the spanning tree for a period that is forward delay plus max age long. The bridges that receive this type of messages use the shorter timeout value for their caches until the flag is no longer set

Network Parameters Bridge priority: the most significant portion of a bridge ID. Used to influence the choice of root bridge. Port priority: used to influence the choice of port when a bridge has twos connected in a loop. Hello time: The time between successive generation of configuration messages by a bridge that assumes itself to be the root. Max age: the message age value at which a stored CM is discarded. Forward delay: a parameter that temporarily prevents a bridge from starting to forward data packets to and from a link until news of topology change has spread to all parts of a bridged network

Performance Requirement for Bridges The spanning tree algorithm has two properties that make performance critical: –Lack of receipt of messages causes bridges to add connectivity. E.g., if a bridge does not receive any CM on some port, it will take over as the designated bridge on that port. Extra connectivity (loops) is potentially disastrous. Therefore, bridges should be designed to transmit CM correctly and quickly during congestion. otherwise, loops will results and cause more severe congestion, which in turn may make bridges unable to recover from congestion

Bridges May Not be Transparent Packet dropping due to buffer overflow. Delay may increase due to MAC or queuing delay. Error rate may increase. We want to keep the original CRC to catch errors made inside the bridge. However, when packets are forwarded between different kinds of LANs, CRC needs to be regenerated. Packet misordering may becomes possible when spanning tree changes. Packet duplication may becomes possible. E.g., a repeater just comes up that connects two LAN which were previously separated in the spanning tree

Broadcast Storm Will cause a flurry of messages which waste network bandwidth and may never end. Mainly observed with the IP protocol. One implementation decision with BSD cause this problem. –An end host will try to forward to a packet that it mysteriously receives with a network layer address of a different host. –Suppose that one IP host is incorrectly configured so that it thinks that its layer-2 address is all 1’s – the broadcast address. –What will happen when some host wants to send a packet to that host? 8- 54