Skip to main content

Peer-To-Peer Networking

Peer-to-peer is a networking model where the two parties involved in either sides of a connection have the same functionality. In contrast, Server-Client model offers one party to run a service while the other uses it. In P2P, both parties are servers+clients themselves and each party is called a 'node'.


For two devices to connect P2P,

They must;

  1. be able to communicate with each other
  2. be able to see whether the partner is accepting connections or not.

P2P networking can be observed at 2 levels.
1. Within a LAN (Local Area Network)

P2P Within LAN 

P2P within a LAN is quite simple and most Operating Systems have builtin P2P functionality. A familiar example would be file, device sharing within the LAN.

  • There's no problem communicating within the LAN
  • And each node can fairly easily detect which other nodes are available


P2P Over the Internet

P2P over the Internet was also fairly simple at the past stages of the Internet where each an every computer/device had a unique Public and Static IP address. But that's no longer the situation.

  1.  The IPv4 addressing system became inadequate to assign Public IP addresses to every device. As a result, only LANs may be assigned a public IP. Then, all the devices within the LAN will have the same public IP and it's going to be hard to lock on to a single device among them.
  2.  NATs(Network Address Translaters) are the gateways that rest between such LANs and the WAN- mostly the router. Because of its design, NATs will refuse connections from the WAN into the LAN. The only connections possible should originate from within the LAN.(This is the worst case)
  3.  Devices with dynamic IP addresses are much difficult to be tracked.

Relatively, its much more tough to work on purely P2P basis. Each node will have to scan the Internet to detect other available nodes which is going to be very very consuming. Besides, there's no simple way of keeping track of nodes with dynamic IPs; each time those nodes connect on and off the Internet, they'll have different different IP addresses.


Solution

Therefore, the easiest way for establishing P2P involves mixing a little bit of server-client architecture and use support from a central server. The central server keeps track of the nodes and provide connectivity information between the nodes. Other than that, there's no data streaming through the server.

Each time a node joins the WAN, it connects to the central server and introduces itself as a node. The server maintains a list of active nodes. With the help of this, nodes can virtually see each other and will get to know the exact IPs of each other. Thus, nodes can see each other.


However, this doesn't solve all the cases. Even if nodes see each other and know where they are, they may not be able to connect! This is because NAT gateway devices don't allow connections from the Internet to reach a device under it. If both nodes are under NATs, connection seems impossible. However, there are some ways around to get past the NAT. One such technique is called 'UDP Hole Punching' where both nodes send 'connect' signals to each other simultaneously and eventually trick the NATs to think connection started from within its territory.

Conclusion

P2P is considered a bit advanced technology implementation. It allows two devices to utilize maximum performance while transferring payloads between each other. Skype and Bittorrent are some famous uses of P2P. P2P may also be used by hackers for creating and commanding botnets. Even though Peer-to-peer was supposed to mean a decentralized the Internet, it has become difficult to implement its strict sense. That is why most people argue P2P is not pure P2P. It has come clear centralization is not something to give-up easily neither something which can be so easily.

Useful Articles to read

Comments

Popular posts from this blog

Why Canned Salmon Got Soft Bones

Canned Salmon is a nutritious food, especially for protein and calcium. You can eat it right out of the tin. The fish bones are very soft and tender that they can hardly be noticed. It is a good source of easily digested and absorbed Calcium. But what made them so soft? Is it really safe to eat? because fresh Salmon bones look nothing like it!

Making and Extracting CAB files in Windows

Cabinet files(a.k.a. Diamond files) are the Microsoft Windows Archives. These archives can store multiple files/folders into a single file with or without involving data compression. Since every Windows system is natively compatible with cab files, Windows provide enough facilities to create, extract, or rebuild cab files without requiring additional software.

Why Atmosphere is Thicker at Equator

Atmosphere is the layer of gases that surrounds the Earth retained by Earth's gravity. Have you ever come across the question; what is the shape of the atmosphere? It's fair to think that the atmosphere is shaped somewhat like the Earth itself. because of gravity. We know that the Earth is not a perfect sphere. So, We can assume atmosphere to have a similar shape. But amazingly, the shape of the Atmosphere is affected by a lot of factors and the deformation is even more. Lets see why that is..