1 Introduction

The explosively increasing traffic data as well as diverse demands of universal mobile users, resulting from the rapid development of 5G communication technologies, has brought unprecedented pressure to the backhaul links with limited capacity. The table in [1] has demonstrated the enhancement of the next-generation capabilities from IMT-2020 compared with IMT-Advanced. To alleviate such bottleneck, fog computing emerged as an efficient way to compensate for “the last mile”. Caching at the fog node as a solution has received more and more attention, since it can not only reduce the pressure of backhaul links and probability of network congestion, but also decrease the network latency. However, due to the limitation of resource, caching at fog nodes also faces the challenge of being eavesdropped by illegitimate users due to its broadcast nature. Therefore, how to ensure communication confidentiality is of vital importance. Traditional encryption method sacrifices some resources to accomplish secret key management and secret key distribution and requires high computing complexity, which is not affordable for fog nodes with limited resources and computing capability. With respect to this, physical layer security has its advantage by means of channel coding and exploiting the inherent characteristics of wireless media, such as random noise and fluctuate channels.

Recently, physical layer security aided caching schemes have obtained some achievements. Considering balancing file diversity as well as file security, in [2, 3], the hybrid caching placement strategy is proposed to jointly optimize the “most popular content” and “largest content diversity” caching schemes to improve the overall secrecy throughput and secrecy energy efficiency in a static network with multiple randomly located eavesdroppers. A hybrid cache placement scheme for physical layer security in cooperative networks is analyzed in [4] by combining the traditional base station caching, most popular content caching and largest content diversity caching schemes together. In [5], two transmission schemes are analyzed to secure caching-aided communication system from symbol level and bit level respectively. To better adapt to the changes of file popularity, probabilistic caching [6] is proposed. By adopting probabilistic caching strategy, the average secure delivery probability and redundant rate are jointly optimized to maximize achievable transmission rate within a stochastic network in [7]. By taking different file secrecy levels into consideration, probabilistic caching is proposed to achieve a tradeoff between secrecy and delivery in [8]. Except for the well-known Wyner’s wiretap code [9], some other PHY-security technologies have been adopted to secure communication in cache-aided networks. In [10], a secure wiretap coding scheme along with physical layer key generation and authentication method is proposed to cope with the security challenges in heterogeneous IoT with multiple access mobile edge computing networks. A cache-enabled physical layer security method jointly considering transmission and caching placement is proposed in [11] to alleviate the burden of backhaul link and improve communication security by using beamforming and artificial noise design.

However, to the best of our knowledge, the above literature mainly concentrate on communication between the nearest base station and user, sacrificing the cooperative gain for security. Therefore, how to ensure communication confidentiality in a cooperative cache-aided stochastic network with physical layer method needs to be explored, which is the contribution of our work. In this paper, we consider secure communication in cooperative stochastic networks, by jointly design caching placement and secrecy rate to maximize secrecy throughput. The rest of this paper is organized as follows. The system model is described in Section 2. Section 3 analyses the optimization problem, followed by the optimization solution in Section 4 and numerical results in Section 5, and the conclusion is drawn in Section 6.

2 System model and performance matric

We consider a downlink wireless cooperative network, where all the base stations within the concerned area are capable of caching contents, as illustrated in Fig. 1. In our system model, a homogeneous Poisson point process (PPP) of density λ is adopted to describe the distribution of base stations and their locations are denoted by Φ. The base stations within communication scope (the shaded area Ω in Fig. 1) jointly transmit their cached file to the legitimate user requesting that file. Meanwhile, there exists a randomly located eavesdropper attempting to overhear the communication process.

Fig. 1
figure 1

The downlink file delivery process with cooperative base stations in cache aided network coexisting with an eavesdropper in the case of F = 5, M = 2

Assuming each legitimate user can be fully supported by cooperative base stations with maximum available bandwidth. All base stations and user devices are equipped with single antenna, so is the eavesdropper. The base stations have no knowledge of the channel state information for both legitimate users as well as eavesdroppers. The capacity of caching memory for each base station is assumed to be the same, i.e., M files, with the total number of files being F(FM). The set of file index is denoted as \(\mathcal {F}=\{1,2,\dots ,F\}\), and the size of all files is assumed to be the same, which is usually normalized to unit, without loss of generality. Assuming the popularity of files follows Zipf distribution as [6, 8], given by Eq. 1,

$$ {f_{m}} = \frac{{1/{m^{\gamma} }}}{{\sum\nolimits_{i = 1}^{F} {1/{i^{\gamma} }} }},{\text{ }}\quad \quad {\text{ }}m \in {\mathcal{F}}. $$
(1)

γ indicates the skewness of Zipf distribution. m is the index of the requested file, and we assume a smaller index m corresponds to a larger fm. A probabilistic caching strategy is applied for the base stations to independently cache files from each other. Based on the caching probability set P = {p1,p2,...,pF} with the constraints in Eq. 2, each base station randomly caches M files by the probabilistic caching method described in [6].

$$ \begin{array}{l}{{\sum}_{m=1}^{F} p_{m} = M}, \\ {0 \leq p_{m} \leq 1, \quad m \in \mathcal{F}}. \end{array} $$
(2)

Without loss of generality, the legitimate user requesting file m is located at the origin of the polar coordinate \((0,0) \in \mathcal {R}^{2}\), and the location of the k th base station as well as the eavesdropper is denoted as (rb,k,𝜃b,k) and (re,𝜃e), where r and 𝜃 represent the corresponding distance and angle in the polar coordinate. Therefore, the distance between the k th base station and the eavesdropper is calculated as \(r_{j, k}=\sqrt {r_{b, k}^{2}+r_{e, j}^{2}-2 r_{b, k} r_{e, j} {\cos \limits } \left (\theta _{b, k}-\theta _{e, j}\right )}\). The probability of requested file m follows (1). Besides, the base stations which cache file m can be modeled as an independent PPP with density λm = pmλ. And we denote the locations of those base stations within Ω as Ωm, thus \( \cup _{m = 1}^{F}{{\Omega }_{m}} = {\Omega } \).

When the legitimate user requests a file m , the base stations caching file m in Ω will cooperatively transmit file m to user with transmit power Pt in one time slot. The radius of Ω is Rc. The channel gains experienced are modeled as distance-based pathlosses with exponent α along with independent and identically distributed small scale fading coefficients, which are circularly symmetric complex Gaussian distributed with zero mean and unit variance. The cache hit event takes place when there exists at least one base station in Ω caching the requested file, or else the cache miss happens. We set the transmission over backhaul link aside due to the concern of latency.

The received signal to interference plus noise ratio (SINR) at the legitimate user when requesting file m is given by Eq. 3,

$$ SIN{R_{b}^{m}} = \frac{{{P_{t}}|{{\sum\nolimits_{x \in {{\Omega}_{m}}} x }^{- \alpha /2}}{h_{x}}{|^{2}}}}{{{\sigma^{2}}+{\sum\nolimits_{y \in {\Phi}\backslash{\Omega}} y^{- \alpha}{|h_{y}|}^{2} }}}, $$
(3)

where x indicates the distance between the base station caching file m and the legitimate user, which is the corresponding rb in the polar coordinate. Besides, hx represents the small scale channel gains of base stations to the legitimate user. From (3), we can observe that the received SINR at legitimate user is dynamically affected by the caching placement strategy \(\{ {p_{m}}\}_{m = 1}^{F}\).

Due to the random location of eavesdropper, there may exist the condition that the received SINR at eavesdropper is better than that of legitimate user. Therefore, it is necessary to adopt some measures to ensure communication confidentiality. In this paper, we adopt the Wynar’s wiretap code to achieve secure communication, considering its advantage of low computational complexity and low energy consumption over traditional encryption methods and other physical layer solutions. According to the principle of wiretap code, the redundant rate denoted as Re is embedded into the data to ensure security. Besides, the transmitted confidential data rate is denoted as Rs, which is named secrecy rate. Consequently, the transmitted data rate Rt can be expressed as Rt = Re + Rs. Meanwhile, the achievable rate of the main channel (i.e., the channel between base stations and the legitimate user) under unit bandwidth when delivering file m can be calculated by \({C_{b}^{m}} = {\log _{2}}(1 + SIN{R_{b}^{m}})\).

3 Problem formulation

