IP::tos¶
Description¶
Returns (or sets) the ToS value encoded within a packet. The Type of
Service (ToS) standard is a means by which network equipment can
identify and treat traffic differently based on an identifier. As
traffic enters the site, the BIG-IP system can apply a rule that sends
the traffic to different pools of servers based on the ToS level
within a packet, or can set the ToS value on traffic matching specific
patterns.
Note: If using DSCP values, know that is a bit-shifted value
within the tos field, so if you need the value to be DSCP 46, the
actual value you need to use with the command is 184 (bit-shifted
twice, so 22=4 * DSCP = TOS) . Please use this table for
refererence:
In normal english, take the DSCP value and multiply by 4 to get the
IP::tos value.
Precedence | Type of Service | DSCP Class | DSCP Value | IP::tos Value |
---|---|---|---|---|
0 | 0 | none | 0 | 0 |
1 | 0 | cs1 | 8 | 32 |
1 | 1 | af11 | 10 | 40 |
1 | 10 | af12 | 12 | 48 |
1 | 11 | af13 | 14 | 56 |
10 | 0 | cs2 | 16 | 64 |
10 | 1 | af21 | 18 | 72 |
10 | 10 | af22 | 20 | 80 |
10 | 11 | af23 | 22 | 88 |
11 | 0 | cs3 | 24 | 96 |
11 | 1 | af31 | 26 | 104 |
11 | 10 | af32 | 28 | 112 |
11 | 11 | af33 | 30 | 120 |
100 | 0 | cs4 | 32 | 128 |
100 | 1 | af41 | 34 | 136 |
100 | 10 | af42 | 36 | 144 |
100 | 11 | af43 | 38 | 152 |
101 | 0 | cs5 | 40 | 160 |
101 | 11 | ef | 46 | 184 |
110 | 0 | cs6 | 48 | 192 |
111 | 0 | cs7 | 56 | 224 |
This command is equivalent to the BIG-IP 4.X variable ip_tos.
Examples¶
Set IP::tos to DSCP class cs2 (dscp 16 -> tos 64)
when CLIENT_ACCEPTED {
if { [IP::tos] == 64 } {
pool telnet_pool
} else {
pool slow_pool
}
}
when CLIENT_ACCEPTED {
if { [TCP::local_port] == 554 } {
# this sets DSCP to 46 (EF)
IP::tos 184
}
}