wangyu- / UDPspeeder

A Tunnel which Improves your Network Quality on a High-latency Lossy Link by using Forward Error Correction, possible for All Traffics(TCP/UDP/ICMP)
MIT License
4.74k stars 833 forks source link

FIFO file questions? #290

Open CensorKo opened 2 years ago

CensorKo commented 2 years ago

@wangyu-

1.When write mode/timeout/queue-len to fifo file, after checking log file found that queue-len parameter still keep default value 200. In below logs, print_parameter function printed 'fec_queue_len=200'. But expected queue-len=2.

echo mode 0 > a.fifo echo timeout 10 > a.fifo echo queue-len 2 > a.fifo

[2022-03-20 23:28:28][INFO][UDPspeeder/misc.cpp,func:handle_command,line:275]got data from fifo,len=30,s=[mode 0 timeout 10 queue-len 2] [2022-03-20 23:28:28][INFO][UDPspeeder/misc.cpp,func:handle_command,line:327]got command [mode] [2022-03-20 23:28:28][INFO][UDPspeeder/misc.cpp,func:print_parameter,line:265]jitter_min=0 jitter_max=0 output_interval_min=10 output_interval_max=10 fec_timeout=10 fec_mtu=1250 fec_queue_len=200 fec_mode=0

2.Only write fec to fifo file will reset all parameters to default value.

echo fec 20:4 > a.fifo

[2022-03-20 23:28:28][INFO][UDPspeeder/misc.cpp,func:print_parameter,line:266]fec_str=20:4 [2022-03-20 23:28:28][INFO][UDPspeeder/misc.cpp,func:print_parameter,line:267]fec_inner_parameter=1:4,2:4,3:4,4:4,5:4,6:4,7:4,8:4,9:4,10:4,11:4,12:4,13:4,14:4,15:4,16:4,17:4,18:4,19:4,20:4 [2022-03-20 23:28:28][INFO][UDPspeeder/misc.cpp,func:handle_command,line:275]got data from fifo,len=9,s=[fec 20:4] [2022-03-20 23:28:28][INFO][UDPspeeder/misc.cpp,func:handle_command,line:279]got command [fec] [2022-03-20 23:28:28][INFO][UDPspeeder/misc.cpp,func:print_parameter,line:265]jitter_min=0 jitter_max=0 output_interval_min=10 output_interval_max=10 fec_timeout=8 fec_mtu=1250 fec_queue_len=200 fec_mode=0

wangyu- commented 2 years ago

1.When write mode/timeout/queue-len to fifo file, after checking log file found that queue-len parameter still keep default value 200.

[2022-03-20 23:28:28][INFO][UDPspeeder/misc.cpp,func:handle_command,line:275]got data from fifo,len=30,s=[mode 0 timeout 10 queue-len 2]

For your first question, it seems like you are writing those parameters by a script. And the script writes too fast, then the 3 commands are combined into a str of 3 lines.

It's my bad, I should handle this correctly. Before I fixed this, you can add sleeps between those echo commands, so that the 3 command are not combined into a single str.

2.Only write fec to fifo file will reset all parameters to default value.

I think I have found the reason in the code, I will fix it later.

Thanks for reporting.

wangyu- commented 1 year ago

Hi @CensorKo ,

2 should have been fixed.

I didn't fix 1 since the work around is easy, and in future I am going to rework the --fifo option. I might switch from fifo to a udp socket, so that the feature can be used on window/mac as well. With udp socket the problem will automatically gone.

alou-S commented 1 year ago

@wangyu- There is also a small problem with the FIFO where settings preinitialized via command line arguments are overridden for the first time when using the FIFO.

Example:

  1. Speeder is started with --mtu 1386 --mode 1 -f 1:4 --fifo fifo.file
  2. echo fec 1:2 > fifo.file
  3. Speeder changes fec_str=1:2 but also changes fec_mtu=1250 and fec_mode=0 (Reset to default values)

Other Notes: