Cut-Through Switching¶
Goals¶
Cut-through switching is a method used in packet switching systems, such as Ethernet switches, to forward frames or packets through the network. It involves starting the forwarding process before the entire frame has been received, typically as soon as the destination address and outgoing interface are determined. This is in contrast to store-and-forward switching, which waits until the entire frame has been received before forwarding it. One advantage of cut-through switching is that it may reduce the switching delay of Ethernet frames, since the switch can begin forwarding the frame as soon as it has enough information to do so. However, cut-through switching also has some potential disadvantages, such as a higher error rate compared to store-and-forward switching, since it does not check the entire frame for errors before forwarding it. In this showcase, we will demonstrate cut-through switching and compare it to store-and-forward switching in terms of delay.
4.3
The Model¶
Cut-through switching reduces switching delay, but skips the FCS check in the switch. The FCS is at the end of the Ethernet frame; the FCS check is performed in destination host. (This is because by the time the FCS check could happen, the frame is almost completely transmitted, so it makes no sense). The delay reduction is more substantial if the packet goes through multiple switches (as one packet transmission duration can be saved at each switch).
Cut-through switching makes use of intra-node packet streaming in INET’s modular Ethernet model. Packet streaming is required because the frame needs to be processed as a stream (as opposed to as a whole packet) in order for the switch to be able to start forwarding it before the whole packet is received.
Note
The default is store-and-forward behavior in hosts such as StandardHost.
The example simulation contains two TsnDevice nodes connected by two TsnSwitch’ nodes (all connections are 1 Gbps):
In the simulation, device1
sends 1000-Byte UDP packets to device2
, with a mean arrival time of 100ms,
and X ms jitter. There are two configurations in omnetpp.ini, StoreAndForward
and CutthroughSwitching
,
which only differ in the use of cut-through switching.
Here are the two configurations:
The default EthernetInterface in Ethernet switches doesn’t support cut-through. In order to use
cut-through, we replace the default interface with EthernetCutthroughInterface. Cut-through is
disabled in this interface by default, thus it needs to be enabled by setting the enableCutthrough
parameter to true
.
In addition, all necessary components in the switch need to support packet streaming. The cut-through interface in the switches supports packet streaming by default; the default PHY layer in hosts need to be replaced with EthernetStreamingPhyLayer, which support packet streaming.
Results¶
The following video shows the store-and-forward behavior in Qtenv:
The next video shows the cut-through behavior:
The following sequence chart excerpt shows a packet sent from device1
to device2
via the switches,
for store-and-forward and cut-through, respectively (the timeline is linear):
We compared the end-to-end delay of the UDP packets in the case of store-and-forward switching vs cut-through switching:
We can verify that result analytically. In case of store-and-forward, the end-to-end duration
is 3 * (transmission time + propagation time)
, around 25.296 ms. In the case of cut-through,
the duration is 1 * transmission time + 3 propagation time + 2 * cut-through delay
, around 8.432 ms.
Sources: omnetpp.ini
, CutthroughSwitchingShowcase.ned
Try It Yourself¶
If you already have INET and OMNeT++ installed, start the IDE by typing
omnetpp
, import the INET project into the IDE, then navigate to the
inet/showcases/tsn/cutthroughswitching
folder in the Project Explorer. There, you can view
and edit the showcase files, run simulations, and analyze results.
Otherwise, there is an easy way to install INET and OMNeT++ using opp_env, and run the simulation interactively.
Ensure that opp_env
is installed on your system, then execute:
$ opp_env run inet-4.3 --init -w inet-workspace --install --chdir \
-c 'cd inet-4.3.*/showcases/tsn/cutthroughswitching && inet'
This command creates an inet-workspace
directory, installs the appropriate
versions of INET and OMNeT++ within it, and launches the inet
command in the
showcase directory for interactive simulation.
Alternatively, for a more hands-on experience, you can first set up the workspace and then open an interactive shell:
$ opp_env install --init -w inet-workspace inet-4.3
$ cd inet-workspace
$ opp_env shell
Inside the shell, start the IDE by typing omnetpp
, import the INET project,
then start exploring.