Subscriber service PCC rules Python API

Table: PCC Rule TLVs in the alc.sub_svc module lists the PCC rule PLVs in the alc.sub_svc module.

Table: PCC Rule TLVs in the alc.sub_svc module
sub_svc TLV Activate/ deactivate TLV details

pccrule

(list)

O/n.a.

Purpose

Adds a PCC rule to the subscriber service. Multiple PCC rule TLVs can be added in a single subscriber service instance.

Value

A PCC rule list describing the PCC rule with PCC rule TLVs such as name, precedence, direction, flows, and actions

PCC rule TLVs are appended to the PCC rule list with the sub_svc.pccrule.add_to_pccrule() function.

Default

Not included

Note: M=Mandatory, O=Optional, n.a.=ignored

Table: alc.sub_svc.pccrule Function lists the alc.sub_svc.pccrule function.

Table: alc.sub_svc.pccrule Function
alc.sub_svc.pccrule function Description

sub_svc.pccrule.add_to_pccrule (pccrule, pccrule TLV, value)

Appends a PCC rule TLV such as name, precedence, flow, or action to the PCC rule list. The PCC rule list describes the PCC rule and can be added to a subscriber service with the sub_svc.add_to_service() function.

Parameters:

pccrule (type = list): PCC rule list that describes the PCC rule. PCC rule TLVs are appended to this list with the sub_svc.pccrule.add_to_pccrule() function.

pccrule TLV (type int): PCC rule TLV that is appended to the PCC rule list

value (type as defined for the PCC rule TLV): the value of the PCC rule TLV that is appended to the PCC rule list

Table: PCC Rule TLVs in the alc.sub_svc.pccrule module lists the PCC rules TLVs in the alc.sub_svc.pccrule module.

Table: PCC Rule TLVs in the alc.sub_svc.pccrule module
PCC rule TLV M|O TLV details

pccrule.name (String)

M

Purpose

Specifies the name of the PCC rule

A PCC rule with the same name and same or different content can only be applied one time on a single parent PPPoE or IPoE session.

A PCC rule with the same name and same or different content can be applied on different parent PPPoE or IPoE sessions. Rules with the same name but different content gets a different PCC rule identifier (rule id).

pccrule.precedence (Integer)

O

Purpose

Specifies the precedence value for the PCC rule. The precedence defines a relative order of the different PCC rules: a rule with a lower precedence value is applied before a rule with a higher precedence value.

Rules with the same precedence and rules without precedence can be automatically optimized; the relative order in which they are applied is determined by the system for optimal sharing.

Value

0 to 65535

Default

n/a These rules are applied at the end.

pccrule.direction

(Integer)

M

Purpose

Specifies the direction of the PCC rule: ingress or egress

Value

direction_ingress (1)

direction_egress (2)

Default

n/a

pccrule.flow

(list)

M

Purpose

Adds a flow to the PCC rule. At least one flow must be added to a PCC rule. Multiple flow TLVs can be added to a PCC rule.

Value

A flow list describing the flow with flow TLVs such as dscp, protocol, src-ip, dst-ip, src-port, and dts-port

Flow TLVs are appended to the flow list with the sub_svc.flow.add_to_flow() function.

Default

Not included

pccrule.qos_action_ account (Boolean)

O (1)

Purpose

PCC rule action: account

Can be applied on ingress and egress

Results in IPv4 or IPv6 criteria entry in QoS policies.

When set to True:

if no rate-limit action is specified, a dynamic policer with pir=cir=max is instantiated for all flows in the PCC rule

CLI equivalent:

policer 1 # dynamic policer
  rate max cir max 
exit
entry 10 create
    match
       …
    exit
    action policer 1
exit

The forwarded octets and packets statistics of the dynamic policer associated with this PCC rule are included in subscriber service accounting.

Value

True (1)

False (0)

Default

False

pccrule.qos_action_ change_fc

(string)

O (1)

Purpose

PCC rule action: change the forwarding class

Can be applied on ingress and egress.

Results in IPv4 or IPv6 criteria entry in QoS policies

CLI equivalent:

entry 10 create
    match
       …
    exit
    action fc <fc-name>
exit

Value

String with fixed format forwarding class name: ‟be”, ‟l2”, ‟af”, ‟l1”, ‟h2”, ‟ef”, ‟h1” or ‟nc”

Default

n/a

pccrule.qos_action_ rate_limit_cir

(Integer)

O (1)

Purpose

PCC rule action: rate-limit CIR

  • instantiate a dynamic policer for all flows in the PCC rule (if not already present)

  • set the CIR value

Can be applied on ingress and egress.

Results in IPv4 or IPv6 criteria entry in QoS policies

CLI equivalent:

policer 1 # dynamic policer
    rate … cir <cir> 
exit
entry 10 create
    match
       …
    exit
    action policer 1
