1.2.1.24 Zeroconf Module

Zero configuration (Zeroconf), provides a mechanism to ease the configuration of a device on a network. It also provides for a more human-like naming convention, instead of relying on IP addresses alone. Zeroconf also goes by the names Bonjour (Apple) and Avahi (Linux), and is an IETF standard

Abstraction Model

Zeroconf Software Abstraction Model:

TCPIP ZEROCONF Abstraction Model

Bonjour Service Model:

TCPIP ZEROCONF Bonjour Service

Enabling

Zeroconf can be enabled in the MPLAB Harmony Configurator, or by setting the following two defines in system_config.h file:

  • TCPIP_STACK_USE_ZEROCONF_LINK_LOCAL

  • TCPIP_STACK_USE_ZEROCONF_MDNS_SD

Link Local (Zeroconf)

The first component of Zeroconf is the ability to self-assign an IP address to each member of a network. Normally, a DHCP server would handle such situations. However, in cases where no DHCP server exists, Zeroconf enabled devices negotiate unique IP addresses amongst themselves.

mDNS

The second component of Zeroconf is the ability to self-assign human-readable hostnames for themselves. Multicast DNS provides a local network the ability to have the features of a DNS server. Users can use easily remembered hostnames to accesses the devices on the network. In the event that devices elect to use the same hostname, as in the IP address resolution, each of the devices will auto-negotiate new names for themselves (usually by appending a number to the end of the name).

Service Discovery

The last component of Zeroconf is service discovery. All Zeroconf devices can broadcast what services they provide. For instance, a printer can broadcast that it has printing services available. A thermostat can broadcast that it has an HVAC control service. Other interested parties on the network who are looking for certain services can then see a list of devices that have the capability of providing the service, and_connect_directly to it. This further eliminates the need to know whether something exists on a network (and what its IP or hostname is). As an end-user, all you would need to do is query the network if a certain service exists, and easily_connect_to it.

Zeroconf Enabled Environments

All Apple products have Zeroconf enabled by default. On Windows, you'll need to download the Safari web browser, and during the install, enable support for Bonjour. Note that in the Safari browser, you can browse and see a list of all Bonjour enabled devices, and click through to them automatically.

Library Interface

NameDescription
Multicast DNS Functions
TCPIP_MDNS_ServiceDeregisterDNS Service Discovery function for end-user to deregister a service advertisement, which was previously registered with the TCPIP_MDNS_ServiceRegister function.
TCPIP_MDNS_ServiceRegisterDNS Service Discovery function for end-users to register a service advertisement. The service is associated with all interfaces.
TCPIP_MDNS_ServiceUpdateDNS-Service Discovery function for end-user to update the service advertisement, which was previously registered with TCPIP_MDNS_ServiceRegister.
TCPIP_MDNS_TaskStandard TCP/IP stack module task function.
Link Local Functions
TCPIP_ZCLL_DisableDisables Zero Configuration on the specified interface.
TCPIP_ZCLL_EnableEnables Zero Configuration on the specified interface.
TCPIP_ZCLL_IsEnabledReturns whether or not an interface is enabled for zero configuration
TCPIP_ZCLL_TaskStandard TCP/IP stack module task function.
Data Types and Constants
ZCLL_MODULE_CONFIGPlaceholder for Zero Configuration Link Layer module configuration.
MDNSD_ERR_CODEvoid DisplayHostName(uint8_t *HostName);