## 4 Methodology
### Redundant Slicing  
Traffic needs to go through \(\mathbf{m}\) entry ORs to reach the middle OR convergence and is split into \(\mathbf{m}\) slices and then recovered at the middle OR. The problem of whether the slices can arrive on time and in order is involved here because, in a real network environment, Tor does not contain any sequencing information [2]. Some slices may experience delays due to network jitter and cannot arrive in order, resulting in packets that cannot be recovered. Previous research has provided a solution by introducing a new INFO control cell [39], where the user regularly reports to middle ORs the packet sequences and the subcircuit where the packets are. If a packet arrives late, the corresponding merge relay caches all the follow-up packets before receiving the delayed one and processes all the acquired packets sequentially. However, this approach faces two problems. One is the slice loss problem where, as long as one of the slices is lost during communication, the middle OR cannot recover the original data in the expected order and the communication is immediately interrupted. Another problem is that the user's OP communicates directly with the middle OR. We all know that the onion routing protocol used by Tor puts forward the idea of path isolation at the beginning of the design to ensure anonymity, where each node only knows its predecessor and successor. It will significantly increase the risk that the Tor communication path will be exposed if the client interacts directly with the middle OR because the middle OR is aware of both the source IP location and the exit OR location. We solve these two problems by using redundant coding as a way to guarantee the multi-path transmission's reliability. **Redundancy mechanism:** The redundancy mechanism implemented in this scheme is based on data coding generation, where the encoding and decoding processes are linear mathematical operations. The applied coding coefficient matrix must adhere to the following criteria to decode the initial content:  
* **Linear independence principle:** Many problems may be faced during the communication process, such as the loss of data, malicious tampering, and data packets. The chaotic packets will be combined to decode. Thus, we create a square matrix for decoding using K corresponding row vectors from the coding coefficient matrix. In this regard, the inverse matrix of the square matrix is our need. Therefore, each row vector must be linear independent [46];
* **Redundancy parameter:** As shown in Table 2, the redundancy parameter is \(\mathbf{r}\). Under the principle of linear independence, the redundant parameter \(\mathbf{r}\) must strictly follow \((0\leq r\leq K)\) when constructing the coding coefficient matrix. The encoding coefficient matrices, EM, contain IM and CM. IM is the independent matrix of the first K rows, and CM is the circulant matrices of the last K rows, as shown in Equation (2). A circulant matrix is a special form of a Toeplitz matrix, and each element of its column vector is the result obtained by shifting the elements of the previous column vector to the right position in turn. \[\left[ \begin{array}{ccccc}e_{1,1}&e_{1,2}&e_{1,3}&e_{1,4}&e_{1,5}\\ e_{2,1}&e_{2,2}&e_{2,3}&e_{2,4}&e_{2,5}\\ e_{3,1}&e_{3,2}&e_{3,3}&e_{3,4}&e_{3,5}\\ e_{4,1}&e_{4,2}&e_{4,3}&e_{4,4}&e_{4,5}\\ e_{5,1}&e_{5,2}&e_{5,3}&e_{5,4}&e_{5,5}\end{array} \right] \tag{2}\]  
The encoding coefficient matrix EM is composed of IM and CM, such as in Equation (3). \[EM_{n,k}=\left[ \begin{array}{c}IM_{k,k}\\ CM_{n-k,k}\end{array} \right]=\left[ \begin{array}{cccc}1&0&\cdots&0\\ 0&1&\cdots&0\\ \vdots&\ddots&\ddots&\vdots\\ 0&\cdots&0&1\\ e_{k+1,1}&\cdots&e_{k+1,k}\\ \vdots&\ddots&\ddots&\vdots\\ e_{n,1}&\cdots&e_{n,k}\end{array} \right] \tag{3}\]  
**Encoding operation:** After the data-slicing process, the encoding operation of the data starts. In Equation (4), \(r=K\).