Forum Discussion

Nhat_319247's avatar
Nhat_319247
Icon for Nimbostratus rankNimbostratus
Jun 22, 2017

irules and rateclass based on ToS values

Reading this whitepaper: https://worldtechit.com/wp-content/uploads/2015/07/f5-white-paper-bandwidth-management-for-peer-to-peer-applications-.pdf

 

it talks about using irules to identify applications then applying an rate class to it. The example they use are P2P applications like torrents and emule.

 

trying to do a similar thing but based on ToS values. Seems simpler but don't really know where to start as this is all new to me and i've not got a F5 in front of me to explore.

 

Anyone able to validate the following butchered irule i put together and advise whether it would work?

 

when CLIENT_ACCEPTED { if { [IP::tos] == 40 } { use rateclass } }

 

 

where would be a rateclass i created that would shape the traffic specific amount.

 

 

  • In case anyone was interested...

    So i got this lab'ed up and tested this with a Virtual LTM. Got it working as follows: Configured a Rate Class: Called it AF11 where i set the base and ceiling rate to 600Kbps Then configured the following irule:

    when CLIENT_ACCEPTED {
        if { [IP::tos] == 40 } { 
          rateclass AF11
        } 
    }
    

    Then applied the irule to the Virtual Server.

    I also tested a time based version of the above irule:

    when CLIENT_ACCEPTED {
        set current_day [clock format [clock seconds] -format {%a} ]
        set current_time [clock seconds]
        set time_min [clock scan {08:00}]
        set time_max [clock scan {17:00}]
    
        if {($current_day == {Sat}) or ($current_day == {Sun})} {
        rateclass Parent
        }
        elseif {($current_time < $time_min) or ($current_time > $time_max)} {
        rateclass Parent
        }
        elseif { [IP::tos] == 40 } { 
          rateclass AF11
        } 
        else {
          rateclass Parent
        }
    }