# Enhancing Border Gateway Protocol Security Using Public Blockchain
## 1 Introduction  
Nowadays, the Internet is composed of a huge number of Autonomous Systems (ASes). These ASes exchange information about IP prefixes. Communication among ASes is handled using a routing protocol called the Border Gateway Protocol (BGP) [1]. In general, ASes trust each other and assume that their neighbour advertises correct data. This behaviour is a little naive because accepting all incoming BGP advertisements as genuine and correct may open the door for potential attacks. One of the most widespread types of attacks on BGP is called BGP hijacking [2]. Its objective is to steal the network IP address and reroute traffic intended for this network by an Autonomous System (AS) under control of a malicious actor. The router of malicious AS announces network prefixes that do not belong to the attacker by inserting false information into BGP messages sent to the neighbouring ASes. Routers in peer ASes accept the advertised prefixes and modify how traffic destined for the hijacked networks is routed. The prefix advertisements are propagated further to their neighbouring ASes, and this process is repeated throughout the Internet. Every AS updates its routingtable according to fraudulent values in the messages received from neighbours. When the network converges, all traffic hijacked from the originating AS is diverted to the malicious AS. This type of attack has a few variations depending on the hijacker's aims. The attack can propagate IP prefix with the same mask as was the prefix in the original AS, but with better features for the prefix. Using another method, the prefix can be advertised with longer and thus more specific mask compared to the original legitimate prefix. The further attack method is called a one-hop prefix hijack. The attacker modifies the AS path and propagates a fake direct connection to the victim AS [3]. Nevertheless, several techniques have been designed to prevent these types of attacks, i.e., BGP Sec [4] and RPKI [5]. However, these techniques are not widely adopted yet, and they are rising slowly because they can be challenging to deploy. Issues include the requirement for modification of the routing protocols or adding additional network resources [3]. Another way to increase the security may be the usage of blockchain. Being decentralized, trustless, accessible, and transparent, can help to achieve a higher level of protection. Blockchain technology is similar to a distributed database with some important design differences. It maintains a consistent copy of a particular dataset across several nodes. It is a fully decentralized environment. Every new record has a reference on the previous record added to the blockchain. The record is called a block and has the reference on the previous block. It is calculated as a hash value from the header fields of the previous block. New blocks in the blockchain network are created by miners, who collect all transactions from the network, and after having a certain amount of them, they turn it into the new block. This new block becomes a candidate to be added to the blockchain. The process where nodes must agree with the new block before it is added into the chain is called consensus. If most of the nodes in the consensus agree with the candidate, it will be added to the chain [6]. The consensual algorithms are, i.e., Proof of Work, Proof of Stake, or Practical Byzantine Fault Tolerant. The selected consensual algorithm affects the time of reaching a consensus. Each of these algorithms requires a different amount of agreeing with nodes, and each of the algorithms tolerates different amounts of malicious nodes without any affect on the final agreement. The blockchain can be either private, controlled by a centralized authority or public that allows anyone to participate in the network [7]. We were inspired by the model [8] for managing network devices and model BGPCoin [9] which designs a reliable way for the origin authentication of the resources in the advertisements.