NSH Based Service Chaining Commands

This chapter describes the commands available on the Cisco ASR 9000 Series Aggregation Services Router Cisco IOS XR software to configure and monitor features related to Network Service Header (NSH) based service chaining.

For detailed information about network stack concepts, configuration tasks, and examples, refer to the IP Addresses and Services Configuration Guide for Cisco ASR 9000 Series Routers.

service-function-path

A service function path can be associated with a class under policy configuration. To configure the service-function-path identifier prior to this association, use the command service-function-path command in the policy map class configuration mode.

service-function-path path-id index index-id

Syntax Description

path-id

Specifies the service function path identifier.

index-id

Specifies index value for service function (SF) or service function forwarder (SFF).

Command Default

No default action.

Command Modes

Policy map class configuration

Command History

Release

Modification

Release 6.1.1

This command was introduced.

Usage Guidelines

The path identifier can have a value between 1 and 16777215 (24 bits).

Task ID

Task ID

Operations

qos

read, write

Examples

This example shows how to configure the service function path identifier:


RP/0/RSP0/CPU0:router(config)# policy-map type pbr gre-policy
RP/0/RSP0/CPU0:router(config-pmap)# class type traffic gre-class
RP/0/RSP0/CPU0:router(config-pmap-c)# service-function-path 10 index 40

service-function-chaining path id

To define the sequence of the service function (SF) or the service function forwarder (SFF) through indices in a SF path, use the command service-function-chaining path id command in the service function chaining submode of the configuration mode.

service-function-chaining path id path-id metadata metadata-nameindex sf sf-name [ sf | sff sf-name | sff-name ... ] index sff sff-name [ sf | sff sf-name | sff-name ... ] index terminate default-action | metadata-disposition-name

Syntax Description

path-id

Specifies the service function chaining path identifier.

index

Specifies index value for SF or SFF.

sf sf-name

Specifies SF name.

sff sff-name

Specifies SFF name.

Command Default

No default action.

Command Modes

Service function chaining submode of the configuration mode.

Command History

Release

Modification

Release 6.1.1

This command was introduced.

Usage Guidelines

An index defines the sequence of the SF or SFF in the SF path. The highest index value indicates that SF/SFF are placed first in the service chain. The SF path can contain more than one SFF. One SF path can have different configurations on different nodes. The index of a SFF should be greater than the index of a SF.

The SF indices must be contiguous. Non-contiguous indices are not allowed and will be dropped by the platform. The SF index can have a value between 1 and 255 (8 bits).

Task ID

Task ID

Operations

qos

read, write

Examples

The following is a configuration example of SF path:


RP/0/RSP0/CPU0:router(config)# service-function-chaining path id 10
RP/0/RSP0/CPU0:router(config-service-function-chaining)# 40 sf SF-NAME
RP/0/RSP0/CPU0:router(config-service-function-chaining)# 39 sff SFF-NAME
RP/0/RSP0/CPU0:router(config-service-function-chaining)# 38 terminate default-action


service-function-chaining sf

To define a service function (SF) with a name and configure reachability parameters, use the command service-function-chaining sf command in the service function chaining submode of the configuration mode.

service-function-chaining sf sf-name locator locator-id transport type source-address ipv4 src-addr destination-address ipv4 dst-addr vni value

Syntax Description

sf sf-name

Specifies SF name.

locator locator-id

Defines reachability information.

transport type

Specifies transport type.

source-address ipv4 src-addr

Specifies source IPv4 address.

destination-address ipv4 dst-addr

Specifies destination IPv4 address.

vni value

Specifies Visual Networking Index (VNI) value, in the range between 4000 and 4099. See this white paper for related information.

Command Default

No default action.

Command Modes

Service function chaining submode of the configuration mode.

Command History

Release

Modification

Release 6.1.1

This command was introduced.

Usage Guidelines

SF can use up to one locator keyword to define reachability information. Reachability information includes transport type and other parameters.

Task ID

Task ID

Operations

qos

read, write

Examples

The following is a configuration example of SF with locator and reachability information:


Router(config)# service-function-chaining sf SFNAME
Router(config-service-function-chaining)# locator SFLOCID
Router(config-service-function-chaining)# transport vxlan-gpe
Router(config-service-function-chaining)# source-address ipv4 192.0.2.10
Router(config-service-function-chaining)# destination-address ipv4 192.0.2.20
Router(config-service-function-chaining)# vni 4010


service-function-chaining sff

To define a service function forwarder (SFF) with a name and configure reachability parameters, use the command service-function-chaining sff command in the service function chaining submode of the configuration mode.

service-function-chaining sff sff-name locator locator-id transport type source-address ipv4 src-addr destination-address ipv4 dst-addr vni value

Syntax Description

sff sff-name

Specifies SFF name.

locator locator-id

Defines reachability information.

transport type

Specifies transport type.

source-address ipv4 src-addr

Specifies source IPv4 address.

destination-address ipv4 dst-addr

Specifies destination IPv4 address.

vni value

Specifies Visual Networking Index (VNI) value, in the range between 4000 and 4099. See this white paper for related information.

Command Default

No default action.

Command Modes

Service function chaining submode of the configuration mode.

Command History

Release

Modification

Release 6.1.1

This command was introduced.

Usage Guidelines

SFF can use up to one locator keyword to define reachability information. Reachability information includes transport type and other parameters.

Task ID

Task ID

Operations

qos

read, write

Examples

The following is a configuration example of SFF with locator and reachability information:


RP/0/RSP0/CPU0:router(config)# service-function-chaining sff SFFNAME
RP/0/RSP0/CPU0:router(config-service-function-chaining)# locator SFFLOCID
RP/0/RSP0/CPU0:router(config-service-function-chaining)# transport vxlan-gpe
RP/0/RSP0/CPU0:router(config-service-function-chaining)# source-address ipv4 192.0.2.10
RP/0/RSP0/CPU0:router(config-service-function-chaining)# destination-address ipv4 192.0.2.20
RP/0/RSP0/CPU0:router(config-service-function-chaining)# vni 4010