1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861
|
<pre>Network Working Group S. Williamson
Request for Comments: 2167 M. Kosters
Obsoletes: RFC <a href="./rfc1714">1714</a> D. Blacka
Category: Informational J. Singh
K. Zeilstra
Network Solutions, Inc.
June 1997
<span class="h1">Referral Whois (RWhois) Protocol V1.5</span>
Status of this Memo
This memo provides information for the Internet community. This memo
does not specify an Internet standard of any kind. Distribution of
this memo is unlimited.
Abstract
This memo describes Version 1.5 of the client/server interaction of
RWhois. RWhois provides a distributed system for the discovery,
retrieval, and maintenance of directory information. This system is
primarily hierarchical by design. It allows for the deterministic
routing of a query based on hierarchical tags, referring the user
closer to the maintainer of the information. While RWhois can be
considered a generic directory services protocol, it distinguishes
itself from other protocols by providing an integrated, hierarchical
architecture and query routing mechanism.
<span class="h2"><a class="selflink" id="section-1" href="#section-1">1</a>. Introduction</span>
Early in the development of the ARPANET, the SRI-NIC established a
centralized Whois database that provided host and network information
about the systems connected to the network and the electronic mail
(email) addresses of the users on those systems [<a href="./rfc954">RFC 954</a>]. The
ARPANET experiment evolved into a global network, the Internet, with
countless people and hundreds of thousands of end systems. The sheer
size and effort needed to maintain a centralized database
necessitates an alternate, decentralized approach to storing and
retrieving this information.
<span class="grey">Williamson, et. al. Informational [Page 1]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-2" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
The original Whois function was to be a central directory of
resources and people on ARPANET. However, it could not adequately
meet the needs of the expanded Internet. RWhois extends and enhances
the Whois concept in a hierarchical and scaleable fashion. In
accordance with this, RWhois focuses primarily on the distribution of
"network objects", or the data representing Internet resources or
people, and uses the inherently hierarchical nature of these network
objects (domain names, Internet Protocol (IP) networks, email
addresses) to more accurately discover the requested information.
RWhois synthesizes concepts from other, established Internet
protocols. The RWhois protocol and architecture derive a great deal
of structure from the Domain Name System (DNS) [<a href="./rfc1034">RFC 1034</a>] and borrow
directory service concepts from other directory service efforts,
primarily [<a href="#ref-X.500" title=""The Directory: Overview of Concepts, Models and Service"">X.500</a>]. The protocol is also influenced by earlier
established Internet protocols, such as the Simple Mail Transport
Protocol (SMTP) [<a href="./rfc821">RFC 821</a>].
This RWhois specification defines both a directory access protocol
and a directory architecture. The directory access protocol
specifically describes the syntax of the client/server interaction.
It describes how an RWhois client can search for data on an RWhois
server, or how the client can modify data on the server. It also
describes how the server is to interpret input from the client, and
how the client should interpret the results returned by the server.
The architecture portion of this document describes the conceptual
framework behind the RWhois protocol. It details the concepts upon
which the protocol is based and describes its structural elements.
The protocol implements the architecture.
This document uses language like SHOULD and SHALL that have special
meaning as specified in "Key words for use in RFCs to Indicate
Requirement Levels". [<a href="./rfc2119">RFC2119</a>]
<span class="grey">Williamson, et. al. Informational [Page 2]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-3" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
<span class="h2"><a class="selflink" id="section-2" href="#section-2">2</a>. Architecture</span>
<span class="h3"><a class="selflink" id="section-2.1" href="#section-2.1">2.1</a> Overview</span>
As a directory service, RWhois is a distributed database, where data
is split across multiple servers to keep database sizes manageable.
The architecture portion of this document details the concepts upon
which the protocol is based and describes its structural elements.
Specifically, the architecture is concerned with how the data is
split across the different servers. The basis of this splitting is
the lexically hierarchical label (or tag), which is a text string
whose position in a hierarchy can be determined from the structure of
the string itself.
All data can follow some sort of hierarchy, even if the hierarchy
seems somewhat arbitrary. For example, person names can be arranged
into hierarchical groups via geography. If all the people in
particular towns are grouped into town groups, then all of the town
groups can be grouped into state (or province) groups, and then all
of the state groups can be grouped into a country group. Then, a
particular name would belong in a town group, a state group, and a
country group. However, just given a name, it would be impossible to
determine where in the hierarchy it belongs. Therefore, a person
name is not lexically hierarchical.
However, there are certain types of data whose position in the
hierarchy can be determined by deciphering the data itself, for
example, phone numbers. A phone number is grouped according to
country code, area code, local exchange, and local extension. By
looking at a phone number, it is possible to determine to which of
all these groups the number belongs: 1-303-555-2367 is in country
code 1, area code 303, local exchange 555, and has a local extension
of 2367. Therefore, a phone number is lexically hierarchical.
On the Internet, two such types of data are widely used: domain names
and IP networks. Domain names are organized via a label-dot system,
reading from a more specific label to a more general label left to
right; for example, war.west.netsol.com is a part of west.netsol.com,
which is a part of netsol.com, which is a part of com. IP networks
are also lexically hierarchical labels using the Classless Inter-
Domain Routing (CIDR) notation, but their hierarchy is not easily
determined with simple text manipulation; for example, 198.41.0.0/22
is a part of 198.41.0.0/16, which is a part of 198.40.0.0/15.
Instead, an IP network's hierarchy is determined by converting the
network to binary notation and applying successively shorter bit
masks.
<span class="grey">Williamson, et. al. Informational [Page 3]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-4" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
It is important to note that, while very little real data is
lexically hierarchical in nature, people often create label systems
(or namespaces) to help manage the data and provide an element of
uniqueness, for example, Social Security Numbers, ISBNs, or the Dewey
Decimal System. RWhois leverages lexically hierarchical labels,
domain names and IP networks, for its data splitting using the
concepts of authority areas and referrals. An authority area is
associated with an RWhois server and a lexically hierarchical label,
which is considered to be its name. An authority area is a piece of
the distributed database that speaks with authority about its
assigned part of the hierarchy. All data associated with a particular
lexically hierarchical tag should be located within that authority
area's database. Authority areas are further explained in <a href="#section-2.4">Section</a>
<a href="#section-2.4">2.4</a>.
RWhois directs clients toward the appropriate authority area by
generating referrals. Referrals are pointers to other servers that
are presumed to be closer to the desired data. The client uses this
referral to contact the next server and ask the same question. The
next server may respond with data, an error, or another referral (or
referrals). By following this chain of referrals, the client will
eventually reach the server with the appropriate authority area. In
the RWhois architecture, referrals are generated by identifying a
lexically hierarchical label and deciphering the label to determine
the next server. Referrals are further explained in <a href="#section-2.5">Section 2.5</a>.
When a number of RWhois servers containing authority areas are
brought on line and informed about each other, they form an RWhois
tree. The tree has a root authority area, which is the group that
contains all other groups. The root authority area must keep
pointers to the servers and authority areas that form the first level
of the hierarchy. The authority areas in the first level of the
hierarchy are then responsible for keeping pointers to the authority
areas below them and for keeping a pointer to the root.
<span class="h3"><a class="selflink" id="section-2.2" href="#section-2.2">2.2</a> Design Philosophy</span>
The design goals for the RWhois protocol are as follows.
* It should be a directory access protocol. The server should be
able to access and update the data residing on it.
* It should facilitate query routing. An unresolved query should
be redirected to a server that is presumed to be closer to the
desired data.
* It should enable data replication. The server should be able to
duplicate its data on another server.
* The server should be lightweight and delegate more functions to
the client.
<span class="grey">Williamson, et. al. Informational [Page 4]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-5" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
The concepts used to achieve these design goals are explained in the
remaining document.
<span class="h3"><a class="selflink" id="section-2.3" href="#section-2.3">2.3</a> Schema Model</span>
As a directory service, RWhois uses various database schema to store
and represent data. Schema, in this document, has two definitions.
First, it refers to the entire structure of a database, all the
tables and fields forming a complete database. When schema is used in
this context, it is called the "database schema". Database schema
consists of attributes, classes, and objects. Schema may also refer
to a single piece of the database, a single table with fields. When
schema is used in this context, it is just called "schema" or it is
preceded by the name of the particular piece: contact schema or
domain schema, for example. In this usage, schema is equivalent to
"class", defined below.
There is no standard database schema in the RWhois architecture. Each
authority area is presumed to be able to define its own local schema.
However, an authority area that is part of a larger RWhois tree is
expected to have some part of its schema pertain to the lexically
hierarchical label upon which the RWhois tree is based. An authority
area schema may not change throughout much of an RWhois tree.
<span class="h4"><a class="selflink" id="section-2.3.1" href="#section-2.3.1">2.3.1</a> Attributes</span>
An attribute is a named field and is the smallest typed unit in the
database schema. It is equivalent to a relational database's field.
An attribute is not considered to be data by itself; it is simply
used to give data a type. When a piece of data has been typed by an
attribute, it is typically referred to as a value and is represented
as an attribute-value pair. The RWhois syntax for the attribute-value
pair is to separate them with a colon, for example:
First-Name:Bill
Attributes have a number of properties, some mandated by the RWhois
protocol and some that are implementation dependent. These properties
are usually a reflection of the database system used by the server.
The following is a list of the protocol-mandated properties and their
descriptions.
Attribute This is the name of the attribute.
Description This is a natural language description of the
attribute.
<span class="grey">Williamson, et. al. Informational [Page 5]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-6" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
Type This is a parameter that broadly indicates the use
of the attribute to the protocol. There are three
standard types: TEXT, ID, and SEE-ALSO. The default is
TEXT, which indicates that the value is a text string.
ID indicates that the attribute contains the ID of
another RWhois object. This type of attribute is used
for database normalization. SEE-ALSO indicates that
the attribute contains a pointer (a Uniform Resource
Identifier (URI)) to some other kind of external data;
for example, a World Wide Web page or FTP site.
Format This is an interpretable string that describes the
acceptance format of the value. The server (and
optionally the client) should match the value to the
format string to determine if the value is acceptable.
The format of this property is a keyword indicating the
syntax of the format string, followed by a colon,
followed by the format string itself. Currently, the
only keyword recognized is "re" for POSIX.2 extended
regular expressions.
Indexed This is a true or false flag indicating that this
attribute should be indexed (and therefore able to be
searched).
Required This is a true or false flag indicating that this
attribute must have a value in an instance of the
class.
Multi-Line This is a true or false flag indicating that this
attribute may have multiple instances in a class, but
all of the instances are to be considered as multiple
lines of the same attribute instance. This allows
normal line terminators to terminate values.
Repeatable This is a true or false flag indicating that there may
be multiple instances of this attribute in a class and
each instance is to be interpreted as a separate
instance (in contrast to Multi-Line). This flag is
mutually exclusive with Multi-Line: if Multi-Line is
true, then Repeatable must be false and vice versa.
<span class="grey">Williamson, et. al. Informational [Page 6]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-7" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
Primary This is a true or false flag that indicates that this
attribute is a primary key. If more than one attribute
in a class is marked as primary, then these attributes
together form a single primary key. The primary key is
intended to be used to force uniqueness among class
instances. Therefore, there can be only one instance of
a primary key in a database. The Primary flag implies
that the attribute is also required.
Hierarchical This is a true or false flag that indicates that this
attribute is lexically hierarchical.
Private This is a true or false flag that indicates whether or
not this attribute is private (that is, publicly not
viewable). It defaults to false. If it is true, then
only the clients that satisfy the
authentication/encryption requirements of a guardian
(described below) are able to view the attribute-value
pair.
<span class="h4"><a class="selflink" id="section-2.3.2" href="#section-2.3.2">2.3.2</a> Class</span>
A class is a collection of attributes; it is a structure, not data.
The concept is equivalent to that of a relational database table. It
is also equivalent to the second definition of schema, above.
A class also has some properties that are sometimes referred to as
its "meta" information. These properties are listed below.
Version This is a time/date stamp that is used to quickly detect
when a class definition has been changed.
Description This is a natural language description of the class.
<span class="h4"><a class="selflink" id="section-2.3.3" href="#section-2.3.3">2.3.3</a> Object</span>
An object is an instance of a class. It is data with a type of
<class>.
<span class="h4"><a class="selflink" id="section-2.3.4" href="#section-2.3.4">2.3.4</a> Base Class</span>
While RWhois does not have or advocate using a specific, standardized
schema, it does impose a few requirements. It requires that all
defined classes inherit attributes from a particular base class (or
base schema). The RWhois specification does not require the actual
implementation of inheritance. Instead, all classes must include the
attributes defined in the base class.
<span class="grey">Williamson, et. al. Informational [Page 7]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-8" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
The base class has the following attributes.
Class-Name This attribute contains the name of the class to which
the object belongs. It is the type of the object
itself. It is of type TEXT and is required.
Auth-Area This attribute contains the name of the authority area
to which the object belongs. It, along with Class-
Name, definitively defines the type of the object. It
is of type TEXT and is required.
ID This attribute is a universal identifier for the
object. It is formed by choosing a string that is
unique within an authority area and appending the
authority area to it, separating the local string from
the authority area name with a period. The only
restrictions on the local string are that it must be
unique within the authority area and not contain the
period character. This attribute is hierarchical in
nature. It is always generated by the server (for
example, during a register operation). It is of type
TEXT and is required.
Updated This attribute is a time/date stamp that indicates the
time of last modification of the object. It is both
informational and a form of record locking. It
prevents two clients from modifying the same object at
the same time. It is of type TEXT and is required.
Guardian This attribute is a link to a guardian object
(described below). Its value is the ID of a guardian
object. It is of type ID and is optional. It is
repeatable, since an object may have multiple
guardians.
Private This attribute is a true or false flag that indicates
whether or not an object is private (that is, publicly
not viewable). It defaults to false. If it is true,
then only the clients that satisfy the
authentication/encryption requirements of one of the
object's guardians are able to view the object. If the
object is publicly viewable, then the Private
attribute property of each of its attributes still
applies.
<span class="grey">Williamson, et. al. Informational [Page 8]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-9" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
TTL This attribute is the "time-to-live" of a given
object. It is included only if an object has a
different time-to-live than the default given in the
Start of Authority information. Its value is specified
in seconds. It is of type TEXT and is optional.
The RWhois specification defines two standard classes that should be
included in all implementations: the referral and guardian classes.
<span class="h4"><a class="selflink" id="section-2.3.5" href="#section-2.3.5">2.3.5</a> Referral Class</span>
The referral class is defined to hold referral information (typically
for link referrals). It consists of attributes defined as part of the
base class, the protocol-specific attributes described below, and any
installation-specific attributes.
Referred-Auth-Area This attribute contains the name of the authority
area to which the referral points. It is used as
a search key during the query routing. It is of
type TEXT and is required. It is repeatable,
since referrals can point to servers hosting more
than one authority area.
Referral This attribute contains the referral itself. It
is an RWhois URL. It is of type TEXT and is
required. It is repeatable, since more than one
server can host a Referred-Auth-Area.
<span class="h4"><a class="selflink" id="section-2.3.6" href="#section-2.3.6">2.3.6</a> Guardian Class</span>
The guardian class is defined to hold security information. The
fundamental concept behind the guardian class is that an object (or
another structure) is "guarded" by containing a pointer to a guardian
object [<a href="#ref-Guardian" title=""The InterNIC Guardian Object"">Guardian</a>]. To modify, delete, or possibly view the guarded
object, the authentication (or encryption, or both) scheme must be
satisfied. Guardians are intended to not have rank: if an object is
guarded by more than one guardian object, satisfying any one of those
guardians is sufficient. A guardian object that does not have any
Guardian attribute linking it to other guardians guards itself. That
is, the authentication scheme in the guardian object itself must be
satisfied to modify, delete, or possibly view it.
Guardian objects are typically linked to actual database objects with
the Guardian attribute found in the base class. However, a guardian
may also be linked to an entire authority area, in which case the
guardian becomes implicitly linked to all of the objects contained
within the authority area.
<span class="grey">Williamson, et. al. Informational [Page 9]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-10" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
The guardian class consists of the base class, the protocol-specific
attributes described below, and any installation-specific attributes.
Guard-Scheme This attribute contains a keyword indicating the
authentication methodology. Its value must be
understood by both the client and server, and its value
dictates the contents of the Guard-Info attribute. It
is of type TEXT and is required.
Guard-Info This attribute contains that data that is used by the
Guard-Scheme to verify the authentication. Its actual
format is dictated by the Guard-Scheme, for example, it
could contain a password or Pretty Good Privacy (PGP)
public key id [<a href="./rfc1991">RFC 1991</a>]. For security reasons, it
should not be displayed, and its Private attribute
property should be set to true. It is of type TEXT and
is required.
<span class="h3"><a class="selflink" id="section-2.4" href="#section-2.4">2.4</a> Authority Areas</span>
The concept of authority areas is pivotal to the RWhois architecture.
When an RWhois tree is created for a particular lexically
hierarchical namespace, the different pieces of the hierarchy are
mapped to authority areas. The most important concept behind an
authority area is the ability for a portion of the RWhois tree to
definitively control that portion of the hierarchy. This means that
an authority area is able to state whether or not a hierarchical tag
is in the whole RWhois tree. It does this either by returning the
object containing this tag, returning a referral to a sub-authority
area, or returning a response indicating that no objects were found.
This structure enables efficient routing of queries based on the
hierarchical label to the piece of the hierarchy responsible for it.
For example, in the domain name namespace as served by RWhois, the
root of the tree would be an authority area named ".", which would
delegate a "us" sub-authority area, which would delegate "va", "co",
"md", and "ca" authority areas, and so forth. When the server with
the "va.us" authority area is asked about "loudoun.va.us", it will be
able to authoritatively state that either no "loudoun.va.us" exists
or it will provide an object for or a referral to "loudoun.va.us".
Further, if the server is asked about "howard.md.us", it cannot
answer authoritatively, so it must provide a referral to its
hierarchical parent ("us" or the root).
This use of authority area strongly indicates where data should be
stored within an RWhois tree. Because RWhois uses a specific query
routing model, data needs to be placed under the proper authority
area. It is certainly possible to place a piece of data under the
<span class="grey">Williamson, et. al. Informational [Page 10]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-11" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
wrong authority area, for example, putting an object for
"howard.md.us" under the "va.us" authority area. In such cases, the
data is considered to be misplaced and unable to be found within the
RWhois tree. However, while data should be placed under the lowest
(most specific) authority area, it is also possible that it could be
placed in a higher (least specific) authority area, for example,
putting an object for "loudoun.va.us" under the "us" authority. This
may be acceptable since, in most cases, the data would be able to be
found.
In addition to controlling a part of an RWhois hierarchy, an
authority area is considered to be autonomous. Each authority area is
treated as a separate database by the protocol. However, it is
recommended that an authority area share some core schema with the
rest of the RWhois tree for interoperability reasons. Each authority
area, however, is not bound by the database schema of its
hierarchical parent or by any of its sub-authority areas.
<span class="h3"><a class="selflink" id="section-2.5" href="#section-2.5">2.5</a> Query Routing</span>
RWhois is not only a directory access protocol but it can also route
queries. Routing a query involves redirecting the query to another
server that is presumed to be closer to the desired data. To route a
query, the server first determines the location of the next server.
It then either forwards the query to that server and returns the
result to the client or returns the location of that server to the
client. The location of the server must contain its host name (or IP
address), port number, and authority area.
The location of the server to which a query is routed is called a
referral. There are two types of referrals: punt and link referrals.
A punt referral is a pointer to a server that is further up an RWhois
tree, and a link referral is a pointer to a server that is further
down the tree. For example, in Figure 1, when the server for the
"va.us" authority area routes a query up to the server for the "us"
authority area, it generates a punt referral. Alternatively, when it
routes a query down to the server for the "loudon.va.us" authority
area, it generates a link referral.
Query routing depends on whether or not the search value in a query
is lexically hierarchical. If the search value is hierarchical, the
server can generate punt or link referrals using the association of
authority areas with lexically hierarchical labels. Otherwise, the
server may send the query to a special index server that gathers the
indexing information for both hierarchical and non-hierarchical data
from the directory servers and returns referrals to these servers
[<a href="#ref-CIP" title=""The Common Indexing Protocol (CIP)"">CIP</a>]. If the server receives one or more referrals from the index
server, it should return them to the client.
<span class="grey">Williamson, et. al. Informational [Page 11]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-12" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
It is important to note that the server may route a query whether it
could resolve the query or not. Even if a query has been resolved
locally, the server may also return referrals to the client by
sending the query to the index server. For example, if the server for
the "com" authority area receives the "domain Org-Name=IBM" query, it
may return all the domain objects for IBM within the "com" authority
area. In addition, it may also return referrals to the server for the
"nl" authority area if that server contains domain objects for IBM in
the Netherlands and has fed the corresponding indexing information to
the index server. This way the client can get back information for
both "ibm.com" and "ibm.nl" domains.
<span class="h4"><a class="selflink" id="section-2.5.1" href="#section-2.5.1">2.5.1</a> Query Routing Rules</span>
An RWhois server routes a query based on certain rules. The objective
is to determine the location of a server to which to route the query.
A query may contain one or more query terms. The query routing rules
are applied on each query term until a referral is found. The rules
are listed below.
* Is the search value in the query term hierarchical? If not, go
to the next query term.
* Parse the hierarchical portion of the search value. Is it is
within one of the authority areas? If not, go to the next query
term.
* Does the found authority area have any referral objects
(instances of the referral class)? If not, return the "230 No
objects found" error to the client.
* Is the hierarchical portion of the search value within the
Referred-Auth-Area attribute of one of the referral objects? If
it is, return the value of the Referral attribute of the found
referral object as a link referral to the client.
* Are the search values of some of the query terms hierarchical
but not within any of the authority areas? If they are, return a
punt referral to the client.
* Are the search values of all the query terms non-hierarchical?
If they are, send the query to a special index server that
gathers the indexing information for both hierarchical and non-
hierarchical data from the directory servers and returns
referrals to these servers. If the server receives one or more
referrals from the index server, return them to the client.
Note that there can be more than one referral returned to the client.
These referrals may point to servers serving different authority
areas. The client may follow them in any order.
<span class="grey">Williamson, et. al. Informational [Page 12]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-13" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
The pseudo code for the above rules is:
for each query term in the query
if the search value in the query term is hierarchical
if the search value is within one of the authority areas
if the search value is within one of the referred authority areas
the server sends link referral(s)
else
the server sends a "230 No objects found" error
endif
endif
endif
endfor
if the search values of some of the query terms are hierarchical but
not within any of the authority areas
the server sends Punt referral(s)
endif
if the search values of all the query terms are non-hierarchical
the server sends Referral(s) from an index server
endif
<span class="h3"><a class="selflink" id="section-2.6" href="#section-2.6">2.6</a> Data Replication</span>
An RWhois server can replicate (duplicate) data from another RWhois
server on a per-authority area basis. Data replication makes the
RWhois service more reliable. Further, it increases throughput by
distributing queries to more than one server.
There can be two types of servers serving an authority area: a master
server and a slave server. A master server is where data is
registered for an authority area. It answers authoritatively to
queries in that authority area. There must be one and only one master
server for an authority area. A master server is also called a
primary server.
A slave server is where data is replicated from the master server for
an authority area. It also answers authoritatively to queries in that
authority area. There may be one or more slave servers for an
authority area. A slave server is also called a secondary server.
Note that a slave server must not register data for an authority
area.
It is recommended that the master and slave servers for an authority
area be geographically separate. Therefore, network unreachability at
one site will not completely shut down the RWhois service for that
authority area.
<span class="grey">Williamson, et. al. Informational [Page 13]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-14" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
<span class="h4"><a class="selflink" id="section-2.6.1" href="#section-2.6.1">2.6.1</a> Data to Replicate</span>
In RWhois, data is replicated on a per-authority area basis. The
smallest type of data a slave server can replicate is an attribute of
a class. Therefore, a slave server can replicate data for all the
classes, some classes, or some attributes of some classes.
The amount of data a slave server can replicate each time is either
all of the data or the data that has changed since the last
replication. The process of replicating all of the data is called
complete replication. The process of replicating the data that has
changed since the last replication is called incremental replication.
<span class="h4"><a class="selflink" id="section-2.6.2" href="#section-2.6.2">2.6.2</a> Start Of Authority Variables</span>
Each authority area has some administrative variables, defined at the
master server, to control data replication. These variables are
called the Start Of Authority (SOA) variables. They are listed below.
Serial-Number This is the serial number of the data in an
authority area. The master server should update
this variable whenever the data in the authority
area is changed. Its value is a time/date stamp.
Refresh-Interval This is the time interval before a slave server
checks for complete replication. Its value is
specified in seconds.
Increment-IntervalThis is the time interval before a slave server
checks for incremental replication. Its value is
specified in seconds.
Retry-Interval This is the time interval before a slave server
tries again to connect to a master server that
appears to be out-of-service. Its value is
specified in seconds.
Time-To-Live This is the default time to live for the data in
an authority area at a slave server. The slave
server should not answer authoritatively to
queries for such stale data. Its value is
specified in seconds.
Admin-Contact This is the email address of an individual or a
role account responsible for the data integrity in
an authority area at the master server.
<span class="grey">Williamson, et. al. Informational [Page 14]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-15" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
Tech-Contact This is the email address of an individual or a
role account responsible for the operation of the
master server for an authority area.
Hostmaster This is the email address of an individual or a
role account to whom email messages to update the
data in an authority area at the master server are
sent.
Primary-Server This is the location of the master server for an
authority area. Its value must contain both the
host name (or IP address) and port number of the
master server.
<span class="h2"><a class="selflink" id="section-3" href="#section-3">3</a>. Protocol</span>
<span class="h3"><a class="selflink" id="section-3.1" href="#section-3.1">3.1</a> Overview</span>
The above sections describe the directory service architecture based
on the RWhois protocol. The remaining sections describe the syntax of
the protocol; the sequence and syntax of the information exchanged
between a server and a client. There are five types of information
that may be exchanged during a client/server session: directive,
response, query, result, and info.
<span class="h4"><a class="selflink" id="section-3.1.1" href="#section-3.1.1">3.1.1</a> Directive</span>
A directive is a command that a client sends to a server to set a
control parameter for the session, get the meta-information (class
definitions and SOA information) about an authority area, or get the
data in an authority area. The first character of a directive must be
a "-". The server must support the "-rwhois" directive; all other
directives are optional. The server must indicate in the banner which
directives are implemented (see <a href="#section-3.1.9">Section 3.1.9</a>).
<span class="h4"><a class="selflink" id="section-3.1.2" href="#section-3.1.2">3.1.2</a> Response</span>
A response is the information that a server returns to a client for a
directive. It is comprised of one or more lines, and the last line
always indicates the success or failure of the directive. The first
character of each response line must be a "%". If a server runs a
directive successfully, the last response line must be "%ok".
Otherwise, it must be "%error <error-code> <error-text>". A line with
the string "%ok" or "%error" in the first position must occur only
once in a server response and must always be the last line. The
server may send the "%info" response for special messages.
<span class="grey">Williamson, et. al. Informational [Page 15]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-16" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
A client must understand the "%ok", "%error", and "%info" responses.
The client must also understand directive specific responses, if it
uses the related directives to communicate with the server. For
example, if the client sends the "-schema" directive to the server,
the client must understand the "%schema" response.
<span class="h4"><a class="selflink" id="section-3.1.3" href="#section-3.1.3">3.1.3</a> Query</span>
A query is a command that a client sends to a server to access the
data in an authority area. The first character of a query must not be
a "-", since the server checks the first character of each command
from a client to determine whether it is a directive or a query.
<span class="h4"><a class="selflink" id="section-3.1.4" href="#section-3.1.4">3.1.4</a> Result</span>
A result is the information that a server returns to a client for a
query. It can be either the accessed data or referrals to other
servers. It is comprised of one or more lines, and the last line
always indicates the success or failure of the query. If a server
returns either data or referrals for a query, the last result line
must be "%ok". Otherwise, it must be "%error <error-code> <error-
text>".
<span class="h4"><a class="selflink" id="section-3.1.5" href="#section-3.1.5">3.1.5</a> Info</span>
An info message contains miscellaneous information that a server
sends to a client. The server may use it to send special messages,
for example a "message of the day" (MOTD), to the client. The first
info line must be "%info on", and the last info line must be "%info
off".
<span class="h4"><a class="selflink" id="section-3.1.6" href="#section-3.1.6">3.1.6</a> Client/Server Session</span>
A typical RWhois client/server session has the following sequence of
messages.
* The client connects to the server.
* The server returns a banner identifying its protocol versions
and capabilities.
* The client sends one or more directives to the server.
* The server returns the response to each directive.
* The client finally sends a query to the server.
* The server returns the query results.
* The server closes the connection, unless the client has directed
it not to close the connection.
<span class="grey">Williamson, et. al. Informational [Page 16]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-17" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
<span class="h4"><a class="selflink" id="section-3.1.7" href="#section-3.1.7">3.1.7</a> Examples</span>
This section gives some common examples of the client/server
interaction. The notation in the examples uses a prefix to indicate
from where the information comes. A "C" indicates that the client
sends the data to the server. An "S" indicates that the server sends
the data to the client. The line is a comment when "#" is used. The
space after the prefix is not part of the data.
The following example illustrates a successful query.
# The client connects to the server.
# The server returns a banner identifying its protocol versions and
# capabilities.
S %rwhois V-1.5:00ffff:00 master.rwhois.net (Network Solutions V-1.5)
# The client sends a directive to limit the number of search hits
# to 20.
C -limit 20
# The server returns a successful response.
S %ok
# The client sends a query to search for rwhois.net domain.
C domain rwhois.net
# The server returns the data for rwhois.net domain.
S domain:ID:dom-1.rwhois.net
S domain:Auth-Area:rwhois.net
S domain:Class-Name:domain
S domain:Updated:19970107201111000
S domain:Domain:rwhois.net
S domain:Server;I:hst-1.rwhois.net
S domain:Server;I:hst-2.rwhois.net
S
S %ok
# The server closes the connection.
The following example illustrates the link and punt referrals.
# The client connects to the server.
# The server returns a banner identifying its protocol versions and
# capabilities.
S %rwhois V-1.5:00ffff:00 master.rwhois.net (Network Solutions V-1.5)
# The client sends a directive to hold the connection until it sends
# a directive to close the connection.
C -holdconnect on
# The server returns a successful response.
S %ok
# The client sends a query to search for a.b.rwhois.net domain.
C domain a.b.rwhois.net
# The server returns a link referral to a server serving the
<span class="grey">Williamson, et. al. Informational [Page 17]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-18" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
# b.rwhois.net authority area.
S %referral rwhois://master.b.rwhois.net:4321/auth-area=b.rwhois.net
S %ok
# The client sends a query to search for internic.net domain.
C domain internic.net
# The server returns a punt referral to a server serving the root
# authority area.
S %referral rwhois://rs.internic.net:4321/auth-area=.
S %ok
# The client sends a directive to close the connection.
C -quit
S %ok
# The server closes the connection.
The following example illustrates a query error.
# The client connects to the server.
# The server returns a banner identifying its protocol versions and
# capabilities.
S %rwhois V-1.5:00ffff:00 master.rwhois.net (Network Solutions V-1.5)
# The client sends a query to search for c.rwhois.net domain.
C domain c.rwhois.net
# The server returns an error, since neither data nor referrals for
# c.rwhois.net domain are found within the rwhois.net authority area.
S %error 230 No objects found
# The server closes the connection.
<span class="h4"><a class="selflink" id="section-3.1.8" href="#section-3.1.8">3.1.8</a> Notation</span>
The following sections use the Augmented Backus-Naur Form (ABNF)
notation to describe the syntax of the protocol. For further
information, see <a href="./rfc822#section-2">Section 2 of [RFC822]</a>. The notation in the examples
uses a prefix to indicate from where the information comes. A "C"
indicates that the client sends the data to the server. An "S"
indicates that the server sends the data to the client. The line is a
comment when "#" is used. The space after the prefix is not part of
the data.
<span class="h4"><a class="selflink" id="section-3.1.9" href="#section-3.1.9">3.1.9</a> General ABNF definitions</span>
Lexical Tokens
alpha = "a".."z" / "A".."Z"
digit = "0".."9"
hex-digit = digit / "a".."f" / "A".. "F"
id-char = alpha / digit / "_" / "-"
any-char = <ASCII 1..255,
except LF (linefeed) and CR (carriage return)>
<span class="grey">Williamson, et. al. Informational [Page 18]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-19" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
dns-char = alpha / digit / "-"
email-char = <see [<a href="./rfc822">RFC 822</a>]>
space = " "
tab = <ASCII TAB (tab)>
lf = <ASCII LF (linefeed)>
cr = <ASCII CR (carriage return)>
crlf = cr lf
Grammar
year = 4digit
month = 2digit
day = 2digit
hour = 2digit
minute = 2digit
second = 2digit
milli-second = 3digit
host-name = dns-char *(dns-char / ".")
ip-address = 1*3digit "." 1*3digit "." 1*3digit "." 1*3digit
email = 1*email-char "@" host-name
authority-area = (dns-char / ".") *(dns-char / "." / "/")
object-id = 1*id-char "." authority-area
host-port = (host-name / ip-address) ":" 1*5digit
class-name = 1*id-char
attribute-name = 1*id-char
attribute-value = 1*any-char
time-stamp = year month day hour minute second milli-second
on-off = "on" / "off"
Note that the time-stamp must be in the Greenwich Mean Time (GMT)
time zone. Also note that since in the above any-char is 1..255
ASCII that the RWhois protocol is an 8 bit protocol.
Response
The general response for every directive and query is either "%ok" or
"%error". In addition, a "%info" response may be sent.
response = ok-response crlf / error-response crlf / info-response
ok-response = "%ok"
error-response = "%error" space error-code space error-text
error-code = 3digit
error-text = 1*any-char
info-response = "%info" space "on" crlf *(*any-char crlf) "%info"
space "off" crlf
<span class="grey">Williamson, et. al. Informational [Page 19]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-20" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
Banner
The server must send a banner to the client when the connection is
opened. The banner contains the version(s) of the protocol the
server supports and a capability ID of encoded bit flags that
indicates which directives are implemented. If the server supports
more than one version of the protocol, the lowest-numbered version
must be specified first. The bits in extra-id are reserved for future
use. The end of the banner should contain a free-form string
indicating the name of the server implementation. A server must
support at least one version of the protocol, and may accept more
versions for compatibility reasons.
rwhois-banner = "%rwhois" space version-list space host-name
[space implementation] crlf
version-list = version *("," version)
version = version-number [":" capability-id]
/ "V-1.5" ":" capability-id
version-number = "V-" 1*digit "." 1*digit
capability-id = response-id ":" extra-id
response-id = 6hex-digit
extra-id = 2hex-digit
implementation = 1*any-char
Protocol
The entire RWhois protocol can be defined as a series of directives,
responses, queries, and results.
rwhois-protocol = client-sends / server-returns
client-sends = *(directives / rwhois-query)
server-returns = *(responses / rwhois-query-result)
<span class="h3"><a class="selflink" id="section-3.2" href="#section-3.2">3.2</a> Required Directives</span>
The server must implement the following directives.
<span class="grey">Williamson, et. al. Informational [Page 20]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-21" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
<span class="h4"><a class="selflink" id="section-3.2.1" href="#section-3.2.1">3.2.1</a> rwhois</span>
Description
The "-rwhois" directive may be issued by the client at the start of
every session . It tells the server which version of the protocol the
client can handle. The server must respond with a banner containing
the protocol version and directives it implements. This banner is the
same banner that is sent by the server when the connection is opened,
except that the server must indicate only one version number. The
banner issued when opening a connection may contain more than one
version number. The directive flags are encoded into three octets,
which are described in <a href="#appendix-D">Appendix D</a>.
ABNF
rwhois-dir = "-rwhois" space version-number [space implementation]
crlf
rwhois-response = "%rwhois" space version space host-name
[space implementation] crlf
Errors
300 Not compatible with version
338 Invalid directive syntax
Examples
# When a connection is opened, the server issues the banner.
S %rwhois V-1.0,V-1.5:00ffff:00 rs.internic.net (NSI Server 1.5.4)
# The client sends the rwhois directive.
C -rwhois V-1.5 NSI Client 1.2.3
S %rwhois V-1.5:00ffff:00 rs.internic.net (NSI Server 1.5.4)
S %ok
<span class="h3"><a class="selflink" id="section-3.3" href="#section-3.3">3.3</a> Optional Directives</span>
The server should implement the following directives.
<span class="grey">Williamson, et. al. Informational [Page 21]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-22" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
<span class="h4"><a class="selflink" id="section-3.3.1" href="#section-3.3.1">3.3.1</a> class</span>
Description
The "-class" directive can be used by the client to get the meta-
information for one or more classes in an authority area. The
response must contain the description and version number of each
specified class and may be expanded in the future with additional
attributes. When no class name is given, the server must return the
meta-information for all the classes in the authority area. Every
class record must end with an empty "%class" line.
ABNF
class-dir = "-class" space authority-area *(space class-name) crlf
class-response = *class-record response
class-record = *class-line "%class" crlf
class-line = "%class" space class-name ":" "description" ":"
1*any-char crlf
/ "%class" space class-name ":" "version" ":" time-stamp crlf
/ "%class" space class-name ":" meta-field ":" meta-value crlf
meta-field = 1*id-char
meta-value = 1*any-char
The following fields are required.
meta-field meta-value Description
description 1*any-char Class description.
Time/date stamp indicating version of class,
version time-stamp must be updated after class definition is
changed.
Errors
338 Invalid directive syntax
340 Invalid authority area
341 Invalid class
400 Directive not available
401 Not authorized for directive
Examples
C -class rwhois.net domain host
S %class domain:description:Domain information
S %class domain:version:19970103101232000
S %class
<span class="grey">Williamson, et. al. Informational [Page 22]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-23" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
S %class host:description:Host information
S %class host:version:19970214213241000
S %class
S %ok
<span class="h4"><a class="selflink" id="section-3.3.2" href="#section-3.3.2">3.3.2</a> directive</span>
Description
The "-directive" directive can be used by the client to get
information about the directives that the server supports. The
response must contain the name and description of each specified
directive and may be expanded in the future with additional
attributes. When no directive name is given, the server must return
information about all the directives. Every directive record must end
with an empty "%directive" line.
ABNF
directive-dir = "-directive" *(space directive-name) crlf
directive-name = 1*id-char
directive-response = *directive-record response
directive-record = "%directive" space "directive" ":" directive-name
crlf *directive-line "%directive" crlf
directive-line = "%directive" space "description" ":" 1*any-char crlf
/ "%directive" space attribute-name ":" attribute-value crlf
Errors
338 Invalid directive syntax
400 Directive not available
401 Not authorized for directive
Examples
Without parameters:
C -directive
S %directive directive:rwhois
S %directive description:RWhois directive
S %directive
S %directive directive:quit
S %directive description:Quit connection
S %directive
S %ok
<span class="grey">Williamson, et. al. Informational [Page 23]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-24" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
With parameters:
C -directive quit
S %directive directive:quit
S %directive description:Quit connection
S %directive
S %ok
<span class="h4"><a class="selflink" id="section-3.3.3" href="#section-3.3.3">3.3.3</a> display</span>
Description
By default, the server uses the dump format for the output of a query
result. The output format can be changed with the "-display"
directive. When no parameter is given, the server must list all the
display formats it supports. Every display record must end with an
empty "%display" line.
Currently, only the dump format is standard and must be supported by
the server. Other output formats may be added in the future. See
<a href="#section-3.4">Section 3.4</a> for the definition of the dump format.
ABNF
display-dir = "-display" crlf
/ "-display" space display-name crlf
display-name = 1*id-char
display-response = *(display-record) response
display-record = "%display" space "name" ":" display-name crlf
*display-line "%display" crlf
display-line = "%display" space attribute-name ":"
attribute-value crlf
Errors
338 Invalid directive syntax
400 Directive not available
401 Not authorized for directive
436 Invalid display format
Examples
# Get the available display formats.
C -display
S %display name:dump
S %display
S %ok
<span class="grey">Williamson, et. al. Informational [Page 24]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-25" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
# Change the active display format.
C -display dump
S %ok
<span class="h4"><a class="selflink" id="section-3.3.4" href="#section-3.3.4">3.3.4</a> forward</span>
Description
The "-forward" directive instructs the server to follow all the
referrals and return the results to the client. This directive can be
used to run an RWhois server as a proxy server. The default value
must be "off". When the value is set to "on", the server must not
return referrals.
ABNF
forward-dir = "-forward" space on-off crlf
forward-response = response
Errors
338 Invalid directive syntax
400 Directive not available
401 Not authorized for directive
Examples
C -forward on
S %ok
C -forward off
S %ok
<span class="h4"><a class="selflink" id="section-3.3.5" href="#section-3.3.5">3.3.5</a> holdconnect</span>
Description
Normally, the server closes the connection after each query. This
behavior is controlled by the holdconnect state, which can be changed
with the "-holdconnect" directive. When the holdconnect state is set
to "off", the server must close the connection after a query; when it
is set to "on", the server must not close the connection after a
query. By default, the holdconnect state must be set to "off" for
each connection.
<span class="grey">Williamson, et. al. Informational [Page 25]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-26" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
ABNF
holdconnect-dir = "-holdconnect" space on-off crlf
holdconnect-response = response
Errors
338 Invalid directive syntax
400 Directive not available
401 Not authorized for directive
Examples
C -holdconnect on
S %ok
C -holdconnect off
S %ok
<span class="h4"><a class="selflink" id="section-3.3.6" href="#section-3.3.6">3.3.6</a> limit</span>
Description
When returning a query result, the server should limit the number of
objects returned to the client. The "-limit" directive changes this
limit. The default and maximum limit is server-dependent. The client
can get the current limit by using the "-status" directive (see
<a href="#section-3.3.13">Section 3.3.13</a>).
ABNF
limit-dir = "-limit" space 1*digit crlf
limit-response = response
Errors
331 Invalid limit
338 Invalid directive syntax
400 Directive not available
401 Not authorized for directive
Examples
C -limit 100
S %ok
<span class="grey">Williamson, et. al. Informational [Page 26]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-27" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
<span class="h4"><a class="selflink" id="section-3.3.7" href="#section-3.3.7">3.3.7</a> notify</span>
Description
The "-notify" directive performs several functions.
* If the server returns a referral that results in an error, the
client can report the bad referral to the server using the
"badref" option.
* When the client follows referrals and goes through the same
referral twice, that referral is a recursive referral and causes
a referral loop. The client can report the recursive referral to
the server using the "recurref" option.
* When the data in an authority area changes, a master server can
use the "update" option to notify its slave servers to update
the data.
* The "inssec" option allows an RWhois server to register itself
as a slave server for an authority area with a master server.
The master server may reject the request on the basis of its
registration policy.
* The "delsec" option allows a slave server to cancel its
registration with the master server.
ABNF
notify-dir = "-notify" space "badref" space referral-query crlf
/ "-notify" space "recurref" space referral-query crlf
/ "-notify" space "update" space host-port ":" authority-area crlf
/ "-notify" space "inssec" space host-port ":"
authority-area crlf
/ "-notify" space "delsec" space host-port ":"
authority-area crlf
referral-query = referral-url space [class-name space] query
notify-response = response
See <a href="#section-3.4">Section 3.4</a> for the definitions of referral-url and query.
Errors
338 Invalid directive syntax
340 Invalid authority area
342 Invalid host/port
400 Directive not available
401 Not authorized for directive
<span class="grey">Williamson, et. al. Informational [Page 27]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-28" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
Examples
# The client reports a bad referral to rwhois.foobar.com to the
# server.
C -notify badref rwhois://rwhois.foobar.com:4321/auth-area=foobar.com
domain foobar.com
S %ok
# The client reports a recursive referral to rwhois.foobar.com to the
# server.
C -notify recurref rwhois://rwhois.foobar.com:4321/auth-area=
foobar.com contact Last-Name="Beeblebrox"
S %ok
# The master server for the foobar.com authority area notifies its
# slave servers to update the data.
C -notify update master.foobar.com:4321:foobar.com
S %ok
# The server rwhois2.foobar.com registers as a slave server for the
# foobar.com authority area.
C -notify inssec rwhois2.foobar.com:4321:foobar.com
S %ok
# The server rwhois2.foobar.com cancels its registration as a slave
# server for the foobar.com authority area.
C -notify delsec rwhois2.foobar.com:4321:foobar.com
S %ok
<span class="h4"><a class="selflink" id="section-3.3.8" href="#section-3.3.8">3.3.8</a> quit</span>
Description
The "-quit" directive can be used by the client to close the
connection. Before the server closes the connection, it must respond
with "%ok".
ABNF
quit-dir = "-quit" crlf
quit-response = response
Errors
No errors.
<span class="grey">Williamson, et. al. Informational [Page 28]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-29" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
Examples
C -quit
S %ok
<span class="h4"><a class="selflink" id="section-3.3.9" href="#section-3.3.9">3.3.9</a> register</span>
Description
The "-register" directive can be used by the client to add, modify,
or delete objects in the server's database. The client must wait to
send the registration data until the "%ok" response is received from
the server. This directive has the following options.
* The "add" option indicates that the object being sent should be
added to the server's database.
* The "mod" option indicates that the object being sent is a
modification of an object that already resides on the server's
database. During a modify operation, the "_NEW_" tag is used to
delineate the end of the original (unmodified) object and the
beginning of the replacement object. That is, the identifying
characteristics of the original object are sent first, then the
"_NEW_" separator is sent, and then the entire replacement
object is sent.
The "del" option indicates that the object being sent should be
deleted from the server's database.
After a register operation (add, modify, or delete an object) in an
authority area, the server should update the "Serial-Number" variable
in the SOA information for the authority area. This is useful for
data replication because a slave server checks the "Serial-Number"
variable to detect a data change at the master server (see <a href="#section-3.6.2">Section</a>
<a href="#section-3.6.2">3.6.2</a>).
ABNF
register-dir = register-on space "add" space maintainer-id crlf
register-add register-off
/ register-on space "mod" space maintainer-id crlf
register-mod register-off
/ register-on space "del" space maintainer-id crlf
register-del register-off
register-on = "-register" space "on"
register-off = "-register" space "off" crlf
register-add = 1*(register-line crlf)
register-mod = 1*(register-line crlf) "_NEW_" crlf
1*(register-line crlf)
register-del = 1*(register-line crlf)
<span class="grey">Williamson, et. al. Informational [Page 29]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-30" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
maintainer-id = email
register-line = attribute-name ":" attribute-value
register-on-response = response
register-off-response = "%register" space "ID" ":" object-id crlf
response
/ "%register" space "Updated" ":" time-stamp crlf response
/ response
* The server must return the register-on-response for the
"-register on" directive and the register-off-response for the
"-register off" directive.
* The maintainer-id identifies, for maintenance purposes, the
sender of registration information. The server should not use it
to authenticate the sender.
* For the "add" option, the client must send all the required
attributes for the object, including the Class-Name and Auth-
Area attributes. However, the client must not send the ID and
Updated attributes. These attributes are assigned by the server
and returned in the response.
* For the "mod" option, the client must send the identifying
information for the object to be modified, followed by the
"_NEW_" separator and the entire replacement object. The
identifying information must contain the ID and Updated
attributes; it may contain other attributes, but the server may
not check them. The ID, Auth-Area, and Class-Name attributes
must match in both the original object data and the replacement
object. The original object data is sent before the replacement
object to enable the server to lock the record in the database.
* For the "del" option, the client must send the identifying
information for the object to be deleted. The identifying
information must contain the ID and Updated attributes; it may
contain other attributes, but the server may not check them.
Errors
120 Registration deferred
320 Invalid attribute
321 Invalid attribute syntax
322 Required attribute missing
323 Object reference not found
324 Primary key not unique
325 Failed to update outdated object
336 Object not found
338 Invalid directive syntax
340 Invalid authority area
341 Invalid class
400 Directive not available
401 Not authorized for directive
<span class="grey">Williamson, et. al. Informational [Page 30]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-31" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
Examples
# Add an object.
C -register on add joe@netsol.com
S %ok
C Class-Name:contact
C Auth-Area:a.com
C First-Name:Scott
C Last-Name:Williamson
C Name:Williamson, Scott
C Email:scottw@a.com
C -register off
S %register ID:23456789.a.com
S %register Updated:19961205224403000
S %ok
# Modify an object.
C -register on mod joe@netsol.com
S %ok
C ID:23456789.a.com
C Updated:19961205124403000
C _NEW_
C Class-Name:contact
C Auth-Area:a.com
C ID:23456789.a.com
C First-Name:Scott
C Last-Name:Williamson
C Name:Williamson, Scott
C Email:sw@a.com
C -register off
S %ok
# Delete an object.
C -register on del joe@netsol.com
S %ok
C ID:23456789.a.com
C Updated:19961205224403000
C -register off
S %ok
<span class="h4"><a class="selflink" id="section-3.3.10" href="#section-3.3.10">3.3.10</a> schema</span>
Description
The "-schema" directive can be used by the client to get the
attribute definitions of one or more classes in an authority area. If
the client specifies class names, the server must return the
attribute definitions of the specified classes. Otherwise, the server
<span class="grey">Williamson, et. al. Informational [Page 31]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-32" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
must return the attribute definitions of all the classes in the
authority area. Every schema record must end with an empty "%schema"
line.
ABNF
schema-dir = "-schema" space authority-area *(space class-name) crlf
schema-response = *schema-record response
schema-record = *schema-line "%schema" crlf
schema-line = "%schema" space class-name ":" attribute-name ":"
attribute-value crlf
Errors
338 Invalid directive syntax
340 Invalid authority area
341 Invalid class
400 Directive not available
401 Not authorized for directive
Examples
C -schema map
S %schema map:attribute:Class-Name
S %schema map:description:Type of the object
S %schema map:type:TEXT
S %schema map:format:re:[a-zA-Z0-9-]+
S %schema map:indexed:OFF
S %schema map:required:ON
S %schema map:multi-line:OFF
S %schema map:repeatable:OFF
S %schema map:primary:OFF
S %schema map:hierarchical:OFF
S %schema map:private:OFF
S %schema
S %schema map:attribute:ID
S %schema map:description:Globally unique object identifier
S %schema map:type:TEXT
S %schema map:format:re:[0-9]+.[a-zA-Z0-9.-]+
<span class="grey">Williamson, et. al. Informational [Page 32]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-33" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
S %schema map:indexed:ON
S %schema map:required:ON
S %schema map:multi-line:OFF
S %schema map:repeatable:OFF
S %schema map:primary:ON
S %schema map:hierarchical:OFF
S %schema map:private:OFF
S %schema
# This is an abbreviated example, more attributes usually follow.
S %ok
<span class="h4"><a class="selflink" id="section-3.3.11" href="#section-3.3.11">3.3.11</a> security</span>
Description
The "-security" directive enables either a client request or a server
response to be authenticated and/or encrypted. Currently, RWhois uses
two standard security methods: password and PGP. Password provides
authentication only, and PGP provides both authentication and
encryption. This directive can be used to securely access or update
any information (meta or data) in an authority area that is protected
by one or more guardian objects.
ABNF
security-dir = "-security" space "on" space direction space
security-method [space security-data] crlf
security-payload ["-security" space "off" crlf]
direction = "request" / "response"
security-method = "password" / "pgp" / 1*id-char
security-data = password-data / pgp-data / 1*any-char
password-data = 1*any-char
pgp-data = "signed" / "encrypt" [space key-id] / "signed-encrypt"
[space key-id]
security-payload = *(*any-char crlf)
security-response = response
* The "password" security-method is available in the "request"
direction only. For password, the security-data is a cleartext
password.
* The "pgp" security-method is available in both the "request" and
"response" directions. For PGP, the security-data indicates how
to treat the security-payload: signed, encrypted, or signed and
encrypted. To encrypt the security-payload in the "response"
direction, the security-data must include the public key ID with
which to encrypt it.
<span class="grey">Williamson, et. al. Informational [Page 33]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-34" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
Errors
338 Invalid directive syntax
352 Invalid security method
353 Authentication failed
354 Encryption failed
400 Directive not available
401 Not authorized for directive
Examples
# Authenticate a request using password.
C -security on request password hello!1
S %ok
# Authenticate a PGP signed request.
C -security on request pgp signed
S %ok
C -register on mod joe@netsol.com
S %ok
C -----BEGIN PGP MESSAGE-----
C Version: 2.6.2
C
C owHrZJjKzMpgdP9D9crUhdpBYnwHGRnPbmVhmHlV7Hef9je/n7vyzhmE6589/+Dg
C jPpVm59tNz92vPSmrFB/4ankBRz+xgY+7z9OUYjefGahbWSNwzzxbw6TpWZGerU+
C uOUg/Cygs33JBdHqjwEc+wyfZPp+N5p2bu+ywoaOu8eLPyn+m2Mt/T9p1UaG68vP
C Zd2d9EPw+Ywpio7dco6yh3b/v7zmQxJHcWpyaVFmSSUDEHi6WBkZm5iamVtY6iXq
C JefnKnCFFqQklqSmWBlaWpoZGhmYGhqZmBgYGxgYKHA55yQWF+v6JeamWiXn55Uk
C JpcocDmWlmToOhalJlpB9cf7uYbHE6kWi/VumUXFJRB9wcn5JUBdPokwgfDMnJzM
C xNzi/DwFLjQBHQWoatfcxMwcq+JyB6h5AA==
C =a0sQ
C -----END PGP MESSAGE-----
C -register off
S %ok
# Encrypt a response using PGP. 52160EC1 is the public key ID with
# which the response is encrypted.
C -security on response pgp encrypt 52160EC1
S %ok
C -xfer com class=domain attribute=Domain-Name
attribute=Organization-Name
S -----BEGIN PGP MESSAGE-----
S Version: 2.6.2
S
S hIwDqWWhK1IWDsEBBACOXssTzD2CbB7Vjj2cNURScpJc2as2TbUDOQiwkT+8qFgG
S ZyRfktpwNNTawRIcGOk1Kcs84z8a3vvTA/oje9vZexHtzfJwBHFdiIZxPuCEpvgv
S 2ppK7WqlmHGcQKVBJJHYw7Fq83CUkeGJB9P1M3CQiXeW8h8MwAuhxSgbgt23PKYA
S AABuhknJrXeh9Owm81+MvyzgLOyM7sjDYmttU9sj/yuOYmAhS9V+34MT/Mwn4wO8
<span class="grey">Williamson, et. al. Informational [Page 34]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-35" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
S 2BCsJqBHXbwOuYKs02p0se4jyKFtZR8MDPWNm9QyAP+oNMTjsufy6ZRa9PegUC6t
S HDhXymkiP03mKMMVK1//7X0=
S =vZ2x
S -----END PGP MESSAGE-----
S %ok
<span class="h4"><a class="selflink" id="section-3.3.12" href="#section-3.3.12">3.3.12</a> soa</span>
Description
The "-soa" directive can be used by the client to retrieve the SOA
information for one or more authority areas. When no authority area
name is given, the server must return the SOA information for all the
authority areas. Every SOA record must end with an empty "%soa" line.
ABNF
soa-dir = "-soa" *(space authority-area) crlf
soa-response = *soa-record response
soa-record = *soa-line "%soa" crlf
soa-line = "%soa" space "authority" ":" authority-area crlf
/ "%soa" space "ttl" ":" 1*digit crlf
/ "%soa" space "serial" ":" time-stamp crlf
/ "%soa" space "refresh" ":" 1*digit crlf
/ "%soa" space "increment" ":" 1*digit crlf
/ "%soa" space "retry" ":" 1*digit crlf
/ "%soa" space "tech-contact" ":" email crlf
/ "%soa" space "admin-contact" ":" email crlf
/ "%soa" space "hostmaster" ":" email crlf
/ "%soa" space "primary" ":" host-port crlf
/ "%soa" space attribute-name ":" attribute-value crlf
The server must return the following SOA information for an authority
area.
attribute-name attribute-value Comments
authority authority-area This is the name of the authority area.
ttl 1*digit This is the default time to live for
the data in the authority area.
serial time-stamp This is the serial number of the data
in the authority area; it changes
when the data changes.
<span class="grey">Williamson, et. al. Informational [Page 35]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-36" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
refresh 1*digit This is the time interval before a
slave server checks for complete
replication.
increment 1*digit This is the time interval before a
slave server checks for incremental
replication.
retry 1*digit This is the time interval before a
slave server tries again to connect
to a master server that appears to be
out-of-service.
tech-contact email This is the contact for the operation
of the master server.
admin-contact email This is the contact for the data
integrity at the master server.
hostmaster email This is the contact for sending update
requests at the master server.
primary host-port This is the host name (or IP address)
and port number of the master server.
Errors
338 Invalid directive syntax
340 Invalid authority area
400 Directive not available
401 Not authorized for directive
Examples
C -soa org
S %soa authority:org
S %soa ttl:86400
S %soa serial:19961119111535000
S %soa refresh:3600
S %soa increment:1800
S %soa retry:180
S %soa tech-contact:tech@internic.net
S %soa admin-contact:admin@internic.net
S %soa hostmaster:hostmaster@internic.net
S %soa primary:rs.internic.net:4321
S %soa
S %ok
<span class="grey">Williamson, et. al. Informational [Page 36]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-37" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
<span class="h4"><a class="selflink" id="section-3.3.13" href="#section-3.3.13">3.3.13</a> status</span>
Description
The "-status" directive can be used by the client to get various
status flags from the server. The response must include the number of
objects in all the authority areas, the current display format, the
server contact information, and the status flags for the state-
oriented directives: "-limit", "-holdconnect", and "-forward".
ABNF
status-dir = "-status" crlf
status-response = *status-line response
status-line = "%status" space "limit" ":" 1*digit crlf
/ "%status" space "holdconnect" ":" on-off crlf
/ "%status" space "forward" ":" on-off crlf
/ "%status" space "objects" ":" 1*digit crlf
/ "%status" space "display" ":" 1*any-char crlf
/ "%status" space "contact" ":" email crlf
/ "%status" space attribute-name ":" attribute-value crlf
Errors
338 Invalid directive syntax
400 Directive not available
401 Not authorized for directive
Examples
C -status
S %status limit:20
S %status holdconnect:OFF
S %status forward:OFF
S %status objects:12345
S %status display:dump
S %status contact:joe@rwhois.net
S %ok
<span class="h4"><a class="selflink" id="section-3.3.14" href="#section-3.3.14">3.3.14</a> xfer</span>
Description
The "-xfer" directive can be used by the client (generally, a slave
server) to transfer the data in an authority area. The client can
control the amount of data transferred using one of the following
options.
<span class="grey">Williamson, et. al. Informational [Page 37]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-38" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
* serial-number: The client can transfer all the objects that have
been added, modified or deleted since a certain time, specifying
the serial-number that indicates that time. This option is used
for incremental replication.
* class: The client can limit the data transfer to one or more
classes, using the "class=<class-name>" option. The server must
return data for only the specified classes. If no class name is
specified, the server must return data for all the classes.
* attribute: The client can limit the data transfer to one or more
attributes of a class, using the "attribute=<attribute-name>"
option in combination with the "class=<class-name>" option. The
server must return data for only the specified attributes of the
class. The client can specify multiple "class=" and "attribute="
pairs.
ABNF
xfer-dir = "-xfer" space authority-area *attribute-def
[space serial-number] crlf
attribute-def = [space "class=" class-name] *(space "attribute="
attribute-name)
serial-number = time-stamp
xfer-response = *xfer-record response
xfer-record = *xfer-line "%xfer" crlf
xfer-line = "%xfer" space class-name ":" attribute-name ":"
attribute-value crlf
Errors
332 Nothing to transfer
333 Not master for authority area
338 Invalid directive syntax
340 Invalid authority area
341 Invalid class
342 Invalid attribute
400 Directive not available
401 Not authorized for directive
<span class="grey">Williamson, et. al. Informational [Page 38]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-39" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
Examples
C -xfer com class=domain attribute=Domain-Name
attribute=Organization-Name
S %xfer domain:Domain-Name:acme.com
S %xfer domain:Organization-Name:Acme Inc.
S %xfer
S %xfer domain:Domain-Name:vogon.com
S %xfer domain:Organization-Name:Vogon Heavy Industries
S %xfer
S %ok
<span class="h4"><a class="selflink" id="section-3.3.15" href="#section-3.3.15">3.3.15</a> X</span>
Description
The "-X" directive is used to specify an additional, non-standard
directive. It can be implemented by executing an external program, by
internal functions, or by other means. It may interact with the
client or simply produce output like one of the standard directives.
ABNF
x-dir = "-X-" x-directive [space x-arguments] crlf *x-line
x-directive = 1*id-char
x-arguments = *any-char
x-response = *(*any-char crlf) response
x-line = *any-char crlf
Errors
338 Invalid directive syntax
400 Directive not available
401 Not authorized for directive
Examples
The following example uses an implementation that executes an
external program, the UNIX "date" command. The server runs the "date"
command and returns its output to the client.
C -X-date
S Mon Jan 6 13:21:20 EST 1997
S %ok
<span class="grey">Williamson, et. al. Informational [Page 39]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-40" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
<span class="h3"><a class="selflink" id="section-3.4" href="#section-3.4">3.4</a> Query</span>
Description
The query allows the client to retrieve objects from the server's
database. The server must support the following types of queries.
* Unrestricted query: It is a single word or a quoted string. The
server must return all the matching objects where one or more
attributes match the query, regardless of the class.
* Class-restricted query: It is a class name specified in front
of the unrestricted query. The server must return all the
matching objects where one or more attributes of the specified
class match the query.
* Attribute-restricted query: It is of the
"<attribute-name>=<search-string>" form. The server must return
all the matching objects where the specified attribute matches
the query.
The server may implement the following types of queries.
* Boolean operator query: It consists of simpler queries combined
using the "and" and "or" operators.
* Wild card query: It consists of an asterisk ("*") in the front
and/or at the end of the search string. The server may support
partial matching using the asterisk.
In response to the query, the server will return the objects that
match the query. If the server does not support complex queries,
with, for example, wild cards or boolean operators, the server may
return the "351 Query too complex" error. When the number of objects
found exceeds the limit (set by the "-limit" directive), the server
should return the objects, followed by the "330 Exceeded maximum
objects limit" error.
The default object output format is the dump format that uses the
"<class-name>:<attribute-name>;<type character>:<attribute-value>"
form. The type character is optional and identifies the type of the
attribute value. The type character is a shorthand for the Type field
of the attribute definition (see <a href="#section-2.3.1">Section 2.3.1</a>). The type characters
are defined as follows.
<span class="grey">Williamson, et. al. Informational [Page 40]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-41" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
Type Attribute
character Type
T TEXT
I ID
S SEE-ALSO
When no type character is given, the client should assume the "T"
type character. The server must provide the type character when the
attribute type is ID or SEE-ALSO. The purpose of the type character
is to aid the client in displaying the data. For example, when an
attribute value is an ID, the client may indicate to the end-user
that it is possible to retrieve the object indicated by the ID.
The server may return one or more referrals in the "%referral
rwhois://<host-name>:<port-number>/auth-area=<authority area>" form.
The client can distinguish multiple referrals by comparing their
authority areas; if all the referrals refer to the same authority
area, the client should follow only one of them. Otherwise, the
client should follow all of them. To follow a referral, the client
must connect to the specified host name and port number, and issue
the same query.
ABNF
rwhois-query = [class-name space] query crlf
query = query-string / attribute-query / query bin-boolean query
query-char = <any-char, except """, space, tab>
quoted-query-char = query-char / space / tab / "
query-string = ["*"] 1*query-char ["*"] / """ ["*"]
1*quoted-query-char ["*"] """
attribute-query = attribute-name "=" query-string
bin-boolean = "and" / "or"
rwhois-query-result = *(query-record / referral-record) response
query-record = 1*query-line crlf
query-line = class-name ":" attribute-name [";" type-char] ":"
attribute-value crlf
type-char = "T" / "I" / "S"
referral-record = 1*(referral-line crlf)
referral-line = "%referral" space referral-url
referral-url = "rwhois" ":" "//" host-port "/" "auth-area="
authority-area
<span class="grey">Williamson, et. al. Informational [Page 41]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-42" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
Errors
130 Object not authoritative
230 No objects found
330 Exceeded maximum objects limit
340 Invalid authority area
341 Invalid class
342 Invalid attribute
350 Invalid query syntax
351 Query too complex
Examples
This example illustrates a query, where no objects are found.
C vogon
S %error 230 No objects found
This example illustrates a query, where two different objects are
returned.
C ibm
S domain:ID:IBMLIFEPRO-DOM.com
S domain:Auth-Area:com
S domain:Domain-Name:IBMLIFEPRO.COM
S domain:Org-Name:IBM
S domain:Server;I:NS12345-HST.NET
S domain:Server;I:NS12345-HST.NET
S domain:Admin-Contact;I:TW1234.COM
S domain:Tech-Contact;I:BN123.NET
S domain:Updated:19961120123455000
S domain:Updated-By:autoreg@internic.net
S domain:Class-Name:domain
S
S network:ID:NET-IBMNET-3.0.0.0/0
S network:Auth-Area:0.0.0.0/0
S network:Network-Name:IBMNET-3
S network:IP-Network:123.45.67.0/24
S network:Org-Name:IBM
S network:Street-Address:1234 Maneck Avenue
S network:City:Black Plains
S network:State:NY
S network:Postal-Code:12345
S network:Country-Code:US
S network:Tech-Contact;I:MG305.COM
S network:Updated:19931120123455000
S network:Updated-By:joeblo@nic.ddn.mil
S network:Class-Name:network
<span class="grey">Williamson, et. al. Informational [Page 42]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-43" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
S
S %ok
This example illustrates a query with a class restrictor, where the
number of objects found exceeds the limit set by the "-limit"
directive.
C -limit 1
S %ok
C domain ibm
S domain:ID:IBMLIFEPRO-DOM.com
S domain:Auth-Area:com
S domain:Domain-Name:IBMLIFEPRO.COM
S domain:Org-Name:IBM
S domain:Server;I:NS12345-HST.NET
S domain:Server;I:NS12345-HST.NET
S domain:Admin-Contact;I:TW1234.COM
S domain:Tech-Contact;I:BN123.NET
S domain:Updated:19961120123455000
S domain:Updated-By:erice@internic.net
S domain:Class-Name:domain
S
S %error 330 Exceeded maximum objects limit
This is an example of attribute matching.
C domain Domain-Name=konabo.com
S domain:ID:12345678.com
S domain:Auth-Area:com
S domain:Domain-Name:konabo.com
S domain:Org-Name:ACME
S domain:Server;I:12345670.com
S domain:Server;I:12345671.com
S domain:Admin-Contact;I:12345660.com
S domain:Tech-Contact;I:12345665.com
S domain:Updated:19961120123455000
S domain:Updated-By:joeblo@internic.net
S domain:Class-Name:domain
S
S %ok
This example illustrates a link referral.
C domain a.b.rwhois.net
# The server returns a link referral to a server serving the
# b.rwhois.net authority area.
S %referral rwhois://master.b.rwhois.net:4321/auth-area=b.rwhois.net
S %ok
<span class="grey">Williamson, et. al. Informational [Page 43]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-44" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
This example illustrates a punt referral.
C domain internic.net
# The server returns a punt referral to a server serving the root
# authority area.
S %referral rwhois://rs.internic.net:4321/auth-area=.
S %ok
This example illustrates multiple referrals that refer to the same
authority area. The client should follow only one of them.
C domain a.b.rwhois.net
# The server returns link referrals to two RWhois servers serving the
# b.rwhois.net authority area.
S %referral rwhois://master.b.rwhois.net:4321/auth-area=b.rwhois.net
S %referral rwhois://slave.b.rwhois.net:4321/auth-area=b.rwhois.net
S %ok
This example illustrates multiple referrals that refer to different
authority areas. The client should follow all of them.
C contact Last-Name="Beeblebrox"
# The server returns a link referral to a server serving the
# b.rwhois.net authority area.
S %referral rwhois://master.b.rwhois.net:4321/auth-area=b.rwhois.net
# The server also returns a punt referral to a server serving the
# net authority area since the query matched an entry in the
# non-hierarchical index received from it.
S %referral rwhois://rs.internic.net:4321/auth-area=net
S %ok
<span class="grey">Williamson, et. al. Informational [Page 44]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-45" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
This is an example of a boolean operator and wildcard matching.
C ibm and jubliana*
S host:ID:JUBLIANA-HST.root
S host:Auth-Area:.
S host:Host-Name:JUBLIANA.TRL.IBM.CO.JP
S host:IP-Address:123.156.220.68
S host:Org-Name:IBM
S host:Street-Address:1234 Maneck Avenue
S host:City:Black Plains
S host:State:NY
S host:Postal-Code:12345
S host:Country-Code:US
S host:Updated:19961120123455000
S host:Updated-By:joeblo@nic.ddn.mil
S host:Class-Name:host
S
S %ok
<span class="h3"><a class="selflink" id="section-3.5" href="#section-3.5">3.5</a> Connection Model</span>
An RWhois client can connect to an RWhois server using one of the
following transport protocols.
<span class="h4"><a class="selflink" id="section-3.5.1" href="#section-3.5.1">3.5.1</a> Transmission Control Protocol (TCP)</span>
TCP provides a reliable stream transport service between a client and
a server. In RWhois, TCP is the default transport protocol because,
during a particular session, a client can send more than one query
and a server can reliably return a large amount of data for each of
those queries. By default, a TCP RWhois server should run on the
standard, Internet Assigned Number Authority (IANA)-assigned port
4321. However, if port 4321 is not available, it may run on an
available port in the non-reserved range (1024 - 65535).
<span class="h4"><a class="selflink" id="section-3.5.2" href="#section-3.5.2">3.5.2</a> User Datagram Protocol (UDP)</span>
UDP provides an unreliable connectionless transport service between a
client and a server. In RWhois, UDP may be used as the transport
protocol if a client wants to quickly send only one query, without
incurring the overhead of establishing a TCP connection with a
server. By default, a UDP RWhois server should run on the standard,
IANA-assigned port 4321. However, if port 4321 is not available, it
may run on an available port in the non-reserved range (1024 -
65535). A separate document will describe the use of UDP as the
transport protocol in RWhois.
<span class="grey">Williamson, et. al. Informational [Page 45]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-46" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
<span class="h3"><a class="selflink" id="section-3.6" href="#section-3.6">3.6</a> Data Replication</span>
This section discusses when and how a slave server should replicate
data. Further, it describes the server registration and location
mechanisms.
<span class="h4"><a class="selflink" id="section-3.6.1" href="#section-3.6.1">3.6.1</a> When to Replicate Data</span>
The time when a slave server may replicate data for an authority area
is determined by the SOA variables for that authority area. The
possible times are the following.
* When the "Refresh-Interval" expires, a slave server may
completely replicate data.
* When the "Increment-Interval" expires, a slave server may
incrementally replicate data.
* A slave server fails to connect to its master server to
replicate data. When the "Retry-Interval" expires, it tries
again to replicate data.
* When the data in an authority area is changed and its "Serial-
Number" updated, a master server may notify its slave servers to
immediately update the data. To notify about the data change,
the master server should send the "-notify update <host-
name>:<port-number>:<authority-area>" directive to its slave
servers.
<span class="h4"><a class="selflink" id="section-3.6.2" href="#section-3.6.2">3.6.2</a> How to Replicate Data</span>
To replicate data, a slave server sends a series of directives to its
master server and checks each response before sending the next
directive. The following sections describe the protocols for
complete and incremental replication.
Complete Replication
The protocol between a master server and a slave server to completely
replicate data for an authority area is as follows.
1. The slave server should connect to the master server. If there
is a connection error, the slave server should log an error and
exit.
2. The slave server should send the "-soa <authority-area>"
directive to the master server and parse the SOA variables from
the response. Let the "Serial-Number" variable in this response
be called the "old-serial-number".
<span class="grey">Williamson, et. al. Informational [Page 46]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-47" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
3. The slave server should send the "-class <authority-area>"
directive to the master server and parse the versions of all the
classes from the response.
4. The slave server should send the "-schema <authority-area>"
directive to the master server and parse the definitions of all
the classes from the response.
5. The slave server should send the "-xfer <authority-area>"
directive to the master server and parse the data objects from
the response. The master server should return all the data
objects, excluding the deleted ones, in the authority area. The
slave server should index these data objects.
6. When the "Refresh-Interval" expires, the slave server should
to the master server. If there is a connection error, the slave
server should try again after the "Retry-Interval".
7. The slave server should send the "-soa <authority-area>"
directive to the master server and parse the SOA variables from
the response. Let the "Serial-Number" variable in this response
be called the "new-serial-number". If the "new-serial-number" is
not greater than the "old-serial-number", go back to step 6.
Otherwise, it indicates a data change at the master server.
8. The slave server should send the "-class <authority-area>"
directive to the master server and parse the versions of all the
classes from the response. If the version of any of the classes
has changed, the slave server should send the "-schema
<authority-area>" directive to the master server and parse the
definitions of all the classes from the response.
9. The slave server should send the "-xfer <authority-area>"
directive the master server and parse the data objects from the
response. The master server should return all the data objects,
excluding the deleted ones, in the authority area. The slave
server should index these data objects and seamlessly replace
the old index with the new one. Further, it should assign the
"new-serial-number" to the "old-serial-number".
10. Go back to step 6.
Note that the "-class", "-schema", and "-xfer" directives change when
a slave server replicates data for only a subset of the schema for an
authority area.
In the following example, a slave server completely replicates data
for all the classes in an authority area. The notation in the example
uses a prefix to indicate from where the information is coming. An
"M" indicates that the master server sends the data to the slave
server. An "S" indicates that the slave server sends the data to the
master server. The line is a comment when "#" is used. The space
after the prefix is not part of the data. The example authority area
is "rwhois.net".
<span class="grey">Williamson, et. al. Informational [Page 47]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-48" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
# The slave server connects to the master server.
M %rwhois V-1.5:00ffff:00 master.rwhois.net
S -soa rwhois.net
M ...
M %soa serial:19970103102258000
M %soa refresh:3600
M ...
S -class rwhois.net
# The master server returns the versions of all the classes in the
# rwhois.net authority area.
S -schema rwhois.net
# The master server returns the definitions of all the classes in the
# rwhois.net authority area.
S -xfer rwhois.net
# The master server returns all the data objects, excluding the
# deleted ones, in the rwhois.net authority area. The slave server
# indexes these data objects.
# The refresh interval of 3600 seconds expires.
S -soa rwhois.net
M ...
M %soa serial:19970103103258000
M %soa refresh:3600
M ...
# The new serial number 19970103103258000 is greater than the old
# serial number 19970103102258000. It indicates a data change at the
# master server.
S -class rwhois.net
# The master server returns the versions of all the classes in the
# rwhois.net authority area. If the version of any of the classes has
# changed, the slave server logs an error and closes the connection.
S -xfer rwhois.net
# The master server returns all the data objects, excluding the
# deleted ones, in the rwhois.net authority area. The slave server
# indexes these data objects and seamlessly replaces the old index.
# The refresh interval of 3600 seconds expires.
S ...
Incremental Replication
The protocol between a master server and a slave server to
incrementally replicate data for an authority area is as follows.
1. The slave server should connect to the master server. If there
is a connection error, the slave server should log an error and
exit.
<span class="grey">Williamson, et. al. Informational [Page 48]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-49" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
2. The slave server should send the "-soa <authority-area>"
directive to the master server and parse the SOA variables from
the response. Let the "Serial-Number" variable in this response
be called the "old-serial-number".
3. The slave server should send the "-class <authority-area>"
directive to the master server and parse the versions of all the
classes from the response.
4. The slave server should send the "-schema <authority-area>"
directive to the master server and parse the definitions of all
the classes from the response.
5. The slave server should send the "-xfer <authority-area>"
directive to the master server and parse the data objects from
the response. The master server should return all the data
objects, excluding the deleted ones, in the authority area. The
slave server should index these data objects.
6. When the "Increment-Interval" expires, the slave server should
connect to the master server. If there is a connection error,
the slave server should try again after the "Retry-Interval".
7. The slave server should send the "-soa <authority-area>"
directive to the master server and parse the SOA variables from
the response. Let the "Serial-Number" variable in this response
be called the "new-serial-number". If the "new-serial-number" is
not greater than the "old-serial-number", go back to step 6.
Otherwise, it indicates a data change at the master server.
8. The slave server should send the "-class <authority-area>"
directive to the master server and parse the versions of all the
classes from the response. If the version of any of the classes
has changed, the slave server should send the "-schema
<authority-area>" directive to the master server and parse the
definitions of all the classes from the response. The slave
server should then send the "-xfer <authority-area>" directive
to the master server and parse the data objects from the
response. The master server should return all the data objects,
excluding the deleted ones, in the authority area. The slave
server should index these data objects and seamlessly replace
the old index with the new one. Further, it should assign the
"new-serial-number" to the "old-serial-number". If the version
of any of the classes has changed, go back to step 6.
9. The slave server should send the "-xfer <authority-area>
<old-serial-number>" directive to the master server and parse
the data objects from the response. The master server should
return all the data objects in the authority area that have been
inserted, updated, or deleted since the "old-serial-number". The
slave server should index all the data again after purging stale
data objects and seamlessly replace the old index with the new
one. Further, it should assign the "new-serial-number" to the
"old-serial-number".
10. Go back to step 6.
<span class="grey">Williamson, et. al. Informational [Page 49]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-50" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
Note that the "-class", "-schema", and "-xfer" directives change when
a slave server replicates data for only a subset of the schema for an
authority area.
In the following example, a slave server incrementally replicates
data for all the classes in an authority area. The notation in the
example uses a prefix to indicate from where the information is
coming. An "M" indicates that the master server sends the data to the
slave server. An "S" indicates the slave server sends the data to the
master server. The line is a comment when "#" is used. The space
after the prefix is not part of the data. The example authority area
is "rwhois.net".
# The slave server connects to the master server.
M %rwhois V-1.5:00ffff:00 master.rwhois.net
S -soa rwhois.net
M ...
M %soa serial:19970103102258000
M %soa increment:1800
M ...
S -class rwhois.net
# The master server returns the versions of all the classes in the
# rwhois.net authority area.
S -schema rwhois.net
# The master server returns the definitions of all the classes in the
# rwhois.net authority area.
S -xfer rwhois.net
# The master server returns all the data objects, excluding the
# deleted ones, in the rwhois.net authority area. The slave server
# indexes these data objects.
# The increment interval of 1800 seconds expires.
S -soa rwhois.net
M ...
M %soa serial:19970103103258000
M %soa increment:1800
M ...
# The new serial number 19970103103258000 is greater than the old
# serial number 19970103102258000. It indicates a data change at
# the master server.
S -class rwhois.net
# The master server returns the versions of all the classes in the
# rwhois.net authority area. If the version of any of the classes has
# changed, the slave server logs an error and closes the connection.
S -xfer rwhois.net 19970103102258000
<span class="grey">Williamson, et. al. Informational [Page 50]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-51" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
# The master server returns all the data objects in the rwhois.net
# authority area that have been inserted, updated, or deleted since
# 19970103102258000. The slave server indexes all the data again
# after purging stale data objects and seamlessly replaces the old
# index. The increment interval of 1800 seconds expires.
S ...
<span class="h4"><a class="selflink" id="section-3.6.3" href="#section-3.6.3">3.6.3</a> Server Registration</span>
This section discusses how an RWhois server can register itself or
cancel its registration as a slave server for an authority area with
a master server.
The initial list of slave servers for an authority area should be
manually configured at the master server. To register itself as a
slave server, the server should send the "-notify inssec <host-
name>:<port-number>:<authority-area>" directive to the master server.
The master server may reject the request on the basis of its
registration policy. To cancel its registration as a slave server,
the server should send the "-notify delsec <host-name>:<port-
number>:<authority-area>" directive to the master server. Note that
the "host-name" and "port-number" in the above directives correspond
to the requesting server.
<span class="h4"><a class="selflink" id="section-3.6.4" href="#section-3.6.4">3.6.4</a> Server Location</span>
To resolve a query in a particular authority area, an RWhois client
may need to first locate the master and slave servers for that
authority area. The different server location mechanisms are as
follows.
Referrals
An RWhois client should know about at least one RWhois server. It
should send the "referral <authority-area>" query to that server. The
query may be routed up or down the RWhois tree before getting
resolved. If the query does get resolved, the result should be a
referral object for that authority area. The client should parse the
"Referral" attributes from the result to obtain a list of servers
serving that authority area.
The client should then send the "-soa <authority-area>" directive to
one of the above servers and parse the "Primary-Server" variable from
the response. The value of this variable is the master server. Then,
the remaining servers in the list are the slave servers.
<span class="grey">Williamson, et. al. Informational [Page 51]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-52" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
SRV RRs
The Server Resource Record (SRV RR), defined for DNS, can be used to
locate the master and slave servers for an authority area. An SRV RR
specifies the location of a network service in an organization's DNS.
It is defined in [<a href="./rfc2052">RFC 2052</a>] as follows.
Service.Proto.Name TTL Class SRV Priority Weight Port Target
Since an authority area identifier is generally a domain name or an
IP address, the RWhois SRV RRs can be added to the DNS file for that
domain or IP address. For example, the RWhois SRV RRs for the
"rwhois.net" authority area could be:
rwhois.tcp.rwhois.net. 86400 IN SRV 10 0 4321 master.rwhois.net.
SRV 20 0 4322 slave.rwhois.net.
where the "master.rwhois.net" server has a higher priority than the
"slave.rwhois.net" server. The client must try to connect to the
server with a higher (lower-numbered) priority.
<span class="h2"><a class="selflink" id="section-4" href="#section-4">4</a>. Security Considerations</span>
RWhois provides security using the guardian class (see <a href="#section-2.3.6">Section</a>
<a href="#section-2.3.6">2.3.6</a>). Any information (meta or data) in an authority area can be
guarded by containing pointers to one or more guardian objects; that
is, it can be securely updated and accessed. Currently, there are two
standard security methods: password and PGP (see <a href="#section-3.3.11">Section 3.3.11</a>).
Password provides authentication only, and PGP provides both
authentication and encryption. PGP is the recommended security
method in RWhois.
The following sections discuss how to securely update and access the
data in an authority area.
<span class="h3"><a class="selflink" id="section-4.1" href="#section-4.1">4.1</a> Data Update</span>
This involves the ability to securely add, modify, or delete some
information (meta or data) in an authority area. An authority area,
on the whole, can be guarded by linking guardians to its SOA and
schema information. Only these guardians should be allowed to add
objects to the authority area and modify its SOA and schema
information. In addition, they can also modify or delete existing
objects in the authority area. However, the function of modifying or
deleting existing objects can be delegated to other guardians by
linking them to objects on a per-object basis.
<span class="grey">Williamson, et. al. Informational [Page 52]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-53" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
<span class="h3"><a class="selflink" id="section-4.2" href="#section-4.2">4.2</a> Access Control</span>
There are two access control issues; the first is the ability to
securely transfer data between the slave and master servers. To
transfer data for an authority area, a slave server can authenticate
itself by satisfying one of the guardians linked to the SOA
information of the authority area at the master server. In addition,
the master server may encrypt the transferred data.
The second issue is the ability to make public only a subset of the
data in an authority area. If all the objects of a particular class
need to be private, the Private attribute of the class should be set
to true. If only some attributes of all the objects of a particular
class need to be private, the Private attribute property of each of
those attributes should be set to true. The guardians of such objects
must be able to view them completely.
<span class="h2"><a class="selflink" id="section-5" href="#section-5">5</a>. Acknowledgments</span>
The authors would like to acknowledge the following individuals.
Stan Borinski
C. Ming Lu
Leslie Meador
Michael Mealling
Greg Pierce
Amar Rao
<span class="h2"><a class="selflink" id="section-6" href="#section-6">6</a>. References</span>
[<a id="ref-CIP">CIP</a>] Allen, J., "The Common Indexing Protocol (CIP)", Bunyip
Information Systems, November 1996, Work in Progress.
[<a id="ref-Guardian">Guardian</a>] Singh, J., M. Kosters, "The InterNIC Guardian Object",
<a href="ftp://rs.internic.net/policy/internic/internic-gen-1.txt">ftp://rs.internic.net/policy/internic/internic-gen-1.txt</a>, Network
Solutions, February 1996.
[<a id="ref-RFC 821">RFC 821</a>] Postel, J., "Simple Mail Transfer Protocol", STD 10, <a href="./rfc821">RFC</a>
<a href="./rfc821">821</a>, ISI, August 1982.
[<a id="ref-RFC 822">RFC 822</a>] Crocker, D, "Standards for the Format of ARPA Internet Text
Messages", STD 11, <a href="./rfc822">RFC 822</a>, University of Delaware, August 1982.
[<a id="ref-RFC 954">RFC 954</a>] Harrenstien, K., Stahl, M., Feinler, E., "NICNAME/WHOIS",
<a href="./rfc954">RFC 954</a>, SRI, October 1985.
[<a id="ref-RFC 1034">RFC 1034</a>] Mockapetris, P. V., "Domain names - concepts and
facilities", STD 13, <a href="./rfc1034">RFC 1034</a>, November 1987.
<span class="grey">Williamson, et. al. Informational [Page 53]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-54" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
[<a id="ref-RFC 1714">RFC 1714</a>] Williamson, S., Kosters, M., "Referral Whois Protocol",
<a href="./rfc1714">RFC 1714</a>, Network Solutions, November 1994.
[<a id="ref-RFC 1738">RFC 1738</a>] T. Berners-Lee, L. Masinter, M. McCahill, "Uniform
Resource Locators (URL)", <a href="./rfc1738">RFC 1738</a>, CERN, Xerox Corporation,
University of Minnesota, December 1994.
[<a id="ref-RFC 1991">RFC 1991</a>] Atkins, D., W. Stallings, P. Zimmermann, "PGP Message
Exchange Formats", <a href="./rfc1991">RFC 1991</a>, MIT, Comp-Comm Consulting, Boulder
Software Engineering, August 1996.
[<a id="ref-RFC 2052">RFC 2052</a>] Gulbrandsen, A., P. Vixie, "A DNS RR for specifying the
location of services (DNS SRV)", <a href="./rfc2052">RFC 2052</a>, Troll Technologies, Vixie
Enterprises, October 1996.
[<a id="ref-X.500">X.500</a>] "The Directory: Overview of Concepts, Models and Service",
CCITT Recommendation X.500, 1988.
Authors' Addresses
Scott Williamson (scottw@rwhois.net)
Mark Kosters (markk@internic.net)
David Blacka (davidb@rwhois.net)
Jasdip Singh (jasdips@rwhois.net)
Koert Zeilstra (kzeil@rwhois.net)
Postal Address:
505 Huntmar Park Drive
Herndon, VA 22070-5100
Telephone: 703-742-0400
<span class="grey">Williamson, et. al. Informational [Page 54]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-55" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
<a href="#appendix-A">Appendix A</a>: Glossary Of Terms
ABNF: Augmented Backus-Naur Form. Refined version of BNF, defined in
[<a href="./rfc822">RFC 822</a>]. See BNF.
Attribute: A named field and the smallest typed unit in a database
schema. See Database Schema.
Authority Area: An autonomous part of an RWhois tree. It is
associated and named after a particular piece of a hierarchy and is
able to state authoritatively whether or not an instance of
hierarchical data is present within the RWhois tree. See RWhois Tree.
Banner: A line sent by a server indicating which protocol versions it
supports and which directives are implemented. This line is issued by
the server after a connection is opened and as a response to the "-
rwhois" directive. See Directive and Response.
Base Class: A class from which all defined classes in a database
schema inherit attributes. See Attribute, Class, and Database Schema.
BNF: Backus-Naur Form. Language to precisely define the syntax of
protocols and computer languages.
Class: A collection of attributes. See Attribute.
Complete Replication: The process of replicating all of the data for
an authority area. See Replication.
Database Schema: A collection of all the classes forming an RWhois
database. See Class.
Directive: A command that a client sends to a server to set a control
parameter for the session, get the meta-information (class
definitions and SOA information) about an authority area, or get the
data in an authority area. See Class and SOA.
Guardian Class: A standard class that contains security information.
An object is guarded by containing a pointer to a guardian object.
See Class and Object.
Incremental Replication: The process of replicating the data that has
changed since the last replication for an authority area. See
Replication.
Info: The miscellaneous information that a server sends to a client.
<span class="grey">Williamson, et. al. Informational [Page 55]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-56" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
Lexically Hierarchical Label: A text string whose position in a
hierarchy is encoded in the string itself.
Link Referral: A pointer to another server that is further down an
RWhois tree. It is used to route a query down the tree. See Referral
and RWhois Tree.
Master Server: A server where the data is registered for an authority
area. It answers authoritatively to queries in the authority area.
It is also called a primary server. See Authority Area.
Namespace: A particular naming system defined by a set of rules
describing the format of a name. Alternately, all of the names
satisfying the rules.
Object: An instance of a class. It is data with a type of <class>.
See Class.
PGP: Pretty Good Privacy. An authentication and encryption scheme.
Primary Server: See Master Server.
Punt Referral: A pointer to another server that is further up an
RWhois tree. It is used to route a query up the tree. See Referral
and RWhois Tree.
Query: A command that a client sends to a server to access the data
in an authority area.
Query Routing: Redirecting a query to another server for resolution.
See Query.
Referral: A pointer to another server that is presumed to be closer
to the desired data. It is used to route a query. See Query Routing.
Referral Class: A standard class that contains referral information
for an authority area. See Class and Referral.
Replication: A server duplicating data from another server on a per-
authority area basis. See Authority Area.
Response: The information that a server returns to a client for a
directive. See Directive.
Result: The information that a server returns to a client for a
query. It can be either the accessed data or referrals to other
servers. See Query and Referral.
<span class="grey">Williamson, et. al. Informational [Page 56]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-57" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
RWhois Tree: A data information tree of RWhois servers where the data
is arranged hierarchically in the authority areas. See Authority
Area.
Schema: See Class.
Secondary Server: See Slave Server.
Slave Server: A server where the data is replicated from the master
server for an authority area. It also answers authoritatively to
queries in the authority area. It is also called a secondary server.
See Master Server.
SOA: Start Of Authority. Administrative variables, defined at the
master server, to control replication for an authority area. See
Master Server and Replication.
Appendix B: RWhois ABNF
This specification uses the Augmented Backus-Naur Form (ABNF)
notation, as defined in <a href="./rfc822#section-2">Section 2 of [RFC 822]</a>.
General Definitions
Lexical Tokens
alpha = "a".."z" / "A".."Z"
digit = "0".."9"
hex-digit = digit / "a".."f" / "A".. "F"
id-char = alpha / digit / "_" / "-"
any-char = <ASCII 1..255,
except LF (linefeed) and CR (carriage return)>
dns-char = alpha / digit / "-"
email-char = <see [<a href="./rfc822">RFC 822</a>]>
space = " "
tab = <ASCII TAB (tab)>
lf = <ASCII LF (linefeed)>
cr = <ASCII CR (carriage return)>
crlf = cr lf
Grammar
year = 4digit
month = 2digit
day = 2digit
hour = 2digit
minute = 2digit
second = 2digit
<span class="grey">Williamson, et. al. Informational [Page 57]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-58" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
milli-second = 3digit
host-name = dns-char *(dns-char / ".")
email = 1*email-char "@" host-name
authority-area = (dns-char / ".") *(dns-char / "." / "/")
object-id = 1*id-char "." authority-area
host-port = (host-name / ip-address) ":" 1*5digit
ip-address = 1*3digit "." 1*3digit "." 1*3digit "." 1*3digit
class-name = 1*id-char
attribute-name = 1*id-char
attribute-value = 1*any-char
time-stamp = year month day hour minute second milli-second
on-off = "on" / "off"
Note that the time-stamp must be in the Greenwich Mean Time (GMT)
time zone.
response = ok-response crlf / error-response crlf / info-response
ok-response = "%ok"
error-response = "%error" space error-code space error-text
error-code = 3digit
error-text = 1*any-char
info-response = "%info" space "on" crlf *(*any-char crlf) "%info"
space "off" crlf
rwhois-banner = "%rwhois" space version-list space host-name
[space implementation] crlf
version-list = version *("," version)
version = version-number [":" capability-id]
/ "V-1.5" ":" capability-id
version-number = "V-" 1*digit "." 1*digit
capability-id = response-id ":" extra-id
response-id = 6hex-digit
extra-id = 2hex-digit
implementation = 1*any-char
rwhois-protocol = client-sends / server-returns
client-sends = *(directives / rwhois-query)
server-returns = *(responses / rwhois-query-result)
directives = rwhois-dir / class-dir / directive-dir / display-dir /
holdconnect-dir / limit-dir / notify-dir / quit-dir /
register-dir / schema-dir / security-dir / soa-dir /
status-dir / xfer-dir / x-dir
<span class="grey">Williamson, et. al. Informational [Page 58]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-59" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
responses = rwhois-response / class-response/ directive-response/
display-response/ holdconnect-response/ limit-response/
notify-response/ quit-response/ register-response/
schema-response / security-response/ soa-response/
status-response/ xfer-response/ x-response
Required Directives
rwhois
rwhois-dir = "-rwhois" space version-number [space implementation]
crlf
rwhois-response = "%rwhois" space version space host-name
[space implementation] crlf
Optional Directives
class
class-dir = "-class" space authority-area *(space class-name) crlf
class-response = *class-record response
class-record = *class-line "%class" crlf
class-line = "%class" space class-name ":" "description" ":"
1*any-char crlf
/ "%class" space class-name ":" "version" ":" time-stamp crlf
/ "%class" space class-name ":" meta-field ":" meta-value crlf
meta-field = 1*id-char
meta-value = 1*any-char
directive
directive-dir = "-directive" *(space directive-name)crlf
directive-name = 1*id-char
directive-response = *directive-record response
directive-record = "%directive" space "directive" ":"
directive-name crlf *directive-line "%directive" crlf
directive-line = "%directive" space "description" ":" 1*any-char crlf
/ "%directive" space attribute-name ":" attribute-value crlf
<span class="grey">Williamson, et. al. Informational [Page 59]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-60" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
display
display-dir = "-display" crlf
/ "-display" space display-name crlf
display-name = 1*id-char
display-response = *display-record response
display-record = "%display" space "name" ":" display-name crlf
*display-line "%display" crlf
display-line = "%display" space attribute-name ":" attribute-value
crlf
holdconnect
holdconnect-dir = "-holdconnect" space on-off crlf
holdconnect-response = response
limit
limit-dir = "-limit" space 1*digit crlf
limit-response = response
notify
notify-dir = "-notify" space "badref" space referral-query crlf
/ "-notify" space "recurref" space referral-query crlf
/ "-notify" space "update" space host-port ":" authority-area
crlf
/ "-notify" space "inssec" space host-port ":" authority-area
crlf
/ "-notify" space "delsec" space host-port ":" authority-area
crlf
referral-query = referral-url space [class-name space] query
notify-response = response
See the query section for the definitions of referral-url and query.
quit
quit-dir = "-quit" crlf
quit-response = response
<span class="grey">Williamson, et. al. Informational [Page 60]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-61" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
register
register-dir = register-on space "add" space maintainer-id crlf
register-add register-off
/ register-on space "mod" space maintainer-id crlf
register-mod register-off
/ register-on space "del" space maintainer-id crlf
register-del register-off
register-on = "-register" space "on"
register-off = "-register" space "off" crlf
register-add = 1*(register-line crlf)
register-mod = 1*(register-line crlf) "_NEW_" crlf
1*(register-line crlf)
register-del = 1*(register-line crlf)
maintainer-id = email
register-line = attribute-name ":" attribute-value
register-on-response = response
register-off-response = "%register" space "ID" ":" object-id crlf
response
/ "%register" space "Updated" ":" time-stamp crlf response
/ response
schema
schema-dir = "-schema" space authority-area *(space class-name) crlf
schema-response = *schema-record response
schema-record = *schema-line "%schema" crlf
schema-line = "%schema" space class-name ":" attribute-name ":"
attribute-value crlf
security
security-dir = "-security" space "on" space direction space
security-method [space security-data] crlf security-payload
["-security" space "off" crlf]
direction = "request" / "response"
security-method = "password" / "pgp" / 1*id-char
security-data = password-data / pgp-data / 1*any-char
password-data = 1*any-char
pgp-data = "signed" / "encrypt" [space key-id] / "signed-encrypt"
[space key-id]
security-payload = *(*any-char crlf)
security-response = response
<span class="grey">Williamson, et. al. Informational [Page 61]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-62" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
soa
soa-dir = "-soa" *(space authority-area) crlf
soa-response = *soa-record response
soa-record = *soa-line "%soa" crlf
soa-line = "%soa" space "authority" ":" authority-area crlf
/ "%soa" space "ttl" ":" 1*digit crlf
/ "%soa" space "serial" ":" time-stamp crlf
/ "%soa" space "refresh" ":" 1*digit crlf
/ "%soa" space "increment" ":" 1*digit crlf
/ "%soa" space "retry" ":" 1*digit crlf
/ "%soa" space "tech-contact" ":" email crlf
/ "%soa" space "admin-contact" ":" email crlf
/ "%soa" space "hostmaster" ":" email crlf
/ "%soa" space "primary" ":" host-port crlf
/ "%soa" space attribute-name ":" attribute-value crlf
status
status-dir = "-status" crlf
status-response = *status-line response
status-line = "%status" space "limit" ":" 1*digit crlf
/ "%status" space "holdconnect" ":" on-off crlf
/ "%status" space "forward" ":" on-off crlf
/ "%status" space "authority" ":" 1*digit crlf
/ "%status" space "display" ":" 1*any-char crlf
/ "%status" space "contact" ":" email crlf
/ "%status" space attribute-name ":" attribute-value crlf
xfer
xfer-dir = "-xfer" space authority-area *attribute-def
[space serial-number] crlf
attribute-def = [space "class=" class-name]
*(space "attribute=" attribute-name)
serial-number = time-stamp
xfer-response = *xfer-record response
xfer-record = *xfer-line "%xfer" crlf
xfer-line = "%xfer" space class-name ":" attribute-name ":"
attribute-value crlf
X
x-dir = "-X-" x-directive [space *[x-arguments]] crlf
x-directive = 1*id-char
x-arguments = *any-char
x-response = *(*any-char crlf) response
<span class="grey">Williamson, et. al. Informational [Page 62]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-63" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
Query
rwhois-query = [class-name space] query crlf
query = query-string / attribute-query / query bin-boolean query
query-char = <any-char, except """, space, tab>
quoted-query-char = query-char / space / tab / "
query-string = 1*query-char ["*"] / """ 1*quoted-query-char ["*"] """
attribute-query = attribute-name "=" query-string
bin-boolean = "and" / "or"
rwhois-query-result = *(query-record / referral-record) response
query-record = 1*query-line crlf
query-line = class-name ":" attribute-name [";" type-char] ":"
attribute-value crlf
type-char = "T" / "I" / "S"
referral-record = 1*(referral-line crlf)
referral-line = "%referral" space referral-url
referral-url = "rwhois" ":" "//" host-port "/" "auth-area="
authority-area
Appendix C: Error Codes
When a server fails to run a command (directive or query), it returns
an error response. The ABNF for an error response is as follows.
error-response = "%error" space error-code space error-text
error-code = 3digit
error-text = 1*any-char
An error text may be modified, but its meaning must remain the same.
The server may append additional information to it, for example
"%error 333 Not master for authority area: foobar.com".
<span class="grey">Williamson, et. al. Informational [Page 63]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-64" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
The following table describes the possible digits in the first,
second, and third positions of an error code.
XXX Description
1XX Information only, no action required
2XX Information, action required
3XX Specific command error, retry that command or try another one
4XX Serious for current command, may correct with another command
5XX Fatal, must disconnect
X0X System wide, no specific command
X1X System wide, no specific command
X2X Registration error
X3X Specific command
X4X Specific command
X5X Specific command
X6X Extended message (version specific)
XXX Sequential order
The following table gives an ordered list of RWhois error codes.
These codes may be extended with implementation- specific codes. An
implementation- specific code must have a "6" in the second position.
Code Text
120 Registration deferred
130 Object not authoritative
230 No objects found
300 Not compatible with version
320 Invalid attribute
321 Invalid attribute syntax
322 Required attribute missing
323 Object reference not found
324 Primary key not unique
325 Failed to update outdated object
330 Exceeded maximum objects limit
331 Invalid limit
332 Nothing to transfer
333 Not master for authority area
336 Object not found
338 Invalid directive syntax
340 Invalid authority area
341 Invalid class
342 Invalid host/port
350 Invalid query syntax
351 Query too complex
352 Invalid security method
353 Authentication failed
354 Encryption failed
400 Directive not available
401 Not authorized for directive
<span class="grey">Williamson, et. al. Informational [Page 64]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-65" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
402 Unidentified error
420 Registration not authorized
436 Invalid display format
500 Memory allocation problem
501 Service not available
502 Unrecoverable error
503 Idle time exceeded
The following error codes, defined in [<a href="./rfc1714">RFC 1714</a>], have been made
obsolete: 100, 200, 231, 334, 335, 337, 421, 431, 432, 433, 434,
460, 461, and 530.
Appendix D: Capability ID
The capability ID encodes which directives are implemented in the
server. To create a capability ID, perform a logical OR on all the
hexadecimal numbers corresponding to the implemented directives. The
resulting number is used in the banner, which is sent by the server
after opening a connection and as a response to the "-rwhois"
directive. The eight most significant bits of the capability ID are
reserved for future use:
class 000001h
directive 000002h
display 000004h
forward 000008h
holdconnect 000010h
limit 000020h
notify 000040h
quit 000080h
register 000100h
schema 000200h
security 000400h
soa 000800h
status 001000h
xfer 002000h
X 004000h
<span class="grey">Williamson, et. al. Informational [Page 65]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-66" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
Appendix E: Schema Definitions
Attribute Definition Model
Name Type Description
Attribute N This is the name of the attribute.
Description S This is a free-form description of the attribute.
Type T This is a parameter that broadly indicates the use
of the attribute to the protocol. There are three
standard types: TEXT, ID, and SEE-ALSO. The default
is TEXT, which indicates that the value is a text
string. ID indicates that the attribute contains
the ID of another RWhois object. This type of
attribute is used for database normalization. SEE-
ALSO indicates that the attribute contains a pointer
(a Uniform Resource Identifier (URI)) to some other
kind of external data; for example, a World Wide Web
page or FTP site.
Format S This is an interpretable string that describes the
acceptance format of the value. The server (and
optionally the client) should match the value to the
format string to determine if the value is
acceptable. The format of this property is a
keyword indicating the syntax of the format string,
followed by a colon, followed by the format string
itself. Currently, the only keyword recognized is
"re" for POSIX.2 extended regular expressions.
Indexed B This is a true or false flag that indicates that
this attribute should be indexed (and therefore able
to be searched).
Required B This is a true or false flag that indicates that
this attribute must have a value.
Multi-Line B This is a true or false flag that indicates that
this attribute may have multiple instances in an
object; all the instances are to be considered as
multiple lines of the same attribute instance.
<span class="grey">Williamson, et. al. Informational [Page 66]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-67" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
Repeatable B This is a true or false flag that indicates that
there may be multiple instances of this attribute in
a class and each instance is to be interpreted as a
separate instance (in contrast to Multi-Line). This
flag is mutually exclusive with Multi-Line: if
Multi-Line is true, then Repeatable must be false
and vice versa.
Primary B This is a true or false flag that indicates that
this attribute is a primary key. If more than one
attribute in a class is marked as primary, then
these attributes together form a single primary key.
The primary key is intended to be used to force
uniqueness among class instances. Therefore, there
can be only one instance of a primary key in a
database. The Primary flag implies that the
attribute is also required.
Hierarchical B This is a true or false flag that indicates that
this attribute is lexically hierarchical.
Private B This is a true or false flag that indicates whether
or not this attribute is private (that is, publicly
not viewable). It defaults to false. If it is true,
then only the clients that satisfy the
authentication/encryption requirements of a guardian
are able to view the attribute-value pair.
<span class="grey">Williamson, et. al. Informational [Page 67]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-68" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
Type is defined as follows:
Type ABNF Definition
B "ON" / "OFF"
N 1*id-char
S 1*any-char
T "ID" / "SEE-ALSO" / "TEXT"
Base Class
Name Type Required RepeatableDescription
Class-Name TEXT Y N This attribute is the name of the
class to which the object
belongs.
Auth-Area TEXT Y N This attribute is the name of the
authority area to which the
object belongs.
ID TEXT Y N This attribute is the universal
identifier of the object.
Updated TEXT Y N This attribute is a time/date
stamp that indicates the time of
last modification of the object.
Guardian ID N Y This attribute is a link to a
guardian object. Its value is the
ID of a guardian object.
Private TEXT N N This attribute is a true or false
flag that indicates whether or
not an object is private (that
is, publicly not viewable). It
defaults to false. If it is
true, then only the clients
that satisfy the
authentication/encryption
requirements of one of the
object's guardians are able to
view the object. If the object
is publicly viewable, then the
Private attribute property of
each of its attributes still
applies.
<span class="grey">Williamson, et. al. Informational [Page 68]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-69" ></span>
<span class="grey"><a href="./rfc2167">RFC 2167</a> RWhois Protocol June 1997</span>
TTL TEXT N N This attribute is the
"time-to-live" of a given object.
It is included only if an object
has a different time-to-live than
the default given in the Start of
Authority information. Its value
is specified in seconds.
Appendix F: Changes RWhois V1.0 - V1.5
General
* Multiple authority areas per server.
* Data replication.
* Revised schema model.
* Revised query routing rules.
* Revised error codes.
* Removed unnecessary spaces in responses and results.
Directives
* Class: New. Returns meta-information for a class.
* Display: Can return supported display formats.
* Load: Obsolete.
* Notify: Syntax change.
* Private: Obsolete.
* Register: Syntax change.
* Schema: Syntax change.
* Security: Obsoletes Private.
* Xfer: Syntax change.
Query
* Display option removed.
* Output format: Only the dump format is standard; optional type
character added.
* Attribute-restricted query.
* Revised referral syntax.
Williamson, et. al. Informational [Page 69]
</pre>
|