## 3 System Design
### Algorithm
#### 3.3.1 Relay Node Selection  
Node selection plays a critical role in determining the reliability and efficiency of a system. In HCDN [16], a resource-to-node index is established through edge servers, and the selection of transmission nodes takes into account factors such as node bandwidth and stability. However, the index server in HCDN has single-point performance bottlenecks and scalability issues. In NKN [19], the next hop node is selected based on the logical distance between nodes in the Chord ring. This node selection method lacks the ability to perceive network status, which can impact end-to-end transmission efficiency and scalability. In our system, we manage user nodes based on NMRS. The NMRS divides the entire network into hierarchical management domains based on constraints such as latency,  
Figure 4: System workflow diagram. which accelerates resource resolution services. Additionally, we introduce link status to characterize the availability of user nodes, and task scheduling is performed by distributed network nodes. This approach allows for more efficient utilization of network resources compared to the method used in NKN. Node selection for ordinary ICN routers, based on the UBSID query to the NMRS for a list of candidate relay node addresses, involves choosing the user node with the optimal network state as the next hop node for transmission. In [36], the authors point out that relay node selection is an NP-hard problem. To mitigate the complexity of node selection, we utilize the LNMRS to manage user nodes and subsequently greedily select relay nodes based on computed link states. The calculation of link states directly affects the efficiency of node selection, as shown in Formula (1):  
\[pathstatus(node_{i})=(\alpha\times Bandwidth_{i}+\beta/RTT_{i})\times sigmoid (p_{i}-p_{0}) \tag{1}\]  
We consider various factors such as bandwidth, latency, and packet loss rate in our node selection process. The bandwidth can be the difference between the peak bandwidth of the nodes and the actual bandwidth used. These parameters can be obtained by sending probe messages to user nodes. In Formula (1), \(\alpha\) represents the weight of bandwidth on the path state, and \(\beta\) represents the weight of round-trip latency on the path state. In practical systems, the values of \(\alpha\) and \(\beta\) need to be adjusted based on specific requirements. \(p_{i}\) represents the packet loss rate to node i and reflects the congestion level of the link. Since the recovery time for packet loss is relatively long, we can use the _sigmoid_ function to characterize its impact on the link state. The _sigmoid_ function is defined in Formula (2); \(p_{0}\) represents the average packet loss rate, which is typically set to 0.03 based on empirical values. The \(\gamma\) factor in the _sigmoid_ function can be adjusted to control the degree of impact that \(p_{i}\) has on the link state. If a certain factor's impact on the link state is not considered, the corresponding weight value can be set to 0. By adjusting the weights and factors in the node selection process, we can prioritize and consider the influence of different factors on the link state. \[sigmoid(x)=1/(1+e^{\gamma\times x}),\text{ }where\text{ }\gamma>0 \tag{2}\]  
Assuming K is the set of candidate nodes obtained from the LNRS, our objective is to select the node with the optimal link state as the next hop relay node from the set of candidate nodes. The measurement of the link state is determined by the calculation formula mentioned earlier, where a higher value indicates a better link state to the corresponding user node. The link state can be periodically probed, calculated, and cached locally, or it can be computed again during node selection to provide a more accurate reflection of the link state.