## 2 Procedures for Constructing a Composite Maximal-Length Sequence (CMLS) and the Codec Design  
In this paper, packet buffering in GMPLS is achieved by encoding each queued packet with a CMLS code composed of two extended maximal-length sequences (MLSs). A family of MLS codes includes \(K^{\text{M}}\) code-words, where \(K^{\text{M}}\) is called code cardinality. Each code-word has \(N^{\text{M}}\) binary elements of {0, 1}, where \(N^{\text{M}}=2^{m}-1\) is known as the MLS length and \(m\) is a positive integer larger than 1. A general way to describe the characteristics of a family of codes is to employ the expression of \((N^{\text{M}},\omega^{\text{M}},\)\(\theta^{\text{M}})\), where \(\omega^{\text{M}}\) and \(\theta^{\text{M}}\) denote the auto- and cross-correlation of MLS codes. \(\omega^{\text{M}}\) is also known as the code weight, or the number of chips \"1\" in a MLS code-word, while \(\theta^{\text{M}}\) is defined as the number of the overlapping chips \"1\" between any two different code-words in a family of MLS codes. The correlation properties between two MLSs in a code set are \(\omega=(N^{\text{M}}+1)/2\) and \(\theta=(N^{\text{M}}+1)/4\). Moreover, MLSs have a periodical-shift property, where an MLS belongs to the original code set after cyclically shifting any number of chips. The construction of a CMLS can be performed in three steps. First, select two MLS codes, \(M_{i}\) (\(N_{1}^{\text{M}}\)) and \(M_{j}\) (\(N_{2}^{\text{M}}\)), with the code length of \(N_{1}^{\text{M}}\) and \(N_{2}^{\text{M}}\), respectively, where \(1\leq i\leq N_{1}^{\text{M}}\) and \(1\leq j\leq N_{2}^{\text{M}}\); second, extend both \(M_{i}\) (\(N_{1}^{\text{M}}\)) and \(M_{j}\) (\(N_{2}^{\text{M}}\)) to the vectors with the length of the lowest common multiple of \(N_{1}^{\text{M}}\) and \(N_{2}^{\text{M}}\) by repeating them multiple times; finally, add these two extended code-words via the module-2 summation. Based on the above steps, the structuring of the CMLS code set of length \(N=N_{1}^{\text{M}}N_{2}^{\text{M}}\) can be summarized as follows:  
\[C_{(i,j)}\Big{(}N_{1}^{\text{M}}N_{2}^{\text{M}}\Big{)}=\widehat{\left[M_{i} \Big{(}N_{1}^{\text{M}}\Big{)}M_{i}\Big{(}N_{1}^{\text{M}}\Big{)}\dots M_{i} \Big{(}N_{1}^{\text{M}}\Big{)}\right]}\oplus\widehat{\left[M_{j}\Big{(}N_{2} ^{\text{M}}\Big{)}M_{j}\Big{(}N_{2}^{\text{M}}\Big{)}\dots M_{j}\Big{(}N_{2}^ {\text{M}}\Big{)}\right]} \tag{1}\]  
where \(\oplus\) denotes the operation of module-2 summation. Based on (1), one can find a CMLS set made of \(M_{i}\) (\(N_{1}^{\text{M}}\)) and \(M_{j}\) (\(N_{2}^{\text{M}}\)) that has \(N\) code-words in it. Figure 1 shows the construction of \(C_{(1,1)}(21)\) with \(N\) = 21 based on \(M_{1}\) (3) = [110] and \(M_{1}\) (7) = [1110010]. The correlation property between any two code-words in a common family of CMLS codes is an important index for describing the code characteristics. The correlation values among CMLS codes with \(N\) are expressed as:  
\[ \begin{array}{ll}\theta_{(i,j,k,l)}&=C_{(i,j)}(N)\odot C_{(k,l)}(N)\\ &=\left\{\begin{array}{ll}(N-1)/2,\ i=k,\ j=l\\ \left(N-N_{1}^{\text{M}}-2\right)/4,\ \left(N-N_{2}^{\text{M}}-2\right)/4,\ \left(N-1\right)/4,\ i\
eq k,\ j\
eq l \end{array}\right.\end{array}  \tag{2}\]  
where \(\odot\) denotes the dot-product operation. Based on (2), the autocorrelation for a CMLS code-word is fixed, while the cross-correlations between any two different CMLS code-words may vary, where the values are limited to three levels. As a CMLS is made from MLSs, both types of sequences have several similar characteristics, such as the mathematical expression of code weight or autocorrelation, and the cyclic-shift property. The latter indicates that when a CMLS \(C_{(i,j)}(N)\) is known, all sequences in the code set can be found in \(\text{T}^{m}[C_{(i,j)}(N)]\), where \(\text{T}^{m}[\ ]\) denotes an operator that cyclically shifts a CMLS for \(m\) elements in right direction, where \(0\leq m\leq N-1\).