MPLS
MPLS (Multiprotocol Label Switching) is a high-performance packet forwarding technology that uses short labels rather than long network addresses to direct data packets through a network. MPLS creates virtual links (Label Switched Paths) between distant nodes regardless of underlying network topology, enabling traffic engineering, Quality of Service (QoS) prioritization, and VPN services. The label mode configuration determines how MPLS labels are allocated and distributed for VPN routes, with options including per-VRF (one label per VRF), per-prefix (unique label per route), per-CE (one label per customer edge router), and VRF connection aggregation modes. These label allocation strategies enable service providers to optimize label space utilization while maintaining traffic separation and scalability across their MPLS networks.
Diagram
Section titled “Diagram”Classes
Section titled “Classes”configuration (iosxe.devices)
Section titled “configuration (iosxe.devices)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| mpls | Class | [mpls] | No |
mpls (iosxe.devices.configuration)
Section titled “mpls (iosxe.devices.configuration)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| label_protocol | String | No | ||
| label_mode_all_vrfs_all_afs_per_vrf | Boolean | true, false | No | |
| label_mode_all_vrfs_all_afs_per_prefix | Boolean | true, false | No | |
| label_mode_all_vrfs_all_afs_per_ce | Boolean | true, false | No | |
| label_mode_all_vrfs_all_afs_vrf_conn_aggr | Boolean | true, false | No | |
| label_mode_all_vrfs_bgp_vpnv4_per_vrf | Boolean | true, false | No | |
| label_mode_all_vrfs_bgp_vpnv4_per_prefix | Boolean | true, false | No | |
| label_mode_all_vrfs_bgp_vpnv4_per_ce | Boolean | true, false | No | |
| label_mode_all_vrfs_bgp_vpnv4_vrf_conn_aggr | Boolean | true, false | No | |
| label_mode_all_vrfs_bgp_vpnv6_per_vrf | Boolean | true, false | No | |
| label_mode_all_vrfs_bgp_vpnv6_per_prefix | Boolean | true, false | No | |
| label_mode_all_vrfs_bgp_vpnv6_per_ce | Boolean | true, false | No | |
| label_mode_all_vrfs_bgp_vpnv6_vrf_conn_aggr | Boolean | true, false | No |
MPLS Label Mode Parameters
Section titled “MPLS Label Mode Parameters”Key Components:
-
Label Protocol (
label_protocol): Configures the MPLS label distribution protocol (e.g., LDP, TDP). -
Label Mode - All VRFs, All Address Families: Configures label allocation mode for all VRFs across all address families:
- Per-VRF Mode (
label_mode_all_vrfs_all_afs_per_vrf): Allocates one label per VRF, minimizing label space usage. - Per-Prefix Mode (
label_mode_all_vrfs_all_afs_per_prefix): Allocates unique labels per route prefix for granular traffic engineering. - Per-CE Mode (
label_mode_all_vrfs_all_afs_per_ce): Allocates one label per customer edge router. - VRF Connection Aggregation (
label_mode_all_vrfs_all_afs_vrf_conn_aggr): Aggregates VRF connections for optimized label allocation.
- Per-VRF Mode (
-
Label Mode - BGP VPNv4 Specific: Configures label allocation mode specifically for BGP VPNv4 routes:
- Per-VRF Mode (
label_mode_all_vrfs_bgp_vpnv4_per_vrf): One label per VRF for VPNv4. - Per-Prefix Mode (
label_mode_all_vrfs_bgp_vpnv4_per_prefix): Unique labels per VPNv4 prefix. - Per-CE Mode (
label_mode_all_vrfs_bgp_vpnv4_per_ce): One label per customer edge for VPNv4. - VRF Connection Aggregation (
label_mode_all_vrfs_bgp_vpnv4_vrf_conn_aggr): Aggregated VRF connections for VPNv4.
- Per-VRF Mode (
-
Label Mode - BGP VPNv6 Specific: Configures label allocation mode specifically for BGP VPNv6 routes:
- Per-VRF Mode (
label_mode_all_vrfs_bgp_vpnv6_per_vrf): One label per VRF for VPNv6. - Per-Prefix Mode (
label_mode_all_vrfs_bgp_vpnv6_per_prefix): Unique labels per VPNv6 prefix. - Per-CE Mode (
label_mode_all_vrfs_bgp_vpnv6_per_ce): One label per customer edge for VPNv6. - VRF Connection Aggregation (
label_mode_all_vrfs_bgp_vpnv6_vrf_conn_aggr): Aggregated VRF connections for VPNv6.
- Per-VRF Mode (
Key Parameters Briefly Explained:
label_protocol: MPLS label distribution protocol (LDP, TDP).label_mode_all_vrfs_all_afs_per_vrf: Per-VRF label allocation for all protocols and address families.label_mode_all_vrfs_all_afs_per_prefix: Per-prefix label allocation for all protocols and address families.label_mode_all_vrfs_all_afs_per_ce: Per-CE label allocation for all protocols and address families.label_mode_all_vrfs_all_afs_vrf_conn_aggr: VRF connection aggregation for all protocols and address families.label_mode_all_vrfs_bgp_vpnv4_*: BGP VPNv4-specific label modes.label_mode_all_vrfs_bgp_vpnv6_*: BGP VPNv6-specific label modes.
You can use these MPLS label mode parameters to optimize label allocation across your MPLS VPN network. The per-VRF mode minimizes label consumption, per-prefix mode enables granular traffic engineering, per-CE mode simplifies multihoming scenarios, and VRF connection aggregation optimizes label space for hub-and-spoke topologies. Choose the appropriate label mode based on your network’s scale, traffic engineering requirements, and label space constraints.
Sample Configuration
Section titled “Sample Configuration”The following configuration shows how to configure MPLS label modes on a Cisco IOS-XE device.
mpls label protocol ldpmpls label mode all-vrfs protocol all-afs per-vrfFor BGP VPNv4-specific configuration:
mpls label protocol ldpmpls label mode all-vrfs protocol bgp-vpnv4 per-prefixFor BGP VPNv6-specific configuration:
mpls label protocol ldpmpls label mode all-vrfs protocol bgp-vpnv6 per-ceExample YAML Code
Section titled “Example YAML Code”The following YAML code defines MPLS label mode configuration on an IOS-XE device.
Example 1: Basic Per-VRF Label Mode
Section titled “Example 1: Basic Per-VRF Label Mode”iosxe: devices: - name: Device1 configuration: mpls: label_protocol: ldp label_mode_all_vrfs_all_afs_per_vrf: trueExample 2: Per-Prefix Label Mode for All Protocols
Section titled “Example 2: Per-Prefix Label Mode for All Protocols”iosxe: devices: - name: CoreRouter1 configuration: mpls: label_protocol: ldp label_mode_all_vrfs_all_afs_per_prefix: trueExample 3: BGP VPNv4 and VPNv6 Specific Configurations
Section titled “Example 3: BGP VPNv4 and VPNv6 Specific Configurations”iosxe: devices: - name: PERouter1 configuration: mpls: label_protocol: ldp label_mode_all_vrfs_bgp_vpnv4_per_vrf: true label_mode_all_vrfs_bgp_vpnv6_per_prefix: trueExample 4: Per-CE Label Mode with VRF Connection Aggregation
Section titled “Example 4: Per-CE Label Mode with VRF Connection Aggregation”iosxe: devices: - name: PERouter2 configuration: mpls: label_protocol: ldp label_mode_all_vrfs_all_afs_per_ce: true label_mode_all_vrfs_bgp_vpnv4_vrf_conn_aggr: trueExample 5: Service Provider Network Configuration
Section titled “Example 5: Service Provider Network Configuration”This example shows a typical service provider PE router configuration with MPLS label modes optimized for scale.
iosxe: devices: - name: SP-PE-Router configuration: mpls: label_protocol: ldp label_mode_all_vrfs_all_afs_per_vrf: true