Skip to content

Parodus In Detail

shilpa24balaji edited this page May 10, 2017 · 2 revisions

WebPA:

WebPA is the communication channel from Cloud to RDK based home gateway devices. It helps to manage devices from Cloud. WEBPA protocol provides functionality of read/write access to device management parameters in an efficient manner as compared to TR-69 or SNMP.

Parodus:

The main idea behind Parodus is to separate the core Webpa routing from the platform specific service. Parodus is a websocket client which connects to server in the cloud & delivers messages to and from services running on the gateway device. Parodus provides communication mechanism between clients (e.g. Client1, Client2, Client3) and server.

parodus_structure.png

PARODUS STRUCTURE

Parodus Functionalities:

  • Websocket client: Nopoll library used as Websocket Client. Nopoll is an OpenSource WebSocket implementation ( **RFC 6455 **). It allows building pure WebSocket solutions or to provide WebSocket support to existing TCP oriented applications. Nopoll handles all the messages coming from or to the server asynchronously.

  • Nanomsg Server: Parodus acts asNanomsg server to distribute messages upstream and downstream (ref. nanomsg).

Parodus Internal Communication - How Parodus communicates with clients on device:

Nanomsg is used to communicate with Parodus on the device. Nanomsg acts like internal bus. Client Server model is used where Parodus is server. This replaces previously defined RPC mechanisms. Message queues are implemented for both incoming WRP messages and outgoing WRP messages from nanomsg. This is same as nopoll incoming and outgoing queue architecture. Nanomsg is used in the following capacities:

· Nanomsg Server: Parodus is a nanomsg server that listens to incoming client requests & provides a mechanism for services on the device to register with Parodus.

· libparodus/Nanomsg Client: Libparodus is provided as a simple c library for any client that wants to communicate with Parodus. Service registration as well as "fire and forget" use cases are supported.

Client can act as:

  1. Send only client: Sends upstream messages to server

  2. Send and receive client: Sends upstream to server and receives downstream messages from server

Client Registration with Parodus (provided by libparodus):

This message is used by on device services that wish to register to parodus. During registration service name and port for sending data will be shared as part of this new WRP message registration_message. Registration msg will be sent to nanomsg server, that msg will contain specific URL of that client and service port number.

These registration port and service details are stored in a list in parodus which will be used to push or send messages downstream. Whenever any client gets registered with parodus that client will be added to that list. Clients will get deleted from that list when parodus observes that client is killed or dead.

client_registration.png

Client Registration

Service Keep Alive Message (provided by libparodus):

To maintain connection with clients parodus sends keep alive messages to clients. It acts like heart beats.

Upstream Communication:

Upstream means sending messages from Device to Cloud. WRP Msg_type 4 (msg_format) is used as upstream message. Upstream does not require any registration. Upstream messages will be received as PULL on fixed pre-defined port in Parodus which will be known to all clients without requiring any registration.

Upstream_flow.png

Upstream Flow

Downstream Communication:

Downstream means sending messages from Cloud to Device. WRP Msg_type 3 (msg_format) is used as downstream message. Parodus processes request coming through webpa server and sends to appropriate client by referring registered client list. Downstream requires registration, during registration service name and port for sending data will be shared as part of registration WRP message.

Downstream_Flow.png

Downstream Flow

CRUD:

Parodus defines a CRUD model that can be used to store/retrieve any configuration from cloud. CRUD APIs are REST APIs that support create, update, delete and retrieve operations for the objects from json file or in-memory. This json file is served as database and gets updated for all GET/SET operations (ref. CRUD-Model).

Parodus Command Line Argument:

Parodus accepts command line arguments. Below are the parameters required as command line arguments -

Name

Type

Description

/hw-model

string

The hardware model name.

/hw-serial-number

string

The serial number.

/hw-manufacturer

string

The device manufacturer.

/hw-mac

string

The MAC address used to manage the device.

/hw-last-reboot-reason

string

The last known reboot reason.

/fw-name

string

The firmware name.

/boot-time

number

The boot time in unix time.

/webpa-url

string

The URL that the WRP client should reach out to.

/webpa-backoff-max

number

The maximum value of c in the binary backoff algorithm

/webpa-ping-time

number

The maximum time to wait between pings before assuming the connection is broken.

/webpa-inteface-used

string

The device interface being used to connect to the cloud.

Open Source Libraries Used: Parodus uses below mentioned libraries:

· WRP-C: Library to pack/unpack messages in WRP format. It converts msgpack into bytes/String/base64 and vice-versa (ref. WRP-C).

· NANOMSG: for handling TCP socket client and server communication as a bus on 2 different processors.

· LIBPARODUS: nanomsg client, provides connectivity to parodus services, acts as parodus client (ref. libparodus).