A Routing Table Insertion (RTI) Attack on Freenet
Total Page:16
File Type:pdf, Size:1020Kb
A Routing Table Insertion (RTI) Attack on Freenet Technical Report University of Hawaii at Manoa Project Members Todd Baumeister Yingfei Dong Zhenhai Duan Guanyu Tian Date 9/18/2012 1 Table of Contents 1. Introduction 2. Route Prediction 2.1 Freenet Routing Algorithm 2.2 Route Prediction Model 2.2.1 Introduction 2.2.2 Routing Table 2.2.3 Routing: Next Peer Node 2.2.4 Routing: Complete Path 2.2.5 HTL 2.2.6 Data Retrieval versus Data Insert Routing 2.3. Routing Algorithm Pseudo-Code 3. RTI Attack 3.1. The Attack 3.2. Identifying the Intersect Node 3.3. Keep alive 4. Traceback Attack 4.1 Broadcast Traceback Attack 4.2 Broadcast Traceback Attack with Topology 4.3 Depth First Traceback Attack 4.4. Traceback Attack Uses 5.5 Traceback Algorithm 5. Freenet Testbed 5.1 Testbed Requirements 5.2 VMware Virtual Machines 5.2.1. Firewall/Router 5.2.2. Freenet Virtual Machine Servers 5.2.3. Freenet Data Analysis and Management 5.2.4. Analysis 5.3 Simulation 5.3.1. Simulator Process 5.3.2. Freenet Node Thread i 5.3.3. Analysis 6. Obtaining Freenet Topology 7. Announcement Protocol 8. Experiment Results 8.1. Routing Algorithm 8.1.1. Routing Algorithm Pseudocode 8.1.2. Example Topology 8.1.3. Example: Routing Failure at First Node 8.1.4. Example: Routing Failure at Third Node in Routing Chain 2 8.1.5. Example: Routing Failure at Node Later in Routing Chain 8.2. Route Prediction Model 8.2.1. Prediction Model Accuracy Experiment 8.2.2. Experiment Results 8.3. General Anonymous P2P Properties 8.4. RTI Attack 8.4.1. Manual RTI Attack 8.4.2. RTI Attack Experiment 8.4.3. Experiment Results 8.5. RTI Attack Coverage 8.6. Attack Pair 9. Definitions 10. Resources 3 1. Introduction This document is a technical report about a Routing Table Insertion(RTI) Attack on Freenet. The details of the RTI attack will be discussed along with other components of Freenet that either directly affect or are affected by the RTI attack. In the first few sections, we will describe the different components of the RTI attack and the theory behind them in Section 2, 3, and 4. Then the remaining section 5, 6, 7 and 8 focus on the experiments we performed on the theory we developed in the former sections. There are three major theories that are described in this document. 1) Route prediction in a Freenet network. 2) RTI attack against a Freenet network. 3) A traceback attack that can be enabled by the RTI attack. These central ideas form the base of this document, and the remaining content is here to support them. 4 2. Route Prediction 2.1 Freenet Routing Algorithm Freenet uses a distributed hash table system to store and retrieve information from its network. The routing algorithm that Freenet uses can be characterized as steepest-ascent hill- climbing algorithm. Every node in the Freenet network has a small world view of the entire system, and it will use its limited information to make the best routing decisions that it can. There are several sources [1,2] that describe the details of the routing algorithm. However, the route prediction model described in this document uses the routing algorithm defined in the source code (version 0.7.5) at https://github.com/freenet/fred-staging. It is the most current version of the routing algorithm, and it has a few differences from the design documents. The general Freenet network configuration, storage and retrieval mechanics will be discussed. Also the anonymity contribution from the Freenet routing algorithm will be covered. In a Freenet network, each node operates independently. A node can have a direct connection with up to 40 other nodes. These connected nodes are considered to be direct peers. Each node in Freenet has a node location that is a real number in the range [0,1). Figure 2.1.a depicts how this address range is laid out. This number is used to determine routing paths, and serves as an indicator that the node should store information with a data location close to its node location. A node will use the node locations of all of the peer nodes that are within two hops when it makes routing decisions. This means that potentially a node knows the node location of (Max Direct Peers)2 other nodes. [ Figure 2.1.a: Circular Value Range [ 0, 1 ). Node Locations and Data Locations are this type of value. ] How is information stored and retrieved from the Freenet network? Every piece of information that is inserted into Freenet is hashed into a key. This key is then used to index that piece of information. Freenet takes the key and converts it to a real number in the range [0, 1). This number is the data location for a given piece of information. This data location can then be used in combination with the node location of the nodes to route and store the piece of information. The routing algorithm will try and find the node with the closest node location to the data location for a piece of information. 5 How does Freenet route requests? Every request that is generated in Freenet has a unique identifier called a UID associated with it. The UID is passed with the request so nodes can identify a request that they have already seen. Each request has a data location associated with it. If a node is unable to directly service a request, it will forward the request on to the next peer. The next node will be a direct peer that has the closest node location to the given data location. Requests will be forwarded until the request can be serviced or the hops to live (HTL) reaches zero. The HTL will be decremented each time a request is forwarded. If a request can be serviced, the reply will be sent back down the path it came from to the original sender. How the next node is chosen, how HTL works, and the differences between insert and retrieval request will be discussed in details in the following. How does a node chose the next closest peer to route to? Each Freenet node will look at all its peers that are within two hops. Then based on the node location of those peers it will chose a node that is one hop away as the next peer to route to. An example of how routing works is covered in Section 4. When a node is forwarding a request to the next peer, it will never forward a request to the previous node. The previous node is the peer node that the current node received the request from. Also Freenet will not route to nodes that have already been visited with the current request. Since each node does not know this list of already visited nodes, it will initially send the request. Then if the node returns a ‘reject loop’ message that means the node was an already visited. When a node receives a request, it will check if it has already seen a request with the same UID, and if it has, it replies with a ‘reject loop’ message. A request is forwared until it can be serviced by a node or its HTL reaches 0. HTLs are used to help limit the amount of resources used by a request. Initially the HTL starts out as (Max HTL), which is 18 by default. The HTL is decremented each time that a request is forwarded to another peer node. Two exceptions arewhen HTL is equal to the Max HTL or equal to 1. There is a 50% chance that the HTL will not be decremented when HTL is at the maximum value. There is also a 25% chance that when the HTL is 1 that the HTL will be decremented to 0. Figure 2.1.b shows the probability distribution for the additional hops generated for both of these deterministic HTL mechanisms. The total path length would be the additional hops from each of the probability distributes added to the Max HTL. 6 [ Figure 2.1.b: Probability of Additional Path Length. HTL = Max HTL has a 50% none decrement chance. HTL = 1 has a 75% none decrement chance. Example: There is roughly a 5% chance that the length of the path will be Max HTL + 3 for HTL = Max HTL.] There are mainly two kinds of requests in Freenet. Data retrieval requests are used to get data out of Freenet, and data insert requests are used to insert data into Freenet. The data retrieval request is the simpler of the two, and it will continue to search until a node can service the request or the HTL expires. If the HTL expires, then the request fails. An data insert request is actually comprised of two separate data insert sub-requests. When the HTL on a data insert request reaches the cacheable HTL threshold (Max HTL -3), a new data insert request will be generated. The new request will have all the same parameters (key, HTL, etc). The only difference will be that the new request will have a different UID. Using a new UID causes the visited node set to be cleared. Resetting the visited node set is done to avoid local minimums when inserting. The data insert request will then continue until the HTL expires. A data insert request will permanently store the data being inserted into every node that it passes through where the HTL is cacheable.