Multifield classification policies

SR Linux supports rule-based QoS multifield classification of IPv4 and IPv6 packets. Each IPv4 and IPv6 multifield classification policy is structurally similar to an IPv4 or IPv6 interface ACL, containing a list of ordered entries, each specifying a set of match conditions and associated actions.

Each multifield classification rule, or entry, has a sequence ID. The policy evaluates packets starting with the entry with the lowest sequence ID, progressing to the entry with the highest sequence ID. Evaluation stops at the first matching entry (that is, when the packet matches all of the conditions specified by the multifield classification entry).

Multifield classification policies are supported on the following platforms:

  • 7220 IXR-D2/D2L/D3/D3L/D4/D5
  • 7250 IXR-6/6e/10/10e/X

Match conditions

Each IPv4 or IPv6 policy entry can specify zero or more of the following match conditions.

Table 1. Multifield classification match conditions
Match condition Description IPv4 policy support IPv6 policy support
Destination IP Matches by prefix or by address and mask
Destination port Matches by destination TCP or UDP port or range. Comparison operators define whether the matching destination port must be:
  • equal to the specified value
  • greater than or equal to the specified value
  • less than or equal to the specified value
DSCP set Matches one of the DSCP values listed. This setting matches against the ingress DSCP value (not the rewritten DSCP value). If left empty, any DSCP value matches.
Fragment/first-fragment Matches a packet that is a fragment, and optionally the first fragment
ICMP type/code Matches one of the specified ICMP type and code combinations
ICMPv6 type/code Matches one of the specified ICMPv6 type and code combinations
Next-header number Matches the first next-header field (in the IPv6 fixed header) if it contains the specified value
Protocol number Matches the IP protocol type field
Source IP Matches by prefix or by address and mask
Source port Matches source TCP or UDP port or range. Comparison operators define whether the matching source port must be:
  • equal to the specified value
  • greater than or equal to the specified value
  • less than or equal to the specified value
TCP flags Matches the TCP flag names: RST, SYN, and ACK based on a logical expression using the &, |, and ! operators

Supported actions

Each IPv4 or IPv6 policy entry supports the following actions:

  • set the forwarding class (mandatory action in each entry)
  • set the drop probability (optional action in each entry, default is low)
  • rewrite the ingress DSCP value (optional action in each entry, supported only on the 7220 IXR-D2/D2L/D3/D3L)

Supported interfaces: routed, bridged, and IRB

You can bind a multifield classification policy (IPv4, IPv6, or both) to the following subinterface types:

  • routed subinterface of a default or ip-vrf network instance, associated with an Ethernet port, LAG, or IRB
  • bridged subinterface of a mac-vrf network instance, associated with an Ethernet port or LAG

DSCP classification policy and multifield classifier policy on the same subinterface

You can apply both a DSCP classification policy and a multifield classifier policy to the same IP/routed subinterface for a specified protocol (IPv4 or IPv6). If an ingress IPv4 or IPv6 packet matches a multifield classification rule, its forwarding class and drop probability are determined solely by the matching multifield classification rule. If an ingress IPv4 or IPv6 packet does not match any multifield classification rule, forwarding class and drop probability are determined as follows:

  • On 7220 IXR-D2/D2L/D3/D3L/D4/D5:

    Forwarding class and drop probability are determined by the configured or default DSCP policy.

  • On 7250 IXR-6/6e/10/10e/X:

    Forwarding class and drop probability are determined by the configured or default IPv4 DSCP policy (for IPv4 packets) or IPv6 DSCP policy (for IPv6 packets).

Scaling and restrictions

The following describe scaling and restrictions for multifield classification policies.

7220 IXR-D2/D2L/D3/D3L/D4/D5

On the 7220 IXR-D2/D2L/D3/D3L/D4/D5:

  • Multifield classifier policies always operate in subinterface-specific mode, with no option available for a shared mode. As a result, the number of TCAM entries required to implement one multifield classifier policy is N × S, where N is the number of TCAM entries required to implement one instance of the policy and S is the number of subinterfaces where the policy is applied.
  • SR Linux blocks the binding of a MAC ACL and an IPv4 or IPv6 multifield classifier policy on the same subinterface. MAC ACL and multifield classification are mutually exclusive options.

7250 IXR-6/6e/10/10e/X

On the 7250 IXR-6/6e/10/10e/X:

  • Multifield classifier policies cannot operate in a subinterface-specific mode, with no option available to create subinterface-specific TCAM entries. As a result, the number of TCAM entries required to support one multifield classifier policy applied across S subintefaces is just N, where N is the number of TCAM entries required to implement one instance of the policy.
  • A maximum of 15 IPv4 and 15 IPv6 multifield classifier instances are supported, with utilization reported under info from state platform linecard slot forwarding-complex name acl resource [input-ipv4-filter-instances | input-ipv6-filter-instances].

Ingress DSCP rewrite (7220 IXR-D2/D2L/D3/D3L)

Ingress DSCP rewrite is supported only on the 7220 IXR-D2/D2L/D3/D3L.

Packets arriving on an interface can have IP DSCP markings that are not trusted. For example, when the upstream devices do not classify or mark the packets properly, or when the interface is at the beginning of a service SLA that is defined in terms of application characteristics instead of DSCP. In this case, an ingress DSCP rewrite action in the multifield classification policy can replace the DSCP value for matching IPv4 or IPv6 packets with a new value.

Note: If an egress DSCP rewrite rule is also applied to a Layer 3 subinterface, it does not overwrite the ingress DSCP rewrite action. In this case, the packet is transmitted with the DSCP specified in the ingress DSCP rewrite rule.

