# Static Evaluation of a Midimew Connected Torus Network for Next Generation Supercomputers
## 3 Routing Algorithm of MTNs  
This section discusses the simulation of the proposed topology. MTN was simulated using JAVA coding to generate the diameter and average distance values. The algorithm for the routing protocol is presented here, and it generated the message paths in the network with respect to its layout. The routing algorithm identified the methods by which the network chose the best path, which in this study was the shortest. This protocol, followed by the packets from their source to their destination, was critical. It's incorrect implementation would severely impact the performance efficiency, since the main goal of the routing algorithm was to select the most cost-effective path. A supercomputer relies on the routing protocol used to connect its nodes. In HINs, these procedures are based on the network topology. For example, the main phases of specific HINs, such as STTN, FTBN, and MMN, may be adapted by applying similar routing procedures, as detailed in this section. However, due to the different layouts of the network (i.e., the topology), the result of the hop-distance, as represented by diameter and average distance, would not be the same. The MTN routing algorithm began at the higher levels before moving to the lower levels based on the hierarchy interconnectivity. The packet dimensions were compared to determine whether its destination was on the same level. If its destination was on the same level, then the routing used an inter-BM connection. The network would follow the shortest path while transferring the packet via assigned outer nodes in each BM. In a similar manner, if the packet was traveling to another level, the routing would use the identified outer nodes to complete the packet transfer. Figure 1 shows the outer nodes for each level. For example, if a level-2 packet had a level-5 destination, then the shortest-path routing would use the bottom-right BM to exit that level. At level 5, the packet would enter through the top-left BM. In the simulation, the MTN was programmed to generate the shortest path between any two distinct nodes of the network, so that the simulation would be able to generate all of the required paths in order to calculate the diameter and average distance. The algorithm's implementation generated the paths with respect to a simple procedure to evaluate the proposed layout. The simulation was conducted using deterministic order routing due to its simplicity and clarity. In such protocols, the hop-distance or the shortest path was counted directly, depending on the proposed topology. The simulation followed dimensional order routing to choose paths based on the cost and dimensionality of the nodes. To move from one node to another, the simulation would first travel horizontally via the x-axis, and then, when the packet could go no further in this direction, it would switch to moving vertically along the y-axis. Therefore, the hop-distance was counted directly as the distance between the packet source and the destination to evaluate the MTN topology in terms of low hop-counts and, thus, better performance. Figure 3 shows the steps followed to apply the MTN topology. The network used source-and-destination pairs as BMs, and it considered the levels of both BMs represented in source destination nodes. It would then choose higher or lower levels based on where each \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Level** & **Consists of** & **Total Nodes** & **Free Ports Used** & **Wire Complexity** \\ \hline Level 2 & 16 of 4 \(\times\) 4 torus & 256 & 4 & 544 \\ Level 3 & 16 of 4 \(\times\) 4 level 2 & 4096 & 8 & 8736 \\ Level 4 & 16 of 4 \(\times\) 4 level 3 & 65,536 & 12 & 139,808 \\ Level 5 & 16 of 4 \(\times\) 4 level 4 & 1,048,576 & 16 & 2,236,960 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: All levels of MTNs (2, L, 0). BM node was located.