SONiC NAS Architecture - amybuck/SONiC-NAS GitHub Wiki

This information describes how SONiC provides an abstraction of hardware devices for network switching platforms in a Linux environment. Each component implements a set of well-defined APIs using full software modularity with hardware and software platform abstraction.

SONiC Components

  • Linux infrastructure
  • SONiC object library
  • Network adaptation service (NAS)
  • Switch Abstraction Interface (SAI)
  • Platform adaptation service (PAS)
  • System Device Interface (SDI)
  • Platform Description Infrastructure
  • Applications and tools

Linux Infrastructure

The Linux infrastructure consists of a collection of services, libraries, and utilities pre-installed in a SONiC generic image. Together with the Linux kernel, these components provide the foundation for the implementation of SONiC NAS Host-Adapter software components.

SONiC Object Library

The SONiC Object Library provides an object-centric framework that mediates interactions between applications and allows user applications to interact with software components. The SONiC Object Library defines two types of application roles — clients and servers.

Client applications can execute create, set, get, and delete operations on individual objects or lists of objects. Server applications execute operations requested by client applications. Because client applications operate on objects, they do not need to be aware of the location or name of the server application that executes a requested operation.

The SONiC Object Library framework supports a publisher/subscriber model. Server applications publish relevant events — client applications can subscribe (register) for specific events and objects. Client applications can register for events generated when objects are created, modified, or deleted. The publisher/subscriber approach and object centric operations allow for the completely independent operation of client and server applications.

Network Adaptation Service (NAS)

The NAS manages the high-level network processor (NPU) abstraction and adaptation. The NAS abstracts and aggregates the core functionality required for networking access at Layer 1 (physical layer), Layer 2 (VLAN, link aggregation), Layer 3 (routing), ACL, QoS, and network monitoring.

The NAS enables adaptation of the low-level switch abstraction provided by the Switch Abstraction Interface (SAI) for standard Linux networking APIs and interfaces, and SONiC-specific Object Library API functionality.

The NAS is also responsible for providing packet I/O services, using the Linux kernel IP stack.

Switch Abstraction Interface (SAI)

The SAI API is based on the Open Compute Project SAI API specification (see SAIO). The NAS implementation uses the SAI API, rather than a vendor-dependent SDK API to access NPU services.

Platform Adaptation Service (PAS)

The PAS provides a higher-level abstraction and aggregation of the functionality provided by the SDI component, and implements the object models associated with system devices. The PAS monitors system devices and reports (publishes) status changes or faults as events. It also allows user applications to retrieve current status information and set control variables of system devices.

The PAS Object API allows user applications to:

  • Read current temperature values reported by temperature sensors
  • Get and set fan speed values
  • Set a LED state
  • Read power levels reported by PSUs
  • Get system inventory and EEPROM information
  • Set transceiver module state (Tx laser on/off) and get module information

The PAS detects:

  • Common field replaceable units (FRUs), such as PSUs and fans, and insertion and removal events
  • Over-temperature events for pre-defined temperature thresholds
  • Transceiver insertion on physical ports

System Device Interface (SDI)

A system device refers to a hardware component including:

  • Fans/cooling devices
  • Power supplies
  • Temperature sensors
  • LEDs
  • EEPROM
  • Programmable devices.
  • Transceivers

All hardware components except for NPUs are abstracted as system devices. The SDI API defines a low-level platform-independent abstraction for all types of system devices. Only system device drivers that implement the SDI API are hardware-specific — the API itself is hardware-independent.

The implementation of the SDI API can use any approach suitable for a given platform or vendor:

  • sysfs access to Linux kernel device drivers
  • User space devices drivers using UIO or other methods
  • New vendor-specific kernel modules, accessible through sysfs, netlink or ioctl calls
  • Combination of any of the methods above

Other approaches not mentioned above are also possible, as long as the implementation supports the SDI API.

The illustration shows a simple implementation of the standard SDI function [sdi_temperature_get](NEED LINK) using sysfs.

Platform Description Infrastructure

The platform description infrastructure describes platform-specific configuration parameters — number of ports per system, supported transceiver modules, mapping of Linux interfaces to physical ports, and number of fans and power supply units. This component also contains the platform-specific system startup configuration and scripts.

Applications and Tools

The SONiC NAS Host-Adapter software provides a set of tools and commands that allow system administrators to access Dell-specific hardware functionality such as physical port, transceiver information, and system inventory (see SONiC Operation and Commands for more information).

A Dell-implemented thermal control application is also provided to prevent damage of hardware components in case of overheating and/or fan failure.