Get to Know Service Layer API
A service layer API is a model-driven network communication protocol that
- uses Google-defined remote procedure call (gRPC) to enable programmatic control of network devices,
- provides direct access to network infrastructure layers for high performance, and
- supports multiple programming languages for integration with various clients, controllers, and protocols.
Benefits
Service layer APIs provide direct access to the Network Infrastructure Layer (Service-Adaptation Layer), resulting in:
- High Performance: Access bypasses intermediary network-state databases, enabling faster operations than typical management APIs. For example, batch updates go directly to the Label Switching Data Base (LSDB) and Routing Information Base (RIB) over gRPC.
- Flexibility: Developers can bring custom protocols or controllers in a variety of languages (C++, Python, Go, etc.) using gRPC.
- Offloading of Low-Level Tasks: IOS XR infrastructure handles conflict resolution, transactional notifications, and data plane abstraction, allowing you to focus on higher-layer protocols and logic.
Components of Service Layer API
- Functionality Verticals/Domains: These categorize API capabilities. Supported verticals include:
- Initialization (event notifications, heartbeats)
- Route (RIB) manipulation (IPv4, IPv6)
- MPLS (label allocation and mapping)
- Interface (state event subscription)
- BFD (session management and notifications)
- Policy-Based Routing (PBR)
- Protobuf schema/model: APIs are defined using gRPC and Google Protocol Buffers (GPB) for model-driven communication.
- gRPC: Handles serialization and encoding/decoding requests/responses between clients and routers, with bindings generated for various languages.
- Service layer gRPC clients: Can run on-box (agents in containers) or off-box (controllers or open-source tools).
- gRPC authentication modes: Secure communication between clients and servers using different methods.
-
The following table lists the authentication type and configuration requirements:
Table 1. Types of Authentication with Configuration Type Authentication Method
Authorization Method
Configuration Requirement
Requirement From Client
Metadata with TLS
username, password
username
grpc
username, password, and CA
Metadata without TLS
username, password
username
grpc no-tls
username, password
Metadata with Mutual TLS
username, password
username
grpc tls-mutual
username, password, client certificate, client key, and CA
Certificate based Authentication
client certificate's common name field
username from client certificate's common name field
grpc tls-mutual
and
grpc certificate authentication
client certificate, client key, and CA
Bring your controller
To bring your controller on IOS XR, first, enable the service layer on the router and then write your Service Layer Client API.


Feedback