The following table provides more information about the packet flows that are supported with ingress DSCP rewrite.

Table 2. Supported packet flows with ingress DSCP rewrite
Ingress packet Ingress subif type Ingress subif MF classifier entry action Forwarding IRB subif MF classifier entry action Egress subif DSCP rewrite policy Egress packet
IP/Ethernet Bridged (mac-vrf)

Set fc = A

dscp-rewrite = B

L2 switched Configured or not configured (no effect in either case) Bridged subif DSCP rewrite policy: no effect DSCP = B
IP/Ethernet Bridged (mac-vrf)

Set fc = A

dscp-rewrite = B

L3 routed between mac‑vrf1 and mac‑vrf2 using IRB Not configured

mac-vrf2 IRB subif DSCP rewrite policy: no effect

mac-vrf2 bridged subif DSCP rewrite policy: no effect

DSCP = B
IP/Ethernet Bridged (mac-vrf)

Set fc = A

dscp-rewrite = B

L3 routed between mac‑vrf1 and mac‑vrf2 using IRB

IRB of mac-vrf1:

set fc = C

dscp-rewrite = D

mac-vrf2 IRB subif DSCP rewrite policy: no effect

mac-vrf2 bridged subif DSCP rewrite policy: no effect

DSCP = D
IP/Ethernet Bridged (mac-vrf)

Set fc = A

dscp-rewrite = B

L3 routed followed by VXLAN encap (symmetric or asymmetric) Not configured Routed subif DSCP rewrite policy: only changes outer DSCP VXLAN with outer DSCP based on fc = A lookup in the DSCP rewrite policy, payload DSCP = B
IP/Ethernet Bridged (mac-vrf)

Set fc = A

dscp-rewrite = B

L3 routed followed by VXLAN encap (symmetric or asymmetric)

IRB of mac-vrf1:

set fc = C

dscp-rewrite = D

Routed subif DSCP rewrite policy: only changes outer DSCP VXLAN with outer DSCP based on fc = C lookup in the DSCP rewrite policy, payload DSCP = D
IP/Ethernet Routed (ip-vrf or default)

Set fc = A

dscp-rewrite = B

L3 routed Routed subif DSCP rewrite policy: no effect DSCP = B

Configuring multifield classification policies for input traffic

To create a multifield classification policy, define either an IPv4 or IPv6 policy name using the qos classifiers multifield command. Within the named policy, configure one or more entries that consist of match conditions and the associated action to apply to matching packets.

The following examples create IPv4 and IPv6 multifield classifier policies, each containing one entry with multiple match conditions and associated actions.

Note: The rewrite set-dscp parameter is supported only on the 7220 IXR-D2/D2L/D3/D3L. Also the forwarding class (and associated queue) referenced by the action parameter must already be configured for the policy entry to be successfully committed.

Configure IPv4 multifield classification policy

--{ candidate shared default }--[  ]--
# info qos classifiers multifield-classifier mf-classifier-test-v4
    qos {
        classifiers {
            multifield-classifier mf-classifier-test-v4 {
                type ipv4
                entry 10 {
                    match {
                        ipv4 {
                            fragment true
                            first-fragment true
                            protocol tcp
                            dscp-set [
                                AF11
                            ]
                            destination-ip {
                                prefix 10.10.20.0/24
                            }
                           icmp {
                                type 1
                                code [
                                    0
                                ]
                            }
                            source-ip {
                                address 10.10.10.1
                                mask 255.255.255.0
                            }
                        }
                        transport {
                            tcp-flags syn&ack
                            destination-port {
                                operator eq
                                value 25
                            }
                            destination-port {
                                operator eq
                                value 25
                            }
                            source-port {
                                operator ge
                                value 2526
                            }
                        }
                    }
                    action {
                        forwarding-class test-fc6
                        drop-probability low
                    }
                }
            }
        }
    }

Configure IPv6 multifield classification policy

--{ candidate shared default }--[  ]--
# info qos classifiers multifield ipv6-policy multifield-test-v6    
    qos {
        classifiers {
            multifield-classifier mf-classifier-test-v6 {
                type ipv6
                entry 100 {
                    match {
                        ipv6 {
                            next-header tcp
                            dscp-set [
                                CS7
                            ]
                            destination-ip {
                                prefix 2001:db8:fe10::/64
                            }
                            icmp6 {
                                type 0
                                code [
                                    1
                                ]
                            }
                            source-ip {
                                prefix 2001:db8:fc00::/64
                            }
                        }
                        transport {
                            destination-port {
                                range {
                                    start 800
                                    end 1000
                                }
                            }
                            source-port {
                                operator le
                                value 700
                            }
                        }
                    }
                    action {
                        forwarding-class test-fc7
                        drop-probability medium
                            rewrite {             
                                set-dscp 56
                        }
                    }
                }
            }
        }

Applying a multifield classification policy to a subinterface

To apply an IPv4 or IPv6 multifield classification policy (or both) to a subinterface, use the qos interfaces interface input classifiers classifier command.

The following example applies the IPv4 and IPv6 multifield classification policies to inbound traffic on subinterface ethernet-1/1.1.

Apply multifield classification policy to subinterface

--{ candidate shared default }--[  ]--
# info qos interfaces interface ethernet-1/1
    qos {
        interfaces {
            interface ethernet-1/1 {
                interface-ref {
                    interface ethernet-1/1
                    subinterface 1 
                }
                input {
                    classifiers {
                        classifier ipv4 {
                            name mf-classifier-test-v4
                        }
                        classifier ipv6 {
                            name mf-classifier-test-v6
                        }
                    }
                }
            }
        }
    }