PengZheng commented on code in PR #690: URL: https://github.com/apache/celix/pull/690#discussion_r1411638589
########## bundles/remote_services/discovery_zeroconf/README.md: ########## @@ -0,0 +1,73 @@ +--- +title: Discovery Zeroconf +--- + +<!-- +Licensed to the Apache Software Foundation (ASF) under one or more +contributor license agreements. See the NOTICE file distributed with +this work for additional information regarding copyright ownership. +The ASF licenses this file to You under the Apache License, Version 2.0 +(the "License"); you may not use this file except in compliance with +the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +--> + +## Discovery Zeroconf + +The `Discovery_zeroconf` is implemented based on [Bonjour](https://github.com/apple-oss-distributions/mDNSResponder), and its operation depends on the mDNS daemon. + +The mapping between celix and mdns services is as follows: + +| **mDNS service** | **celix service** | +|------------------|-------------------------------------------| +| instance name | service name+hash(endpoint uuid) | +| service type | "_celix-rpc._udp"+${custom subtype} | +| domain name | "local" | +| txt record | service properties | +| host | "celix_rpc_dumb_host.local."(It is dummy) | +| port | 50009(It is dummy) | + + +Because We will perform the mDNS query only using link-local multicast, so we set domain name default value "local". + +To reduce the operation of conversion between host name and address info. we set the address info to txt record, and set the host name and port to a dummy value("celix_rpc_dumb_host.local." and "50009"). + +We set the instance name of the mDNS service as `service_name + hash(endpoint uuid)`. If there is a conflict in the instance name, mDNS_daemon will resolve it. Since the maximum size of the mDNS service instance name is 64 bytes, we take the hash of the endpoint uuid here, which also reduces the probability of instance name conflicts. Review Comment: Usage of UUID in instance name is explicitly discourage by RFC 6763, the rational of which is explained [here](https://datatracker.ietf.org/doc/html/rfc6763#appendix-D). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@celix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org