cnbatch / kcptube

同时支持传送TCP与UDP的KCP通道,附带端口跳跃的功能,以及FEC,自带中继服务器支持
BSD 3-Clause "New" or "Revised" License
95 stars 10 forks source link

what is the meaning of the dport_refresh parameter? #6

Closed aa51513 closed 10 months ago

aa51513 commented 11 months ago

Is d an abbreviation for destination? 这里的d是否是destination的缩写词?

Based on the above guesses, I think that dport_refresh refers to the refresh interval of the UDP target port, is my understanding correct? 基于以上猜测,我认为dport_refresh指的是udp目标端口刷新的时间间隔,我的理解是否正确?

I'm also wondering, why would flushing the destination port be considered, rather than modifying the source port? 我还想知道,为什么会考虑刷新目标端口,而不是修改源端口?

cnbatch commented 11 months ago

Both kcptube and udphop have the same meaning for "dport_refresh": it can be either a destination or dynamic. 无论是 kcptube 还是 udphop,这个 dport_refresh 的意思都是一样的:既可以是 destination,又可以是 dynamic。

I have mentioned in https://www.v2ex.com/t/956158 under ‘features’: ‘unconditional port jumping (even when the server is in single-port mode, the client still changes the sending port).’ 我在 https://www.v2ex.com/t/956158 列出“特点”时就提到过:“无条件端口跳跃(服务器单端口模式时客户端照样更换发送端口)”

In other words, the source port of the client will always be changed. 换句话说,客户端的源端口一定会更换的。

There is one difference between kcptube and udphopdport_refresh=0 can be set in kcptube to completely disable port refreshing. Once disabled, no ports will be changed anymore. 相较于 udphop,kcptube 有个不同之处——可以设置 dport_refresh=0 彻底禁用端口刷新,禁用后就不再更换任何端口了。