Internetworking Basics

  •  

     Chapter 8


    Ethernet Switching

    These notes guide discuss Ethernet Switching

    Introduction

    Layer 2 Bridging

    Layer 2 Switching  
            Microsegmentation
            Mac Address Tables

    Switch Modes

    Spanning Tree Protocol  
            Broadcast Storm
            Address Table Filtering Instability
            STP in Operation

    Summary

     
     

    Introduction

    On completion of these notes you should...

    • Understand the purpose of bridges and switches.
    • Understand the effects of bridges and switches on colision and broadcast domains.
    • Define microsegmentation
    • Describe the store-and-forward, cut-through and fragment-free switching methods
    • Understand the purpose of Spanning Tree Protocol (STP) and how it works
    • Describe the different modes of STP
     

    Layer 2 Bridging

    A bridge is a device that connects two or more LAN segments together. The diagram below illustrates this. Two LAN's, LAN 1 and LAN 2 are connected together via the bridge.

    A bridge is different to a hub though because it make decisions on the data it receives. When a device transmits a frame to another device, the MAC address of both the sending and receiving device are contained within the frame. You may recall that a MAC stands for Media Access Control and that every network interface card has a unique MAC address. Here is an example of a MAC address

    00-40-F3-2C-4C-9B

    When a bridge receives a frame, it checks the destination MAC to see if it should forward it to the other LAN segment or not. It will not forward a frame to another LAN segment unless the frame is intended for a host on that segment. Thus, network traffic intended for a hosts on one segment is not forwarded to other segments. This selective forwarding of network data is called filtering.

    Sometimes, a device needs to send a message to all other devices. A generic message sent to all devices is called a broadcast.

    There may be various reasons for sending broadcast messages. As an example, perhaps the sending device needs to find the MAC address of another device. In such a case it would send a broadcast message.

    Both hubs and bridges forward broadcasts to all ports, a process called flooding. So, although a bridge splits up a collision domain, it does not divide a broadcast domain.

      

    So, the advantage of a bridge over a hub is that a bridge filters network traffic. Since network traffic is not automatically sent to all network segments, just to the appropriate segment, then this effectively divides a collision domain. Whereas with a hub, all devices attached make up one big collision domain, a bridge creates at least two collision domains, which means there are less collisions on the wire.

    Apart from a bridge's useful filtering capabilities, it can also be useful for connecting two LAN segments with different Ethernet speeds, e.g. 10Mbps Ethernet to 100Mbps Ethernet.

     

    Layer 2 Switching

    A switch is another devices that also creates a single concentration point, connecting many devices together. Whereas a bridge usually has a single port in and a single port out that connects two segments together, a switch has many ports, with devices attached to each port. A switch is often thought of as a multi-port bridge.

    When a switch connects many devices together, each link effectively becomes a separate microsegment. This make it possible for devices to operate in full-duplex mode.

    Just like bridges, switches keep MAC address tables and make forwarding decisions based on MAC addresses.

      

    When a switch receives a frame, it reads the destination MAC address. If knows which port to which the host with that address is attached to, it will forward the frame to that port only. Thus, network traffic intended for a host on one port is not forwarded to other ports. This filters out unnecessary traffic. Only if a switch does not know which port the host is on, or if a broadcast frame is received does it forward the frame to all the other ports.

    When you consider a bridge, you consider the incoming and outgoing ports to be attached to two separate LAN segments. However, since a switch has many ports, there will be many segments (microsegments) - segment private and dedicated to creating a single private link to a single host device. A switch effectively divides a collision domain into smaller collision domains, while the broadcast domain is extended, since broadcast traffic is always forwarded.

    ~~Microsegmentation~~

    Every single port connection on a switch creates a separate segment between the port and the device attached at the other end.

    This creation of dedicated links is called microsegmentation.  Moreover, with microsegmentation, because the link to each host device is dedicated to that host only, then in a full-duplex link, collisions do not occur and the host can make use of the full link bandwidth. The only time a switch relays traffic to more than one host is when it is relaying broadcast messages.

    ~~ MAC Address Tables ~~

    When a bridge or switch is first powered up, it reads the source and destination MAC address inside all frames that are transmitted on the LAN segments and builds a tables of MAC addresses. This table is used to decide where to forward frames. The diagram below illustrates the method used by a switch to build a MAC address table.

    Suppose Host A sends a frame to Host Z. The switch will then know that Host A is on port 1 and make an entry in it's MAC address table. The switch does not yet know where Host Z is, so it broadcasts the frame onto the other three ports. Then Host Z replies to Host A as shown below.

    The switch know realises that Host Z is on port 3 and make another entry in it's MAC address table. The switch carries on with the process of determining the port to which each host is connected and updating it's MAC address table. By this method, the switch builds up a good picture of the location of all the devices within the broadcast domain.

     

    Switch Modes

    When a switch forwards a frame, there are three modes it can use. These modes are store-and-forward, cut-through and fragment-free switching. Each has advantages and disadvantages with respect to performance and latency.

    ~~ Store-and-Forward Mode ~~

    A switch operating under the store-and-forward switching method waits until an entire frame is received before forwarding it on to its destination. This allows the switch to check the frame for errors and reject any bad frames, preventing them from propagating through the network. Although this switching method takes a little time, since a whole frame has to be read before forwarding it on, the latency is negligible.

    ~~ Cut-Through Mode ~~

    A switch operating under the cut-through switching method reads a frame until it has received the destination MAC address; then without waiting to read the rest of the frame it forwards the frame on to its destination. The disadvantage of this method is that it offers no error detection.

    ~~ Fragment-Free Mode ~~

    A switch operating under the fragment-free switching method reads a frame until it has received enough of it to be sure it is not a collision fragment. Any collision fragments are dropped, preventing them from propagating through the network. A valid frame is forwarded on to its destination.

    ~~ Which Mode to Use ~~

    When the source and destination bit rates are the same, frame bits can be sent out as soon as they are received. This is called synchronous switching. The cut-through and fragment-free methods can be used with synchronous switching; incoming bits are sent out immediately at the same bit rate as they were received.

    If the source and destination bit rates are not the same, a frame received at the source bit rate must be stored and then sent out at the destination bit rate. This is called asynchronous switching. The cut-through and fragment-free methods cannot be used with asynchronous switching. Only the store-and-forward method can be used.

    Here's an example; if a source is operating at 100Mbps and a destination is operating at 1000Mbps, which switching method can be used? Only the store-and-forward method can be used.

     

    Spanning Tree Protocol

    Sometimes on a network, extra bridges and/or switches are added in order to provide redundant paths for fault tolerance. Thus if one path becomes unavailable then an alternative path may be used. However, when bridges or switches are connected together such that there are redundant paths, there is the possibility of creating loops. To understand this, consider the diagram below:-

    There are two paths from Host A to Host C , one path through Switch 1 and another path through Switch 2. This path redundancy is useful if one of the switches stops functioning since there is alternative path for network traffic. However, this redundancy could also cause broadcast storms and address table filtering instability.

    ~~ Broadcast Storm ~~

    Broadcast Storms, where switches endlessly flood broadcast frames to all ports, are a possibility when redundant paths exist on a network. The STP mechanism is required to prevent this. Consider the diagram below:-

    When Host A sends a broadcast frame, such as an ARP request, the frame will be received by both Switch 1 and Switch 2. When Switch 1 receives the frame, it is identified as a broadcast message since the destination MAC address field contains the broadcast address FF:FF:FF:FF:FF:FF. It then floods the frame to Segment Y , which also contains Switch 2.

    When the broadcast frame arrives at Switch 2 , the switch repeats the process and floods it to Segment X , which also contains Switch 1. When Switch 1 receives the frame, it will flood it again. Thus, the broadcast frame will endlessly travel around around the network, from switch to switch.

    ~~ Address Table Filtering Instability ~~

    Address table filtering instability is another problem that might occur when redundant paths exist on a network. Consider the diagram below:-

    When Host A sends a message to Host B, the frame will be received by both Switch 1 and Switch 2.

    Suppose Switch 1 does not yet have an entry for Host B in it's MAC address table. It then floods the frame to all segments.

    When Host B receives the frame and replies to it, Switch 1 will deduce Host B is on port 1 on Segment X and create a MAC address entry >> Host B is on port 1.

    In the meantime, Switch 2 also receives the frame, does not yet have an entry for Host B in it's MAC address table either and so floods the frame to all segments.

    When Switch 1 receives a copy of the frame from Switch 2 on port 2, it removes the MAC address entry >> Host B is on port 1>> and replaces it with >> Host B is on port 2.

    Thus Switch 1 is now incorrect about which segment Host B is located on.

    ~~ STP in Operation ~~

    Spanning Tree Protocol (STP) is a a protocol designed to eliminate redundant paths and loops on a network. The specification for STP is defined in IEEE 802.1d.

    STP works as follows...

    Switches and bridges exchange special messages called Bridge Protocol Data Units (BPDUs) to inform each other of their existence. The purpose is these BPDUs is to decide which ports should remain open, which should be blocked to avoid loops and to elect a root bridge (which you can imagine as the king amongst bridges/switches.)

    Here is an example of a BPDU.

    Sender BID 8000:ABCDEF123456
    Root Path Cost 100
    Root BID 8000:123456ABCDEF
    Port ID 1

    At the beginning, each bridge/switch assumes that it is the root bridge and sends a BPDU out of all of its ports, advertising itself as the root bridge. The diagram below shows each switch sending out such a BPDU. You should note that in reality, a different BPDU is sent of each switch port, unless the port is disabled.

    A BPDU contains a bridge ID (BID) field. An election is held where the bridge or switch with the lowest Bridge ID is elected the root bridge. All the ports on a root bridge are then marked as designated ports that are allowed to forward MAC addresses.

    When the root bridge is elected, all the other bridges/switches decide which of their own ports will be used to connect to the root bridge. This will be the port with the least path cost to use and is known as the root port. Path costs, as shown in the table below, depend on the bandwidth of the link on that port. If two ports have the same path cost, the lowest numbered port is chosen.

    INTERFACE TYPE BANDWIDTH PORT PATH COST
    56K Serial 56,000 bits/sec 17857
    10M Ethernet 10,000,000 bits/sec 100
    FDDI 100,000,000 bits/sec 10

    In the diagram below, Switch 1 has been elected the root bridge. Switch 2 has decided that port 1 has the least path cost and so that port becomes the root port. Switch 3 also decided port 1 is its root port.

    Now that the root ports have been decided on, which of the switches in the diagram do you think should forward traffic onto Segment Z? If both of them are allowed to forward frames, then a loop would form. One switch's port 2 should be allowed to forward frames (acting as a designated port), while the other switch's port 2 should be disabled.

    On non-root bridges only one port can be designated, all others are blocked. Only designated ports forward MAC addresses. Designated ports are selected based on the lowest path cost to the root bridge for a segment.

    In the diagram below, the designated port for Segment Z is port 2 on Switch 2. Port number 2 on Switch 3 has been disabled. Any traffic destined for that segment would be forwarded through Switch 2 only.

    Thus the STP mechanism ensures that redundant links are closed down. Of course, any redundant link can be opened again. This would be necessary, for example, if the network topology changed.

    At any time bridge and switch ports running STP can be in one of following four modes:

    • Blocking - a port in this state sends and receives BPDUs but will not forward frames. When bridges/switches are turned on they are in this state; it is the default state.
        
    • Listening - a port in this state listens to BPDUs to ensure there are no loops. Frames are not forwarded when in this state.
        
    • Learning - a port in this state learns about MAC addresses and builds a MAC address table. Frames are not forwarded when in this state.
        
    • Forwarding - a port in this state sends and receives frames. BPDUs are still sent and received.
       
    • Disabled - a port in this state does not forward frames or send/receive BPDUs.

    ~~Activity~~

     Activity A

    Examine the picture below. Six switches are show, connecting together six LAN segments. The root bridge is Switch 1. You may assume the path cost of each switch is the same as the number in its name, e.g. Switch 1 has a path cost of 1, Switch 2 has a path cost of 2, etc.

    1. Decide which port of each switch would be assigned as the root port.
        
    2. Decide if port 2 on Switch 3 or port 2 on Switch 4 would be assigned as the designated port for Segment 3.
        
    3. Decide if port 3 on Switch 5 or port 2 on Switch 6 would be assigned as the designated port for Segment 3.


       

    1. Where are the root ports?         2. Where are the designated ports?

      

    Summary

    On completing these notes you should have learned the following key points:-

    • Both bridges and switches divide a collision domain into smaller collision domains.
    • Both bridges and switches increase the size of a broadcast domain.
    • Bridges are often used to connect two LAN segments.
    • Switches create microsegments, which are effectiviely dedicated point-to-point links
    • Switches allow devices to operate in full-duplex mode, increasing each link's bandwidth and reducing the number of collisions to a minimum.
    • There are three common switching modes used to forward frames, store-and-forward, cut-through and fragment-free.
    • Only the store-and-forward switching method can be used when the source and destination bit-rates are different, (asynchronous switching.)
    • The Spanning Tree Protocol (STP) is used to prevent loops forming when there are redundant paths on a network.
    • STP prevents broadcast storms and MAC Address Filtering Instability
    • The ports on an STP enabled switch can be in one of the following modes; blocking, learning, listening. forwarding and disabled.
     
     

    Site Home

    Top

    Unit Home


       


      

     

     

       
    This Unit 

    Unit Information

    Assessment

    Syllabus

    Scheme of Work

    Learning Resources

    Notes & Lessons

    Assignments

    Quizzes

    Activities

    Resources

    Books & Things

    Links