BWC::priority

Description

This command allows you to map a policy instance or category to a priority class of a priority group. Please note that the weight-percentages are updated only for the BWC instance over which the iRule is being run. The policy continues to have the weight-percentage as configured by tmsh/GUI. Any new BWC instance will get the weight-percentage from the tmsh/GUI based configuration unless the new instance executed a BWC:priority iRule to override it.

Syntax

BWC::priority <name1> <value1> [<name2> <value2>] ...

Where nameX is the name of a priority class and valueX is teh weight of the priority class in percentage.

Examples

### Configuration ###
net bwc policy bwc_policy {
  categories {
    c1 {
      max-cat-rate 10mbps
      traffic-priority-map tg1->tc1
    }
    c2 {
      max-cat-rate 10mbps
      traffic-priority-map tg1->tc2
    }
  }
  dynamic enabled
  log-publisher /Common/test_publisher
  max-rate 10mbps
  max-user-rate 10mbps
}
net bwc priority-group tg1 {
  priority-classes {
    tc1 {
      weight-percentage 80
    }
    tc2 {
      weight-percentage 20
    }
  }
}

### iRule ###

when SERVER_CONNECTED {
  set my_policy bwc_policy
  set my_cat none
  set my_cookie [IP::remote_addr]
  switch -glob [TCP::remote_port] {
    "101" {
      set my_cat c1
    }
    "102" {
      set my_cat c2
    }
  }
  BWC::policy attach $my_policy $my_cookie
  if { $my_cat != "none" } {
    log local0. "BWC::color set $my_policy $my_cat"
    BWC::color set $my_policy $my_cat
    BWC::priority "tc1" 60 "tc2" 40
  }
}