P2P通信方式

发布于 2024-12-03 15:46:25 字数 326 浏览 0 评论 0原文

我一直在尝试服务器-客户端应用程序编程,并想探索 P2P。我不知道从哪里开始。

我正在考虑一种方法,(每个用户称为一个节点)

每个节点都由服务器和连接到其他节点的服务器的不同客户端实例组成。所以基本上node1是node2和node3的服务器和客户端,node2是node1和node3的服务器和客户端,node3是node1和node2的服务器和客户端。节点可以通过向中央服务器提交信息来了解彼此。

我不确定这是一种盗版方法,因为如果节点数量增加,我认为这不会真正起作用。

我正在寻找的是资源或其背后方法的基本思想,或者我是否走在正确的轨道上。

提前致谢。

I've been experimenting with server-client application programming and want to explore P2P. I don't know where to start.

I was thinking of a method, (each user is referred to as a node)

Each node is built up of a server and different client instances connected to other node's servers. So basically node1 is a server and client to node2 and 3, node2 is a server and client to node1 and node3, and node3 is a server and client to node1 and node2. And the nodes would know about each other by submitting information to a central server.

I am not sure it this is a piratical method, because if the number of nodes increases I don't think this could really function.

What I am looking for is resources or a basic idea of the method behind it, or am I on the right track.

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

望喜 2024-12-10 15:46:25

每个节点由服务器和不同的客户端实例组成
连接到其他节点的服务器。所以基本上node1是一个服务器
节点2和3的客户端,节点2是节点1的服务器和客户端
node3,node3是node1和node2的服务器和客户端。还有
节点可以通过向某个节点提交信息来了解彼此
中央服务器。

通常,人们谈论两种类型的对等点:边缘对等点(= 您所说的客户端对等点)和超级对等点(= 您所说的服务器对等点)。通常,超级对等点是具有额外功能以支持 P2P 网络结构的边缘对等点。

因此,您不能(也不应该)让给定的对等方充当某些对等方的服务器和其他对等方的客户端。它应该与每个人都是边缘或与每个人都超级。

您需要发布一组种子(即超级节点的位置),而不是中央服务器。然后,边缘节点获取这些种子并开始连接到超级节点之一。 P2P 网络中不存在中央服务器,而是一组超级对等点。

Each node is built up of a server and different client instances
connected to other node's servers. So basically node1 is a server and
client to node2 and 3, node2 is a server and client to node1 and
node3, and node3 is a server and client to node1 and node2. And the
nodes would know about each other by submitting information to a
central server.

Often, people talk about two types of peers: edges peers (= what you call client peer) and super peers (= what you call server peer). Typically, a super peer is an edge peer with extra functionalities to support the structure of the P2P network.

So, you can't (and should not) have a given peer behaving as a server from some peers and as a client for others. It should be edge with everyone or super with everyone.

Instead of a central server, you need to publish a set of seeds (i.e., location of super peers). Then, edge peers fetch those seeds and start to connect to one of the super peers. There is no such things as a central server in a P2P network, but rather a set of super peers.

起风了 2024-12-10 15:46:25

您可能想查看 ZeroMQ 库和 相关指南 - 其中有一些关于设计这样的分布式系统的有用内容,以及您会发现的一些相关问题。

You might want to take a look at the ZeroMQ library and associated guide - there's some useful stuff in there about designing distributed systems like this, and some of the associated problems you'll find.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文