You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The agent's traffic_shaper.js is currently hard-coded to use ipfw. Instead, the ipfw-specific details should be factored out into a user-modifiable script.
Current impl:
Agent started with deviceAddr=1.2.3.4, gets job with "bwIn":5000,"bwOut":1000,"latency":28,"plr":0
ipfw list then ifw deiete any rules/pipes that match our deviceAddr
release pipeIds (via socket close)
The proposed solution is similar to our existing video_hdmi.js + "capture" script, but with more flexibility to support custom start/stop values:
Add new --trafficShaper PATH arg with default value "lib/traffic_shaper/ipfw.sh"
Alias current --deviceAddr 1.2.3.4 to optional --trafficShaperArg 1.2.3.4, where the value must match "^[^-\s]\S*$".
Modify scheduleStart() to check if the script file exists, execute the shaper with args -s myDeviceId start 1.2.3.4 --bwIn 5000 --bwOut 1000 --latency 28 --plr 0, read and skip lines except an option line matching "^stop=([^-\s]\S*)$" (e.g. stop=foo_1.2.3.4), and return when it reads a line matching "^(.*\s)?started\." (or EOF or timeout after 10 seconds).
Modify scheduleStop() to execute the shaper with args -s myDeviceId stop foo_1.2.3.4, return when it reads a line matching "^(.*\s)?stopped\." (or EOF or timeout after 10 seconds).
One awkward issue is recreating the dynamic, unique pipeId assignment in Bash. At worst we can loop on r=$RANDOM; nc -l -k $r. I'll have to think about this a bit...
The text was updated successfully, but these errors were encountered:
The agent's traffic_shaper.js is currently hard-coded to use ipfw. Instead, the ipfw-specific details should be factored out into a user-modifiable script.
Current impl:
deviceAddr=1.2.3.4
, gets job with"bwIn":5000,"bwOut":1000,"latency":28,"plr":0
ipfw add 42 pipe 42 ip from any to 1.2.3.4 in
ipfw pipe 42 config bw 5000Kbit/s delay 14ms
, ...ipfw list
thenifw deiete
any rules/pipes that match our deviceAddrThe proposed solution is similar to our existing video_hdmi.js + "capture" script, but with more flexibility to support custom start/stop values:
--trafficShaper PATH
arg with default value "lib/traffic_shaper/ipfw.sh"--deviceAddr 1.2.3.4
to optional--trafficShaperArg 1.2.3.4
, where the value must match"^[^-\s]\S*$"
.-s myDeviceId start 1.2.3.4 --bwIn 5000 --bwOut 1000 --latency 28 --plr 0
, read and skip lines except an option line matching"^stop=([^-\s]\S*)$"
(e.g.stop=foo_1.2.3.4
), and return when it reads a line matching"^(.*\s)?started\."
(or EOF or timeout after 10 seconds).-s myDeviceId stop foo_1.2.3.4
, return when it reads a line matching"^(.*\s)?stopped\."
(or EOF or timeout after 10 seconds).One awkward issue is recreating the dynamic, unique pipeId assignment in Bash. At worst we can loop on
r=$RANDOM; nc -l -k $r
. I'll have to think about this a bit...The text was updated successfully, but these errors were encountered: