<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article  PUBLIC "-//NLM//DTD Journal Publishing DTD v3.0 20080202//EN" "http://dtd.nlm.nih.gov/publishing/3.0/journalpublishing3.dtd"><article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="3.0" xml:lang="en" article-type="research article"><front><journal-meta><journal-id journal-id-type="publisher-id">IJCNS</journal-id><journal-title-group><journal-title>International Journal of Communications, Network and System Sciences</journal-title></journal-title-group><issn pub-type="epub">1913-3715</issn><publisher><publisher-name>Scientific Research Publishing</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="doi">10.4236/ijcns.2017.108B018</article-id><article-id pub-id-type="publisher-id">IJCNS-78393</article-id><article-categories><subj-group subj-group-type="heading"><subject>Articles</subject></subj-group><subj-group subj-group-type="Discipline-v2"><subject>Computer Science&amp;Communications</subject></subj-group></article-categories><title-group><article-title>
 
 
  A Safety Relay Selection Method Based on Network Coding
 
</article-title></title-group><contrib-group><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Qiang</surname><given-names>Guo</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref></contrib><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Xin</surname><given-names>Li</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref></contrib></contrib-group><aff id="aff1"><addr-line>College of Information and Communication Engineering, Harbin Engineer University, Harbin, China</addr-line></aff><pub-date pub-type="epub"><day>14</day><month>08</month><year>2017</year></pub-date><volume>10</volume><issue>08</issue><fpage>167</fpage><lpage>175</lpage><history><date date-type="received"><day>May</day>	<month>28,</month>	<year>2017</year></date><date date-type="rev-recd"><day>Accepted:</day>	<month>August</month>	<year>11,</year>	</date><date date-type="accepted"><day>August</day>	<month>14,</month>	<year>2017</year></date></history><permissions><copyright-statement>&#169; Copyright  2014 by authors and Scientific Research Publishing Inc. </copyright-statement><copyright-year>2014</copyright-year><license><license-p>This work is licensed under the Creative Commons Attribution International License (CC BY). http://creativecommons.org/licenses/by/4.0/</license-p></license></permissions><abstract><p>
 
 
  
    A method of cooperative relay selection based on network coding security is proposed for relay selection problem of cooperative communication system security in networked multi-relay scenarios, which is different from the existing relay node selection method. The algorithm not only merged with timestamp and homomorphic signature to construct the node degree of safety to find reliable relay, at the same time to considers the received signal to noise ratio at all relay nodes value and the channel gain to the source node. The simulation results show that the proposed method can improve the achievable rate of the destination node and reduce the outage probability on the basis of guaranteeing the safety of the relay node. 
  
 
