## 3 Scenarios of Multi-Level Buffering Services and Performance Evaluations
The departure time of a packet leaving the buffer \(\gamma\), which includes the latencies of finding a free code and optical decoding/encoding, is assumed to be the formula of the Poisson process. When a buffer of a unit CMLS subset is considered, it follows the characteristics of an \(M\)/\(M\)/\(1\)/\(N_{S}\) system. Here, \(N_{S}\) is defined as the number of CMLSs in a code subset. For the example of Figures 6 and 7, the values of \(N_{S}\) for high- and low-QoS users are respectively 7 and 3. The probability density function (PDF) of the number of coded packets in a buffer is treated as the steady-state probability of the used queuing system, which is given as [22]:  
\[P_{S}(k)=P_{0}\bigg{(}\frac{\gamma}{\mu}\bigg{)}^{k} \tag{4}\]  
where \(0\leq k\leq N_{S}\). \(P_{0}\) denotes the probability of zero packets existing in the buffer, which can be obtained by using the normalized condition and expressed as  
\[P_{0}=\frac{1}{\sum\limits_{k=0}^{N_{S}}\left(\frac{\gamma}{\mu}\right)^{k}} \tag{5}\]  
For a buffer that has been assigned CMLS codes of length \(N\), it is at capacity when all \(N\) codes are distributed to the buffered packets. A newly incoming packet is dropped since the buffering space is not available. Therefore, the PDP is defined as the probability of \(N\) packets existing in the buffer, which is given as:  
\[\text{PDP}=[P_{S}(N_{S})]^{(\frac{N}{N_{S}})} \tag{6}\]  
According to (6), the buffer model can be described as \(N\)/\(N_{S}\) parallel \(M\)/\(M\)/\(1\)/\(N_{S}\) systems. In the proposed optical buffering process, the CMLS code used for encoding a queuing packet is determined by the following steps. First, the control unit in the buffer selects a code subset with at least one unoccupied code in it. Second, one of the unoccupied codes in the selected code subset is assigned to the packet. If the codes in a code subset are all occupied, this subset is neglected by the control unit during the code-searching process. Therefore, the probability of successfully finding an occupied code for packet encoding in the buffering process is related to \(N\), \(N_{S}\), and \(N\)/\(N_{S}\). In (5) and (6), one could observe that PDP is determined by these three parameters. The relation between the parameters of \(N\), \(N_{S}\), and \(N\)/\(N_{S}\) is listed as follows:  
\[ \begin{array}{l}N(\text{Code length or the number of codes in a code set})\\ =N_{S}(\text{The number of codes in a code subset})\\ \times(N/N_{S})(\text{The number of code subsets})\end{array}  \tag{7}\]  
Figure 8 shows the PDPs of the two levels of buffering performance versus activity coefficient \(\rho\), where \(\rho\) is defined as \(\gamma\)/\(\mu\). The figure compares the two scenarios of high- and low-QoS users for different CMLS lengths. The parameters for code lengths are listed as follows. For \(N=21\), \(N_{1}^{\text{M}}=3\), and \(N_{2}^{\text{M}}=7\), while for \(N=45\), \(N_{1}^{\text{M}}=3\), and \(N_{2}^{\text{M}}=15\). For a given code length (\(N=21\)), the code assignment based on the partition of the code space with a larger subset number \(N\)/\(N_{1}^{\text{M}}=7\) improves the performance in terms of PDP, compared with the one with a smaller subset number \(N\)/\(N_{1}^{\text{M}}=3\). Please note that the difference between the twolevels of PDP becomes significant when the length difference between \(N_{1}^{\text{M}}\) and \(N_{2}^{\text{M}}\) increases. Furthermore, an increase in \(\rho\) leads to worse PDP performance. This is because the number of packets waiting in the input line grows, and the incoming packet number may exceed the buffer capacity. The PDP of the buffering system for \(N_{1}^{\text{M}}\) = 3 and \(N_{2}^{\text{M}}\) = 7 is plotted versus the CMLS code length \(N\) in Figure 9. The activity coefficient \(\rho\) in the figure is 3.2. The buffer performance is improved by increasing the code length since more packets can be allocated in the system.