Synergy Software Package User's Manual
NetX Duo DHCPv6 Client

NetX Duo DHCP IPv6 Client Introduction

The Dynamic Host Configuration Protocol (DHCP) is used to obtain an IP address and network parameters. The DHCP is designed to extend the basic functionality of the BOOTP (which is limited to static address configuration) to include a completely dynamic IP address allocation through "leasing" an IP address to a client for a specified period of time. The DHCP can also be configured to allocate IP addresses in a static manner (like the BOOTP). An application's IP address is one of the supplied parameters for the NetX™ component. Supplying the IP address poses no problem if the IP address is known to the application, either statically or through the user configuration. When the application does not know or care what its IP address is, the NetX is initialized with a zero IP address; a DHCP client component added to NetX can then dynamically obtain an IP address.

The document covers the NetX Duo DHCPv6 Client API and how it is used to obtain IPv6 addresses. In IPv6 networks, DHCPv6 (instead of DHCP) is used for dynamic global IPv6 address assignment from a DHCPv6 server. DHCPv6 offers many of the same features, as well as several enhancements.

NetX Duo DHCP IPv6 Client Module Features

  • NetX Duo DHCPv6 Client is compliant with RFC 3315, RFC 3646, and related RFCs.
  • Provides high-level APIs for:
    • Creating and deleting a DHCPv6 Client instance
    • Starting and stopping a DHCPv6 Client
    • Message sending and processing
    • Retrieving DHCPv6 data from the DHCPv6 Client
nxd_dhcp_ipv6_client_BD.png
NetX Duo DHCP IPv6 Client Module Block Diagram
Note
In the figure above, the NetX Duo Network Driver module has multiple implementation options available. See the description just after the module stack figure in Including the NetX Duo DHCP IPv6 Client Module in an Application for additional details.

NetX Duo DHCP IPv6 Client Module APIs Overview

The NetX Duo DHCPv6 Client framework defines APIs for creating, deleting, adding and getting client information. A complete list of the available APIs, an example API call and a short description of each can be found in the following table. A table of status return values follows the API summary table.

NetX Duo DHCP IPv6 Client Module API Summary

