Optical packet switching (OPS) [1, 2] networks show signs of future success in optical communications with high speed and large capacity. However, OPS deployment is currently limited by packet-buffering issues resulting from the lack of optical memory devices. The buffering function is essential to resolve the competence between two or more packets in the same channel for a common route. A similar approach of electrical buffering based on the store-and-forward technique is not compatible with OPS because optical random-access memory cannot be used. Therefore, the networks face difficulty in performing buffering-based services such as contention resolution and congestion avoidance without the aid of optical memory. To reduce the contention effect on packet switching and enhance network performance, several optical buffering schemes have been proposed for OPS by queuing packets in three signal dimensions: time [3, 4], wavelength [5, 6], and code [7, 8].

For optical buffering in the time domain, fiber delay lines (FDLs) [3, 4] have the ability to execute the first-in-first-out algorithm on the packet flows entering the router. Optical packets travel the FDLs for an arranged length for a specific time until the assigned output port is available. The wavelength-domain buffering in OPS is achieved by tunable wavelength convertors [5, 6] that modulate each buffered packet with a specific wavelength signal. Multiple packets can be kept in a common device with collisions by employing the wavelength-division multiplexing (WDM) technique. Using optical codes enables network routers to create buffering scenarios known as code switching for optical packets. Code switching [7, 8] is a process executed by an optical switch that changes the original code of the input packet into a new output code. In the code-domain buffering, each payload bit in the packet is converted to a code sequence before entering a buffer. Moreover, WDM and optical codes can be combined to improve the buffering model by enlarging its capacity.

Optical buffering in the code domain has several advantages, namely, it has a shorter buffered packet stream length and does not require extra optical bandwidth compared with its counterparts in the time- and wavelength domains. However, the greatest capacity of a code-based buffer is determined by the code length and the codec scale. Although launching more available codes is a solution granting increased capacity, a large-scale codec with a higher system cost is required to generate optical codes with a large cardinality. In the author’s previous work, two-code keying [8] was chosen to encode optical packets, where payload bits “1” and “0” were respectively represented by an optical code and its complement. The performance improvement came from the increased signal-to-noise ratio of the packet signals such that more packets could be stored in the buffer for an acceptable bit-error rate.

The optical code-division multiple access (OCDMA) systems based on spectral-amplitude-coding (SAC) have had significant advancement recently. In particular, several code-construction ways aiming to generate optical codes with very low cross-correlations have been proposed to reduce the noise variance at decoders [9, 10]. Users assigned with such codes have improved bit-error rates (BERs) and high data rates. Furthermore, some algebraic methods, such as the ones based on the Pascal triangle matrix [10] and the Jordan block matrix [11], have been used to design the codes with flexible code lengths, code weights, and accommodated user numbers. These codes have more excellent suitability for the networks with various conditions than the conventional codes.

In this paper, complementary code keying (CCK) [12, 13] is introduced for capacity enhancement. Instead of simply employing typical codes, either one of typical or complementary codes can be assigned to a packet for encoding. Due to the increment of the code number in the buffering system, the scale and the number of codecs are also increased, which causes high system complexity. The optical coding technique of spectral amplitude coding (SAC) [14, 15] and the codec design based on arrayed waveguide grating (AWG) [16, 17] are employed to simplify the buffer architecture. Both processes of coding and complementary coding can be performed by a shared encoder. As the implemented codec number is reduced, the system cost can be decreased.

