Skip to content

Commit

Permalink
improve olsrd timings
Browse files Browse the repository at this point in the history
  • Loading branch information
pocki80 authored Sep 17, 2018
1 parent 55f42ef commit cfe8bec
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 13 deletions.
74 changes: 68 additions & 6 deletions wizard-run
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#
# EdgeMAX Wizard "OLSRd_V1" created 03/2016 by Onetrix.net for FunkFeuer.at
# Version [0903k/201806130]
# Version [0903k/201809170]
# ^-- previous line is used from bmk-webstatus-package as version identification, dont remove "Version "
#
# Github repository: https://github.com/vchrizz/ER-wizard-OLSRd_V1/
Expand Down Expand Up @@ -34,6 +34,7 @@
# *) 09/2017 added option to enable/use watchdog plugin with watchdog script
# *) 11/2017 fixed wizard-run: downgraded olsrd packages to version 0.9.0.3-1 for mipsel architecture
# *) 11/2017 fixed wizard-run: downgraded olsrd packages to version 0.9.0.3-1 for mips architecture
# *) 09/2018 changed default olsrd timings to reduce overall olsrd network traffic
#

ACTION=$1
Expand Down Expand Up @@ -409,6 +410,46 @@ fi
## END patch for installing this wizard onto a existing 0.9.0.3 wizard END ##
#############################################################################

###update default intervals to reduce olsr management traffic
#define new settings
Pollrate="0.1"
HelloInterval="5.0"
HelloValidityTime="100.0"
TcInterval="3.0"
TcValidityTime="500.0"
MidInterval="30.0"
MidValidityTime="500.0"
HnaInterval="30.0"
HnaValidityTime="500.0"
#apply new settings
if [ -f $olsrd4config ]; then
[ "$Pollrate" ] && sed -i "s/Pollrate.*/Pollrate $Pollrate/" $olsrd4config
[ "$HelloInterval" ] && sed -i "s/HelloInterval.*/HelloInterval $HelloInterval/" $olsrd4config
[ "$HelloValidityTime" ] && sed -i "s/HelloValidityTime.*/HelloValidityTime $HelloValidityTime/" $olsrd4config
[ "$TcInterval" ] && sed -i "s/TcInterval.*/TcInterval $TcInterval/" $olsrd4config
[ "$TcValidityTime" ] && sed -i "s/TcValidityTime.*/TcValidityTime $TcValidityTime/" $olsrd4config
[ "$MidInterval" ] && sed -i "s/MidInterval.*/MidInterval $MidInterval/" $olsrd4config
[ "$MidValidityTime" ] && sed -i "s/MidValidityTime.*/MidValidityTime $MidValidityTime/" $olsrd4config
[ "$HnaInterval" ] && sed -i "s/HnaInterval.*/HnaInterval $HnaInterval/" $olsrd4config
[ "$HnaValidityTime" ] && sed -i "s/HnaValidityTime.*/HnaValidityTime $HnaValidityTime/" $olsrd4config
#restart olsrd
/etc/init.d/olsrd restart
fi
if [ -f $olsrd6config ]; then
[ "$Pollrate" ] && sed -i "s/Pollrate.*/Pollrate $Pollrate/" $olsrd6config
[ "$HelloInterval" ] && sed -i "s/HelloInterval.*/HelloInterval $HelloInterval/" $olsrd6config
[ "$HelloValidityTime" ] && sed -i "s/HelloValidityTime.*/HelloValidityTime $HelloValidityTime/" $olsrd6config
[ "$TcInterval" ] && sed -i "s/TcInterval.*/TcInterval $TcInterval/" $olsrd6config
[ "$TcValidityTime" ] && sed -i "s/TcValidityTime.*/TcValidityTime $TcValidityTime/" $olsrd6config
[ "$MidInterval" ] && sed -i "s/MidInterval.*/MidInterval $MidInterval/" $olsrd6config
[ "$MidValidityTime" ] && sed -i "s/MidValidityTime.*/MidValidityTime $MidValidityTime/" $olsrd6config
[ "$HnaInterval" ] && sed -i "s/HnaInterval.*/HnaInterval $HnaInterval/" $olsrd6config
[ "$HnaValidityTime" ] && sed -i "s/HnaValidityTime.*/HnaValidityTime $HnaValidityTime/" $olsrd6config
#restart olsrd
/etc/init.d/olsrd6 restart
fi
###done update default intervals to reduce olsr management traffic

