Posts

Showing posts with the label Linux网络编程

Valorant requires a restart or loads slowly when entering the game. What can I do? I have an idea.

Valorant is a free first -person tactical shooting game developed by Riot Games, which combines the exact system of arms shooting and heroism. Players will be transformed into agents and will compete for target points using team collaboration, tactical layout and skills cooperation 5V5 offensive and defense stroke. The game has a low economic system and high competitiveness. Before each game start, buy weapons and armor according to tactical needs and use a combination of heroic skills to create the benefits of the battlefield. Its solid ballistic mechanism and map design require players for accurate purposes and tactical decision -making. At the same time, the rich character pool and skill combination give the game a strategic depth. If you have the problems you need to restart or slowly load while playing a "Varorant", try the following systematic solution: Network environment optimization is the main solution. Because valante servers can be introduced abroad, physical dist...

net.ipv4.ip_local_port_range 的值究竟影响了啥,和UDP connect之间的关系是什么?

前言 网上关于  net.ipv4.ip_local_port_range  的值的效果众说纷纭(下面所说的连接都假定使用的是相同的协议(都是 TCP 或 UDP)): 大部分文章都说这个值决定了客户端的一个 ip 可用的端口数量,即一个 ip 最多只能创建 60K 多一点的连接(1025-65535),如果要突破这个限制需要客户端机器绑定多个 ip。 还有部分文章说的是这个值决定的是 socket 四元组中的本地端口数量,即一个 ip 对同一个目标 ip+port 最多可以创建 60K 多一点连接,只要目标 ip 或端口不一样就可以使用相同的本地端口,不一定需要多个客户端 ip 就可以突破端口数量限制。 文档  中的介绍也很模糊: ip_local_port_range - 2 INTEGERS Defines the local port range that is used by TCP and UDP to choose the local port. The first number is the first, the second the last local port number. If possible, it is better these numbers have different parity. (one even and one odd values) The default values are 32768 and 60999 respectively. 下面就通过TCP来做一些实验来确认这个选项的实际效果。 实验环境: $ uname -a Linux vagrant 4.15.0-29-generic #31-Ubuntu SMP Tue Jul 17 15:39:52 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux 相同目标 ip 和相同目标端口下的端口数量限制 先设置 ip_local_port_range 的值为非常小的范围: $ echo "61000 61001" | sudo tee /proc/sys/net/ipv4/ip_local_port_range 61000 61001 $ cat /proc/sy...