To configure an affinity (attributes which MPLS-TE tunnel requires in its links) for an MPLS-TE tunnel, use the affinity command in interface configuration mode. To disable this behavior, use the no form of this command.
affinity {affinity-value mask mask-value | exclude name | exclude-all | include name | include-strict name | flex-algo name}
no affinity {affinity-value mask mask-value | exclude name | exclude-all | include name | include-strict name}
Syntax Description
affinity-value
|
Attribute values that are required for links to carry this tunnel. A 32-bit decimal number. Range is from 0x0 to 0xFFFFFFFF,
representing 32 attributes (bits), where the value of an attribute is 0 or 1.
|
mask
mask-value
|
Checks the link attribute. A 32-bit decimal number. Range is 0x0 to 0xFFFFFFFF, representing 32 attributes (bits), where the
value of an attribute mask is 0 or 1.
|
exclude
name
|
Configures a particular affinity to exclude.
|
exclude-all
|
Excludes all affinities.
|
include
name
|
Configures the affinity to include in the loose sense.
|
include-strict
name
|
Configures the affinity to include in the strict sense.
|
Command Default
affinity-value : 0X00000000
mask-value : 0x0000FFFF
Command Modes
Interface configuration
Command History
Release
|
Modification
|
Release 7.0.12 |
This command was introduced.
|
Usage Guidelines
Affinity determines the link attributes of the tunnel (that is, the attributes for which the tunnel has an affinity). The
attribute mask determines which link attribute the router should check. If a bit in the mask is 0, the attribute value of
a link or that bit is irrelevant. If a bit in the mask is 1, the attribute value of that link and the required affinity of
the tunnel for that bit must match.
A tunnel can use a link if the tunnel affinity equals the link attributes and the tunnel affinity mask.
If there is an affinity failure, a 5-minute timer is started at the LSP headend. If the tunnel is not able to reoptimize within
the timeframe, it is torn down. However, if you execute the mpls traffic-eng reoptimize disable affinity-failure command, no timer is started and the tunnel is not torn down. At a subsequent time, other triggers for reoptimization may
start the timer for the LSPs with affinity failure.
Any properties set to 1 in the affinity should be 1 in the mask. The affinity and mask should be set as follows:
tunnel_affinity=tunnel_affinity and tunnel_affinity_mask
You can configure up to 16 affinity constraints under a given tunnel. These constraints are used to configure affinity constraints
for the tunnel:
- Include constraint
-
Specifies that a link is considered for CSPF if it contains all affinities associated with the include constraint. An acceptable
link contains more affinity attributes than those associated with the include statement. You can have multiple include statements
under a tunnel configuration.
- Include-strict constraint
-
Specifies that a link is considered for CSPF if it contains only the colors associated with the include-strict statement.
The link cannot have any additional colors. In addition, a link without a color is rejected.
- Exclude constraint
-
Specifies that a link satisfies an exclude constraint if it does not have all the colors associated with the constraint. In
addition, a link that does not have any attribute satisfies an exclude constraint.
- Exclude-all constraint
-
Specifies that only the links without any attribute are considered for CSPF. An exclude-all constraint is not associated with
any color; whereas, all other constraint types are associated with up to 10 colors.
You set 1 bit for each color; however, the sample output shows multiple bits at the same time. For example, you can configure
red and orange colors on HundredGigabitEthernet 0/0/0/3 from the interface command. The sample output from the show mpls traffic-eng link-management interfaces command shows that the Attributes field is set to 0x21, which means that there are 0x20 and 0x1 bits on the link.
Task ID
Task ID
|
Operations
|
mpls-te
|
read, write
|
Examples
This example shows how to configure the tunnel affinity and mask:
RP/0/RP0/CPU0:router# configure
RP/0/RP0/CPU0:router(config)# interface tunnel-te 1
RP/0/RP0/CPU0:router(config-if)# affinity 0101 mask 303
This example shows that a link is eligible for CSPF if the color is red. The link can have any additional colors.
RP/0/RP0/CPU0:router# configure
RP/0/RP0/CPU0:router(config)# interface tunnel-te 1
RP/0/RP0/CPU0:router(config-if)# affinity include red
This example shows that a link is eligible for CSPF if it has at least red and orange colors. The link can have any additional
colors.
RP/0/RP0/CPU0:router# configure
RP/0/RP0/CPU0:router(config)# interface tunnel-te 1
RP/0/RP0/CPU0:router(config-if)# affinity include red orange
This sample output shows that the include constraint from the show mpls traffic-eng tunnels command is 0x20 and 0x1:
Name: tunnel-te1 Destination: 0.0.0.0
Status:
Admin: up Oper: down Path: not valid Signalling: Down
G-PID: 0x0800 (internally specified)
Config Parameters:
Bandwidth: 0 kbps (CT0) Priority: 7 7
Number of configured name based affinity constraints: 1
Name based affinity constraints in use:
Include bit map : 0x21
Metric Type: TE (default)
AutoRoute: disabled LockDown: disabled
Loadshare: 0 equal loadshares
Auto-bw: disabled(0/0) 0 Bandwidth Requested: 0
Direction: unidirectional
Endpoint switching capability: unknown, encoding type: unassigned
Transit switching capability: unknown, encoding type: unassigned
Reason for the tunnel being down: No destination is configured
History:
This example shows that a tunnel can go over a link that contains red or orange affinity. A link is eligible for CSPF if it
has a red color or a orange color. Thus, a link with red and any other colors and a link with orange and other additional
colors must meet the constraint.
RP/0/RP0/CPU0:router# configure
RP/0/RP0/CPU0:router(config)# interface tunnel-te 1
RP/0/RP0/CPU0:router(config-if)# affinity include red
RP/0/RP0/CPU0:router(config-if)# affinity include orange
This sample output shows that the include constraint from the show mpls traffic-eng tunnels command is 0x20 or 0x1:
Name: tunnel-te1 Destination: 0.0.0.0
Status:
Admin: up Oper: down Path: not valid Signalling: Down
G-PID: 0x0800 (internally specified)
Config Parameters:
Bandwidth: 0 kbps (CT0) Priority: 7 7
Number of configured name based affinity constraints: 2
Name based affinity constraints in use:
Include bit map : 0x1
Include bit map : 0x20
Metric Type: TE (default)
AutoRoute: disabled LockDown: disabled
Loadshare: 0 equal loadshares
Auto-bw: disabled(0/0) 0 Bandwidth Requested: 0
Direction: unidirectional
Endpoint switching capability: unknown, encoding type: unassigned
Transit switching capability: unknown, encoding type: unassigned
Reason for the tunnel being down: No destination is configured
History:
This example shows that a link is eligible for CSPF if it has only red color. The link must not have any additional colors.
RP/0/RP0/CPU0:router# configure
RP/0/RP0/CPU0:router(config)# interface tunnel-te 1
RP/0/RP0/CPU0:router(config-if)# affinity include-strict red
This example shows that a link is eligible for CSPF if it does not have the red attribute.
RP/0/RP0/CPU0:router# configure
RP/0/RP0/CPU0:router(config)# interface tunnel-te 1
RP/0/RP0/CPU0:router(config-if)# affinity exclude red
This example shows that a link is eligible for CSPF if it does not have red and blue attributes. Thus, a link that has only
a red attribute or only a blue attribute is eligible for CSPF.
RP/0/RP0/CPU0:router# configure
RP/0/RP0/CPU0:router(config)# interface tunnel-te 1
RP/0/RP0/CPU0:router(config-if)# affinity exclude red blue
This example shows that a link is eligible for CSPF if it does not have either a red or a blue attribute.
RP/0/RP0/CPU0:router# configure
RP/0/RP0/CPU0:router(config)# interface tunnel-te 1
RP/0/RP0/CPU0:router(config-if)# affinity exclude red
RP/0/RP0/CPU0:router(config-if)# affinity exclude blue