Hello, everybody. My name is Nathan Evans. This is Christian Grothoff. Here to talk to you today about routing in the dark, pitch black. Basically, this is a talk about security problems in the latest version of FreeNet's routing algorithm. So, the first important thing I'm going to say is, what exactly is the question FreeNet's, or the problem that FreeNet's trying to solve? Basically, performing efficient routing in decentralized networks is a very difficult problem for peer-to-peer file sharing networks and all kinds of different networks. FreeNet claims to solve this problem with logarithmic routing, logarithmic to the size of the network. Our question is whether or not FreeNet's new routing algorithm is resilient, robust, and resistant to our attacks. In order to explain the attack, first I'm going to go over some of the, exactly how routing works, so that it's easier to understand. But, as a spoiler alert, we don't really think that it is robust, resilient to our attacks. So, what exactly is FreeNet, for those of you who don't know? FreeNet is an anonymous file-sharing network. Well, it's touted as an anonymous file-sharing network. FreeNet adds structure to an unstructured network by using node locations in a cyclic address space. It's a friend-to-friend network, which means that all the peers are defined. They're not discovered in any way like a lot of other peer-to-peer networks. The important thing to remember is that our focus is only on the routing, not the other aspects of the network. And, for the routing, you need to understand two things. First off, routing, in the best case, assumes that all the data is stored at the node's location, which is closest to the data's key. All data is identified by a key, which is in the same cyclic address space as the location's. Also, you assume that all nodes forward requests based on the proximity of the key to the node's location. So, it forwards it to the closest peer that it has. So, there is a theoretical basis for the FreeNet routing protocol. It's based on small world networks. Since routing... uses node locations to determine proximity to the data, the algorithm works best in small world networks, but it would work in any kind of network. And also, we need to remember or know that FreeNet uses location swapping in order to help structure the network and make the routing more efficient. So, in order to understand how the swapping works, we have an example here. First off, since we're going to use this example throughout the talk, we need to know that the circles represent nodes, the locations... are the numbers inside the nodes. On the edges are the distances between the nodes. They're only listed on the two nodes that we're considering swapping because those are the only ones we really care about. We're looking here at a potential swap between 0.90 and 0.60. And, as you can see, the edge distances are large. And the idea, basically, for a swap is that we want to reduce the average edge distances. So, here's the result of the swap. And, as you can see, the average edge distances have gone down. So, that's... a good swap. Here's the actual equation for how... or formula, I guess, of how swapping actually happens. Another thing to remember is that all peers randomly initiate swaps. So, any peer tries to swap with its neighbors all the time. And, basically, P of A B is determined by the ratio of the products of the distances to all the neighbors that a peer has before and after a swap. That's kind of a mouthful. If you want to look at the equation, that's what it says. But, basically, if the result of this is greater than 1, a swap always happens. And, otherwise, a swap happens with probability of P of A B, as it's shown up there. So, again, in order to understand the routing, I'm going to go over get and put requests. So, this is how a get request works. Again, we have to remember that the peers use the location and the proximity to the data's key for routing. Basically, a client starts a get request, and it sends to its neighbor whose closest... whose location is nearest to the key that it's routing. Trying to find... Unless the data is at the neighbor, the request is forwarded to that peer's nearest neighbor with relation to the key again. And this kind of... This forwarding stops when the HTL equals 0, the data is found, or the request has been seen before, and that's just to avoid circular routing. So, now we have an example of an actual get request in our example network again. Here we are. We're starting from .90, the node .90, and we're searching for data identified by the key .22. So, first .90 finds its closest peer, which is .1, and it routes to it. .1 doesn't have anybody to route to, so it replies that it doesn't have the data. .90 then tries its next closest peer, which is .6. .6 forwards to its closest peer, which is .25. .25 responds that it has the data, responds to .6, and .6 responds back. I know this is kind of boring, but it's important to understand the routing before we get to the attack. So, this is how put requests work. Basically, they're really similar to get requests. A client initiates the put request or an insert, routes to its nearest neighbor. The neighbor checks whether any of its peers have a closer location than it does to the key, and if so, it forwards it to that peer. And if it is the closest peer out of all of its other neighbors, it resets the HTL to its maximum and then forwards the request out to all of its peers. This is kind of weird. We think it's mostly for replication, but it's relatively irrelevant to what we're doing with the attack. And again, the routing continues until the hops to live equals zero or a circular route happens. So, here's a quick put example. This one starts from our node .25, and we're inserting data with the key .93. So, .25 sends to its nearest neighbor, which is .6. .6 has a closer peer than itself, so it forwards the request to .90. .90 decides that it's the closest peer out of all of its neighbors, so it resets the HTL to max, and forwards the request to all of its neighbors again. So, now we get into the fun part. The basic idea for our attack here is that Freenet has a large reliance on a balanced distribution of node locations for storage and routing. But if there's some way that we could reverse the diversity of all these locations, unfair storage responsibility and bad routing starts to happen. And basically, this is because if there's a lack of close locations to a key for data, all data ends up clustered at a few nodes, and all routing responsibilities go to a few nodes. And the way we can do this is that peers can't verify the neighbors of their neighbors. So, basically, you can force swapping if you lie about who your neighbors are. So, here's the details of our attack. Basically, we just create malicious nodes or a node with specific location or locations. When a swap occurs with a malicious node, a random location is removed from the network. A good location is removed. And then the malicious node resets itself to a bad location again. Locations also can spread between non-malicious nodes just through the regular swapping protocol. And after enough time, we found that even few attackers can create large storage problems and clusters around certain bad locations. So, here's our example network again, this time showing the attack. So, in this network, we tell 0.90 to go bad. So, 0.90 then resets its location to one that we choose. It then forces a swap with each of its neighbors, first with 0.85. And then it resets its location. And it forces a swap with 0.10. Resets its location again. And then it forces a swap with 0.60. Resets its location again. And you can see that it's taken over pretty much all of its peers, which we can, again, force swaps by lying about who its peers are. And although they would swap with a low probability, we're showing 0.50, 0.00, and 0.45 swapping, just so you can see that swaps do occur between non-malicious nodes and still spread to malicious locations. And then after that swap happens, the malicious node again forces a swap with the new 0.45, and then resets its location again. So, imagine storage or routing in this network for any data whose key is above 0.5. You can see that all routing requests are going to go to the highest malicious location in the network, which in this case happens to be the node, but it could be any of them. But this puts a large portion of the storage responsibilities and routing requests to go through one node, which is the problem. So how did we implement the attack? You don't need to be an elite hackser to write what we did. The code is very minor changes to the actual Freenet codebase. The attack nodes follow all the steps of the protocol except lying about who their peers are. We found that over a long enough period, a single attacker can spread malicious locations to most nodes in the network. Using multiple locations and multiple attackers in our attack helps make it go faster and makes the effects more defined. Okay, so here's the testbed we used. It's an 800-node testbed. We created an overlay testbed topology that conforms to the small world networks, as defined by Watts and Strogatz. We monitor the network to find path links and to monitor the swapping locations. For simplicity in our network, content is stored at the closest node with relation to the key. This is the assumption, again, for routing, but we just put it at that one node because we don't want to worry about replication and things like that. Also, we set a bound on the storage at each node, which is true in the real world, as well. So here's an example of how our malicious nodes attack the network. Basically, the picture on the left you can see is an initial distribution of node locations for our 800 nodes. You can see it's pretty well distributed around the circle. In the picture on the right, you can see that there's large clusters around our malicious locations and there's large gaps where we've basically taken away all the good locations around there. Okay, so now the fun examples. These are our data loss examples in our network. It's important to go over how the data loss actually happens. Basically, if you remember the example I showed you with the 0.5 as a malicious node, if somebody was inserting data again above 0.5, all that data would end up stored at 0.504 with a high probability. Once 0.504 loses its... storage capacity, or runs out of storage capacity, it then has to push out data in a first-in, first-out fashion. So that's how the data actually gets lost. So here's our example. On the x-axis is time. It goes from 0 to 200. It's roughly 5 1⁄2 hours. On the y-axis is the percent of data lost in the network. Also, the attack always starts at 75 time increments. You can see here that after about 2 hours of attack time, roughly 20% of the data in the network is lost. And this is with only 2 attack nodes out of 800. So here's the data loss example, this time with 4 attack nodes, again in our 800-node network. Exact same scales for everything. Here we have about 30% data loss with 4 attack nodes. Okay, so here's with 8 attack nodes, which is 1% of the network. And it's pretty drastic. You can see that there's about 60% data loss in the network. Also, the above and below lines are the standard deviation because we did this over average runs. So you can see that sometimes it's a lot more drastic and sometimes it's less. This is because we don't choose our malicious nodes in any way. We just randomly choose them. So we don't know exactly what the topology looks like. when we choose them. So what are some possible protections that Freenet could use to protect against this? One thing they could do is check how frequently a node swaps similar locations. But as soon as you define similar, you're limiting the size of your network. And as all peer-to-peer networks want to be, they want to have as many peers as possible. So that's not a good solution. Another idea is limiting the number of swaps with a particular peer. But if you stop the number of swaps at, say, 5 with a certain peer, and it's still advantageous for routing to swap with that peer, then you're screwed, and that's not a very good protection either. Can you determine a node is bad because its location is really, really close to yours? No, because again, if your network is large enough, you're going to expect to be swapping with people whose locations are really close to you. Another idea is secure multiparting computation to compute the formula we showed you earlier. But that doesn't really do anything because an attacker can always lie about who his friends are, and there's no way to fix that. You can never know who the friends of your friends are in a friend-to-friend network. So in conclusion, we don't believe that Freenet's routing algorithm is robust enough to be used. Adversaries can remove the diversity of node locations and therefore screw storage responsibilities and routing responsibilities, and we cause significant content loss with even a few attackers. We use Freenet's own code against itself, so it's not like we're doing anything really bad. We're just tweaking a little bit. And since swapping is such a crucial part of the routing algorithm, it's a really tough problem to fix, and it's just a fundamental problem. We also think that churn in the network, natural churn, can cause similar location loss. But to find that out, come read our paper. And the code's available there. Thanks, everybody, for listening. Questions? Could you repeat that? Are you saying that... Yes. Yes. Okay, so the question is, if everybody has a huge data store, does that solve this problem? In the short term, probably. I mean, you could tweak a lot of the parameters. In our network, we're using... We're inserting 25% of the total storage capacity of the network. So, yeah, if you tweak that, it's gonna change it either way. Essentially, what it mostly changes is that how much data loss occurs how quickly. If you've got whatever... Every node has a terabyte of storage space, and your overall network only contains a terabyte of data, then you're fine. Nothing will happen. If every node only has, whatever, 500 megabytes of storage space, and your network contains 10 times as much, right, then your results will be much worse than what we have right now. So the point is, it's really just gradual. And we just picked one quarter as a data point to show kind of, okay, what would we realistically expect for such kind of network to be able to handle, right? Yeah. It approaches, essentially, 100%. If you keep it going, it will approach 100%, as you can see. The graphs... I mean, obviously, the curve flattens out, but as the malicious node locations spread, right, and they start spreading slower and slower over time, but they will continue to spread because of the random swaps that the network does, you will eventually take over everything. Even with just one malicious node, you would eventually take over everything. Question is, you know, how long do you want to run these simulations, and 800 nodes per day? This is a lot. We don't have that much processing time. Anybody who didn't hear that, the question was, what happens if you run this for a really long period of time? And our answer is that, eventually, even one attacker can take over all the locations in the network. I mean, given enough time, random swaps are going to happen, and all the nodes will become bad. Yeah. So is this just an architectural issue with GreenNet specifically, or is it GreenNet-directed, or are there other... ? Well, of course there's other networks that don't suffer from this, but... So the question here is, is this an architectural Freenet problem, I think, or is it... ? Oh, okay. And then how general a problem with friend-to-friend networks it is? Well, here it's a real big problem because of the swapping, because they really rely on who your friends are for this equation. And a friend-to-friend network that doesn't rely on swapping for such a big portion of the routing, then it wouldn't really be as much of a problem. And essentially, it's an architectural problem in the sense of the Freenet routing algorithm specifically. Yeah. The other parts of Freenet are not impacted, but it's kind of essential that you, you know, find your data quickly and where you store your data and so on. And so in that sense, yes, it's the Freenet architecture. It's not a general friend-to-friend problem. I would just say friend-to-friend networks make it incredibly hard to do these kind of things to begin with. And the answer is just this is not a solution, at least not a good one. Yeah. In your research, your attack algorithm, what's your order of magnitude on average? Order of magnitude of? . For, for routing? No, your attack algorithm actually affects the entire network. I'm not sure. Well, the number of swaps. Okay, the question was what's the order of magnitude of our algorithm to the network, what we have to do? Well, the answer is obviously you have to have kind of an O of N as a linear number of swaps to take over the entire network. Right. And the rest, I mean, this is swaps with your neighbors. Right. How long it will take to spread, again, depends on how often the nodes themselves swap. Right. . No. We didn't actually, well. The question doesn't make sense. That's what I mean, so. Any more questions? Okay. Thanks, everybody. Thank you.