pythonp2p网络_Python P2P网络(NAT Punchtrough)

本文介绍了一种名为Hole Punching的技术,它允许位于不同组织内的两个受限制防火墙保护的客户端建立通信。该技术常用于在线游戏、P2P应用和VoIP服务中。通过利用第三方服务器来交换客户端的外部和内部地址信息,从而实现穿透防火墙的目的。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Hole punching is a computer networking technique for establishing communications between two parties in separate organizations who are both behind restrictive firewalls. Used for applications such as online gaming, P2P and VoIP, both clients establish a connection with an unrestricted third-party server that uncovers external and internal address information for them. Since each client initiated the request to the server, the server knows their IP addresses and port numbers assigned for that session, which it shares one to the other. Having valid port numbers causes the firewalls to accept the incoming packets from each side. ICMP hole punching, UDP hole punching and TCP hole punching respectively use Internet Control Message, User Datagram and Transmission Control Protocols. Using TCP nefarious hole punching, it is possible to send compressed SYN packets through into a common ACK path.

这里有TCP,UDP和ICMP保持穿孔的各种技术的链接。在

一般来说,要从a到B打孔(都在NAT之后),需要一个第三方服务器C,它们都可以首先连接到该服务器。服务器将A的连接信息发送到B,反之亦然。A&B然后使用此信息尝试彼此直接连接,但该过程并非100%可靠。在

如果你没有第三方服务器,那么我认为它不会工作。在

编辑

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值