2 - ccna - switching

of 17 /17
CCNA – SWITCHING By: Sameh El-Hakim Cyber Security Engineer

Author: sameh

Post on 06-Aug-2015




9 download

Embed Size (px)


1. CCNA SWITCHING By: Sameh El-Hakim Cyber Security Engineer 2. INTRODUCTION Switching is the process of using the physical address of devices to perform forwarding decisions. There are three distinct functions of layer 2 switching that are vital for you to remember: Address learning Forward/filter decisions Loop avoidance 3. ADDRESS LEARNING When a switch is first powered on, the MAC forward/filter table Content Addressable Memory (CAM) is empty After Learning 4. FORWARD/FILTER DECISIONS When a frame is received on an interface, the switch looks at the destination hardware address, then chooses the appropriate exit interface for it in the MAC database. This way, the frame is only forwarded out of the correct destination port. 5. LOOP AVOIDANCE If multiple connections between switches are created for redundancy purposes, network loops can occur. Spanning Tree Protocol (STP) is used to prevent network loops while still permitting redundancy. * Redundancy or redundant links between switches are important to have in place because they help prevent nasty network failures in the event that one link stops working. 6. THE SPANNING TREE PROTOCOL (STP) Responsible for identifying links in the network and shutting down the redundant ones, preventing possible network loops. In order to do so: I. All switches in the network exchange BPDU messages between them to agree upon the root bridge. II. Once they elect the root bridge, every switch has to determine which of its ports will communicate with the root bridge. * Bridge Protocol Data Units (BPDUs) are frames that contain information about the Spanning tree protocol (STP). Inside the BPDU is the bridge ID. 7. SPANNING-TREE TERMS 1. Root bridge is the bridge with the lowest and the best bridge ID. The switches within the STP network elect a root bridge, and once it has been elected, all other bridges must create a single path to it. The port with the best path to the root bridge is called the root port. 2. Non-root bridges These are all bridges that arent the root bridge. 3. BPDU 4. Bridge ID The bridge ID is how STP keeps track of all the switches in the network. Its determined by a combination of the bridge priority, which is 32,768 by default on all Cisco switches, and the base MAC address. The bridge with the lowest bridge ID becomes the root bridge in the network. Most networks benefit by forcing a specific bridge or switch to be on the Root Bridge by setting its bridge priority lower than the default value. 5. Port cost is the deciding factor used by every bridge to find the most efficient path to the root bridge. 6. Path cost A switch may encounter one or more switches on its path to the Root Bridge, and 8. BRIDGE PORT ROLES 1. Root port is the link with the lowest path cost to the root bridge. The root bridge can never have a root port designation, while every other switch in a network must have one and only one root port. 2. Designated port A designated port is one thats been determined to have the best (lowest) cost to get to on a given network segment. A designated port will be marked as a forwarding port. 3. Non-designated port 4. Forwarding port will be either a root port or a designated port. 5. Blocked port A blocked port wont forward frames in order to prevent loops. 9. SPANNING-TREE PORT STATES 1. Disabled it doesnt participate in frame forwarding or STP. 2. Blocking As I mentioned, a blocked port wont forward frames; it just listens to BPDUs. The purpose of the blocking state is to prevent the use of looped paths. All ports are in blocking state by default when the switch is powered up. 3. Listening This port listens to BPDUs to make sure no loops occur on the network before passing data frames. 4. Learning The switch port listens to BPDUs and learns all the paths in the switched network. A port in learning state populates the MAC address table but still doesnt forward data frames. Forward delay refers to the time it takes to transition a port from listening to learning mode, or from learning to forwarding mode, which is set to 15 seconds by default and can be seen in the show spanning-tree output. 5. Forwarding This port sends and receives all data frames on the bridged * The original STP (802.1d) takes 50 seconds to go from blocking to forwarding mode by default 10. LINK COSTS 11. STP VS RSTP CONVERGENCE TIME STP: I. The hello time is 2 seconds. The Max Age Timer is 10x the hello timer. II. Once a port is in blocking state, it stays there for 20 seconds. Then moves onto listening at 15 seconds, then learning at 15 seconds. That's where you get your 50 seconds. RSTP: I. The max age is 3x the hello. So a max of 6 seconds. II. Moves onto learning at 15 12. SPANNING-TREE OPERATIONS Since the priorities are all equal to 32,768, well compare MAC addresses and find the MAC address of S1 is lower than that of S2 and S3, meaning that S1 has a better bridge ID. 13. SPANNING-TREE OPERATIONS Looking at the cost of each link, its clear why S2 and S3 are using their directly connected links, because a gigabit link has a cost of 4. For example, if S3 chose the path through S2 as its root port, wed have to add up each port cost along the way to the root, which would be 4 + 4 for a total cost of 8. Every port on the root bridge is a designated, or forwarding, 14. SPANNING-TREE OPERATIONS based on the bridge ID, the port with the best and lowest would become the only bridge forwarding on that segment, with the one having the highest, worst bridge ID put into blocking mode. Since S3 had a lower bridge ID (better), S2s port went into blocking mode. 15. STP EXAMPLE 16. REFERENCES * CCNA Routing and Switching Study Guide - Lammle, Todd * http://searchnetworking.techtarget.com * http://blog.pluralsight.com/switching-and-stp * http://www.techexams.net/forums/ccna-ccent/52440-stp-vs- rstp-convergence-times.html * Interview questions: http://computernetworkingnotes.com/basic-networking-interview/questions-and- answers.html 17. THANK YOU