CHAPTER 7 Layer 2 Switching Objectives Understand Switching vs Routing Distinguish between Switching and Bridging Explain how switches make forwarding decisions Describe the STP algorithm Explain the types of LAN Switching Basic switch configuration Layer 2 Switching Purposes for using switching Breaks up collision domains Security through VLAN implementation Cost effective resilient internetwork Purpose for Spanning Tree Protocol STP Stops loops in layer 2 switched networks Before Layer 2 Switching Switched LANs Typical Switched Designs Switching Services Layer 2 switching provides Hardware based bridging ASIC Wire speed Low latency Low cost Broadcast and Collision Domains Number of Collision Domains of ports One Broadcast Domain Layer 2 Switching Considerations Must break up the collision domains correctly Make sure that users spend 80 percent of their time on the local segment Switches do not break up broadcast domains by default Bridging vs LAN Switching Bridges are software based switches are hardware based they use ASIC chips Switches have higher of ports Both forward broadcasts Both learn MAC addresses by examining Source Address header Both make forwarding decisions based on layer 2 addresses Destination MAC address A Tricky Point Bridged switched networks break up collision domains but remember the network is still one large broadcast domain Some major grief as your network grows Broadcasts and multicasts Slow convergence time of spanning trees That s why layer 2 switches bridges cannot completely replace routers layer 3 devices Switch Functions Various types of Ethernet Connectivity 10M to 10G Provides access to end user devices Core functions Address Learning Forwarding Filtering Loop Avoidance Operates Using OSI Layer 2 Concepts by Default Learning and Forwarding 4000 1111 1111 4000 3333 3333 E0 E1 E3 4000 4444 4444 4000 2222 2222 Filter Table 4000 1111 1111 4000 2222 2222 4000 3333 3333 4000 4444 4444 E2 E0 E1 E2 E3 Forwards Broadcasts out all interfaces Forwards Unknown Unicasts everywhere Forwards Known unicasts out correct interface Address Learning Layer 2 switches and bridges remember the source hardware address of each frame received on an interface they enter this information into a MAC database called a forward filter table Forward filter decisions When a frame is received on an interface the switch looks at the destination hardware address finds the exit interface in the MAC database the frame is forwarded out only the specified destination port Loop Avoidance Multiple connections between switches created for redundancy purposes network loops can occur Spanning Tree Protocol STP used to stop network loops still permits redundancy Switching Loops Broadcast Storms Multiple Copies of a Frame Database Instability thrashing the MAC table Multiple Loops Example PC B sends a Broadcast C A A B B D Spanning Tree Protocol STP Originally created by DEC Compaq HP IEEE later created its own version called 802 1D All Cisco switches run the IEEE 802 1D version of STP not compatible with the DEC version STP STP s main task is to stop network loops from occurring in layer 2 network bridges or switches Uses Spanning Tree Algorithm STA create a topology database search out destroy redundant links Important STP Terminology Root Bridge the bridge with the best lowest ID With STP the key is for all the switches in the network to elect a root bridge that becomes the focal point in the network BPDU Bridge Protocol Data Unit all switches exchange information used in the selection of the root switch Each switch compares the parameters in the BPDU that they send to one neighbor with the one that they receive from another neighbor More STP Terms Bridge ID this is how STP keeps track of all switches in the network Nonroot bridge all bridges that are not the root bridge Root port always the link directly connected to the root bridge or the shortest path to the root bridge Designated port either a root port or a port that has been determined as having the best lower cost a designated port will be marked as a forwarding port Last Page of STP Terms Port cost determined when multiple links are used between two switches and none are root ports The cost of a link is determined by the bandwidth of a link Forwarding port port that forwards frames Blocked port port that will not forward frames in order to prevent loops However a blocked port will always listen to frames Spanning Tree Protocol STP Remember STP s job is to find all links in the network and shut down any redundant ones thereby preventing network loops from occurring STP does this by first electing a root bridge that will preside over network topology decisions Selecting the Root Bridge The bridge ID is used to elect the root bridge in the network as well as to determine the root port This ID is 8 bytes long and includes both the priority and the MAC address of the device The default priority on all devices running the IEEE STP version is 32 768 Selecting the Root Bridge cont To determine the root bridge the priorities of the bridge and the MAC address are combined Ex If two switches call them A and B both use the default priority of 32 768 then the MAC address will be used instead If switch A s MAC address is 0000 0c00 1111 1111 and switch B s MAC address is 0000 0c00 2222 2222 then switch A would become the root bridge Remember the lower value is the better one when electing a root bridge Selecting the Root Bridge cont BPDUs bridge protocol data units are sent every 2 seconds by default out all active ports on a bridge switch and the bridge with the lowest best bridge ID is elected the root bridge Selecting the Designated Port If more than one link is connected to the root port then port cost becomes the factor used to determine which port will be the root port To determine the port or ports that will be used to communicate with the root bridge you must first figure out the path s cost need lowest The STP cost is an accumulated total path cost based on the available bandwidth of each of the links See next slide Ethernet costs Spanning Tree Operations Selecting the root bridge Selecting the designated port Spanning Tree Port States 5 Blocking a blocked port won t forward frames it just listens to BPDUs All ports are in blocking state when the switch is powered up Listening the port listens to BPDUs to make sure no loops occur on the network before passing data frames Learning the switch port listens to BPDUs and learns all the
View Full Document