frp icon indicating copy to clipboard operation
frp copied to clipboard

Fix XTCP timeout & Symmetric NAT client

Open arm64v8a opened this issue 3 years ago • 10 comments

See #1585 #1795

Add processing when visitor receives the client's reply earlier than the server's. Fix timeout. Use ListenUDP rather than Dial. This make XTCP works when client is Symmetric NAT.

arm64v8a avatar May 01 '21 15:05 arm64v8a

请问测试是否稳定?

jliveusa avatar Jun 12 '21 10:06 jliveusa

请问测试是否稳定?

稳定。

测试环境:

  1. Client: Symmetric NAT / Visitor: FullCone NAT
  2. Client: FullCone NAT / Visitor: Symmetric NAT

arm64v8a avatar Jun 13 '21 07:06 arm64v8a

I have cloned your patch1 branch and I compiled it on Ubuntu18, tested on my working situation. SSH Server is in a Symmertic NAT and SSH Client is in a PortRestrictedCone NAT. Worked Just Well at the moment!

kxdkxd avatar Oct 09 '21 17:10 kxdkxd

image However I am still receiving these error. Green cmd is my WEBDAV server. Even though the UDP met error temporarily, it established connection eventually. This is a point to improve!!!

kxdkxd avatar Oct 09 '21 17:10 kxdkxd

image Longer test shows that, I made WinSCP to keep alive an SSH connection, however, from a certain moment, the nat hole can not made succeess anymore, plz help us with this problem, thx!!

kxdkxd avatar Oct 10 '21 03:10 kxdkxd

@fatedier

  • [ ]

commit

jambestwick avatar Nov 25 '21 15:11 jambestwick

楼主 这个分支还合么 。 快1年了 😂 @fatedier

likohank avatar Mar 08 '22 12:03 likohank

去年有这个需求,便改了一下。我现在已经不太记得了。

可以参考这篇文章

理论上只有三种 NAT 穿透类型不能连通,而当时 frp 的打洞有问题,只要有对称 NAT 都不能连通

可以对着这篇文章检查一下。即使不合这个 PR 也对完善打洞有帮助。

@fatedier @likohank

arm64v8a avatar Mar 08 '22 15:03 arm64v8a

最近看了frp打洞部分的代码,发现了这个issue,本想提一个PR,才发现已经有人提了PR。 @arm64v8a 代码还可以有些许优化,考虑到UDP丢包,在打洞期间,建议每次发包3次,每次间隔1秒。 Client: 1.向Visitor发包3次 2.收到sid包并确认正确后,向real Visitor发包3次

Visitor: 1.向Client发包3次 2.收到sid包并确认正确后,向real Client发包3次

如此,可以穿越绝大部分NAT组合。仅有对称+对称,对称+端口受限锥形不能穿越。

@arm64v8a 希望可以再优化一版代码,谢谢。 @fatedier 希望完整的打洞代码可以merge.

ximiximi1 avatar Mar 09 '22 13:03 ximiximi1

最近看了frp打洞部分的代码,发现了这个issue,本想提一个PR,才发现已经有人提了PR。 @arm64v8a 代码还可以有些许优化,考虑到UDP丢包,在打洞期间,建议每次发包3次,每次间隔1秒。 Client: 1.向Visitor发包3次 2.收到sid包并确认正确后,向real Visitor发包3次

Visitor: 1.向Client发包3次 2.收到sid包并确认正确后,向real Client发包3次

如此,可以穿越绝大部分NAT组合。仅有对称+对称,对称+端口受限锥形不能穿越。

@arm64v8a 希望可以再优化一版代码,谢谢。 @fatedier 希望完整的打洞代码可以merge.

目前的实现方式比较初级,也没有太多精力放在 p2p 上面,加上测试也比较麻烦,所以暂时不打算继续深入下去。 等之后基于 v2 可能会有新的实现,或者在有足够空闲时间的时候再来做这方面的事情。

fatedier avatar Mar 09 '22 13:03 fatedier