exit

Value

0 to 2000000000 kb/s

Default

n/a

pccrule.qos_action_ rate_limit_pir

(integer)

O (1)

Purpose

PCC rule action: rate-limit PIR

  • Instantiate a dynamic policer for all flows in the PCC rule (if not already present)

  • Set the PIR value

Can be applied on ingress and egress.

Results in IPv4 or IPv6 criteria entry in QoS policies.

CLI equivalent:

policer 1 # dynamic policer
    rate <pir> 
exit
entry 10 create
    match
       …
    exit
    action policer 1
exit

Value

1 to 2000000000 kb/s

Default

None

pccrule.qos_action

(integer)

O (1)

Purpose

PCC rule action: QoS forward

Can be applied on ingress and egress

Results in IPv4 or IPv6 criteria entry in QoS policies

CLI equivalent:

entry 10 create
    match
       …
    exit
    action
exit

Value

pccrule.qos_action_forward (1)

Default

n/a

pccrule.filter_action_http_redirect (string)

O (1)

Purpose

PCC rule action: http-redirect

Can be applied on ingress only

Results in an IPv4 or IPv6 filter entry

CLI equivalent:

entry 10 create
    match next-header tcp
       ...
    exit
    action
      http-redirect <rdr-url-string>
    exit
exit

Value

http-redirect URL string (maximum 255 characters)

Default

n/a

pccrule.filter_action_ redirect_to_nexthop_v4

(string)

O (1)

Purpose

PCC rule action: redirect to a next-hop IPv4 address

Can be applied on ingress only

Results in an IPv4 filter entry

CLI equivalent:

entry 10 create
    match
       ...
    exit
    action
        forward next-hop <ip-address>
    exit
exit

Value

IPv4 address

Default

n/a

pccrule.filter_action_ redirect_to_nexthop_v6

(string)

O (1)

Purpose

PCC rule action: redirect to a next-hop IPv6 address

Can be applied on ingress only

Results in an IPv6 filter entry. CLI equivalent:

entry 10 create
    match
       ...
    exit
    action
      forward next-hop <ipv6-address>
    exit
exit

Value

IPv6 address

Default

None

pccrule.filter_action_ redirect_to_router_v4

(integer)

O (1)

Purpose

PCC rule action: redirect to a routing instance

Can be applied on ingress only

Results in an IPv4 filter entry

CLI equivalent:

entry 10 create
    match
       ...
    exit
    action
      forward router <router-instance>
    exit
exit

Value

service-id

Default

n/a

pccrule.filter_action_ redirect_to_router_v6

(Integer)

O (1)

Purpose

PCC rule action: redirect to a routing instance

Can be applied on ingress only

Results in an IPv6 filter entry

CLI equivalent:

entry 10 create
    match
       ...
    exit
    action
      forward router <router-instance>
    exit
exit

Value

service-id

Default

n/a

pccrule.filter_action

(Integer)

O (1)

Purpose

PCC rule action: Filter forward or drop

Can be applied on ingress and egress

Results in an IPv4 or IPv6 filter entry

CLI equivalent:

entry 10 create
    match
       ...
    exit
    action
      forward | drop
    exit
exit

Value

pccrule.filter_action_forward (1)

pccrule.filter_action_drop (2)

Default

n/a

pccrule.policer_parent_arbiter (String)

O

Purpose

Specifies the dynamic policer parent arbiter name for this PCC rule.

The reserved value ‟_tmnx_no_parent” sets no arbiter parent for the dynamic policer used in this PCC rule.

Overrides the dynamic policer value configured in the sap-ingress or sap-egress QoS policy.

Value

Free format string (maximum length = 32 bytes)

‟_tmnx_no_parent” sets no parent arbiter

Default

None

pccrule.policer_parent_level (Integer)

O

Purpose

Specifies the dynamic policer parent level for this PCC rule.

Overrides the dynamic policer value configured in the sap-ingress or sap-egress QoS policy.

Value

1 to 8

Default

None

pccrule.policer_parent_weight (Integer)

O

Purpose

Specifies the dynamic policer parent weight for this PCC rule.

Overrides the dynamic policer value configured in the sap-ingress or sap-egress QoS policy.

Value

1 to 100

Default

None

pccrule.policer_mbs (Integer)

O

Purpose

Specifies the dynamic policer MBS value in bytes or reset to the default MBS value for this PCC rule.

Overrides the dynamic policer value configured in the sap-ingress or sap-egress QoS policy.

Value

0 to 16777216

-1 sets the default MBS

Default

None

pccrule.policer_cbs (Integer)

O

Purpose

Specifies the dynamic policer CBS value in bytes or resets to the default CBS value for this PCC rule.

Overrides the dynamic policer value configured in the sap-ingress or sap-egress QoS policy.

Value

0 to16777216

-1 sets the default CBS

Default