The buffer processing packets is approximated to a queuing model, where independent random variables with an identical distribution are used to model the inter-arrival times of the incoming packet flow. The inter-arrival times follow the exponential distribution, and therefore the number of arriving packets in the time duration from 0 to *t* can be treated as a Poisson stream characterized by the mean and variance that are both equal *λ*. The processing times for each packet performed by the buffer are also independent and identically distributed and have the memoryless property. Their density is an exponential function with the mean 1/*μ* and the variance 1/*μ*^{2}. Based on the analysis results, the capacity constraint for the proposed buffer is effectively released, and the packet dropping probability (PDP) is reduced, as the number of available codes for CCK is twice that for previous code-based buffers.

### System design

In this section, a code-domain buffer combining CCK and SAC signals is described. By converting packets into coded and complementary coded signals, the buffer capacity is increased. For the conventional memory scheme based on optical codes with amplitude-shift keying (ASK), at most *N* packets can be queued simultaneously in the same space, where *N* is the code length or code cardinality. Packet dropping occurs when the number of arriving packets exceeds the buffer capacity, as shown in Fig. 1a. If CCK is adopted, additional *N* packets can be conveyed to the complementary coded signals. Then, the buffer can store up to 2 *N* packets during the buffering procedure, as shown in Fig. 2b. Throughout this manuscript, the code sequences selected for encoding packets are known as Walsh-Hadamard codes and their complementarities [18, 19], which are respectively denoted as **H**_{k} and **H**_{k}* in Fig. 1, where 1≦*k*≦*N*. Although stored in a common channel at the same time, each encoded packet is identifiable from the multiplexed signals, as the multiple-access interference among them can be canceled by the following algorithm [19]:

$$ {\mathbf{C}}_{\boldsymbol{k}}\odot {\mathbf{H}}_{\boldsymbol{k}}-{\mathbf{C}}_{\boldsymbol{k}}\odot {\mathbf{H}}_{\boldsymbol{k}}^{\ast}=\left\{\begin{array}{c}N/2,\kern1em {\mathbf{C}}_{\boldsymbol{k}}={\mathbf{H}}_{\boldsymbol{k}},k=j\\ {}-N/2,{\mathbf{C}}_{\boldsymbol{k}}={\mathbf{H}}_{\boldsymbol{k}}^{\ast},k=j\\ {}0,\kern4.75em \mathrm{otherwise}\end{array}\right. $$

(1)

where ⊙ denotes the dot-product operator.

The other technique employed in the packet buffering in this paper is SAC, which was initially proposed in optical access networks to achieve asynchronous and simultaneous transmissions without signal interferences [14, 15]. The author introduces SAC as a possible method to cancel the interference resulting from overlapping packets in the buffer. In SAC, the code sequence assigned to each user is a binary sequence with elements {0, 1} and is encoded in the spectrum of an optical carrier. Each chip “1” in the sequence is represented by a specific wavelength signal, while each chip “0” is represented by a null wavelength. Figure 2 shows the optical signal in the time-wavelength dimension before and after the SAC encoding is performed. For Hadamard code **H**_{1} = (1100) with *N* = 4, the SAC representation consists of two wavelengths λ_{1} and λ_{3}, which map the first and the second elements of chip “1” in **H**_{1}.

An optical buffering scheme based on CCK with a capacity of 2 *K* is shown in Fig. 3. When electrical payload bits arrive at the buffer input, the buffer manager searches all available code sets that are not occupied by other buffered packets and selects one of them for packet encoding. Once the code set is determined, a link configuration in the first optical cross connect is established to forward the optical carrier generated from a broadband light source to the corresponding encoder. Two optical packets can be structured simultaneously by respectively modulating their payload bits with the typical and complementary signals of the selected code set.

The AWG properties of cyclic-shift and free spectral range are employed to generate the SAC signals of the Hadamard codes. Code sequences with a length of 4 are taken as the example in Fig. 4. Optical spectra consisting of eight wavelengths, λ_{1} to λ_{8}, are divided into two parts, one for generating **H**_{1} and the other for **H**_{1}*. The wavelength distribution of **H**_{1} = (1100) is (λ_{1}λ_{2}00), and that of **H**_{1}* = (0011) is (00λ_{7}λ_{8}). The reason that **H**_{1} and **H**_{1}* are encoded in different optical bands is that the decoder is unable to identify the buffered packets if these two codes are mixed in the same channel. Therefore, the number of usable codes is increased at the expense of the increased signal bandwidth. Based on the encoder design, the proposed system is cost-effective because it is capable of generating a large number of coded signals by using a relatively small number of codecs. Generally, for a code-domain buffer with capacity *K*, at least *K* pairs of codecs should be implemented, with each of them generating/detecting a specific code **H**_{k}, where 1≦*k*≦*K*. In CCK, the maximum number of coded packets in the buffer increases from *K* to 2 *K*. If a general coding structure is used, up to 2 *K* pairs of codecs are required. In the proposed encoder based on the AWG, the signals of both **H**_{k} and **H**_{k}* can be simultaneously created; thus, the implemented codec number is reduced from 2 *K* to *K*, which decreases the system cost.

Except for spectral-amplitude-coding (SAC), one of the most common coding methods in optical networks is time spreading (TS) [20, 21]. In an optical coding scheme based on TS, a bit signal with duration *T*_{b} is divided into *N* chips with duration *T*_{c} = *T*_{b}/*N*, where *N* is the code length. As *T*_{c} < *T*_{b}/*N* for general TS cases, the decoder must have the ability to detect the short pulses, which requires high-speed components and induces an increased receiver bandwidth. For a given *T*_{c}, using a long-length code extends the bit duration, causing a lower throughput. Furthermore, due to the time-domain coding, strict chip synchronization between the encoder and decoder is required. On the other hand, codes are encoded on the optical spectrum in SAC, so *T*_{c} is constantly the same as *T*_{b} and does not increase with the code length. Therefore, for a SAC codec, one could release its requirement of the processing speed so that the system complexity is effectively reduced.

### System modeling

In this section, the author models the processes of code-domain buffering as a queuing system, which was employed to model the code-domain packet switches in previous research [20, 21]. The buffer, incoming packet sequence, and optical buffering are considered as the service center, population of customers, and provided service, respectively. The arrival times between packets are a collection of independent and identically distributed random variables of exponential distribution with mean *λ*. The service time, including the processing delay of the decoding, remodulation, switching, and encoding in the buffer, is also exponentially distributed with mean *μ*. The arbitrariness of service times comes from the variable lengths of packets. For the server number, despite multiple decoders in the buffer, only the one matching the code carried by the incoming packet has an output signal to activate the optical modulator. Then, the optical carrier is converted to an optical code by the corresponding encoder. Over a small time interval, only one encoder is operated, which implies a single-server scenario. The service discipline of first-in-first-out is assumed, as the buffer processes the incoming packets in order. Based on the above assumptions, the buffering scenario can be described as the Kendall notation of the M/M/1/*K* model [22], where *K* is the code number assigned to a buffer.

The properties of the M/M/1/*K* model are birth–death processes, where only one or none of the events occurs at a time. The events can be a packet arriving at the buffer input or a coded packet leaving from the output. From [22], the steady-state probabilities of *k* packets in the buffer *P*(*k*) are given by:

$$ P(k)=\left\{\begin{array}{c}\frac{\rho^k\left(1-\rho \right)}{1-{\rho}^{K+1}},\rho \ne 1\\ {}\frac{1}{K+1},\kern2em \rho =1\end{array}\right. $$

(2)

where *ρ* is the utilization ratio, defined as *λ*/*μ*. The author employs steady-state probabilities as a performance measure of the buffering efficiency. When a new packet gets to the buffer input, several coded packets already exist. One of the codes unused by the queued packets is selected for queuing the received one. If all codes have been distributed, the system fails to perform code conversion, and the packet is abandoned. In this case, the buffer capacity is full, and no available code can be used for buffering. The PDP is defined as the probability that *K* packets are stored in the buffer, which is given by *P*(*K*).

