## 2 Preliminaries
### 3-Stage ASA Switch Architecture  
Figure 2a presents an AWG-based switch architecture, called a 3-stage ASA switch [24], that contains two planes, one of which is an electronic control plane and the other is an optical data plane. Each input port of a 3-stage ASA switch has separate fibers connecting the control plane and the data plane. The control plane of the 3-stage ASA switch implements scheduling first to guarantee collision-free data transmissions. Figure 2b presents the architecture of the data plane, which chooses a Clos topology and consists of three stages. The first (or third) stage consists of \(N\times N\) AWGs, and the middle stage consists of \(N\times N\) space switches, (i.e., optical crossbars). It is worth noting that \(N\) must be odd. Figure 1: Nine signals can pass through a \(3\times 3\) arrayed waveguide grating (AWG) simultaneously by using three different wavelengths {0, 1, 2}. In the notation \(\lambda_{w}^{i}\), \(w\) refers to the wavelength and \(i\) refers to the input port number. From the topology of the data plane of the 3-stage ASA switch (Figure 2b), we can see that the wavelength routing of the 3-stage ASA switch only depends on the wavelength routings of the \(N\times N\) AWGs in the first and third stages. Thus, the theoretical foundation for determining the wavelength routing of the 3-stage ASA switch is based on the 2-stage switch made from cascading two \(N\times N\) AWGs (see Figure 2c). The same as for a signal in an \(N\times N\) AWG, we also use (\(i\), \(w\), \(o\)) to denote a signal in the 2-stage switch from input \(i\) to output \(o\), using wavelength \(w\). The relationship among the parameters \(i\), \(o\), and \(w\) in a 2-stage switch is derived in Equation (2):  
\[o=(i+2w)\bmod N. \tag{2}\]  
A nonblocking switch means that each input can reach all outputs and two signals using the same wavelength do not collide at a link. However, the term \(2w\) in Equation (2) suggests that the 2-stage switch is not always nonblocking. Specifically, some inputs in the 2-stage switch may not reach all outputs. Reference [24] proves that the 2-stage switch is nonblocking if \(N\) is odd. It is worth noting that to ensure the 2-stage switch is nonblocking, each wavelength \(w\) must be guaranteed to be uniquely determined by input \(i\) and output \(o\). Suppose (\(i_{1}\), \(w_{1}\), \(o_{1}\)) and (\(i_{2}\), \(w_{2}\), \(o_{2}\)) are two signals in the 2-stage switch with \(o_{1}=o_{2}\) and \(i_{1}=i_{2}\), where \(o_{1}=(i_{1}+2w_{1})\bmod N\) and \(o_{2}=(i_{2}+2w_{2})\bmod N\). This leads to \(2(w_{1}-w_{2})\bmod N=0\), and the wavelength can be uniquely determined, (i.e., \(w_{1}=w_{2}\)), only if \(N\) is odd. For a 3-stage ASA switch, a two-tuple [group, member] is used to represent an input (or output) port address, where group refers to \(N\times N\) AWG, member refers to the link of \(N\times N\) AWG to which the input (output) port is attached, and \(0\leq\) group, member \(\leq N-1\) (see Figure 2b). Hence, a signal from input port [\(g_{\mathrm{s}}\), \(m_{\mathrm{s}}\)] to output port [\(g_{\mathrm{d}}\), \(m_{\mathrm{d}}\)], using the wavelength \(w\) is represented as ([\(g_{\mathrm{s}}\), \(m_{\mathrm{s}}\)], \(w\), [\(g_{\mathrm{d}}\), \(m_{\mathrm{d}}\)]), where \(0\leq g_{\mathrm{s}}\), \(m_{\mathrm{s}}\), \(g_{\mathrm{d}}\), \(m_{\mathrm{d}}\leq N-1\). According to Equation (2), the relationship among \(m_{\mathrm{s}}\), \(m_{\mathrm{d}}\), and \(w\) satisfies Equation (3):  
\[m_{\mathrm{d}}=(m_{\mathrm{s}}+2w)\bmod N, \tag{3}\]  
where \(N\) is odd. Thus, member fields are used for wavelength routing in the first and third stages of the 3-stage ASA switch. In addition, group fields are used for space switching in the middle stage. Specifically, signal [\([g_{\mathrm{s}}\), \(m_{\mathrm{s}}]\), \(w\), [\(g_{\mathrm{d}}\), \(m_{\mathrm{d}}\)]] is routed from the \(g_{\mathrm{s}}\)th input to the \(g_{\mathrm{d}}\)th output of the \((m_{\mathrm{s}}+w)\)th space switch in the middle stage.