Skip to content

Ingress Policy#

QoS → IPIngress Policies

A brief introduction to QoS

Quality of Service (QoS) is a set of technologies and mechanisms used to manage traffic prioritization, often but not exclusively used in scenarios of network congestion. A full explanation of QoS is beyond the scope of this documentation, as the concepts are often as complex as the implementation of them on various network operating systems, along with chip-specific capabilities and limitations.

An IngressPolicy is used to map an incoming packet to a particular Queue. It operates in 3 stages, each of which is explained in more detail below:

  1. Inspect the packet headers and classify it: classification means that the packet is assigned an internal-only ForwardingClass tag
  2. Police the incoming traffic: limit the bandwidth of certain traffic classes
  3. Based on the ForwardingClass, map the packet to a particular Queue

In addition, the IngressPolicy also determines the parameters of the Queue, such as Committed Burst Size (CBS), Maximum Burst Size (MBS), and PFC1 parameters.

Mapping a forwarding class to a queue

Currently, EDA does not support mapping a forwarding class to a Queue on ingress, even though it can be configured through the forwardingClassToQueueMapping property: this property is ignored.

Why?

While advanced routers like the Nokia 7750 SR have dedicated queues for ingressing and egressing traffic, in the datacenter there is often only one queue being used. This queue is either a Virtual Output Queue (VOQ) before the packet crosses the forwarding fabric, or an Egress Queue (EGQ) after the packet has crossed the forwarding fabric. The technical reason for this, as well as their benefits and drawbacks, are beyond the scope of this article.

Classification#

Traffic streams can be prioritized by looking at certain packet headers. Currently supported headers include:

  • IP header
    • based on source / destination prefix, source / destination port, ...
    • based on the DSCP priority bits
  • MAC header
    • based on the dot1p priority bits

Each classifier will map a packet to a ForwardingClass and drop probability or "color". The lower the drop probability, the less likely a packet is to be dropped while in the queue. When the queue is full, all new incoming packets are discarded regardless of drop probability. This mechanism is known as color marking and requires policers (on ingress) or slope policies (on egress) to be active on the node to be effective.

IP entry#

When using the ipEntry classifier, you can optionally rewrite the DSCP value. This can be useful to re-assess priorities, or it can be used to ignore priority bits altogether when packets ingress the network.

Dot1p entry#

The dot1pPolicyEntry creates a classifier that inspects the Priority Code Point (PCP) bits of a VLAN tag in an ethernet header. Based on the PCP bits, the packet is assigned a particular ForwardingClass. The PCP field is 3 bits long, and therefore has values ranging from 0 to 7 (inclusive).

DSCP entry#

The dscpPolicyEntry creates a classifier that inspects the Differentiated Services Code Point (DSCP) bits in an IP header. The DSCP field is 6 bits long, and therefore has values ranging from 0 to 63 (inclusive).

Policing#

Policers count bits per second, and can recolor packets (re-assign drop probabilities) if the packets that are counted by this policer exceed a certain bandwidth. That's a lot to unpack: let's break it down:

  • An IngressPolicy determines which combination of ForwardingClass and traffic types (unicast, multicast, ...) are policed by a certain policer.
  • The policer counts the packets that pass through it, and takes one of three actions.
    • A packet that comes in while the policer is in a normal (non-exceeding) state, is not recolored.
    • A packet that comes in while the policer exceeds the committed rate (CIR), but below the peak rate (PIR), is recolored in accordance with exceedAction.
    • A packet that comes in while the policer exceeds the peak rate (PIR) is recolored in accordance with violateAction.

What about pre-coloring?

Policers rely on a two-rate token-based system, where each packet drains a number of tokens from one, two, or zero buckets (depending on pre-coloring done by the classifiers) that are continuously being refilled. There are a lot of nuances to this mechanism and there are subtle implementation differences between operating systems and even hardware platforms. For an in-depth overview of policers, refer to the OS-specific user documentation.

Queueing#

