ThreadX docsThreadX docs
ThreadX
ThreadX Modules
NetX Duo
FileX
GUIX
USBX
TraceX
LevelX
ThreadX
ThreadX Modules
NetX Duo
FileX
GUIX
USBX
TraceX
LevelX
  • NetX Duo Documentation

    • Understand NetX Duo
    • NetX Duo documentation
    • Chapter 1 - Introduction to NetX Duo
    • Chapter 2 - Installation and Use of NetX Duo
    • Chapter 3 - Functional Components of NetX Duo
    • Chapter 4 - Description of NetX Duo Services
    • Chapter 5 - NetX Duo Network Drivers
    • Appendix A - NetX Duo Services
    • Appendix B - NetX Duo Constants
    • Appendix C - NetX Duo Data Types
    • Appendix D - NetX Duo BSD-Compatible Socket API
    • Appendix E - NetX Duo ASCII Character Codes
    • Auto-IP

      • Chapter 1 - Introduction to NetX Duo AutoIP
      • Chapter 2 - Installation and use of NetX Duo AutoIP
      • Chapter 3 - Description of NetX Duo AutoIP services
    • BSD

      • Chapter 1 - Introduction to NetX Duo BSD
      • Chapter 2 - Installation and use of NetX Duo BSD
      • Chapter 3 - NetX Duo BSD Services
    • Crypto

      • Chapter 1 - Introduction to NetX Duo Crypto
      • Chapter 2 - Installation and use of NetX Duo Crypto
      • Chapter 3 - Functional description of NetX Duo Crypto
      • Chapter 4 - NetX Duo Crypto API description
      • Appendix - NetX Duo Crypto CAVS test
    • DHCP Client

      • Chapter 1 - Introduction to the NetX Duo DHCP Client
      • Chapter 2 - Installation and use of NetX Duo DHCP Client
      • Chapter 3 - Description of NetX Duo DHCP Client services
      • Appendix A - Description of the Restore state feature for NetX Duo DHCP Client services
    • DHCP Server

      • Chapter 1 - Introduction to NetX Duo DHCP Server
      • Chapter 2 - Installation and Use of the NetX Duo DHCP Server
      • Chapter 3 - Description of NetX Duo DHCP server services
    • DHCPv6 Client

      • Chapter 1 - Introduction to NetX Duo DHCPv6 Client
      • Chapter 2 - Installation and use of NetX Duo DHCPv6 Client
      • Chapter 3 - NetX Duo DHCPv6 configuration options
      • Chapter 4 - NetX Duo DHCPv6 Client services
      • Appendix A - Description of the Restore State Feature for NetX Duo DHCPv6 Client
    • DHCPv6 Server

      • Chapter 1 - Introduction to NetX Duo DHCPv6 server
      • Chapter 2 - Installation and use of NetX Duo DHCPv6 server
      • Chapter 3 - NetX Duo DHCPv6 server configuration options
      • Chapter 4 - NetX Duo DHCPv6 server services
      • Appendix A – NetX Duo DHCPv6 option codes
      • Appendix B - NetX Duo DHCPv6 server status codes
      • Appendix C - NetX Duo DHCPv6 unique identifiers (DUIDs)
      • Appendix D - NetX Duo Advanced DHCPv6 server example
    • DNS

      • Chapter 1 - Introduction to the NetX Duo DNS Client
      • Chapter 2 - Installation and Use of NetX Duo DNS Client
      • Chapter 3 - Description of NetX Duo DNS Client Services
    • FTP

      • Chapter 1 - Introduction to NetX Duo FTP
      • Chapter 2 - Installation and use of FTP
      • Chapter 3 - Description of FTP services
    • HTTP

      • Chapter 1 - Introduction to NetX Duo HTTP
      • Chapter 2 - Installation and Use of NetX Duo HTTP
      • Chapter 3 - Description of NetX Duo HTTP Services
    • iperf

      • Chapter 1 - Introduction to NetX Duo Iperf
      • Chapter 2 - Installing and using NetX Duo Iperf
      • Chapter 3 - Running the UDP Transmit Test
    • mDNS

      • Chapter 1 - Introduction to NetX Duo mDNS/DNS-SD
      • Chapter 2 - Installation and use of mDNS
      • Chapter 3 - Description of internal service cache
      • Chapter 4 - Description of mDNS services
    • mqtt

      • Chapter 1 - Introduction to NetX Duo MQTT
      • Chapter 2 - Installation and use of NetX Duo MQTT client
      • Chapter 3 - Description of NetX Duo MQTT Client Services
    • NAT

      • Chapter 1 - An introduction to Network Address Translation
      • Chapter 2 - Installation and use of NAT
      • Chapter 3 - NAT configuration options
      • Chapter 4 - Description of NAT services
    • POP3 Client

      • Chapter 1 - Introduction to NetX Duo POP3
      • Chapter 2 - Installation and use of NetX Duo POP3 Client
      • Chapter 3 - Description of POP3 Client services
    • PPP

      • Chapter 1 - Introduction to the NetX Duo Point-to-Point Protocol (PPP)
      • Chapter 2 - Installation and use of NetX Duo Point-to-Point Protocol (PPP)
      • Chapter 3 - Description of NetX Duo Point-to-Point Protocol (PPP) services
    • PTP Client

      • Chapter 1 - Introduction to NetX Duo PTP Client
      • Chapter 2 - Installation and Use of NetX Duo PTP Client
      • Chapter 3 - Description of NetX Duo PTP Client Services
    • rtp

      • Chapter 1 - Introduction to the NetX Duo RTP Sender
      • Chapter 2 - Installation and use of NetX Duo RTP Sender
      • Chapter 3 - Description of NetX Duo RTP Sender Services
    • rtsp

      • Chapter 1 - Introduction to the NetX Duo RTSP Server
      • Chapter 2 - Installation and use of NetX Duo RTSP Server
      • Chapter 3 - Description of NetX Duo RTSP Server Services
    • Secure DTLS

      • Chapter 1 - Introduction to NetX Duo Secure DTLS
      • Chapter 2 - Installation and use of NetX Duo Secure DTLS
      • Chapter 3 - Functional description of NetX Duo Secure DTLS
      • Chapter 4 - Description of NetX Duo Secure DTLS services
      • Appendix A - NetX Duo Secure DTLS return/error codes
    • Secure TLS

      • Chapter 1 - Introduction to NetX Duo Secure
      • Chapter 2 - Installation and use of NetX Duo Secure
      • Chapter 3 - Functional description of NetX Duo Secure
      • Chapter 4 - Description of NetX Duo Secure services
      • Appendix A - NetX Duo Secure return/error codes
    • SMTP Client

      • Chapter 1 - Introduction to NetX Duo SMTP client
      • Chapter 2 - Installation and use of NetX Duo SMTP client
      • Chapter 3 - Client description of SMTP Client services
    • snmp

      • Chapter 1 - Introduction to NetX Duo SNMP
      • Chapter 2 - Installation and use of the NetX Duo SNMP agent
      • Chapter 3 - Description of NetX Duo SNMP agent services
    • sntp client

      • Chapter 1 - Introduction to NetX Duo SNTP
      • Chapter 2 - Installation and Use of NetX Duo SNTP Client
      • Chapter 3 - Description of NetX Duo SNTP Client Services
      • Appendix A - NetX Duo SNTP Fatal Error Codes
    • telnet

      • Chapter 1 - Introduction to NetX Duo Telnet
      • Chapter 2 - Installation and use of NetX Duo Telnet
      • Chapter 3 - Description of NetX Duo Telnet services
    • TFTP

      • Chapter 1 - Introduction to NetX Duo TFTP
      • Chapter 2 - Installation and use of NetX Duo TFTP
      • Chapter 3 - Description of NetX Duo TFTP services
    • Web HTTP

      • Chapter 1 - Introduction to HTTP and HTTPS
      • Chapter 2 - Installation and use of HTTP and HTTPS
      • Chapter 3 - Description of HTTP services
    • About the NetX Duo User Guide