echo "detected $arch architecture, extracting packages olsrd and olsrd-plugins ..." >>$log
if [ $arch == 'mips' ]; then
# base64: olsrd_0.9.0.3-1_mips.deb
Expand Down Expand Up @@ -19471,6 +19512,28 @@ setupv4olsrd () {
sed -i "s/olsrd_dyn_gw.so.0.5/olsrd_dyn_gw.so.0.3/g" $olsrd4config 2>>$log
sed -i "s/olsrd_nameservice.so.0.4/olsrd_nameservice.so.0.3/g" $olsrd4config 2>>$log
fi
#fix timings to match defaults
Pollrate="0.1"
HelloInterval="5.0"
HelloValidityTime="100.0"
TcInterval="3.0"
TcValidityTime="500.0"
MidInterval="30.0"
MidValidityTime="500.0"
HnaInterval="30.0"
HnaValidityTime="500.0"
#apply new settings
if [ -f $olsrd4config ]; then
[ "$Pollrate" ] && sed -i "s/Pollrate.*/Pollrate $Pollrate/" $olsrd4config
[ "$HelloInterval" ] && sed -i "s/HelloInterval.*/HelloInterval $HelloInterval/" $olsrd4config
[ "$HelloValidityTime" ] && sed -i "s/HelloValidityTime.*/HelloValidityTime $HelloValidityTime/" $olsrd4config
[ "$TcInterval" ] && sed -i "s/TcInterval.*/TcInterval $TcInterval/" $olsrd4config
[ "$TcValidityTime" ] && sed -i "s/TcValidityTime.*/TcValidityTime $TcValidityTime/" $olsrd4config
[ "$MidInterval" ] && sed -i "s/MidInterval.*/MidInterval $MidInterval/" $olsrd4config
[ "$MidValidityTime" ] && sed -i "s/MidValidityTime.*/MidValidityTime $MidValidityTime/" $olsrd4config
[ "$HnaInterval" ] && sed -i "s/HnaInterval.*/HnaInterval $HnaInterval/" $olsrd4config
[ "$HnaValidityTime" ] && sed -i "s/HnaValidityTime.*/HnaValidityTime $HnaValidityTime/" $olsrd4config
fi
#add logging to /etc/init.d/olsrd
if [ $(grep -c "/tmp/olsrd.log" $olsrd4init) -eq 0 ]; then
echo "Add logging to /etc/init.d/olsrd" >>$log
Expand Down Expand Up @@ -19862,7 +19925,6 @@ ebtables -P FORWARD DROP' /config/scripts/pre-config.d/ebtables.sh >>$log 2>>$lo
olsrdsettings=$olsrdsettings',"MidInterval":"'$(awk '/MidInterval/ {print $2}' $olsrd4config)'"'
olsrdsettings=$olsrdsettings',"HnaValidityTime":"'$(awk '/HnaValidityTime/ {print $2}' $olsrd4config)'"'
olsrdsettings=$olsrdsettings',"HnaInterval":"'$(awk '/HnaInterval/ {print $2}' $olsrd4config)'"'
olsrdsettings=$olsrdsettings',"HnaInterval":"'$(awk '/HnaInterval/ {print $2}' $olsrd4config)'"'
olsrdsettings=$olsrdsettings',"Pollrate":"'$(awk '/Pollrate/ {print $2}' $olsrd4config)'"'
olsrdsettings=$olsrdsettings'}]'

Expand Down Expand Up @@ -20170,12 +20232,12 @@ Interface "br9" {\

[ "$Pollrate" == "null" ] && Pollrate="0.1"
[ "$HelloInterval" == "null" ] && HelloInterval="5.0"
[ "$HelloValidityTime" == "null" ] && HelloValidityTime="125.0"
[ "$TcInterval" == "null" ] && TcInterval="2.0"
[ "$HelloValidityTime" == "null" ] && HelloValidityTime="100.0"
[ "$TcInterval" == "null" ] && TcInterval="3.0"
[ "$TcValidityTime" == "null" ] && TcValidityTime="500.0"
[ "$MidInterval" == "null" ] && MidInterval="25.0"
[ "$MidInterval" == "null" ] && MidInterval="30.0"
[ "$MidValidityTime" == "null" ] && MidValidityTime="500.0"
[ "$HnaInterval" == "null" ] && HnaInterval="25.0"
[ "$HnaInterval" == "null" ] && HnaInterval="30.0"
[ "$HnaValidityTime" == "null" ] && HnaValidityTime="500.0"

[ "$Pollrate" ] && sed -i "s/Pollrate.*/Pollrate $Pollrate/" $olsrd4config $olsrd6config
Expand Down
14 changes: 7 additions & 7 deletions wizard.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
EdgeMAX Wizard "OLSRd_V1" created 03/2016 by Onetrix.net for FunkFeuer.at
Works on EdgeRouter and EdgeRouter X / X-SFP (system version 1.7.0+)
versioninfo=201806130
versioninfo=201809170
^-- use version identifier as number: YYYYMMDDX whereas X can be intraday-version
autoupdate=201806130
autoupdate=201809170
^-- set autoupdate the same version identifier to allow autoupdates
-->
Expand All @@ -15,7 +15,7 @@ <h3>Optimized Link State Routing Protocol</h3>
</div>
<legend style="position:absolute;right:0px;padding:5px;">
<center>EdgeMAX Wizard "OLSRd_V1" created 2016<br>by <a href="http://onetrix.net" target="_blank">Onetrix.net</a> for <a href="http://funkfeuer.at" target="_blank">FunkFeuer.at</a>
<br>Version [0903k/20180613]</center>
<br>Version [0903k/20180917]</center>
</legend>
<div style="padding:15px;border: 1px solid lightgray;width:648px">
<table border="0">
Expand Down Expand Up @@ -119,17 +119,17 @@ <h3>Optimized Link State Routing Protocol</h3>
<div class="clear"></div><br><div class="clear"></div><div class="clear"></div><br><div class="clear"></div>
<div><input type="text" name="HelloInterval" value="5.0" /></div><div><span class="text" data-infotip='Hello interval in seconds(float)'>HelloInterval</span></div>
<div class="clear"></div><br><div class="clear"></div><div class="clear"></div><br><div class="clear"></div>
<div><input type="text" name="HelloValidityTime" value="125.0" /></div><div><span class="text" data-infotip='HELLO validity time'>HelloValidityTime</span></div>
<div><input type="text" name="HelloValidityTime" value="100.0" /></div><div><span class="text" data-infotip='HELLO validity time'>HelloValidityTime</span></div>
<div class="clear"></div><br><div class="clear"></div><div class="clear"></div><br><div class="clear"></div>
<div><input type="text" name="TcInterval" value="2.0" /></div><div><span class="text" data-infotip='TC interval in seconds(float)'>TcInterval</span></div>
<div><input type="text" name="TcInterval" value="3.0" /></div><div><span class="text" data-infotip='TC interval in seconds(float)'>TcInterval</span></div>
<div class="clear"></div><br><div class="clear"></div><div class="clear"></div><br><div class="clear"></div>
<div><input type="text" name="TcValidityTime" value="500.0" /></div><div><span class="text" data-infotip='TC validity time'>TcValidityTime</span></div>
<div class="clear"></div><br><div class="clear"></div><div class="clear"></div><br><div class="clear"></div>
<div><input type="text" name="MidInterval" value="25.0" /></div><div><span class="text" data-infotip='MID interval in seconds(float)'>MidInterval</span></div>
<div><input type="text" name="MidInterval" value="30.0" /></div><div><span class="text" data-infotip='MID interval in seconds(float)'>MidInterval</span></div>
<div class="clear"></div><br><div class="clear"></div><div class="clear"></div><br><div class="clear"></div>
<div><input type="text" name="MidValidityTime" value="500.0" /></div><div><span class="text" data-infotip='MID validity time'>MidValidityTime</span></div>
<div class="clear"></div><br><div class="clear"></div><div class="clear"></div><br><div class="clear"></div>
<div><input type="text" name="HnaInterval" value="25.0" /></div><div><span class="text" data-infotip='HNA interval in seconds(float)'>HnaInterval</span></div>
<div><input type="text" name="HnaInterval" value="30.0" /></div><div><span class="text" data-infotip='HNA interval in seconds(float)'>HnaInterval</span></div>
<div class="clear"></div><br><div class="clear"></div><div class="clear"></div><br><div class="clear"></div>
<div><input type="text" name="HnaValidityTime" value="500.0" /></div><div><span class="text" data-infotip='HNA validity time'>HnaValidityTime</span></div>
</div>
Expand Down

0 comments on commit cfe8bec

Please sign in to comment.