# Next-Generation Payment System for Device-to-Device Content and Processing Sharing
## 4 Simulation Study and Numerical Results  
A standalone simulator has been written in C++ for this study. Each video is requested by each mobile user at most once during the simulation. The arrival of the requests to video file \(i\) follows a Poisson process with intensity \(N\,p_{i}/T\), where \(p_{i}\) is the \"popularity\" of video file \(i\), and \(T\) is the duration of simulation. The popularity \(p_{i}\) is, in fact, a probability that has Zipf distribution [50]. The exponent of the Zipf distribution is selected so that the resulting distribution yields the well-known Pareto (90/10) law [51; 52] among the video population. In this manner, 90% of the requests are for the most popular 10% of the contents on the average. In this study, we define 10 popularity classes, where each class has an equal number of mobile users belonging to them. The popularity of each class is determined according to the described Zipf distribution. The mobile users that request each video are selected randomly according to a uniform distribution. This means that on average, \(N\,p_{i}\) mobile users will request video file \(i\), where the popularity class video file \(i\) belongs determines \(p_{i}\), and the arrival of the requests obeys a Poisson process. The simulation parameters are summarized in Table 2. The number of the quality levels of the videos is set to be three. The duration of the video files was taken upon the considerations of Internet dynamics. A typical maximum twitter video length is 140 s; hence, the minimum video size is set to five GOPs (or 10 s) in the short video group while the maximum size is set to be 70 GOPs (or 140 s). Similarly, minimum and maximum values for long videos are set to be 150 GOPs (5 min) and 450 GOPs (15 min), respectively.The quality level a user receives a video depends on the distance of the user to the source it is receiving the content from, whether it be the base station or another user. The threshold for the highest quality level is set to \(d_{1}=90\) m, i.e. the user will receive the highest quality available if its distance to the source is less than 90 m, whereas the threshold for the second quality level is set to \(d_{2}=300\) m.  
A sample topology the simulation is run on is provided in Figure 1. There are six user clusters, representing attraction points where users tend to gather together, each consisting of 10 users, centered around the cluster centers indicated by the small circles and uniformly distributed within the cluster radius, \(r=50\) m. In addition, there are 40 more users that do not belong to any cluster. These are uniformly distributed within the entire cell, which is assumed to be a circular region of radius \(R=500\) m.  
The distributions of the token balance are plotted in Figure 2 for \(c_{b}=0\), 1, and 10. Observe that \(c_{b}=0\) corresponds to current commercial practice in which no extra cost is attached to downloading from a cloud/base station. (In fact, due to the data quotas users \begin{table}
\begin{tabular}{l l} \hline \hline Simulation duration & 5000 s \\ Simulation runs per each data point & 50 \\ Number of video files & 600 \\ Number of Zipf popularity classes & 10 \\ Number of mobile users, \(N\) & 100 \\ Cell radius, \(R\) & 500 m \\ Cluster radius, \(r\) & 50 m \\ Number of clusters & 6 \\ Number of users per cluster & 10 \\ Number of video quality levels & 3 \\ Quality level distance thresholds & \(d_{1}=90\) m, \(d_{2}=300\) m \\ Short video length parameters & \(L_{s,min}=5\) GOPs, \(L_{s,max}=70\) GOPs \\ Long (and seek) video length parameters & \(L_{l,min}=150\) GOPs, \(L_{l,max}=450\) GOPs \\ Group of pictures (GOP) duration & 2 s \\ Seek probability, \(p_{sek}\) & 0.05 \\ Energy loss exponent, \(k\) & 2 \\ Data provision cost coefficient, \(c_{p}\) & \(10^{-4}\) token/m\({}^{2}\) \\ Minimum data provision cost, \(c_{\min}\) & 1 token per GOP \\ Transcoding cost coefficient, \(c_{t}\) & 1 \\ Base station cost coefficient, \(c_{b}\) & varied between 0 and 10 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Simulation parameters.