MultiAddr

MultiAddr

What is Addressing?

Addressing is used when two nodes in a network want to communicate with each other. For example, if you want to send something to your friend, you require his/her address, or if you want to send someone an email you need their email address.

When a node wants to communicate with another node, remotely in the same network, they need to know the address of each other.

There are multiple schemes of Addressing. In a communication architecture like TCP/IP you can have the following types -

  1. Physical address - provided by your Local Area Network to all connected nodes. It is the lowest level of address.

  2. Logical Address - This is used to communicate with nodes on different networks. It has a broader scope than a physical address. It is the IP address provided to the nodes connected to the internet.

  3. Port Address - A computer runs many processes at the same time. This address tells which process should receive the data after it is received by the node

But it doesn't end there. Across the multiple networks which can use different communication protocols where each one of them has its own addressing format.

The most commonly used standard is Transmission Control Protocol/Internet Protocol (TCP/IP) which uses the above-mentioned addressing formats across the Internet that we use daily.

Other Networking Protocols

In addition to TCP/IP there are other protocols listed here which can have their own addressing schemes to locate and communicate with peers -

  1. UDP - User Datagram Protocol. Generally used for streaming or online activities which require real-time services. Similar to TCP, but less reliable.

  2. HTTPS - Hypertext Transfer Protocols. Used for communicating between browsers and web servers. HTTP is the standard protocol to share data on the World Wide Web

  3. FTP - File Transfer Protocol. It is used for transferring files between nodes on a network.

  4. NFS - Network File System. Allows remote access to one's computer, enables remote file sharing and access

  5. WebSockets - A communication protocol providing channels over a single long-lived connection. Commonly used for real-time web applications.

Many of the protocols leverage the IP address directly or indirectly of the nodes to determine the destination of the message.

HTTPS uses URIs (Uniform Resource Identifiers) which include URLs (Uniform Resource Locators) which can contain either an IP address or domain names.

Generally when communication happens between 2 nodes it may or may not be over the same network, but can be using the same protocol.

This is because a node needs to know the addressing scheme to locate the destination where it has to send a message.

An updated addressing standard aims to make communication more flexible and robust. This standard is known as MultiAddressing or MultiAddr.

MultiAddr

MultiAddr refers to a standardised format which is used to represent a network address using various protocols together.

This gives it more advantage over previous addressing schemes making it more flexible as it allows communication over different protocols and future proof, meaning that any new communication protocol can be easily accommodated in this addressing format.

MultiAddr standard is protocol-agnostic. This means that it is not confined to any one protocol standard like just using the IP address in case of TCP.

It is able to accommodate any new standard like a combination of TCP/IP and UDP.

The convention of encoding multiple layers of addresses into a single path defines a human and machine-readable format. Take this for an example /ip4/127.0.0.1/udp/1234

The part /ip4/127.0.0.1 tells us we want that address of IPv4 TCP protocol and will be sending UDP packets on the port 1234.

MultiAddr is composable. We can layer different protocols on top of each other to create better schemes. Another example is a secure TCP connection using TLS /ip4/127.0.0.1/tcp/80/tls . This encrypts a basic TCP connection.

The schemes which use such standards provide clear information about the protocol to use and the location of where the data can be accessed or delivered. This is clearly shown using the Inter-Planetary File System scheme to locate a file

This /ipfs/QmWAT5TFyj3v7vQ5F3DfWjX738Y7rE2c451537F54VY7C clearly identifies the protocol in use which is IPFS and the hash of the specific file being accessed.

Using a multiaddr standard network applications can be built more flexible and interoperable in a dynamic growing world of tech.