The Service Discovery Gateway feature enables multicast Domain Name System (mDNS) to operate across Layer 3 (L3) boundaries (different subnets). An mDNS gateway is able to provide transport for service discovery across Layer 3 boundaries by filtering, caching and redistributing services from one L3 domain (subnet) to another.
Prior to implementation of this feature, mDNS was limited in scope to within a subnet due to the use of link-local scoped multicast addresses. This feature enhances Bring Your Own Device (BYOD).
Consider the scenario in the above image. If the mDNS gateway functionality is enabled on the router, then service information can be sent from one subnet to another and vice-versa. For example, the printer and fax service information being advertised in the network with IP address 192.0.2.6 are redistributed to the network with IP address 198.51.100.4. Ultimately, the printer and fax service information in the in the network with IP address 192.0.2.6 is learnt by mDNS-enabled hosts and devices in the other network.
Filtering
You can filter services that you want to redistribute. While
creating a service–list, the permit or deny option must be used.
The permit option allows you to permit/transport specific
service–list information. The deny option allows you to deny
service–list information that is available to be transported to
other subnets.
You need to mention a sequence number when
using the permit or deny option. The same service–list name can be
associated with multiple sequence numbers and each sequence number
will be mapped to a rule.
Note
If no filters are configured, the default action is to deny service–list information to be transported through the device or interface.
Query is another option provided while creating service–lists. You can create queries using a service–list. If you want to browse for a service, then active queries can be used. This helps to keep the records refreshed in the cache.
Note
Active queries can only be used globally and cannot be used at the interface level.
A service end–point (such as, a printer, fax, and so on) sends unsolicited announcements when a service starts up. After that, it sends unsolicited announcements whenever a network change event occurs (such as, an interface coming up or going down, and so on). The device always respond to queries.
After creating a service–list and using the permit or deny option, you can filter by using match statements (commands) based on service–instance, service–type, or message–type (announcement or query).
How to Configure Service Discovery Gateway
Creating a Service-list, Applying a Filter for the Service-List and Configuring Parameters for the Service-List Name
Creates a service-list and applies a filter on the service-list according to the permit or deny option applied to the sequence number.
Or
Creates a service-list and associates a query for the service-list name if the query option is used.
Step 4
match message-type{announcement | any | query}ORmatch service-instance{instance-name | any | query} ORmatch service-typemDNS-service-type-string
Example:
Do one of the following:
Device(config-mdns-sd-sl)# match message-type announcement
OR
Device(config-mdns-sd-sl)# match service-instance servInst 1
OR
Device(config-mdns-sd-sl)# match service-type _ipp._tcp
Use one (or more) of the following commands.
Configures parameters for a service-list name that is created using step 3.
Note
You cannot use the match command if you have used the query option in the previous step. The match command can be used only for the permit or deny option.
Step 5
exit
Example:
Device(config-mdns-sd-sl)# exit
Returns to global configuration mode.
Enabling mDNS Gateway for a Device and Redistributing Services
After enabling mDNS gateway for a device, you can apply filters (apply IN-bound filtering or OUT-bound filtering) and active queries by using service-policy and service-policy-query commands respectively. You can redistribute services and service announcements using the redistribute mdns-sd command, and set some part of the system memory for cache using the cache-memory-max command.
Note
Steps 4 to 7 are optional and not meant to be used in any specific order.
Enables mDNS gateway functionality for a device and enters multicast DNS configuration (config-mdns) mode.
Step 4
match service-instanceservice-policy-name
{IN | OUT}
Example:
Device(config-mdns)# service-policy serv-pol1 IN
For a service-list, applies a filter on incoming service discovery information (IN-bound filtering) or outgoing service discovery information (OUT-bound filtering).
Step 5
redistribute mdns-sd
Example:
Device(config-mdns-sd-sl)# exit
Returns to global configuration mode.
Note
If redistribution is enabled globally, global configuration is given higher priority than interface configuration.
Step 6
cache-memory-maxcache-config-percentage
Example:
Device(config-mdns)# cache-memory-max 20
Sets some part of the system memory (in percentage) for cache.
Note
By default, 10% of the system memory is set aside for cache. You can override the default value by using this command.
show mdns requests[detail| name record-name | type record-type[name record-name]]
Example:
Device# show mdns requests detail
MDNS Outstanding Requests
======================================================
Request name : _ipp._tcp.local
Request type : PTR
Request class : IN
This command displays information for outstanding mDNS requests, including record name and record type information.
Step 2
show mdns cache[interfacetype number | namerecord-name[typerecord-type] | typerecod-type]
Example:
Device# show mdns cache
mDNS CACHE
=================================================================================================================================
[<NAME>] [<TYPE>][<CLASS>] [<TTL>/Remaining] [Accessed] [If-index] [<RR Record Data>]
_services._dns-sd._udp.local PTR IN 4500/4496 0 3 _ipp._tcp.local
_ipp._tcp.local PTR IN 4500/4496 1 3 printer1._ipp._tcp.local
printer1._ipp._tcp.local SRV IN 120/116 1 3 0 0 5678 smuchala-WS.local
printer1._ipp._tcp.local TXT IN 4500/4496 1 3 (1)''
smuchala-WS.local A IN 120/116 1 3 192.168.183.1
This command displays mDNS cache information.
Step 3
show mdns statistics{all| service-listlist-name| service-policy{all| interfacetype number}}
Example:
Device# show mdns statistics all
mDNS Statistics
mDNS packets sent : 0
mDNS packets received : 31
mDNS packets dropped : 8
mDNS cache memory in use: 64264(bytes)
This command displays mDNS statistics.
Step 4
debug mdns{allerroreventpacketverbose}
Example:
Device# debug mdns
This command enables all mDNS debugging flows.
Configuration Examples for Service Discovery Gateway
Example: Creating a Service-List, Applying a Filter for the Service-List and Configuring Parameters for the Service-List Name
The following example shows creation of a service-list sl1. The permit option is being applied on sequence number 3 and all services with message-type announcement are filtered and available for transport across various subnets associated with the device.
Example: Enabling Mdns Gateway for a Device and Redistributing Services
The following example shows how to enable an mDNS gateway for a device and enable redistribution of services across subnets. IN-bound filtering is applied on the service-list serv-pol1. 20% of system memory is made available for cache and service-list-query periodicity is configured at 100 seconds.
The Cisco Support website provides extensive online resources,
including documentation and tools for troubleshooting and
resolving technical issues with Cisco products and technologies.
To receive security and technical information about your
products, you can subscribe to various services, such as the
Product Alert Tool (accessed from Field Notices), the Cisco
Technical Services Newsletter, and Really Simple Syndication
(RSS) Feeds.
Access to most tools on the Cisco Support website requires a
Cisco.com user ID and password.
The following table provides release information about the feature or features described in this module. This table lists only the software release that introduced support for a given feature in a given software release train. Unless noted otherwise, subsequent releases of that software release train also support that feature.
Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to
www.cisco.com/go/cfn. An account on Cisco.com is not required.
Table 1 Feature Information for Service Discovery Gateway
Feature Name
Releases
Feature Information
Service Discovery Gateway
Cisco IOS Release 15.2(1)E
15.1(2)SY
The Service Discovery Gateway feature enables multicast Domain Name System (mDNS) to operate across L3 boundaries (different subnets).
The following commands were
introduced or modified:
cache-memory-max, clear mdns cache, clear mdns
statistics, debug mdns, match message-type, match service-instance,
match service-type, redistribute mdns-sd, service-list mdns-sd,
service-policy, service-policy-query, service-routing mdns-sd, show mdns cache, show mdns
requests,
show mdns
statistics