In order to evaluate the security performance under different caching placement strategies as well as secrecy rate, we adopt the secrecy throughput as performance criteria. Under the condition of delivering file m, the expression of secrecy throughput Φm is

$$ {{\Phi}^{m}} = {R_{s}^{m}}{P_{c}^{m}}, $$
(4)

where, \({P_{c}^{m}}\) is connection probability for delivering file m, which is calculated as \({P_{c}^{m}} = \mathrm {P}\{ {C_{b}^{m}} \ge {R_{e}^{m}} + {R_{s}^{m}}|{\mathcal {S}^{m}}\}\mathrm {P}\{{{\mathcal {S}}^{m}}\}\). \({{\mathcal {S}}^{m}}\) is the cache hit event of file m, and \(\mathrm {P}\{{{\mathcal {S}}^{m}}\} = \mathrm {P}\{ |{{\Omega }_{m}} | \ne 0\} \). Therefore, the average network throughput Φ can be described as a weighted sum of secrecy throughput under each file’s delivery and probability of each file being requested. Then, aiming at maximizing Φ, the security aware caching placement optimization problem can be formulated as (5),

$$ \begin{array}{c}{\max {\Phi}={\sum}_{m=1}^{F} f_{m} {\Phi}^{m}}. \\ s.t. \left\{\begin{array}{l}{SINR_{e} \leq {\upbeta}_{e}}, \\ {{\sum}_{m=1}^{F} p_{m} = M}, \\ {0 \leq p_{m} \leq 1, \quad m \in \mathcal{F}}. \end{array}\right. \end{array} $$
(5)

And βe in Eq. 5 is the SINR threshold of eavesdropper recovering confidential files.

Recall the system model in part 2, the density of base stations caching file m is denoted as \({\lambda _{m}} \buildrel {\Delta } \over = {p_{m}}\lambda \). Therefore, when requesting file m, the number of caching hit event follows PPP distribution with density λm, as shown in Eq. 6:

$$ \mathrm{P}\{ n = k\} = \frac{{{e^{- {\lambda_{m}}}}{\lambda_{m}}^{k}}}{{k!}}. $$
(6)

Accordingly, the cache hit probability \(\mathrm {P}\{{{\mathcal {S}}^{m}}\}\) can be expressed by Eq. 7,

$$ \begin{aligned} \mathrm{P}\{{{\mathcal{S}}^{m}}\} &= \mathrm{P}\{ |{{\Omega}_{m}}| \ne 0\} \\ &= 1 - \mathrm{P}\{ N = 0\} \\ &= 1 - {e^{- \lambda {p_{m}}\pi {R_{c}}^{2}}}. \end{aligned} $$
(7)

Consequently, with given communication area Ω and base station density λ, the cache hit probability is affected by the caching probabilities of different files.

On the other hand, when delivering file m, the connection probability \({P_{c}^{m}}\) can be derived by Eq. 8, where, \({\tau _{m}} \buildrel {\Delta } \over = {2^{{{R_{t}^{m}}}}} - 1\).

$$ \begin{aligned} {P_{c}^{m}} &=\mathrm{P}\left\{\log_{2}\left( 1+SIN{R_{b}^{m}}\right) \geq {R_{t}^{m}} | \mathcal{S}^{m}\right\}\mathrm{P}\{{{\mathcal{S}}^{m}}\} \\ &=\mathrm{P}\left\{SIN{R_{b}^{m}} \geq \tau_{m} | \mathcal{S}^{m}\right\}\mathrm{P}\{{{\mathcal{S}}^{m}}\}. \end{aligned} $$
(8)

In the interference-limited scenario, compared with the interference power, the noise power is very small and thus can be neglected. Therefore,

$$ \begin{aligned} {P_{c}^{m}} &=\mathrm{P}\left\{SI{R_{b}^{m}} \geq \tau_{m} | \mathcal{S}^{m}\right\}\mathrm{P}\{{{\mathcal{S}}^{m}}\}\\ &=\mathrm{P}\{{P_{t}}|{{\sum\nolimits_{x \in {{\Omega}_{m}}} x^{- \alpha /2}{h_{x}} }}|^{2} \geq \tau_{m} I\}\mathrm{P}\{{{\mathcal{S}}^{m}}\}\\ &\buildrel (a) \over =\mathrm{E}_{x,I}[e^{({\sum\nolimits_{k \in |{{\Omega}_{m}}|} x_{k}^{- \alpha} })^{-1}\tau_{m} I}]\\ &\buildrel (b) \over=\mathrm{E}_{x}[\mathcal L_{I}(\frac{\tau_{m}}{{{\sum}_{k=1 }^{K} x_{k}^{- \alpha} }})]\\ &\buildrel (c) \over=\mathrm{E}_{x}[e^{-sI}]\\ &=\mathrm{E}_{x}[e^{-s{\sum\nolimits_{y \in {\Phi}\backslash{\Omega}} y^{- \alpha}{|h_{y}|}^{2} }}]\\ &=\mathrm{E}_{x}[\prod\limits_{y \in {\Phi}\backslash{\Omega}}e^{-s{|h_{y}|}^{2}y^{- \alpha}}]\\ &=\mathrm{E}_{x}[\prod\limits_{y \in {\Phi}\backslash{\Omega}}{\mathrm{E}_{{|h_{y}|}^{2}}[e^{-s{|h_{y}|}^{2}y^{- \alpha}}}]]\\ &\buildrel (d) \over=\mathrm{E}_{x}[\prod\limits_{y \in {\Phi}\backslash{\Omega}}e^{\frac{1}{1+sy^{- \alpha}}}]\\ &=\mathrm{E}_{x}[exp(-2\pi\lambda{\int}_{R_{c}}^{+\infty}{\frac{sr^{-\alpha}}{1+sr^{-\alpha}}rdr})]\\ &\buildrel (e) \over=\mathrm{E}_{x}[-\pi\lambda s^{\frac{2}{\alpha}}{\int}_{{R_{c}^{2}}s^{\frac{-2}{\alpha}}}^{+\infty}{\frac{1}{1+w^{\frac{\alpha}{2}}}dw}]. \end{aligned} $$
(9)

Noticing that (a) holds for \(|{{\sum \nolimits _{x \in {{\Omega }_{m}}} x^{- \alpha /2}{h_{x}} }}|^{2} \sim exp(\frac {1}{{{\sum }_{x \in {{\Omega }_{m}}} x^{- \alpha } }})\) and \(I={\sum \nolimits _{y \in {\Phi }\backslash {\Omega }} y^{- \alpha }{|h_{y}|}^{2} }\); (b) is the Laplace transform of I; (c) holds for \(s = \frac {\tau _{m}}{{{\sum }_{k=1 }^{K} x_{k}^{- \alpha } }}\), and (d) holds for \(|h_{y}|^{2} \sim exp(1)\). When α = 4, we can have

$$ \begin{aligned} {\int}_{{R_{c}^{2}}s^{\frac{-2}{\alpha}}}^{+\infty}{\frac{1}{1+w^{\frac{\alpha}{2}}}dw}&=\frac{\pi}{2}-arctan({R_{c}^{2}}s^{-\frac{1}{2}}). \end{aligned} $$
(10)

Substituting (10) into (9), the connection probability \({P_{c}^{m}}\) is

$$ {P_{c}^{m}}\!=\mathrm{E}_{x}[exp(-\pi\lambda(\frac{\tau_{m}}{{\sum}_{k=1}^{K}{x_{k}^{-\alpha}}})^{\frac{2}{\alpha}}(\frac{\pi}{2}-arctan({R_{c}^{2}}s^{-\frac{1}{2}})))]. $$
(11)

We mark the distance between the legitimate user and the nearest base station hitting file m is z. Therefore, \({{\sum }_{k=1}^{K}{x_{k}^{-\alpha }}}={z^{-\alpha }}+{{\sum }_{x \in {\Omega }_{m} \backslash z}{x^{-\alpha }}}\). According to [12], the expectation of \(D_{m}\buildrel {\Delta } \over ={{\sum }_{x \in {\Omega }_{m} \backslash z}{x^{-\alpha }}}\) is given as

$$ \begin{aligned} \mathrm{E}[D_{m}]&=\mathrm{E}[{\sum\limits_{x \in {\Omega}_{m} \backslash z}{x^{-\alpha}}}]\\ &=2\pi p_{m}\lambda {\int}_{z}^{R_{c}}{z^{-\alpha+1}dz}\\ &=\frac{2\pi p_{m}\lambda}{\alpha-2}(z^{2-\alpha}-R_{c}^{2-\alpha}). \end{aligned} $$
(12)

Due to the fact that \(arctan(\frac {1}{x})+arctan(x)=\frac {\pi }{2}\), and substituting (7) and (12) into (11), the final expression of \({P_{c}^{m}}\) is given as

$$ \begin{array}{@{}rcl@{}} &&{P_{c}^{m}}=2\pi p_{m}\lambda {\int}_{0}^{R_{c}}{zexp(-\pi\lambda s^{\frac{2}{\alpha}}arctan(R_{c}^{-2}s^{\frac{1}{2}})}\\ &&\quad\qquad{-\pi p_{m}\lambda z^{2})}dz, \end{array} $$
(13)

where, \(s=\frac {\tau _{m}}{z^{-\alpha }+\frac {2\pi p_{m}\lambda }{\alpha -2}{(z^{2-\alpha }-R_{c}^{2-\alpha })}}\).

When \(R_{c}^{-2}s^{\frac {1}{2}} < 1\), \(arctan(R_{c}^{-2}s^{\frac {1}{2}})\approx R_{c}^{-2}s^{\frac {1}{2}}\). As a result, \({P_{c}^{m}}\) can be approximated as

$$ {P_{c}^{m}}\approx 2\pi p_{m}\lambda {\int}_{0}^{R_{c}}{zexp(-\pi\lambda s^{\frac{2}{\alpha}}R_{c}^{-2}s^{\frac{1}{2}}-\pi p_{m}\lambda z^{2})}dz. $$
(14)

And substituting (14) into (4), the average secrecy throughput Φ can be derived by

$$ \begin{array}{@{}rcl@{}} &&{\Phi} \approx \sum\limits_{i=1}^{F}{2\pi p_{m}\lambda f_{m} {R_{s}^{m}} {\int}_{0}^{R_{c}}{zexp(-\pi\lambda s^{\frac{2}{\alpha}}R_{c}^{-2}s^{\frac{1}{2}}}}\\ &&\quad\quad{{-\pi p_{m}\lambda z^{2})}dz}. \end{array} $$
(15)

4 Optimization strategy

From equation (15), we can observe that the average secrecy throughput dynamically varies with the transmitting data rate \({R_{t}^{m}}\) (i.e. \({R_{e}^{m}}\) and \({R_{s}^{m}}\)) and the caching placement probabilities \(\{ {p_{m}}\}_{m = 1}^{F}\). To maximize the average network throughput Φ in Eq. 5 is the same as maximizing Φm, since the concavity of function will not be affected by the weighted sum function. According to (4), assuming that the secrecy rate \({R_{s}^{m}}\) is given, in order to maximize Φm, we can improve the connection probability \({P_{c}^{m}}\). Based on the definition of connection probability, \({P_{c}^{m}} = \mathrm {P}\{ {C_{b}^{m}} \ge {R_{e}^{m}} + {R_{s}^{m}}|{{\mathcal {S}}^{m}}\}\mathrm {P}\{{{\mathcal {S}}^{m}}\}\), the more base stations participate in transmission cooperation, the larger \({P_{c}^{m}}\) is, which means the probabilities of different files should be distinct. However, when the probabilities of different files are distinctly different, \(\mathrm {P}\{{{\mathcal {S}}^{m}}\}\) is lower according to (7), corresponding to less diversity. Therefore, there exists a tradeoff between the connection probability and cache hit probability under given transmitting data rate.

Similarly, there is another tradeoff under fixed caching probability. With given caching probability, \(\mathrm {P}\{{{\mathcal {S}}^{m}}\}\) is fixed. Denoting \({\omega ^{m}} \buildrel {\Delta } \over = {R_{s}^{m}}\mathrm {P}\{ {C_{b}^{m}} \ge {R_{e}^{m}} + {R_{s}^{m}}|{{\mathcal {S}}^{m}}\}\), thus both the redundant rate \({R_{e}^{m}}\) and secrecy rate \({R_{s}^{m}}\) can influence ωm. However, \({R_{e}^{m}}\) can only affect \({P_{c}^{m}}\). Therefore, in order to maximize ωm, we need to set \({R_{e}^{m}}\) as small as possible. On the other hand, to make sure of secure communication, the constraints \(SIN{R_{e}^{m}} \le {{{\upbeta }_{e}^{m}}}\) leads to the optimal value of \({R_{e}^{m}}\) being \({R_{e}^{0}} \buildrel {\Delta } \over = {\log _{2}}(1 + SIN{R_{e}^{m}})\). Hence, with the given caching probability and optimal redundant rate, to improve secrecy throughput, the secrecy data rate \({R_{s}^{m}}\) should be improved. However, the larger \({R_{s}^{m}}\) will lead to a smaller \({P_{c}^{m}}\). Therefore, our optimization goal is to find an optimal caching probability and secrecy rate to balance the tradeoffs and achieve an optimal average secrecy throughput performance.

The optimization problem in Eq. 5 is proved to be a non-convex problem. To simplify the optimization problem, a two-stage solution is proposed based on the above analysis to jointly optimize \({P_{c}^{m}}\) and \({R_{s}^{m}}\). The first stage is to optimize \(\{ {p_{m}}\}_{m = 1}^{F}\) for maximizing \({P_{c}^{m}}\) with fixed \({R_{s}^{m}}\). When Rc is large enough, s can be approximated as \(s=\frac {\tau _{m}}{\pi p_{m} \lambda z^{-2}}\). Hence, \({P_{c}^{m}}\) can be further approximated by

$$ \begin{aligned} {P_{c}^{m}} &\approx 2\pi {p_{m}}\lambda {\int}_{0}^{R_{c}} {z e^{(\frac{-\tau_{m}}{{R_{c}^{2}} p_{m}}-\pi p_{m} \lambda)z^{2}}} dz\\ &= \frac{\pi {p_{m}^{2}} \lambda {R_{c}^{2}}}{\pi {p_{m}^{2}} \lambda {R_{c}^{2}}+\tau_{m}}. \end{aligned} $$
(16)

Therefore, (15) can be simplified as (17),

$$ {\Phi} = \sum\limits_{m=1}^{F}{f_{m} {R_{s}^{m}} \frac{\pi \lambda {R_{c}^{2}} {p_{m}^{2}}}{\pi \lambda {R_{c}^{2}} {p_{m}^{2}}+\tau_{m}}}. $$
(17)

By analyzing the second derivative of Φ, we can solve the optimization problem in two cases. And by adopting Lagrangian method [13], the optimized probability, denoted as \({\{p_{m}^{opt}\}}_{m=1}^{F}\), can be derived by

$$ p_{m}^{opt} = min\{[\frac{\sqrt{\frac{2\sqrt{z}-\sqrt[3]{z_{1}}-\sqrt[3]{z_{2}}}{3}}-\sqrt{\frac{\sqrt[3]{z_{1}}+\sqrt[3]{z_{2}}}{3}}}{4\pi\lambda {R_{c}^{2}}}]^{+} ,1\}, $$
(18)

where, \(z_{1,2}=\frac {-3B\pm 3\sqrt {B^{2}-4AC}}{2}, z=(\sqrt [3]{z_{1}}+\sqrt [3]{z_{2}})^{2}-3A\). And \(A=192\pi \lambda \tau _{m} {R_{c}^{2}}\), \(B=72\pi \lambda {R_{c}^{2}} t\), \(C=-64\pi \lambda \tau _{m} {R_{c}^{2}}\), \(t=\sqrt {\frac {2\pi \lambda \tau _{m} f_{m} {R_{c}^{2}}}{w+\mu _{m}}}\).

Based on the given \(\{p_{m}^{opt}\}_{m=1}^{F}\), we then optimize \({R_{s}^{m}}\) by maximizing Φm, assuming all files have identical secrecy rate. Set the first derivation of Eq. 17 to zero and the optimized secrecy rate \(R_{s}^{opt}\) can be derived by

$$ \frac{{d{{\Phi}^{m}}}}{{d{R_{s}^{m}}}} = 0. $$
(19)

Substituting (4) and \({\tau } \buildrel {\Delta } \over = {2^{{R_{s}}+{{R_{e}^{0}}}}} - 1\) into (19), \(R_{s}^{opt}\) can be derived by

$$ \lambda \pi {R_{c}^{2}} {p_{m}^{2}}+2^{{R_{e}^{0}}+R_{s}^{opt}}(1-ln2 R_{s}^{opt})=0. $$
(20)

Due to the complexity of Eq. 20, we can use bisection method to get \(R_{s}^{opt}\). The pseudo-code is shown in Algorithm 1. Accordingly, we iteratively optimize the problem following (16) and (19) until achieving the maximization of the average network throughput Φopt.

figure a

5 Numerical analysis

In this section, we evaluate the performance of the proposed security aware caching placement optimization strategy, with respect to the successful connection probability and average network secrecy throughput. The settings of simulation parameters are depicted as Table 1.

Table 1 Parameter settings of simulation

The successful connection probability is analyzed in Fig. 2 to validate the theoretical results by evaluating different communication radius Rc and different secrecy rate Rs. From Fig. 2, we can observe that the theoretical successful connection probability results derived in (15) matches well with the Monte-Carlo simulation results, especially when Rc is small comparing with Φ. Besides, the approximation results in (16) can well depicts the tendency of successful connection probability, too. With fixed secrecy rate, a larger communication radius leads to a larger successful connection probability. That’s because the larger communication radius means more base stations can participate in file delivery cooperation, thus can improve the signal to interference plus noise ratio at the legitimate receiver, assuming that the communication security can be guaranteed by adopting a proper redundant rate. And the successful connection probability decreases as the secrecy rate increases, which is consistent with (15).

Fig. 2
figure 2

The successful connection probability Pc under different secrecy rates Rs and communication radius Rc, with given probabilistic caching scheme M = 1,F = 1,γ = 1

Figure 3 compares the optimal probabilistic caching scheme with two baseline schemes, namely, the uniform caching scheme and the most popular file (MPF) caching scheme under different file popularity skewness parameter γ, when the total file amount is 5 and caching capacity is 2. The Pc of MPF caching and optimal probabilistic caching varies from different skewness parameters while the Pc of uniform caching remains unchanged, because the caching probabilities of uniform caching don’t depend on file popularity while the other two caching schemes do. On the other hand, the optimal probabilistic caching scheme always performs better than the other baseline schemes. Besides, when the skewness parameter is high, MPF caching scheme is closer to the proposed optimal probabilistic caching scheme, and vice versa for a low skewness parameter. The reason is that the caching probabilities in probabilistic is more flexible and thus can better adjust to the change of file popularity than the other two baseline schemes.

Fig. 3
figure 3

The successful connection probability comparison of three caching schemes, i.e., Uniform caching, MPF caching and optimal probabilistic caching scheme, under different skewness parameter γ of file popularity when M = 2,F = 5

The relationship between secrecy throughput Φ and secrecy rate Rs is evaluated in Fig. 4 under different redundant rate Re. From Fig. 4 we can draw a conclusion that with the increase of Rs, Φ first increases to a maximum value and then decreases, which means we can find an optimal secrecy rate to maximize the average secrecy throughput. On the other hand, the larger redundant rate will lead to a smaller average secrecy throughput, due to the connection probability decreases as Re increases. Therefore, the stronger the decoding capability of eavesdropper, the worse the secrecy throughput performance is.

Fig. 4
figure 4

The relationship between secrecy throughput Φ and secrecy rate Rs under different redundant rate Re

6 Conclusions

This paper has investigated joint optimization of physical layer security and caching placement strategy in a cooperative network with randomly distributed base stations, coexisting with a randomly located eavesdropper. We first describe the cooperative communication system model. Then, the caching placement strategy is analyzed by adopting stochastic geometry to deal with the connection probability. With the purpose of maximizing average secrecy throughput, the redundant rate is embedded into the transmitted data and the caching probability and secrecy rate are iteratively optimized by our proposed algorithm. The numerical analysis has validated our theoretical analysis and the outperformance of the proposed algorithm over the other two baseline algorithms has been demonstrated.