# An Adaptive Delay-Tolerant Routing Algorithm for Data Transmission in Opportunistic Social Networks
## 3 System Model Design
### The Second-Factor Fuzzy Input: Computation of the Remiating Cache Level  
Congestion control is one of the most important issue in opportunistic networks because of the limited cache space of mobile devices. In general, there are two mainstream ways to effectively implement congestion control: limiting the number of message copies to avoid generating unnecessary packets and deleting unnecessary packets in a timely manner. However, message carriers decide whether to forward data information to its neighbor nodes by analyzing their storage capacity. To this end, the selection of the next hop node is determined by evaluating the membership level of cache space of neighbor nodes. This is equivalent to the phenomenon of congestion can be effectively avoided once the relationship between data information and cache space is determined.  
To avoid data congestion in the data transmission process, DTCM algorithm takes into account the average size of data packets that need to be transmitted, the number of these data packets, and the remaining cache spaces of nodes. We first define \(CR_{(node_{i})}\) as the residual cache ratio, which is the ratio between the remaining cache spaces of \(node_{i}\) and the size of the data packets transmitted to \(node_{i}\), and it is formalized as:  
\[CR_{(node_{i})}=\frac{CS^{rem}_{(node_{i})}}{\sum\limits_{s=1}^{u}{{{m}_{u}} \times{{s}_{i}}}} \tag{5}\]where \(CS^{rem}_{(node_{i})}\) is the remaining cache spaces of \(node_{i}\) and \(u\) represents the total number of messages that received by \(node_{i}\). Moreover, \(nu_{s}\) denotes the number of data packets in the message \(s\), and \(si_{s}\) is the average size of each data packet in the message \(s\). When \(CR_{(node_{i})}\geq 1\), it means that \(node_{i}\) has enough cache spaces to store the data group, and data congestion can be effectively avoided, so \(node_{i}\) can be considered as a candidate for the next hop; otherwise, data congestion may occur in cache spaces of \(node_{i}\), and message copies will not be forwarded to \(node_{i}\).  
With the aim of comparing the storage capacity between each neighbor node, we convert the residual cache ratio \(CR_{(node_{i})}\) to the remaining cache level \(L^{c}_{(node_{i})}\), which can be expressed as:  
\[L^{c}_{(node_{i})}=\frac{CR_{(node_{i})}}{\sum\limits_{k\in R}CR_{(node_{k})}} \tag{6}\]  
where \(R\) is the se of neighbor nodes of \(node_{i}\). The larger the value of \(L^{c}_{(node_{i})}\), the greater the storage capacity from \(node_{i}\) than that from other nodes in the same communication area. Also, to maintain the stability and sustainability of the data transmission process, we set a lower bound on the remaining cache level of mobile nodes \(L^{c}_{\min}\) in the network, and the remaining cache level can be updated to:  
\[L^{re}_{(node_{i},\Delta t)}=\frac{L^{c}_{\min}}{L^{c}_{(node_{c})}} \tag{7}\]  
where \(\Delta t\) represents the time stamp for updating the remaining cache level. Equation (A1) satisfies \(L^{re}_{(node_{i},\Delta t)}\in(0,1]\) when \(L^{c}_{(node_{c})}>L^{c}_{\min}\), which indicates that the cache capacity of the \(node_{i}\) at \(\Delta t\) is greater than the average cache space horizon of network. Otherwise, \(L^{re}_{(node_{i},\Delta t)}>1\) means \(node_{i}\) is not a reliable next hop in the network, with insufficient caching capacity. In other words, data congestion can be effectively controlled in DTCM algorithm by two assumptions: \(CR_{(node_{i})}\geq 1\) and \(L^{re}_{(node_{i},\Delta t)}>1\).