Location-based addressing vs Content-based addressing

Location-based addressing vs Content-based addressing

Location-based addressing and content-based addressing are two different approaches to identifying and accessing data in a network. In this article, we will explore how these systems work, what are their benefits and challenges, and what are some popular applications that use them.


Location-based addressing is a way of identifying and accessing data by its physical location in a network.

Location-based addressing is a common way of networking where each node has a specific address that helps to route messages to it. It uses IP addresses, which are numerical designations assigned to each device connected to a network. An IP address indicates the location of a resource, but not what the resource is or what it contains. For instance, WWW uses location-based addressing called URLs to point to documents, where each file is represented by a list of one or more locations, the path, and the filename, on the physical storage.

For example,?to access a website, you need to know its IP address or use the Domain Name System "DNS" (which Maps a human-readable name?to an IP address). Location-based addressing works well for static and centralized networks, where data stays in one place and nodes have fixed addresses.

But location-based addressing has some challenges for dynamic and decentralized networks, where data can move or copy across different nodes, and nodes can come or go from the network anytime. e.g, if an existing location changes in any way, like the filename changes, or if the server moves to a new DNS?name, or just expired, the document is no longer accessible. this makes location-based addressing links less reliable as any link can later rots.

In some situations, location-based addressing can create issues such as:

  • Address exhaustion: There may not be enough addresses for all the nodes in the network.
  • Address management: Assigning and maintaining addresses may need a central authority (One single authority/node taking care of the address pool) or a complicated protocol that can add overhead and security risks.
  • Address resolution: The link between addresses and locations may change often and need frequent updates or lookups that can raise latency and bandwidth usage.
  • Address dependency: The access to data relies on the availability and reachability of the node that has it, which can lower reliability and performance.


Content-based addressing is a way of identifying and accessing data by its content, regardless of its physical location (not known anyway).

Content-based addressing is an alternative and more innovative way to identify and locate resources on a network that tries to solve location-based addressing limitations in dynamic and decentralized networks.

In content-based addressing each piece of data has a unique identifier that helps to find and get it. this unique identifier is derived from the data itself using a hash function. For example, when visiting a website hosted on IPFS, a content-based addressing distributed storage system, all you need to know is the CID for the website, which is unique and verifiable, and once the content is requested by your computer, it can be easily downloaded from any source (node) which share it at that time. As opposed to centrally located servers, Any user in the network can serve a file by its content address, and other peers in the network can find and request that content from any node that has it using a distributed hash table (DHT). this makes such systems immutable and more resilient to things like link rot, hacks, and censorship.

Content-based addressing is more fitting for dynamic and decentralized networks, where data can be spread and copied across multiple nodes, and nodes can come or go from the network anytime. In these situations, content-based addressing can offer some benefits over traditional Location-based addressing such as:

  • Address scalability: There are virtually unlimited identifiers for any amount of data in the network.
  • Address autonomy: Each node can create and check identifiers by itself without needing a central authority or a complicated protocol.
  • Address resolution: The link between identifiers and locations can be done by using distributed hash tables (DHTs) or other decentralized methods that can lower latency and bandwidth usage.
  • Address independence: The access to data does not rely on any specific node, but on any node that has a copy of it, which can improve reliability and performance.


however, Content-based addressing could have some issues too, such as:

  • Content duplication: Content-based addressing can create multiple copies of the same data across different nodes, which can consume more storage space and network bandwidth than necessary.
  • Content discovery: Content-based addressing require efficient mechanisms to locate and retrieve data by its identifier, such as distributed hash tables (DHTs) or other decentralized methods, which can introduce complexity and overhead in the network.
  • Incentive: Content-based addressing could rely on voluntary participation and the altruism of peers to store and share files, which may not be sustainable or scalable in the long term. such systems could face several challenges in designing and implementing an effective and efficient incentive scheme.


Now let's take a look at some popular applications that use content-based addressing.

  • Git is a distributed version control system that tracks changes in any set of computer files, usually used for coordinating work among programmers collaboratively. Git uses content-based addressing to store and compare different versions of a project. Git passes the content of each file through SHA-1, a cryptographic hash function, to generate a unique key called object id. Git then stores these objects in a directory named with the first two characters of the key, and a file named with the remaining 38 characters.?Git can quickly compare two versions of a project by comparing their keys, and avoid storing duplicate content by checking if the key already exists.
  • IPFS is a distributed system for storing and accessing files, websites, applications, and data. IPFS uses content-based addressing to store and share files in a peer-to-peer network. IPFS also passes the content of each file through a cryptographic hash function to generate a unique key, called the “content identifier”. IPFS then distributes these files across multiple nodes in the network and uses distributed hash tables (DHTs) or other decentralized mechanisms to map the keys to the locations of the nodes that have them.?IPFS can efficiently locate and retrieve any file by using its key, and ensure that the file is authentic and unchanged by verifying its hash


In summary, location-based addressing and content-based addressing are two different ways of identifying and accessing data in a network. Location-based addressing is more suitable for static and centralized networks, while content-based addressing can offer benefits such as scalability, autonomy, resolution, and independence, and is more suitable for modern, dynamic, and decentralized networks. Both methods have advantages and disadvantages depending on the context and the application.

If you are interested in learning more about content-based addressing and how it can enable a more distributed and resilient web, I recommend checking out the IPFS website. Thank you for reading and feel free to share your thoughts and questions in the comments below.

要查看或添加评论,请登录

Sameh Farouk的更多文章

社区洞察