Function Name Example API Call and Description
nx_dhcpv6_client_create nx_dhcpv6_client_create(&dhcp_0, &ip_0, "DHCPv6 Client", &pool_0,NULL, NULL, pointer, 2048, dhcpv6_state_change_notify, dhcpv6_server_error_handler);
Create a DHCPv6 Client instance.
nx_dhcpv6_client_delete nx_dhcpv6_client_delete(&my_dhcp);
Delete a DHCPv6 Client instance.
nx_dhcpv6_client_set_interface nx_dhcpv6_client_set_interface(&dhcp_0, index);
Set the Client network interface for communications with the DHCPv6 Server.
nx_dhcpv6_create_client_duid nx_dhcpv6_create_client_duid(&dhcp_0, NX_DHCPV6_DUID_TYPE_LINK_TIME, NX_DHCPV6_HW_TYPE_IEEE_802, 0)
Create a DHCPv6 Client DUID.
nx_dhcpv6_create_client_ia nx_dhcpv6_create_client_ia(&dhcp_0, &ipv6_address, NX_DHCPV6_PREFERRED_LIFETIME, NX_DHCPV6_VALID_LIFETIME);
Legacy Add a DHCPv6 Client Identity Address (IA).
nx_dhcpv6_create_client_iana nx_dhcpv6_create_client_iana(&dhcp_0, DHCPV6_IA_ID, DHCPV6_T1, DHCPV6_T2);
Create a DHCPv6 Client Identity Association for Non-Temporary Addresses (IANA).
nx_dhcpv6_add_client_ia nx_dhcpv6_add_client_ia(&dhcp_0, &ipv6_address, NX_DHCPV6_PREFERRED_LIFETIME, NX_DHCPV6_VALID_LIFETIME);
Add a DHCPv6 Client Identity Address (IA).
nx_dhcpv6_get_client_duid_time_id nx_dhcpv6_get_client_duid_time_id(&dhcp_0, &time_ID);
Get the time ID from DHCPv6 Client DUID.
nx_dhcpv6_get_ip_address nx_dhcpv6_get_IP_address(&dhcp_0, &ipv6_address);
nxd_ipv6_address_set(&ip_0, 0, &ipv6_address, 64, &address_index);
Get the global IPv6 address assigned to the DHCPv6 client.
nx_dhcpv6_get_lease_time_data nx_dhcpv6_get_lease_time_data(&dhcp_0, &T1, &T2, &preferred_lifetime, &valid_lifetime);
Get T1 and T2 in the Identity Association (IANA) leased to the DHCPv6 Client.
nx_dhcpv6_get_iana_lease_time nx_dhcpv6_get_iana_lease_time(&dhcp_0, &T1, &T2);
Get T1, T2, valid and preferred lifetimes for the DHCPv6 Client IPv6 address by address index.
nx_dhcpv6_get_valid_ip_address_count nx_dhcpv6_get_valid_ip_address_count(&dhcp_0, &address_count);
This service retrieves the count of the Client's valid IPv6 addresses. A valid IPv6 address is bound (assigned) to the Client and registered with the IP instance. Also useful for determining if the DHPCv6 Client has reached the bound state.
nx_dhcpv6_get_valid_ip_address_lease_time nx_dhcpv6_get_valid_ip_address_lease_time(&dhcp_0, &ip_address, &preferred_lifetime, &valid_lifetime);
Get T1, T2, valid and preferred lifetimes for the DHCPv6 Client IPv6 address by address index.
nx_dhcpv6_get_DNS_server_address nx_dhcpv6_get_DNS_server_address(&dhcp_0, index, &server_address);
Get DNS Server address at the specified index into the DHCPv6 Client DNS server list.
nx_dhcpv6_get_other_option_data nx_dhcpv6_get_other_option_data(&dhcp_0, option_code, buffer);
Get the specified option data, such as domain name or time zone server.
nx_dhcpv6_get_time_accrued nx_dhcpv6_get_time_accrued(&dhcp_0, &time_accrued);
Get the time accrued the global IPv6 address lease has been bound to the DHCPv6 Client.
nx_dhcpv6_get_time_server_address nx_dhcpv6_get_time_server_address(&dhcp_0, index, &server_address);
Get Time Server address at the specified index into the DHCPv6 Client Time server list.
nx_dhcpv6_reinitialize nx_dhcpv6_reinitialize(&dhcp_0);
Reinitialize the DHCPv6 for restarting the DHCPv6 Client state machine and rerunning the DHCPv6 protocol.
nx_dhcpv6_request_confirm nx_dhcpv6_request_confirm(&dhcp_0);
Send a CONFIRM request to the Server.
nx_dhcpv6_request_inform_request nx_dhcpv6_request_inform_request(&dhcp_0);
Send an INFORM REQUEST message to the Server.
nx_dhcpv6_request_option_DNS_server nx_dhcpv6_request_option_DNS_server(&dhcp_0, NX_TRUE);
Add the DNS server option to the Client option request data in request messages to the Server.
nx_dhcpv6_request_option_FQDN nx_dhcpv6_request_option_FQDN(&dhcp_0, "DHCPv6_Client", NX_DHCPV6_CLIENT_DESIRES_NO_SERVER_DNS_UPDATE);
Add the FQDN option to the Client option request data in request messages to the Server.
nx_dhcpv6_request_option_domain_name nx_dhcpv6_request_option_domain_name(&dhcp_0, NX_TRUE);
Add the domain name option to the Client option request data in request messages to the Server.
nx_dhcpv6_request_option_time_server nx_dhcpv6_request_option_time_server(&dhcp_0, NX_TRUE);
Add the time server option to the Client option request data in request messages to the Server.
nx_dhcpv6_request_option_timezone nx_dhcpv6_request_option_timezone(&dhcp_0, NX_TRUE);
Add the time zone option to the Client option request data in request messages to the Server.
nx_dhcpv6_request_release nx_dhcpv6_request_release(&dhcp_0);
Send a RELEASE request to the Server.
nx_dhcpv6_request_solicit nx_dhcpv6_request_solicit(&dhcp_0);
Send a DHCPv6 SOLICIT request to any Server on the Client network (broadcast).
nx_dhcpv6_request_solicit_rapid nx_dhcpv6_request_solicit_rapid(&dhcp_0);
Send a DHCPv6 SOLICIT request to any Server on the Client network (broadcast) with the Rapid Commit option set.
nx_dhcpv6_resume nx_dhcpv6_resume(&dhcp_0);
Resume DHCPv6 Client processing.
nx_dhcpv6_set_time_accrued nx_dhcpv6_set_time_accrued(&dhcp_0, time_accrued);
Set the time accrued on the global Client IPv6 address lease in the Client record.
nx_dhcpv6_start nx_dhcpv6_start(&dhcp_0);
Start the DHCPv6 Client thread task. Note this is not equivalent to starting the DHCPv6 state machine and does not send a SOLICIT request.
nx_dhcpv6_stop nx_dhcpv6_stop(&dhcp_0);
Stop the DHCPv6 Client thread task.
nx_dhcpv6_suspend nx_dhcpv6_suspend(&dhcp_0);
Suspend the DHCPv6 Client thread task.
The following services are available if NX_DHCPV6_CLIENT_RESTORE_STATE is defined for the project:
nx_dhcpv6_client_get_record nx_dhcpv6_client_get_record(dhcpv6_ptr,                      client_record_ptr);
Obtain a record of the client state (to save to non-volatile memory)
nx_dhcpv6_client_restore_record nx_dhcpv6_client_restore_record(dhcpv6_ptr,  client_record_ptr, time_elapsed);
Apply saved client record to the current Client instance. Note the DHCPv6 Client thread must be not be running when this task is called.
Note
For details on operation and definitions for the function data structures, typedefs, defines, API data, API structures, and function variables, review the associated Azure RTOS User's Manual in the References section.

