Skip to content

Commit

Permalink
update parameters pages
Browse files Browse the repository at this point in the history
  • Loading branch information
cnbatch committed Nov 5, 2023
1 parent 7a8bb6f commit 033f182
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
18 changes: 9 additions & 9 deletions docs/parameters_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,20 +82,20 @@ Enabling `blast=1` at this time is recommended.
#### Pattern Interpretation (Simplified Version)
First, the conclusion: the lower the number of the pattern, the faster the response speed. The fast mode is slightly different, please continue reading.

kcp_sndwnd refers to the size of the sending buffer, and kcp_rcvwnd refers to the size of the receiving buffer. These two factors will affect the transmission rate.
`kcp_sndwnd` refers to the size of the sending buffer, and `kcp_rcvwnd` refers to the size of the receiving buffer. These two factors will affect the transmission rate.

kcp_nodelay refers to the nodelay variable of KCP, which is used to select the growth rate of the waiting time for timeout retransmission. Originally, there were only two options, 0 and 1, where 0 means not using KCP's own fast retransmission and 1 means enabling it.
`kcp_nodelay` refers to the `nodelay` variable of KCP, which is used to select the growth rate of the waiting time for timeout retransmission. Originally, there were only two options, 0 and 1, where 0 means not using KCP's own fast retransmission and 1 means enabling it.

When the value is 0, the new time is simply multiplied by 2 based on the previous time.<br />
When the value is 1, the new waiting time is only 1.5 times the previous time, not 2 times.<br />
In May 2023, the author added a value of 2, similar to value 1. The difference is that value 1 uses the "previous time" calculated by the current packet itself, while value 2 uses the average delay time calculated separately within KCP.<br />
That's why it was mentioned earlier that "kcp_nodelay=2 can make the network latency jitter smoother."
- When the value is 0, the new time is simply multiplied by 2 based on the previous time.<br />
- When the value is 1, the new waiting time is only 1.5 times the previous time, not 2 times.<br />
In May 2023, the original author of KCP added a value of 2, similar to value 1. The difference is that value 1 uses the previous time calculated by the current packet itself, while value 2 uses the average delay time calculated separately within KCP.<br />
That's why this page was mentioned earlier that kcp_nodelay=2 can make the network latency jitter smoother.

kcp_interval refers to the internal update interval of KCP.
`kcp_interval` refers to the `internal` variable, the update interval of KCP.

kcp_resend refers to the value of the fastresend variable within KCP. If the value is 0, it means that the fast retransmission function is turned off. If the value is not 0, it means that after crossing the specified number of times, it will no longer wait and will directly transmit again.
`kcp_resend` refers to the value of the `fastresend` variable within KCP. If the value is 0, it means that the fast retransmission function is turned off. If the value is not 0, it means that after crossing the specified number of times, it will no longer wait and will directly transmit again.

kcp_nc refers to the last parameter nc of kcp_nodelay, where 0 means not to close the flow control and 1 means to close the flow control. It should be set to 1, otherwise the transmission speed will be very slow.
`kcp_nc` refers to the last parameter `nc` of `ikcp_nodelay()`, where 0 means not to close the flow control and 1 means to close the flow control. It should be set to 1, otherwise the transmission speed will be very slow.

# Log File
After obtaining the IP address and port after NAT hole punching for the first time, and after the IP address and port of NAT hole punching change, an ip_address.txt file will be created in the Log directory (overwrite if it exists), and the IP address and port will be written in.
Expand Down
16 changes: 8 additions & 8 deletions docs/parameters_zh-hans.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,19 +81,19 @@
### 模式解读(简易版)
先说结论:模式的数字越靠前,响应速度越迅速。fast 模式稍有不同,请继续阅读。

kcp_sndwnd 指的是发送缓冲区的大小,kcp_rcvwnd 指的是接收缓冲区的大小。这两项会影响到收发速率。
`kcp_sndwnd` 指的是发送缓冲区的大小,`kcp_rcvwnd` 指的是接收缓冲区的大小。这两项会影响到收发速率。

kcp_nodelay 指的是 KCP 的 nodelay 变量,用于选择超时重传等待时长的增长速度。原本只有 0、1 之分,0 表示不使用 KCP 自身的快速重传,1 表示启用。<br />
数值为 0,则简单叠加,即新的时间是上一次时间的简单乘 2。<br />
数值为 1,表示新的等待时间仅为上一次时间乘 1.5,而不是2。<br />
2023年5月,作者又增加了数值 2,类似于数值 1。区别在于,数值 1 所用的“上一次时间”来自于当前数据包自己统计的数值,而数值 2 则使用 KCP 内部单独计算的平均延迟时间。<br />
`kcp_nodelay` 指的是 KCP 的 `nodelay` 变量,用于选择超时重传等待时长的增长速度。原本只有 0、1 之分,0 表示不使用 KCP 自身的快速重传,1 表示启用。<br />
- 数值为 0,则简单叠加,即新的时间是上一次时间的简单乘 2。<br />
- 数值为 1,表示新的等待时间仅为上一次时间乘 1.5,而不是2。<br />
2023 年 5 月,KCP 原作者又增加了数值 2,类似于数值 1。区别在于,数值 1 所用的“上一次时间”来自于当前数据包自己统计的数值,而数值 2 则使用 KCP 内部单独计算的平均延迟时间。<br />
这就是为什么前面提到过“kcp_nodelay=2 可使延迟抖动更为平滑”。

kcp_interval 指的是 KCP 内部更新间隔。
`kcp_interval` 指的是 KCP 内部更新间隔`interval` 变量

kcp_resend 指的是 KCP 内部的 fastresend 变量值,数值为 0 则表示关闭快速重传功能。若数值不为 0,表示跨越了指定次数后就不再等待,直接重传。
`kcp_resend` 指的是 KCP 内部的 `fastresend` 变量值,数值为 0 则表示关闭快速重传功能。若数值不为 0,表示跨越了指定次数后就不再等待,直接重传。

kcp_nc 指的是 ikcp_nodelay 的最后一个参数 nc,0 表示不关闭流控, 1 表示关闭流控。此处应当设置成 1,否则传输速度会十分缓慢。
`kcp_nc` 指的是 `ikcp_nodelay()` 的最后一个参数 `nc`,0 表示不关闭流控, 1 表示关闭流控。此处应当设置成 1,否则传输速度会十分缓慢。

# Log 文件
在首次获取打洞后的 IP 地址与端口后,以及打洞的 IP 地址与端口发生变化后,会向 Log 目录创建 ip_address.txt 文件(若存在就覆盖),将 IP 地址与端口写进去。
Expand Down

0 comments on commit 033f182

Please sign in to comment.