None

pccrule.policer_stat_mode (Integer)

O

Purpose

Specifies the dynamic policer stat-mode for this PCC rule.

Overrides the dynamic policer value configured in the sap-ingress or sap-egress QoS policy.

Value

Note that integer values are mapped to each of the stats-mode.

ingress:

  • 0 = pccrule.ingress_stat_mode_no_stats
  • 1 = pccrule.ingress_stat_mode_minimal
  • 2 = pccrule.ingress_stat_mode_offered_profile_no_cir
  • 3 = pccrule.ingress_stat_mode_offered_total_cir
  • 4 = pccrule.ingress_stat_mode_offered_priority_no_cir
  • 5 = pccrule.ingress_stat_mode_offered_profile_cir
  • 6 = pccrule.ingress_stat_mode_offered_priority_cir
  • 7 = pccrule.ingress_stat_mode_offered_limited_profile_cir
  • 8 = pccrule.ingress_stat_mode_offered_profile_capped_cir
  • 9 = pccrule.ingress_stat_mode_offered_limited_capped_cir

egress:

  • 0 = pccrule.egress_stat_mode_no_stats
  • 1 = pccrule.egress_stat_mode_minimal
  • 2 = pccrule.egress_stat_mode_offered_profile_no_cir
  • 3 = pccrule.egress_stat_mode_offered_total_cir
  • 4 = pccrule.egress_stat_mode_offered_profile_cir
  • 5 = pccrule.egress_stat_mode_offered_limited_capped_cir
  • 6 = pccrule.egress_stat_mode_offered_profile_capped_cir
  • 8 = pccrule.egress_stat_mode_offered_total_cir_exceed
  • 9 = pccrule.egress_stat_mode_offered_four_profile_no_cir
  • 10 = pccrule.egress_stat_mode_offered_total_cir_four_profile

Default

None

pccrule.policer_packet_byte_offset (Integer)

O

Purpose

Specifies the dynamic policer packet-byte-offset for this PCC rule. Setting the value to zero (0) sets no packet-byte-offset.

Overrides the dynamic policer value configured in the sap-ingress or sap-egress QoS policy.

Value

ingress: -32 to +31

egress: -64 to +31

Default

None

Notes:

Table: alc.sub_svc.flow functions lists the alc.sub_svc.flow function.

Table: alc.sub_svc.flow functions
alc.sub_svc.flow functions Description

sub_svc.flow.add_to_flow (flow, flow TLV, value)

Appends a flow TLV such as dscp, protocol, src-ip, dst-ip, src-port, or dst-port to the flow list. The flow list defines matching criteria for an IP flow and can be added to a PCC rule with the sub_svc.pccrule.add_to_pccrule() function.

Parameters:

flow (type = list): list containing the match criteria (DSP, 5-tuple) that describes an IP flow. Flow TLVs are appended to this list with the sub_svc.flow.add_to_flow() function. The flow is added to a PCC rule with the sub_svc.pccrule.add_to_pccrule() function.

flow TLV (type int): Flow TLV that is appended to the flow list.

value (type as defined for the flow TLV): the value of the flow TLV that is appended to the flow list

Table: PCC rule TLVs alc.sub_svc.flow module lists the PCC Rule TLVs alc.sub_svc.flow Module.

Table: PCC rule TLVs alc.sub_svc.flow module
Flow TLV M|O TLV details

flow.dscp (string)

O

Purpose

Specifies a DSCP flow match criterion

Value

Fixed DSCP name strings as in the output of show qos dscp-table; for example, ‟be” or ‟ef”. The DSCP name must be specified in lowercase.

Default

n/a

flow.protocol

(integer)

O

Purpose

Specifies a protocol number match criterion

Value

0 to 255

Default

n/a

flow.dst-ip

(string)

O

Purpose

Specify a destination IPv4 or IPv6 match criterion

Value

ipv4-address | ipv6-address | any

where

ipv4-address: d.d.d.d[/m]

d [0 to 255]

m [0 to 32]

ipv6-address: x:x:x:x:x:x:x:x[/preflen]

x: [0 to FFFF]

preflen: 0 to 128

Default

any

flow.dst-port

(string)

O

Purpose

Specify a destination port match criterion

Value

port or port range: port[-port]

where

port: 0 to 65535

Default

n/a

flow.src-ip

(string)

O

Purpose

Specify a source IP or IPv6 match criterion

Value

ipv4-address | ipv6-address | any

where

ipv4-address: d.d.d.d[/m]

d [0 to 255]

m [0 to 2]

ipv6-address: x:x:x:x:x:x:x:x[/preflen]

x: [0 to FFFF]

preflen: 0 to 128

Default

any

flow.src-port

(string)

O

Purpose

Specifies a source port match criterion

Value

port or port range: port[-port]

where

port: 0 to 65535

Default

n/a