Status Return Values

Name Description
NX_SUCCESS Successful API call.
NX_PTR_ERROR* Invalid pointer input.
NX_CALLER_ERROR* Must be called from thread.
NX_DHCPV6_PARAM_ERROR Invalid non pointer input.
NX_INVALID_INTERFACE Invalid interface index input.
NX_DHCPV6_UNSUPPORTED_DUID_TYPE DUID type unknown or not supported.
NX_DHCPV6_UNSUPPORTED_DUID_HW_TYPE DUID hardware type unknown or not supported.
NX_DHCPV6_IA_ADDRESS_ALREADY_EXIST Duplicate IA address.
NX_DHCPV6_REACHED_MAX_IA_ADDRESS IA exceeds the max IAs Client can store.
NX_DHCPV6_INVALID_IA_ADDRESS Invalid (for example, null) IA address in IA.
NX_DHCPV6_IA_ADDRESS_NOT_VALID IPv6 address successfully assigned.
NX_DHCPV6_UNKNOWN_OPTION Unknown/unsupported option code.
NX_DHCPV6_ALREADY_STARTED DHCPv6 Client is already running.
NX_DHCPV6_NOT_STARTED DHCPv6 Client task not started.
NX_DHCPV6_MISSING_REQUIRED_OPTIONS Client missing required options.
Note
Lower-level drivers may return common error codes. Refer to the SSP User's Manual API References for the associated module for a definition of all relevant status return values.
  • These are error codes which are only returned if error checking is enabled. Refer to the NetX User Guide for the Renesas Synergy™ Platform or NetX Duo User's Guide for the Renesas Synergy™ Platform for more details on error-checking services in NetX and NetX Duo, respectively.

NetX Duo DHCP IPv6 Client Module Operational Overview

The DHCPv6 protocol also uses the UDP to dynamically obtain IPv6 addresses. A NetX Duo IP instance is created automatically, and UDP, IPv6, and ICMPv6 are enabled on the IP instance prior to creating the DHCPv6 Client. When the DHCPv6 Client is created, a UDP socket is created and bound to port 546. The IPv6 Global Address property of the IP instance is locked to a zero IPv6 address; otherwise, the IPv4 address may be any network IP address. If the IP instance IPv6 Link Local Address property is set to zero, the DHCPv6 Client creates the link local address from the MAC address. The MAC address is set in the NetX Port ETHER instance. See Channel 1 MAC Address High Bits and Channel 1 MAC Address Low Bits properties. This is the source address for DHCPv6 messages to the server.

