{'fraction_non_alphanumeric': 0.035914964136823845, 'fraction_numerical': 0.008648592661643233, 'mean_word_length': 4.473356009070295, 'pattern_counts': {'":': 1, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Mapping the Interplanetary Filesystem

The Interplanetary Filesystem (IPFS) is a distributed data storage service frequently used by blockchain applications and for sharing content in a censorship-resistant manner. Data is distributed within an open set of peers using a Kademlia-based distributed hash table (DHT). In this paper, we study the structure of the resulting overlay network, as it significantly influences the robustness and performance of IPFS. We monitor and systematically crawl IPFS' DHT towards mapping the IPFS overlay network. Our measurements found an average of 44474 nodes at every given time. At least 52.19% of these reside behind a NAT and are not reachable from the outside, suggesting that a large share of the network is operated by private individuals on an as-needed basis. Based on our measurements and our analysis of the IPFS code, we conclude that the topology of the IPFS network is, in its current state, closer to an unstructured overlay network than it is to a classical DHT. While such a structure has benefits for robustness and the resistance against Sybil attacks, it leaves room for improvement in terms of performance and query privacy.


I. INTRODUCTION
The Interplanetary Filesystem [1] is a community-developed peer-to-peer protocol and network providing public data storage services. IPFS is often cited as a fitting data storage solution for blockchain-based applications [2]- [6] and was previously used for mirroring censorship-threatened websites such as Wikipedia 1 . IPFS' design is reminiscent to classical peer-to-peer systems such as filesharing networks [7]. Any Internet-enabled device can participate as an IPFS node and nodes are operated without explicit economic incentives. Unlike blockchain-based systems such as Bitcoin [8], data items (files, folders, ...) are not replicated globally. Instead, each data item is stored by a small set of nodes, that item's providers, who make the data item available to other peers. Data items are addressed through immutable, cryptographically-generated names which are resolved to their providers through a distributed hash table based on Kademlia [9].
Given IPFS' reported attractiveness as a building block for decentralized applications and censorship circumvention, the question arises whether the network is actually suited to fulfill this role in terms of robustness and "decentrality". We are particularity interested in the following questions: • What is possible with regards to mapping and monitoring the IPFS overlay network (assessing its "health")?
• How many and what types of nodes participate in the IPFS network? What kind of churn do they exbibit? 1 https://github.com/ipfs/distributed-wikipedia-mirror • How "decentralized" is the network -in terms of overlay structure and the geographical distribution of nodes? In this paper, we present the results of a comprehensive empirical study on the IPFS overlay network. As central components of our methodology, we collected connection data from several self-controlled monitoring nodes and repeatedly crawled the IPFS DHT. We find that, similar to other Kademlia-based systems [7], [10], connections corresponding to DHT routing table entries can be learned through carefully crafted, iterative peer discovery queries. However, through measurements and studies of the IPFS code base, we also uncover a number of differences to both previous systems and the design outlined in the IPFS whitepaper [1]. For example, in contrast to other Kademlia implementations, IPFS establishes a connection with every peer it encounters and maintains a large number of connections that do not correspond to any DHT routing table entries. As a further surprise, and despite whitepaper claims to implementing mechanisms from [11], we find that no noteworthy protection against Sybil attacks is currently implemented in IPFS. The effect on security, however, is limited. Thanks to IPFS' unusual hoarding of overlay connections and the fact that requests are promiscuously sent to all direct peers, content retrieval is possible even if an attacker can place Sybil nodes at key locations in the overlay.
Our contributions are threefold: • We give an overview on the IPFS system based on white papers, public online discussions, and code. Notably, we describe the actual state of current implementations, and contrast it with the design documents.
• We run monitoring nodes with varying connectivity (fully reachable, behind NAT), some of which modified to accept an unlimited number of overlay connections. Among other things, this allows us to map the quantitative relationship between overlay connections and DHT routing table entries, as influenced by node connectivity.
• We repeatedly crawled the IPFS DHT to obtain its topology, thereby also enumerating all DHT-enabled nodes and their addresses.

II. RELATED WORK
Peer-to-Peer networks have been studied extensively in the past, yielding various results on network crawling and characterization [12]- [20] with applications to real-world peer-topeer systems like BitTorrent [7] and KAD [16]. We extend this line of research by developing and performing a measurement study on IPFS -a highly popular data storage network with various reported applications (see, e.g., [2], [4], [5] for a sample of academic projects).
In their seminal work, Stutzbach et al. [15], [20] study requirements and pitfalls with regards to obtaining accurate snapshots of peer-to-peer overlays. Specifically, they find that the duration of crawls should be as small as possible, to avoid distortions in the results due to churn. Steiner et al. [16], [19] crawled the KAD network to obtain the number of peers and their geographical distribution as well as intersession times. Salah et al. [10] studied the graph-theoretical properties of KAD and contrasted their results with analytical considerations. Similarly to KAD and other networks, the DHT component of IPFS is also, in principle, based on Kademlia [9]. We therefore build upon previously proposed crawling methods. However, we also find that IPFS differs substantially from more canonical Kademlia implementations, necessitating enhancements to existing measurement approaches. We furthermore explore links in the IPFS overlay that are not used for DHT functionality.
A simple crawler for the IPFS DHT has been made available before 2 that aims at enumerating all nodes in the network. For this paper, we developed a new crawler from scratch to capture the entire overlay topology. It is optimized for short running times to ensure the correctness of snapshots 3 .
The I/O performance of retrieving and storing data on IPFS was studied in [6], [21]- [23], with interesting and partially contrasting results. Ascigil et al. [6] report high latencies, low throughput and high redundancy when retrieving data through IPFS. Similarly, Shen et al. [21] report high latencies for large files and large variances in the transmission speed. In [22], [23], the authors optimize and evaluate the performance of IPFS in edge computing settings. They report small latencies and high throughput when using the global DHT as little as possible and running IPFS in a private local network. In contrast to these prior works, we focus on grasping the overlay structure and node composition of the public IPFS network. Furthermore, we give a comprehensive, code review-supported overview of IPFS' "network layer", revealing information not previously available in literature or documentation.

III. THE INTERPLANETARY FILESYSTEM
In the following, we describe key aspects of IPFS' design and discuss particularities relevant to conducting a measurement study and interpreting its results. It is worth noting that the development of IPFS is ongoing, so that details of the design may change over time. Here, we focus on inherent conceptual properties that change rarely in deployed protocols.

A. In a Nutshell
As a broad overview, the design of IPFS can be summarized in the following way: • Data items are stored and served by data providers. 2 https://github.com/vyzo/ipfs-crawl 3 The code of our crawler can be found at https://github.com/scriptkitty/ipfs-crawler • References to data providers are stored in a DHT. • In addition to DHT-based provider discovery, data items are requested from all connected overlay neighbors.
• In contrast to information in the IPFS white paper [1], no proposals of S/Kademlia [11] are implemented. • Overlay connections can correspond to DHT routing table (bucket) entries, but do not have to.
• By crawling the DHT we obtain a subset of all connections; we estimate the size of that subset in Sec. V-B.

B. Node Identities and S/Kademlia
Anyone can join the IPFS overlay network, i. e., it is an open (permissionless) system with weak identities. Nodes are identified by the hash of their public key, H(k pub ). To ensure flexibility, IPFS uses so-called "multi-hashes": a container format capable of supporting different hash functions. A multihash adds meta information about the hash function and the digest length to a hash. By default, IPFS uses RSA2048 key pairs and SHA256 hashes.
Creating a new IPFS identity is as simple as generating a new RSA key pair -making the network highly susceptible to Sybil attacks [24]. Towards increasing the cost of Sybil attacks, the IPFS white paper [1] suggests that the Proof-of-Workbased ID generation approach of S/Kademlia [11] is in use. However, based on our careful review of the IPFS codebase, this is not the case at the moment. IPFS currently implements no restriction on the generation of node IDs, neither are DHT lookups carried out through multiple disjoint paths, as proposed in S/Kademlia. IP address-based Sybil protection measures, such as limiting the number of connections to nodes from the same /24 subnet, are currently also not in use.
On the network layer, IPFS uses a concept of socalled "multi-addresses". Similar to multi-hashes, these multiaddresses are capable of encoding a multitude of network and transport layer protocols. Through these multi-addresses, a peer announces its connection capabilities, e. g., IPv4, IPv6, etc., and the addresses it can be reached from to the network.

C. Data Storage: Self-Certifying Filesystem
IPFS uses a form of Self-Certifying Filesystem (SFS) (originally introduced in [25]) to ensure the integrity of data throughout its delivery. In IPFS, each data item d is assigned a unique immutable address that is the hash of its content, i. e. addr(d) = H(d). Technically, folders and files are organized in a Merkle tree-like structure. For example, a folder entry contains the hashes of all files in the folder. In the end, the receiver can recognize whether received data was tampered with by comparing its hash with the requested address.
Due to these hash structures, the address of data changes whenever the data itself is changed, which is not ideal in most circumstances. As a partial remedy, IPFS introduces the socalled Interplanetary Namesystem (IPNS); a way of issuing self-certifying mutable addresses to data. An address in IPNS is the hash of a public key, containing a record that links to the hash of the desired data. The hash is signed with the corresponding private key, making it easy to check the integrity and authenticity of the IPNS record (hence, selfcertifying). IPNS addresses can only be updated by the issuer by publishing the update on the overlay through the DHT.

D. Content retrieval
Data items are usually stored at multiple nodes in the network. Nodes store content because they are its original author or because they have recently retrieved it themselves. Nodes normally serve the data items they store, upon request. The nodes that store a given data item are consequently referred to as that data item's providers.
When an IPFS node v wishes to retrieve a given data item d (e. g., based on a user request), it follows two strategies in parallel: 1) Look up providers P (d) for d in the DHT (cf. Sec. III-E), then request d from members of P (d).

2) Ask all nodes it is currently connected to for d, using the
Bitswap subprotocol (cf. Sec. III-F)

