## 4 Analysis and Simulation  
### Noise Analysis  
According to the analysis in Section 2, the main types of noise present in the all-optical QPSK-oriented matching system are input, amplifier, and mismatch noise. [PERSON] et al. used cascaded AND gates to eliminate mismatch noise [PERSON] et al. (2016). In this subsection, we analyze the effects of input and amplifier noise on the original system (hereafter, we refer to the QPSK-oriented all-optical matching system in [PERSON] et al. (2016) as the \"original system\" for brevity). First, the effects of input and amplifier noise on the original system are analyzed. Next, the matching results of the original system when both types of noise co-exist are analyzed. Figure 8 shows the simulation results of the original system in an ideal scenario and three noise scenarios. In VPItransmissionMaker 8.5, the NoiseWhiteGaussOpt module was used as input noise. The amplifier noise was characterized by an NF of 4 dB, with the noise center frequency set at 194 THz. In the simulations, the input QPSK optical signal adopted the Non-Return-to-Zero (NRZ) coding format. The data sequence for the simulations was {0, \(\pi/2\), \(3\pi/2\), \(0\), \(3\pi/2\), \(\pi\), \(\pi/2\), \(0\), \(\pi\), \(\pi\), \(\pi/2\), \(3\pi/2\), \(0\), \(3\pi/2\), \(\pi\), \(\pi/2\)}, and the target sequence was {\(3\pi/2\), \(0\), \(3\pi/2\), \(\pi\), \(\pi/2\), \(0\), \(\pi\), \(\pi\)}. Figure 8a shows the simulation results of the original system under an ideal scenario. Because the length of the target sequence was eight symbols, the system output eight frames of matching results. In Frame 1, the system output the position of \(\{3\pi/2\}\) in the data sequence; in Frame 2, it output the position of \(\{3\pi/2,0\}\) in the data sequence; in Frame 3, it output the position of \(\{3\pi/2,0,3\pi/2\}\) in the data sequence, and so on. In Frame 8, the system output the position of the target sequence \(\{3\pi/2,0,3\pi/2\), \(\pi\), \(\pi/2,0,\pi,\pi\}\) in the data sequence. The last symbol of the target sequence corresponded to the 10 th symbol of the data sequence. The output signal of the all-optical matching system served as a control signal to enable the photonic firewall to perform different operations. According to the simulation results reported by [PERSON] et al. [PERSON] et al. (2016) and shown in Figure 8a, for the original system, the power of \"1\" in the output optical signal was approximately 6 mW, while that of \"0\" was approximately 0 mW. We define the judgment threshold of the output signal of the all-optical matching system as \(\Gamma\). Its value was 80% of the power of \"1\". For the original system, the judgment threshold \(\Gamma\) = 4.8 mW. When the power of this symbol is greater than \(\Gamma\), it is considered \"1\"; otherwise, it is \"0\". Based on this standard, we analyzed the impact of noise on the system's performance. Figure 8b shows the effects of input noise on the original system when the input OSNR of the system was set to 6 dB. The input noise mainly affected the power of \"1\" in the output signal and had little effect on the power of \"0\". When the input OSNR was 6 dB, in Frame 1, the power of two \"1\" symbols was less than \(\Gamma\), and the powers of all \"1\" symbols in Frames 2 to 8 were less than \(\Gamma\). Although the waveform of the signal was approximately correct, it may cause misjudgment of the photonic firewall in practice. Figure 8c shows the impact of amplifier noise on the original system. The NF of all EDFAs was set to 4 dB. In the system's AND gates and wavelength converters, the EDFAs were positioned after the filters; thus, the system could not filter out the noise introduced by the amplifiers at the output. This resulted in significant noise fluctuations in the output signal of the system. During the simulation, an erroneous output signal appeared in Frame 4, which, combined with the noise, led to errors in the final matching results.