2

Most of the reading I've done about P2P networks are either about small scale simple mesh networks, where every peer can talk to another, or about high level protocols such as bittorrent, where data comes from a variety of sources, and locations can be decentralized by using a distributed hash table. But it still uses IP for routing packets, so packets will go to an ISP and large nodes and then filter back down to a small node again.

My understanding is because of the number of IP addresses, no one node can store them all, so packets have to be passed up to large nodes first, in the same way that a letter goes to the main sorting office of a country first, then to a city etc.

Given a very large network, would be possible to route a packet in an efficient manner without using high level addressing and passed between nodes of equal size, e.g. without saying 217.34.33.243, don't know where that goes, send it to 217 block, and they can send it on to subdivision 34.

I'm not quite sure what the right terms are for what I'm asking, so that would be useful as well. I'm calling it peer-to-peer and decentralized, but I'm not sure if that's correct.

8
  • 1
    Some of what you write about goes back to the original layer-2 networking. On layer-2, each host is a peer of every other host on the layer-2 network. It's not very efficient with large networks, which is why layer-3 networking (including IP) was introduced. When you talk about BitTorrent, that is above OSI layer-4, which is off-topic here. You could create your own layer-3 which meets your specifications (there were many layer-3 protocols over the years, but IP won), but don't expect it to be supported by any existing networks or equipment. – Ron Maupin Feb 24 '16 at 16:34
  • Thanks. Does layer 2 manage routing along a path through several nodes in a network or just adjacent nodes? What I'm trying to find is topologies where routing is done without either every node being connected or supernodes. – Tom Feb 24 '16 at 18:28
  • 1
    Layer-2 does not manage any routing through different hosts. Switches can manage layer-2 to a degree, but routing is a layer-3 thing. That is why I said you can create your own layer-3. It would be possible to install your own layer-3 in devices like PCs and servers, but routers are a different story. The Internet is based on IP, which stands for Internet Protocol. If you want something that works on the existing Internet, you will need to to use IP as layer-3 and do something in the upper layers (e.g. BitTorrent), but that would be off-topic here. – Ron Maupin Feb 24 '16 at 18:34
  • Could you give some examples of the alternative layer 3 proposals? Were any of them remotely non-hierarchical? – Tom Feb 25 '16 at 9:24
  • 1
    IPX, AppleTalk, CLNP, and, more recently, IPv6 are examples of layer-3 protocols which have been, and some are still being, used. IPX and AppleTalk were probably the closest thing to what you are looking for. They were developed at a time when networks were small, and extensions for larger networks were made. In IPX, the servers were the routers (although Cisco did support IPX), and there were advertisements on the network for everything to announce itself. AppleTalk was mostly peer-to-peer, but added zones, and Cisco supported it, too, for a while. – Ron Maupin Feb 25 '16 at 13:55
5

Based on your comment,,"The routing of the internet is still hierarchical and filters down through blocks to be efficient," you don't seem to understand the Internet.

The Internet is very decentralized. Each ISP connects to any other ISP it wants to, and the addressing is not hierarchical, as you seem to think. Yes, ISPs agree to get address blocks from some central authorities (RIRs), but the address blocks are not assigned in a hierarchical fashion (and with the IPv4 shortage, it gets worse as companies buy and sell address blocks to each other). For example, ISP A gets 123.123.0.0/16, and it peers with ISP B that has 134.0.0.0/8 and 213.12.0.0/22, and it also peers with ISP C that has 96.32.16.0/24, 145.83.56.0/24, and 178.45.0.0/16. The ISP addressing may be somewhat hierarchical within an ISP (only within any one of the assigned address blocks), but between ASes, it is certainly not. AS is Autonomous System, and each is autonomous from every other AS.

In any case, IP is going to be hierarchical at a local level in an assigned address block if the single address block is broken down into different networks. That is the nature of IP, and just about any layer-3 protocol. But, you could have multiple address blocks that do not relate to each other.

There used to be many layer-2 protocols that were strictly peer-to-peer. For example, ethernet is peer-to-peer. It has seemingly random addressing (MAC addresses), and hosts on an ethernet LAN communicate directly through ethernet and MAC addresses. There were LAN protocols that simply used the LAN addressing, and they were peer-to-peer.

