SONiC NAS Run Time - amybuck/SONiC-NAS GitHub Wiki

This information describes the SONiC NAS run-time processes and components.

SONiC NAS Software Processes

  • sonic_object_service — Runs the CPS broker which mediates all CPS operations and events
  • sonic_pas_service — PAS daemon which runs PAS functionality
  • sonic_nas_daemon — NAS daemon which runs NAS functionality

System Components Managed by Applications

  • sonic-front-panel-ports — Manages physical port mapping to Linux interfaces
  • sonic-phy-media-config — Manages configuration of physical media
  • sonic-monitor-phy-media — Monitors physical media (SFP) events generated by PAS when a pluggable module is inserted(automatically configures port parameters)
  • sonic-ip — Gets/sets IP address parameters using the Object Library API
  • sonic-nas-shell — Runs NPU shell commands

NAS Linux Adaptation Functionality

The NAS daemon integrates standard Linux network APIs with NPU hardware functionality, and registers and listens to networking (netlink) events. When it receives an event, the NAS daemon processes the event contents and programs the NPU with relevant information, such as enabling/disabling an interface, adding/removing a route, or adding/deleting a VLAN.

Internal tap devices are used to associate physical ports on the NPU with Linux interfaces. When the NAS detects a change in physical port status (up/down), the daemon propagates the new port status to the associated tap device.

Packet I/O describes control-plane packet forwarding between physical ports and associated Linux interfaces. Packet I/O is implemented as a standalone thread of the NAS daemon. Packets received by the NPU are forwarded to the CPU. The packet I/O thread receives the packet through the SAI API callback. Each received packet contains the identity of the source physical port. The packet I/O module injects the packet to the tap device associated with the source physical port.

Applications receive packets from the Linux IP stack using standard sockets. Applications use tap devices to transmit packets. The packet I/O thread receives the transmitted packet from the Linux IP stack. Based on the source tap device of the packet, the transmitted packet is forwarded to the associated physical port.

SONiC Object Library Services

The NAS daemon registers with the object library as a server application to provide programmability of the NPU. The NAS performs create, delete, set, and get operations for objects which model the networking functionality. The PAS daemon also registers with the SONiC Object Library Service as a server application to provide programmability for system devices.

File System Organization

The SONiC NAS host-adapter uses a standard Linux ext4 file system. The Linux packages required for SONiC software are installed on the file system as per standard Linux package locations.

  • /usr/bin/ — Contains binaries, libraries, and YANG models
  • /etc/sonic/ — Contains platform description files and default configuration files

The platform files contain hardware module descriptions that apply to the current platform — the number of physical ports, fans, and power supplies. The default configuration files contain initialization information applicable to the current platform, such as the initial SAI configuration and system ACL rules applied at initialization.

System Startup

SONiC uses the systemd framework to define the system startup sequence — unit definitions are stored in /lib/systemd/system/sonic-nas-init.service.