Friday, June 17, 2016

FEC...Forward Error Correction


FEC (Forward Error Correction)

What is FEC, how does it works, where it is used and why ?
If you have these questions you are on right place !! 
So lets clear all your questions step by step... 

To learn about FEC we first need to learn about 64b/66b encoding.


What does 64b/66b encoding means ?

As name suggests it coverts 64 bits stream into 66 bits by adding 2 bit of preamble.
These preamble bits can be 10 or 01 in binary.

  • If the preamble is 01, the next 64 bits are all data
  • If the preamble is 10, the next 8 bits will be field type followed by 56 bits of control info and/or data
To understand this better below is a table chart for the same.


As you can see sync (Preamble) 01 is followed by all data while 10 has 8 bit of field followed by data/control.

So lets say you are sending idle packets (all zeroes) of 64bit then 64b/66b encoding will convert this bit stream something like below:
"10"
1e
00 00 00 00 00 00 00
"10"
  "10" 1e 00 00 00 00 00 00 00 "10"

I hope you have basic understanding of 64b/66b encoding now so lets move to FEC now which is our main intention to learn.

What is FEC ?

Forward Error Correction, as name suggests it controls the errors in streaming of data. Currently we are surrounded with digital signals like Mobile network, Internet, Cloud, Camera stream (Surveillance), WiFi, FM channels, GPS signals etc and all are having a data stream which is eventually passed to the servers one over the other. Currently we have so much of data to pass we can not survive with 10Gbps, 25Gbps or 40 Gbps network. We need 100 Gbps or more bandwidth to transfer these data reliably.
As you are aware, faster the speed more noise will introduce and more noise mean more errors will be generated. To overcome these data stream errors FEC comes to the picture. Of course there are limitations in correcting numbers of errors in a single packet but will talk about it later.

Types of FEC

There are 2 main categories of FEC codes

  1. Block codes: It works on fixed size blocks (packets) of bits or symbols. Examples is Reed-Solomon coding. which can be use on Hard Disk drives, CD/DVD roms etc.
  2. Convolutional codes: It works on bit or symbol of arbitrary length. few examples are Golay, Hamming codes, which can be used to NAND flash ECC.
Today we will talk about 100G RS-FEC (Reed Solomon FEC)
Below is a image which shows the relationship of RS-FEC sublayer to the ISO Open System Interconnection (OSI) model:



So FEC interface is provided to allow the PCS to transfer information to and from the RS-FEC.
The RS-FEC operates on 20 parallel bit streams. The PCS or PMA continuously sends 20 bit streams to RS-FEC one per lane each at speed of 5.15625 GBd. this 20 steam together makes 100 GB (5.15625 x 20) = 103.125 GBd

Let's take an example of system where we are using FEC.
Below is a block diagram of system, where we are using 100G FEC (25G x 4 channel).



Here, you can see that ch0 to ch 3 have 100G ethernet traffic so each channel is operating at 25G rate. These channels are nothing but a serdes. (I have a separate blog for serdes which will get publish soon)
This 100G ethernet traffic is now goes into FEC block specifically FEC encoder which will encode data with Reed Solomon codes with 64b/66b encoding and pass it to ch 8 to ch 11 and output of these ch 8 - ch 11 is FEC encoded 100G ethernet data.
Now the reverse path, ch8 - ch11 which must receive FEC encoded 100GE traffic will goes to FEC block specifically FEC decoder where it gets decoded (reverse method of encoding) and pass it to ch 0 to 3.

Now you must have a question like why you need FEC encoding if it does encoding and decoding both.
But let me give you an example, when you send 100GB/sec continuous data from US to India or visa versa over the network there are chances that you data will get some errors due to noise or any distortion. If this data is in raw format with just CRC check you will get an error (CRC fail/mismatch) at other end so ideally you need to send that 100GB data again which will cost a lot.
So if it has FEC encoded data then FEC decoder can correct few bits off errors (as per capability of FEC) automatically and you do not need to resend that packets which will save time and money both.

Below images are example of diff noise types in data stream.
1. White noise:


2. Impulse noise:


So to correlate our block diagram with this example, ch 8- 11 are in US which is connected to other system in India with same ch 8- 11 so whatever you are sending out from ch 8-11 are FEC encoded data which will go over the network from US <-> India.
I know I'm being loudmouth so lets move to next topic.

Let's see what is a flow when we do FEC encoding but before that let me tell you one thing. we have 2 different coding NRZ and PAM (PAM2 or PAM4) which you can read in my separate blog "http://workineinfo.blogspot.com/2016/06/nrz-vs-pam.html"

Below is a NRZ FEC encoding architecture:
Typically we use FEC528 (Reed Solomon code (528,514)  ) on NRZ side.



As I have mentioned earlier we get 100G ethernet traffic divided in 20 PCS lanes which will get FEC encoded in 4 lanes (each with 25G)

PAM4 FEC encoding:
We use FEC444 or FEC544 for PAM4 FEC, below is architecture of it.



How does FEC frame looks like ?

Below is a image of NRZ FEC frame in 256B/257B transcoding.



Below is a image of PAM4 FEC frame in 256/257B transcoding.





Hope you have some idea on FEC now, will create a new blog for in-depth understanding of FEC and algorithm for Reed Solomon.

Thanks.



No comments:

Post a Comment