</p></abstract><kwd-group><kwd>Timestamp</kwd><kwd> Homomorphic Signature</kwd><kwd> Node Degree of Safety</kwd><kwd> Achievable Rate</kwd><kwd> Outage Probability</kwd></kwd-group></article-meta></front><body><sec id="s1"><title>1. Introduction</title><p>The network coding technology has attracted wide attention because of the advantages of throughput and transmission delay minimization, and can balance the network load, solve the network congestion and improve the network bandwidth utilization [<xref ref-type="bibr" rid="scirp.78393-ref1">1</xref>]. The broadcast characteristics of wireless communication channel transmission make network coding technology more suitable for application to wireless cooperative relay communication network, which can further improve spectrum efficiency and system capacity. But at the same time it also brings a lot of security issues [<xref ref-type="bibr" rid="scirp.78393-ref2">2</xref>], because the principle of the network coding itself, information diffusivity is stronger, so compared with the ordinary network, in this case the attacker as long as the injection of small malicious information or a slight modification of the relevant information may affect a range or even the entire network. That is to say, the same attack means, in the mode of the network more efficient attack, more contagious, so for the secure communication relay node selection algorithm research is another focus of collaborative communication [<xref ref-type="bibr" rid="scirp.78393-ref3">3</xref>]. In this paper, we study the situation of selecting cooperative relay for the source node in the multi-relay scenario, analyze the security and validity of the relay selection problem in this case, combined use of fusion timestamp and homomorphic signature security detection algorithm and the optimal intermediate node selection scheme, a secure and effective multipath selection algorithm based on network coding is proposed, this method cannot only guarantee the security of data transmission, to further improve the performance of the system.</p></sec><sec id="s2"><title>2. Fusion Timestamp and Homomorphic Signature Security Calculation</title><p>Due to the network coding is very vulnerable to the malicious modification of the packet by the attacker in the network, thus the obtaining-information node has the influence on the decoding of the correct packet. If the attacker repeats the malicious information which is not related to the correct data, it will cause enormous waste of network resources, this paper designs a network coding scheme that combines time-stamp and homomorphic signatures to resist pollution attacks and replay attacks on the basis of RSA homomorphic signature scheme [<xref ref-type="bibr" rid="scirp.78393-ref4">4</xref>]. The scheme introduces the pollution attack and replay attack as a link of safety indicators on the basis of the basic dynamic weight calculation formula. The RSA signature is used to detect the pollution attack, and the time stamp mechanism is introduced so that the scheme can detect the replay attack, Find the optimal security node of the network coding algorithm.</p><sec id="s2_1"><title>2.1. The System Model</title><p>“<xref ref-type="fig" rid="fig1">Figure 1</xref>” and “<xref ref-type="fig" rid="fig2">Figure 2</xref>” show the system model. In the system there is a source node s, A destination node d, and relay node followed by<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x2.png" xlink:type="simple"/></inline-formula>. The relay node uses half-duplex mode to forward the signal, Received signal using amplify-and-forward, AF approach.</p></sec><sec id="s2_2"><title>2.2. The Specific Algorithm</title><p>There are three parts of the homomorphic signature scheme with timestamps,</p><fig id="fig1"  position="float"><label><xref ref-type="fig" rid="fig1">Figure 1</xref></label><caption><title> The source node sends</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/78393x3.png"/></fig><fig id="fig2"  position="float"><label><xref ref-type="fig" rid="fig2">Figure 2</xref></label><caption><title> Relay nodes forward</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/78393x4.png"/></fig><p>which are asymmetric key generation algorithm, signature generation algorithm and signature verification algorithm respectively.</p><p>Asymmetric key generation algorithm [<xref ref-type="bibr" rid="scirp.78393-ref5">5</xref>]:</p><p>・ Randomly select two large prime numbers<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x5.png" xlink:type="simple"/></inline-formula>, <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x6.png" xlink:type="simple"/></inline-formula>among them <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x7.png" xlink:type="simple"/></inline-formula> Usually take <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x8.png" xlink:type="simple"/></inline-formula> for 256 bit, take <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x9.png" xlink:type="simple"/></inline-formula> for 1024 bit.</p><p>・ Calculation<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x10.png" xlink:type="simple"/></inline-formula>, <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x11.png" xlink:type="simple"/></inline-formula>Randomly select integers <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x12.png" xlink:type="simple"/></inline-formula>, and Satisfy:</p><disp-formula id="scirp.78393-formula279"><label>(1)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/78393x13.png"  xlink:type="simple"/></disp-formula><p>・ Generates the RSA signature key d and the public key <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x14.png" xlink:type="simple"/></inline-formula> Where d is satisfied:</p><disp-formula id="scirp.78393-formula280"><label>(2)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/78393x15.png"  xlink:type="simple"/></disp-formula><p>Signature generation algorithm:</p><p>・ The source node generates m messages to be sent: <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x16.png" xlink:type="simple"/></inline-formula>(<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x17.png" xlink:type="simple"/></inline-formula>).</p><p>・ Takes the current timestamp t as the timestamp of the message and generates a signature for the message and timestamp, The signature is denoted by<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x18.png" xlink:type="simple"/></inline-formula>:</p><disp-formula id="scirp.78393-formula281"><label>(3)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/78393x19.png"  xlink:type="simple"/></disp-formula><p>r is the source private key, d is the source public key, and <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x20.png" xlink:type="simple"/></inline-formula> is the public parameter of the source.</p><p>Signature verification algorithm:</p><p>・ The intermediate node receives a message<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x21.png" xlink:type="simple"/></inline-formula>, To determine whether Equation (4) was established:</p><disp-formula id="scirp.78393-formula282"><label>(4)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/78393x22.png"  xlink:type="simple"/></disp-formula><p>・ If Equation (4) is established, shows the message isn’t subject to pollution attacks, go to the next step, if the formula 2 don’t hold, indicating that the message received pollution attacks, the intermediate node should discard this message.</p><p>・ By the time stamp to determine whether the replay attack, if a message timestamp within the scope of the time, it indicates that the message has not been replayed, otherwise, this message should be discarded.</p></sec><sec id="s2_3"><title>2.3. Security Degree Calculation</title><p>Assuming that all links can be attacked, the introduction of pollution attack and replay attack as an index to calculate the intermediate node security degree on the basis of the basic dynamic weight calculation formula, find the appropriate intermediate node for data transmission, to ensure the security of network coding.</p><p>The initial the safety degree of the intermediate node s assignment to 1, Intermediate node degree of security calculation:</p><disp-formula id="scirp.78393-formula283"><label>(5)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/78393x23.png"  xlink:type="simple"/></disp-formula><p>N represents the total number of messages sent by node i, <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x24.png" xlink:type="simple"/></inline-formula>indicates the number of contaminated attacks on node i, <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x24.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x25.png" xlink:type="simple"/></inline-formula>indicates the number of replay attacks by node i, <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x24.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x25.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x26.png" xlink:type="simple"/></inline-formula>is used to measure the degree of pollution attack and replay in node i:</p><disp-formula id="scirp.78393-formula284"><label>(6)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/78393x27.png"  xlink:type="simple"/></disp-formula><disp-formula id="scirp.78393-formula285"><label>(7)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/78393x28.png"  xlink:type="simple"/></disp-formula><p>Due to the uncertainty of the network, the dynamic threshold is introduced to calculate the security of the current intermediate nodes. The threshold chosen by this algorithm is the weighted sum of the highest security degrees of each node for a period time. As shown in Equation (8):</p><disp-formula id="scirp.78393-formula286"><label>(8)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/78393x29.png"  xlink:type="simple"/></disp-formula><p><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x30.png" xlink:type="simple"/></inline-formula>represents the maximum value of the safety of the intermediate node j over a period of time, <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x30.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x31.png" xlink:type="simple"/></inline-formula>set of dynamic threshold, The safety of the intermediate node satisfies<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x30.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x31.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x32.png" xlink:type="simple"/></inline-formula>, This node as a preselected node.</p></sec><sec id="s2_4"><title>2.4. Security Analysis</title><p>Focuses on Pollution attacks and Replay attacks [<xref ref-type="bibr" rid="scirp.78393-ref6">6</xref>].</p><p>・ Security Analysis of Pollution Attack: There are two kinds of attacks on pollution attacks. 1) The attacker can forge the received packet (Y, T), and intention to forge the packets to generate valid signatures, but because the attacker doesn’t know the source node to the private key, so I can’t to packets (Y, T) generates valid signatures, attacks a failure. 2) The attacker intends to generate the fake data <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x33.png" xlink:type="simple"/></inline-formula> with the valid signature <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x33.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x34.png" xlink:type="simple"/></inline-formula> of the intercepted packet, and<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x33.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x34.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x35.png" xlink:type="simple"/></inline-formula>, the difficulty of such attack mode is equivalent to solve the problem of discrete logarithm.</p><p>・ Security analysis of Replay Attack: There are two kinds of attacks on replay attacks. 1) Directly replay the intercepted message combination, assuming that the attacker intercepts the message with <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x36.png" xlink:type="simple"/></inline-formula> and the node receives the message and sends the received timestamp with the current time<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x36.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x37.png" xlink:type="simple"/></inline-formula>, In comparison, if it is not within the scope of limitation, it can be judged that the message is a replay message and the attack is invalid. 2) Modify the timestamp of the intercepted message and generate a signature for it. The attacker can’t sign the part of the intercepted message because he does not know the private key of the source node, so the attack is invalid.</p></sec></sec><sec id="s3"><title>3. Optimal Relay Node Selection Scheme</title><p>The selection of the relay node is the key factor that affects the final transmission quality. Selecting the optimal relay node can not only reduce the network cost, but also improve the performance of the communication system. In this paper, from the point of view of system achievable rate and outage probability, combined with the intermediate nodes selected in Chapter 2, calculating the received signal-to-noise ratio of the intermediate node in the direction of the source node to the intermediate node and comparing the decision threshold with the set signal-to-noise ratio, selecting the intermediate node satisfying the condition, an intermediate node having the largest channel gain among the intermediate node and the destination node link is selected from the candidate node set.</p><sec id="s3_1"><title>3.1. Multi-Relay System Model</title><p>The channels are quasi-static Rayleigh fading channels, the channel state remains unchanged during one transmission cycle. For each “source node-relay node-destination node” link, the total power of the signal transmission is limited to p, the source node occupies half of the total power, the residual power is distributed equally by the relay node, and between the two source nodes there is no forward link [<xref ref-type="bibr" rid="scirp.78393-ref7">7</xref>].<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x38.png" xlink:type="simple"/></inline-formula>, <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x38.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x39.png" xlink:type="simple"/></inline-formula>respectively represent the channel fading coefficients of the source node S to the i-th relay node and the i-th relay node to the destination node d, <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x38.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x39.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x40.png" xlink:type="simple"/></inline-formula>, <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x38.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x39.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x40.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x41.png" xlink:type="simple"/></inline-formula>mean is zero, Complex Gaussian Random Variables with Variance of <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x38.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x39.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x40.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x41.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x42.png" xlink:type="simple"/></inline-formula> and<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x38.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x39.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x40.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x41.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x42.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x43.png" xlink:type="simple"/></inline-formula>. Each link is affected by additive white Gaussian noise<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x38.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x39.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x40.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x41.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x42.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x43.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x44.png" xlink:type="simple"/></inline-formula>, and its mean is zero variance of 1. The whole model uses time division mode, completed in two time slots.</p><p>In the first time slot, the source node S transmits the signal x at the power<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x45.png" xlink:type="simple"/></inline-formula>. The signal received by the relay node <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x45.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x46.png" xlink:type="simple"/></inline-formula> is represented as:</p><disp-formula id="scirp.78393-formula287"><label>(9)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/78393x47.png"  xlink:type="simple"/></disp-formula><p>In the second time slot, the relay node <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x48.png" xlink:type="simple"/></inline-formula> broadcasts the received signal network to the destination node d. The destination node receives the signal as:</p><disp-formula id="scirp.78393-formula288"><label>(10)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/78393x49.png"  xlink:type="simple"/></disp-formula><p>The relay node <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x50.png" xlink:type="simple"/></inline-formula> adopts the AF protocol, then A is the amplification factor,</p><p><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x51.png" xlink:type="simple"/></inline-formula>, <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x51.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x52.png" xlink:type="simple"/></inline-formula>is the forwarding power of the relay node<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x51.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x52.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x53.png" xlink:type="simple"/></inline-formula>.</p><p>So to get the destination node to accept SNR expression:</p><disp-formula id="scirp.78393-formula289"><label>(11)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/78393x54.png"  xlink:type="simple"/></disp-formula></sec><sec id="s3_2"><title>3.2. Relay Selection Method Specific Step Description</title><p>In this paper, the relay node selection scheme is used to set the SNR threshold at each intermediate node. After two selections, select the most optimal relay nodes. The specific steps are as follows:</p><p>・ A reasonable threshold value <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x55.png" xlink:type="simple"/></inline-formula> for receiving the SNR is set in the system, In the previous section, the received SNR at the intermediate node in the source-middle node direction is given as<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x55.png" xlink:type="simple"/></inline-formula><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x56.png" xlink:type="simple"/></inline-formula>. we can get some preselected nodes according to Equation (12):</p><disp-formula id="scirp.78393-formula290"><label>(12)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/78393x57.png"  xlink:type="simple"/></disp-formula><p>The set of candidate nodes expressed as <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x58.png" xlink:type="simple"/></inline-formula></p><p>・ Select the relay node with the largest channel gain in the direction of the intermediate node-destination node, which satisfies the Equation (13):</p><disp-formula id="scirp.78393-formula291"><label>(13)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/78393x59.png"  xlink:type="simple"/></disp-formula><p>The optimal relay selection scheme takes into account the received SNR at the relay node and selects the maximum channel gain at the destination node.</p></sec><sec id="s3_3"><title>3.3. Effectiveness Analysis</title><p>In order to verify the validity of the relay selection scheme used in this article, and the maximized minimum SNR relay selection scheme in [<xref ref-type="bibr" rid="scirp.78393-ref8">8</xref>], the maximized minimum channel gain relay selection scheme in [<xref ref-type="bibr" rid="scirp.78393-ref9">9</xref>] and the random relay selection scheme are carried out from the achievable rate and outage probability performance Simulation comparison. The system uses equal power allocation scheme.</p><p>“<xref ref-type="fig" rid="fig3">Figure 3</xref>” shows the simulation results of the achievable rate of each relay selection method under different total power.</p><fig id="fig3"  position="float"><label><xref ref-type="fig" rid="fig3">Figure 3</xref></label><caption><title> The achievable rate comparison of various relay selection schemes</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/78393x60.png"/></fig><p>Simulation results show, Based on the method of maximizing the received SNR and channel gain, the achievable rate and performance of the cooperative system are compared with the Max-Min relay selection scheme, the channel gain harmonic mean maximum scheme, the random relay selection scheme, respectively, increased by 3.9%, 11.1%, 14.3%.</p><p>“<xref ref-type="fig" rid="fig4">Figure 4</xref>” shows the simulation results of the outage probability of each relay selection method under different total power.</p><p>Under the condition of total system power, the improved two-way relay selection scheme proposed in this paper is the smallest and the best performance in the four relay selection schemes.</p></sec></sec><sec id="s4"><title>4. Simulation Parameter Analysis</title><p>In the existing multi-relay system, the majority of the research on relay selection is based on the assumption that all relay nodes are in the middle of the two source nodes, this article will be more general circumstances to study the proposed program performance.</p><p>“<xref ref-type="fig" rid="fig5">Figure 5</xref>” shows Relay node location. The serial number 1 is the source node, the serial number 12 as the destination node, This paper assumes that the source node sends ten packets, each packet has ten components, for each intermediate node random introduction of pollution attacks and replay attacks, in a period of time, each intermediate node for three times the safety calculation results are as follows “<xref ref-type="table" rid="table1">Table 1</xref>”:</p><p>Select the maximum security for each intermediate node Use Equation (8):</p><p><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/78393x61.png" xlink:type="simple"/></inline-formula>to calculate the dynamic threshold. Get the dynamic threshold</p><p>based on this experiment:</p><fig id="fig4"  position="float"><label><xref ref-type="fig" rid="fig4">Figure 4</xref></label><caption><title> Outage probability comparison of various relay selection schemes</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/78393x63.png"/></fig><fig id="fig5"  position="float"><label><xref ref-type="fig" rid="fig5">Figure 5</xref></label><caption><title> Relay node location</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/78393x64.png"/></fig><table-wrap id="table1" ><label><xref ref-type="table" rid="table1">Table 1</xref></label><caption><title> Relay node security calculation results</title></caption><table><tbody><thead><tr><th align="center" valign="middle"  rowspan="2"  >Intermediate node number</th><th align="center" valign="middle"  colspan="3"  >Node degree of security</th></tr></thead><tr><td align="center" valign="middle" >Number of experiments 1</td><td align="center" valign="middle" >Number of experiments 2</td><td align="center" valign="middle" >Number of experiments 3</td></tr><tr><td align="center" valign="middle" >2 3 4 5 6 7 8 9 10 11</td><td align="center" valign="middle" >0.600000 0.383333 0.480000 0.575000 0.420000 0.346154 0.500000 0.544444 0.383333 0.585714</td><td align="center" valign="middle" >0.346154 0.285714 0.500000 0.285714 0.666667 0.315385 0.445455 0.285714 0.575000 0.544444</td><td align="center" valign="middle" >0.575000 0.383333 0.336364 0.740000 0.300000 0.383333 0.346153 0.833333 0.575000 0.480000</td></tr></tbody></table></table-wrap><p>To get the candidate nodes: 2, 5, 6, 9, 11. The above five nodes perform the optimal relay node selection algorithm.</p><p>The final selection of the relay according to Section 3.2 is the trunk of serial number 2.</p></sec><sec id="s5"><title>5. Conclusion</title><p>Aiming at the characteristics of network coding application in wireless cooperative relay communication system, a relay selection method based on network coding security is proposed. The method uses the time-stamped homomorphic signature scheme to construct the node’s security degree and calculate the dynamic threshold Select the trusted candidate node, the security of each node used in the past period of time the maximum value is because the threshold is a threshold, the network does not want to enter the dangerous node, so the need to set the threshold, if the current time Threshold, then it may be more dangerous nodes into the network, is not conducive to network security. Then, based on the method of maximizing the received signal-to-noise ratio and channel gain, the optimal relay node is selected from the candidate nodes. The simulation results show that the achievable rate can be improved and the outage probability can be effectively reduced on the basis of ensuring the security of the relay node.</p></sec><sec id="s6"><title>Cite this paper</title><p>Guo, Q. and Li, X. (2017) A Safety Relay Selection Method Based on Network Coding. Int. J. Communications, Network and System Sciences, 10, 167-175. https://doi.org/10.4236/ijcns.2017.108B018</p></sec></body><back><ref-list><title>References</title><ref id="scirp.78393-ref1"><label>1</label><mixed-citation publication-type="other" xlink:type="simple">Fragouli, C., Boudec, J. and Widmer, J. (2006) Network Coding: An Instant Primer. ACM SIGCOMM Computer Communica-tion Review, 36, 63-68.  
https://doi.org/10.1145/1111322.1111337</mixed-citation></ref><ref id="scirp.78393-ref2"><label>2</label><mixed-citation publication-type="other" xlink:type="simple">Cao, Z.H. and Tang, Y.S. (2010) Summary of Secure Network Coding. Computer Application, 30, 499-505. https://doi.org/10.3724/SP.J.1087.2010.00499</mixed-citation></ref><ref id="scirp.78393-ref3"><label>3</label><mixed-citation publication-type="other" xlink:type="simple">Chang, X.M., Wang, J. and Wang, J.P. (2016) On the Optimal Design of Secure Network Coding against Wiretapping Attack. Computer Networks, 99, 82-98.  
https://doi.org/10.1016/j.comnet.2015.12.012</mixed-citation></ref><ref id="scirp.78393-ref4"><label>4</label><mixed-citation publication-type="other" xlink:type="simple">Yu, Z., Wei, Y. and Ramkumar, B. (2008) An Efficient Signa-ture-Based Scheme for Securing Network Coding against Pollution Attacks. Proceedings of International Conference on Computer Communications (INFOCOM), Arizona, USA, 13-18 April 2008, 1409-1417. https://doi.org/10.1109/INFOCOM.2008.199</mixed-citation></ref><ref id="scirp.78393-ref5"><label>5</label><mixed-citation publication-type="other" xlink:type="simple">Pei, H.-L., Shang, T. and Liu, J.-W. (2013) Secure Network Coding Method Merged with Timestamp and Homomorphic Signature. Journal on Communications.</mixed-citation></ref><ref id="scirp.78393-ref6"><label>6</label><mixed-citation publication-type="other" xlink:type="simple">Cai, N. and Yeung, R.W. (2011) Secure Network Coding on a Wiretap Network. IEEE Transactions on Information Theory, 57, 424-435.  
https://doi.org/10.1109/TIT.2010.2090197</mixed-citation></ref><ref id="scirp.78393-ref7"><label>7</label><mixed-citation publication-type="other" xlink:type="simple">Dai, X.-L., Zhang, J. and Ji, X.-L. (2014) A New Method for Cooperative Relay Selection Based on Hybrid Intelligent Algorithm. Telecommunication Engineering.</mixed-citation></ref><ref id="scirp.78393-ref8"><label>8</label><mixed-citation publication-type="other" xlink:type="simple">Lu, L. and Yu, H.Y. (2011) Physical Layer Network Coding Packet Opportunity Relay. Journal of Electronics &amp; Information Technology, 31, 1767-1770.</mixed-citation></ref><ref id="scirp.78393-ref9"><label>9</label><mixed-citation publication-type="other" xlink:type="simple">Liu, S.L. and Cao, S.H. (2013) Two-Way AF Relay System Relay Selection and Power Allocation Strategy. Computer Engineering and Applications, 49.</mixed-citation></ref></ref-list></back></article>