In the CCK scenario, the buffer first reads the code information, and if all Hadamard codes are completely used, the arriving packets are transferred to the encoders that create the complementary signals. If both types of codes are fully assigned to packets, packet dropping is inevitable because the buffer space is not available. Given the same assumptions of the previous modeling method, the only difference in CCK is that when an encoder is activated, it is capable of processing two classes of packets at the same time. This scheme enhances the buffering performance, as the buffer has increased the capacity from *K* to 2 *K*. Therefore, it is reasonable to treat the buffer as the M/M/2/2 *K* model [22]. However, as the bandwidth of CCK packets is half that of the ASK packets, the supporting signal rate is also halved. The utilization ratio is increased to 2*ρ* because for the same amount of payload bits, the duration of CCK packets is twice that of ASK. The steady-state probability of *k* packets occupied in the buffer is given by:

$$ {P}^{\ast }(k)=2{\rho}^k{P}^{\ast }(0) $$

(3)

where *P**(0) is given as:

$$ {P}^{\ast }(0)={\left[1+2\rho \left(1+\frac{1-{\rho}^{2K-1}}{1-\rho}\right)\right]}^{-1} $$

(4)

Similarly, as at most 2 *K* packets can be stored in the buffer, the PDP for CCK is given by *P**(2 *K*).