Chapter 2 - Installation and use of mDNS

This chapter contains a description of various issues related to installation, set up, and usage of the NetX Duo mDNS module.

Product Distribution

NetX Duo mDNS is available at https://github.com/eclipse-threadx/netxduo. The package includes two source files and a PDF file that contains this document, as follows:

  • nxd_mdns.h Header file for NetX Duo mDNS module
  • nxd_mdns.c C Source file for NetX Duo mDNS module
  • nxd_mdns.pdf PDF description of mDNS for NetX Duo
  • demo_netxduo_mdns.c A simple demonstration program that illustrates the services provided by mDNS.

NetX Duo mDNS Installation

In order to use the NetX Duo mDNS APIs, the entire distribution mentioned previously should be copied to the same directory where NetX Duo is installed. For example, if NetX Duo is installed in the directory "c:\netxduo" then the nxd_mdns.h and nxd_mdns.c should be copied into this directory.

Using NetX Duo mDNS

Using the NetX Duo mDNS module is easy. Basically, the application code must include nxd_mdns.h after it includes tx_api.h and nx_api.h, in order to use ThreadX, and NetX Duo, respectively. The build project must include the mDNS source code and the application file, and of course the ThreadX and NetX library files. This is all that is required to use NetX Duo mDNS.

Configuration Options