To begin the process of requesting a global IPv6 address assignment, a Client first broadcasts a SOLICIT message using the nx_dhcpv6_request_solicit service. In IPv6, the broadcast address is the All_DHCP_Relay_Agents_and_Servers address (FF02::1:2.). A DHCPv6 Server responds with an ADVERTISE message containing a global IPv6 address (not a link local address) for the Client, the IPv6 address lease time, and any additional information requested by the client. The DHCPv6 protocol requires the client to wait for a period of time to receive ADVERTISE messages from all DHCPv6 Servers on the network. The client pre-processes each ADVERTISE message to be a valid message and scans the option data for various DHCPv6 parameters; it also checks the preference value in the preference option, if supplied by the server. If more than one ADVERTISE message is received, the NetX DHCPv6 Client chooses the ADVERTISE message with the highest preference value received by the end of the wait period. If the Client receives an ADVERTISE message with a preference value of 255, it accepts that message immediately and discards all subsequent ADVERTISE messages.

The client extracts data from the ADVERTISE message and broadcasts (so all DHCPv6 Servers are informed) a REQUEST message specifying which server the client chooses; that server then confirms the assigned address information and lease times with a REPLY message to complete the protocol. 

The DHCPv6 Client is promoted to the bound state and automatically registers the assigned IPv6 address with the IP instance. 

Notification of Successful Address Assignment and Validation

The application can determine when the DHCPv6 Client is bound to an IPv6 address in two ways:  the first is to query the DHCPv6 Client itself for a valid IPv6 address using the nx_dhcpv6_get_IP_address service for clients for applications using only one global IPv6 address assigned, (the general case) or nx_dhcpv6_get_valid_ip_address_count service for clients with more than one IPv6 address assigned. The second way requires the DHCPv6 Client be configured with the state change callback, the Name of state change notification function property* of the DHCPv6 Client stack element. 

If the DHCPv6 Client receives a response from the server, but the server is unable to assign the address, the server returns an error status.  The application is notified of the error status received if configured with the DHCPv6 Client server-error callback - the Name of server error handler property of the DHCPv6 Client stack element. 

These callbacks must be defined by the application because these callback functions are called from the DHCPv6 Client thread task; the client application must NOT call any NetX Duo DHCPv6 Client services that require mutex control of the DHCPv6 Client (such as nx_dhcpv6_start, nx_dhcpv6_stop), and any of the APIs that send messages directly from the callback (such as nx_dhcpv6_request_release).

The states of the DHCP IPv6 protocol are:

NX_DHCPV6_STATE_INIT

NX_DHCPV6_STATE_SENDING_SOLICIT

NX_DHCPV6_STATE_SENDING_REQUEST

NX_DHCPV6_STATE_SENDING_RENEW

NX_DHCPV6_STATE_SENDING_REBIND

NX_DHCPV6_STATE_SENDING_DECLINE

NX_DHCPV6_STATE_SENDING_INFORM_REQUEST

NX_DHCPV6_STATE_BOUND_TO_ADDRESS

Duplicate Address Detection of the IPv6 address

If configured for the Duplicate Address Detection (DAD) protocol, enabled by default in NetX Duo Duplicate Address Detection property, NetX Duo automatically sends "Neighbor Solicit" messages to verify the assigned address is unique on the network. If the IPv6 address is unique, NetX Duo notifies the DHCPv6 Client when the assigned address has been promoted from NX_IPV6_ADDR_STATE_TENTATIVE to NX_IPV6_ADDR_STATE_VALID internally. The application must allow time for the DAD to finish processing, which takes about 4-5 seconds. If the DAD is not enabled, the IP instance marks the address VALID immediately.

Once an IPv6 address is valid, the device may use that IPv6 address to send and transmit IPv6 messages.

If the DAD protocol fails, NetX Duo notifies the DHCPv6 Client to send a DECLINE message to the server and restart the DHCPv6 Client at the INIT state. 

Retransmission of DHCPv6 Client Solicitations

The DHCPv6 Client times out waiting for a server reply before sending another DHCPv6 message and defaults to 1 second on the first retransmit, per RFC 3315 recommendations. If the DHCPv6 Client fails to receive a valid server response to the SOLICIT message, each subsequent retransmission interval doubles up to a maximum of 120 seconds by default.