Except for the PDP, the author uses the mean number in a steady-state queue as another performance measure to more sufficiently describe the merits of the proposed buffer scheme. *Q* and *Q**, respectively representing the average numbers of packets waiting in the queue before entering the ASK and CCK buffers, are given as [22]:

$$ Q=\left\{\begin{array}{c}\frac{\rho \left[K{\rho}^{K+1}-\left(K+1\right){\rho}^K+1\right]}{\left(1-{\rho}^{K+1}\right)\left(1-\rho \right)}-\left[1-P(0)\right],\rho \ne 1\\ {}\frac{K}{2}-\left[1-P(0)\right],\kern9.5em \rho =1\end{array}\right. $$

(5)

$$ {Q}^{\ast }=\frac{2{\rho}^3}{{\left(1-\rho \right)}^2}\left\{{\rho}^{2K-2}\left[2\left(\rho -1\right)\left(K-1\right)-1\right]+1\right\}{P}^{\ast }(0),\rho \ne 1 $$

(6)

At the end of the buffering process, multiple coded packets are multiplexed and then sent to the common buffer output, as shown in Fig. 3 in the manuscript. The signal quality degrades when the photo-detectors in the decoder perform the optical-to-electrical conversion on the coded packets. Due to the presented noise sources such as phase-intensity induced noise (PIIN) and thermal noise, the decoded photo-current may not correctly reflect the power variations of the original optical signal. Such errors are described by a parameter known as code-error probability, which is expressed as follows [14]:

$$ {P}_{\mathrm{C}}(K)=\frac{1}{2}\mathit{\operatorname{erfc}}\left\{\frac{I}{2\sqrt{\left[{\sigma}_{\mathrm{PIIN}}^2(K)+{\sigma}_{\mathrm{TH}}^2\right]}}\right\} $$

(7)

where *I* is the photo-current at the decoder’s output, \( {\sigma}_{\mathrm{PIIN}}^2(i) \) is the variance of PIIN, and \( {\sigma}_{\mathrm{TH}}^2 \) is the variance of thermal noise. The terms of current and noises are respectively expressed as follows:

$$ I=\left\{\begin{array}{c} RP/2,\mathrm{for}\ \mathrm{ASK}\\ {} RP/4,\mathrm{for}\ \mathrm{CCK}\end{array}\right. $$

(8)

$$ {\sigma}_{\mathrm{PIIN}}^2(K)=\left\{\begin{array}{c}{R}^2{P}^2 BK\left(K+1\right)/4,\kern4.5em \mathrm{for}\ \mathrm{ASK}\\ {}{R}^2{P}^2B\left\lfloor K/2\right\rfloor \left(\left\lfloor K/2\right\rfloor +1\right)/8,\mathrm{for}\ \mathrm{CCK}\end{array}\right. $$

(9)

$$ {\sigma}_{\mathrm{TH}}^2={BS}_{\mathrm{TH}} $$

(10)

, where *P* is the received optical power, *B* is the electrical bandwidth of the receiver, *v* is the bandwidth of the light source, *R* is the responsiveness of the photo-detector, and *S*_{TH} is the power spectral density (PSD) of the thermal noise. The symbol of ⌊·⌋ denotes the floor function. For ASK, the encoding is executed on the entire optical bandwidth, while for CCK, the bandwidth is equally divided into two channels, one for the typical encoding and the other for the complementary coding. Two different coding methods result in different mathematical expressions in photo-current and noise sources.