Python DTC variables and API

The following are the Python variables and APIs related to DTC:

Subscriber Host Identification

alc.dtc.derivedId

A read or write (from the Python perspective) string to store the LUDB lookup key for subscriber host identification. This key is derived from the contents of the packet. This string is used as a match criteria in LUDB. The derived-id can only be used when the lookup is performed in ESM. If the LUDB is attached to the local DHCP server, then the lookup based on the derived-id cannot be performed as the DHCP server has no means to derive such an ID from the DHCP message.

Caching Any Data During the Lifetime of a Transaction

alc.dtc.store(key,value)

The operator can store any data needed in one or more entries. The key can be any arbitrary string (printable ASCII characters), up to 32 bytes. The value part is ‛unlimited’ (memory permitting) in size.

alc.dtc.retrieve(key)

Retrieve data from the DTC. The key must be an existing key, which is a string consisting of printable ASCII characters, up to 32 bytes.

For example, this can be used to cache the DHCP options that the client inserts but the server does not echo back. Those options can still be retrieved in 7750 SR and 7450 ESS by cache in case that their presence is needed for any reason.

The lifespan of the cached data is tied to a DHCP transaction (a pair or corresponding DHCP messages flowing in opposite direction).

ESM Related Parameters (ESM strings, routing context)

DTC provides an API to supply a subset of configuration parameters that can otherwise come from RADIUS and LUDB and are used by the ESM code to setup the subscriber host.

DTC parameters as defined below should not be considered as DHCP options that can be blindly returned to the DHCP client, but instead they should be considered as real configuration settings. For example, the lease-time option is used in LUDB to enforce the lease time for the client. As such, the ESM keeps state of the lease-time. The following parameters can be used to setup a subscriber host:

alc.dtc.setESM (key-from-below, value)

Store data that is used by ESM. This data is write-only.  

The keys are predefined (only these can be used) and are described in Table: ESM-related Python variables . These keys are read-only static variables.

The LUDB column indicates the configuration option under the config>subscr-mgmt>loc-user-db>ipoe>host context in LUDB.

Table: ESM-related Python variables
DTC variable Type LUDB RADIUS attribute Comment

alc.dtc.subIdent

string

identification-strings >subscriber-id

Alc-Subsc-ID-Str

alc.dtc.subProfileString

string

identification-strings >sub-profile-string

Alc-Subsc-Prof-Str

alc.dtc.slaProfileString

string

identification-strings >sla-profile-string

Alc-SLA-Prof-Str

alc.dtc.spiSharingGroupId

integer

identification-strings >spi-sharing-group-id

Alc-SPI-Sharing-Id

alc.dtc.ancpString

string

identification-strings >ancp-string

Alc-ANCP-Str

alc.dtc.appProfileString

string

identification-strings >app-profile-string

Alc-App-Prof-Str

alc.dtc.intDestId

string

identification-strings >inter-dest-id

Alc-Int-Dest-Id-Str

alc.dtc.catMapString

string

identification-strings >category-map-name

Alc-Credit-Control-CategoryMap

alc.dtc.ipAddress

string

address

Framed-IPAddress

alc.dtc.dhcp4DefaultGateway

string

options>default-router

Alc-Default-Router

alc.dtc.subnetMask

string

address

Framed-IPNetmask

alc.dtc.ipv4LeaseTime

integer

options>lease-time

Alc-Lease-Time

alc.dtc.ipv4PrimDns

string

options>dns-server

Alc-Primary-Dns

Client-DNS-Pri

alc.dtc.ipv4SecDns

string

Alc-Secondary-Dns

Client-DNS-Sec

alc.dtc.primNbns

string

options>netbios-name-server

Alc-Primary-Nbns

RB-Client-NBNSPri

alc.dtc.secNbns

string

Alc-Secondary-Nbns

RB-Client-NBNSSec

alc.dtc.msapGroupInterface

string

msap-defaults>group-interface

Alc-MSAP-Interface

alc.dtc.msapPolicy

string, integer

msap-defaults>policy

Alc-MSAP-Policy

alc.dtc.msapServiceId

string, integer

msap-defaults>service

Alc-MSAP-Serv-Id

alc.dtc.retailServiceId

string

Retail-service-id

Alc-Retail-Serv-Id

alc.dtc.ipv6Address

string

ipv6-address

Alc-Ipv6-Address

alc.dtc.ipv6DelegatedPrefix

string

ipv6-delegated-prefix

Delegated-IPv6-Prefix

alc.dtc.ipv6SlaacPrefix

string

ipv6-slaac-prefix

Framed-IPv6-Prefix

alc.dtc.ipv6WanPool

string

ipv6-wan-address-pool

Framed-IPv6-Pool

alc.dtc.ipv6PrefixPool

string

ipv6-delegated-prefix-pool

Alc-Delegated-

IPv6-Pool

alc.dtc.ipv6DelegatedPrefixLength

integer

ipv6-delegated-prefix-len

Alc-Delegated-IPv6-Prefix-Length

alc.dtc.accountingPolicy

string

acct-policy

alc.dtc.dhcpv4GIAddr

string

gi-address

alc.dtc.dhcv4ServerAddress

string

server

alc.dtc.dhcp4SrcAddr

string

alc.dtc.dhcp4Pool

string

address>pool

Framed-Pool

Ip-Address-Pool-Name

prim | sec (‟|” – delimiter)

alc.dtc.linkAddress

string

link-address

alc.dtc.dhcp6SrcAddr

string

alc.dtc.dhcv6ServerAddr

string

server6

alc.dtc.setDhcpv6LinkAddr

string

link-address

This API applies only to regular numbered or unnumbered IPv6 interfaces (no ESM)

alc.dtc.setDhcpv6ServerAddr

string

server6

This API applies only to regular numbered or unnumbered IPv6 interfaces (no ESM)

alc.dtc.ipv6PrimDns

string

options6>dns-server

Alc-Ipv6-Primary-Dns

alc.dtc.ipv6SecDns

string

Alc-Ipv6-Secondary-Dns

alc.dtc.dhcpv6PreferredLifetime

integer

ipv6-lease-times>preferred-lifetime

Alc-v6-Preferred-Lifetime

alc.dtc.dhcpv6RebindTimer

integer

ipv6-lease-times>rebind-timer

Alc-Dhcp6-Rebind-Time

alc.dtc.dhcpv6RenewTimer

integer

ipv6-lease-times>renew-timer

Alc-Dhcp6-Renew-Time

alc.dtc.dhcpv6ValidLifetime

integer

ipv6-lease-times>valid-lifetime

Alc-v6-Valid-Lifetime

For example, an IP address is assigned to a DTC variable as a string:

alc.dtc.ipAddress = 192.168.0.10

This is performed through the following ALU API: alc.dtc.setESM(alc.dtc.ipAddress, 192.168.0.10). The DTC logic then parses this variable and converts it into appropriate format for consumption by ESM code.

The values defined above are the ones that are mostly defined in the LUDB. Main use, however, is assigning ESM strings for the subscriber host instantiation phase during the processing of DHCP ACK/Reply messages. Consequently, the Python script needs to be run only on DHCP Request messages (no need to run it on Discoveries for ESM string assignment, unless the LUDB derived ID is also needed).

DHCP options that are blindly returned to the DHCP client without the ESM code being aware of them cannot be configured with DTC. These options should be configured with RADIUS (Alc-ToCLient-Dhcp-Options IPv4 only) or they can be inserted directly into DHCP messages with Python (bypassing DTC).

Other possible uses for DTC variables are: