* QoS
  QoS in WeOS 5

  In this chapter you will learn:
  - WeOS 5 defaults regarding QoS
  - Traffic Shaping and QoS priority
  - Egress Bandwidth Limit
  - Ingress Rate Limit


** WeOS 5 defaults regarding QoS
   When WeOS 5 boots up with default settings, QoS will function with its defaults.
   This means that when a packet arrives at ingress line, it will be assigned priority
   based on the VLAN priority field (0-7) if the packet has VLAN tag, or otherwise it
   will get default priority of 0. 


** Traffic Shaping and QoS priority
   All egress traffic in WeOS 5 may be shaped according to the needs of user.

   There are 8 general priority values: 0 to 7. These priorities are distributed evenly
   through 8 traffic classes or queues in 1 to 1 mapping, i.e. priority 0 belongs
   to queue 0, priority 1 belongs to queue 1, and so forth.

   There are 3 priority modes in WeOS: PORT, VLAN TAG, IP.

   PORT priorities are 8, ranging from 0 to 7 and map 1 to 1 with general priorities.
   VLAN TAG priorities are 8, ranging from 0 to 7 and map 1 to 1 with general priorities.
   IP priorities are 64, according to DSCP field of IP packet, and these are mapped
   to 8 general priorities. The mapping is as follows:
   DSCP value * Priority
   0  - 7     *    0
   8  - 15    *    1
   16 - 23    *    2
   24 - 31    *    3
   32 - 39    *    4
   40 - 47    *    5
   48 - 55    *    6
   56 - 63    *    7

   If priority mode PORT is configured on the port, then all ingress
   packets will be assigned the user specified port priority. It is always a default
   or catchall priority mode. Default port priority is 0.

   If priority mode VLAN TAG is configured on the port, then all ingress packets arriving
   with 802.1Q tag will get priority specified in VLAN tag (IEEE 802.1p). If VLAN tag is
   not present in arriving packet, then WeOS defaults to PORT priority mode.

   If priority mode IP is configured, then all ingress IP packets (IPv4 and IPv6) will be
   assigned priority that corresponds to the DSCP value of incoming layer 3 packet. If
   incoming packet is not an IP packet, then WeOS defaults to PORT priority.

#  **We can add this if we like, but first discuss how we want it to work**
#   It is possible to set priority for specific VLAN, in which case it gains the highest
#   preference among the above mentioned priority modes.

   Priority value that has been assigned to the packet at ingress will be used by egress
   logics to queue packet in a specific egress queue, which is assigned to receive packets
   with that priority. Furthermore, if the packet will egress with a VLAN tag, the
   assigned priority will be included in the priority field of the VLAN tag.


** Egress Bandwidth Limit
   It is possible to limit the bandwidth of outgoing traffic on port.
   The bandwidth may be specified in bits per second, such as 350 kbit/s, or 500 Mbit/s.
   If bandwidth limit is set, all outgoing traffic will be shaped according to the specified
   bandwidth.


** Ingress Rate Limit
   Whenever it is desired, one can limit the rate of ingress traffic on port.
   It is possible to select specific type of traffic to be rate-limited, based on DMAC address: BROADCAST, MULTICAST,
   UNKNOWN-UNICAST, or ALL types at once. Any combination of the above mentioned types is possible.
   The rate may be specified in bits per second, such as 64 kbit/s, or 250 Mbit/s. WeOS 5 does not support
   limiting traffic on a frames per second (fps) basis.
   Note: For virtual L2 ports, e.g., SSL L2 VPN ports, all unicast MACs are unknown,
   thus rate limiting UNKNOWN-UNICAST on such ports will apply to all unicast traffic
   ingressing the port.
