Quality of Service: Difference between revisions

From Bondix Wiki
(First draft, describe how to set up QoS on tlt)
 
No edit summary
 
(22 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Quality of Service allows you to differentiate between different types of traffic, and apply different rules to them that affect how they are transported through the bonding tunnel.
<center>'''This page is currently work-in-progress!'''</center>


'''This feature is currently in development, information presented here is subject to change.'''
==Basics==
[[File:QoS Editor.png|thumb|right|The QoS editor with a default rule.]]With Bondix Quality of Service settings, you can apply different bonding rules for different types of traffic. Traffic can be differentiated via packet type, source, and/or destination IP. Bonding rules allow for setting priority or duplication to limiting bandwidth or optimizing for latency.


=== Configuration on Teltonika ===
===Server: QoS Presets===
Currently it is only possible to configure QoS on Teltonika devices.
On the server side, Bondix S.A.NE comes with a selection of QoS presets which can be used for quick configuration. In effect, Bondix QoS replaces Bondix Tunnel Presets. However, if QoS is to be initiated from the Client, make sure to choose "Custom QoS" in the Tunnel Presets of the General Settings.


Navigate to Network > Bondix Bonding > Quality of Service. Currently, you will have to create all classes yourself, we will introduce presets soon.
Here are the Server's QoS presets at a glance:
{| class="wikitable"
|+
! Preset
!Description
|-
| style="width: 150px" |Bonding
|This is the default preset - bonding over any interface with BondingProxy enabled.
|-
|Bonding (No Proxy)
|Bonding with BondingProxy disabled.
|-
|Packet Duplication
|Default Bonding with packet duplication (1x) enabled.
|-
|Seamless failover
|Only use one interface as indicated by channel priority or latency.
|-
| Satellite
|A preset for satellite scenarios. Satellite is only used for HTTP(S) traffic, except when no other interfaces are available.
|-
|Default QoS
|A more sophisticated preset including a priority rule for DNS traffic, VoIP and online meetings.
|}
A QoS preset consists of one or more traffic groups (QoS group). When a client connects to a server, it sends along its desired QoS configuration which the server can either use or replace with a different configuration. The server also comes with a QoS preset editor which allows you to create custom presets that can be applied on multiple tunnels.
<gallery widths=400px heights=260px>
File:Bondix-123101-qos.png|thumb|QoS settings on Bondix Server
File:Bondix-123101-tunnel-qos.png|thumb|QoS presets for Tunnels on Bondix Server
File:Bondix-123101-qos-presets.png|thumb|QoS presets for Tunnels on Bondix Server, list
</gallery>


==== Traffic Classes ====
===Client & Server: Traffic Group===
First, create traffic classes. These are rules that specify how traffic should be treated. At a glance:
A traffic group (QoS group) consists of a ruleset of how traffic should be handled, and a list of matching traffic types to which these rules shoule be applied to.
[[File:QoSClasses.png|center|frame]]
 
====Group Settings====
{| class="wikitable"
{| class="wikitable"
|+
|+
!
!Property
!
!Description
|-
| style="width: 150px" |Name
|This is where you give your traffic group a short descriptive name that ideally describes the type of traffic you want to assign to it.
|-
|-
|Max Channel
|Score
|maximum amount of channels that should be used, 0 = unlimited
| The group's score determines how often it gets the chance to send out data. The minimum value is 1, each additional score point gives the group a bigger slice of available data. Groups with higher score also get to write their data first. View this as a type of priority setting.
|-
|-
|Duplication
|Packet Copies
|specifies how many copies of the packet should be sent out.
|This value defines how many copies of each packet should be made. A value of 0 means no duplication, a value of 1 means single duplication, and so on. Packet Copies are opportunistic: If not enough interfaces are available to send the amount of configured copies, less copies will be made.
|-
|-
|Bonding Latency
|Latency Offset
|sets the latency threshold when selecting channels. The latency of the lowest channel PLUS this value is the upper limit for all other channels.  
|This setting describes the maximum difference that is allowed between the interface with the lowest and the one with the highest latency. With this setting, you can exclude slow or unreliable lines should their latency become too high. A value of 0 means no limitation.
|-
|-
|Distribute
|Max Down (MBit)
|Whether packets should be distributed evenly accross all channels. If you use packet duplication, this might have only little effect.  
|This value defines the maximum bandwidth allowed downstream in MBit. Downstream always refers to traffic sent from the server to the client. A value of 0 means no limitation.
|-
|-
|Max Bandwidth
|Max Up (MBit)
|A limit in MBit for all traffic in that group.
|This value defines the maximum bandwidth allowed upstream in MBit. Upstream always refers to traffic sent from the client to the server. A value of 0 means no limitation.
|-
|-
|Bonding Proxy
|Max Channel
|Whether traffic should use Bonding Proxy. When disabled and there is matching TCP traffic, it will still end up in the proxy, but in a default QoS class. The goal is to not send matching traffic into the proxy, but this is currently not implemented.
|This value sets the maximum number of channels that should be used at once for this group. A value of 0 means no limit.  
|-
|-
|Channel Selection
| Channel Selection
|Specifies how suitable channels are picked for the class. This only has an effect when distribute is disabled, or when only a subset of channels are to be used.
|Here, you can define how channels are selected. These are the possible options:


* Default: The default mechanism, using a combination of latency and packetloss.
* Default: This is the default method which considers configured priority, latency and reliability.
* Latency: Prioritize latency
* Latency: This option only considers latency (lowest first).
* Bandwidth: Prioritize Bandwidth
* Bandwidth: This option only considers available bandwidth (highest first).
* Priority: This option only considers priority.
|-
|-
|Score
|Bonding Proxy
|Will be renamed to priority. Classes with higher priority can write packets first, and also <score> amount of packets at once. In theory, setting this high enough should allow for a high priority class to starve any other value. However, see remarks down below.
|If enabled, matching TCP traffic will be bonded using BondingProxy which optimizes bonding throughput and efficiency.
|-
|Always Distribute
|If enabled, traffic is always spread through all interfaces. This is disabled by default as it usually introduces unnecessary jitter but may be beneficial if you're looking to spread traffic evenly across multiple interfaces.
|}
|}
'''Important: Currently, you must reload the page after saving changes made in the Traffic Classes list, otherwise editing QoS rules will likely fail'''. This is a known bug that we are working on.


==== QoS Rules ====
==== Matching Rules ====
After having created a set of traffic classes, you can create sorting rules, which specify what type of traffic should be assigned to which traffic classes.
Matching rules describe the type of traffic you want to assign to a group.
[[File:QoSSorting.png|center|frame]]
{| class="wikitable"
{| class="wikitable"
|+
|+
!
!Property
!
!Description
|-
|-
|Protocol
| style="width: 150px" |Traffic Type
|Which protocol to match to. Currently available options are Any, TCP, UDP, TCP+UDP, ICMP, Other,
|Possible options:
 
* Any - ignore traffic type
* TCP
* UDP
* TCP & UDP
* ICMP
* Other - everything else that is not on this list
|-
|-
|Source
|Source
|What source IP's to match on. Value must be entered in CIDR notation. To be able to match to source IPs, masquerading must be disabled on the client, and an appropiate route must be configured on the tunnel.
|Here, you define the source IP network in CIDR notation. In order to match properly, make sure to disable masquerading on the client. A value of "0.0.0.0/0" means traffic from any source.
|-
|-
|Source Ports
|Source Port
|What source port(s) to use. You can either specify a single port (e.g. 12345) or a range of ports (e.g. 12340-12350). A value of "0" means any port.
|Here, you define the source port. This can either be a single value (e.g. "80") or a range (e.g. "22-23"). A value of 0 means any port.  
|-
|-
|Destination
|Destination
|What destination IPs to match on. Again, value must be entered in CIDR notation.
|Here, you give the destination IP network in CIDR notation. For individual IPs, make sure to include the network prefix /32. A value of "0.0.0.0/0" means traffic to any destination.
|-
|-
|Dest Ports
|Destination Port
|What destination ports to use. Accepts single port or port range, or "0" for any port.
|Here, you give the destination port. This can either be a single value (e.g. "80") or a range (e.g. "22-23"). A value of 0 means any port.
|-
|-
|Traffic Class
|DSCP
|What traffic class to use. If a traffic class does not appear here, you must refresh the page in your browser, known bug.
|Here, you specify the DSCP [[wikipedia:Differentiated_services|Differentiated Services Code Point]] value. A value of -1 means that packets with any DSCP value will match. This value is ignored in combination with Bonding Proxy.
|}
|}
Traffic rules are sorted by specificity. If multiple rules would match to certain traffic, the rule that is the most specific will be applied.
Traffic matching rules are sorted by specificity. That means that the most specific rules are checked on first, the broadest rule is checked last.
 
<gallery widths=400px heights=260px>
File:Bondix-123101-qos.png|thumb|left|QoS settings on Bondix Server
File:Tel-07045-network-bondixsane-qos.png|thumb|left|QoS settings on Bondix Client for Teltonika 07.04.5
File:Tel-07045-network-bondixsane-qos-detail.png|thumb|left|QoS settings on Bondix Client for Teltonika 07.04.5, Traffic Group detail
</gallery>
 
===Client: Teltonika===
[[File:Teltonika Preset Selection.png|right]]
If you want to use custom QoS settings on Teltonika routers, make sure that the preset is set to "Custom QoS" and that the assigned server allows Client QoS settings - otherwise the server will override any Client QoS settings. You can see if this is the case under Bondix S.A.NE - Status in the ...
 
We recommend pushing QoS presets via the Bondix Server because then they're created and managed in a single place and don't have to manage the QoS settings on all routers individually.


Traffic that does not match any traffic will be matched to an internal default QoS class, that uses the default bonding settings. We do not intend to make these settings accessible. Instead, you should create a broad rule that matches to all traffic (Any Protocol, 0.0.0.0/0:0 for both source & destination). targetting a traffic class of your choice.
==Compatibility==
Client and server are generally backwards compatible. When a legacy client connects to a QoS-enabled endpoint, the client can still apply its original tunnel preset (which is what QoS replaces). When a QoS-enabled client connects to a legacy server, it will always use the default "Bonding" tunnel preset, or the preset propagated by the legacy server.


=== Compatibility ===
== Best Practices ==
Client and server are generally backwards compatible. When a legacy client connects to a QoS endpoint, the client can still apply its original Tunnel Preset. When a QoS client connects to a legacy client, it will apply the default "Bonding" tunnel preset, it's still possible on the legacy server to override these presets.


Quality of Service will replace the generic "Tunnel Preset" setting. While this setting is currently still available in beta builds, it will eventually disappear.
* Always create a default rule that matches to any traffic. Traffic without an appropriate matching rule will still be transmitted but performance results may vary.
* BondingProxy uses ''iptables'' rules to redirect matching TCP traffic. To exclude certain traffic from BondingProxy, create a new group with matching rules and the proxy disabled. This will create appropiate exclusion rules for ''iptables''.

Latest revision as of 10:47, 9 November 2023

This page is currently work-in-progress!

Basics

The QoS editor with a default rule.

With Bondix Quality of Service settings, you can apply different bonding rules for different types of traffic. Traffic can be differentiated via packet type, source, and/or destination IP. Bonding rules allow for setting priority or duplication to limiting bandwidth or optimizing for latency.

Server: QoS Presets

On the server side, Bondix S.A.NE comes with a selection of QoS presets which can be used for quick configuration. In effect, Bondix QoS replaces Bondix Tunnel Presets. However, if QoS is to be initiated from the Client, make sure to choose "Custom QoS" in the Tunnel Presets of the General Settings.

Here are the Server's QoS presets at a glance:

Preset Description
Bonding This is the default preset - bonding over any interface with BondingProxy enabled.
Bonding (No Proxy) Bonding with BondingProxy disabled.
Packet Duplication Default Bonding with packet duplication (1x) enabled.
Seamless failover Only use one interface as indicated by channel priority or latency.
Satellite A preset for satellite scenarios. Satellite is only used for HTTP(S) traffic, except when no other interfaces are available.
Default QoS A more sophisticated preset including a priority rule for DNS traffic, VoIP and online meetings.

A QoS preset consists of one or more traffic groups (QoS group). When a client connects to a server, it sends along its desired QoS configuration which the server can either use or replace with a different configuration. The server also comes with a QoS preset editor which allows you to create custom presets that can be applied on multiple tunnels.

Client & Server: Traffic Group

A traffic group (QoS group) consists of a ruleset of how traffic should be handled, and a list of matching traffic types to which these rules shoule be applied to.

Group Settings

Property Description
Name This is where you give your traffic group a short descriptive name that ideally describes the type of traffic you want to assign to it.
Score The group's score determines how often it gets the chance to send out data. The minimum value is 1, each additional score point gives the group a bigger slice of available data. Groups with higher score also get to write their data first. View this as a type of priority setting.
Packet Copies This value defines how many copies of each packet should be made. A value of 0 means no duplication, a value of 1 means single duplication, and so on. Packet Copies are opportunistic: If not enough interfaces are available to send the amount of configured copies, less copies will be made.
Latency Offset This setting describes the maximum difference that is allowed between the interface with the lowest and the one with the highest latency. With this setting, you can exclude slow or unreliable lines should their latency become too high. A value of 0 means no limitation.
Max Down (MBit) This value defines the maximum bandwidth allowed downstream in MBit. Downstream always refers to traffic sent from the server to the client. A value of 0 means no limitation.
Max Up (MBit) This value defines the maximum bandwidth allowed upstream in MBit. Upstream always refers to traffic sent from the client to the server. A value of 0 means no limitation.
Max Channel This value sets the maximum number of channels that should be used at once for this group. A value of 0 means no limit.
Channel Selection Here, you can define how channels are selected. These are the possible options:
  • Default: This is the default method which considers configured priority, latency and reliability.
  • Latency: This option only considers latency (lowest first).
  • Bandwidth: This option only considers available bandwidth (highest first).
  • Priority: This option only considers priority.
Bonding Proxy If enabled, matching TCP traffic will be bonded using BondingProxy which optimizes bonding throughput and efficiency.
Always Distribute If enabled, traffic is always spread through all interfaces. This is disabled by default as it usually introduces unnecessary jitter but may be beneficial if you're looking to spread traffic evenly across multiple interfaces.

Matching Rules

Matching rules describe the type of traffic you want to assign to a group.

Property Description
Traffic Type Possible options:
  • Any - ignore traffic type
  • TCP
  • UDP
  • TCP & UDP
  • ICMP
  • Other - everything else that is not on this list
Source Here, you define the source IP network in CIDR notation. In order to match properly, make sure to disable masquerading on the client. A value of "0.0.0.0/0" means traffic from any source.
Source Port Here, you define the source port. This can either be a single value (e.g. "80") or a range (e.g. "22-23"). A value of 0 means any port.
Destination Here, you give the destination IP network in CIDR notation. For individual IPs, make sure to include the network prefix /32. A value of "0.0.0.0/0" means traffic to any destination.
Destination Port Here, you give the destination port. This can either be a single value (e.g. "80") or a range (e.g. "22-23"). A value of 0 means any port.
DSCP Here, you specify the DSCP Differentiated Services Code Point value. A value of -1 means that packets with any DSCP value will match. This value is ignored in combination with Bonding Proxy.

Traffic matching rules are sorted by specificity. That means that the most specific rules are checked on first, the broadest rule is checked last.

Client: Teltonika

Teltonika Preset Selection.png

If you want to use custom QoS settings on Teltonika routers, make sure that the preset is set to "Custom QoS" and that the assigned server allows Client QoS settings - otherwise the server will override any Client QoS settings. You can see if this is the case under Bondix S.A.NE - Status in the ...

We recommend pushing QoS presets via the Bondix Server because then they're created and managed in a single place and don't have to manage the QoS settings on all routers individually.

Compatibility

Client and server are generally backwards compatible. When a legacy client connects to a QoS-enabled endpoint, the client can still apply its original tunnel preset (which is what QoS replaces). When a QoS-enabled client connects to a legacy server, it will always use the default "Bonding" tunnel preset, or the preset propagated by the legacy server.

Best Practices

  • Always create a default rule that matches to any traffic. Traffic without an appropriate matching rule will still be transmitted but performance results may vary.
  • BondingProxy uses iptables rules to redirect matching TCP traffic. To exclude certain traffic from BondingProxy, create a new group with matching rules and the proxy disabled. This will create appropiate exclusion rules for iptables.