Overview
PandM is a CCSP component that implements core provisioning and management functionality of the device. Its primary role is to respond to commands from other CCSP components and protocol agents that need to set or query variables pertaining to provisioning and management. Its interface to other components uses the CCSP Message Bus interface and is based around a data model derived from TR-181 (TR-157, TR-143) along with CCSP specific extensions. PandM is a Key module which holds parameters related to many key services like: dhcpv6, LAN, DeviceInfo etc. It maintains a TR181 data model XML file with dbus object path as /com/cisco/spvtg/ccsp/pam . Has a layered architecture which makes it less complex for GET/SET implementation.
P&M interfaces with Protocol Agent, Cr, PSM and other common components via the Message Bus Interface.Initialize On the lower side, P&M interfaces with the HAL layer modules, Ethernet, WiFi, MoCA, IP, DHCP client/server, etc.
eyJleHRTcnZJbnRlZ1R5cGUiOiIiLCJnQ2xpZW50SWQiOiIiLCJjcmVhdG9yTmFtZSI6IlVua25vd24gVXNlciAoeW1haGFyYW5hKSIsIm91dHB1dFR5cGUiOiJibG9jayIsImxhc3RNb2RpZmllck5hbWUiOiJVbmtub3duIFVzZXIgKHltYWhhcmFuYSkiLCJsYW5ndWFnZSI6ImVuIiwidWlDb25maWciOiJ7fSIsImRpYWdyYW1EaXNwbGF5TmFtZSI6IiIsInNGaWxlSWQiOiIiLCJhdHRJZCI6IjE0NDkwMTUzMiIsImRpYWdyYW1OYW1lIjoiUGFuZE0gT3ZlcnZpZXdEaWFncmFtLmRyYXdpbyIsImFzcGVjdCI6IiIsImxpbmtzIjoiYXV0byIsImNlb05hbWUiOiJDY3NwUGFuZE0iLCJ0YnN0eWxlIjoidG9wIiwiY2FuQ29tbWVudCI6ZmFsc2UsImRpYWdyYW1VcmwiOiIiLCJjc3ZGaWxlVXJsIjoiIiwiYm9yZGVyIjp0cnVlLCJtYXhTY2FsZSI6IjEiLCJvd25pbmdQYWdlSWQiOjIxMzY1Njc2LCJlZGl0YWJsZSI6ZmFsc2UsImNlb0lkIjoyMTM2NTY3NiwicGFnZUlkIjoiIiwibGJveCI6dHJ1ZSwic2VydmVyQ29uZmlnIjp7ImVtYWlscHJldmlldyI6IjEifSwib2RyaXZlSWQiOiIiLCJyZXZpc2lvbiI6MSwibWFjcm9JZCI6ImFjYmYwZGJkLWZlZjYtNGJkYi05NmE2LWUwMWYyODVjZDkwOSIsInByZXZpZXdOYW1lIjoiUGFuZE0gT3ZlcnZpZXdEaWFncmFtLmRyYXdpby5wbmciLCJsaWNlbnNlU3RhdHVzIjoiT0siLCJzZXJ2aWNlIjoiIiwiaXNUZW1wbGF0ZSI6IiIsIndpZHRoIjoibnVsbCIsInNpbXBsZVZpZXdlciI6ZmFsc2UsImxhc3RNb2RpZmllZCI6MTYxNDY5NDU1MjAwMCwiZXhjZWVkUGFnZVdpZHRoIjpmYWxzZSwib0NsaWVudElkIjoiIn0=
Figure 1 PandM Overview
system calls - Example
sysevent set ipv4-tsip_IPAddress %s
sysevent set ipv4-tsip_Subnet %s
sysevent set ipv4-tsip_Gateway %s
sysevent set ipv4-resync_tsip %d
system("sysevent set wan_staticip-status stopped");
system("sysevent set wan_staticip-status started");
Architecture
This is the architecture of PandM component:
eyJleHRTcnZJbnRlZ1R5cGUiOiIiLCJnQ2xpZW50SWQiOiIiLCJjcmVhdG9yTmFtZSI6IlVua25vd24gVXNlciAoeW1haGFyYW5hKSIsIm91dHB1dFR5cGUiOiJibG9jayIsImxhc3RNb2RpZmllck5hbWUiOiJVbmtub3duIFVzZXIgKHltYWhhcmFuYSkiLCJsYW5ndWFnZSI6ImVuIiwidWlDb25maWciOiJ7fSIsImRpYWdyYW1EaXNwbGF5TmFtZSI6IiIsInNGaWxlSWQiOiIiLCJhdHRJZCI6IjE0NDkwMTUzMCIsImRpYWdyYW1OYW1lIjoiUGFuZE1BcmNoaXRlY3R1cmVPdmVydmlldy5kcmF3aW8iLCJhc3BlY3QiOiIiLCJsaW5rcyI6ImF1dG8iLCJjZW9OYW1lIjoiQ2NzcFBhbmRNIiwidGJzdHlsZSI6InRvcCIsImNhbkNvbW1lbnQiOmZhbHNlLCJkaWFncmFtVXJsIjoiIiwiY3N2RmlsZVVybCI6IiIsImJvcmRlciI6dHJ1ZSwibWF4U2NhbGUiOiIxIiwib3duaW5nUGFnZUlkIjoyMTM2NTY3NiwiZWRpdGFibGUiOmZhbHNlLCJjZW9JZCI6MjEzNjU2NzYsInBhZ2VJZCI6IiIsImxib3giOnRydWUsInNlcnZlckNvbmZpZyI6eyJlbWFpbHByZXZpZXciOiIxIn0sIm9kcml2ZUlkIjoiIiwicmV2aXNpb24iOjEsIm1hY3JvSWQiOiJkZjEzOGIxZS1lZDBiLTQ3MGUtYjcyYS1hYmY1MTQzYmFhY2EiLCJwcmV2aWV3TmFtZSI6IlBhbmRNQXJjaGl0ZWN0dXJlT3ZlcnZpZXcuZHJhd2lvLnBuZyIsImxpY2Vuc2VTdGF0dXMiOiJPSyIsInNlcnZpY2UiOiIiLCJpc1RlbXBsYXRlIjoiIiwid2lkdGgiOiJudWxsIiwic2ltcGxlVmlld2VyIjpmYWxzZSwibGFzdE1vZGlmaWVkIjoxNjE0Njk0NTUyMDAwLCJleGNlZWRQYWdlV2lkdGgiOmZhbHNlLCJvQ2xpZW50SWQiOiIifQ==
Figure 2 PandM Architecture Overview
PandM consist of three layers:
1) Access Layer
Access Layer interfaces with the CCSP message bus and receives any set or get calls and passes them onto the DML layer to manage the data which is in request.
2) Data Model Management Layer
- Goal is to support a large number of data model objects for good scalability
- Data Model Management Layer loads all data model access APIs through a pre-defined XML file which contains description of data model objects and parameters.
- The data model implementation in shared library interfaces HAL Integration (backend) Layer by calling backend integration APIs.
3) PandM HAL Integration (backend) Layer, a.k.a, component specific HAL
This is the layer making calls to underlying Linux system calls/commands, third party modules, open source modules and other CCSP components to execute the requests. This layer will be more component specific and will be providing APIs to CCSP so as to manage a particular hardware module of the system.
The implementation of APIs is responsible to convert the user space calls into Device IOCTL (kernel space) accordingly.
Code Flow
eyJleHRTcnZJbnRlZ1R5cGUiOiIiLCJnQ2xpZW50SWQiOiIiLCJjcmVhdG9yTmFtZSI6IlVua25vd24gVXNlciAoeW1haGFyYW5hKSIsIm91dHB1dFR5cGUiOiJibG9jayIsImxhc3RNb2RpZmllck5hbWUiOiJVbmtub3duIFVzZXIgKHltYWhhcmFuYSkiLCJsYW5ndWFnZSI6ImVuIiwidWlDb25maWciOiJ7fSIsImRpYWdyYW1EaXNwbGF5TmFtZSI6IiIsInNGaWxlSWQiOiIiLCJhdHRJZCI6IjE0NDkwMTUyMiIsImRpYWdyYW1OYW1lIjoiUGFuZE1Db2RlZmxvdy5kcmF3aW8iLCJhc3BlY3QiOiIiLCJsaW5rcyI6ImF1dG8iLCJjZW9OYW1lIjoiQ2NzcFBhbmRNIiwidGJzdHlsZSI6InRvcCIsImNhbkNvbW1lbnQiOmZhbHNlLCJkaWFncmFtVXJsIjoiIiwiY3N2RmlsZVVybCI6IiIsImJvcmRlciI6dHJ1ZSwibWF4U2NhbGUiOiIxIiwib3duaW5nUGFnZUlkIjoyMTM2NTY3NiwiZWRpdGFibGUiOmZhbHNlLCJjZW9JZCI6MjEzNjU2NzYsInBhZ2VJZCI6IiIsImxib3giOnRydWUsInNlcnZlckNvbmZpZyI6eyJlbWFpbHByZXZpZXciOiIxIn0sIm9kcml2ZUlkIjoiIiwicmV2aXNpb24iOjEsIm1hY3JvSWQiOiIzOWNkZDhiNy02YTdiLTRhZjItYWNhMS1jZTA0ZjFlOThmOWYiLCJwcmV2aWV3TmFtZSI6IlBhbmRNQ29kZWZsb3cuZHJhd2lvLnBuZyIsImxpY2Vuc2VTdGF0dXMiOiJPSyIsInNlcnZpY2UiOiIiLCJpc1RlbXBsYXRlIjoiIiwid2lkdGgiOiJudWxsIiwic2ltcGxlVmlld2VyIjpmYWxzZSwibGFzdE1vZGlmaWVkIjoxNjE0Njk0NTUyMDAwLCJleGNlZWRQYWdlV2lkdGgiOmZhbHNlLCJvQ2xpZW50SWQiOiIifQ==
PandM DM Objects on Initialization
CosaNatCreate() |
CosaProcStatusCreate() |
CosaDeviceInfoCreate() |
CosaUserinterfaceCreate() |
CosaEthernetCreate() |
CosaUsersCreate() |
CosaDdnsCreate() |
CosaFirewallCreate() |
CosaSecurityCreate() |
CosaIPCreate() |
CosaDhcpv4Create() |
CosaHostsCreate() |
CosaDNSCreate() |
CosaRoutingCreate() |
CosaBridgingCreate() |
CosaIFStackCreate() |
CosaPPPCreate() |
CosaDhcpv6Create() |
CosaDeviceControlCreate() |
CosaIPv6rdCreate() |
CosaRACreate() |
CosaNeighdiscCreate() |
CosaMldCreate() |
CosaDiagnosticsCreate() |
CosaTimeCreate() |
CosaUpnpCreate() |
TR181_ParentalControlCreate() |
CosaRLogCreate() |
CosaGreCreate() |
CosaGreTunnelCreate() |
CosaCGreCreate() |
CosaHotspotCreate() |
CosaFileTransferCreate() |
CosaTSIPCreate() |
CosaDeviceFingerprintCreate() |
Object/Parameter supported by P&M
Device.DeviceInfo. |
Device.GatewayInfo. |
Device.InterfaceStack.{i}. |
Device.Ethernet. |
Device.MoCA.Interface. |
Device.Bridging.Bridge.{i}. |
Device.PPP.Interface.{i}. |
Device.IP.Interface.{i}. |
Device.Routing.Router.{i}. |
Device.NAT. |
Device.DHCPv4. |
Device.DHCPv6. |
Device.Users. |
Functional Structure
CCSP Message Bus APIs
PandM DBUS object path is “/com/cisco/spvtg/ccsp/pam”.
PandM supports following CCSP Message Bus APIs:
initialize | Initializes NAT, DeviceInfo, Firewall, Ethernet, IP, Hosts, MoCAand Bridging. |
finalize | finalize |
getParameterNames | API returns parameter names associated with the supported objects. |
getParameterValues | Returns values of the parameters queried for. |
setParameterValues | API to the parameters with the values provided |
setCommit | Mainly used in bulk/atomic set operations when more than one parameter is involved. |
setParameterAttributes | API to set notifications status for the parameters. |
getParameterAttributes | API to get notifications status for the parameters. |
AddTblRow | API to add rows to the objects of table type. |
DeleteTblRow | API to delete rows to the objects of table type. |
busCheck | API is used in diagnostic mode. |
CCSP Message Bus APIs required from other components
PandM requires following CCSP Message Bus APIs.
From CR:
1) registerCapabilities
2) unregistername_space
3) unregisterComponent
4) discComponentSupportingNamespace
5) checkNamespaceDataType
6) SendDeviceProfileChangeSignal
From PA:
7) SendParameterValueChangeSignal
From PSM:
8) getParameterValues
9) setParameterValues
10) getParameterNames
PandM System Flow
Parameter set/get flow in PandM
eyJleHRTcnZJbnRlZ1R5cGUiOiIiLCJnQ2xpZW50SWQiOiIiLCJjcmVhdG9yTmFtZSI6IlVua25vd24gVXNlciAoeW1haGFyYW5hKSIsIm91dHB1dFR5cGUiOiJibG9jayIsImxhc3RNb2RpZmllck5hbWUiOiJVbmtub3duIFVzZXIgKHltYWhhcmFuYSkiLCJsYW5ndWFnZSI6ImVuIiwidWlDb25maWciOiJ7fSIsImRpYWdyYW1EaXNwbGF5TmFtZSI6IiIsInNGaWxlSWQiOiIiLCJhdHRJZCI6IjE0NDkwMTUyOCIsImRpYWdyYW1OYW1lIjoiUGFyYW1ldGVyIEdldCBGbG93IERpYWdyYW0uZHJhd2lvIiwiYXNwZWN0IjoiIiwibGlua3MiOiJhdXRvIiwiY2VvTmFtZSI6IkNjc3BQYW5kTSIsInRic3R5bGUiOiJ0b3AiLCJjYW5Db21tZW50IjpmYWxzZSwiZGlhZ3JhbVVybCI6IiIsImNzdkZpbGVVcmwiOiIiLCJib3JkZXIiOnRydWUsIm1heFNjYWxlIjoiMSIsIm93bmluZ1BhZ2VJZCI6MjEzNjU2NzYsImVkaXRhYmxlIjpmYWxzZSwiY2VvSWQiOjIxMzY1Njc2LCJwYWdlSWQiOiIiLCJsYm94Ijp0cnVlLCJzZXJ2ZXJDb25maWciOnsiZW1haWxwcmV2aWV3IjoiMSJ9LCJvZHJpdmVJZCI6IiIsInJldmlzaW9uIjoxLCJtYWNyb0lkIjoiODYwYjhjNjktNWY1Yy00Y2U5LWJhYzEtNGZmNjMwNmJlZmZjIiwicHJldmlld05hbWUiOiJQYXJhbWV0ZXIgR2V0IEZsb3cgRGlhZ3JhbS5kcmF3aW8ucG5nIiwibGljZW5zZVN0YXR1cyI6Ik9LIiwic2VydmljZSI6IiIsImlzVGVtcGxhdGUiOiIiLCJ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wicHJldmlld05hbWUiOiJQYW5kTSBib290LXVwIGZsb3cgZGlhZ3JhbS5kcmF3aW8ucG5nIiwibGljZW5zZVN0YXR1cyI6Ik9LIiwic2VydmljZSI6IiIsImlzVGVtcGxhdGUiOiIiLCJ3aWR0aCI6Im51bGwiLCJzaW1wbGVWaWV3ZXIiOmZhbHNlLCJsYXN0TW9kaWZpZWQiOjE2MTQ2OTQ1NTIwMDAsImV4Y2VlZFBhZ2VXaWR0aCI6ZmFsc2UsIm9DbGllbnRJZCI6IiJ9
Figure 5 PandM boot-up flow
Instance Number Operation Flow
Object instance number is used to uniquely identify the object, even across reboots. It is a special value PandM has to maintain, though it is not shown as a parameter. Instance number is generated when a new object is added, or during initialization, if no existing instance number is found. Generated instance number is saved in persistent configuration. Once the object is removed, the instance number is usually not reused.
Instance Number Operation Flow, when system boots up:
- Data Model Access Layer Starts and Loads DM adapter. DM adapter initialize its backend API
- DM adapter calls CosaDmlXyzGetEntry() to retrieve each object
- Backend reads saved configuration from persistent storage
- DM adapter checks, if Instance Number/Alias exists
- If exists then get saved configuration from persistent storage
- If not fund
- DM adapter generates Instance Number/Alias
- DM adapter calls CosaDmlXyzSetValues()
- Backend saves Instance Number/Alias into persistent storage
When an object is added during runtime:
- DMM receives ACS response to add an object. DM adapter creates an object internally and set the parameters with default values. DM adapter picks a unique instance number (and alias).
- DMM returns the instance number. DMM receives Set with filled parameters.
- DM adapter calls backend API to Add Entry. Instance Number and Alias (if any) are filled in.
- Backend saves the configuration, including Instance Number and Alias, and take respective actions.