Chapter 17 Traffic Shaping for FortiOS 5.0 : Traffic shaping methods : Traffic shaping options
  
Traffic shaping options
When configuring traffic shaping for your network, there are three different methods to control the flow of network traffic to ensure that the desired traffic gets through while also limiting the bandwidth that users use for other less important or bandwidth consuming traffic. The three shaping options are:
shared policy shaping - bandwidth management by security policies
per-IP shaping - bandwidth management by user IP addresses
application control shaping - bandwidth management by application
Shared policy shaping and per IP shaping are enabled within the security policy, while the application control shaping is configured in Security Profiles > Application Control > Application Sensors, and enabled in the security policy by enabling Application Control in the Security Profiles section.
The FortiGate unit offers three different traffic shaping options, all of which can be enabled at the same time within the same security policy. Generally speaking, the hierarchy for shapers in FortiOS is:
Application Control shaper
Security policy shaper
Per-IP shaper
With this hierarchy, if an application control list has a traffic shaper defined, it will have precedence always over any other security policy shaper. For example, with the example above creating an application control for Facebook, the shaper defined for Facebook will supersede any security policy enabled traffic shapers. While the Facebook application may reach its maximum bandwidth, the user can still have the bandwidth room available from the shared shaper and, if enabled, the per-IP shaper.
Equally, any security policy shared shaper will have precedence over any per-IP shaper. However, traffic that exceeds any of these shapers will be dropped. For example, the policy shaper will take effect first, however, if the per-IP shaper limit is reached first, then traffic for that user will be dropped even if the shared shaper limit for the policy has not been exceeded.
See also 
Shared policy shaping
Per-IP shaping
Application control shaping
Enabling in the security policy
Type of Service priority
Differentiated Services
Tos and DSCP mapping
Traffic Shaper Monitor