About DNS-SD/mDNS discovery

The DNS-SD/mDNS discovery mechanism (also known by the Apple trademark name 'Bonjour') is the currently preferred discovery mechanism in DoIP networks. Services are advertised by DNS records, that can be retrieved in a local network by means of multicast DNS (mDNS). This means that devices using IPv6 can generate their own IP address each time they start up, and still be discovered.

Technical details

DoIP devices advertise a service with type '_ep._tcp'. The service has a name that should be unique on the host that is advertising the service and is also shown to the user. The protocol that is used to download the definition file from the device is specified in the 'EPProtocol' attribute. On the right, a screenshot of Bonjour Browser can be seen that shows an advertised endpoint service.

HTTP as transfer protocol

Commonly, HTTP is used as the protocol to download definition files in the negotiation phase (EPProtocol=HTTP). In this case, the port number of the service points to an HTTP-server running on the advertising host. The service also has an attribute to specify the path at which the definition file can be downloaded on the HTTP server (EPDefinitionPath). This attribute always starts with a '/' and exactly specifies the path that should be sent in the 'GET'-request by the downloader.

Other attributes

Optionally, an additional attribute (EPMagicNumber) can be published to prevent a process from discovering services it advertises itself. The EPMagicNumber can be a random value of any type and should never be used to uniquely identify services on other nodes.

Optionally, the mediation level of a device is specified in the 'EPMediationLevel' attribute.

Summary of attributes

  • EPProtocol (required) specifies the protocol used to download the definition file (commonly, “HTTP”)
  • EPMagicNumber (optional) is a random number generated by the advertising process to prevent discovery of services it advertises itself.
  • EPDefinitionPath (required when EPProtocol=HTTP) is used to tell the location of the definition file if the protocol used is HTTP.
  • EPMediationLevel specifies the mediation level of a service. The mediation level can also be specified in the definition file, but if possible, it should also be specified as service property, because this allows clients to skip downloading the definition file at all if the mediation level is too low. The mediation level in the service property should of course always be equal to the level specified in the definition file (if not, the behaviour is undefined).
  • EPStatePath (optional) specifies the path at which the so-called state file can be downloaded. The state file indicates the current state of an endpoint. Clients that provide user interfaces will download this every now and then to update it.
  • EPStateVersion (optional) contains a version or hash of the state file. Clients can listen for changes on this attribute, and only need to download the state file (from the path indicated by EPStatePath) if the state version is different than the previous version it had downloaded. Clients that do not provide a state will not specify an EPStatePath, but can supply a non-changing EPStateVersion.
 
dns-sd_mdns.txt · Last modified: 2010/05/17 21:35 by tommy
 
© Pixelspark, 2009-2012