# Cross-Layer MAC/Routing Protocol for Reliability Improvement of the Internet of Things
## 3 Topological Structure Mesh Routing
### Network Expansion into a Mesh Topology  
Figure 8 shows the process of network expansion into a mesh topology using the TSMR.  
In Figure 8, routers A and B are associated with the PAN constructed by the base station using the TSMR. After joining the PAN, the routers broadcast beacon messages periodically. Routers C and D, which are not yet associated with the network, receive beacon messages from routers A and B. On the receipt of the beacon message, router D transmits  
Figure 8: Process of the proposed network expansion.  
Figure 7: Format of the proposed association-response frame.  
the association-request frame to router B, and router C transmits the association-request message to routers A and B. Router A transmits an association relay message that includes the information of the association-request message received from router C. Router B, which receives association-request frames from two or more routers, aggregates the association-request frames and transmits the association-relay frame to the base station. If the base station receives the association-relay frame, it selects the SD for the router during the inactive period and transmits the association-response frame. The base station selects the SD for the router based on the RSSI field included in the association relay frame or request frame. If the router receives the association response frame, it determines the _short-address_ field in the association-response frame. If the _short address_ field of the received association response frame is the same as its own address, the PAN router initiates communication on the assigned SD.  
Figure 9 shows the format of the proposed association-relay frame.  
In Figure 9, the _parent-network ID_ field represents the network ID of the parent router that received the association-request frame and consists of the raw ID and the column ID. The _short-address_ field indicates the MAC address of the device that transmits the association-request frame. The _leaf ID_ field points to the address assigned to the leaf device. The _RSSI_ field is set to the RSSI value measured when the router receives an association-request frame.  
Figure 10 shows the data transactions of mesh networks configured using the TSMR. In Figure 10, base station BS broadcasts a beacon frame at the superframe starting point. The neighboring router synchronizes with the base station using a beacon frame received from the base station. The router then broadcasts beacon frames in the beacon intervals. All routers receive beacon frames from neighboring routers and determine whether data frames should be received from neighboring routers. If there is no data frame to receive from the neighboring router, the base station and the router switch to sleep mode during the corresponding SD to reduce energy consumption. In addition, to avoid data collisions and congestion, all routers transmit data frames to neighboring routers in the contention free period (CFP). In Figure 10, when Router A transmits data to Router D, Router A uses a beacon frame to notify Router D of the data transmission. Router D may receive the data frame from the CFP allocated by Router A. All routers except A and D switch to power-saving mode during that interval to reduce energy consumption. Router B broadcasts a beacon frame including CFP allocation information when transmitting a data frame to Router C. Router C receives the data frame from Router B during the allocated CFP using the Beacon frame received from Router B.  
Figure 9: Format of the proposed association-relay frame.