Two-Code Keying and Code Conversion for Optical Bu ﬀ er Design in Optical Packet Switching Networks

: Bu ﬀ ering management is a crucial function in current optical packet switching (OPS) networks. To avoid packet blocking due to competition for the same switched path, optical bu ﬀ ering is required to queue packets after a router makes the forwarding decision. In this paper, the author proposed a bu ﬀ ering scheme based on optical code-division multiple access (OCDMA), where each packet is encoded with an optical signature code. An optical coding technique combining spectral-amplitude coding (SAC) and two-code keying (TCK) is introduced to advance the bu ﬀ ering performance regarding packet loss probability. In TCK, the payload bits “1” and “0” of a stored packet are respectively converted to a SAC signal and its complementarity. As the Hamming distance between the coding signals of bits “1” and “0” is extended, the existing drawback that the OCDMA-based bu ﬀ er capacity is limited by the decoder noise increased with the number of queued SAC packets is resolved. Moreover, an encoder consisting of a ﬁber Bragg grating (FBG) array is applied for simplifying the system design. A SAC signal and its complementary counterpart can be generated simultaneously without the need of an extra encoder.


Introduction
Optical packet switching (OPS) is a primary technique to realize all-optical networks with sufficient data capacity [1][2][3]. However, the limitation of OPS deployment exists due to packet-storage issues. Two or more packets face a contention when a router in the network tries to forward them to the same output port. Contention resolution and packet buffering should be performed while the packets are being routed. Electrical buffering schemes, such as random access memory (RAM), have yet to be maturely implemented in the optical domain [4,5]. Optical memory is proposed to avoid signal collision and increase switching efficiency [6][7][8][9][10][11][12]. There are three primary methods: time-domain contention resolution [6][7][8], wavelength routing [9][10][11], and code conversion [12,13].
Fiber delay lines (FDLs) act as memory units with an algorithm of first-in-first-out (FIFO) in OPS networks [6][7][8]. An FDL is a section of fiber with a fixed length made up of several loops. The delay from the traveling time of passing through an FDL buffer is used to protect the packet from the congestion of others in the same time slot. Optical buffering can also be implemented in the wavelength domain [9][10][11]. A tunable wavelength converter (TWC) transforms the wavelength of the incoming packet into a new one selected from the available wavelength set. Packets with various wavelengths are kept in a shared memory device without being spread over multiple time slots.
With the emergence of optical code-division multiple access (OCDMA) in data transmissions, code conversion is launched to solve the contention problem without delaying the packets [12,13].

