1 / 47

CHAPTER 7: Layer 2 Switching

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 .

yves
Download Presentation

CHAPTER 7: Layer 2 Switching

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CHAPTER 7: Layer 2 Switching

  2. 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

  3. 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

  4. Before Layer 2 Switching

  5. Switched LANs

  6. Typical Switched Designs

  7. Switching Services • Layer 2 switching provides: • Hardware-based bridging (ASIC) • Wire speed • Low latency • Low cost

  8. Broadcast and Collision Domains • Number of Collision Domains= (# of ports) • One Broadcast Domain

  9. 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.

  10. 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

  11. 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)

  12. 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

  13. 4000.1111.1111 4000.3333.3333 E2 E0 E3 E1 4000.4444.4444 4000.2222.2222 Learning and Forwarding • Forwards Broadcasts out all interfaces • Forwards Unknown Unicasts everywhere • Forwards Known unicasts out correct interface Filter Table 4000.1111.1111 E0 4000.2222.2222 E1 4000.3333.3333 E2 4000.4444.4444 E3

  14. 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

  15. 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

  16. 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

  17. B C A B A D Switching Loops • Broadcast Storms • Multiple Copies of a Frame • Database Instability – thrashing the MAC table • Multiple Loops • Example: PC B sends a Broadcast

  18. 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

  19. 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.

  20. 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.

  21. 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.

  22. 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.

  23. 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.

  24. 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.

  25. 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.

  26. 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.

  27. 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.

  28. Spanning-Tree Operations • Selecting the root bridge • Selecting the designated port

  29. 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 paths in the switched network. It also learns MAC addresses and builds a filter table but does not forward frames.

  30. Spanning-Tree Port States (cont.) • Forwarding – the port sends and receives all data on the bridged port. • Disabled – a port in the disabled state does not participate in the frame forwarding or STP. A port in the disabled state is virtually nonoperational.

  31. Once Again, STP States Are: • Blocking • Listening • Learning • Forwarding • Disabled

  32. A Little More on Port States • Switch ports are most often in either the blocking or forwarding state • A forwarding port is one that has been determined to have the lowest (best) cost to the root bridge. • But when and if the network experiences a topology change (b/c of a failed link or b/c someone adds a new switch), you’ll find the ports on a switch in listening and learning state.

  33. Port States (cont.) • Blocking ports is a strategy for preventing network loops • Once a switch determines the best path to the root bridge, then all other ports will be in blocking mode. • Blocked ports can still receive BPDUs; they just don’t send out any frames.

  34. Convergence • Convergence occurs when bridges and switches have transitioned to either the forwarding or blocking modes. • No data is forwarded during this time. • Before data can be forwarded again, all devices must be updated. • Convergence is important to make sure all devices have the same database, but it does cost time; it usually takes 50 seconds to go from blocking to forwarding mode • Forward delay means the time it takes to transition a port from listening to learning mode or vice versa.

  35. BPDU B A Non Root Bridge Root Bridge Default Priority= 32768 Default Priority= 32768 Mac address- 0000.0000.0001 Mac address-0000.0000.1111 Spanning Tree Protocol (STP) • Switches communicate through BPDU’s • End Result: Some ports “block”, others “forward” • Blocking ports do not forward traffic, preventing loops Root Port Designated Port Designated Port Blocked Port

  36. Spanning-Tree Example

  37. Lastly, LAN Switch Types • LAN switch types decide how a frame is handled when it’s received on a switch port. • Latency • Definition: The time it takes for a frame to be sent out an exit port once the switch receives the frame • Depends on the chosen switching mode • There are three switching modes • Cut-through (FastForward) • FragmentFree (modified cut-through) • Store-and-forward

  38. Cut-Through (Real Time) • The LAN switch copies only the destination address (the first six bytes following the preamble) onto its onboard buffers. • That done, it then looks up the hardware destination address in the MAC switching table, determines the outgoing interface, and proceeds to forward the frame toward its destination

  39. FragmentFree (Modified Cut-Through) • The switch waits for the collision window (64 bytes) to pass before forwarding. • This is b/c if a packet has an error, it almost always occurs within the first 64 bytes.(Note:Ethernet frames must be >= 64 and < 1518) • It’s the default switching method for the 1900 switches.

  40. Store-and-Forward • Cisco’s primary LAN switching method • In this mode, the LAN switch copies the entire frame onto its onboard buffers and then computes the cyclic redundancy check (CRC). • Because it copies the entire frame, latency through the switch varies with frame length. • The frame is discarded if: • It contains a CRC error • It’s too short (less than 64 bytes including the CRC) • It’s too long (more than 1518 bytes including CRC)

  41. LAN Switch Types • Cut-through (FastForward) • FragmentFree (modified cut-through) • Store-and-forward

  42. Setting The Passwords #config t (config)#enable password level 1 todd (config)#enable password level 15 todd

  43. Setting The Hostname #config t (config)#hostname Todd1900 Todd1900(config)#

  44. Setting IP Information

  45. Configuring Interface Descriptions

  46. Erasing The Switch Configuration

  47. In Summary, we covered: • Layer-2 switching and how switches differ from bridges • Address learning and how the MAC address filter table is built • Forward/filtering decisions that layer-2 switches make and how they make them • Spanning-Tree Protocol and how it prevents loops • LAN switch types used on Cisco routers and how they differ • Basic 1900 configuration

More Related