380 likes | 403 Views
Chapter 3 Part 2 Switching and Bridging. Networking CS 3470, Section 1. Refresher. We can use switching technologies to interconnect links to form a large network What is a hub ? What is a switch ? What is a bridge ? Collision domains?. Hubs. Hubs operate at the physical layer Why?
E N D
Chapter 3 Part 2 Switching and Bridging Networking CS 3470, Section 1
Refresher • We can use switching technologies to interconnect links to form a large network • What is a hub? • What is a switch? • What is a bridge? • Collision domains?
Hubs • Hubs operate at the physical layer • Why? • They only repeat signals
Switches/Bridges • Bridges (or switches) operate at the data link layer • Why? • They only make informed switching decisions using link layer addresses (typically MAC addresses)
Bridge Advantages • Isolates collision domains resulting in higher total max throughput • Limitless number of nodes and geographical coverage • Can connect different Ethernet types • Transparent (“plug-and-play”): no configuration necessary
Bridge Self Learning • A bridge has a bridge table • Entry in bridge table: • (Node LAN Address, Bridge Interface, Time Stamp) • Stale entries in table dropped (TTL can be 60 min) • Bridges learn which hosts can be reached through which interfaces • When frame received, bridge “learns” location of sender: incoming LAN segment • Records sender/location pair in bridge table
Bridge Learning: Drawback • Previous strategy works fine until a LAN has a loop in it • Possible bad failure case – frames could loop forever without getting to final destination! • How could this happen? • In a large network, some administrator could add a bridge that closes a loop without realizing it • Could also be built in on purpose to provide redundancy
A Loop? • Suppose all bridge table are empty • Network J wants to send to Network E
A Loop? • B4 does not know where E is at, so flood • B2 does not know where E is at, so flood • B6 does not know where E is at, so flood
Disabled Bridges Spanning Tree • For increased reliability, desirable to have redundant, alternative paths from source to dest • But we don’t want the loop problem! • Solution: organize bridges in a spanning tree by disabling subset of interfaces
Spanning Tree Algorithm • Protocol used by set of bridges to agree upon a spanning tree for a particular LAN • Each bridge decides the ports over which it is and is not willing to forward frames • Algorithm is dynamic • Bridges may reconfigure themselves into a new spanning tree should some bridge fail
Spanning Tree Algorithm • Each bridge has a unique identifier • B1, B2, B3… B A B3 B5 C B7 K D F B2 E B1 G H B6 B4 I J
Spanning Tree Algorithm • Algorithm elects bridge with smallest ID as root of the spanning tree B A B3 B5 C B7 K D F B2 E B1 G H B6 B4 I J
Spanning Tree Algorithm • The root bridge has all ports enabled. • Each bridge computes the shortest path to the root and notes which port on that path. • This is the “preferred” port to the root bridge. • All bridges connected to the same LAN elect a single designated bridge to forward frames to the root bridge. • If there's a tie, the one with the lowest ID wins.
Spanning Tree Algorithm • While a human could have an overall view of the LAN and compute the spanning tree, bridges don’t have that luxury • Bridges must exchange configuration information with each other to decide root bridge and spanning tree
Configuration Messages • Contain three things • ID for bridge that is sending message (X) • Distance (measured in hops) from sending bridge to the root bridge (d) • ID for what sending bridge believes to be root bridge (Y) • In form (Y,d,X)
Configuration Messages • Initially, each bridge thinks it is the root • Sends configuration messages out on each port identifying self as root and giving distance to the root as 0
Spanning Tree Algorithm B A B3 B5 C B7 K D F B2 E B1 G H B6 B4 I J
Spanning Tree Algorithm B (B3,0,B3) (B7,0,B7) (B1,0,B1) A (B5,0,B5) (B2,0,B2) B3 B5 C (B5,0,B5) (B1,0,B1) B7 K D (B3,0,B3) (B1,0,B1) F B2 E B1 G H (B6,0,B6) (B4,0,B4) (B7,0,B7) (B2,0,B2) (B5,0,B5) (B1,0,B1) (B4,0,B4) B6 (B1,0,B1) (B6,0,B6) B4 I J
Configuration Messages • Upon receiving messages, bridge checks to see if new message for port is better than currently recorded information • Message is better if it • Identifies a root with a smaller ID • Identifies a root with equal ID but shorter distance • Root ID and distance are equal, but sending bridge has smaller ID • If message better, discard old information
Spanning Tree Algorithm B (B3,0,B3) (B7,0,B7) (B1,0,B1) A (B5,0,B5) (B2,0,B2) B3 B5 C (B5,0,B5) (B1,0,B1) B7 K D (B3,0,B3) (B1,0,B1) F B2 E B1 G H (B6,0,B6) (B4,0,B4) (B7,0,B7) (B2,0,B2) (B5,0,B5) (B1,0,B1) (B4,0,B4) B6 (B1,0,B1) (B6,0,B6) B4 I J
Spanning Tree Algorithm B (B3,0,B3) (B7,0,B7) (B1,0,B1) A (B5,0,B5) (B2,0,B2) B3 B5 C (B5,0,B5) (B1,0,B1) B7 K D (B3,0,B3) (B1,0,B1) F B2 E B1 G H (B6,0,B6) (B4,0,B4) (B7,0,B7) (B2,0,B2) (B5,0,B5) (B1,0,B1)! (B1,0,B1) (B4,0,B4) B6 (B1,0,B1) (B6,0,B6) B4 I J
Configuration Messages • When a bridge receives a message that it is not the root bridge… • It stops generating configuration messages on its own • Only forwards configuration messages from other bridges after first adding 1 to the distance field
Spanning Tree Algorithm • B3 has accepted B2 as root B (B3,0,B3) (B7,0,B7) (B1,0,B1) A (B5,0,B5) (B2,0,B2) B3 B5 C (B5,0,B5) (B1,0,B1) B7 K D (B3,0,B3) (B1,0,B1) F B2 E B1 G H (B6,0,B6) (B4,0,B4) (B7,0,B7) (B2,0,B2) (B5,0,B5) (B1,0,B1)! (B1,0,B1) (B4,0,B4) B6 (B1,0,B1) (B6,0,B6) B4 I J
Spanning Tree Algorithm • B3 sends (B2,1,B3) towards B5 • B2 accepts B1 as root and sends (B1,1,B2) towards B3 B (B2,1,B3) (B1,1,B7) (B1,0,B1) A (B1,1,B5) (B1,1,B2) B3 B5 C (B1,1,B5) (B1,0,B1) B7 K D (B2,1,B3) (B1,0,B1) F B2 E B1 G H (B1,1,B6) (B1,1,B4) (B1,1,B7) (B1,1,B2) (B1,1,B5) (B1,0,B1) (B1,1,B4) B6 (B1,0,B1) (B1,1,B6) B4 I J
Spanning Tree Algorithm • B5 accepts B1 as root and sends (B1,1,B5) towards B3 B (B2,1,B3) (B1,1,B7) (B1,0,B1) A (B1,1,B5) (B1,1,B2) B3 B5 C (B1,1,B5) (B1,0,B1) B7 K D (B2,1,B3) (B1,0,B1) F B2 E B1 G H (B1,1,B6) (B1,1,B4) (B1,1,B7) (B1,1,B2) (B1,1,B5) (B1,0,B1) (B1,1,B4) B6 (B1,0,B1) (B1,1,B6) B4 I J
Spanning Tree Algorithm • B3 accepts B1 as root • Stops forwarding on both ports because B2 and B5 are closer to root B (B2,1,B3) (B1,1,B7) (B1,0,B1) A (B1,1,B5) (B1,1,B2) B3 B5 C (B1,1,B5) (B1,0,B1) B7 K D (B2,1,B3) (B1,0,B1) F B2 E B1 G H (B1,1,B6) (B1,1,B4) (B1,1,B7) (B1,1,B2) (B1,1,B5) (B1,0,B1) (B1,1,B4) B6 (B1,0,B1) (B1,1,B6) B4 I J
A Loop? • So how do we fix our first example’s loop using spanning tree?
Limitations of Bridges • Bridges only mean to connect a “handful” of similar LANs • Spanning tree algorithm scales linearly • At some point there are just too many messages • Bridges forward all broadcast frames • A different approach to increase the scalability of LANs is through the use of virtual LANs(VLANs)
A B E VLANs • IEEE 802.1Q standard • VLANs separate the collision domain as well as the broadcast domain • Hosts in each VLAN are in the same Virtual LAN • “Color coded” • “Trunks” carry multiple VLANs between switches
VLANs • Security • Data on a VLAN is separated from other data • VLAN can span multiple switches • Example: Resnet • Flexibility • Now, users can connect to the closest switch and be put onto a VLAN with similar systems
VLANs • VLAN tagged frames are carried as standard data link layer (802.3) frames • Type field is modified from 0x8000 to 0x8100 • DST and SRC addresses are preserved • LEN/TYPE fields are modified to include the VLAN tag • Data field is preserved • TAG field adds 22 bytes to the frame
VLAN Notes • 4096 VLANs allowed • Most switches only support up to 1024 VLANs • Spanning tree should be run on each VLAN
Routers • Routersare nodes that interconnect networks • Often called gateways • Network layer device • Why? • Works with IP addresses • Connects heterogeneous networks based off of different data link protocols • Example?
Bridges vs. Routers • Both store-and-forward devices • Routers: network layer devices (examine network layer headers) • Bridges are link layer devices • Routers maintain routing tables, implement routing algorithms • Bridges maintain bridge tables, implement filtering, learning and spanning tree algorithms
Routers vs. Bridges Bridges Pros Bridges Cons All traffic confined to spanning tree, even when alternative bandwidth is available Bridges do not offer protection from broadcast storms • Bridge operation is simpler requiring less packet processing • Bridge tables are self learning
Routers vs. Bridges Routers Pros Routers Cons Require IP address configuration (not plug and play) Require higher packet processing • Arbitrary topologies can be supported, cycling is limited by TTL counters (and good routing protocols) • Provide protection against broadcast storms
Routers vs. Bridges • Bridges do well in small (few hundred hosts) while routers used in large networks (thousands of hosts)