# BGP Neighbor Trust Establishment Mechanism Based on the Bargaining Game
## 3 The BGP Neighbor Trust Mechanism Based on the Bargaining Game
### BNTE-BG Mechanism  
In the BGP neighbor establishment process, first, ASes with different AS numbers complete the TCP connection at the transport layer and then exchange the parameters through the Finite State Machine (FSM). We will combine the bargaining game model with the first stage of BGP neighbor establishment, proposing BNTE-BG. The mechanism process is as follows:  
1. System Initialization. The BGP router sets the service quality attribute vector range \(X^{acc}\) and \(X^{pro}\) independently. \(X^{acc}=\left[X^{acc}_{min},\ X^{acc}_{max}\right]\) represents the range of service quality attributes that the BGP router can accept. \(X^{dec}_{min}=\left\{x^{dec}_{1 min},x^{dec}_{2 min},x^{dec}_{3 min},x^{dec}_{4 min},x^{dec}_{5 min}\right\}\) represents the minimum value of each service quality attribute that can be accepted. \(X^{acc}_{max}=\left\{x^{acc}_{1 max},x^{acc}_{2 max},x^{acc}_{3 max},x^{acc}_{4 min},x^{acc}_{5 max}\right\}\) represents the maximum value of each service quality attribute that can be accepted. \(X^{pro}=\left[X^{pro}_{min},\ X^{pro}_{max}\right]\) represents the range of service quality attributes that the BGP router can provide [23]. \(X^{pro}_{min}=\left\{x^{pro}_{1 min},x^{pro}_{2 min},x^{pro}_{3 min},x^{pro}_{4 min},x^{pro}_{5 min}\right\}\) represents the minimum value of each service quality attribute that can be provided. The specific settings are as follows: \[\left\{ \begin{array}{l}x^{acc}_{1 min}\leq x_{1}\leq x^{acc}_{1 max}\\ x^{acc}_{2 min}\leq x_{2}\leq x^{acc}_{2 max}\\ x^{acc}_{3 min}\leq x_{3}\leq x^{acc}_{3 max}\\ x^{acc}_{4 min}\leq x_{4}\leq x^{acc}_{4 max}\\ x^{acc}_{5 min}\leq x_{5}\leq x^{acc}_{5 max}\end{array} \right.\quad\left\{ \begin{array}{l}x^{pro}_{1 min}\leq x_{1}\leq x^{pro}_{1 max}\\ x^{pro}_{2 min}\leq x_{2}\leq x^{acc}_{2 max}\\ x^{prom}_{3 min}\leq x_{3}\leq x^{acc}_{5 max}\\ x^{prom}_{4 min}\leq x_{4}\leq x^{acc}_{4 max}\\ x^{prom}_{5 min}\leq x_{5}\leq x^{acc}_{5 max}\end{array} \right.\] where \(x_{1}\), \(x_{2}\), \(x_{3}\), \(x_{4}\), and \(x_{5}\) are defined as in Section 3.1. Simultaneously, the BGP router sets \(u^{req}\) and \(u^{qgr}\). \(u^{req}\) is the neighbor trust establishment requester's expected payoff. \(u^{qgr}\) is the neighbor trust establishment agreer's expected payoff. 2. The BGP Neighbor Trust Establishment Process. We suppose that \(AS_{1}\) wants to establish a trusted neighbor relationship with its adjacent \(AS_{2}\). \(AS_{1}\) is the neighbor trust establishment requester, with the service quality attribute vector range \(X^{acc}_{AS_{1}}\), the negotiation ability \(\delta_{AS_{1}}\) and the expected payoff \(u^{req}_{AS_{1}}\). \(AS_{2}\) is the neighbor trust establishment agreer, with the service quality attribute vector range \(X^{pro}_{AS_{2}}\), the negotiation ability \(\delta_{AS_{2}}\), and the expected payoff \(u^{qgr}_{AS_{2}}\). The number of quotations for \(AS_{1}/AS_{2}\) is \(T_{AS_{1}}/T_{AS_{2}}\). In order to better describe the process, we take \(T_{AS_{1}}=T_{AS_{2}}=1\). The implementation of BNTE-BG is shown in Figure 1 and Algorithm 1:  
1. First, \(AS_{1}\) initiates a neighbor trust establishment request to \(AS_{2}\). It uses the service quality attribute vector range \(X^{acc}_{AS_{1}}\), the current quotation number \(t_{AS_{1}}\) and the negotiation ability \(\delta_{AS_{1}}\) to generate the service quality attribute quotation vector \(X^{(1)}\) through the quote strategy function \(Quote\_req\). Then \(AS_{1}\) adds it to the TCP message and sends it to \(AS_{2}\). 2. When \(AS_{2}\) receives the new TCP message from \(AS_{1}\), it extracts the service quality attribute quotation vector \(X^{(1)}\). It calculates the payoff, then judges whether \(AS_{1}\)'s \(X^{(1)}\) satisfy the expected payoff \(u^{agr}_{AS_{2}}\). If it does, \(AS_{2}\) outputs \"Establish neighbor\".