When a packet has been classified (assigned a forwarding class) and colored (assigned a drop probability or 'color') and has not been dropped by the violate-action of the policer, the router performs a forwarding lookup that determines the egress port for the packet. Depending on the hardware platform, the packet is enqueued in a VOQ (Virtual Output Queue) or EGQ (Egress Queue).

If there is room in the Queue, the packet is added to the queue. If there is no room left in the Queue, the packet is dropped.

Slope policies#

Slope policies drop a certain percentage of incoming packets when a packet enters the queue. The percentage is based on the occupancy of the Queue and the configuration of the slope policy of the EgressPolicy, and is discussed in more detail in the EgressPolicy documentation article.

Dependencies#

ForwardingClass#

Most QoS mechanisms either assign a ForwardingClass to a packet, or take an action based on the assigned ForwardingClass. These must exist as a resource if the IngressPolicy refers to them.

Deployment of a ForwardingClass

Both the IngressPolicy and EgressPolicy resources refer to a ForwardingClass by name, and therefore this name must exist on the node. Only the EgressPolicy configures these, which means that a (default) EgressPolicy must always be configured that maps all referenced ForwardingClasses to a queue, even if it is not used.

Queue#

The IngressPolicy defines the classification of packets, and assigns them to a particular Queue for further processing, in addition to configuring the Queues themselves. The Queue resources referenced by the policy must exist as resources before the IngressPolicy can be configured.

References#

The IngressPolicy has no references to any EDA resources other than the ones specified in Dependencies.

Examples#

apiVersion: qos.eda.nokia.com/v2
kind: IngressPolicy
metadata:
  name: my-ingress-policy
  namespace: eda
spec:
  classifier:
    entries:
      - dscpPolicyEntry:
          dropProbabilityLevel: Low
          dscpValues:
            - value: 0
          forwardingClass: fc0
        type: Auto
      - dscpPolicyEntry:
          dropProbabilityLevel: Low
          dscpValues:
            - value: 26
          forwardingClass: fc3
        type: Auto
      - dscpPolicyEntry:
          dropProbabilityLevel: Low
          dscpValues:
            - value: 48
          forwardingClass: fc6
        type: Auto
  forwardingClassToQueueMapping:
    - forwardingClasses:
        - fc3
      queue: pfc-3
  queueManagement:
    - pfcReservedBufferPercent: 10
      queues:
        - maximumBurstSizeBytes: 1024000
          pfcPauseFramePriority: 3
          queue: pfc-3
cat << 'EOF' | kubectl apply -f -
apiVersion: qos.eda.nokia.com/v2
kind: IngressPolicy
metadata:
  name: my-ingress-policy
  namespace: eda
spec:
  classifier:
    entries:
      - dscpPolicyEntry:
          dropProbabilityLevel: Low
          dscpValues:
            - value: 0
          forwardingClass: fc0
        type: Auto
      - dscpPolicyEntry:
          dropProbabilityLevel: Low
          dscpValues:
            - value: 26
          forwardingClass: fc3
        type: Auto
      - dscpPolicyEntry:
          dropProbabilityLevel: Low
          dscpValues:
            - value: 48
          forwardingClass: fc6
        type: Auto
  forwardingClassToQueueMapping:
    - forwardingClasses:
        - fc3
      queue: pfc-3
  queueManagement:
    - pfcReservedBufferPercent: 10
      queues:
        - maximumBurstSizeBytes: 1024000
          pfcPauseFramePriority: 3
          queue: pfc-3
EOF

Custom Resource Definition#

To browse the Custom Resource Definition go to crd.eda.dev.

IngressPolicy

qos.eda.nokia.com / v2

SPEC

IngressPolicySpec defines the desired state of IngressPolicy

  • #
  • #
  • #
  • #

STATUS

IngressPolicyStatus defines the observed state of IngressPolicy


  1. Priority-based Flow Control or PFC is a mechanism (IEEE 802.1Qbb) that enables a network element to signal to one of their neighbors to stop sending traffic for a particular priority.