User Tools

Site Tools


doc:techref:ucwmp

Table of Contents

ucwmp (CPE WAN Management Protocol daemon)

Project ucwmp is implementation of TR-069 for OpenWrt.

Code is licensed under GPL 2 and can be accessed at http://git.openwrt.org/?p=project/ucwmp.git;a=summary

It consists of few components that are separated binaries.

cwmpd

In TR-069 it's CPE role to initiate connection (session) with ACS (Auto Configuration Server) and this is what ucwmpd is responsible for. It's a daemon that reads config from cwmp UCI section (so it's usually located in /etc/config/cwmp) and starts sessions with ACS when needed.

ucwmpd daemons knows almost nothing about TR-069 protocol, all it understands are events. It needs to be aware of them as it knows exactly the reason for starting a session (this could be 0 BOOTSTRAP, 2 PERIODIC, 6 CONNECTION REQUEST, etc.).

It registers in ubus a cwmp object with following methods:

Method Argments Description
server_info_get { } Dump current config (info about ACS, periodic config, etc.)
server_info_set ? Update config
connection_request { "username": "username", "realm": "realm", "nonce": "nonce", "uri": "uri", "response": "response", "cnonce": "cnonce", "nc": "nc" } Request for initializing connection (session) with an ACS
event_sent ? ?
event_add ? ?
session_completed ? ?

When session is supposed to be started, ucwmpd executes external binary called cwmp-session with the following arguments:

-d <level>	Debugging level
-e <json>	List of events as JSON
-I <path>	Path to JSON with device info (Manufacturer, ModelName, SerialNumber, etc.)
-m <path>	Path to JSONs definint data model (eg. TR-098)

cwmp-session

TBD

connreq

Since ACS is a server and CPE is a client, there isn't a stadard way for ACS to initiate a connection. TR-069 however specifies a way to workaround this limitation. ACS can request CPE to initiate session by accessing a special HTTP URL. This way ACS may inform CPE that configuration was updated and ask it to reconfigure without waiting for a periodical request.

In ucwmp project this is handled by CGI compatible connreq binary. It simply requires configuring uhttpd (or some different HTTP server) to handle some specific URL with a connreq CGI.

When connreq is called, it verifies ACS request using CGI environment variables (HTTP_AUTHORIZATION and REQUEST_URI) and calls connection_request ubus method. As the result ucwmpd will start a session if the authorization succeeded.

doc/techref/ucwmp.txt · Last modified: 2014/04/23 11:35 by zajec