# Joint Location-Dependent Pricing and Request Mapping in ICN-Based Telco CDNs For 5G
## 4 Joint Pricing and Request Mapping
### The Design of LDP Module
```
0:\(\theta_{m}\), \(\hat{\theta}\), \(\sigma_{1}\), \(\sigma_{2}\), \(P_{min}\), \(P_{max}\)
0:\(p_{m}\)
1:if\(\theta_{m}<\sigma_{1}\hat{\theta}\)then
2:\(p_{m}=P_{min}\); // Set the price of site \(m\) as the lowest price
3:elseif\(\sigma_{1}\hat{\theta}\leq\theta_{m}<\sigma_{2}\hat{\theta}\)then
4:\(p_{m}=P_{min}+\frac{P_{max}-P_{min}}{\sigma_{2}\hat{\theta}-\sigma_{1}\hat{ \theta}}\left(\theta_{m}-\sigma_{1}\hat{\theta}\right)\); // Set the price of site \(m\) according to its congestion level based on linear part of the piecewise function in Figure 3
5:elseif\(\theta_{m}\geq\sigma_{2}\hat{\theta}\)then
6:\(p_{m}=P_{max}\); // Set the price of site \(m\) as the highest price
7:endif
8:return\(p_{m}\);
```  
**Algorithm 1** The congestion-aware bandwidth pricing strategy (CABP) algorithm  
On the basis of the CABP strategy, the procedure of LDP is described in Algorithm 2 based on principle (b). Note that the temporal and spatial heterogeneity of traffic patterns of different sites should be taken into account to reduce network congestion [36]. Therefore, the LDP algorithm takes the variation of the sites' congestion level as a key factor that influences the pricing procedure. At the beginning of every price update period (\(T_{LDP}\)), the LDP module first checks the variation of \(\Theta\) to determine whether or not to set the prices to be location-dependent. If the variation is smaller than \(\delta\) (a pre-defined parameter, in this work we set as \(\delta\) = 0.03), \(p_{m}\) (\(\forall m\in M\)) are set to the same value, calculated by running the CABP function with mean value of \(\Theta\) as congestion level and 1 as reference congestion level (line 5). If the variation is larger than \(\delta\), the prices are set to be location-dependent. Figure 3: The relationship between congestion level and bandwidth price. We fuse \(\Theta\) based on the population weighted average method to obtain the reference congestion level \(\hat{\theta}\) (line 7). Note that given \(U_{m}\) as the user number of site \(m\), the population weight of site \(m\) is defined as \(\gamma\). Then, by running the function CABP with \(theta_{m}\) and \(\hat{\theta}\) as the input parameters, \(p_{m}\) is obtained (line 8). \(\sigma_{11},\sigma_{12}\) and \(\sigma_{21},\sigma_{22}\) are set as \(\sigma_{1},\sigma_{2}\), respectively, in the above two cases. ```
0:\(\theta_{m}\), \(\forall m\in M\)
0:\(P\)
1:for Every beginning of \(T_{LDP}\)do
2:if\(var(\Theta)<\delta\)then
3:\(\theta_{avg}=mean(\Theta)\); //Obtain the average value of the sites' congestion level
4:\(\hat{\theta}=1\); //Set 1 as the reference congestion level
5:\(p_{m}=CABP(\theta_{avg},\hat{\theta},\sigma_{11},\sigma_{12})\), \(\forall m\in M\); // Calculate price for every site with \(\theta_{avg}\) as congestion level in CABP
6:else
7:\(\hat{\theta}=\sum_{m=1}^{M}\gamma_{m}\theta_{m}(\gamma_{m}=\frac{U_{m}}{\sum_{ i=1}^{M}U_{i}})\); //Set the data fusion result obtained from population-weighted average method as the reference congestion level
8:\(p_{m}=CABP(\theta_{m},\hat{\theta},\sigma_{21},\sigma_{22}),\forall m\in M\); //Calculate price for site \(m\) with \(\theta_{m}\) as congestion level in CABP
9:endif
10:endfor
11:return\(P=[p_{1},p_{2},...,p_{M}]\);
```  
**Algorithm 2** The LDP Algorithm