A device for interleaving data blocks for an optical communications system between a satellite and an earth station, the interleaving device configured to receive as input data frames, each of the data frames comprising a plurality of ordered data blocks, and the interleaving device is configured to provide as output interleaved data blocks,
- said interleaving device comprising a control module, an external memory configured to store the interleaved data blocks and a cache memory comprising a plurality of buffer areas, each of the buffer areas have a size at least equal to a size of one of the data frames,
- the control module is configured to:
- write each new data frames received in an available one of the buffer areas,
- form groups of the interleaved data blocks from different ones of the data blocks belonging to different ones of the data frames stored in different buffer areas,
- write each of the groups of the interleaved blocks in a sequential area of the external memory,
- wherein each of the buffer areas is available if and only if the buffer area does not contain any of the data blocks that has not yet been used to form one of the groups of the interleaved blocks to be written in the external memory.