E. Content Retrieval: Kademlia DHT
IPFS uses a Kademlia-based DHT. Kademlia offers mechanisms for efficiently locating data records in a peer-topeer network [9]. Each node in the IPFS overlay network is uniquely identified by its node ID-the SHA-2 hash of its public key. Data records are indexed and located using keys. Records in the IPFS DHT are lists of data providers for data items stored in IPFS, and the keys to these records are consequently the addresses of data items (H(d) for a data item d). An example scenario illustrating this relationship is presented in Fig. 1. Nodes can be part of the IPFS overlay network but choose to not participate in the DHT, by acting as so-called client nodes. Therefore, we distinguish between the IPFS overlay which entails all nodes, including clients, and the overlay without clients which consists of nodes that take part in the DHT protocol. When no ambiguity may occur, we simply use the term overlay for both.
Node IDs and keys share the same representation and are treated identically as IDs (∈ [0, 2 256 ]). Records in a Kademlia DHT are stored at nodes whose node ID is "close" to the record's key. Closeness is defined via the bitwise XOR of two IDs, taken as an integer value, i. e., dist(x, y) = x ⊕ y. A node stores its known neighbors in so-called k-buckets which partition the known overlay network (without clients) based on the local node's ID. Every k-bucket (or simply bucket) stores up to k neighbors. For each possible distance n there is exactly one bucket storing nodes with dist(x, y) = n, where x is the local node's ID and y is any node ID from the respective bucket. In IPFS' DHT, k = 20, i. e., each bucket stores up to 20 entries. Bucket i stores nodes whose distance is in [2 i , 2 i+1 ), which effectively corresponds to the length of the common prefix shared between two node IDs.
IPFS uses a performance optimization in that buckets are unfolded, i. e., created, only when necessary. As each bucket corresponds to a common prefix length, the "later" buckets with a longer common prefix length tend to be mostly empty, as the probability to encounter a node that falls into a specific bucket decreases exponentially with the common prefix length. To avoid storing mostly empty buckets, IPFS creates them on the fly when necessary. This in turn implies that we can not know in advance how many buckets a node on the network has currently unfolded.
In IPFS, a node v resolves an ID x to a record or a set of closest nodes on the overlay using multi-round iterative lookups. In each lookup round, v sends requests to known nodes with IDs close to x. Nodes reply with either a record corresponding to x or with new node contacts, selected by proximity to x and therefore enabling a subsequent lookup round. Peer-to-peer connections in IPFS are always based on TCP or other reliable transport layer protocols. Consequently, the DHT component of IPFS also uses (TCP-) connections (unlike many other Kademlia implementations, which are datagram based).
In contrast to the original Kademlia proposal [9], IPFS does not ping the last entry of a bucket for a potential eviction, if a new node is about to enter a new bucket. Instead, the new node is simply rejected. Nodes are ejected from buckets only if the connection with them is terminated for other reasons. Similarly, IPFS' DHT does not maintain a replacement buffer [9] with candidate nodes for full buckets.

