340 likes | 545 Views
For the next few meetings, we will focus on:. (4) Transport Layer (3) Network Layer (2) Data Link Layer (1) Physical Layer. Today, we will cover:. (2) Data Link Layer Layer-2 switching and how switches differ from bridges Address learning Spanning-Tree Protocol (STP)
E N D
For the next few meetings, we will focus on: • (4) Transport Layer • (3) Network Layer • (2) Data Link Layer • (1) Physical Layer
Today, we will cover: • (2) Data Link Layer • Layer-2 switching and how switches differ from bridges • Address learning • Spanning-Tree Protocol (STP) • LAN switch types used on Cisco routers
Layer-2 switching • When Cisco discusses switching, they’re talking about layer-2 switching unless they say otherwise. • Layer-2 switching is the process of using the hardware address of devices on a LAN to segment a network
Collision Domains • Switches/bridges break up large collision domains into smaller ones. • Switches break up collision domains on each and every port • Can connect hubs into switch ports (collision domain) • A collision domain is a network segment with two or more devices sharing the same bandwidth. • Routers create VLANs (logcal LANs) and segment broadcast domains.
Bridging vs. LAN Switching • Bridges are software based, switches are hardware based (they use ASIC chips) • Switches have higher # of ports • Both bridges and switches forward broadcasts • Both bridges and switches make forwarding decisions based on layer-2 addresses
A Tricky Point • Bridged (switched) networks break up collision domains, but remember, _that_ 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)
Three Switch Functions • (remember these!) • 1) Address learning • 2) Forward/filter decisions • 3) Loop avoidance
Address Learning • Layer-2 switches and bridges remember the source hardware address of each frame received on an interface, and 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 and finds the exit interface in the MAC database. The frame is only forwarded out the specified destination port.
Loop Avoidance • If multiple connections between switches are created for redundancy purposes, network loops can occur. Spanning Tree Protocol (STP) is used to stop network loops while still permitting redundancy.
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, which is 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 STA to first create a topology database, then 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 – all switches exchange information to use in the selection of the root switch. Each switch compares the parameters in the Bridge Protocol Data Unit 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. More on this in a minute. • 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. More on this in a minute. • 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 table on board for Ethernet costs.
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.
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.
Once Again, STP States Are: • Blocking • Listening • Learning • Forwarding • Disabled
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.
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.
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 (not recommended to change default STP timers. • Forward delay means the time it takes to transition a port from listening to learning mode or vice versa.
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.
Three Switching Modes: • Cut-through (fastest) – when in this mode, the switch waits for the destination hardware address to be received before it looks up the destination address in the MAC filter table. • FragmentFree • This is the default mode for the Catalyst 1900 switch, and it’s sometimes referred to as modified cut-through • The switch checks the first 64 bytes of a frame before forwarding it for fragmentation, thus guarding against possible collisions.
Three Switching Modes (cont.) • Store-and-forward (slowest) – The complete data frame is received on the switch’s buffer, a CRC is run, and then the switch looks up the destination address in the MAC filter table. • (See example on board for different points where the switching mode takes place in the frame.)
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
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. • It’s the default switching method for the 1900 switches.
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)
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