Readme: Added Annex-F procedures

This commit is contained in:
Suvendhu Hansa 2022-12-20 12:09:04 +00:00 committed by Vivek Kumar Dutta
parent 664ef70ff2
commit fb8b5b9da6

View file

@ -87,9 +87,9 @@ The following tables provides a summary of all methods, and indicates the condit
| `GetRPCMethods` | OPTIONAL | `Yes` |
| `Inform` | `REQUIRED` | `Yes` |
| `TransferComplete` | `REQUIRED` | `Yes` |
| `AutonomousTransferComplete` | OPTIONAL | No |
| `AutonomousTransferComplete` | OPTIONAL | `Yes` |
| `DUStateChangeComplete` | OPTIONAL | `Yes` |
| `AutonomousDUStateChangeComplete` | OPTIONAL | No |
| `AutonomousDUStateChangeComplete` | OPTIONAL | `Yes` |
| `RequestDownload` | OPTIONAL | No |
| `Kicked` | OPTIONAL | No |
@ -448,6 +448,64 @@ ubus call uci commit '{"config":"cwmp"}'
Now, all required configuration are ready and you can start a cwmp connection using HTTPS.
## Manageable devices and Gateway Information (TR069 - Annex F)
> The CPE WAN Management Protocol can be used to remotely manage CPE Devices that are connected via a LAN through a Gateway. When an ACS manages both a Device and the Gateway through which the Device is connected, it can be useful for the ACS to be able to determine the identity of that particular Gateway.
> -- <cite> TR-69 Annex F.</cite>
Below is the sequence diagram for the Device-Gateway association with DHCP Discover.
```mermaid
sequenceDiagram
Lan-Device->>+Gateway: DHCP Discover (Device Identity)
Gateway->>Lan-Device: DHCP Offer (Gateway Identity)
Lan-Device->>Gateway: DHCP Request (Device Identity)
Gateway->>-Lan-Device: DHCP ACK (Gateway Identity)
Note left of Lan-Device: Lan-Device Populate GatewayInfo. table
Note right of Gateway: Gateway Populate ManageableDevice.{i}. table
Lan-Device->>ACS: TR069 Inform (with Gateway Identity)
ACS->>Lan-Device: TR069 Inform response
ACS->>Gateway: TR069 Get (ManageableDevice)
Gateway->>ACS: TR069 GetResp (ManageableDevice) table
```
### Gateway Procedures
A Gateway here in this context means, an Annex-F capable CPE running icwmpd which provide LAN/NAT connectivity.
The Gateway Identity tuple (OUI, ProductClass, SerialNumber) is present in 'db' (Same source used for Device.DeviceInfo. object).
The `/etc/init.d/icwmp` script reads the default lan interface from UCI option `cwmp.cpe.default_lan_interface` and configures the gateway identity in `dhcp` UCI for the corresponding LAN interface section to publish gateway information to its LAN clients.
> Note: If UCI option `cwmp.cpe.default_lan_interface` is not defined then gateway identity would not be published in LAN network.
#### Identification of Manageable Device in LAN network
Gateway device relies on DHCP options (/tmp/dhcp.client.options) file for getting the Manageable Device identities, which is exposed in the TR181 datamodel using (libbbf) API's.
The Device.ManagementServer.ManageableDevice.{i}. object table is populated for the active devices available in `Device.Hosts.` table and their device identity is collected from `/tmp/dhcp.client.options` file.
### Lan-Device procedures
A Lan-Device here in this context means, an Annex-F capable CPE running icwmpd which is connected via a LAN through a Gateway.
The Lan-Device Identity tuple (OUI, ProductClass, SerialNumber) is present in 'db' (Same source used for Device.DeviceInfo. object).
The `/etc/init.d/icwmp` script reads the default wan interface from UCI option `cwmp.cpe.default_wan_interface` and configures the device identity in `network` UCI to publish its own identity to upstream network (DHCP server) using DHCP option 125 for the corresponding wan interface.
> Note: If UCI option `cwmp.cpe.default_wan_interface` is not defined then it assumes the default interface as `wan`.
#### Identification of Gateway Device in WAN network
If lan-device(CPE) receives DHCP option 125 in DHCP offer from upstream network it exposes the same in its UBUS method (e.g. ifstatus wan).
```bash
root@iopsys-44d43771b000:~# ifstatus wan
{
...
...
"data": {
"opt125": "XXXXXXXXXXXXXXXXXXX"
}
}
```
ICWMPD package adds a DHCP client hook script (`/etc/udhcpc.user.d/udhcpc_icwmp.user`), which parses DHCP option 125 to extract gateway identity based on Enterprise ID `3561`.
This script then writes the gateway identity in `/var/state/cwmp` if CWMP is enabled in the device.
Datamodel (libbbf) API's reads the gateway information from `/var/state/cwmp` to populate Device.GatewayInfo. object. If gateway information is not available in `/var/state/cwmp` then it reads the 'db' (Same source used for Device.DeviceInfo. object) and maps that data to populate Device.GatewayInfo. object.
## Dependencies
To successfully build icwmp, the following libraries are needed: