## 3 The Network Model  
The Ad Hoc network can be divided into either a flat structure or a hierarchical structure [27]. In the network of the flat structure, all nodes are equal. Such a network structure has good robustness, and the node load in the network is also relatively balanced. But a flat structure encounters efficiency and scalability problems with increased network size. In the hierarchical network, the Ad Hoc network adopts a certain cluster algorithm to form several clusters. Each cluster network consists of a cluster head and several cluster members nodes.  
Clustering is an effective method for solving the scalability of Ad Hoc networks. The hierarchical structure is introduced in the network, and the nodes divided into different layers should take different functions. Also, the utilization of clustering in an Ad Hoc network possesses the advantages of reducing routing overhead, increasing network capacity, and providing scalability. Therefore, the clustering structure plays an important role in network management. In this paper, the clustering structure is used to cluster the nodes so that in the static configuration stage, the cluster head nodes and the nodes within the cluster have their own global routing tables, respectively. When the train runs into a certain cluster, fixed nodes within the cluster are selected for communication. In the dynamic monitoring stage, each cluster head node plays a role in dynamically monitoring the link status. The network topology of the train and trackside nodes is shown in Figure 1.  
As is shown in Figure 1, in urban rail transit wireless Ad Hoc networks, the trackside nodes are arranged linearly along the track and are relatively stationary, the train nodes dynamically travel on the track, and the sink nodes are distributed at stations at both ends of the tunnel. The functions and working methods of each node are as follows:  
1. Train: Performs data transmission with the sink node of the platform. When the train runs within the range of a certain cluster, the nodes within the cluster are responsible for forwarding the messages sent by the train and selecting the most suitable node within the cluster by considering the residual link's lifetime.  
Figure 1: Network topology.  
2. Trackside nodes: Forward data transmitted between trains and stations and storing routing tables for route discovery.
3. Cluster head nodes: Master the routing information of the cluster nodes and are responsible for dynamically monitoring the link status to further determine whether the link needs to be replaced.
4. Sink nodes: The node on the track near the platform serves as a sink node to collect data transmitted by the train and surrounding nodes.  
The dynamic addressing section of this article will select paths based on three types of services with different requirements for delay and packet loss rates. The descriptions of the three services are as follows:  
1. Service 1: It has high requirements for delay and packet loss rate and features high reliability and low delay, such as train operation control service.
2. Service 2: It has higher requirements for packet loss rate and features high reliability. For example, the passenger information service system mainly transmits video information from the ground to the train, with low requirements for delay.
3. Service 3: It has higher requirements for delay, such as the intelligent monitoring of tunnels and other Internet of Things services, which require timely detection of problems within the tunnel.