Skip to content

class of service

Thomas Mangin edited this page Jun 15, 2026 · 1 revision

Pre-Alpha. This page describes behavior that may change.

Class-of-Service (CoS) in Ze maps the 3-bit IEEE 802.1p Priority Code Point (PCP) in 802.1Q VLAN headers to internal priorities and back. The feature has two layers: named profiles defined under class-of-service, and per-interface or per-unit bindings that reference those profiles.

The cos plugin owns this surface. Removing the plugin removes all QoS configuration from interfaces.

Named profiles

Profiles live under class-of-service { ieee-802.1p { ... } }. Each profile defines an ingress map (PCP to priority) and an egress map (priority to PCP). PCP and priority values are 0 through 7.

class-of-service {
    ieee-802.1p voip {
        ingress {
            pcp 5 { priority 7; }
            pcp 0 { priority 0; }
        }
        egress {
            priority 7 { pcp 5; }
            priority 0 { pcp 0; }
        }
    }
}

Unmapped PCP values keep priority 0 on ingress. Unmapped priorities are sent with PCP 0 on egress.

Interface binding

Reference a profile on an interface to apply it to all VLAN units on that interface:

interface {
    ethernet eth0 {
        class-of-service voip;
        unit 0 {
            vlan-id 100;
        }
        unit mgmt {
            vlan-id 200;
            class-of-service none;
        }
    }
}

All units inherit the interface-level profile. A unit can override it with a different profile name, or opt out entirely with none.

Inline QoS maps

Instead of referencing a named profile, a unit can define its maps inline. Inline maps and a profile reference are mutually exclusive on the same unit.

interface {
    ethernet eth0 {
        unit 0 {
            vlan-id 100;
            ingress-qos-map 5 { priority 7; }
            egress-qos-map 7 { pcp 5; }
        }
    }
}

Dynamic per-subscriber CoS via RADIUS

For L2TP/PPPoE subscribers, the CoS profile can be assigned dynamically at session establishment through RADIUS attributes:

Source Attribute Format
Filter-Id (11) cos:<profile-name> Selects a named 802.1p profile for the subscriber's access VLAN
Cisco-AVPair (vendor 9) subscriber:sub-qos-policy-in, subscriber:sub-qos-policy-out CoS profile name
Juniper ERX (vendor 4874) Ingress-Policy-Name, Egress-Policy-Name CoS profile name
Nokia (vendor 6527) Alc-Subscriber-QoS-Override CoS profile name
Huawei (vendor 2011) HW-Subscriber-QoS-Profile CoS profile name
MikroTik (vendor 14988) Mikrotik-Rate-Limit Shaper rate extraction (not CoS profile)

Ze cos: Filter-Id takes priority over vendor-specific attributes. Unknown vendor IDs are silently ignored.

The profile is applied on session-up. Mid-session CoA (Change of Authorization) updates are supported: a new cos: Filter-Id in a CoA message switches the active profile. On session-down, the subscriber's QoS state reverts.

VPP support

When the VPP interface backend is active, CoS maps are applied through the VPP qos-record (ingress) and qos-mark (egress) APIs instead of netlink VLAN QoS map ioctls.

CLI

show class-of-service          # List all registered profiles with their maps
show subscriber detail <id>    # Includes CoS profile when the cos plugin is loaded

See also

  • Interfaces for the interface configuration surface.
  • L2TP/PPP for the subscriber session model and RADIUS integration.
  • Plugins for the plugin catalogue.
  • Traffic Control for per-interface queueing disciplines.

Adapted from the cos plugin YANG schema and source code.

Home

About

First Steps

Configuration

Operation

Interfaces

Plugins

Plugin Development

Chaos Testing

Blueprints

Development

Reference

Clone this wiki locally