Optical Buffering with Two-Code Keying (TCK) and Code Conversion
In this section, we introduce the fundamental characteristics of the proposed OCDMA-based buffer and compare them with those of conventional FDL. Figure 1a shows an N × 1 FDL buffer where N input packets are competing for a common output path. The buffer arranges packets in non-overlapping time slots to avoid signal collisions. Each FDL queues a packet with a delay of nD, where D is the unit delay time, and n is a positive integer of the loop number of the FDL. To effectively schedule the packet leaving, a control unit in the buffer assigns a suitable delay to each packet according to its arrival time and length. Contention resolution is performed as all N delayed packets can be multiplexed in a single output channel without interference. In this scheme, packets cannot be stored contiguously in time as each FDL only provides a discrete delay. Interruptions between packets result in that the buffer length is longer than the length summation of the original packets. When all FDLs are occupied, new arriving packets are discarded.
The scheme in Figure 1b shows the structure of an N-input single-output optical buffer based on optical encoding that expresses each packet as an OCDMA signal. The reason for encoding packets is to avoid drops resulting from signal collisions. For optical buffering, packets P 1 , P 2 , . . . ,P N are encoded with optical codes C 1 , C 2 , . . . ,C N , respectively. In this scheme, one packet may partially overlap with another. By employing appropriate detection methods and the orthogonal property among OCDMA codes, the desired packet can be decoded from the packet stack without interference. As packets are stored in the code dimension, they are not delayed or slowed, and the only waiting time comes from the encoding processes. Therefore, the OCDMA buffer has better efficiency in terms of time utilization than FDL.  In this paper, we proposed an OCDMA-based buffer combined with TCK. By converting the packet payload into an optical code and its complement, the packet signal is more robust in the noisedominant environment. The buffer capacity is increased as more packets can be stored under a given noise level. For an OCDMA buffering scheme of on-off keying (OOK), bit "1" is presented as an optically coded signal while for a bit "0", the optical power is absent, as shown in Figure 2a. If TCK is adopted, an additional signal of complementary code is used to convey bit "0s" in the packet. During the whole packet interval, the optical power for the packet does not vary with the bit values and remains nearly constant, as shown in Figure 2b   As each buffered packet is assigned with a specific code, the orthogonal property among OCDMA signals can be employed to distinguish the desired signal from the packet stack. SAC was initially proposed in optical access networks to achieve asynchronous and simultaneous transmissions without multiple-access interference (MAI). This author introduces SAC as a possible method to cancel the interference resulting from the overlapping packets in the buffer. Several TCK systems in SAC, such as residue-stuffed QC (RSQC) codes [16] and Walsh-Hadamard codes [18] have been proposed to provide a 3-dB gain in the SNR to reduce the signal errors. Considering the buffer design of TCK of Walsh-Hadamard codes, the MAI effect can be cancelled by executing the following algorithms [18]: In this paper, we proposed an OCDMA-based buffer combined with TCK. By converting the packet payload into an optical code and its complement, the packet signal is more robust in the noise-dominant environment. The buffer capacity is increased as more packets can be stored under a given noise level. For an OCDMA buffering scheme of on-off keying (OOK), bit "1" is presented as an optically coded signal while for a bit "0", the optical power is absent, as shown in Figure 2a. If TCK is adopted, an additional signal of complementary code is used to convey bit "0s" in the packet.   In this paper, we proposed an OCDMA-based buffer combined with TCK. By converting the packet payload into an optical code and its complement, the packet signal is more robust in the noisedominant environment. The buffer capacity is increased as more packets can be stored under a given noise level. For an OCDMA buffering scheme of on-off keying (OOK), bit "1" is presented as an optically coded signal while for a bit "0", the optical power is absent, as shown in Figure 2a. If TCK is adopted, an additional signal of complementary code is used to convey bit "0s" in the packet.   As each buffered packet is assigned with a specific code, the orthogonal property among OCDMA signals can be employed to distinguish the desired signal from the packet stack. SAC was initially proposed in optical access networks to achieve asynchronous and simultaneous transmissions without multiple-access interference (MAI). This author introduces SAC as a possible method to cancel the interference resulting from the overlapping packets in the buffer. Several TCK systems in SAC, such as residue-stuffed QC (RSQC) codes [16] and Walsh-Hadamard codes [18] have been proposed to provide a 3-dB gain in the SNR to reduce the signal errors. Considering the buffer design of TCK of Walsh-Hadamard codes, the MAI effect can be cancelled by executing the following algorithms [18]: As each buffered packet is assigned with a specific code, the orthogonal property among OCDMA signals can be employed to distinguish the desired signal from the packet stack. SAC was initially proposed in optical access networks to achieve asynchronous and simultaneous transmissions without multiple-access interference (MAI). This author introduces SAC as a possible method to cancel the interference resulting from the overlapping packets in the buffer. Several TCK systems in SAC, such as residue-stuffed QC (RSQC) codes [16] and Walsh-Hadamard codes [18] have been proposed to provide a 3-dB gain in the SNR to reduce the signal errors. Considering the buffer design of TCK of Walsh-Hadamard codes, the MAI effect can be cancelled by executing the following algorithms [18]: where N is the code length and is the symbol of the dot-product. To decode the packet of C k or − C k , the receiver generates an exactly identical local code and performs the correlation function of (1) or (2), respectively.