DHCPv6 Lease Timeouts

The IPv6 lease assigned by the server contains two timeout parameters (T1 and T2) in the DHCPv6 Client Identity Association – Non-Temporary Addresses, (IANA), which is the data type specified by RFC 3315 to store IPv6 address data in DHCPv6.

When the time elapsed on an assigned IPv6 address reaches T1, the DHCPv6 Client automatically sends a RENEW message. If the elapsed time reaches T2 without a successful renewal, DHCPv6 Client automatically sends a REBIND message. If it still receives no response, the DHCP Client unregisters the IPv6 address with the IP instance and restarts the DHCPv6 protocol at the INIT state. Two other IPv6 lease parameters, preferred and valid lifetime, are assigned automatically to the Identity Association (IA) contained in the IANA in the DHCPv6 process. When the preferred and valid lifetimes expire, the assigned IPv6 address is either deprecated or rendered invalid; meaning a valid T1 must be less than the preferred lifetime and a T2 must be less than the valid lifetime.

NetX Duo DHCP IPv6 Client Module Important Operational Notes and Limitations

NetX Duo DHCP IPv6 Client Module Operational Notes

  • The NetX Duo Source element has a few key properties for supporting DHCPv6: The NetX Duo IPv6 Support property, the Checksum computation support on received ICMPV6 packets, and the Checksum computation support on transmitted ICMPv6 packets.  The latter two ensure that incoming and outgoing packets have an ICMPv6 checksum in the ICMPv6 header; these are automatically enabled for the DHCPv6 Client module. If the NetX Duo Source element is added to the project, check to make sure these properties are enabled.
  • The DHCPv6 Client creation requires a previously created packet pool. The application can use the IP default packet pool (g_packet_pool0) used by the IP instance or it can create its own (usually g_packet_pool1.)
  • Before sending a SOLICIT request, the Client must create a DHCP Unique Identifier (DUID) to uniquely define the client on the network. The MAC address is usually used but can be another unique identifier.  A typical invocation of this service is:
nx_dhcpv6_create_client_duid(&g_dhcpv6_client0,
NX_DHCPV6_DUID_TYPE_LINK_TIME /* Use MAC address */,
              NX_DHCPV6_HW_TYPE_IEEE_802,
              0 /* Client DUID time, usually set to zero */);
  • The DHCPv6 Client must also create the IANA for the client; this structure holds IPv6 lease information such as IPv6 addresses and T1 and T2 times.  (The client can use the IANA to request lease times.) To create an IANA, use thenx_dhcpv6_client_create_iana service:
status = nx_dhcpv6_create_client_iana(&g_dhcpv6_client0, 
DHCPV6_IANA_ID /* ULONG unique ID */,
DHCPV6_T1 /* Request T1 time in seconds or
             set to TX__WAIT_FOREVER */
DHCPV6_T2 /* Request T2 time;must be longer
          than T1 */);
  • In the SOLICIT request, the client may request the assignment of a specific IPv6 address from the server by calling the nx_dhcpv6_add_client_ia service before calling nx_dhcpv6_request_solicit.  This service uses an NXD_ADDRESS address data type for the IPv6 address. See NetX Duo User Guide for the Renesas Synergy™ Platform for details on the data type definition in NetX Duo.
  • To request network information such as a DNS server, NTP server, and other options, the application can all these APIs before calling nx_dhcpv6_request_solicit:
    • nx_dhcpv6_request_option_timezone(&g_dhcpv6_client, NX_TRUE);
    • nx_dhcpv6_request_option_DNS_server(&g_dhcpv6_client, NX_TRUE);
    • nx_dhcpv6_request_option_time_server(&g_dhcpv6_client, NX_TRUE);
    • nx_dhcpv6_request_option_domain_name(&g_dhcpv6_client, NX_TRUE);
  • If the client needs to release an assigned IPv6 address, it informs the DHCPv6 server by calling the nx_dhcpv6_request_release service. The DHCPv6 Client sends a unicast RELEASE message to the server and should wait for the server REPLY.
  • For DHCPv6 Client services that retrieve information about the DHCPv6 Client, an address index may need to be specified. Most clients have one IPv6 global address assigned, so the address index is 0.
  • To obtain specific information about lease times, use the nx_dhcpv6_get_valid_ip_address_lease_time service.  This requires an address index input (usually 0.)

NetX Duo DHCP IPv6 Client Module Limitations

  • The NetX Duo DHCPv6 Client does not support the server unicast option for sending unicast DHCPv6 messages to the DHCPv6 Server even if the server indicates this is permitted.
  • The NetX Duo DHCPv6 Client only supports DUIDs for LINK (MAC address) and LINK TIME (MAC address and time input.)
  • The NetX Duo DHCPv6 Client does not support the reconfigure request in which a server initiates IPv6 address changes to the clients on the network.
  • The NetX Duo DHCPv6 Client does not support the enterprise format for the DHCPv6 unique identifier control block; it only supports Link Layer and Link Layer Plus Time formats.
  • The NetX Duo DHCPv6 Client does not support Temporary Association (TA) address requests, but does support Non Temporary (IANA) option requests.
  • Refer to the most recent SSP Release Notes for any additional operational limitations for this module.

Including the NetX Duo DHCP IPv6 Client Module in an Application

This section describes how to include either or both the NetX Duo DHCP IPv6 Client module in an application using the SSP configurator.

Note
It is assumed you are familiar with creating a project, adding threads, adding a stack to a thread, and configuring a block within the stack. If you are unfamiliar with any of these items, refer to the first few chapters of the SSP User's Manual to learn how to manage each of these important steps in creating SSP-based applications.

To add the NetX Duo DHCP IPv6 Client module to an application, simply add it to a thread using the stacks selection sequence given in the following table.

NetX Duo DHCP IPv6 Client Module Selection Sequence

Resource ISDE Tab Stacks Selection Sequence
g_dhcp_client0 NetX Duo DHCP IPv6 Client Threads New Stack> X-Ware> NetX Duo> Protocols> NetX Duo DHPC IPv6 Client

When the NetX Duo DHCP IPv6 Client module is added to the thread stack as shown in the following figure, the configurator automatically adds any needed lower‑level modules. Any modules needing additional configuration information have the box text highlighted in Red. Modules with a Gray band are individual modules that stand alone. Modules with a Blue band are shared or common; they need only be added once and can be used by multiple stacks. Modules with a Pink band can require the selection of lower-level modules; these are either optional or recommended. (This is indicated in the block with the inclusion of this text.) If the addition of lower-level modules is required, the module description include Add in the text. Clicking on any Pink banded modules brings up the New icon and displays possible choices.

 

nxd_dhcp_ipv6_client_MS.png
NetX Duo DHCP IPv6 Client Module Stack

In the stack above, the NetX Network Driver (or NetX Duo Network Driver in a NetX Duo stack) has not been populated yet. There are multiple possible selections for the Network Driver; they are not all provided so as not to needlessly complicate the figure and the following configuration tables. The available options depend on the MCU target, but some typical options include:

  • NetX Duo Port using PPP on nxd_ppp
  • NetX Port ETHER on sf_el_nx
  • NetX Port using Cellular Framework on sf_cellular_nsal_nx
  • NetX Port using PPP on nx_ppp
  • NetX Port using Wi-Fi Framework on sf_wifi_nsal_nx

Configuring the NetX Duo DHCP IPv6 Client Module

The NetX Duo DHCP IPv6 Client module must be configured by the user for the desired operation. The SSP configuration window automatically identifies (by highlighting the block in red) any required configuration selections, such as interrupts or operating modes, which must be configured for lower-level modules for successful operation. Only properties that can be changed without causing conflicts are available for modification. Other properties are locked and not available for changes and are identified with a lock icon for the locked property in the Properties window in the ISDE. This approach simplifies the configuration process and makes it much less error-prone than previous manual approaches to configuration. The available configuration settings and defaults for all the user-accessible properties are given in the Properties tab within the SSP Configurator and are shown in the following tables for easy reference.

Note
You may want to open your ISDE, create the module and explore the property settings in parallel with looking over the following configuration table values. This helps to orient you and can be a useful hands-on approach to learning the ins and outs of developing with SSP.

