
Traffic shaping allows ingress and egress controls to be applied at various points within the FireBrick.
Several places in the configuration allow you to specify a graph. This causes traffic through that point (a firewall rule, or an interface, or whatever the attribute is attached to) to be recorded on a graph which you can see from the web pages. In addition to showing on a graph, you can also define that the graph has speed restrictions. These can be simple tx and rx speed limits or more complex settings allowing maximum average speeds over time. You define the speed controls for the graph by adding a shaper config object.
In addition, in a few places, you can set a speed attribute directly. This is a short cut for where you want a speed limit applied to some specific interface, such as PPPoE. You can specify speed to control the tx speed on that interface directly. If you also specify a graph that also creates a graph. There is a warning if you try and make contradictory speed, graph and shaper settings in your config as a whole. Just setting speed creates a shaper without a name that relates just to that interface and so does not show a graph.
Shapers/graphs are controlled by the graph name you give them - putting several firewall rules or interfaces all on the same named shaper/graph causes the traffic as a whole to be shaped. If you want, for example, several independent 2M speed lanes then each will need a different name.
It works by a leaky bucket principle as follows:-
The current rate can be configured for tx(transit) and rx(receive). The latency limit is larger for small packets (<1000 bytes) than for smaller packets.
Shaping is applied based on a named graph. The graph name can be set on various aspects of the system. The shaping rates are then defined in the <shaper/> definitions in the configuration. The rate can also be set dynamically using RADIUS for L2TP traffic. When the configuration is loaded this sets all named shapers listed. Shaping can be applied:-
The packet length and inclusion rules used for shaping is also used for producing the CQM graphs of usage.
Where there is bonding of multiple paths in use the shaper is essential in working out which link to use. Ensure the tx speed for each link is correct. The current packet sending time for each link is used to decide which link has the shortest queue in the network and should be used. The way this works means that if links are all set to a high rate (e.g. gigabit) then the packets typically round robin between links.
An aggregate shaper can be applied in some cases, for example L2TP. In this case the aggregate shaper can hit limits independently of shapers applied to each session. When this happens a damping factor is applied. This is increased every time the aggregate shaper has a second when packets are discarded, and decreases every second when it does not. The damper has a range of 0 to 255 which introduces a damping effect on the individual session shapers. It reduces the throughput of the individual sessions. The idea is that rather than the aggregate shaper limiting traffic it is limited by the individual sessions.
It is possible to mark each session as low, normal or high priority which affects at what damping level the reduction in speed is applied to that session.
The graph shows a speed line for TX speed only. This is calculated on an hourly basis and the line is the highest speed limit applied for that hour. This can be useful for historical graphs.
Where a long term shaper is used, this is useful to show that some reduction in speed has been applied if it lasts longer than the hour.
Where a shared shaper is used this shows the share of the overall speed that this FireBrick has.
Long term policing is designed to be used where burstable services are provided and need policing to protect against abuse.
To set long term, shaping you define a shaper and include the min, max and interval settings. The way the long term shaper works is to try and ensure the target speed (e.g. tx or rx setting) is not exceeded on a long term average, but otherwise allowing usage up to the max speed.
Shared shapers allow a named shaper to be shared over several connected FireBricks. You define the Ethernet interface over which the FireBricks are connected (which can be a dedicated VLAN for example) in the cqm settings. You can also set a shared secret that must be the same on all FireBricks that are sharing.
Any shaper can then for set to have share="true" and it will be shared via that interface with other FireBricks. This involves adjustments ever second to ensure the defined speed is shared fairly between all of the FireBricks.
Sharers are shared by name. You should set the same speed on all FireBricks for the same named shared shaper.