System Configuration
A single-input single-output OCDMA buffer with capacity K consisting of parallel encoders/decoders and optical cross-connects (OXCs) is shown in Figure 3. The main idea is to express several buffered packets as the multiplexed SAC signals overlapped in the time domain. Decoders at the buffer input detect the coded and the complementary coded signals from the payload bits "1" and "0" of the incoming packet. After one of the available codes that are not occupied by other buffered packets is selected, the switch control unit (SCU) establishes a link configuration in the 1 × K OXC to forward the optical carrier generated from a broadband light source (BLS) to the corresponding encoder. Then a 1 × 2 OXC determines the output signal from a code set consisting of the typical and the complementary codes based on the values of electrical payload bits. Finally, packet buffering is achieved by performing code conversion on the incoming packet. In this figure, d i (1) and d i (0) denote the coded signals for encoding payload bit "1" and "0" from decoder i, respectively, where 1 I K.
Electronics 2019, 8, 1117 4 of 10 where N is the code length and  is the symbol of the dot-product. To decode the packet of Ck or Ck , the receiver generates an exactly identical local code and performs the correlation function of (1) or (2), respectively.

System Configuration
A single-input single-output OCDMA buffer with capacity K consisting of parallel encoders/decoders and optical cross-connects (OXCs) is shown in Figure 3. The main idea is to express several buffered packets as the multiplexed SAC signals overlapped in the time domain. Decoders at the buffer input detect the coded and the complementary coded signals from the payload bits "1" and "0" of the incoming packet. After one of the available codes that are not occupied by other buffered packets is selected, the switch control unit (SCU) establishes a link configuration in the 1 × K OXC to forward the optical carrier generated from a broadband light source (BLS) to the corresponding encoder. Then a 1 × 2 OXC determines the output signal from a code set consisting of the typical and the complementary codes based on the values of electrical payload bits. Finally, packet buffering is achieved by performing code conversion on the incoming packet. In this figure, di (1) and di (0) denote the coded signals for encoding payload bit "1" and "0" from decoder i, respectively, where The codec in Figure 4 is designated to be capable of generating and detecting Walsh-Hadamard codes. These codes can be found in the rows of Hadamard matrices, which were introduced by Jacques Hadamard in 1893 [19]. The matrix Hn has the elements of {1,−1} and the order of 1, 2, and 4n, where n is a positive integer. Two Hadamard matrices with the same order n have the property of HnHn T = nIn, where In is the identity matrix of order n. As the optical power is unipolar, the entries of Hn are modified into 1s and 0s to fit for optical coding. Given that n = 4, the relationships between Hadamard matrices and the code vectors used for TCK are given as: The codec in Figure 4 is designated to be capable of generating and detecting Walsh-Hadamard codes. These codes can be found in the rows of Hadamard matrices, which were introduced by Jacques Hadamard in 1893 [19]. The matrix H n has the elements of {1,−1} and the order of 1, 2, and 4n, where n is a positive integer. Two Hadamard matrices with the same order n have the property of H n H n T = nI n , where I n is the identity matrix of order n. As the optical power is unipolar, the entries of H n are modified into 1s and 0s to fit for optical coding. Given that n = 4, the relationships between Hadamard matrices and the code vectors used for TCK are given as: where − H n is a matrix with each element being 2's complement of H n 's elements. For a Hadamard matrix with order m = 4n, at most (m − 1) codes are available, as the receiver cannot reject the MAI resulting from the codes of all zeros and all ones.
where Hn is a matrix with each element being 2's complement of Hn's elements. For a Hadamard matrix with order m = 4n, at most (m − 1) codes are available, as the receiver cannot reject the MAI resulting from the codes of all zeros and all ones. An encoder consisting of fiber Bragg gratings (FBGs) is employed to generate SAC signals for packet buffering. Figure 5 shows the encoder structure of Hadamard code C1 = (1,0,1,0) and 1 C = (0,1,0,1). As the code chip is encoded on the spectrum, the signal wavelengths corresponding to C1 are (1,0,3,0). These two wavelengths are thrown back by the two FBGs with reflection wavelengths 1 and 3, respectively. The passed wavelengths, 2 and 4, form the wavelength assignment of (0,2,0,4), which exactly matches the chip distribution of 1 C . In SAC, the encoding process that avoids packet loss due to the collision is performed in the wavelength domain, so the patterns of optical codes cannot be observed in the time waveforms of packets, which are only determined by the payload sequences. The power spectral density (PSD) of the signal of a Hadamard code Ck with length N is composed of N / 2 wavelengths filtered from a BLS spectrum by an FBG array. The remaining wavelengths not filtered by FBGs are used to modulate the packet assigned with complimentary code Ck . Figure 5a,b shows the coded signals of Hadamard codes of C1 = (1,0,1,0) and 1 C = (0,1,0,1) in the wavelength domain, respectively. Figure 6a-c shows the time waveforms of electrical payload sequence, the optically coded packet of TCK, and the demodulated payload sequence. Note that as payload bits "1" and "0" were both encoded with SAC codes with equal power, so they had similar amplitudes, and the payload values could not be identified in Figure 6b. Furthermore, comparing Figure 6a with Figure 6c, one can find that the payload sequences had become bi-polar as the decoded results of bit "1s" and "0s" from the correlation algorithms of (1) and (2)   An encoder consisting of fiber Bragg gratings (FBGs) is employed to generate SAC signals for packet buffering. Figure 5 shows the encoder structure of Hadamard code C 1 = (1,0,1,0) and − C 1 = (0,1,0,1). As the code chip is encoded on the spectrum, the signal wavelengths corresponding to C 1 are (λ 1 ,0,λ 3 ,0). These two wavelengths are thrown back by the two FBGs with reflection wavelengths λ 1 and λ 3 , respectively. The passed wavelengths, λ 2 and λ 4 , form the wavelength assignment of (0,λ 2 ,0,λ 4 ), which exactly matches the chip distribution of  In SAC, the encoding process that avoids packet loss due to the collision is performed in the wavelength domain, so the patterns of optical codes cannot be observed in the time waveforms of packets, which are only determined by the payload sequences. The power spectral density (PSD) of the signal of a Hadamard code C k with length N is composed of N / 2 wavelengths filtered from a BLS spectrum by an FBG array. The remaining wavelengths not filtered by FBGs are used to modulate the  Figure 6a-c shows the time waveforms of electrical payload sequence, the optically coded packet of TCK, and the demodulated payload sequence. Note that as payload bits "1" and "0" were both encoded with SAC codes with equal power, so they had similar amplitudes, and the payload values could not be identified in Figure 6b. Furthermore, comparing Figure 6a with Figure 6c, one can find that the payload sequences had become bi-polar as the decoded results of bit "1s" and "0s" from the correlation algorithms of (1) and (2)