If you want to communicate with a host in a different LAN, then you must pass through a layer-3 device (router), and that device must have knowledge of how to reach other layer-3 networks. That may be through other routers, or it may be directly attached to the other networks. The different networks do not need to be consecutive, hierarchical or even the same size.

One thing you wrote seemed to indicate that you may think that the different octets in an IP address have meaning, but they do not. They are simply to make it easier for humans to read the address, which is a 32-bit binary number. A network mask will indicate which part of the 32-bit number is the network, and which part is the host address, and that can vary a lot, and it often doesn't fall on the octet boundaries. For example, the address 10.11.12.13/15 is in the 10.10.0.0/15 network, not the 10.11.0.0/15 network. The network part of the address ends before the end of the second octet. That network could be attached to a router that has wildly different addressing on the other interfaces of the router, so it is not inherently hierarchical.

A host that communicates with another host on the same ethernet LAN will communicate directly with that host. The host will compare the destination layer-3 address with its own layer-3 address and mask to determine that the destination is on the same LAN, and it will then create a layer-2 frame addressed to the destination host. This can use IP as the layer-3 protocol, and it is still peer-to-peer.

If the destination host is on a different network, then the source host will use the layer-2 address of its configured gateway as the destination address in the layer-2 frame it creates, and the layer-2 frame will be delivered to the gateway.

The gateway will strip off the frame, losing any layer-2 addressing (both source and destination). The router will look at the destination layer-3 address and search its routing table for a match. If there is no match, the packet is dropped. If there is a match, then the router will create a new frame for the interface indicated in the routing table, and it will forward the new frame out that interface. This is where you lose peer-to-peer, although the addressing may not be consecutive or hierarchical.

On a single LAN, you can have a true peer-to-peer connection, but to get from one LAN to another LAN, you must have some type of map and a way to get from one LAN to another LAN.

The part about the higher level protocols creating peer-to-peer networks is really off-topic here because protocols above OSI layer-4 are off-topic here.


The problem with scaling on a layer-2 peer-to-peer network is that broadcasts must be used, and at some point, broadcasts will overwhelm the regular traffic. When a host receives a broadcast, which is sent to every host, it must interrupt whatever it is doing and check to see if the broadcast is for it.

At the start, a host will not know its neighbors and addresses, so it must broadcast in order to discover a particular neighbor. It can then build a table that includes that particular neighbor. The table will have limits, and entries in the table must also time out or it will end up with a bunch of dead neighbors in it. To populate the table, the host must first broadcast for the neighbor to which it want to communicate.

At some point, the LAN will be saturated with broadcasts, and it will collapse under the weight. That is why we limit the size of LANs and impose layer-3 networking, which can have some type of hierarchy, or maybe not.

2
  • Thanks - this is a great comprehensive answer. I have read it through several times to try to take it all in. – Tom Aug 19 '17 at 15:21
  • If the network addressing of the Internet was hierarchical, then the Internet routing tables would not need to be approaching 1,000,000 entries as they are today. The plan for IPv6 was to be assigned in a hierarchical manner, but that fell apart right away. The peering between ASes is probably closer to what you are looking for than just about anything else. ASes connect in a peer-to-peer fashion. – Ron Maupin Aug 19 '17 at 17:27
1

A considerable amount of work has been done on layer-2 routing. I don't know if you have already explored layer-2 mesh networking protocols like B.A.T.M.A.N Advanced, BMX6, CJDNS (not really layer-2 but tries to redefine certain things at that layer). If not, do explore.

Also visit battlemesh_dot_org.

0

Yes. One such network is called the Internet. Practically speaking there is no limit to the number of nodes, especially when accounting for IPv6.

2
  • The problem with IPv4 and IPv6 is that the node IDs are centrally assigned, so they are not completely distributed. – Eduardo Jun 17 '17 at 11:21
  • Yes but the routing is not decentralised, which is the part I'm interested in. The routing of the internet is still hierarchical and filters down through blocks to be efficient. – Tom Aug 16 '17 at 16:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.