Well, as we just mentioned, we might still have a problem where we have an edge with a single circuit.
Usually this is going to be an internet circuit, and if we only have that available, this could be in some remote
part of the world, some remote part of the country, or it could just be that we've got a lot of these out there.
For example, Cisco has used the example that this could be, you know, an ATM.
Banks tend to have dozens, if not hundreds, or thousands of ATMs,
and we're probably pulling as cheap of internet circuits as we can to that many different locations.
And so whatever the host is on the other side of this,
we recognize that sending traffic out across a low-quality internet link could have the potential for a lot of loss.
In the last video, we saw that with packet duplication, if I had a second circuit,
I could send another copy out, and hopefully at least one of those made it to the other side.
But now we only have a single circuit, so what can we do about this?
Well, what we can do is we can bake into this
concept here a packet that will allow us to perform some amount of error correction.
And so this is going to be known as forward error correction, and the idea here is that we're going to be proactively including
extra information that will help us to perform data recovery.
So what exactly is this all about? Well, first of all, let's talk very briefly about
the concept of parity. So we're going to use parity, which is a mathematical operation that we're going to use in order to
help us recover our data. And this comes from the world of storage.
If you've ever built a server, or maybe even just like a gaming PC, or a really nice computer, you might have
bundled multiple disks together using what's known as RAID. What we do is we have, let's say, three different hard drives like this
on our machine, and we're storing data on all of them.
But what happens if one of these disks were to go down?
Do we lose all of the data that was stored on there?
Well, with RAID, we can make it so that that data is actually able to be recovered. So I install a new
hard drive here. I replace this one that died. And now, because of the data that's stored on these two,
I can actually recover all of the information that was otherwise lost, which sounds a little bit magical. But here's how this works.
We can use the XOR operation in order to do something really fancy.
Basically, what I can do here is I can take a bunch of bits, like one, two, in our case three bits here, and I can
XOR these all together, and I can get a result. And this result
is actually known as a parity, a parity bit. So whatever this, you know, these numbers are over here,
whatever these bits are, 1, 0, and 1, we're going to create a parity bit that then, let's say we lose one of these.
Let's do this in a different color to be clear. If we lose one of these, I can take these other two bits,
so the 1 and the 0, and
I can XOR these together, and
I can get the original value that we lost. We lost a 1. And
so this is how I can perform a math operation, a very basic binary math operation, in order to recover lost data
thanks to this parity bit.
So that's great for the storage world, but how does that apply here to this situation where I have a bunch of loss on my
link? Well, what I want to do is, again, the concept of forward error correction is
that I'm going to be proactive, and
I'm just going to include parity. So I'm going to proactively include
parity inside of my transmissions.
This means two things. First of all, I'm increasing the amount of data that I'm sending, so that's kind of bad news from a
bandwidth perspective. If I need to send 10 megabits across the link,
then I'm actually going to have to send more than that, like 12 and a half megabits. So the data increases,
which is not ideal. But I now have made it so my data is
recoverable. I can get it back if a packet drops because I have that parity bit concept.
So what SD-WAN does now is
it takes four different
packets.
So these are four individual packets that are about to be transmitted, and
it uses these via that XOR operation to create a parity packet.
So now we're not just talking about a bit,
we're talking about an entire packet that I've created. And so now instead of sending four packets across
the WAN, I'm actually sending five packets across the wide area network.
So again, my data went up a little bit, but here's the good news.
Now, if it goes across that lossy internet link, so we've got this lossy internet. Again,
it's our only circuit at this remote site, whatever the situation is, and I only get four packets on the other side.
Well, what I can do is I can do exactly what we just drew out over here.
I can take the parity packet along with the three other packets, and I can now XOR them
and I can recover the original packet.
So let's say packets 1, 2, 3, and 4, and I lost packet 4.
Well, now I can recover packet 4 if I have packets 1, 2, 3, and the parity packet.
So that makes it so I don't have to retransmit that packet. The router is simply able to create packet number 4
because I sent that parity packet.
The beautiful thing about parity is that, yeah,
I could actually just send two copies of every one of these packets, and that way if I lose one that I'm,
you know, that I can recover it. I could do it that way.
But notice that that would require four different copies to be sent, and that would increase my data usage by a hundred percent,
not by 25 percent or what-have-you. And so we don't want to do it that way.
This parity packet can actually be used to recover any of the blocks of data.
Now, a quick note on the configuration for FEC.
Or, I don't know, I call it FEC for error correction.
So we can activate it in one of two ways.
We can configure it to be statically enabled, and if it's statically enabled, it's just always on.
That means that every single time I'm about to send four packets,
I will also send a parity packet along with it. Or I can configure it to be dynamic
because it does come at a cost. It comes at a cost of increasing the data utilization on that link,
which might actually lead to more loss because now I'm creating congestion where before there wasn't any congestion.
But I can dynamically enable it by telling my SD-WAN environment to detect when there's a 2% loss on the link.
Because of BFD running, I can track that and I can see that, hey, we are actually experiencing,
let's say now, greater than 2% loss. At that point,
we will enable forward error correction and we will hope that that brings down the loss on our connection.
So a key takeaway here is recognizing that we have just discussed two different technologies that both aim to
help us out with this loss concept, the first of which was
duplication, which as we said, if I have a second circuit, then I could leverage duplication.
But again, it does require me to have two circuits. When I only have one circuit,
I can enable forward error correction and that will help me deal with loss on a single link.
Could I use forward error correction if I have two links? Sure, I absolutely could.
But we might want to consider using duplication at that point.
It might be a little bit more efficient or for that matter, maybe we disable duplication and enable forward error correction.
It's going to depend on our environment.
It's going to depend on our data and we might just need to do some testing to see which one creates the best end-user experience.