In the previous article, we learned about the basic building block of TOP’s network architecture: Distributed Hash Tables (DHTs). Now we will take a brief look at how these building blocks are strung together to form the network architecture of TOP Network.

Network Topology

As the previous article noted, TOP’s network topology has some similarities to the Internet. The Internet is one big network of interconnected networks, while TOP Network is one big p2p network consisting of many interconnected p2p networks.

TOP Network is an overlay network, meaning TOP’s network topology is software defined and runs atop the Internet. The architecture consists of a large distributed backbone mesh network, and many sub mesh networks. A mesh network is simply a p2p network of nodes where each node directly connects to a portion of the other nodes.

To be more specific, the topology of the backbone network will follow that of the Kademlia DHT implementation, although this pictorial representation is sufficient for explanation purposes.

Network to Node Virtualization

Here’s where things get interesting. Each node in the distributed backbone network can actually be a network in itself. Each sub-network, whether that be the VPN service network, a consensus group, or whatever else, can be virtualized as a single node. This is where the analogy to the Internet get’s its origins. The backbone network is a mesh network where each node can be a sub mesh network; one big mesh network of mesh networks.

This is similar to the Internet Service Provider (ISP) hierarchy present in the Internet Infrastructure. Tier 1 ISP backbone networks route data between continents around the globe, and subsequently connect to regional Tier 2 ISPs. Tier 2 ISPs then route data regionally using their own local backbone networks.

In TOP’s architecture, the Tier 1 network would be the yellow network depicted above which routes “globally” between different mesh networks. The Tier 2 networks are the sub mesh networks which have their own backbone networks to route “regionally” within that sub-network.

The sub-networks generally have the same topology as the Tier 1 backbone network. Therefore, the overall topology can be thought of as many interconnected and layered Kademlia DHTs.

Fast Routing

There are many different sub-networks associated with TOP Network. Each shard of TOP Chain is a p2p network, each service chain is a p2p network, each communication function on the service layer is a p2p network etc. If all the nodes involved with each of TOP Network’s sub-networks were put into one big mesh network, routing would be inefficient. Having layered sub-networks allows for much faster routing and relevant node discovery.

The reason for this is that with a single monolithic network, routing would take just as long whether or not it’s known what type of node is being searched for. With a network of networks architecture, it is possible to use prefix routing to greatly increase efficiency and speed.

XIP address

On the Internet, each device is assigned an IP address. To communicate with a device over the Internet, all that’s needed is the IP address, and the Internet Protocol takes care of the routing. Analogously, each node on TOP Network is assigned what’s called an “XIP” address. Given an XIP address, the TOP routing protocol can quickly route to the node to which the XIP address belongs.

As mentioned previously, each Tier 1 backbone node can be a network in itself. All the nodes in a given sub-network — which is itself virtualized as a single backbone “node” — will have a common XIP prefix. The suffix can then determine the specific node within that sub-network.

Let’s take the example of the VPN service network. All VPN service node XIP addresses will have a common prefix. If a client was attempting to use a VPN app built on TOP Network, finding the correct VPN service node and VPN relay nodes would be simple, since the prefix indicates where to look.

Instead of searching throughout all the nodes of TOP Network, the prefix narrows the search down to only the relevant sub-network.

In terms of the TOP public chain, this type of network architecture makes routing between shards much more efficient. Each shard cluster can be virtualized as a single node, with all nodes within a shard having a common prefix. This allows cross-shard transactions to be quickly sent to the relevant shards, instead of needing to sift through all the nodes in the network.