How to build a Peer to Peer P2P Network??

Hello. My name is Enrique. I am planning to build a P2P network. It can be very simple, and it is intended to be run on Windows, XP and 7. How i can do this??

I have looked at internet but i only find linux examples. I will try to read linux sources to see if i can copy the logic, but i can not guarantee anything.

Do you know some open source simple very simple P2P network?? It can be without protections, like hashing. Something mountable from scratch.

I have developed also a little project that i have released in Github: github.com/enriquemesa8080 You can see it. My programming skills are demonstrated there, i have many skills but i lack some fluency in some places.

About the P2P i have no developed nothing yet because i don't know where to start. Do you have some book about P2P in C++?? I expect it to be free.

Thanks for your help.

I have looked at internet but i only find linux examples.
The networking will be identical.

Do you know some open source simple very simple P2P network?? It can be without protections, like hashing.
Hashing? You're talking about something than a P2P network. I suspect you mean file sharing or something like that .. this higher level stuff goes beyond networking. There's sample stuff for almost everything that's been done before. Have you looked on shard public repos like github/gitlab/sourceforge?

i don't know where to start.
You could by learning about how IP networks work and how to program them. It's simply astonishing how many folk want to write network code without bothering to learn anything about networking.
have you done anything at all? can you, for example, write code that sends a file from one computer to another with TCP socket code off the top of your head, or would that be new to you?
Yes. I have prior experience working with TCP, as a server and as a client. I know how to build networking, including multiclient, i understand that kind of examples. But i don't understand how to turn common server-client architechture into peer to peer.

For example. I have read a note that says that a user connects to a server of bootstrap holding all IP addresses of nodes. And each node handwires a connection to each node after it.

Is valid for a node to keep more than ten connections to other nodes as same time?? This means, that if network is of a 50 computers, then each node has 50 connections between themselves?? Can be this considered a little TCP peer to peer app??

I said copy the logic because i understand networking but i don't understand how networking left server-client and start to be peer to peer. Thanks for your help. I will to left you some links. https://www.geeksforgeeks.org/p2ppeer-to-peer-file-sharing/

This is the linux code that i have seen.

https://github.com/mitrapinaki/PeerToPeer

It starts two threads, one as server, and other as client. Is right to add a bootstrap server?? I want to make it in that way in this beggining. Of course the source apparently don't uses bootstrapping server. I am a Windows Programmer using MinGW, and i have no good experience adapting source codes. I will try to run it.

Assume that i understand the basics of a server-client app. (Winsock)

Thanks for your help.
i understand networking but i don't understand how networking left server-client and start to be peer to peer.
There are two common network models built on IP, client-server that setup streams for data transfer (using TCP), and any to any connections that pass datagrams (using UDP).

It sounds like brush up on the latter. The GeeksForGeeks link alludes to it, but doesn't describe it. I couldn't find any links to anything useful. You probably need a text book like vol 3 of Douglas Comer's series on networking, but nearly 30 years later they're still really expensive.

Is valid for a node to keep more than ten connections to other nodes as same time??
Yes. TCP servers of big tech companies are easily expected to handle 40K connections at any one time.

The github link isn't particularly useful.

I suggest you stop and think about what you want you project to do, then you can decide how to do it. I am unclear on what exactly you want to do.
RakNet has P2P and it works on Windows, Linux and even mobile now.

https://github.com/facebookarchive/RakNet
Last edited on
this is going to be frustrating.. you have the unenviable choice of trying to unravel a project with a substantial amount of code or buying book; I don't think you will find a 10 cent answer on the web or a simple example that is sufficient for a real project. I haven't even found a simple example period, and I looked for a few min.

Yes. TCP servers of big tech companies are easily expected to handle 40K connections at any one time.
^^ your PC can't handle this lol. Those servers have multiple network cards and bandwidth. In ~2005 though we had tiny embedded pcs with 1 built in netcard running 10-20 connections without any problems, so you can do a LOT with a pc. Push the limits, see what you can do with how much hardware, and THAT info is fairly readily available online.
Last edited on
Thanks for your help.
Topic archived. No new replies allowed.