MOD22: Announce Service via DNS SD - GoranErdeljan/TINF19C-Team-4-Service-Registry GitHub Wiki

Created by Benedict Wetzel

1. Introduction

This module announces the service using the DNS-SD-Mechanism. It is a sub-module of MOD20.

2. Requirements

The following requirements are covered by this module:

3. Prerequisites

In order to use this module the following prerequisites should be met:

  • The developer should have a working computer that can access the internet
  • The developer should use a Linux-based OS
  • The developer should have Node.js version 12.14.1 or higher installed
  • The developer should have NPM version 7.10.0 or higher installed
  • The developer should have at least some basic experience with Node.js

4. Dependencies

This module depends on the following items:

5. Technical overview

5.1 announceService.js

This file uses the multicast-dns NPM package to respond to mDNS-Queries used by the DNS-SD-Mechanism with a mDNS-Response that contains the Master-Asset-Model as TXT-Records and the IP-Address of the service as specified in the configuration of the module.

Function Description
setConfig Sets the configuration of the module; should be called before the start-function
start Passes the Master-Asset-Model to the module and registers an event handler that is called when a DNS-SD-Query is received. The event handler checks whether the application was requested and sends a mDNS-Response containing the DNS-SD-Entry with the Master-Asset-Model of the service as TXT-Records with the additional "oi4=true" record.

5.2 package.json

Sets the dependencies and is used by NPM to install the required NPM packages