Buffering Performance Analysis
In this section, we analyze the performance of the proposed buffer system. Effects of incoherent intensity noise and thermal noise in the photo-detectors for demodulating optical packets were investigated. The Gaussian approximation was proposed for quantifying the performance index of bit-error rate (BER). The variance of photo-current comes from the occurrence of spontaneous emission when a light signal is detected, which can be expressed as In (5), the first term denotes the thermal noise and the second is the variance of phase-intensity induced noise (PIIN) [19], where STH is the PSD of thermal noise, R is the responsiveness of the photodiode, and B is the electrical-equivalent noise bandwidth. G(v) is the PSD of the stacked packets in the buffer, which can be written as where Psr is the effective power of light source at the receiver, K is the packet number in the buffer,

Buffering Performance Analysis
In this section, we analyze the performance of the proposed buffer system. Effects of incoherent intensity noise and thermal noise in the photo-detectors for demodulating optical packets were investigated. The Gaussian approximation was proposed for quantifying the performance index of bit-error rate (BER). The variance of photo-current comes from the occurrence of spontaneous emission when a light signal is detected, which can be expressed as In (5), the first term denotes the thermal noise and the second is the variance of phase-intensity induced noise (PIIN) [19], where S TH is the PSD of thermal noise, R is the responsiveness of the photodiode, and B is the electrical-equivalent noise bandwidth. G(v) is the PSD of the stacked packets in the buffer, which can be written as where P sr is the effective power of light source at the receiver, K is the packet number in the buffer, ∆v is the optical source bandwidth, and c(i) is the i-th element of Hadamard code C i . (v) denotes a unit-width rectangular function centered at 0. As the correlation properties for Hadamard codes and their complements are similar, to simplify the analysis, we assumed that the payload sequences for K packets in the buffer were all bits "1". Based on the assumptions on the light source in [19], the mathematical expression for the integral in (5) can be expressed as Then BER can be derived by using the following expression: The numerator term in (8) represents the photo-current of decoding a Hadamard-coded packet. Figure 7 shows the BER as a function of light source power P sr . The parameters used for analysis were S TH = 1.6 × 10 -22 W/Hz, R = 0.95 A/W, B = 1 GHz, and ∆v = 0.6 THz and others were the same as the ones used in Figures 5 and 6. When P sr was relatively small, the BERs for OOK and TCK were close. When P sr increased, the proposed scheme had a lower BER, due to the larger power of photo-current achieved by encoding SAC codes on both bits "1" and "0". The BER improvement for the OOK buffer was less efficient, as the increment of photo-current was not enough to get a significantly high signal-to-noise ratio (SNR). Furthermore, the comparison between the numerical analysis and simulations were shown in this figure. Instead of using the mathematical deductions, we used electrical power meters to measure the signal powers at photo-detectors to obtain the photo-current and the PIIN power for simulation. It can be observed that the BER values from these two methods had close results, which indicated the rigidity of the used scheme for performance analysis. K packets in the buffer were all bits "1". Based on the assumptions on the light source in [19], the mathematical expression for the integral in (5) can be expressed as Then BER can be derived by using the following expression: The numerator term in (8) represents the photo-current of decoding a Hadamard-coded packet. Figure 7 shows the BER as a function of light source power Psr. The parameters used for analysis were STH = 1.6 × 10 -22 W/Hz, R = 0.95 A/W, B = 1 GHz, and v = 0.6 THz and others were the same as the ones used in Figures 5 and 6. When Psr was relatively small, the BERs for OOK and TCK were close. When Psr increased, the proposed scheme had a lower BER, due to the larger power of photo-current achieved by encoding SAC codes on both bits "1" and "0". The BER improvement for the OOK buffer was less efficient, as the increment of photo-current was not enough to get a significantly high signalto-noise ratio (SNR). Furthermore, the comparison between the numerical analysis and simulations were shown in this figure. Instead of using the mathematical deductions, we used electrical power meters to measure the signal powers at photo-detectors to obtain the photo-current and the PIIN power for simulation. It can be observed that the BER values from these two methods had close results, which indicated the rigidity of the used scheme for performance analysis. The improved BER results achieved by employing TCK for optical buffering were further supported by Figure 8. Two eye diagrams were presented at the light source power Psr = −22 dBm for a single packet of TCK and OOK. It revealed that the eye height in Figure 8a was higher than that in Figure 8b, and the patterns were clearer. This indicated that the proposed buffer scheme had enhanced performances, despite the presence of noise sources. The improved BER results achieved by employing TCK for optical buffering were further supported by Figure 8. Two eye diagrams were presented at the light source power P sr = −22 dBm for a single packet of TCK and OOK. It revealed that the eye height in Figure 8a was higher than that in Figure 8b, and the patterns were clearer. This indicated that the proposed buffer scheme had enhanced performances, despite the presence of noise sources. In Figure 9, BERs of the conventional OOK and TCK buffers were analyzed under different multiplexed packet numbers. The increase of K resulted in the increase of optical power detected at photo-detectors, which induced a more considerable noise variance. As one could anticipate, TCK buffer had increased capacity at a given BER. Despite the presence of photo-current variations, the decoder had a higher probability of correctly identifying the packet payloads due to the large Hamming distance between signals "1" and "0" achieved by employing TCK.
In Figure 10, one can observe the buffer capacity versus various electrical bandwidths at BER = 10 −9 . A system with a larger bandwidth is capable of supporting higher packet rates. However, the noise power is proportional to the receiver bandwidth, so there is a tradeoff between packet rates and BER. This limitation could be partially relieved by employing the TCK buffer, which can store more packets than the OOK one, for a designated BER.  In Figure 9, BERs of the conventional OOK and TCK buffers were analyzed under different multiplexed packet numbers. The increase of K resulted in the increase of optical power detected at photo-detectors, which induced a more considerable noise variance. As one could anticipate, TCK buffer had increased capacity at a given BER. Despite the presence of photo-current variations, the decoder had a higher probability of correctly identifying the packet payloads due to the large Hamming distance between signals "1" and "0" achieved by employing TCK. In Figure 9, BERs of the conventional OOK and TCK buffers were analyzed under different multiplexed packet numbers. The increase of K resulted in the increase of optical power detected at photo-detectors, which induced a more considerable noise variance. As one could anticipate, TCK buffer had increased capacity at a given BER. Despite the presence of photo-current variations, the decoder had a higher probability of correctly identifying the packet payloads due to the large Hamming distance between signals "1" and "0" achieved by employing TCK.
In Figure 10, one can observe the buffer capacity versus various electrical bandwidths at BER = 10 −9 . A system with a larger bandwidth is capable of supporting higher packet rates. However, the noise power is proportional to the receiver bandwidth, so there is a tradeoff between packet rates and BER. This limitation could be partially relieved by employing the TCK buffer, which can store more packets than the OOK one, for a designated BER. In Figure 10, one can observe the buffer capacity versus various electrical bandwidths at BER = 10 −9 . A system with a larger bandwidth is capable of supporting higher packet rates. However, the noise power is proportional to the receiver bandwidth, so there is a tradeoff between packet rates and BER. This limitation could be partially relieved by employing the TCK buffer, which can store more packets than the OOK one, for a designated BER.