F. Content Retrieval: Bitswap Data Exchange
Bitswap is a subprotocol of IPFS used for transfers of actual content data. It is similar to Bittorrent [7] and is used for obtaining data items from connected peers. Interestingly, IPFS overlay nodes (including clients) query all of their connected peers for data items they look for (their so called wantlist). This happens in parallel to DHT queries for data providers registered in the DHT. While in some aspects questionable with regards to performance, the promiscuous broadcasting of queries results in a key security feature of IPFS: attacks on the DHT have only a limited impact on the availability of stored data. For example, while it is within the means of a dedicated attacker to overwrite the providers record for a file with Sybil nodes, users are able to retrieve it via one of their many (around 900, cf. Sec. VII) directly connected peers.
We verified this behavior experimentally within a private IPFS network. We overwrote the all provider lists for a target data item with Sybil entries, effectively removing all correct providers from the DHT. Whereas, as expected, all DHT queries for the data item failed after this intervention, nodes were still able to obtain the data item from overlay neighbors.

IV. UNDERSTANDING THE OVERLAY STRUCTURE
IPFS nodes can be separated into two kinds: nodes that participate in the DHT and nodes that are clients. We want to disentangle the different kinds of overlays that arise through this distinction and reason about what information can be measured. We distinguish between the IPFS overlay (G), the IPFS overlay without clients (G) and the overlay induced by DHT buckets (G ′ ). We explain the differences in the following.
Overlay networks are commonly modeled as graphs with nodes as vertices and connections between those nodes as edges. LetG = (Ṽ ,Ẽ) be an undirected graph (due to the symmetry of TCP-connections), withṼ representing the nodes in the IPFS overlay andẼ the connections among them.G consists of all nodes, including clients. Since clients do not contribute to the DHT -one of the core pillars of IPFS -we focus most of our analysis on the IPFS overlay without clients. Let V ⊆Ṽ be the set of IPFS nodes that are not clients and G :=G[V ] the induced subgraph of V , i. e., the graph with vertex set V and all edges fromẼ that have both endpoints in V . V can be, to a large extent, learned by crawling the DHT buckets of each node, whereas it is not straightforward to reason aboutṼ as client nodes are not registered anywhere or announced on the network.
What exactly can be learned by crawling each node's buckets? IPFS attempts to reflect every new connection (inbound or outbound) to DHT-enabled nodes (i. e., nodes that are not pure clients) in DHT buckets. When connections are terminated for whatever reason, the corresponding entry is deleted from the respective bucket. Each node's buckets, and hence the DHT as a whole, therefore contains only active connections. If buckets were arbitrarily large, nearly all overlay links (E) would (also) be part of the buckets.
However, buckets are limited to k = 20 entries without an eviction mechanism. This leads to situations where connections are established but cannot be reflected in buckets. For example, during lookups, IPFS establishes connections to all newly discovered nodes and attempts to add them to buckets. To avoid maintaining a nearly infinite number of connections, IPFS nodes start to randomly terminate connections that are older than 30 s once their total number of connections exceeds 900. If relevant buckets are full at both nodes, the connection exists without being reflected in any bucket at all.
For visualizing the possible configurations, Fig. 2 depicts an example overlay network without clients (G), with the connections that are reflected in buckets (G ′ ) redrawn on top. A connection between two nodes can either 1) be reflected in buckets by both nodes (e. g., (v 2 , v 3 )), 2) be reflected in buckets by only one node (e. g., (v 0 , v 1 )) or 3) exist independently of bucket entries (e. g., In practice, it therefore usually holds that E ′ is a strict subset of E and G ′ therefore strict subgraph of G. Unlike G, G ′ is furthermore a directed graph. The direction is important since lookups of data or other nodes only consider the nodes stored in buckets. In the case of a well functioning DHT it is expected that V ′ ≡ V andṼ \ V ′ is exactly the set of client nodes. Event though it is likely that not all node pairs from E are reflected in E ′ , we expect that G ′ is strongly connected and that it is therefore, in principle, possible to enumerate all nonclient nodes V by crawling the DHT. Our crawling results (cf. Sec. VII-A) support this assumption. Before delving into our crawling methodology and the remaining insights gained through it, we present an empirically founded estimation of the relationship betweenG, G and G ′ .

V. MEASURING THE INTERPLAY BETWEENG, G AND G ′
In the following, we focus on the default behavior of nodes (with and without NAT), the share of clients in the IPFS overlay (i. e.,Ṽ \ V ) and how much of the overlay of DHTenabled nodes (G) is reflected in buckets (G ′ ).

A. Empirical Results of Monitoring nodes
First, we started an IPFS node, version v0.5.0-dev with default settings and a public IP address, without any firewall. Every 20 s, we queried the number of overlay connections, as well as the number of nodes in the node's buckets for a total of 2.99 d. For the number of overlay connections we relied on the API that IPFS offers in this case, whereas the number of nodes was extracted through our external crawling tool (discussed in Sec. VI). The results are depicted in Fig. 3, which shows the number of overlay connections (edges fromẼ, solid red line), connections with DHT-enabled nodes (edges from E, dashed green line) and the number of connections in the buckets (edges from E ′ , dashed blue line). The measurement began simultaneously with the IPFS node itself, hence, the short startup phase in the beginning. It can be seen that the number of connections largely fluctuates around a value, with up to 400 connections established in just a few minutes. This behavior is due to the way IPFS handles its connection limit.  The default number of connections an IPFS node will establish is 900, but it does not cap at that value. Instead, IPFS 1) starts a new connection with every node it encounters when querying data and 2) accepts every incoming connection at first. If the number of connections exceeds the limit, IPFS evicts connections (uniformly) at random that are older than 30 s, until the upper limit is satisfied again.Furthermore, 76.40 % of connections are DHT-enabled, on average, indicating a notable difference between the overlay with clients (G) and the one without (G). We performed the same experiment for a node behind a firewall for a duration of 3.05 d, the results are shown in Fig. 4. Several properties can be observed from both experiments. Firstly, a node behind a NAT has almost two orders of magnitude less connections than its non-NATed counterpart. Secondly, most connections of the non-NATed node are inbound connections, i. e., established from another peer on the network. Since our node was idle and not searching for content or other peers, it has no external trigger to start outbound connections. The NATed node cannot accept incoming connections, hence, the low number of connections. Lastly, it can be seen that IPFS' API functions lag behind in reporting the protocols of a peer: the number of DHTenabled connections can never be smaller than the number of connections in the buckets. Last but not least, we are interested in a more holistic perspective on the different overlay types and number of nodes in the network. To this end we started an IPFS node (v0.5.0-dev) with a public IP and a connection limit of 500000. Similar to the other experiments, we logged the connections every 20 s for a total of 1.80 d. The results are depicted in Fig. 5, which shows the number of connections over time, the number of DHT connections and the total number of node IDs seen. On average, the node had 38903 connections, 63.64 % of which were DHT connections. Again, the vast majority of these connections is inbound, since our node was idle. The number of node IDs is steadily increasing, whereas the number of connections is not, which could be due to clients with non-persistent node IDs, e. g., the browserenabled Javascript implementation of IPFS 4 . Fig. 3 it is clearly visible that the buckets (E ′ ) store 22.16 % of all connections between DHT-enabled nodes (E), due to the buckets' limited capacity of k = 20 nodes (cf. Sec. IV). These connections can, therefore, not be found by crawling the DHT nor be obtained through passive measurements alone. This raises the question: why is the gap between connections stored in a node's buckets (E ′ ) and all overlay connections between non-client nodes (E) so significant?

B. Analysis of the Difference between E and E ′ In
Analytically, we are interested in the following quantity: Given N := |V | non-client nodes in the overlay, what is the expected number of nodes stored in the buckets? The distribution of nodes to buckets is highly skewed, since the first bucket is "responsible" for one half of the ID space, the second bucket for one fourth etc. [26], [27]. The expected number of nodes in each bucket i is therefore min{20, N ·p i }, with p i := 2 −i . Although we do not encounter every peer equally likely, this reasoning still holds: During bootstrap, an IPFS node performs lookups for its own node ID as well as random targets tailored for each bucket. The former ensures that it knows all nodes in its direct neighborhood, partially filling the smallest, non-empty bucket. The latter ensures that it knows some nodes from each other bucket, filling them completely with high probability. Which bucket will be the smallest non-empty bucket therefore only depends on the total number of non-client nodes in the overlay.

E[# nodes in buckets|N nodes in overlay]
(1) The result of this analytical consideration are depicted in Fig. 6. The solid red line corresponds to a "perfect" setting, where each overlay connection would be stored in a bucket, whereas the dashed blue line is the result of eq. (3). Plugging the empirically found number of nodes from Sec. VII into this formula yields an expected number of bucket entries between 232 and 247, which coincides with the measured average number of entries of 232.47 (max. 245). So far, we've seen some indications on the relationship between the IPFS overlayG, the overlay without clients G and what is stored in buckets G ′ . In the following, we are interested in obtaining measurements of G ′ to learn more about the topology of the network.

A. Crawl Procedure
As described in Sec. III, nodes in the network are identified through a (multi-)hash of a public key. The crawler used new key pairs in every run to thwart potential biases due to reoccurring IDs. Moreover, an IPFS node will not store our crawling nodes in its buckets, since our nodes are marked as clients who do not actively participate in the Kademlia communication 5 .
Nodes can be found by issuing FindNode packets for some target ID, which can be a key or a node ID (=hash of a public key in the case of nodes). To completely crawl a node, one has to send a FindNode packet for each possible bucket. This is due to the fact that a node returns its k closest neighbors to the target provided in a FindNode packet. The closest neighbors to the target are the ones in the bucket the target falls into. If the bucket in question is not full (i. e., less than k entries), the closest neighbors are the ones in the target bucket and the two buckets surrounding it. Since the bucket utilization of remote nodes is unknown, we do not know in advance how many requests per node we have to send for obtaining all of its DHT neighbors. We therefore send FindNode packets to targets with increasing common prefix lengths and stop once no new nodes are learned. This results in a significant speed improvement as no requests are sent for buckets that are nearly certainly empty (since the number of potential bucket entries decreases exponentially with the common prefix length). Faster crawls, in turn, enable us to capture more accurate snapshots of the dynamically changing network.

B. Hash Pre-Image Computation
Unlike more canonical Kademlia implementations, whenever an IPFS node receives a FindNode packet, it hashes the provided target and searches for the nearest neighbors to that hash. Therefore, to know which target to send for which bucket, we need to compute pre-images that, when hashed, yield the desired common prefix length between FindNode target and the node ID of the node we are crawling. To that end, we generated pre-images for every possible prefix of 24bit length. In other words, we computed 2 24 pre-images such that, for each possible prefix of the form {0, 1} 24 , there is a hash starting with that prefix.
Equipped with this table, one lookup operation is sufficient to pick a pre-image that, when hashed by the receiver, will yield the desired bucket. Note that this table can be used for an arbitrary number of crawls, hence, the computation only had to be performed once.

C. Crawl Procedure
Each crawl commenced with the 4 IPFS default bootnodes and continued from there by sending FindNode packets for each common prefix length (and therefore bucket) until no more new nodes were learned. Therefore, if the IPFS network were static and nodes replied to requests deterministically, a crawl would always yield the same results. Due to the inherent dynamics in the overlay this is not the case: repeated crawls allow us to observe changes in the overlay over time.  Table I: Inverse cumulative session lengths: each row gives the number of sessions (and total percentage) that were longer than the given duration.

VII. CRAWLING RESULTS
We repeatedly crawled the IPFS network for a total duration of 6.98 d. Crawls were started one at a time and back to back, in the sense that as soon as a crawl was finished, a new one was started. We performed a total of 2400 crawls, with a single crawl taking an average of 4.10 min to complete.

A. Number of Nodes, Reachability and Churn
To get an idea for the size of the network, we first focus on the number of nodes in the network and their session lengths. During our 6.98 d, we found a total of 309404 distinct node IDs, with an average number of 44474 per crawl. This is consistent with the results obtained in Sec. V, hinting that both methods provide an adequate view of V , the set of non-client nodes in the IPFS overlay. Surprisingly, of all the nodes that were queried, the crawler was only able to connect to 6.55 %, on average.
We suspect that most IPFS nodes are run by private people connected through NAT. This hypothesis is supported by our results: about 52.19 % of all nodes report only local IP addresses for other nodes to connect to, which is exactly the behavior of nodes behind symmetric NATs (cf. Sec. VII-B). Furthermore, if most nodes are behind NATs, they are also prone to short uptimes, since these are probably used as client nodes which are shut down after use.
Exactly this behavior can be observed regarding the session lengths, which are depicted in Table I. We define a session as the time difference between the crawl, when we were able to reach the node and when it became unreachable again. The table depicts the inverse cumulative session lengths: each row yields the number of sessions (and their percentage) that were longer than the given duration. For example, roughly 56 % of all sessions were longer than 5 min, or equivalently, 44 % of all sessions were shorter than 5 min. This indicates that participation in IPFS is dynamic and rather short-lived. We also observed a periodic pattern in the number of nodes found through crawling, as shown in Fig. 7. The figure distinguishes between all nodes and nodes that were reachable, i. e., the crawler was able to establish a connection to these nodes. The significant increase in the number of nodes at the end of the measurement period could stem from other researchers' nodes or even an attack on the network. It can be seen that between noon and 19pm UTC, the number of nodes increases significantly. This might hint at a usage pattern in that users start their IPFS nodes on-demand in their spare time and shut them down after use. Additionally, this underlines the hypothesis of most nodes being operated by private people behind NATs, as the number of reachable nodes, i. e., nodes we could connect to, does not fluctuate as much.
One could argue that private users behind NATs will tend to use their nodes in their spare time in the evening. Hence, a usage pattern with peaks in the afternoon of UTC time hints to many users in Asia, since UTC afternoon corresponds to evening times in, e. g., China. This hypothesis is supported by the distribution of nodes over countries.    II depicts the top ten countries, both for all discovered nodes and for nodes that were reachable by our crawler 6 These ten countries contain 91.04 % (93.67 % in the case of reachable nodes) of the whole network, already hinting at centralization tendencies regarding the spatial distribution of nodes.

B. Node Distribution over Countries and Protocol Usage
Again, it can be seen that 52.19 % of all nodes only provide local or private IP addresses, thus making it impossible to connect to them. This is in line with the default behavior of IPFS when operated behind a NAT. When a node first comes online, it does not know its external IP address and therefore advertises the internal IP addresses to peers it connects to. These entries enter the DHT, since IPFS aims to provide support for building private IPFS networks. Over time, a node learns about its external multi-addresses (multi-addresses contain address and port, cf. Sec. III) from its peers. An IPFS considers these observed multi-addresses reachable, if at least four peers have reported the same multi-address in the last 40 minutes and the multi-address has been seen in the last ten minutes. This is never the case for symmetric NATs, which assign a unique external address and port for every connection, yielding a different multi-address for every connected peer. Furthermore, there is a significant difference visible especially between China and the U.S.: although most IPFS nodes are in China, the vast majority of reachable nodes stems from the U.S. As stated in Sec. III, IPFS supports connections through multiple network layer protocols; Table III shows the prevalence of encountered protocols during our crawls. If a node was reachable through multiple, say IPv4 addresses, we only count it as one occurence of IPv4 to not distort the count. The majority of nodes support connections through IPv4, followed by IPv6, whereas other protocols are barely used at all. The protocols "ipfs" and "p2p-circuit" are connections through IPFS' relay nodes, "dnsaddr", "dns4/6" are DNS-resolvable addresses and "onion3" signals TOR capabilities. Degree Relative frequency Figure 9: The same distribution as Fig. 8, but only including reachable (i. e. online) nodes.

C. Overlay Topology
Min.  A crawl yields a view on the nodes V ′ in the buckets G ′ = (V ′ , E ′ ), of non-client nodes, and their connections to each other, i. e. E ′ . As discussed in Sec. IV, we obtain a measurement of V ′ (which is approximately V ) and E ′ which is a strict subset of E. Nevertheless, G ′ = (V ′ , E ′ ) is the graph used by IPFS to locate data and nodes through the DHT and therefore provides a lot of insights.
Since there is a huge discrepancy between all discovered and the reachable nodes, and since we cannot measure the properties of unreachable nodes, we distinguish these two classes in the analysis. Fig.s 8 and 9 depict the log-log in-degree distribution from the first crawl; note that other crawls yielded similar results. We differentiate between all found nodes (Fig. 8) and only reachable nodes (Fig. 9). The (roughly) straight line in the figure indicates a highly skewed distribution where some peers have very high in-degree (up to 1000) whereas most peers have a fairly small in-degree. In other words, the in-degree distribution can be approximated by a power-law, hence, the graph can be classified as scale-free, which is in line with prior measurements on other Kademlia systems [10].
In the following, we specifically focus on the top degree nodes. Top degree nodes were defined as the 0.05 % of all nodes, yielding 22.2 nodes on average. We refrain from defining a number, say the 20 nodes with the highest degree, since this would weigh crawls with fewer nodes differently than crawls with a higher number of total observed nodes. Fig. 10 depicts a cumulative distribution of how many times the nodes with the highest degree were seen in the crawls. If a node was in the set of highest-degree nodes in one run but not in other runs, its "percentage seen" would be 1 # of crawls = 1 2400 = 0.0033 or 0.33 %. On the other extreme, if a node was within the highest degree nodes in every crawl, its percentage seen would be a 100 %.
The cumulative distribution in Fig. 10 shows a high churn within the highest degree nodes: approximately 80 % of nodes were only present in 10 % of the crawls. Only a few nodes have a high degree in the majority of all crawls; these nodes are the bootstrap nodes along a handful of others.

VIII. CONCLUSION AND FUTURE WORK
Founded in an analysis of network-layer mechanisms actually in use in the current IPFS implementation, we've presented several approaches towards mapping the IPFS overlay network. Using monitoring nodes and a 6.98 d crawl of the IPFS DHT, we obtain a holistic view on IPFS' node population as well as indicators about the larger overlay structure. Of the 44474 nodes that we found during each crawl on average, only 6.55 % responded to our connection attempts. This, among other indicators, hints at the fact that a majority of nodes is operated by private individuals. Lastly, we found that due to the combination of DHT-based and broadcast-based content retrieval, IPFS is a hybrid between structured and unstructured overlays; sacrificing performance for improving robustness.
Towards future works, we observe that our monitoring nodes can be extended to also record data request patterns (similarly to studies conducted in the Bitcoin peer-to-peer network [28]). As IPFS nodes broadcast each sought data item to each of their connected peers (cf. Sec. III-F), a node that is connected to every other node could monitor nearly all data requests in the network. While enabling insights into the "filesystem" side of IPFS, the success of such a measurement approach would also result in dire implications for the query privacy of IPFS users.