From 698cf74f3a3f2a9a0fb1103e4f3e516fbbddd328 Mon Sep 17 00:00:00 2001 From: Thomas Kolb Date: Sun, 28 Apr 2024 14:01:47 +0200 Subject: [PATCH] doc: document data whitening procedure --- doc/hamnet70.adoc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/doc/hamnet70.adoc b/doc/hamnet70.adoc index 69b6f66..b982960 100644 --- a/doc/hamnet70.adoc +++ b/doc/hamnet70.adoc @@ -73,7 +73,19 @@ The following table lists all supported combinations of modulation and forward e | _reserved_ |=== -==== Data modulation +==== Data Whitening + +The IP packets transferred by Hamnet70 may contain long sequences of identical bytes (think of the zeros in the middle of IPv6 addresses), which make it hard to keep the system synchronized. To prevent the transmission of many identical symbols in a row, the data is whitened using a pseudo-random sequence. + +Here, a 9-bit linear feedback shift register (LFSR) according to the CCITT specification is used to generate the pseudo-random sequence. The generator polynomial is stem:[x^9 + x^5 + 1]. The data is whitened by XORing data bytes with the _whitening key_ generated from the LFSR. + +The whitening key is generated by taking the LSB of the LFSR state, and shifting it into an 8-bit register from the right. Then the LFSR is advanced and the process is repeated. Every 8 repetitions the contents of the 8-bit register are XORed with a data byte to calculate the whitened data. + +To remove the whitening, the same procedure is applied to the whitened data at the receiver side. XORing with the same sequence results in the original data. + +Whitening is only applied to the layer 2 packet data, but not the PHY header. + +==== Data Modulation The first data symbol follows directly after the last symbol of the PHY header. The data is encoded and modulated using the scheme defined in the PHY header’s MODCOD field. The number of symbols resulting from the encoding and modulation process is stored in the PHY header as well.