SD-WAN improves the performance and reliability of IP networks, and one of the techniques it employs is Forward Error Correction (FEC). This blog post explains how FEC works and describes how leading SD-WAN platforms utilize it to mitigate packet loss.
We begin with a reminder: packet delivery on IP networks is best effort, not guaranteed. This was a deliberate design choice by the inventors of TCP/IP to minimize router cost and maximize efficiency; if an IP network experiences congestion and router buffers fill up, packets may be dropped, and impacted applications must respond appropriately.
Dealing with Packet Loss
One way that applications deal with packet loss is by implementing a bidirectional protocol between senders and receivers wherein packets are marked with sequence numbers by the sender (i.e., “packet 1,” “packet 2,” “packet 3,” …). This makes it easy for a receiver to identify which packets failed to arrive, and it can send messages back to the sender requesting those packets be resent. The Transport Control Protocol (TCP) portion of TCP/IP is a general-purpose implementation of this scheme, and it works well for many applications, including mainstays like World Wide Web (HTTP) and Email (SMTP).
Unfortunately, there are some applications for which this approach doesn’t work, notably real-time voice and video. For these applications, delivery is time-sensitive; there is no opportunity to resend. When voice or video packets are lost, the results are garbled speech and pixelated video. Can anything be done to mitigate this? Is there some scheme by which a receiver could recover a lost packet in a timely fashion, without waiting for the sender to resend it? The answer is yes, and that scheme is FEC.
How FEC Works
FEC is not a new concept. In fact, its origins go back more than seventy years to the early days of digital communications, where it was developed to detect, and correct bit errors caused by noisy communications channels such as analog telephone lines. It accomplished this by inserting additional error-correcting bits into the data stream, and provided certain conditions were met, receivers could use these additional bits to detect and correct bit errors in the data.
FEC applied to IP networking uses a similar approach: senders generate and send special error-correcting packets along with the regular data packets, and provided certain conditions are met, these additional packets enable receivers to regenerate lost data packets without retransmission. This sounds complicated, but it’s surprisingly easy to implement.
FEC in SD-WAN
One leading SD-WAN platform generates one error-correcting packet for every four consecutive data packets by default. The contents of this error-correcting packet are the bitwise exclusive OR (XOR) across the associated data packets. This implements an even parity scheme, and the error-correcting packet is sometimes referred to as a parity packet. Depending upon network availability and conditions, the parity packet might be sent using the same underlay network as its associated data packets, or it might be sent using a different underlay network. As with TCP, the data packets are marked with sequence numbers to make it easy to detect missing packets.
On the receiving end, the SD-WAN platform examines the sequence numbers of the arriving data packets to determine if any are missing. If all of them were delivered, the corresponding parity packet is silently discarded, and the data packets are delivered to the LAN. But if one of the data packets is missing, it is quickly regenerated by performing the same bitwise XOR operation used by the sender, this time across the remaining three data packets plus the parity packet.
This parity scheme can recover one lost packet in an associated group of data packets; if two or more packets in the group are missing, they cannot be recovered this way. For this reason, the ratio of data packets to parity packets must be small enough so that multiple missing packets in a group is unlikely. At the same time, it should be large enough to minimize the bandwidth overhead of the parity packets. Leading SD-WAN platforms adjust this ratio dynamically based on measured packet loss of their underlay networks. This adaptive approach allows SD-WAN to strike an optimal balance between effective error correction and bandwidth overhead.
FEC is a great example of SD-WAN improving the performance of IP networks by applying application-layer intelligence to IP routing. During packet loss conditions in its underlay network(s), FEC is automatically invoked, and the effective rate of packet loss experienced by applications is significantly reduced. This translates into better audio and video quality and improved application throughput.
Acerca de GTT
GTT connects people across organizations, around the world, and to every application in the cloud. Our clients benefit from an outstanding service experience built on our core values of simplicity, speed, and agility. GTT owns and operates a global Tier 1 internet network and provides a comprehensive suite of cloud networking services. We also offer a complementary portfolio of managed services, including managed SD-WAN from leading technology vendors.