There are several configuration options for building NetX Duo mDNS module. The default values are listed, but each define can be set by the application prior to inclusion of the specified NetX Duo mDNS header file. The following list describes each in detail:

  • NX_MDNS_DISABLE_SERVER Disables the mDNS/DNS-SD server functionality. Without the server functionality, the mDNS/DNS-SD module does not announce services provided by local host, nor does it respond to mDNS enquiries. This symbol is not defined by default.
  • NX_MDNS_DISABLE_CLIENT Disables the mDNS/DNS-SD client functionality. Without the client functionality, mDNS/DNS-SD does not send queries, nor does it maintain mDNS query responses received over the network.
  • NX_MDNS_ENABLE_ADDRESS_CHECK Defined, the mDNS module performs validates addresses (source address, destination address, and port numbers) from the received mDNS messages. This symbol is defined by default.
  • NX_MDNS_ENABLE_CLIENT_POOF Defined, the mDNS module performs Passive Observation Of Failures, mDNS /DNS_SD client (querier) observes the multicast queries issued by the other hosts on the network. This symbol is defined by default.
  • NX_MDNS_ENABLE_SERVER_NEGATIVE_RESPONSES Defined, the mDNS /DNS-SD server (responder) generates negative responses to queries for which it has legitimate ownership. This symbol is defined by default.
  • NX_MDNS_ENABLE_IPV6 Defined, the mDNS/DNS-SD send/process mDNS message over IPv6 address. This symbol is not defined by default.
  • NX_MDNS_IPV6_ADDRESS_COUNT Maximum IPv6 addresses count of host. The default value is 2.
  • NX_MDNS_HOST_NAME_MAX Maximum string size for host name. The default value is 64. Does not include the NULL terminator.
  • NX_MDNS_SERVICE_NAME_MAX Maximum string size for service name. The default value is 64. Does not include the NULL terminator.
  • NX_MDNS_DOMAIN_NAME_MAX Maximum string size for domain name. The default value is 16. Does not include the NULL terminator.
  • NX_MDNS_CONFLICT_COUNT Maximum conflict count for host name or service name. The default value is 8.
  • NX_MDNS_RR_TTL_HOST TTL value for resource records with host name, in second. The default value is 120 for 120s.
  • NX_MDNS_RR_TTL_OTHER TTL value for other resource records, in second. The default value is 4500 for 75 minutes.
  • NX_MDNS_PROBING_TIMER_COUNT The time interval, in ticks, between mDNS probing messages. The default value is 25 ticks for 250ms.
  • NX_MDNS_ANNOUNCING_TIMER_COUNT The time interval, in ticks, between mDNS announcement messages. The default value is 25 ticks for 250ms.
  • NX_MDNS_GOODBYE_TIMER_COUNT The time interval, in ticks, between repeated "goodbye" messages. The default value is 25 ticks for 250ms.
  • NX_MDNS_QUERY_MIN_TIMER_COUNT The minimum time interval, in ticks, between two queries. The default value is 100 ticks for 1 second.
  • NX_MDNS_QUERY_MAX_TIMER_COUNT The maximum time interval, in ticks, between two queries. The default value is 360000 for 60 seconds.
  • NX_MDNS_QUERY_DELAY_MIN The minimum delay for sending first query, in ticks. The default value is 2 ticks for 20ms.
  • NX_MDNS_QUERY_DELAY_RANGE The delay range for sending first query, in ticks. The default value is 10 ticks for 100ms.
  • NX_MDNS_RESPONSE_INTERVAL The time interval, in ticks, in responding to a query to ensure an interval of at least 1s since the last time the record was multicast. The default value is 100 ticks.
  • NX_MDNS_RESPONSE_PROBING_TIMER_OUT The time interval, in ticks, in responding to a probe queries to ensure an interval of at least 250ms since the last time the record was multicast. The default value is 25 ticks.
  • NX_MDNS_RESPONSE_UNIQUE_DELAY The delay, in ticks, in responding to a query to a service that is unique to the local network. The default value is 1 tick for 10ms.
  • NX_MDNS_RESPONSE_SHARED_DELAY_MIN The minimum delay, in ticks, in responding to a query to a shared resource. The default value is 2 ticks for 20ms.
  • NX_MDNS_RESPONSE_SHARED_DELAY_RANGE The delay range, in ticks, in responding to a query to a shared resource. The default value is 10 ticks for 100ms.
  • NX_MDNS_RESPONSE_TC_DELAY_MIN The minimum delay, in ticks, in responding to a query with TC bit. The default value is 40 ticks for 400ms.
  • NX_MDNS_RESPONSE_TC_DELAY_RANGE The delay range, in ticks, in responding to a query with TC bit. The default value is 10 ticks for 100ms.
  • NX_MDNS_TIMER_COUNT_RANGE When sending out mDNS responses, the packet contains responses that otherwise would be sent within this timer counter range. The timer count range is expressed in ticks. The default value is 12 for 120ms. This value allows a response to include messages that would be sent within the next 120ms range if each tick is 10ms.
  • NX_MDNS_PROBING_RETRANSMIT_COUNT The number of retransmitted probing messages. The default value is 3.
  • NX_MDNS_GOODBYE_RETRANSMIT_COUNT The number of retransmitted "goodbye" messages. The default value is 1.
  • NX_MDNS_POOF_MIN_COUNT The number of queries that no multicast response, then the host may take this as an indication that the record may no longer be valid. The default value is 2.
  • NX_MDNS_POOF_TIME_COUNT The time interval, in ticks, in deleting the record from the cache after seeing two or more of these queries, and seeing no multicast response containing the expected answer. The default value is 1000 ticks for 10 seconds.
  • NX_MDNS_RR_DELETE_DELAY_TIMER_COUNT The delay for deleting a resource record when the TTL of this record is zero, in ticks, The default value is 100 ticks for 1 second.
Prev
Chapter 1 - Introduction to NetX Duo mDNS/DNS-SD
Next
Chapter 3 - Description of internal service cache