Switch Forwarding:  "Store and Forward" vs. "Cut-through"

Version 3

    This post is basic, and aimed for beginners that wish to understand the difference between Store and Forward and Cut-through forwarding modes implementation in Mellanox Spectrum switches, and supply configuration example.

    The option to configure the switch mode is available starting from MLNX-OS version 3.6.4006 (per port).

     

    References

     

    Overview

    Store-and-Forward is used to describe a functionality where a switch receives a complete packet, stores it, and only then forwards it.

    since the switch make forwarding decisions based on the destination address which is at the header of the packet, the switch can make the forwarding decision before receiving the complete packet, this process is called cut-through, the switch forwards part of the packet before receiving the complete packet.

     

    Cut-through allows lower latency and saves buffer space, but if an error occurred in the packet while utilizing cut-through, the packet will be forwarded with an error, alternatively, utilizing store-and-forward allows the switch to drop erroneous packets.

     

    The configuration of the mode, can be done per egress port. By default the mode is cut-through.

     

     

    Note: If low-latency is crucial to a certain network, it is recommended to have the leafs and spines configured with similar port speed (for cut-through). However, in many networks the uplink ports of the leafs/ToRs will be in higher speed than the downlink ports towards the servers. For example, an interface of 10GbE passing traffic to 40GbE interface, causes the switch to store the whole packet before sending it which increases latency (depending on the size of the packet and the speed of the interface). If the ingress and egress interfaces have the same speed or if the ingress port will be in higher speed than the egress port, the switch will operate in a cut-through mode. Each packet is parsed and sent to the egress port even before the whole packet gets into the system. This act reduces overall latency in the network.

     

     

    Configuration

    There are two options to set the forwarding mode.

    • Per switch globally
    • Per port

     

    1. Get the current switch forwarding mode configuration

    switch (config) # show switchmode

    ------------------------------------------------

    Interface   Mode                 Configuration    

    ------------------------------------------------

    Eth1/1      cut-through          inherited        

    Eth1/2      cut-through          inherited        

    Eth1/3      cut-through          inherited        

    Eth1/4      cut-through          inherited        

    Eth1/5      cut-through          inherited        

    Eth1/6      cut-through          inherited        

    Eth1/7      cut-through          inherited        

    Eth1/8      cut-through          inherited        

    Eth1/9      cut-through          inherited        

    Eth1/10     cut-through          inherited        

    Eth1/11     cut-through          inherited        

    Eth1/12     cut-through          inherited        

    Eth1/13     cut-through          inherited        

    Eth1/14     cut-through          inherited        

    Eth1/15     cut-through          inherited        

    Eth1/16     cut-through          inherited        

     

    Global forwarding mode: cut-through

     

    2. Change the mode globally to Store-and-Forward

     

    switch (config) # switchmode store-and-forward

     

    switch  (config) # show switchmode

    ------------------------------------------------

    Interface   Mode                 Configuration    

    ------------------------------------------------

    Eth1/1      store-and-forward    inherited        

    Eth1/2      store-and-forward    inherited        

    Eth1/3      store-and-forward    inherited        

    Eth1/4      store-and-forward    inherited        

    Eth1/5      store-and-forward    inherited        

    Eth1/6      store-and-forward    inherited        

    Eth1/7      store-and-forward    inherited        

    Eth1/8      store-and-forward    inherited        

    Eth1/9      store-and-forward    inherited        

    Eth1/10     store-and-forward    inherited        

    Eth1/11     store-and-forward    inherited        

    Eth1/12     store-and-forward    inherited        

    Eth1/13     store-and-forward    inherited        

    Eth1/14     store-and-forward    inherited        

    Eth1/15     store-and-forward    inherited        

    Eth1/16     store-and-forward    inherited        

     

    Global forwarding mode: store-and-forward

     

    3. To set specific port to Store-and-Forward while all other ports are in cut-through mode, run:

    switch (config) # no switchmode store-and-forward

     

    switch (config) # interface ethernet 1/1 switchmode store-and-forward

     

    switch (config) # show switchmode

    ------------------------------------------------

    Interface   Mode                 Configuration    

    ------------------------------------------------

    Eth1/1      store-and-forward    configured       

    Eth1/2      cut-through          inherited        

    Eth1/3      cut-through          inherited        

    Eth1/4      cut-through          inherited        

    Eth1/5      cut-through          inherited        

    Eth1/6      cut-through          inherited        

    Eth1/7      cut-through          inherited        

    Eth1/8      cut-through          inherited        

    Eth1/9      cut-through          inherited        

    Eth1/10     cut-through          inherited        

    Eth1/11     cut-through          inherited        

    Eth1/12     cut-through          inherited        

    Eth1/13     cut-through          inherited        

    Eth1/14     cut-through          inherited        

    Eth1/15     cut-through          inherited        

    Eth1/16     cut-through          inherited        

     

    Global forwarding mode: cut-through