Configuration Settings for the NetX Duo DHCP IPv6 Client Module

ISDE Property Value Description
Internal Thread Priority 3 Internal thread priority selection.
Time out for obtaining DHCPv6 client mutex (ticks) TX_WAIT_FOREVER Time out for obtaining DHCPv6 client mutex selection.
Time interval between current IP address lease time update (seconds) 1 Time interval between current IP address lease time update selection.
Maximum IA addresses allowed in client record 1 Maximum IA addresses allowed in client record selection.
Number of DNS servers the client will store 2 Number of DNS servers the client will stored selection.
Number of time servers the client will store 1 Number of time servers the client will store selection.
Domain name buffer size (bytes) 32 Domain name buffer size selection.
Current time zone information buffer size (bytes) 16 Current time zone information buffer size selection.
Maximum DHCPv6 server messages buffer size (bytes) 100 Maximum DHCPv6 server messages buffer size selection.
Name g_dhcpv6_client0 Module name.
Internal thread stack size (bytes) 4096 Internal thread stack size selection.
Name of state change notification function dhcpv6_state_change_notify Name of state change notification function selection.
Name of server error handler dhcpv6_server_error_handler Name of server error handler selection.
Name of generated initialization function nx_dhcpv6_client_init0 Name of generated initialization function selection.
Auto Initialization Enable, Disable

Default: Enable
Auto initialization selection.
Note
The example settings and defaults are for a project using the S7G2 Synergy MCU Group. Other MCUs may have different default values and available configuration settings.

In some cases, settings other than the defaults for stack modules can be desirable. For example, it might be useful to select different Ethernet interface pins and resets. The configurable properties for the lower-level stack modules are given in the following sections for completeness and as a reference. 

Note
Most of the property settings for lower-level modules are intuitive and usually can be determined by inspection of the associated properties window from the SSP configurator.

Configuration Settings for the NetX Duo DHCP IPv6 Client Lower-Level Modules

Only a small number of settings must be modified from the default for the IP layer and lower-level drivers as indicated via the red text in the thread stack block. Notice that some of the configuration properties must be set to a certain value for proper framework operation and are locked to prevent user modification. The following table identifies all the settings within the properties section for the module:

Configuration Settings for the NetX Duo IP Instance

ISDE Property Value Description
Name g_ip0 Module name.
IPv4 Address (use commas for separation) 0,0,0,0 IPv4 Address selection.
Subnet Mask (use commas for separation) 255,255,255,0 Subnet Mask selection.
IPv6 Global Address (use commas for separation) 0x2001, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1 IPv6 global address selection.
IPv6 Link Local Address (use commas for separation, All zeros means use MAC address) 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 IPv6 link local address selection.
IP Helper Thread Stack Size (bytes) 2048 IP Helper Thread Stack Size (bytes) selection.
IP Helper Thread Priority 3 IP Helper Thread Priority selection.
ARP Enable ARP selection.
ARP Cache Size in Bytes 512 ARP Cache Size in Bytes selection.
Reverse ARP Enable, Disable

Default: Disable
Reverse ARP selection.
TCP Enable, Disable

Default: Enable
TCP selection.
UDP Enable, Disable

Default: Enable
UDP selection.
ICMP Enable, Disable

Default: Enable
ICMP selection.
IGMP Enable, Disable

Default: Enable
IGMP selection.
IP fragmentation Enable, Disable

Default: Disable
IP fragmentation selection.
Name of generated initialization function ip_init0 Name of generated initialization function selection.
Auto Initialization Enable, Disable

Default: Enable
Auto initialization selection.
Note
The example settings and defaults are for a project using the Synergy S7G2 MCU Group. Other MCUs may have different default values and available configuration settings.

Configuration Settings for the NetX Duo DHCP IPv6 Common Instance

ISDE Property Value Description
Type of Service for UDP requests Normal, Minimum delay, Maximum data, Maximum reliabililty, Minimum cost

Default: Normal
Type of service UDP requests selection
Time to live 128 Time to live selection
Packet Queue depth 5 Packet queue depth selection
packet alocation timeout (seconds) 3 Packet allocation timeout selection
Interval for active session time update (seconds) 3 Interval for active session time update selection
Note
The example settings and defaults are for a project using the S7G2 Synergy MCU Group. Other MCUs may have different default values and available configuration settings.

