A performance investigation of SAC-OCDMA system based on a spectral efficient 2D cyclic shift code for next generation passive optical network

A two dimensional spectral/spatial cyclic shift (2D-CS) optical code division multiple access (OCDMA) systems is proposed for a potentially next generation passive optical network (NG-PON) implementation called (2D-CS NG-OCDMA-PON) system. The2D-CS proposed code is characterized by a high capacity and a zero cross correlation property leads to completely eliminating the multiple access interference (MAI) effect that is considered as the main OCDMA system drawback. Firstly, the 2D-CScode construction is investigated from 1D-CS code. Secondly, a system description is provided by exhibiting the transmitter and receiver architecture in the PON context. Analytical analysis reveals that our proposed 2D-CScode outperforms similar codes such as perfect difference (2D-PD) and dynamic cyclic shift (2D-DCS) codes in terms of spectral efficiency, simultaneous network subscribers and data bit rate. In addition, based on numerical analysis 2D-CS NG-OCDMA-PON system shows a good system performance by means of avery low BER and a high Q-factor values equal to 10-26\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$10^{{ - 26}}$$\end{document} and 10.41 dB, respectively. Likewise, for four users and free-amplification the achievable reach ability distance of the NG-OCDMA-PON system is 63.21 km, 43.57 km and 33.2 km while Q-factor is equal to 6 dB at a bit rate of 622 Mb/s, 1 Gb/s and 1.5 Gb/s, respectively. On the other side, according to the system setup the number of single mode fiber (SMF) is reduced to the half compared to other 2D-OCDMA-PON systems based on enhanced multi diagonal (EMD) and single weight ZCC (SWZCC) codes.


Introduction
In the recent years, optical code division multiple access (OCDMA) technique has attracted much attention due to its ability to permit multiple users sharing the same bandwidth of the channel asynchronously and synchronously through providing each user its own code (Alayedi et al. 2019(Alayedi et al. , 2020a(Alayedi et al. , 2020bCherifi et al. 2016Cherifi et al. , 2019Gupta and Goel 2017;Abd et al. 2014;Nisar 2016). Moreover, this technique has several features like multi data transmission service, high security level, random access user, adaptable and scalable network and packet collisions absence' Durand et al. 2012Durand et al. , 2016Martinez et al. 2020). As well, OCDMA technique is compatible with both wavelength division multiplexing (WDM) and time division multiple access (TDMA) techniques, so that, it can present a very effective and potential solution for the future optical networks . Accordingly, OCDMA systems can be classified into two categories: Coherent systems which use bipolar codes (− 1) and (+ 1) and non-coherent systems which use unipolar codes (0) and (1).
In terms of comparison, the orthogonality between codes is strictly guaranteed for coherent systems that are likely achieved for incoherent systems. In addition, coherent systems employ several elements that consequently increase the infrastructure cost and system complexity. However, incoherent systems depend on intensity modulation and direct detection (IM/DD) in encoding and decoding operations (Alayedi et al. 2020a;Cherifi et al. 2019Cherifi et al. , 2020.Spectral amplitude coding-OCDMA (SAC-OCDMA) system suffers from multiple access interference (MAI) leading to a degradation of the system performance (Durand et al. 2012;Mrabet et al. 2009;Okassa M'foubat et al. 2012). This issue can be eliminated if the codes will have constant in phase cross correlation value (Gupta and Goel 2017). Also, OCDMA system is affected by multiple noise sources such as dark current, thermal noise and shot noise from spectra overlapping due to different users sharing the network facilities (Arief et al. 2013;Durand et al. 2016;Feng et al. 2015). In fact, several factors can contribute to enhance OCDMA systems performance such as incrementing the code weight will surely enhance the quality of service (QoS), correlation properties and BER (Imtiaz et al. 2016).
According to components used in optical access networks, it can be categorized into two types covering passive optical network (PON) and active optical network (AON). The difference between them can be determined through the use of an optical and electrical de-multiplexer, respectively (Yousif and Nisar 2013). Furthermore, AON needs energy more than PON so PON is considered as an energy saver (Butt et al. 2018). PON is a broadcast (point to multi point) technique which premises passive components such as: couplers, splitters, optical fibers and so on.. Therefore, it is adaptive with OCDMA technique as well as it present a very promising candidate for next generation networks. The transmissions between transmitters and receivers can be executed from an optical line terminal (OLT) to optical network unit (ONU)as well (Mrabet et al. 2018(Mrabet et al. , 2019. The objective of PON attempts to extend the bandwidth which permits the capability of carrying information ongigabit order to fulfil the requirements of optical communication systems (Kora et al. 2011;Mrabet et al. 2017;Okassa M'foubat et al. 2012). Consequently, OCDMA-PON has been attracted researchers viewing it can confidentiality guarantee a data transmission, asynchronous communication completely, the same bandwidth for uplink and downlink and access networks with high speed. OCDMA-PON faces several challenges as algorithm complexity reduction of resource management where it should be solved. This allows OCDMA-PON to be afforded to assure resource allocation on request and adaptive (Hadi and Pakravan 2017;Mrabet et al. 2017Mrabet et al. , 2018Mrabet et al. , 2019.Several codes have been proposed for OCDMA systems such as one dimensional (1D) codes which encode in frequency or time component and two dimensional (2D) codes which encode frequency and time components together. Increasing the system capacity requires a large number of filters with very small bandwidth for many wavelengths that is an impractical solution that leads automatically to increase the code length and degrade the system performance (Lin et al. 2005).Moreover, 2D encoding does not only include the combination between frequency and time components together, it also includes the combination between frequency and spatial, frequency and polarization and so on (Kadhim et al. 2014).
For this, there multiple approaches published recently for 2D-OCDMA systems use spectral and spatial as first and second encoding domain to tackle this shortcoming. These codes suffer from high cross correlation (λ c ≥ 1) and auto-correlation values for instance 2D-perfect difference (PD) and 2D-dynamic cyclic shift (2D-DCS) and 2D-multi service (2D-MS) codes which are proposed by Lin et al. [16], Najjar et al. (Najjar et al. 2017) and Jellali et al. (Jellali et al. 2017) respectively. Although, these codes can minimize the MAI using an MAI cancellation property but none of them can totally eliminate it because they have a constant in-phase cross correlation value between two adjacent codes. As well, both 2D-DCS and 2D-MS codes can enhance OCDMA system by augmenting the code length of spatial component and decreasing the code length of spectral component. In (Bih-Chyun Yeh et al. 2009), 2D-diluted PD (2D-DPD) code is derived from PD code. Based on that, it suffers from constant cross correlation value. However, its influence on OCDMA system is matched 2D-DCS code as demonstrated in our previous works (Alayedi et al. 2020a; in spite of both have a different matrix. Yang et al. (Chao-Chin Yang and Jen-Fa Huang 2003)proposed 2D-M-Matrice coding based on M-sequence code with depending spatial encoding technique for first code sequence and frequency encoding technique for second code sequence. This code presents ashortcoming characterized with a high cross-correlation value. As a result, the improvement of the system performance is depressed. Nevertheless, this code suffers from MAI and his improvement is so limited that 2D-PD code can be overcomed and give better performance although the code length of the second component is itself with differentiation in code length of the first component that is less for PD code as demonstrated in (Lin et al. 2005). Also, Matem et al. (Matem et al. 2019) proposed 2D-hybrid code with both zero cross correlation (ZCC) for spectral encoding and multi diagonal (MD) for spatial encoding code. This hybrid code can suppress MAI effect due to its ZCC property for both codes but through ZCC code construction, it has been found that the cardinality is related greatly to code weight in other sense; the number of users cannot be increased without increasing the code weight in contrastto MD code.
In order to overcome latter drawbacks, this paper proposes a two dimensional cyclic shift (2D-CS) code with its corresponding system structure in spatial encoding domain as second dimension to the reporting 1D-CS code which is characterized by a zero cross correlation property and high cardinality with short code length. Adaptation of the OCDMA technique with PON using a 2D-CS code is discussed in both analytical and numerical parts to show the code benefits on the next generations PON (NG-PON). To the best of our knowledge this paper is the first time to propose 2D-OCDMA system based on 2D-CS signature for NG-PON. This paper displays a detailed presentation of the 2D-CS code construction in the second section. The function of the proposed system with its corresponding structure is described in third section. Fourth section displays a comparisonbetween the above code focusing on 569 Page 4 of 28 DCS and CS codes. Analytical and numerical results of system performance are presented in fifth and sixth sections respectively. A simulation setup is explained in seventh section and finally, this paper is ended by a conclusion in the eighth section.

Two dimensional cyclic shift code construction
The 2D-CS code can be constructed by using two code sequences of 1D-CS code which can be defined by these parameters: ( L, K, w, c ) which present the length of code sequence, capacity of system, code weight and in phase cross correlation respectively. The 1D-CS code matrix in terms of the number of users and the weight of the code is defined by the length of the code (Mostafa et al. 2019): It can be describe the construction steps of CS code as following: Step 1: Choose both desired code weight and active user's number.
Step 2: To generate the first codeword allocated for the first user, it should to determine the ones positions through this vector: P ones = C 1n , C 12 , … … , C 1w where n = {1, 2, … … , w} and C 1n presents the number of column in the 1 st row of code matrix.
Step 3: The rest positions of the code word are filled by zeros until "L" length.
Step 4: For the second code word, it can be obtained by shifting the first code word by by "w" to the right.
Overall, from the second to the latter code word, it can be obtained by shifting the precedent by "w" to the right. An example of the CS code family with K = 4 and w = 3 is presented in Table 1.
To construct 2D-CS code, we need to use two sequences X e and Y f for spectral and spatial components respectively. Let take B(e, f ) expresses the 2D-CS codeword which given as : The code lengths of spectral and spatial components are: L 1 = w 1 .K 1 and L 2 = w 2 K 2 where K 1 and K 2 , and w 1 and w 2 present their code sizes and code weights respectively. The total capacity and code length of our new codeare C tot = K 1 .K 2 and L tot = L 1 .L 2 respectively. An example of the 2D-CS code sequences is presented in Table 2 where it is chosen the code size and code weight of spectral component the same for spatial component.
Let a e,f present the B e,f elements where e = 1, 2, … , L 1 and f = 1, 2, … , L 2 . Thus, B e,f matrix can be expressed as Lin et al. 2005):  It can be divide the 2D-CS code cross correlation four distinct matrices B (d) where d = {1, 2, 3, 4} , which are Lin et al. 2005): The cross correlation between B 0,0 and B e,f can be defined as (Kadhim et al. 2014): According to Eq. (5), we note that the 2D-CS code auto-correlation (λ a ) always equal to multiplication between code weights from first and second sequence, and the cross-correlation (λ c ) equal to zero. Fig. 1.manifests a 3D graphic representation of the proposed 2D-CS code of first user U(1,1) with its code word B(1,1) is allocated from Table 2. It uses X 1 = 1 1 0 0 0 0 and Y 1 = 1 1 0 0 which mentions to spectral and spatial axes respectively, and the cross-correlation calculation for the proposed 2D-CS code is listed in Table 3.

System description
The general scheme of 2D-Spectral/Spatial OCDMA system can be presented in Fig. 2. At the beginning, there are K 1 .K 2 transmitter/receiver pairs and N star couplers where for each one of them is allocated with the 2D-CS code word from B e,f . As cleared in Fig. 3, the transmitter structure for each user is composed of pseudo random bit sequences (PRBS) generator, an incoherent light source such as light emission diode (LED), an electrical to Table 2 The 2D-CS code for w 1 = 2 , K 1 =3, w 2 =2 and K 2 =2 optical modulator (EOM), a power splitter and two sets of fiber Bragg gratings (FBGs) where both have equal number of gratings but with opposite arrangement. After generating the binary data by PRBS generator as electrical form, these data is delivered to the EOM which modulates it depending on ON-OFF keying (OOK) format as well converts it from electrical to optical form. FBG1 receives the modulated optical pulses from EOM and encodes it spectrally according to the corresponded wavelength to ''1'' of X g code sequence then reflect to the FBG2 to compensate the run-trip delay then it is delivered to the optical splitter. The others wavelengths which do not correspond to (1) of X g code sequence are eliminated and filtered out. The optical splitter retransmits the encoded optical pulses into w 2 star couplers to encode them spatially according to the corresponded coupler of Y h code sequence. Thus, two dimension encodings is completely done for optical signal. For receiver structure of each user as cleared in Fig. 4, it presents the inverse operation of transmitting structure where it is The combiners work to sum the reaching signals from the star couplers according to the corresponded Y f code sequence to decode spatially then they are transmitted to the FBG1 to decode them spectrally in accordance with the corresponded wavelength of X e code sequence and reflect back them to FBG2 to compensate the run-trip delay. Thus, the optical pulses are decoded in two dimensions fully. Later, they are delivered to the PD which converts them from optical to electrical form. Finally, LPF filters the aggregated signal. Table 3 The 2D-CS code cross correlation

2D-CS system performance
We will use four assumptions to make the system analysis simple which are Jellali et al. 2017;Lin et al. 2005): (1) Unpolarized light source ideally with flat spectrum over f 0 − Δf , f 0 + Δf of bandwidth, where f 0 and Δf are the central optical frequency and the optical source bandwidth respectively and it estimated in Hertz.
(2) Equal power for each transmitter.
(3) An identical spectral for each component of power spectral.
(4) Each bit stream from each user is synchronized. Depending on these assumptions and the Gaussian approximation (Feng et al. 2015), the bit error rate (BER) estimation can be realized with considering the thermal, PIIN and shot noises. The photo-current noise is given by Kadhim et al. 2014;Matem et al. 2019): where K b is Boltzmann's constant, T n is the absolute temperature, B is the electrical bandwidth, R L is the load resistance, I dd is the average photo-current, c is the coherence time and finally e is the electron charge. The coherence time can be expressed as (Alayedi et al. 2020a;Lin et al. 2005): where r(v) presents the power spectral density (PSD) for each user. It can be expressed as (Alayedi et al. 2020a;Kadhim et al. 2014): where P sr and d K present the effective source power at receiver and data bit of K th user which may be (0) or (1) respectively.
The V(v, i) function can be defined as: where u(v) present the unit step function defined as: The output photo-diode current in the part of receiver can be written as: where R represents the photo-diode responsivity and equals to .e h.v c where , h , v c are the quantum efficiency, Plank's constant and the central frequency of the original broad-band optical pulse respectively (Cherifi et al. 2016;Hadi and Pakravan 2017). Note that L 1 = w 1 K 1 and K 1 = C tot ∕K 2 , Eq. (11) will be written as: The PIIN variance current can be defined as: Based on results in Eqs. (11) and (12) and taking account the probability of transmitting (0) and (1) is the same, Eq. (6) will become: The average signal to noise ratio (SNR) can be written as: Using the Gaussian approximation, the BER is given by (Durand et al. 2016;Cherifi et al. 2020;Yousif and Nisar 2013): The Q-factor can be derived from the BER where can be expressed as ):

Codes comparison
This section compares the proposed code named 2D-CS to different two dimensional codes that are reported in previous works including CS, 2D-PD, ZCC/MD and MS. All 2Dcodes have a high auto-correlation value compared to the proposed code 2D-CS has an autocorrelation value equal to zero (λ c = 0) which leads to the use of a simple structure, but none of (11) � them (2D codes) can totally decrease the MAI as can check the proposed code that allows it to outperforms the existing 2D codes in terms of high ability.
In addition, compared to the 2D-hybrid ZCC/MD, the auto-correlation value of the 2D-CS and 2D-hybrid ZCC/MD can be considered the same, but there is a difference presented by the spectral component of 2D-hybrid ZCC/MD code. Otherwise, ZCC code suffers in terms of the flexibility which relates to the number of users that is highly related to the code weight contrary to the developed 2D CS code where all parameters are independent and flexible.
Accordingly, Table 4 illustrates a detailed comparison between the different codes mentioned in (Abd et al. 2014;Jellali et al. 2017;Mostafa et al. 2019) in terms of cross-correlation, position of ones for first code sequence, next code sequence, code family, employed detection technique, signal power, the noise power, SNR, code length and receiver complexity.

Numerical results and discussion
This section discusses the system performance using two dimensional cyclic shift (2D-CS) code in two terms: bit error rate (BER) as function of number of simultaneous users, effective source power, data rate and spectral width, and signal to noise ratio (SNR) as function of number of simultaneous users. It indicates the effect of passage from one dimensional (1D) to 2D CS code and it is compared with 2D-perfect difference (2D-PD) (Lin et al. 2005) 2D-multi service (2D-MS) ), 2D-dycnamic cyclic shift (2D-DCS) ) and 2D-zero cross correlation/multi diagonal (2D-ZCC/MD) (Matem et al. 2019)codes for the same code lengths spectral and spatial: ( L 1 = 57 ) and ( L 2 = 3 ) respectively. The employed parameters for numerical analysis are listed in Table 5. Figure 5 presents the BER variation as function of number of simultaneous users for −10dBm of received power and 622 Gb/s of data rate. As shown, our proposed code can support higher number of users reaches 203 whereas in case 1D can support just reaching 87 users. Thus, the system capacity has been enhanced about 2.33 times from passing from 1 to 2D. As well, OCDMA system based on 2D-CS code has been outperformed both 2D-PD, 2D-MS and 2D-ZCC/MD, and 2D-DCS codes for the same code length about 2.31, 1.49 and 1.34 times respectively where the system capacity by using each code of them is 88, 136 and 151 users respectively so we can say that possibility meeting the needs of optical systems. Also, the properties of 1D-CS, 2D-PD, 2D-MS and 2D-ZCC/MD are different where each one of them has its method construction and characteristics but for a BER threshold, both 1D-CS and 2D-PD codes and both 2D-MS and 2D-ZCC/MD can support the users number.
Position of ones for firstcode sequence Not successive based on:

Successive at the beginningof sequence
The next code sequence Can be generated by shifting its back by (w−1) to theright Can be generated byshifting its back by (w) Fig. 11 More than DCS codedemonstrated in Fig. 11 Noise power More than 2D-CS code demonstrated in Fig. 12 Less than DCS codedemonstrated in Fig. 12 SNR Less than CS code demonstrated in Fig. 6 More than DCS codedemonstrated in Fig. 6 PIIN term   Figure 6 presents the SNR variation as function of number of simultaneous users when the electrical bandwidth and effective source power are 311 MHz and −10 dBm respectively. It is cleared that our proposed 2D-CS code has higher SNR due to high output current of photo diode comparing with dark current noise. For ( K < 100 ), it is observed that the curves of different codes overlap between them the SNR value of any code sometimes varies from better to worse or vice versa comparing with other codes so it cannot be determine which code outperforms other codes except our proposed code keeps it outperforming than other codes. Starting from(K > 100 ), the curves of different code starts take a determined targetwithout overlapping.Although 2D-OCDMA system using CS code is affected by PIIN, but it keeps higher SNR value comparing with 1D-CS, 2D-PD, 2D-MS, 2D-ZCC/ MD and 2D-DCS codes. For 150 active users number, we have found that the SNR values are 49.75, 58.51, 102.2, 127.3, 146 and 231 for 1D-CS, 2D-PD, 2D-MS, 2D-ZCC/MD, 2D-DCS and 2D-CS codes respectively and according the above results, it can prove the potential of our proposed system for MAI and PIIN effects. Figure 7 presents the BER variation as function of data rate for 70 active users number. As shown, required BER in optical communications can be achieved for 2.9, 1.39, 1.23, 1.13, 0.89 and 0.98 Gbps for 2D-CS, 2D-ZCC/MD, 2D-DCS, 2D-MS, 2D-PD and 1D-CS codes respectively. As a result, using our proposed code, OCDMA system can accommodate high data rate close to 3 Gbps where as other codes cannot reach to 1.5 Gbps and this enhancement can be justify zero cross correlation property of our code which contributes significantly to enhance the OCDMA system performance.
For Fig. 8, it offers the BER variation as function of received power for 120 and 0.622 Gbps of active users number and data rate respectively. For Psr < −23 dBm, all codes has almost the same performance in other sense the curves are restricted except 2D-PD curve which varies speedily from Psr > −30 and don't achieve BER floor cause of great PIIN effect. After that, they start in variation until achieving BER floor for -12.95, -12.35, -11.11 and -8.8 dBm for 2D-CS, 2D-DCS, both 2D-ZCC/MD and MS and 1D-CS codes respectively. By virtue of the above results, the implementing of our proposed code makes each user in OCDMA system needs minor power at receiver level and save around -0.65 and -1.84 dBm comparing with 2D-DCS and both 2D-ZCC/MD and MS codes respectively as well the passage from 1 to 2D save around -4.15 dBm.
Fifth parameter has been studied, is the BER variation as function of spectral width for 120 of active users number as shown in Fig. 9. It is observed that 1D-CS curve is not plotted due to its zero cross correlation property and its SNR expression does not contain " Δv " variable. For BER floor, our proposed code can satisfy optical communication demands when 0.56 Thz whereas 2D-ZCC/MD, 2D-DCS, 2D-MS and 2D-PD codes make OCDMA system need up to 1.5, 1.6, 1.8 and 2.6 Thz of light spectral width respectively. Referring to the above, using 2D-CD code make OCDMA system save the light spectral width up to three to five times comparing with used codes for comparison. On the other hand, our system is studied under the effect of noise sources: PIIN, Shot noise and Thermal noise as for 120 of active users number as shown in Fig. 10.It is clear that our system is mainly affected by PIIN and thermal noise. Green curve indicates the neglect of shot noise and gives almost the same performance comparing with black curve. Meanwhile, red curve indicates the neglect of thermal noise where the system performance is greatly enhanced. In briefly, it can neglect shot noise effect and just consider both thermal noise and PIIN to evaluate the system performance.  Figure 11 highlights on incident current variation as function of received power for 120 of active users' number as shown in Fig. 9. It is clear that the signal information current of 2D-CS is better than 1D and the same comparing with 2D-ZCC/MD code. Meanwhile, the 2D-PD code signal information current is the best comparing with other codes. It can be intercept these results through used detection technique at receiver side where 2D-PD, 2D-DCS and 2D-MS use AND detection whereas 2D-ZCC/MD, 2D-CS and 1D-CS code use direct detection. The spectral direct detection (SDD) is better than AND detection where it decrease the system complexity up to 50%and the required filters number.On the other hand, AND detection gives better performance than SDD where it is allocated a filter for each wavelength in contrast in SDD, single filter is enough. Therefore, AND can significantly restrain MAI effect than SDD.In addition to that, it stands to reason say that high signal power conducts to minimize BER but in our case 2D-PD code makes OCDMA system suffer highly from PIIN and also 2D-DCS and 2D-MS codes which reflected negatively on system performance and this is demonstrated in Fig. 12.
Finally, the current dark noise variation as function of received power is presented in Fig. 12. It is observed that OCDMA system suffer from very high noise using 2D-PD code which has better signal power. Concerning other codes, it seems that noise values are convergent but as well our proposed code has minor noise power due to zero cross correlation propertyas well the code features play an essential role in influencing the system performance not just used detection technique. On the other hand, although the relation between SNR and noise current dark is inverse, that means very low noise leads to very high SNR in other sense enhancing in quality of service (QoS).
Based on Eq. (17), the Q-factor is plotted as function of number of simultaneous users with determining the data rate at 622 Mbps. It is noticed that, the Q-factor diminishes when the users' number augments which mentions to the reversible relevance between them contrary between BER and "K". At an agreeable Q-factor value in optical communications in which estimated by 6 dB, the OCDMA system capacity is 203, 151, 136, 88 and 87 in system performance. On the other hand, the total code length of 2D-CS code is equalize to 171 for L1 = 57 and L2 = 3. Additionally, the total code length of 1D-CS code is equalize to L = 348 for w = 4 and K = 87.Note that the optimization has been included whence system capacity with diminishing the code length too. Nevertheless, the efficient capacity (η) of our proposed code can be calculated from the following expression as ): Therefore, we find that η is equalize to 118, 88, 79, 73, 51 and 25% for 2D-CS, 2D-DCS, 2D-MS, 2D-ZCC/MD, 2D-PD and 1D-CS codes respectively. In spite of 2D-MS and 2D-ZCC/MD codes has the same cardinality but the spectral efficiency is not the same due to the differentiation in spectral code length.The above result are proves the outperforming of 2D-CS code than others depended codes in this study making it more adaptable and appropriated to satisfy the optical communication requirement.
In this study, we introduce another parameter for more demonstration of the outperforming of our code comparing others, which is spectral efficiency (SE). It can be defined through the divide of the aggregate information rate on total spectral bandwidth where it can be expressed as : where K BER=10 −9 refers to the maximum system capacity and Δ refers to the bandwidth of each optical wavelength. We have several 2D codes where each one of them has it cardinality except 2D-MS and 2D-ZCC/MD code as well the bandwidth of wavelength is estimated by 90 nm. In reference to Fig. 14, it is evident that the 2D-CS code has the highest SE Noting that the relevance between "SE" and "w" is reversible proportional because the SE diminishes as the weight augments. Furthermore, both 2D-ZCC/MD and 2D-MS codes have the same SE variation of although each one belongs to different family where the first is classified into ZCC families and the second is classified into codes with constant inphase cross correlation (IPCC) value. That is due to both permit OCDMA system to supply the same capacity as founded in Figs. 5 and 13. Table 6 offers the SE comparison for various codes. Consequently, for minor considered code weight that is equal (11), 2D-CS code overcome 2D codes: DCS, both ZCC/MD and MS and PD as well 1D-CS code whence SE percent by dint of 5.41%, 7.31%, 12.55% and 12.66% respectively. Indeed, these results comes back from that 2D-CS code accommodates 203 users whilst 2D-DCS, both 2D-MS and 2D-ZCC/MD, 2D-PD and 1D-CS codes accommodate just 151, 136, 88 and 87 users respectively at an agreeable Q-factor 6 dB and BER 1e-9 with deeming the same number of wavelength for all codes. These obtained results in the above comes from zero cross correlation feature of our proposed code making qualified to satisfy the optical communication demands and support the next generation OCDMA-PON networks.

Network setup
In this section, our proposed 2D-CS code is simulated using Optisystm software version 7.0. Used parameters in the simulation are listed in Table 7.It is taken a consideration the non-linearity properties of single mode fiber (SMF) and noise sources as thermal noise coefficient to obtain results that are slightly closer to practical performance.
According to the 2D-CS-OCDMA system model which proposed to implement for PON, it includes four users: two users allocated for spectral encoding and two users allocated for spatial encoding as shown in Fig. 16.Form Fig. 15, as in other PON systems, upstream data from OLT are spitted using star couplers and then summed using combiners to assure deliver the combined signals to ONU using SMFs. It can be divide the proposed network into two parts: optical line terminal module (OLT) at the central office and optical network units (ONUs) at the subscriber's premises to replicate a basic PON.The OLT of our proposed system includes K 1 × K 2 transmitter units in our case there are four, where each unit includes whit light source which is linked with a Mech-Zehander Modulator (MZM) works as signal converter from electrical to optical form.The modulated pulses are delivered to the spectral encoder from MZM, in our proposed network, we use two sets of fiber Bragg gratings (FBGs). FBGs reflect a corresponded wavelength to 1 s of X e code word. The encoded signals spectrally are retransmitted in different two fibers ( w 2 ) by a power splitter to a corresponded star coupler to 1 s of Y T f to encode them spatially. For example, the output signals from first user which use '' 1 2 00'' of code word, are connected to the first and second star couplers ( C 1 &C 2 ) as elaborated in detail in Table 8.
For the part of the ONUa power combiner linked with FBG where the ONU is linked with OLT by using SMF. The power combiner sum the output signals in accordance with the matched star coupler of Y T f of code word so after this step, signals are decoded spatially. As shown in Fig. 16, OCDMA-PON, the power combiner specified for first user, is connected with first and second star couplers and it is imperative for OCDMA principle and compatible with Table 7. Then they are sent to FBGs for spectrally decoding and photo diode (PD) for direct detection and it converts the signals from optical to the electrical form. Finally, low pass Bessel filter and BER analyzer are complete for each unit of ONU. Table 8 explains how to encode and decode in two dimensional spectral and spatial where there four users and each one of them is allocated with a code word. Let take third user example where it needs an encoder or in other sense two filters for 1 and 2 for spectral encoding. Later, filters should to connect with third and fourth star couplers where before that, it has to split their outputs into two identical portions. And with these connections, two dimensional encoding is realized and it is also elaborated more in Fig. 16. For two dimensional decoding, it presents the reverse operation of encoding.
The performance of our proposed code is distinct by referring to the Eye diagram and BER patterns as shown in Fig. 17. It is clear that 2D-CS code gives 2D-OCDMA system good performance and it can see this through obtained BER and Q-factor values where the BER values are:1.85 × 10 −19 , 8.48 × 10 −19 , 5.71 × 10 −18 and 8.72 × 10 −26 as well the Q-factor values are: 8.92, 8.79, 8.49 and 10.41 for first user, second user, third user and fourth user respectively. Consequently, we note that both BER and Q-factor values do not pass their threshold which they should to be minor than 10 −9 and superior than ''6 dB'' respectively. In addition to that, the system performance can be determined through the opening of eye diagram where as long as it extends over a wider range, this indicates the reducing of multiple access interference and confers the system a better performance, and vice versa. By virtue of the above results, all users have different values of BER and Q-factor and it can be explain this difference through several factors: (1) Power loss: although all users have the same power in the part of transmitter and during the transmission they suffer from loss in power but it is not necessary the loss is the same for all.
(2) Synchronization absence: each user transmits its information but it is not necessary all users restrict in distinct moment.
(3) PIIN effect: although the power loss is different from each user, it leads to differ PIIN effect as in Eq. (12) so it will reflect back on BER.
(4) Spectrum differentiation: OCDMA is considered as a multi service transmission technique. That means that it can transmit various formats such as audio, video and image. In other sense there are different signal types carried be the in the same network each signal has its specific spectrum. To support that, it is added for this work Fig. 18. to demonstrate the above results. In accordance with Fig. 18, it seems obviously that the 2D-CS code gains OCDMA system a good performance manifesting through the BER value 1e-26 and Q-factor value 10 dB approximately where both attain optical communication conditions.
For Figs. 19 and 20, they present the distance variation comparing with Q-factor and BER respectively. It clears that if the distance increased, the BER will be increased and the Q-factor decreased which means that the relation between distance and BER is proportional and inverse between distance and Q-factor. In addition, the optical fiber dispersion also affects on the system performance. Although each user exploits high data rate in different two cases equal to 0.622, 1 and 1.5Gbps, it is remarkable that the threshold distance of our proposed system whatever for floor BER or Q-factor, reaches 63.21 km, 43.57 km and 33.2 km,respectively. Likewise, it is very great making our codes satisfies the requirements of optical communication systems.
At the last, Figs. 21 and 22 manifest the BER and Q-factor variation as function of data rate for fixed distances up to 20, 30 and 40 km. It is evident that the BER augments and the Q-factor diminishes as a case of data rate in increased. That mentions to the direct proportion and inverse proportion between them respectively. The analysis is processed for 4 users accessing the mean at the same time. It can seen that the performance of our proposed network impairs in case of augmenting of SMF length. Nevertheless, the better performance for 2D-CS setup with ( L 1 = 4 and L 2 = 4) can be performed at 20 km of distance with provided data rate of 1.68 Gbps.
Furthermore, the Q-factor diminishes and BER elevates for 30 km SMF length where the system suffers from the weakness until data rate reaches from 1.68 to 1.56 Gbps. Likewise, the weakness continues in system impairment until achieving 1.45 Gbps of data rate at 40 km.
Consequently, to scheme and optimize OCDMA system configuration parameters, it should to set fiber extent with small length as possible it is remarkable that the threshold distance of our proposed system whatever for floor BER or Q-factor, reaches 63.21, 43.57 and 33.2 km respectively and it is very great making our codes satisfies the requirements of optical communication systems.
On the other side, this study does not just include the attained improvement advantages by CS code for 2D-OCDMA system as SMF distance and data rate, it also comprises the system structure that can elaborated as following: C 1 1 ,C 1 2 , C 1 3 , C 1 4 , C 1 C 2 1 , C 2 2 , C 2 3 , C 2 4 , C 2 C 3 C 4 C 1 C 2 C 3 1 , C 3 2 , C 3 3 , C 3 4 , C 3 C 4 1 , C 4 2 , C 4 3 , C 4 4 , C 4 Cherifi et al. ) and Imtiaz et al. (Imtiaz et al. 2020) have been proposed 2D-OCDMA system using single weight ZCC (SWZCC) code and enhanced multi diagonal (EMD) code, respectively by setting the first component for spectral encoding while the second component is set for spatial encoding. By scrutinizing proposed system structures which presented in Fig. 6 in )and Fig. 8 in (Imtiaz et al. 2020), we note that in both studies, authors have been allocated a single SMF for each user but in our work, we have been allocated a single SMF for two users at same time.
This means that the system complexity is reduced by 50% in term of numbers of SMFs. Additionally, the maximum Q-factor does not surpass 8 dB at 0 km in  whereas we have obtained Q > 8 dB at 20 km. At the end, these improvements can be developed and profited for number of users more than four as in this study.

Conclusion
In this paper, a novel 2D spectral/spatial CS code was proposed for non-coherent OCDMA-PON systems based on 1D-CS code. The code can overcome the limitations of OCDMA-PON systems in terms of MAI effect and long code length as well. Compared to other 2D studied codes, CS code produced an output PD current with an intensity less than the produced currents of other studied codes. However, thanks to ZCC property that produces the least noise effect which maintains the SNR value leading to minimize BER value and obtaining good results. The latter results are characterized with a superior cardinality, high data rate and minor received power. According to mimic results gave agreeable results presented by BER less than 1e-9 and Q-factor more than 6 dB. Moreover, according to the numerical results, the reach ability distance of the proposed NG-OCDMA-PON system based on 2D-CS codes can go up to 63 km operating at 622 Mb/s and with free-amplification. On the other side, it allows for each user a high data rate with setting fiber length at different high values as 20 km, 30 and 40 km as well the system complexity which reduced up to 50% at channel level comparing with reported 2D works: SWZCC and EMD codes. Consequently, these achieved improvements are due to the ZCC property which can totally eliminate the MAI effect leading to become a potential candidate to meet optical communication requirements in the next generation OCDMA-PON (NG-OCDMA-PON).