Conclusion
The application of TCK in an OCDMA-based buffer in OPS networks was investigated in this paper. The number of queued packets in the proposed buffer was increased by assigning packets with OCDMA signals and their complementary codes. The buffering performances in BER and buffer capacity were obtained by numerical analysis and simulations by considering the thermal noise and PIIN. The proposed TCK buffer could lead to a reduction of the BER as the Hamming distance between payload bits "1" and "0" is twice than that of the OOK buffer, which obtains a larger SNR. Moreover, the author found a cost-effective encoder based on FBGs that simultaneously generates an OCDMA signal and its complementary counterpart. For future works, the authors aim to adopt channel coding in OPS as a solution to resolve packet contention, prevent packet loss, as well as enhance network security [20]. Except for simply considering the capacity, investigating other physical constraints in OPS such as survivability, secrecy, and processing would give more adequate insights for optical buffer systems.

Conclusions
The application of TCK in an OCDMA-based buffer in OPS networks was investigated in this paper. The number of queued packets in the proposed buffer was increased by assigning packets with OCDMA signals and their complementary codes. The buffering performances in BER and buffer capacity were obtained by numerical analysis and simulations by considering the thermal noise and PIIN. The proposed TCK buffer could lead to a reduction of the BER as the Hamming distance between payload bits "1" and "0" is twice than that of the OOK buffer, which obtains a larger SNR. Moreover, the author found a cost-effective encoder based on FBGs that simultaneously generates an OCDMA signal and its complementary counterpart. For future works, the authors aim to adopt channel coding in OPS as a solution to resolve packet contention, prevent packet loss, as well as enhance network security [20]. Except for simply considering the capacity, investigating other physical constraints in OPS such as survivability, secrecy, and processing would give more adequate insights for optical buffer systems.