Configuration Settings for the NetX Duo Common Instance

ISDE Property Value Description
Name of generated initialization function nx_common_init0 Name of generated initialization function selection
Auto Initialization Enable, Disable

Default: Enable
Auto initialization selection
Note
The example settings and defaults are for a project using the S7G2 Synergy MCU Group. Other MCUs may have different default values and available configuration settings.

Configuration Settings for the NetX Duo Packet Pool Instance

ISDE Property Value Description
Name g_packet_pool0 Module name
Packet Size in Bytes 640 Packet size selection
Number of Packets in Pool 16 Number of packets in pool selection
Name of generated initialization function packet_pool_init0 Name of generated initialization function selection
Auto Initialization Enable, Disable

Default: Enable
Auto initialization selection
Note
The example settings and defaults are for a project using the S7G2 Synergy MCU Group. Other MCUs may have different default values and available configuration settings.

NetX Duo DHCP IPv6 Client Module Clock Configuration

The ETHERC peripheral module uses PCLKA as its clock source. The PCLKA frequency is set using the SSP configurator clock tab prior to a build, or by using the CGC interface at run-time.

NetX Duo DHCP IPv6 Client Module Pin Configuration

The ETHERC peripheral module uses pins on the MCU device to communicate to external devices. I/O pins must be selected and configured by the external device as required.  The following table illustrates the method for selecting the pins within the SSP configuration window and the subsequent table illustrates an example selection for the I2C pins.

Note
The selected operation mode determines the peripheral signals available and the MCU pins required.

Pin Selection for the ETHERC Module

Resource ISDE Tab Pin selection Sequence
ETHERC Pins Select Peripherals> Connectivity:ETHERC> ETHERC1.RMII
Note
The selection sequence assumes ETHERC1 is the desired hardware target for the driver.

Pin Configuration Settings for the ETHERC1

Property Value Description
Operation Mode Disabled, Custom, RMII

Default: Disabled
Select RMII as the Operation Mode for ETHERC1.
Pin Group Selection Mixed, _A only

Default: _A only
Pin group selection.
REF50CK P701 REF50CK pin.
TXD0 P700 TXD0 pin.
TXD1 P406 TXD1 pin.
TXD_EN P405 TXD_EN pin.
RXD0 P702 RXD0 pin.
RXD1 P703 RXD1 pin.
RX_ER P704 RX_ER pin.
CRS_DV P705 CRS_DV pin.
MDC P403 MDC pin.
MDIO P404 MDIO pin.
Note
The example settings are for a project using the S7G2 Synergy MCU Group and the SK-S7G2 Kit. Other Synergy MCUs and other Synergy Kits may have different available pin configuration settings.

Using the NetX Duo DHCP IPv6 Client Module in an Application

The following example assumes a system that is already established with a working and enabled IP, ARP and UDP, and the link is running.

The steps in using the NetX Duo DHCP IPv6 Client module in a typical application are:

  1. Create a Client DUID for the DHCPv6 Client using the nx_dhcpv6_create_client_duid.
  2. Create an IANA for the DHCPv6 Client using the nx_dhcpv6_create_client_iana.
  3. Request network options (such as DNS server and time server) using the nx_dhcpv6_request_option_DNS_server and nx_dhcpv6_request_option_time_server API [Optional].
  4. Start the DHCPv6 Client with the nx_dhcpv6_start API.  This sets the DHCPv6 Client state and binds the client socket, in effect getting the DHCPv6 Client ready to exchange messages with the server.
  5. Send the SOLICIT message to the server using the nx_dhcpv6_request_solicit API.  The DHCPv6 Client internally manages the rest of the DHCPv6 protocol.
  6. Check for IPv6 Address resolution using the nx_dhcpv6_get_valid_ip_address_count API to return with an address_count > 0.  The DHCPv6 Client now as a valid IPv6 address.

The following figure illustrates common steps in a typical operational flow diagram:

nxd_dhcp_ipv6_client_TA.png
Flow Diagram of a Typical NetX Duo DHCP IPv6 Client Module Application