md_doc_naming.html 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
  5. <meta http-equiv="X-UA-Compatible" content="IE=9"/>
  6. <meta name="generator" content="Doxygen 1.8.13"/>
  7. <meta name="viewport" content="width=device-width, initial-scale=1"/>
  8. <title>GRPC C++: gRPC Name Resolution</title>
  9. <link href="tabs.css" rel="stylesheet" type="text/css"/>
  10. <script type="text/javascript" src="jquery.js"></script>
  11. <script type="text/javascript" src="dynsections.js"></script>
  12. <link href="search/search.css" rel="stylesheet" type="text/css"/>
  13. <script type="text/javascript" src="search/searchdata.js"></script>
  14. <script type="text/javascript" src="search/search.js"></script>
  15. <link href="doxygen.css" rel="stylesheet" type="text/css" />
  16. </head>
  17. <body>
  18. <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
  19. <div id="titlearea">
  20. <table cellspacing="0" cellpadding="0">
  21. <tbody>
  22. <tr style="height: 56px;">
  23. <td id="projectalign" style="padding-left: 0.5em;">
  24. <div id="projectname">GRPC C++
  25. &#160;<span id="projectnumber">1.23.0</span>
  26. </div>
  27. </td>
  28. </tr>
  29. </tbody>
  30. </table>
  31. </div>
  32. <!-- end header part -->
  33. <!-- Generated by Doxygen 1.8.13 -->
  34. <script type="text/javascript">
  35. var searchBox = new SearchBox("searchBox", "search",false,'Search');
  36. </script>
  37. <script type="text/javascript" src="menudata.js"></script>
  38. <script type="text/javascript" src="menu.js"></script>
  39. <script type="text/javascript">
  40. $(function() {
  41. initMenu('',true,false,'search.php','Search');
  42. $(document).ready(function() { init_search(); });
  43. });
  44. </script>
  45. <div id="main-nav"></div>
  46. <!-- window showing the filter options -->
  47. <div id="MSearchSelectWindow"
  48. onmouseover="return searchBox.OnSearchSelectShow()"
  49. onmouseout="return searchBox.OnSearchSelectHide()"
  50. onkeydown="return searchBox.OnSearchSelectKey(event)">
  51. </div>
  52. <!-- iframe showing the search results (closed by default) -->
  53. <div id="MSearchResultsWindow">
  54. <iframe src="javascript:void(0)" frameborder="0"
  55. name="MSearchResults" id="MSearchResults">
  56. </iframe>
  57. </div>
  58. </div><!-- top -->
  59. <div class="header">
  60. <div class="headertitle">
  61. <div class="title">gRPC Name Resolution </div> </div>
  62. </div><!--header-->
  63. <div class="contents">
  64. <div class="textblock"><h2>Overview</h2>
  65. <p>gRPC supports DNS as the default name-system. A number of alternative name-systems are used in various deployments. We support an API that is general enough to support a range of name-systems and the corresponding syntax for names. The gRPC client library in various languages will provide a plugin mechanism so resolvers for different name-systems can be plugged in.</p>
  66. <h2>Detailed Design</h2>
  67. <h3>Name Syntax</h3>
  68. <p>A fully qualified, self contained name used for gRPC channel construction uses URI syntax as defined in <a href="https://tools.ietf.org/html/rfc3986">RFC 3986</a>.</p>
  69. <p>The URI scheme indicates what resolver plugin to use. If no scheme prefix is specified or the scheme is unknown, the <code>dns</code> scheme is used by default.</p>
  70. <p>The URI path indicates the name to be resolved.</p>
  71. <p>Most gRPC implementations support the following URI schemes:</p>
  72. <ul>
  73. <li><code>dns:[//authority/]host[:port]</code> &ndash; DNS (default)<ul>
  74. <li><code>host</code> is the host to resolve via DNS.</li>
  75. <li><code>port</code> is the port to return for each address. If not specified, 443 is used (but some implementations default to 80 for insecure channels).</li>
  76. <li><code>authority</code> indicates the DNS server to use, although this is only supported by some implementations. (In C-core, the default DNS resolver does not support this, but the c-ares based resolver supports specifying this in the form "IP:port".)</li>
  77. </ul>
  78. </li>
  79. <li><code>unix:path</code> or <code>unix://absolute_path</code> &ndash; Unix domain sockets (Unix systems only)<ul>
  80. <li><code>path</code> indicates the location of the desired socket.</li>
  81. <li>In the first form, the path may be relative or absolute; in the second form, the path must be absolute (i.e., there will actually be three slashes, two prior to the path and another to begin the absolute path).</li>
  82. </ul>
  83. </li>
  84. </ul>
  85. <p>The following schemes are supported by the gRPC C-core implementation, but may not be supported in other languages:</p>
  86. <ul>
  87. <li><code>ipv4:address[:port][,address[:port],...]</code> &ndash; IPv4 addresses<ul>
  88. <li>Can specify multiple comma-delimited addresses of the form <code>address[:port]</code>:<ul>
  89. <li><code>address</code> is the IPv4 address to use.</li>
  90. <li><code>port</code> is the port to use. If not specified, 443 is used.</li>
  91. </ul>
  92. </li>
  93. </ul>
  94. </li>
  95. <li><code>ipv6:address[:port][,address[:port],...]</code> &ndash; IPv6 addresses<ul>
  96. <li>Can specify multiple comma-delimited addresses of the form <code>address[:port]</code>:<ul>
  97. <li><code>address</code> is the IPv6 address to use. To use with a <code>port</code> the <code>address</code> must enclosed in literal square brackets (<code>[</code> and <code>]</code>). Example: <code>ipv6:[2607:f8b0:400e:c00::ef]:443</code> or <code>ipv6:[::]:1234</code></li>
  98. <li><code>port</code> is the port to use. If not specified, 443 is used.</li>
  99. </ul>
  100. </li>
  101. </ul>
  102. </li>
  103. </ul>
  104. <p>In the future, additional schemes such as <code>etcd</code> could be added.</p>
  105. <h3>Resolver Plugins</h3>
  106. <p>The gRPC client library will use the specified scheme to pick the right resolver plugin and pass it the fully qualified name string.</p>
  107. <p>Resolvers should be able to contact the authority and get a resolution that they return back to the gRPC client library. The returned contents include:</p>
  108. <ul>
  109. <li>A list of resolved addresses (both IP address and port). Each address may have a set of arbitrary attributes (key/value pairs) associated with it, which can be used to communicate information from the resolver to the <a class="el" href="load-balancing_8md.html">load balancing</a> policy.</li>
  110. <li>A <a class="el" href="service__config_8md.html">service config</a>.</li>
  111. </ul>
  112. <p>The plugin API allows the resolvers to continuously watch an endpoint and return updated resolutions as needed. </p>
  113. </div></div><!-- contents -->
  114. <!-- start footer part -->
  115. <hr class="footer"/><address class="footer"><small>
  116. Generated on Mon Aug 19 2019 12:05:23 for GRPC C++ by &#160;<a href="http://www.doxygen.org/index.html">
  117. <img class="footer" src="doxygen.png" alt="doxygen"/>
  118. </a> 1.8.13
  119. </small></address>
  120. </body>
  121. </html>