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 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527
|
<!DOCTYPE html>
<html lang="en" class="RFC">
<head>
<meta charset="utf-8">
<meta content="Common,Latin" name="scripts">
<meta content="initial-scale=1.0" name="viewport">
<title>RFC 8895: Application-Layer Traffic Optimization (ALTO) Incremental Updates Using Server-Sent Events (SSE)</title>
<meta content="Wendy Roome" name="author">
<meta content="Y. Richard Yang" name="author">
<meta content="
The Application-Layer Traffic Optimization (ALTO) protocol (RFC 7285)
provides network-related information, called
network information resources, to client applications so that clients
can make informed decisions in utilizing network resources.
This document presents a mechanism to allow an ALTO server to push
updates to ALTO clients to achieve two benefits: (1) updates can be
incremental, in that if only a small section of an information
resource changes, the ALTO server can send just the changes and (2)
updates can be immediate, in that the ALTO server can send updates
as soon as they are available.
" name="description">
<meta content="xml2rfc 3.4.0" name="generator">
<meta content="ALTO" name="keyword">
<meta content="8895" name="rfc.number">
<!-- Generator version information:
xml2rfc 3.4.0
Python 3.6.10
appdirs 1.4.4
ConfigArgParse 1.2.3
google-i18n-address 2.3.5
html5lib 1.0.1
intervaltree 3.0.2
Jinja2 2.11.2
kitchen 1.2.6
lxml 4.4.2
pycairo 1.19.0
pycountry 19.8.18
pyflakes 2.1.1
PyYAML 5.3.1
requests 2.22.0
setuptools 40.6.2
six 1.14.0
WeasyPrint 51
-->
<link href="rfc8895.xml" rel="alternate" type="application/rfc+xml">
<link href="#copyright" rel="license">
<style type="text/css">/*
NOTE: Changes at the bottom of this file overrides some earlier settings.
Once the style has stabilized and has been adopted as an official RFC style,
this can be consolidated so that style settings occur only in one place, but
for now the contents of this file consists first of the initial CSS work as
provided to the RFC Formatter (xml2rfc) work, followed by itemized and
commented changes found necssary during the development of the v3
formatters.
*/
/* fonts */
@import url('https://fonts.googleapis.com/css?family=Noto+Sans'); /* Sans-serif */
@import url('https://fonts.googleapis.com/css?family=Noto+Serif'); /* Serif (print) */
@import url('https://fonts.googleapis.com/css?family=Roboto+Mono'); /* Monospace */
@viewport {
zoom: 1.0;
width: extend-to-zoom;
}
@-ms-viewport {
width: extend-to-zoom;
zoom: 1.0;
}
/* general and mobile first */
html {
}
body {
max-width: 90%;
margin: 1.5em auto;
color: #222;
background-color: #fff;
font-size: 14px;
font-family: 'Noto Sans', Arial, Helvetica, sans-serif;
line-height: 1.6;
scroll-behavior: smooth;
}
.ears {
display: none;
}
/* headings */
#title, h1, h2, h3, h4, h5, h6 {
margin: 1em 0 0.5em;
font-weight: bold;
line-height: 1.3;
}
#title {
clear: both;
border-bottom: 1px solid #ddd;
margin: 0 0 0.5em 0;
padding: 1em 0 0.5em;
}
.author {
padding-bottom: 4px;
}
h1 {
font-size: 26px;
margin: 1em 0;
}
h2 {
font-size: 22px;
margin-top: -20px; /* provide offset for in-page anchors */
padding-top: 33px;
}
h3 {
font-size: 18px;
margin-top: -36px; /* provide offset for in-page anchors */
padding-top: 42px;
}
h4 {
font-size: 16px;
margin-top: -36px; /* provide offset for in-page anchors */
padding-top: 42px;
}
h5, h6 {
font-size: 14px;
}
#n-copyright-notice {
border-bottom: 1px solid #ddd;
padding-bottom: 1em;
margin-bottom: 1em;
}
/* general structure */
p {
padding: 0;
margin: 0 0 1em 0;
text-align: left;
}
div, span {
position: relative;
}
div {
margin: 0;
}
.alignRight.art-text {
background-color: #f9f9f9;
border: 1px solid #eee;
border-radius: 3px;
padding: 1em 1em 0;
margin-bottom: 1.5em;
}
.alignRight.art-text pre {
padding: 0;
}
.alignRight {
margin: 1em 0;
}
.alignRight > *:first-child {
border: none;
margin: 0;
float: right;
clear: both;
}
.alignRight > *:nth-child(2) {
clear: both;
display: block;
border: none;
}
svg {
display: block;
}
.alignCenter.art-text {
background-color: #f9f9f9;
border: 1px solid #eee;
border-radius: 3px;
padding: 1em 1em 0;
margin-bottom: 1.5em;
}
.alignCenter.art-text pre {
padding: 0;
}
.alignCenter {
margin: 1em 0;
}
.alignCenter > *:first-child {
border: none;
/* this isn't optimal, but it's an existence proof. PrinceXML doesn't
support flexbox yet.
*/
display: table;
margin: 0 auto;
}
/* lists */
ol, ul {
padding: 0;
margin: 0 0 1em 2em;
}
ol ol, ul ul, ol ul, ul ol {
margin-left: 1em;
}
li {
margin: 0 0 0.25em 0;
}
.ulCompact li {
margin: 0;
}
ul.empty, .ulEmpty {
list-style-type: none;
}
ul.empty li, .ulEmpty li {
margin-top: 0.5em;
}
ul.compact, .ulCompact,
ol.compact, .olCompact {
line-height: 100%;
margin: 0 0 0 2em;
}
/* definition lists */
dl {
}
dl > dt {
float: left;
margin-right: 1em;
}
/*
dl.nohang > dt {
float: none;
}
*/
dl > dd {
margin-bottom: .8em;
min-height: 1.3em;
}
dl.compact > dd, .dlCompact > dd {
margin-bottom: 0em;
}
dl > dd > dl {
margin-top: 0.5em;
margin-bottom: 0em;
}
/* links */
a {
text-decoration: none;
}
a[href] {
color: #22e; /* Arlen: WCAG 2019 */
}
a[href]:hover {
background-color: #f2f2f2;
}
figcaption a[href],
a[href].selfRef {
color: #222;
}
/* XXX probably not this:
a.selfRef:hover {
background-color: transparent;
cursor: default;
} */
/* Figures */
tt, code, pre, code {
background-color: #f9f9f9;
font-family: 'Roboto Mono', monospace;
}
pre {
border: 1px solid #eee;
margin: 0;
padding: 1em;
}
img {
max-width: 100%;
}
figure {
margin: 0;
}
figure blockquote {
margin: 0.8em 0.4em 0.4em;
}
figcaption {
font-style: italic;
margin: 0 0 1em 0;
}
@media screen {
pre {
overflow-x: auto;
max-width: 100%;
max-width: calc(100% - 22px);
}
}
/* aside, blockquote */
aside, blockquote {
margin-left: 0;
padding: 1.2em 2em;
}
blockquote {
background-color: #f9f9f9;
color: #111; /* Arlen: WCAG 2019 */
border: 1px solid #ddd;
border-radius: 3px;
margin: 1em 0;
}
cite {
display: block;
text-align: right;
font-style: italic;
}
/* tables */
table {
width: 100%;
margin: 0 0 1em;
border-collapse: collapse;
border: 1px solid #eee;
}
th, td {
text-align: left;
vertical-align: top;
padding: 0.5em 0.75em;
}
th {
text-align: left;
background-color: #e9e9e9;
}
tr:nth-child(2n+1) > td {
background-color: #f5f5f5;
}
table caption {
font-style: italic;
margin: 0;
padding: 0;
text-align: left;
}
table p {
/* XXX to avoid bottom margin on table row signifiers. If paragraphs should
be allowed within tables more generally, it would be far better to select on a class. */
margin: 0;
}
/* pilcrow */
a.pilcrow {
color: #666; /* Arlen: AHDJ 2019 */
text-decoration: none;
visibility: hidden;
user-select: none;
-ms-user-select: none;
-o-user-select:none;
-moz-user-select: none;
-khtml-user-select: none;
-webkit-user-select: none;
-webkit-touch-callout: none;
}
@media screen {
aside:hover > a.pilcrow,
p:hover > a.pilcrow,
blockquote:hover > a.pilcrow,
div:hover > a.pilcrow,
li:hover > a.pilcrow,
pre:hover > a.pilcrow {
visibility: visible;
}
a.pilcrow:hover {
background-color: transparent;
}
}
/* misc */
hr {
border: 0;
border-top: 1px solid #eee;
}
.bcp14 {
font-variant: small-caps;
}
.role {
font-variant: all-small-caps;
}
/* info block */
#identifiers {
margin: 0;
font-size: 0.9em;
}
#identifiers dt {
width: 3em;
clear: left;
}
#identifiers dd {
float: left;
margin-bottom: 0;
}
#identifiers .authors .author {
display: inline-block;
margin-right: 1.5em;
}
#identifiers .authors .org {
font-style: italic;
}
/* The prepared/rendered info at the very bottom of the page */
.docInfo {
color: #666; /* Arlen: WCAG 2019 */
font-size: 0.9em;
font-style: italic;
margin-top: 2em;
}
.docInfo .prepared {
float: left;
}
.docInfo .prepared {
float: right;
}
/* table of contents */
#toc {
padding: 0.75em 0 2em 0;
margin-bottom: 1em;
}
nav.toc ul {
margin: 0 0.5em 0 0;
padding: 0;
list-style: none;
}
nav.toc li {
line-height: 1.3em;
margin: 0.75em 0;
padding-left: 1.2em;
text-indent: -1.2em;
}
/* references */
.references dt {
text-align: right;
font-weight: bold;
min-width: 7em;
}
.references dd {
margin-left: 8em;
overflow: auto;
}
.refInstance {
margin-bottom: 1.25em;
}
.references .ascii {
margin-bottom: 0.25em;
}
/* index */
.index ul {
margin: 0 0 0 1em;
padding: 0;
list-style: none;
}
.index ul ul {
margin: 0;
}
.index li {
margin: 0;
text-indent: -2em;
padding-left: 2em;
padding-bottom: 5px;
}
.indexIndex {
margin: 0.5em 0 1em;
}
.index a {
font-weight: 700;
}
/* make the index two-column on all but the smallest screens */
@media (min-width: 600px) {
.index ul {
-moz-column-count: 2;
-moz-column-gap: 20px;
}
.index ul ul {
-moz-column-count: 1;
-moz-column-gap: 0;
}
}
/* authors */
address.vcard {
font-style: normal;
margin: 1em 0;
}
address.vcard .nameRole {
font-weight: 700;
margin-left: 0;
}
address.vcard .label {
font-family: "Noto Sans",Arial,Helvetica,sans-serif;
margin: 0.5em 0;
}
address.vcard .type {
display: none;
}
.alternative-contact {
margin: 1.5em 0 1em;
}
hr.addr {
border-top: 1px dashed;
margin: 0;
color: #ddd;
max-width: calc(100% - 16px);
}
/* temporary notes */
.rfcEditorRemove::before {
position: absolute;
top: 0.2em;
right: 0.2em;
padding: 0.2em;
content: "The RFC Editor will remove this note";
color: #9e2a00; /* Arlen: WCAG 2019 */
background-color: #ffd; /* Arlen: WCAG 2019 */
}
.rfcEditorRemove {
position: relative;
padding-top: 1.8em;
background-color: #ffd; /* Arlen: WCAG 2019 */
border-radius: 3px;
}
.cref {
background-color: #ffd; /* Arlen: WCAG 2019 */
padding: 2px 4px;
}
.crefSource {
font-style: italic;
}
/* alternative layout for smaller screens */
@media screen and (max-width: 1023px) {
body {
padding-top: 2em;
}
#title {
padding: 1em 0;
}
h1 {
font-size: 24px;
}
h2 {
font-size: 20px;
margin-top: -18px; /* provide offset for in-page anchors */
padding-top: 38px;
}
#identifiers dd {
max-width: 60%;
}
#toc {
position: fixed;
z-index: 2;
top: 0;
right: 0;
padding: 0;
margin: 0;
background-color: inherit;
border-bottom: 1px solid #ccc;
}
#toc h2 {
margin: -1px 0 0 0;
padding: 4px 0 4px 6px;
padding-right: 1em;
min-width: 190px;
font-size: 1.1em;
text-align: right;
background-color: #444;
color: white;
cursor: pointer;
}
#toc h2::before { /* css hamburger */
float: right;
position: relative;
width: 1em;
height: 1px;
left: -164px;
margin: 6px 0 0 0;
background: white none repeat scroll 0 0;
box-shadow: 0 4px 0 0 white, 0 8px 0 0 white;
content: "";
}
#toc nav {
display: none;
padding: 0.5em 1em 1em;
overflow: auto;
height: calc(100vh - 48px);
border-left: 1px solid #ddd;
}
}
/* alternative layout for wide screens */
@media screen and (min-width: 1024px) {
body {
max-width: 724px;
margin: 42px auto;
padding-left: 1.5em;
padding-right: 29em;
}
#toc {
position: fixed;
top: 42px;
right: 42px;
width: 25%;
margin: 0;
padding: 0 1em;
z-index: 1;
}
#toc h2 {
border-top: none;
border-bottom: 1px solid #ddd;
font-size: 1em;
font-weight: normal;
margin: 0;
padding: 0.25em 1em 1em 0;
}
#toc nav {
display: block;
height: calc(90vh - 84px);
bottom: 0;
padding: 0.5em 0 0;
overflow: auto;
}
img { /* future proofing */
max-width: 100%;
height: auto;
}
}
/* pagination */
@media print {
body {
width: 100%;
}
p {
orphans: 3;
widows: 3;
}
#n-copyright-notice {
border-bottom: none;
}
#toc, #n-introduction {
page-break-before: always;
}
#toc {
border-top: none;
padding-top: 0;
}
figure, pre {
page-break-inside: avoid;
}
figure {
overflow: scroll;
}
h1, h2, h3, h4, h5, h6 {
page-break-after: avoid;
}
h2+*, h3+*, h4+*, h5+*, h6+* {
page-break-before: avoid;
}
pre {
white-space: pre-wrap;
word-wrap: break-word;
font-size: 10pt;
}
table {
border: 1px solid #ddd;
}
td {
border-top: 1px solid #ddd;
}
}
/* This is commented out here, as the string-set: doesn't
pass W3C validation currently */
/*
.ears thead .left {
string-set: ears-top-left content();
}
.ears thead .center {
string-set: ears-top-center content();
}
.ears thead .right {
string-set: ears-top-right content();
}
.ears tfoot .left {
string-set: ears-bottom-left content();
}
.ears tfoot .center {
string-set: ears-bottom-center content();
}
.ears tfoot .right {
string-set: ears-bottom-right content();
}
*/
@page :first {
padding-top: 0;
@top-left {
content: normal;
border: none;
}
@top-center {
content: normal;
border: none;
}
@top-right {
content: normal;
border: none;
}
}
@page {
size: A4;
margin-bottom: 45mm;
padding-top: 20px;
/* The follwing is commented out here, but set appropriately by in code, as
the content depends on the document */
/*
@top-left {
content: 'Internet-Draft';
vertical-align: bottom;
border-bottom: solid 1px #ccc;
}
@top-left {
content: string(ears-top-left);
vertical-align: bottom;
border-bottom: solid 1px #ccc;
}
@top-center {
content: string(ears-top-center);
vertical-align: bottom;
border-bottom: solid 1px #ccc;
}
@top-right {
content: string(ears-top-right);
vertical-align: bottom;
border-bottom: solid 1px #ccc;
}
@bottom-left {
content: string(ears-bottom-left);
vertical-align: top;
border-top: solid 1px #ccc;
}
@bottom-center {
content: string(ears-bottom-center);
vertical-align: top;
border-top: solid 1px #ccc;
}
@bottom-right {
content: '[Page ' counter(page) ']';
vertical-align: top;
border-top: solid 1px #ccc;
}
*/
}
/* Changes introduced to fix issues found during implementation */
/* Make sure links are clickable even if overlapped by following H* */
a {
z-index: 2;
}
/* Separate body from document info even without intervening H1 */
section {
clear: both;
}
/* Top align author divs, to avoid names without organization dropping level with org names */
.author {
vertical-align: top;
}
/* Leave room in document info to show Internet-Draft on one line */
#identifiers dt {
width: 8em;
}
/* Don't waste quite as much whitespace between label and value in doc info */
#identifiers dd {
margin-left: 1em;
}
/* Give floating toc a background color (needed when it's a div inside section */
#toc {
background-color: white;
}
/* Make the collapsed ToC header render white on gray also when it's a link */
@media screen and (max-width: 1023px) {
#toc h2 a,
#toc h2 a:link,
#toc h2 a:focus,
#toc h2 a:hover,
#toc a.toplink,
#toc a.toplink:hover {
color: white;
background-color: #444;
text-decoration: none;
}
}
/* Give the bottom of the ToC some whitespace */
@media screen and (min-width: 1024px) {
#toc {
padding: 0 0 1em 1em;
}
}
/* Style section numbers with more space between number and title */
.section-number {
padding-right: 0.5em;
}
/* prevent monospace from becoming overly large */
tt, code, pre, code {
font-size: 95%;
}
/* Fix the height/width aspect for ascii art*/
pre.sourcecode,
.art-text pre {
line-height: 1.12;
}
/* Add styling for a link in the ToC that points to the top of the document */
a.toplink {
float: right;
margin-right: 0.5em;
}
/* Fix the dl styling to match the RFC 7992 attributes */
dl > dt,
dl.dlParallel > dt {
float: left;
margin-right: 1em;
}
dl.dlNewline > dt {
float: none;
}
/* Provide styling for table cell text alignment */
table td.text-left,
table th.text-left {
text-align: left;
}
table td.text-center,
table th.text-center {
text-align: center;
}
table td.text-right,
table th.text-right {
text-align: right;
}
/* Make the alternative author contact informatio look less like just another
author, and group it closer with the primary author contact information */
.alternative-contact {
margin: 0.5em 0 0.25em 0;
}
address .non-ascii {
margin: 0 0 0 2em;
}
/* With it being possible to set tables with alignment
left, center, and right, { width: 100%; } does not make sense */
table {
width: auto;
}
/* Avoid reference text that sits in a block with very wide left margin,
because of a long floating dt label.*/
.references dd {
overflow: visible;
}
/* Control caption placement */
caption {
caption-side: bottom;
}
/* Limit the width of the author address vcard, so names in right-to-left
script don't end up on the other side of the page. */
address.vcard {
max-width: 30em;
margin-right: auto;
}
/* For address alignment dependent on LTR or RTL scripts */
address div.left {
text-align: left;
}
address div.right {
text-align: right;
}
/* Provide table alignment support. We can't use the alignX classes above
since they do unwanted things with caption and other styling. */
table.right {
margin-left: auto;
margin-right: 0;
}
table.center {
margin-left: auto;
margin-right: auto;
}
table.left {
margin-left: 0;
margin-right: auto;
}
/* Give the table caption label the same styling as the figcaption */
caption a[href] {
color: #222;
}
@media print {
.toplink {
display: none;
}
/* avoid overwriting the top border line with the ToC header */
#toc {
padding-top: 1px;
}
/* Avoid page breaks inside dl and author address entries */
.vcard {
page-break-inside: avoid;
}
}
/* Tweak the bcp14 keyword presentation */
.bcp14 {
font-variant: small-caps;
font-weight: bold;
font-size: 0.9em;
}
/* Tweak the invisible space above H* in order not to overlay links in text above */
h2 {
margin-top: -18px; /* provide offset for in-page anchors */
padding-top: 31px;
}
h3 {
margin-top: -18px; /* provide offset for in-page anchors */
padding-top: 24px;
}
h4 {
margin-top: -18px; /* provide offset for in-page anchors */
padding-top: 24px;
}
/* Float artwork pilcrow to the right */
@media screen {
.artwork a.pilcrow {
display: block;
line-height: 0.7;
margin-top: 0.15em;
}
}
/* Make pilcrows on dd visible */
@media screen {
dd:hover > a.pilcrow {
visibility: visible;
}
}
/* Make the placement of figcaption match that of a table's caption
by removing the figure's added bottom margin */
.alignLeft.art-text,
.alignCenter.art-text,
.alignRight.art-text {
margin-bottom: 0;
}
.alignLeft,
.alignCenter,
.alignRight {
margin: 1em 0 0 0;
}
/* In print, the pilcrow won't show on hover, so prevent it from taking up space,
possibly even requiring a new line */
@media print {
a.pilcrow {
display: none;
}
}
/* Styling for the external metadata */
div#external-metadata {
background-color: #eee;
padding: 0.5em;
margin-bottom: 0.5em;
display: none;
}
div#internal-metadata {
padding: 0.5em; /* to match the external-metadata padding */
}
/* Styling for title RFC Number */
h1#rfcnum {
clear: both;
margin: 0 0 -1em;
padding: 1em 0 0 0;
}
/* Make .olPercent look the same as <ol><li> */
dl.olPercent > dd {
margin-bottom: 0.25em;
min-height: initial;
}
/* Give aside some styling to set it apart */
aside {
border-left: 1px solid #ddd;
margin: 1em 0 1em 2em;
padding: 0.2em 2em;
}
aside > dl,
aside > ol,
aside > ul,
aside > table,
aside > p {
margin-bottom: 0.5em;
}
/* Additional page break settings */
@media print {
figcaption, table caption {
page-break-before: avoid;
}
}
/* Font size adjustments for print */
@media print {
body { font-size: 10pt; line-height: normal; max-width: 96%; }
h1 { font-size: 1.72em; padding-top: 1.5em; } /* 1*1.2*1.2*1.2 */
h2 { font-size: 1.44em; padding-top: 1.5em; } /* 1*1.2*1.2 */
h3 { font-size: 1.2em; padding-top: 1.5em; } /* 1*1.2 */
h4 { font-size: 1em; padding-top: 1.5em; }
h5, h6 { font-size: 1em; margin: initial; padding: 0.5em 0 0.3em; }
}
/* Sourcecode margin in print, when there's no pilcrow */
@media print {
.artwork,
.sourcecode {
margin-bottom: 1em;
}
}
/* Avoid narrow tables forcing too narrow table captions, which may render badly */
table {
min-width: 20em;
}
/* ol type a */
ol.type-a { list-style-type: lower-alpha; }
ol.type-A { list-style-type: upper-alpha; }
ol.type-i { list-style-type: lower-roman; }
ol.type-I { list-style-type: lower-roman; }
/* Apply the print table and row borders in general, on request from the RPC,
and increase the contrast between border and odd row background sligthtly */
table {
border: 1px solid #ddd;
}
td {
border-top: 1px solid #ddd;
}
tr:nth-child(2n+1) > td {
background-color: #f8f8f8;
}
/* Use style rules to govern display of the TOC. */
@media screen and (max-width: 1023px) {
#toc nav { display: none; }
#toc.active nav { display: block; }
}
/* Add support for keepWithNext */
.keepWithNext {
break-after: avoid-page;
break-after: avoid-page;
}
/* Add support for keepWithPrevious */
.keepWithPrevious {
break-before: avoid-page;
}
/* Change the approach to avoiding breaks inside artwork etc. */
figure, pre, table, .artwork, .sourcecode {
break-before: avoid-page;
break-after: auto;
}
/* Avoid breaks between <dt> and <dd> */
dl {
break-before: auto;
break-inside: auto;
}
dt {
break-before: auto;
break-after: avoid-page;
}
dd {
break-before: avoid-page;
break-after: auto;
orphans: 3;
widows: 3
}
span.break, dd.break {
margin-bottom: 0;
min-height: 0;
break-before: auto;
break-inside: auto;
break-after: auto;
}
/* Undo break-before ToC */
@media print {
#toc {
break-before: auto;
}
}
/* Text in compact lists should not get extra bottim margin space,
since that would makes the list not compact */
ul.compact p, .ulCompact p,
ol.compact p, .olCompact p {
margin: 0;
}
/* But the list as a whole needs the extra space at the end */
section ul.compact,
section .ulCompact,
section ol.compact,
section .olCompact {
margin-bottom: 1em; /* same as p not within ul.compact etc. */
}
/* The tt and code background above interferes with for instance table cell
backgrounds. Changed to something a bit more selective. */
tt, code {
background-color: transparent;
}
p tt, p code, li tt, li code {
background-color: #f8f8f8;
}
/* Tweak the pre margin -- 0px doesn't come out well */
pre {
margin-top: 0.5px;
}
/* Tweak the comact list text */
ul.compact, .ulCompact,
ol.compact, .olCompact,
dl.compact, .dlCompact {
line-height: normal;
}
/* Don't add top margin for nested lists */
li > ul, li > ol, li > dl,
dd > ul, dd > ol, dd > dl,
dl > dd > dl {
margin-top: initial;
}
/* Elements that should not be rendered on the same line as a <dt> */
/* This should match the element list in writer.text.TextWriter.render_dl() */
dd > div.artwork:first-child,
dd > aside:first-child,
dd > figure:first-child,
dd > ol:first-child,
dd > div:first-child > pre.sourcecode,
dd > table:first-child,
dd > ul:first-child {
clear: left;
}
/* fix for weird browser behaviour when <dd/> is empty */
dt+dd:empty::before{
content: "\00a0";
}
</style>
<link href="rfc-local.css" rel="stylesheet" type="text/css">
<link href="https://dx.doi.org/10.17487/rfc8895" rel="alternate">
<link href="urn:issn:2070-1721" rel="alternate">
<link href="https://datatracker.ietf.org/doc/draft-ietf-alto-incr-update-sse-22" rel="prev">
</head>
<body>
<script src="https://www.rfc-editor.org/js/metadata.min.js"></script>
<table class="ears">
<thead><tr>
<td class="left">RFC 8895</td>
<td class="center">ALTO Incremental Updates</td>
<td class="right">November 2020</td>
</tr></thead>
<tfoot><tr>
<td class="left">Roome & Yang</td>
<td class="center">Standards Track</td>
<td class="right">[Page]</td>
</tr></tfoot>
</table>
<div id="external-metadata" class="document-information"></div>
<div id="internal-metadata" class="document-information">
<dl id="identifiers">
<dt class="label-stream">Stream:</dt>
<dd class="stream">Internet Engineering Task Force (IETF)</dd>
<dt class="label-rfc">RFC:</dt>
<dd class="rfc"><a href="https://www.rfc-editor.org/rfc/rfc8895" class="eref">8895</a></dd>
<dt class="label-category">Category:</dt>
<dd class="category">Standards Track</dd>
<dt class="label-published">Published:</dt>
<dd class="published">
<time datetime="2020-11" class="published">November 2020</time>
</dd>
<dt class="label-issn">ISSN:</dt>
<dd class="issn">2070-1721</dd>
<dt class="label-authors">Authors:</dt>
<dd class="authors">
<div class="author">
<div class="author-name">W. Roome</div>
<div class="org">Nokia Bell Labs</div>
</div>
<div class="author">
<div class="author-name">Y. Yang</div>
<div class="org">Yale University</div>
</div>
</dd>
</dl>
</div>
<h1 id="rfcnum">RFC 8895</h1>
<h1 id="title">Application-Layer Traffic Optimization (ALTO) Incremental Updates Using Server-Sent Events (SSE)</h1>
<section id="section-abstract">
<h2 id="abstract"><a href="#abstract" class="selfRef">Abstract</a></h2>
<p id="section-abstract-1">The Application-Layer Traffic Optimization (ALTO) protocol (RFC 7285)
provides network-related information, called
network information resources, to client applications so that clients
can make informed decisions in utilizing network resources.
This document presents a mechanism to allow an ALTO server to push
updates to ALTO clients to achieve two benefits: (1) updates can be
incremental, in that if only a small section of an information
resource changes, the ALTO server can send just the changes and (2)
updates can be immediate, in that the ALTO server can send updates
as soon as they are available.<a href="#section-abstract-1" class="pilcrow">¶</a></p>
</section>
<div id="status-of-memo">
<section id="section-boilerplate.1">
<h2 id="name-status-of-this-memo">
<a href="#name-status-of-this-memo" class="section-name selfRef">Status of This Memo</a>
</h2>
<p id="section-boilerplate.1-1">
This is an Internet Standards Track document.<a href="#section-boilerplate.1-1" class="pilcrow">¶</a></p>
<p id="section-boilerplate.1-2">
This document is a product of the Internet Engineering Task Force
(IETF). It represents the consensus of the IETF community. It has
received public review and has been approved for publication by
the Internet Engineering Steering Group (IESG). Further
information on Internet Standards is available in Section 2 of
RFC 7841.<a href="#section-boilerplate.1-2" class="pilcrow">¶</a></p>
<p id="section-boilerplate.1-3">
Information about the current status of this document, any
errata, and how to provide feedback on it may be obtained at
<span><a href="https://www.rfc-editor.org/info/rfc8895">https://www.rfc-editor.org/info/rfc8895</a></span>.<a href="#section-boilerplate.1-3" class="pilcrow">¶</a></p>
</section>
</div>
<div id="copyright">
<section id="section-boilerplate.2">
<h2 id="name-copyright-notice">
<a href="#name-copyright-notice" class="section-name selfRef">Copyright Notice</a>
</h2>
<p id="section-boilerplate.2-1">
Copyright (c) 2020 IETF Trust and the persons identified as the
document authors. All rights reserved.<a href="#section-boilerplate.2-1" class="pilcrow">¶</a></p>
<p id="section-boilerplate.2-2">
This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents
(<span><a href="https://trustee.ietf.org/license-info">https://trustee.ietf.org/license-info</a></span>) in effect on the date of
publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with
respect to this document. Code Components extracted from this
document must include Simplified BSD License text as described in
Section 4.e of the Trust Legal Provisions and are provided without
warranty as described in the Simplified BSD License.<a href="#section-boilerplate.2-2" class="pilcrow">¶</a></p>
</section>
</div>
<div id="toc">
<section id="section-toc.1">
<a href="#" onclick="scroll(0,0)" class="toplink">▲</a><h2 id="name-table-of-contents">
<a href="#name-table-of-contents" class="section-name selfRef">Table of Contents</a>
</h2>
<nav class="toc"><ul class="ulEmpty compact toc">
<li class="ulEmpty compact toc" id="section-toc.1-1.1">
<p id="section-toc.1-1.1.1" class="keepWithNext"><a href="#section-1" class="xref">1</a>. <a href="#name-introduction" class="xref">Introduction</a><a href="#section-toc.1-1.1.1" class="pilcrow">¶</a></p>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.2">
<p id="section-toc.1-1.2.1" class="keepWithNext"><a href="#section-2" class="xref">2</a>. <a href="#name-terms" class="xref">Terms</a><a href="#section-toc.1-1.2.1" class="pilcrow">¶</a></p>
<ul class="ulEmpty compact toc">
<li class="ulEmpty compact toc" id="section-toc.1-1.2.2.1">
<p id="section-toc.1-1.2.2.1.1" class="keepWithNext"><a href="#section-2.1" class="xref">2.1</a>. <a href="#name-requirements-language" class="xref">Requirements Language</a><a href="#section-toc.1-1.2.2.1.1" class="pilcrow">¶</a></p>
</li>
</ul>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.3">
<p id="section-toc.1-1.3.1"><a href="#section-3" class="xref">3</a>. <a href="#name-background" class="xref">Background</a><a href="#section-toc.1-1.3.1" class="pilcrow">¶</a></p>
<ul class="ulEmpty compact toc">
<li class="ulEmpty compact toc" id="section-toc.1-1.3.2.1">
<p id="section-toc.1-1.3.2.1.1"><a href="#section-3.1" class="xref">3.1</a>. <a href="#name-incremental-encoding-json-m" class="xref">Incremental Encoding: JSON Merge Patch</a><a href="#section-toc.1-1.3.2.1.1" class="pilcrow">¶</a></p>
<ul class="ulEmpty compact toc">
<li class="ulEmpty compact toc" id="section-toc.1-1.3.2.1.2.1">
<p id="section-toc.1-1.3.2.1.2.1.1"><a href="#section-3.1.1" class="xref">3.1.1</a>. <a href="#name-json-merge-patch-encoding" class="xref">JSON Merge Patch Encoding</a><a href="#section-toc.1-1.3.2.1.2.1.1" class="pilcrow">¶</a></p>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.3.2.1.2.2">
<p id="section-toc.1-1.3.2.1.2.2.1"><a href="#section-3.1.2" class="xref">3.1.2</a>. <a href="#name-json-merge-patch-alto-messa" class="xref">JSON Merge Patch ALTO Messages</a><a href="#section-toc.1-1.3.2.1.2.2.1" class="pilcrow">¶</a></p>
</li>
</ul>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.3.2.2">
<p id="section-toc.1-1.3.2.2.1"><a href="#section-3.2" class="xref">3.2</a>. <a href="#name-incremental-encoding-json-p" class="xref">Incremental Encoding: JSON Patch</a><a href="#section-toc.1-1.3.2.2.1" class="pilcrow">¶</a></p>
<ul class="ulEmpty compact toc">
<li class="ulEmpty compact toc" id="section-toc.1-1.3.2.2.2.1">
<p id="section-toc.1-1.3.2.2.2.1.1"><a href="#section-3.2.1" class="xref">3.2.1</a>. <a href="#name-json-patch-encoding" class="xref">JSON Patch Encoding</a><a href="#section-toc.1-1.3.2.2.2.1.1" class="pilcrow">¶</a></p>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.3.2.2.2.2">
<p id="section-toc.1-1.3.2.2.2.2.1"><a href="#section-3.2.2" class="xref">3.2.2</a>. <a href="#name-json-patch-alto-messages" class="xref">JSON Patch ALTO Messages</a><a href="#section-toc.1-1.3.2.2.2.2.1" class="pilcrow">¶</a></p>
</li>
</ul>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.3.2.3">
<p id="section-toc.1-1.3.2.3.1"><a href="#section-3.3" class="xref">3.3</a>. <a href="#name-multiplexing-and-server-pus" class="xref">Multiplexing and Server Push: HTTP/2</a><a href="#section-toc.1-1.3.2.3.1" class="pilcrow">¶</a></p>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.3.2.4">
<p id="section-toc.1-1.3.2.4.1"><a href="#section-3.4" class="xref">3.4</a>. <a href="#name-server-push-server-sent-eve" class="xref">Server Push: Server-Sent Event</a><a href="#section-toc.1-1.3.2.4.1" class="pilcrow">¶</a></p>
</li>
</ul>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.4">
<p id="section-toc.1-1.4.1"><a href="#section-4" class="xref">4</a>. <a href="#name-overview-of-approach-and-hi" class="xref">Overview of Approach and High-Level Protocol Message Flow</a><a href="#section-toc.1-1.4.1" class="pilcrow">¶</a></p>
<ul class="ulEmpty compact toc">
<li class="ulEmpty compact toc" id="section-toc.1-1.4.2.1">
<p id="section-toc.1-1.4.2.1.1"><a href="#section-4.1" class="xref">4.1</a>. <a href="#name-update-stream-service-messa" class="xref">Update Stream Service Message Flow</a><a href="#section-toc.1-1.4.2.1.1" class="pilcrow">¶</a></p>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.4.2.2">
<p id="section-toc.1-1.4.2.2.1"><a href="#section-4.2" class="xref">4.2</a>. <a href="#name-stream-control-service-mess" class="xref">Stream Control Service Message Flow</a><a href="#section-toc.1-1.4.2.2.1" class="pilcrow">¶</a></p>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.4.2.3">
<p id="section-toc.1-1.4.2.3.1"><a href="#section-4.3" class="xref">4.3</a>. <a href="#name-service-announcement-and-ma" class="xref">Service Announcement and Management Message Flow</a><a href="#section-toc.1-1.4.2.3.1" class="pilcrow">¶</a></p>
</li>
</ul>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.5">
<p id="section-toc.1-1.5.1"><a href="#section-5" class="xref">5</a>. <a href="#name-update-messages-data-update" class="xref">Update Messages: Data Update and Control Update Messages</a><a href="#section-toc.1-1.5.1" class="pilcrow">¶</a></p>
<ul class="ulEmpty compact toc">
<li class="ulEmpty compact toc" id="section-toc.1-1.5.2.1">
<p id="section-toc.1-1.5.2.1.1"><a href="#section-5.1" class="xref">5.1</a>. <a href="#name-generic-alto-update-message" class="xref">Generic ALTO Update Message Structure</a><a href="#section-toc.1-1.5.2.1.1" class="pilcrow">¶</a></p>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.5.2.2">
<p id="section-toc.1-1.5.2.2.1"><a href="#section-5.2" class="xref">5.2</a>. <a href="#name-alto-data-update-message" class="xref">ALTO Data Update Message</a><a href="#section-toc.1-1.5.2.2.1" class="pilcrow">¶</a></p>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.5.2.3">
<p id="section-toc.1-1.5.2.3.1"><a href="#section-5.3" class="xref">5.3</a>. <a href="#name-alto-control-update-message" class="xref">ALTO Control Update Message</a><a href="#section-toc.1-1.5.2.3.1" class="pilcrow">¶</a></p>
</li>
</ul>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.6">
<p id="section-toc.1-1.6.1"><a href="#section-6" class="xref">6</a>. <a href="#name-update-stream-service" class="xref">Update Stream Service</a><a href="#section-toc.1-1.6.1" class="pilcrow">¶</a></p>
<ul class="ulEmpty compact toc">
<li class="ulEmpty compact toc" id="section-toc.1-1.6.2.1">
<p id="section-toc.1-1.6.2.1.1"><a href="#section-6.1" class="xref">6.1</a>. <a href="#name-media-type" class="xref">Media Type</a><a href="#section-toc.1-1.6.2.1.1" class="pilcrow">¶</a></p>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.6.2.2">
<p id="section-toc.1-1.6.2.2.1"><a href="#section-6.2" class="xref">6.2</a>. <a href="#name-http-method" class="xref">HTTP Method</a><a href="#section-toc.1-1.6.2.2.1" class="pilcrow">¶</a></p>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.6.2.3">
<p id="section-toc.1-1.6.2.3.1"><a href="#section-6.3" class="xref">6.3</a>. <a href="#name-capabilities" class="xref">Capabilities</a><a href="#section-toc.1-1.6.2.3.1" class="pilcrow">¶</a></p>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.6.2.4">
<p id="section-toc.1-1.6.2.4.1"><a href="#section-6.4" class="xref">6.4</a>. <a href="#name-uses" class="xref">Uses</a><a href="#section-toc.1-1.6.2.4.1" class="pilcrow">¶</a></p>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.6.2.5">
<p id="section-toc.1-1.6.2.5.1"><a href="#section-6.5" class="xref">6.5</a>. <a href="#name-request-accept-input-parame" class="xref">Request: Accept Input Parameters</a><a href="#section-toc.1-1.6.2.5.1" class="pilcrow">¶</a></p>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.6.2.6">
<p id="section-toc.1-1.6.2.6.1"><a href="#section-6.6" class="xref">6.6</a>. <a href="#name-response" class="xref">Response</a><a href="#section-toc.1-1.6.2.6.1" class="pilcrow">¶</a></p>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.6.2.7">
<p id="section-toc.1-1.6.2.7.1"><a href="#section-6.7" class="xref">6.7</a>. <a href="#name-additional-requirements-on-" class="xref">Additional Requirements on Update Stream Service</a><a href="#section-toc.1-1.6.2.7.1" class="pilcrow">¶</a></p>
<ul class="ulEmpty compact toc">
<li class="ulEmpty compact toc" id="section-toc.1-1.6.2.7.2.1">
<p id="section-toc.1-1.6.2.7.2.1.1"><a href="#section-6.7.1" class="xref">6.7.1</a>. <a href="#name-event-sequence-requirements" class="xref">Event Sequence Requirements</a><a href="#section-toc.1-1.6.2.7.2.1.1" class="pilcrow">¶</a></p>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.6.2.7.2.2">
<p id="section-toc.1-1.6.2.7.2.2.1"><a href="#section-6.7.2" class="xref">6.7.2</a>. <a href="#name-cross-stream-consistency-re" class="xref">Cross-Stream Consistency Requirements</a><a href="#section-toc.1-1.6.2.7.2.2.1" class="pilcrow">¶</a></p>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.6.2.7.2.3">
<p id="section-toc.1-1.6.2.7.2.3.1"><a href="#section-6.7.3" class="xref">6.7.3</a>. <a href="#name-multipart-update-requiremen" class="xref">Multipart Update Requirements</a><a href="#section-toc.1-1.6.2.7.2.3.1" class="pilcrow">¶</a></p>
</li>
</ul>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.6.2.8">
<p id="section-toc.1-1.6.2.8.1"><a href="#section-6.8" class="xref">6.8</a>. <a href="#name-keep-alive-messages" class="xref">Keep-Alive Messages</a><a href="#section-toc.1-1.6.2.8.1" class="pilcrow">¶</a></p>
</li>
</ul>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.7">
<p id="section-toc.1-1.7.1"><a href="#section-7" class="xref">7</a>. <a href="#name-stream-control-service" class="xref">Stream Control Service</a><a href="#section-toc.1-1.7.1" class="pilcrow">¶</a></p>
<ul class="ulEmpty compact toc">
<li class="ulEmpty compact toc" id="section-toc.1-1.7.2.1">
<p id="section-toc.1-1.7.2.1.1"><a href="#section-7.1" class="xref">7.1</a>. <a href="#name-uri" class="xref">URI</a><a href="#section-toc.1-1.7.2.1.1" class="pilcrow">¶</a></p>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.7.2.2">
<p id="section-toc.1-1.7.2.2.1"><a href="#section-7.2" class="xref">7.2</a>. <a href="#name-media-type-2" class="xref">Media Type</a><a href="#section-toc.1-1.7.2.2.1" class="pilcrow">¶</a></p>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.7.2.3">
<p id="section-toc.1-1.7.2.3.1"><a href="#section-7.3" class="xref">7.3</a>. <a href="#name-http-method-2" class="xref">HTTP Method</a><a href="#section-toc.1-1.7.2.3.1" class="pilcrow">¶</a></p>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.7.2.4">
<p id="section-toc.1-1.7.2.4.1"><a href="#section-7.4" class="xref">7.4</a>. <a href="#name-ird-capabilities-uses" class="xref">IRD Capabilities & Uses</a><a href="#section-toc.1-1.7.2.4.1" class="pilcrow">¶</a></p>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.7.2.5">
<p id="section-toc.1-1.7.2.5.1"><a href="#section-7.5" class="xref">7.5</a>. <a href="#name-request-accept-input-paramet" class="xref">Request: Accept Input Parameters</a><a href="#section-toc.1-1.7.2.5.1" class="pilcrow">¶</a></p>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.7.2.6">
<p id="section-toc.1-1.7.2.6.1"><a href="#section-7.6" class="xref">7.6</a>. <a href="#name-response-2" class="xref">Response</a><a href="#section-toc.1-1.7.2.6.1" class="pilcrow">¶</a></p>
</li>
</ul>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.8">
<p id="section-toc.1-1.8.1"><a href="#section-8" class="xref">8</a>. <a href="#name-examples" class="xref">Examples</a><a href="#section-toc.1-1.8.1" class="pilcrow">¶</a></p>
<ul class="ulEmpty compact toc">
<li class="ulEmpty compact toc" id="section-toc.1-1.8.2.1">
<p id="section-toc.1-1.8.2.1.1"><a href="#section-8.1" class="xref">8.1</a>. <a href="#name-example-ird-announcing-upda" class="xref">Example: IRD Announcing Update Stream Services</a><a href="#section-toc.1-1.8.2.1.1" class="pilcrow">¶</a></p>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.8.2.2">
<p id="section-toc.1-1.8.2.2.1"><a href="#section-8.2" class="xref">8.2</a>. <a href="#name-example-simple-network-and-" class="xref">Example: Simple Network and Cost Map Updates</a><a href="#section-toc.1-1.8.2.2.1" class="pilcrow">¶</a></p>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.8.2.3">
<p id="section-toc.1-1.8.2.3.1"><a href="#section-8.3" class="xref">8.3</a>. <a href="#name-example-advanced-network-an" class="xref">Example: Advanced Network and Cost Map Updates</a><a href="#section-toc.1-1.8.2.3.1" class="pilcrow">¶</a></p>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.8.2.4">
<p id="section-toc.1-1.8.2.4.1"><a href="#section-8.4" class="xref">8.4</a>. <a href="#name-example-endpoint-property-u" class="xref">Example: Endpoint Property Updates</a><a href="#section-toc.1-1.8.2.4.1" class="pilcrow">¶</a></p>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.8.2.5">
<p id="section-toc.1-1.8.2.5.1"><a href="#section-8.5" class="xref">8.5</a>. <a href="#name-example-multipart-message-u" class="xref">Example: Multipart Message Updates</a><a href="#section-toc.1-1.8.2.5.1" class="pilcrow">¶</a></p>
</li>
</ul>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.9">
<p id="section-toc.1-1.9.1"><a href="#section-9" class="xref">9</a>. <a href="#name-operation-and-processing-co" class="xref">Operation and Processing Considerations</a><a href="#section-toc.1-1.9.1" class="pilcrow">¶</a></p>
<ul class="ulEmpty compact toc">
<li class="ulEmpty compact toc" id="section-toc.1-1.9.2.1">
<p id="section-toc.1-1.9.2.1.1"><a href="#section-9.1" class="xref">9.1</a>. <a href="#name-considerations-for-choosing" class="xref">Considerations for Choosing Data Update Messages</a><a href="#section-toc.1-1.9.2.1.1" class="pilcrow">¶</a></p>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.9.2.2">
<p id="section-toc.1-1.9.2.2.1"><a href="#section-9.2" class="xref">9.2</a>. <a href="#name-considerations-for-client-p" class="xref">Considerations for Client Processing Data Update Messages</a><a href="#section-toc.1-1.9.2.2.1" class="pilcrow">¶</a></p>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.9.2.3">
<p id="section-toc.1-1.9.2.3.1"><a href="#section-9.3" class="xref">9.3</a>. <a href="#name-considerations-for-updates-" class="xref">Considerations for Updates to Filtered Cost Maps</a><a href="#section-toc.1-1.9.2.3.1" class="pilcrow">¶</a></p>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.9.2.4">
<p id="section-toc.1-1.9.2.4.1"><a href="#section-9.4" class="xref">9.4</a>. <a href="#name-considerations-for-updates-t" class="xref">Considerations for Updates to Ordinal Mode Costs</a><a href="#section-toc.1-1.9.2.4.1" class="pilcrow">¶</a></p>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.9.2.5">
<p id="section-toc.1-1.9.2.5.1"><a href="#section-9.5" class="xref">9.5</a>. <a href="#name-considerations-for-sse-text" class="xref">Considerations for SSE Text Formatting and Processing</a><a href="#section-toc.1-1.9.2.5.1" class="pilcrow">¶</a></p>
</li>
</ul>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.10">
<p id="section-toc.1-1.10.1"><a href="#section-10" class="xref">10</a>. <a href="#name-security-considerations" class="xref">Security Considerations</a><a href="#section-toc.1-1.10.1" class="pilcrow">¶</a></p>
<ul class="ulEmpty compact toc">
<li class="ulEmpty compact toc" id="section-toc.1-1.10.2.1">
<p id="section-toc.1-1.10.2.1.1"><a href="#section-10.1" class="xref">10.1</a>. <a href="#name-update-stream-server-denial" class="xref">Update Stream Server: Denial-of-Service Attacks</a><a href="#section-toc.1-1.10.2.1.1" class="pilcrow">¶</a></p>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.10.2.2">
<p id="section-toc.1-1.10.2.2.1"><a href="#section-10.2" class="xref">10.2</a>. <a href="#name-alto-client-update-overload" class="xref">ALTO Client: Update Overloading or Instability</a><a href="#section-toc.1-1.10.2.2.1" class="pilcrow">¶</a></p>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.10.2.3">
<p id="section-toc.1-1.10.2.3.1"><a href="#section-10.3" class="xref">10.3</a>. <a href="#name-stream-control-spoofed-cont" class="xref">Stream Control: Spoofed Control Requests and Information Breakdown</a><a href="#section-toc.1-1.10.2.3.1" class="pilcrow">¶</a></p>
</li>
</ul>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.11">
<p id="section-toc.1-1.11.1"><a href="#section-11" class="xref">11</a>. <a href="#name-requirements-on-future-alto" class="xref">Requirements on Future ALTO Services to Use This Design</a><a href="#section-toc.1-1.11.1" class="pilcrow">¶</a></p>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.12">
<p id="section-toc.1-1.12.1"><a href="#section-12" class="xref">12</a>. <a href="#name-iana-considerations" class="xref">IANA Considerations</a><a href="#section-toc.1-1.12.1" class="pilcrow">¶</a></p>
<ul class="ulEmpty compact toc">
<li class="ulEmpty compact toc" id="section-toc.1-1.12.2.1">
<p id="section-toc.1-1.12.2.1.1"><a href="#section-12.1" class="xref">12.1</a>. <a href="#name-application-alto-updatestre" class="xref">application/alto-updatestreamparams+json Media Type</a><a href="#section-toc.1-1.12.2.1.1" class="pilcrow">¶</a></p>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.12.2.2">
<p id="section-toc.1-1.12.2.2.1"><a href="#section-12.2" class="xref">12.2</a>. <a href="#name-application-alto-updatestrea" class="xref">application/alto-updatestreamcontrol+json Media Type</a><a href="#section-toc.1-1.12.2.2.1" class="pilcrow">¶</a></p>
</li>
</ul>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.13">
<p id="section-toc.1-1.13.1"><a href="#section-13" class="xref">13</a>. <a href="#name-appendix-design-decision-no" class="xref">Appendix: Design Decision: Not Allowing Stream Restart</a><a href="#section-toc.1-1.13.1" class="pilcrow">¶</a></p>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.14">
<p id="section-toc.1-1.14.1"><a href="#section-14" class="xref">14</a>. <a href="#name-references" class="xref">References</a><a href="#section-toc.1-1.14.1" class="pilcrow">¶</a></p>
<ul class="ulEmpty compact toc">
<li class="ulEmpty compact toc" id="section-toc.1-1.14.2.1">
<p id="section-toc.1-1.14.2.1.1"><a href="#section-14.1" class="xref">14.1</a>. <a href="#name-normative-references" class="xref">Normative References</a><a href="#section-toc.1-1.14.2.1.1" class="pilcrow">¶</a></p>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.14.2.2">
<p id="section-toc.1-1.14.2.2.1"><a href="#section-14.2" class="xref">14.2</a>. <a href="#name-informative-references" class="xref">Informative References</a><a href="#section-toc.1-1.14.2.2.1" class="pilcrow">¶</a></p>
</li>
</ul>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.15">
<p id="section-toc.1-1.15.1"><a href="#section-appendix.a" class="xref"></a><a href="#name-acknowledgments" class="xref">Acknowledgments</a><a href="#section-toc.1-1.15.1" class="pilcrow">¶</a></p>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.16">
<p id="section-toc.1-1.16.1"><a href="#section-appendix.b" class="xref"></a><a href="#name-contributors" class="xref">Contributors</a><a href="#section-toc.1-1.16.1" class="pilcrow">¶</a></p>
</li>
<li class="ulEmpty compact toc" id="section-toc.1-1.17">
<p id="section-toc.1-1.17.1"><a href="#section-appendix.c" class="xref"></a><a href="#name-authors-addresses" class="xref">Authors' Addresses</a><a href="#section-toc.1-1.17.1" class="pilcrow">¶</a></p>
</li>
</ul>
</nav>
</section>
</div>
<section id="section-1">
<h2 id="name-introduction">
<a href="#section-1" class="section-number selfRef">1. </a><a href="#name-introduction" class="section-name selfRef">Introduction</a>
</h2>
<p id="section-1-1">The Application-Layer Traffic Optimization (ALTO) protocol <span>[<a href="#RFC7285" class="xref">RFC7285</a>]</span> provides network-related information, called
network information resources, to client applications so that clients may
make informed decisions in utilizing network resources. For example, an
ALTO server provides network and cost maps, where a network map
partitions the set of endpoints into a manageable number of sets each
defined by a Provider-Defined Identifier (PID) and a cost map provides
directed costs between PIDs. Given network and cost maps, an ALTO client
can obtain costs between endpoints by first using the network map to get
the PID for each endpoint and then using the cost map to get the costs
between those PIDs. Such costs can be used by the client to choose
communicating endpoints with low network costs.<a href="#section-1-1" class="pilcrow">¶</a></p>
<p id="section-1-2">The ALTO protocol defines only an ALTO client pull model without
defining a mechanism to allow an ALTO client to obtain updates to
network information resources, other than by periodically re-fetching
them. In settings where an information resource may be large but only
parts of it may change frequently (e.g., some entries of a cost map),
complete re-fetching can be inefficient.<a href="#section-1-2" class="pilcrow">¶</a></p>
<p id="section-1-3">
This document presents a mechanism to allow an ALTO server
to push incremental updates to ALTO clients. Integrating server push
and incremental updates provides two benefits:
(1) updates can be small, in that if only a small section of an
information resource changes, the ALTO server can send just the
changes and
(2) updates can be immediate, in that the ALTO server can send updates
as soon as they are available.<a href="#section-1-3" class="pilcrow">¶</a></p>
<p id="section-1-4">While primarily intended to provide updates to GET-mode network and
cost maps, the mechanism defined in this document can also provide
updates to POST-mode ALTO services, such as the ALTO endpoint property
and endpoint cost services. The mechanism can also support new ALTO
services to be defined by future extensions, but a future service needs
to satisfy requirements specified in <a href="#FutureDesignConsiderations" class="xref">Section 11</a>.<a href="#section-1-4" class="pilcrow">¶</a></p>
<p id="section-1-5">The rest of this document is organized as follows. <a href="#Background" class="xref">Section 3</a> gives background on the basic techniques used in
this design: (1) JSON merge patch and JSON patch to allow incremental
updates and (2) Server-Sent Events (SSE) <span>[<a href="#SSE" class="xref">SSE</a>]</span> to allow
server push. With the background, <a href="#Overview" class="xref">Section 4</a> gives a
non-normative overview of the design. <a href="#ALTO.SSE.Events" class="xref">Section 5</a>
defines individual messages in an update stream. <a href="#UpdateStreamService" class="xref">Section 6</a> defines the update stream service. <a href="#UpdateStreamController" class="xref">Section 7</a> defines the stream control service.
<a href="#Examples" class="xref">Section 8</a> gives several examples to illustrate the two
types of services. <a href="#OperationProcessingConsiderations" class="xref">Section 9</a>
describes operation and processing considerations by both ALTO servers
and clients. <a href="#DesignDecisions" class="xref">Section 13</a> discusses a design feature
that is not supported. <a href="#Security" class="xref">Section 10</a> discusses security
issues. Sections <a href="#FutureDesignConsiderations" class="xref">11</a> and <a href="#IANA" class="xref">12</a> review the
requirements for future ALTO services to use SSE and IANA
considerations, respectively.<a href="#section-1-5" class="pilcrow">¶</a></p>
</section>
<div id="Terms">
<section id="section-2">
<h2 id="name-terms">
<a href="#section-2" class="section-number selfRef">2. </a><a href="#name-terms" class="section-name selfRef">Terms</a>
</h2>
<p id="section-2-1">Besides the terminologies as defined in <span>[<a href="#RFC7285" class="xref">RFC7285</a>]</span>,
this document also uses additional terminologies defined as follows:<a href="#section-2-1" class="pilcrow">¶</a></p>
<span class="break"></span><dl class="dlNewline" id="section-2-2">
<dt id="section-2-2.1">Update Stream:</dt>
<dd style="margin-left: 1.5em" id="section-2-2.2">A reliable, in-order connection compatible with HTTP/1.x between an ALTO
client and an ALTO server so that the server can push a sequence of update
messages using <span>[<a href="#SSE" class="xref">SSE</a>]</span> to the client.<a href="#section-2-2.2" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-2-2.3">Update Stream Server:</dt>
<dd style="margin-left: 1.5em" id="section-2-2.4">This document refers to an ALTO server providing an update stream as an
ALTO update stream server, or update stream server for short. Note that the
ALTO server mentioned in this document refers to a general server that
provides various kinds of services; it can be an update stream server or
stream control server (see below). It can also be a server providing ALTO
Information Resource Directory (IRD).<a href="#section-2-2.4" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-2-2.5">Update Message:</dt>
<dd style="margin-left: 1.5em" id="section-2-2.6">A message that is either a data update message or a control update
message.<a href="#section-2-2.6" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-2-2.7">Data Update Message:</dt>
<dd style="margin-left: 1.5em" id="section-2-2.8">An update message that is for a single ALTO information resource and
sent from the update stream server to the ALTO client when the resource
changes. A data update message can be either a full-replacement message or
an incremental-change message. Full replacement is a shorthand for a
full-replacement message, and incremental change is a shorthand for an
incremental-change message.<a href="#section-2-2.8" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-2-2.9">Full Replacement:</dt>
<dd style="margin-left: 1.5em" id="section-2-2.10">A data update message for a resource that encodes the content of the
resource in its original ALTO encoding.<a href="#section-2-2.10" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-2-2.11">Incremental Change:</dt>
<dd style="margin-left: 1.5em" id="section-2-2.12">A data update message that specifies only the difference between the
new content and the previous version. An incremental change can be encoded
using either JSON merge patch or JSON patch in this document.<a href="#section-2-2.12" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-2-2.13">Stream Control Service:</dt>
<dd style="margin-left: 1.5em" id="section-2-2.14">A service that provides an HTTP URI so that the ALTO client of an update
stream can use it to send stream control requests to the ALTO server on the
addition or removal of resources receiving update messages from the update
stream. The ALTO server creates a new stream control resource for each
update stream instance, assigns a unique URI to it, and sends the URI to the
client as the first event in the stream. (Note that the stream control
service in ALTO has no association with the similarly named Stream Control
Transmission Protocol <span>[<a href="#RFC4960" class="xref">RFC4960</a>]</span>.)<a href="#section-2-2.14" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-2-2.15">Stream Control:</dt>
<dd style="margin-left: 1.5em" id="section-2-2.16">A shorthand for stream control service.<a href="#section-2-2.16" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-2-2.17">Stream Control Server:</dt>
<dd style="margin-left: 1.5em" id="section-2-2.18">An ALTO server providing the stream control service.<a href="#section-2-2.18" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-2-2.19">Substream-ID:</dt>
<dd style="margin-left: 1.5em" id="section-2-2.20">An ALTO client can assign a unique substream-id when requesting the
addition of a resource receiving update messages from an update stream. The
server puts the substream-id in each update event for that resource. The
substream-id allows a client to use one update stream to receive updates to
multiple requests for the same resource (i.e., with the same resource-id in
an ALTO IRD), for example, for a POST-mode resource with different input
parameters.<a href="#section-2-2.20" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-2-2.21">Data-ID:</dt>
<dd style="margin-left: 1.5em" id="section-2-2.22">A subfield of the "event" field of <span>[<a href="#SSE" class="xref">SSE</a>]</span> to identify the
ALTO data (object) to be updated. For an ALTO resource returning a multipart
response, the data-id to identify the data (object) is the substream-id, in
addition to the Content-ID of the object in the multipart response. The
data-id of a single-part response is just the substream-id.<a href="#section-2-2.22" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-2-2.23">Control Update Message:</dt>
<dd style="margin-left: 1.5em" id="section-2-2.24">An update message for the update stream server to notify the ALTO client
of related control information of the update stream. A control update
message may be triggered by an internal event at the server, such as server
overloading and hence the update stream server will no longer send updates
for an information resource, or as a result of a client sending a request
through the stream control service.
The first message of an update stream is a control update message that
provides
a control URI to the ALTO client. The ALTO client can use the URI to send
stream control requests to the stream control server.<a href="#section-2-2.24" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
</dl>
<div id="ReqLang">
<section id="section-2.1">
<h3 id="name-requirements-language">
<a href="#section-2.1" class="section-number selfRef">2.1. </a><a href="#name-requirements-language" class="section-name selfRef">Requirements Language</a>
</h3>
<p id="section-2.1-1">
The key words "<span class="bcp14">MUST</span>", "<span class="bcp14">MUST NOT</span>",
"<span class="bcp14">REQUIRED</span>", "<span class="bcp14">SHALL</span>", "<span class="bcp14">SHALL NOT</span>", "<span class="bcp14">SHOULD</span>", "<span class="bcp14">SHOULD NOT</span>",
"<span class="bcp14">RECOMMENDED</span>", "<span class="bcp14">NOT RECOMMENDED</span>",
"<span class="bcp14">MAY</span>", and "<span class="bcp14">OPTIONAL</span>" in this document are to be interpreted as
described in BCP 14 <span>[<a href="#RFC2119" class="xref">RFC2119</a>]</span> <span>[<a href="#RFC8174" class="xref">RFC8174</a>]</span>
when, and only when, they appear in all capitals, as shown here.<a href="#section-2.1-1" class="pilcrow">¶</a></p>
</section>
</div>
</section>
</div>
<div id="Background">
<section id="section-3">
<h2 id="name-background">
<a href="#section-3" class="section-number selfRef">3. </a><a href="#name-background" class="section-name selfRef">Background</a>
</h2>
<p id="section-3-1">The design requires two basic techniques: encoding of incremental
changes and server push. For incremental changes, existing techniques
include JSON merge patch and JSON patch; this design uses both. For
server push, existing techniques include HTTP/2 and <span>[<a href="#SSE" class="xref">SSE</a>]</span>; this design adopts some design features of HTTP/2 but
uses <span>[<a href="#SSE" class="xref">SSE</a>]</span> as the basic server-push design. The rest of
this section gives a non-normative summary of JSON merge patch, JSON
patch, HTTP/2, and <span>[<a href="#SSE" class="xref">SSE</a>]</span>.<a href="#section-3-1" class="pilcrow">¶</a></p>
<section id="section-3.1">
<h3 id="name-incremental-encoding-json-m">
<a href="#section-3.1" class="section-number selfRef">3.1. </a><a href="#name-incremental-encoding-json-m" class="section-name selfRef">Incremental Encoding: JSON Merge Patch</a>
</h3>
<p id="section-3.1-1">To avoid always sending complete data, a server needs mechanisms to
encode incremental changes, and JSON merge patch is one
mechanism. <span>[<a href="#RFC7396" class="xref">RFC7396</a>]</span> defines the encoding of
incremental changes (called JSON merge patch objects) to be used by
the HTTP PATCH method <span>[<a href="#RFC5789" class="xref">RFC5789</a>]</span>. From <span>[<a href="#RFC7396" class="xref">RFC7396</a>]</span>, this document adopts only the JSON merge patch
object
encoding and does not use the HTTP PATCH method, as the updates are
sent as events instead of HTTP methods; also, the updates are
server to client, and PATCH semantics are more for
client to server. Below is a non-normative summary of JSON merge patch
objects; see <span>[<a href="#RFC7396" class="xref">RFC7396</a>]</span> for the normative
definition.<a href="#section-3.1-1" class="pilcrow">¶</a></p>
<div id="MergePatchOverview">
<section id="section-3.1.1">
<h4 id="name-json-merge-patch-encoding">
<a href="#section-3.1.1" class="section-number selfRef">3.1.1. </a><a href="#name-json-merge-patch-encoding" class="section-name selfRef">JSON Merge Patch Encoding</a>
</h4>
<p id="section-3.1.1-1"> Informally, a JSON merge patch message consists of a JSON merge
patch object (referred to as a patch in <span>[<a href="#RFC7396" class="xref">RFC7396</a>]</span>),
which defines how to transform one JSON value into another using a
recursive merge patch algorithm. Specifically, the patch is computed
by treating two JSON values (first one being the original and the
second being the updated) as trees of nested JSON objects
(dictionaries of name/value pairs), where the leaves are values
(e.g., JSON arrays, strings, and numbers), other than JSON objects, and
the path for each leaf is the sequence of keys leading to that
leaf. When the second tree has a different value for a leaf at a
path or adds a new leaf, the patch has a leaf, at that path, with
the new value. When a leaf in the first tree does not exist in the
second tree, the JSON merge patch tree has a leaf with a JSON "null"
value. Hence, in the patch, null as the value of a name/value pair
will delete the element with "name" in the original JSON value. The
patch does not have an entry for any leaf that has the same value in
both versions. See the MergePatch pseudocode at the beginning of
<span><a href="https://www.rfc-editor.org/rfc/rfc7396#section-2" class="relref">Section 2</a> of [<a href="#RFC7396" class="xref">RFC7396</a>]</span> for the
formal specification of how to apply a given patch. As a result, if
all leaf values are simple scalars, JSON merge patch is a quite
efficient representation of incremental changes. It is less
efficient when leaf values are arrays, because JSON merge patch
replaces arrays in their entirety, even if only one entry
changes.<a href="#section-3.1.1-1" class="pilcrow">¶</a></p>
</section>
</div>
<div id="MergePatchALTO">
<section id="section-3.1.2">
<h4 id="name-json-merge-patch-alto-messa">
<a href="#section-3.1.2" class="section-number selfRef">3.1.2. </a><a href="#name-json-merge-patch-alto-messa" class="section-name selfRef">JSON Merge Patch ALTO Messages</a>
</h4>
<p id="section-3.1.2-1">
To provide both examples of JSON merge patch and a demonstration of
the feasibility of applying JSON merge patch to ALTO, the sections
below show the application of JSON merge patch to two key ALTO
messages.<a href="#section-3.1.2-1" class="pilcrow">¶</a></p>
<div id="MergePatchNetMapExample">
<section id="section-3.1.2.1">
<h5 id="name-json-merge-patch-network-ma">
<a href="#section-3.1.2.1" class="section-number selfRef">3.1.2.1. </a><a href="#name-json-merge-patch-network-ma" class="section-name selfRef">JSON Merge Patch Network Map Messages</a>
</h5>
<p id="section-3.1.2.1-1"><span><a href="https://www.rfc-editor.org/rfc/rfc7285#section-11.2.1.6" class="relref">Section 11.2.1.6</a> of [<a href="#RFC7285" class="xref">RFC7285</a>]</span>
defines the format of an ALTO network map message. Assume a simple
example ALTO message sending an initial network map:<a href="#section-3.1.2.1-1" class="pilcrow">¶</a></p>
<div id="section-3.1.2.1-2">
<pre class="sourcecode lang-json">
{
"meta" : {
"vtag": {
"resource-id" : "my-network-map",
"tag" : "da65eca2eb7a10ce8b059740b0b2e3f8eb1d4785"
}
},
"network-map" : {
"PID1" : {
"ipv4" : [ "192.0.2.0/24", "198.51.100.0/25" ]
},
"PID2" : {
"ipv4" : [ "198.51.100.128/25" ]
},
"PID3" : {
"ipv4" : [ "0.0.0.0/0" ],
"ipv6" : [ "::/0" ]
}
}
}
</pre><a href="#section-3.1.2.1-2" class="pilcrow">¶</a>
</div>
<p id="section-3.1.2.1-3">Consider the following JSON merge patch update message, which
(1) adds an ipv4 prefix "203.0.113.0/25" and an ipv6 prefix
"2001:db8:8000::/33" to "PID1", (2) deletes "PID2", and (3)
assigns a new "tag" to the network map:<a href="#section-3.1.2.1-3" class="pilcrow">¶</a></p>
<div id="section-3.1.2.1-4">
<pre class="sourcecode lang-json">
{
"meta" : {
"vtag" : {
"tag" : "a10ce8b059740b0b2e3f8eb1d4785acd42231bfe"
}
},
"network-map": {
"PID1" : {
"ipv4" : [ "192.0.2.0/24", "198.51.100.0/25",
"203.0.113.0/25" ],
"ipv6" : [ "2001:db8:8000::/33" ]
},
"PID2" : null
}
}
</pre><a href="#section-3.1.2.1-4" class="pilcrow">¶</a>
</div>
<p id="section-3.1.2.1-5">Applying the JSON merge patch update to the initial network map
is equivalent to the following ALTO network map:<a href="#section-3.1.2.1-5" class="pilcrow">¶</a></p>
<div id="section-3.1.2.1-6">
<pre class="sourcecode lang-json">
{
"meta" : {
"vtag": {
"resource-id" : "my-network-map",
"tag" : "a10ce8b059740b0b2e3f8eb1d4785acd42231bfe"
}
},
"network-map" : {
"PID1" : {
"ipv4" : [ "192.0.2.0/24", "198.51.100.0/25",
"203.0.113.0/25" ],
"ipv6" : [ "2001:db8:8000::/33" ]
},
"PID3" : {
"ipv4" : [ "0.0.0.0/0" ],
"ipv6" : [ "::/0" ]
}
}
}
</pre><a href="#section-3.1.2.1-6" class="pilcrow">¶</a>
</div>
</section>
</div>
<div id="MergePatchCostMapExample">
<section id="section-3.1.2.2">
<h5 id="name-json-merge-patch-cost-map-m">
<a href="#section-3.1.2.2" class="section-number selfRef">3.1.2.2. </a><a href="#name-json-merge-patch-cost-map-m" class="section-name selfRef">JSON Merge Patch Cost Map Messages</a>
</h5>
<p id="section-3.1.2.2-1"><span><a href="https://www.rfc-editor.org/rfc/rfc7285#section-11.2.3.6" class="relref">Section 11.2.3.6</a> of [<a href="#RFC7285" class="xref">RFC7285</a>]</span>
defines the format of an ALTO cost map message. Assume a simple
example ALTO message for an initial cost map:<a href="#section-3.1.2.2-1" class="pilcrow">¶</a></p>
<div id="section-3.1.2.2-2">
<pre class="sourcecode lang-json">
{
"meta" : {
"dependent-vtags" : [
{"resource-id": "my-network-map",
"tag": "a10ce8b059740b0b2e3f8eb1d4785acd42231bfe"
}
],
"cost-type" : {
"cost-mode" : "numerical",
"cost-metric": "routingcost"
},
"vtag": {
"resource-id" : "my-cost-map",
"tag" : "3ee2cb7e8d63d9fab71b9b34cbf764436315542e"
}
},
"cost-map" : {
"PID1": { "PID1": 1, "PID2": 5, "PID3": 10 },
"PID2": { "PID1": 5, "PID2": 1, "PID3": 15 },
"PID3": { "PID1": 20, "PID2": 15 }
}
}
</pre><a href="#section-3.1.2.2-2" class="pilcrow">¶</a>
</div>
<p id="section-3.1.2.2-3">The following JSON merge patch message updates the example cost
map so that (1) the "tag" field of the cost map is updated, (2)
the cost of PID1->PID2 is 9 instead of 5, (3) the cost of
PID3->PID1 is no longer available, and (4) the cost of
PID3->PID3 is defined as 1.<a href="#section-3.1.2.2-3" class="pilcrow">¶</a></p>
<div id="section-3.1.2.2-4">
<pre class="sourcecode lang-json">
{
"meta" : {
"vtag": {
"tag": "c0ce023b8678a7b9ec00324673b98e54656d1f6d"
}
}
"cost-map" : {
"PID1" : { "PID2" : 9 },
"PID3" : { "PID1" : null, "PID3" : 1 }
}
}
</pre><a href="#section-3.1.2.2-4" class="pilcrow">¶</a>
</div>
<p id="section-3.1.2.2-5">Hence, applying the JSON merge patch to the initial cost map is
equivalent to the following ALTO cost map:<a href="#section-3.1.2.2-5" class="pilcrow">¶</a></p>
<div id="section-3.1.2.2-6">
<pre class="sourcecode lang-json">
{
"meta" : {
"dependent-vtags" : [
{"resource-id": "my-network-map",
"tag": "a10ce8b059740b0b2e3f8eb1d4785acd42231bfe"
}
],
"cost-type" : {
"cost-mode" : "numerical",
"cost-metric": "routingcost"
},
"vtag": {
"resource-id": "my-cost-map",
"tag": "c0ce023b8678a7b9ec00324673b98e54656d1f6d"
}
},
"cost-map" : {
"PID1": { "PID1": 1, "PID2": 9, "PID3": 10 },
"PID2": { "PID1": 5, "PID2": 1, "PID3": 15 },
"PID3": { "PID2": 15, "PID3": 1 }
}
}
</pre><a href="#section-3.1.2.2-6" class="pilcrow">¶</a>
</div>
</section>
</div>
</section>
</div>
</section>
<section id="section-3.2">
<h3 id="name-incremental-encoding-json-p">
<a href="#section-3.2" class="section-number selfRef">3.2. </a><a href="#name-incremental-encoding-json-p" class="section-name selfRef">Incremental Encoding: JSON Patch</a>
</h3>
<div id="JSONPatchOverview">
<section id="section-3.2.1">
<h4 id="name-json-patch-encoding">
<a href="#section-3.2.1" class="section-number selfRef">3.2.1. </a><a href="#name-json-patch-encoding" class="section-name selfRef">JSON Patch Encoding</a>
</h4>
<p id="section-3.2.1-1">One issue of JSON merge patch is that it does not handle array
changes well. In particular, JSON merge patch considers an array as
a single object and hence can only replace an array in its
entirety. When the change is to make a small change to an array, such
as the deletion of an element from a large array, whole-array
replacement is inefficient. Consider the example in <a href="#MergePatchNetMapExample" class="xref">Section 3.1.2.1</a>. To add a new entry to the ipv4
array for PID1, the server needs to send a whole new array. Another
issue is that JSON merge patch cannot change a value to be null, as
the JSON merge patch processing algorithm (MergePatch in <a href="#MergePatchOverview" class="xref">Section 3.1.1</a>) interprets a null as a removal
instruction. On the other hand, some ALTO resources can have null
values, and it is possible that the update will want to change the
new value to be null.<a href="#section-3.2.1-1" class="pilcrow">¶</a></p>
<p id="section-3.2.1-2">JSON patch <span>[<a href="#RFC6902" class="xref">RFC6902</a>]</span> can address the preceding
issues. It defines a set of operators to modify a JSON object. See
<span>[<a href="#RFC6902" class="xref">RFC6902</a>]</span> for the normative definition.<a href="#section-3.2.1-2" class="pilcrow">¶</a></p>
</section>
</div>
<section id="section-3.2.2">
<h4 id="name-json-patch-alto-messages">
<a href="#section-3.2.2" class="section-number selfRef">3.2.2. </a><a href="#name-json-patch-alto-messages" class="section-name selfRef">JSON Patch ALTO Messages</a>
</h4>
<p id="section-3.2.2-1">To provide both examples of JSON patch and a demonstration of the
difference between JSON patch and JSON merge patch, the sections
below show the application of JSON patch to the same updates shown
in <a href="#MergePatchALTO" class="xref">Section 3.1.2</a>.<a href="#section-3.2.2-1" class="pilcrow">¶</a></p>
<section id="section-3.2.2.1">
<h5 id="name-json-patch-network-map-mess">
<a href="#section-3.2.2.1" class="section-number selfRef">3.2.2.1. </a><a href="#name-json-patch-network-map-mess" class="section-name selfRef">JSON Patch Network Map Messages</a>
</h5>
<p id="section-3.2.2.1-1">First, consider the same update as in <a href="#MergePatchNetMapExample" class="xref">Section 3.1.2.1</a> for the network map. Below is
the encoding using JSON patch:<a href="#section-3.2.2.1-1" class="pilcrow">¶</a></p>
<div id="section-3.2.2.1-2">
<pre class="sourcecode lang-json">
[
{
"op": "replace",
"path": "/meta/vtag/tag",
"value": "a10ce8b059740b0b2e3f8eb1d4785acd42231bfe"
},
{
"op": "add",
"path": "/network-map/PID1/ipv4/2",
"value": "203.0.113.0/25"
}
{
"op": "add",
"path": "/network-map/PID1/ipv6",
"value": ["2001:db8:8000::/33"]
},
{
"op": "remove",
"path": "/network-map/PID2"
}
]
</pre><a href="#section-3.2.2.1-2" class="pilcrow">¶</a>
</div>
</section>
<section id="section-3.2.2.2">
<h5 id="name-json-patch-cost-map-message">
<a href="#section-3.2.2.2" class="section-number selfRef">3.2.2.2. </a><a href="#name-json-patch-cost-map-message" class="section-name selfRef">JSON Patch Cost Map Messages</a>
</h5>
<p id="section-3.2.2.2-1">Compared with JSON merge patch, JSON patch does not encode cost
map updates efficiently. Consider the cost map update shown in
<a href="#MergePatchCostMapExample" class="xref">Section 3.1.2.2</a>, the encoding using JSON
patch is:<a href="#section-3.2.2.2-1" class="pilcrow">¶</a></p>
<div id="section-3.2.2.2-2">
<pre class="sourcecode lang-json">
[
{
"op": "replace",
"path": "/meta/vtag/tag",
"value": "c0ce023b8678a7b9ec00324673b98e54656d1f6d"
},
{
"op": "replace",
"path": "/cost-map/PID1/PID2",
"value": 9
},
{
"op": "remove",
"path": "/cost-map/PID3/PID1"
},
{
"op": "replace",
"path": "/cost-map/PID3/PID3",
"value": 1
}
]
</pre><a href="#section-3.2.2.2-2" class="pilcrow">¶</a>
</div>
</section>
</section>
</section>
<section id="section-3.3">
<h3 id="name-multiplexing-and-server-pus">
<a href="#section-3.3" class="section-number selfRef">3.3. </a><a href="#name-multiplexing-and-server-pus" class="section-name selfRef">Multiplexing and Server Push: HTTP/2</a>
</h3>
<p id="section-3.3-1">HTTP/2 <span>[<a href="#RFC7540" class="xref">RFC7540</a>]</span> provides two related features:
multiplexing and server push. In particular, HTTP/2 allows a client
and a server to multiplex multiple HTTP requests and responses over a
single TCP connection. The requests and responses can be interleaved
on a block (frame) by block (frame) basis, by indicating the requests
and responses in HTTP/2 messages, avoiding the head-of-line blocking
problem encountered with HTTP/1.1. To achieve the same goal, this
design introduces substream-id to allow a client to receive updates to
multiple resources. HTTP/2 also provides a server-push facility to
allow a server to send asynchronous updates.<a href="#section-3.3-1" class="pilcrow">¶</a></p>
<p id="section-3.3-2">Despite the two features of HTTP/2, this design chooses a design
compatible with HTTP/1.x for the simplicity of HTTP/1.x. A design
based on HTTP/2 may more likely need to be implemented using a more
complex HTTP/2 client library. In such a case, one approach for using
server push for updates is for the update stream server to send each
data update message as a separate server-push item and let the client
apply those updates as they arrive. An HTTP/2 client library may not
necessarily inform a client application when the server pushes a
resource. Instead, the library might cache the pushed resource and
only deliver it to the client when the client explicitly requests that
URI. Further, it is more likely that a design based on HTTP/2 may
encounter issues with a proxy between the client and the server, in
that server push is optional and can be disabled by any proxy between
the client and the server. This is not a problem for the intended use
of server push; eventually, the client will request those resources, so
disabling server push just adds a delay. But this means that Server
Push is not suitable for resources that the client does not know to
request.<a href="#section-3.3-2" class="pilcrow">¶</a></p>
<p id="section-3.3-3">Thus, this design leaves a design based on HTTP/2 as a future work
and focuses on ALTO updates on HTTP/1.x and <span>[<a href="#SSE" class="xref">SSE</a>]</span>.<a href="#section-3.3-3" class="pilcrow">¶</a></p>
</section>
<div id="SSEOverview">
<section id="section-3.4">
<h3 id="name-server-push-server-sent-eve">
<a href="#section-3.4" class="section-number selfRef">3.4. </a><a href="#name-server-push-server-sent-eve" class="section-name selfRef">Server Push: Server-Sent Event</a>
</h3>
<p id="section-3.4-1">Server-Sent Events (SSE) are techniques that can work with
HTTP/1.1. The following is a non-normative summary of SSE; see <span>[<a href="#SSE" class="xref">SSE</a>]</span> for its normative definition.<a href="#section-3.4-1" class="pilcrow">¶</a></p>
<p id="section-3.4-2">SSE enable a server to send new data to a client by "server push".
The client establishes an HTTP <span>[<a href="#RFC7230" class="xref">RFC7230</a>]</span> <span>[<a href="#RFC7231" class="xref">RFC7231</a>]</span> connection to the server and keeps the connection
open. The server continually sends messages. Each message has one or
more lines, where a line is terminated by a carriage return
immediately followed by a new line,
a carriage return not immediately followed by a new line,
or a new line not immediately preceded by a carriage return.
A message is terminated by a blank line (two line terminators in a row).<a href="#section-3.4-2" class="pilcrow">¶</a></p>
<p id="section-3.4-3">Each line in a message is of the form "field-name: string
value". Lines with a blank field name (that is, lines that start with
a colon) are ignored, as are lines that do not have a colon. The
protocol defines three field names: event, id, and data. If a message
has more than one "data" line, the value of the data field is the
concatenation of the values on those lines. There can be only one
"event" and "id" line per message. The "data" field is required; the
others are optional.<a href="#section-3.4-3" class="pilcrow">¶</a></p>
<p id="section-3.4-4"><a href="#sse-example" class="xref">Figure 1</a> is a sample SSE stream, starting with
the client request. The server sends three events and then closes the
stream.<a href="#section-3.4-4" class="pilcrow">¶</a></p>
<span id="name-a-sample-sse-stream"></span><div id="sse-example">
<figure id="figure-1">
<div id="section-3.4-5.1">
<pre class="sourcecode">
(Client request)
GET /stream HTTP/1.1
Host: example.com
Accept: text/event-stream
(Server response)
HTTP/1.1 200 OK
Connection: keep-alive
Content-Type: text/event-stream
event: start
id: 1
data: hello there
event: middle
id: 2
data: let's chat some more ...
data: and more and more and ...
event: end
id: 3
data: goodbye
</pre>
</div>
<figcaption><a href="#figure-1" class="selfRef">Figure 1</a>:
<a href="#name-a-sample-sse-stream" class="selfRef">A Sample SSE Stream</a>
</figcaption></figure>
</div>
</section>
</div>
</section>
</div>
<div id="Overview">
<section id="section-4">
<h2 id="name-overview-of-approach-and-hi">
<a href="#section-4" class="section-number selfRef">4. </a><a href="#name-overview-of-approach-and-hi" class="section-name selfRef">Overview of Approach and High-Level Protocol Message Flow</a>
</h2>
<p id="section-4-1">With the preceding background, this section now gives a non-normative
overview of the update mechanisms and message flow to be defined in
later sections of this document. <a href="#FigOverview" class="xref">Figure 2</a> gives the main components and
overall message flow.<a href="#section-4-1" class="pilcrow">¶</a></p>
<span id="name-alto-sse-architecture-and-m"></span><div id="FigOverview">
<figure id="figure-2">
<div class="artwork art-text alignLeft" id="section-4-2.1">
<pre>
-------------------------------------------------------------------
| |
| +-------+ +-------+ 1. init request +------+ |
| | | | | <-------------- | | |
| | | | | --------------> | | |
| 3.add/ | | | | 1'. control URI | | |
| remove | | | | | | |
| resource |Stream | |Update | | | |
-------->|Control| private |Stream | 2a. data update |Client| --
|Server |<------->|Server | messages | |
-------- | | | | ---------------> | | <-
| response | | | | ---------------> | | |
| | | | | 2b. control update| | |
| +-------+ +-------+ messages +------+ |
| |
-------------------------------------------------------------------
</pre>
</div>
<figcaption><a href="#figure-2" class="selfRef">Figure 2</a>:
<a href="#name-alto-sse-architecture-and-m" class="selfRef">ALTO SSE Architecture and Message Flow</a>
</figcaption></figure>
</div>
<div id="USSMF">
<section id="section-4.1">
<h3 id="name-update-stream-service-messa">
<a href="#section-4.1" class="section-number selfRef">4.1. </a><a href="#name-update-stream-service-messa" class="section-name selfRef">Update Stream Service Message Flow</a>
</h3>
<p id="section-4.1-1">
The building block of the update mechanism defined in this document is the
update stream service (defined in <a href="#UpdateStreamService" class="xref">Section 6</a>), where each update stream service is a
POST-mode service that provides update streams.<a href="#section-4.1-1" class="pilcrow">¶</a></p>
<p id="section-4.1-2">
Note that the lines of the format "** ... **" are used to describe
message flows in this section and the following sections.<a href="#section-4.1-2" class="pilcrow">¶</a></p>
<span class="break"></span><dl class="dlNewline" id="section-4.1-3">
<dt id="section-4.1-3.1">** Initial request: client -> update server **:</dt>
<dd style="margin-left: 1.5em" id="section-4.1-3.2">
<p id="section-4.1-3.2.1">
When an ALTO client requests an update stream service,
the ALTO client establishes a persistent connection to the update
stream server and submits an initial update-stream request (defined in
<a href="#UpdateInput.media-type" class="xref">Section 6.5</a>), creating an update
stream. This initial request creating the update stream is labeled
"1. init request" in <a href="#FigOverview" class="xref">Figure 2</a>.<a href="#section-4.1-3.2.1" class="pilcrow">¶</a></p>
<p id="section-4.1-3.2.2">
An update stream can provide updates to both GET-mode resources, such
as ALTO network and cost maps, and POST-mode resources, such as ALTO
endpoint property service. Also, to avoid creating too many update
streams, this design allows an ALTO client to use one update stream to
receive updates to multiple requests. In particular, the client may
request to receive updates for the same resource but with different
parameters for a POST-mode resource, in addition to being able to
consolidate updates for multiple resources into a single stream.
The updates for each request is called a substream and hence the
update server needs an identifier to indicate the substream when
sending an update. To achieve this goal, the client
assigns a unique substream-id when requesting updates to a resource in an update stream,
and the server puts the substream-id in each update.<a href="#section-4.1-3.2.2" class="pilcrow">¶</a></p>
</dd>
<dd class="break"></dd>
<dt id="section-4.1-3.3">** Data updates: update server -> client **:</dt>
<dd style="margin-left: 1.5em" id="section-4.1-3.4">
The objective of an update stream is to continuously push (to an
ALTO client) the data value changes for a set of resources, where the
set of resources is specified by the ALTO client's requests.
This document
refers to messages sending such data-value changes as data update
messages (defined in <a href="#ALTO.SSE.UpdateEvents" class="xref">Section 5.2</a>). Although
an update stream may update one or more requests, each data update
message updates only one request and is sent as a Server-Sent Event
(SSE), as defined by <span>[<a href="#SSE" class="xref">SSE</a>]</span>. A data update message is
encoded either as a full replacement or as an incremental change. A
full replacement uses the JSON message format defined by the ALTO
protocol. There can be multiple encodings for incremental changes. The
current design supports incremental changes using JSON merge patch
<span>[<a href="#RFC7396" class="xref">RFC7396</a>]</span> or JSON patch <span>[<a href="#RFC6902" class="xref">RFC6902</a>]</span> to
describe the changes of the resource. Future documents may define
additional mechanisms for incremental changes. The update stream
server decides when to send data update messages and whether to send
full replacements or incremental changes. These decisions can vary
from resource to resource and from update to update. Since the
transport is a design compatible with HTTP/1.x, data update messages
are delivered reliably and in order, and the lossless, sequential
delivery of its messages allows the server to know the exact state of
the client to compute the correct incremental updates. <a href="#FigOverview" class="xref">Figure 2</a> shows examples of data update messages (labeled
"2a. data update messages") in the overall message flow.<a href="#section-4.1-3.4" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-4.1-3.5">** Control updates: update server -> client **:</dt>
<dd style="margin-left: 1.5em" id="section-4.1-3.6">
An update stream can run for a long time and hence there can be status
changes at the update stream server side during the lifetime of an
update stream; for example, the update stream server may encounter an
error or need to shut down for maintenance. To support a robust, flexible
protocol design, this document allows the update stream server to send
control update messages (defined in <a href="#ALTO.SSE.ControlEvents" class="xref">Section 5.3</a>) in addition to data update messages
to the ALTO client. <a href="#FigOverview" class="xref">Figure 2</a> shows that both data
updates and control updates can be sent by the server to the client
(labeled "2b. control update messages").<a href="#section-4.1-3.6" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
</dl>
</section>
</div>
<div id="SCSMF">
<section id="section-4.2">
<h3 id="name-stream-control-service-mess">
<a href="#section-4.2" class="section-number selfRef">4.2. </a><a href="#name-stream-control-service-mess" class="section-name selfRef">Stream Control Service Message Flow</a>
</h3>
<span class="break"></span><dl class="dlNewline" id="section-4.2-1">
<dt id="section-4.2-1.1">** Stream control: client -> stream control server **:</dt>
<dd style="margin-left: 1.5em" id="section-4.2-1.2">
<p id="section-4.2-1.2.1">In addition to control changes triggered from the update stream
server side, in a flexible design, an ALTO client may initiate
control changes as well, in particular, by adding or removing ALTO
resources receiving updates. An ALTO client initiates such changes
using the stream control service (defined in <a href="#UpdateStreamController" class="xref">Section 7</a>). Although one may use a design
that the client uses as the same HTTP connection to send the control
requests, it requires stronger server support, such as HTTP
pipeline. For more flexibility, this document introduces stream
control service. In particular, the update stream server of an
update stream uses the first message to provide the URI of the
stream control service (labeled "1': control URI" in <a href="#FigOverview" class="xref">Figure 2</a>).<a href="#section-4.2-1.2.1" class="pilcrow">¶</a></p>
<p id="section-4.2-1.2.2">The ALTO client can then use the URI to ask the stream control
server specified in the URI to request the update stream server to
(1) send data update messages for additional resources, (2) stop
sending data update messages for previously requested resources, or
(3) gracefully stop and close the update stream altogether.<a href="#section-4.2-1.2.2" class="pilcrow">¶</a></p>
</dd>
<dd class="break"></dd>
</dl>
</section>
</div>
<div id="SAMMF">
<section id="section-4.3">
<h3 id="name-service-announcement-and-ma">
<a href="#section-4.3" class="section-number selfRef">4.3. </a><a href="#name-service-announcement-and-ma" class="section-name selfRef">Service Announcement and Management Message Flow</a>
</h3>
<span class="break"></span><dl class="dlNewline" id="section-4.3-1">
<dt id="section-4.3-1.1">** Service announcements: IRD server -> client **:</dt>
<dd style="margin-left: 1.5em" id="section-4.3-1.2">An update server may provide any number of update stream services,
where each update stream may provide updates for a given subset of the
ALTO server's resources. An ALTO server's Information Resource
Directory (IRD) defines the update stream services and declares the
set of resources for which each update stream service provides
updates. The ALTO server selects the resource set for each update
stream service. It is recommended that if a resource depends on one or
more other resource(s) (indicated with the "uses" attribute defined in
<span>[<a href="#RFC7285" class="xref">RFC7285</a>]</span>), these other resource(s) should also be part
of that update stream. Thus, the update stream for a cost map should also
provide updates for the network map on which that cost map depends.<a href="#section-4.3-1.2" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-4.3-1.3">** Service management (server) **:</dt>
<dd style="margin-left: 1.5em" id="section-4.3-1.4">An ALTO client may request any number of update streams
simultaneously. Because each update stream consumes resources on the
update stream server, an update stream server may require client
authorization and/or authentication, limit the number of open update
streams, close inactive streams, or redirect an ALTO client to another
update stream server.<a href="#section-4.3-1.4" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
</dl>
</section>
</div>
</section>
</div>
<div id="ALTO.SSE.Events">
<section id="section-5">
<h2 id="name-update-messages-data-update">
<a href="#section-5" class="section-number selfRef">5. </a><a href="#name-update-messages-data-update" class="section-name selfRef">Update Messages: Data Update and Control Update Messages</a>
</h2>
<p id="section-5-1">This section defines the format of update messages sent from the
server to the client. It first defines the generic structure of update
messages (<a href="#ALTO.SSE.EventFormat" class="xref">Section 5.1</a>). It then defines the
details of the data update messages (<a href="#ALTO.SSE.UpdateEvents" class="xref">Section 5.2</a>) and the control update messages (<a href="#ALTO.SSE.ControlEvents" class="xref">Section 5.3</a>). These messages will be used in the
next two sections to define the update stream service (<a href="#UpdateStreamService" class="xref">Section 6</a>) and the stream control service (<a href="#UpdateStreamController" class="xref">Section 7</a>).<a href="#section-5-1" class="pilcrow">¶</a></p>
<div id="ALTO.SSE.EventFormat">
<section id="section-5.1">
<h3 id="name-generic-alto-update-message">
<a href="#section-5.1" class="section-number selfRef">5.1. </a><a href="#name-generic-alto-update-message" class="section-name selfRef">Generic ALTO Update Message Structure</a>
</h3>
<p id="section-5.1-1">Both data update and control update messages from the server to the
client have the same basic structure. Each message includes a data
field to provide data information, which is typically a JSON object,
and an event field preceding the data field, to specify the media type
indicating the encoding of the data field.<a href="#section-5.1-1" class="pilcrow">¶</a></p>
<p id="section-5.1-2">A data update message needs additional information to identify the
ALTO data (object) to which the update message applies. To be generic,
this document uses a data-id to identify the ALTO data (object) to be
updated; see below.<a href="#section-5.1-2" class="pilcrow">¶</a></p>
<p id="section-5.1-3">Hence, the event field of ALTO update message can include two
subfields (media-type and data-id), where the two subfields are
separated by a comma (',', U+002C):<a href="#section-5.1-3" class="pilcrow">¶</a></p>
<div id="section-5.1-4">
<pre class="sourcecode">
media-type [ ',' data-id ]
</pre><a href="#section-5.1-4" class="pilcrow">¶</a>
</div>
<p id="section-5.1-5">According to <span><a href="https://www.rfc-editor.org/rfc/rfc6838#section-4.2" class="relref">Section 4.2</a> of [<a href="#RFC6838" class="xref">RFC6838</a>]</span>, the comma character is not allowed in a media-type
name so there is no ambiguity when decoding of the two subfields.<a href="#section-5.1-5" class="pilcrow">¶</a></p>
<p id="section-5.1-6">Note that an update message does not use the SSE "id" field.<a href="#section-5.1-6" class="pilcrow">¶</a></p>
</section>
</div>
<div id="ALTO.SSE.UpdateEvents">
<section id="section-5.2">
<h3 id="name-alto-data-update-message">
<a href="#section-5.2" class="section-number selfRef">5.2. </a><a href="#name-alto-data-update-message" class="section-name selfRef">ALTO Data Update Message</a>
</h3>
<p id="section-5.2-1">A data update message is sent when a monitored resource changes. As
discussed in the preceding section, the event field of a data update
message includes two subfields: 'media-type' and 'data-id'.<a href="#section-5.2-1" class="pilcrow">¶</a></p>
<p id="section-5.2-2">The 'media-type' subfield depends on whether the data update is a
complete specification of the identified data or an incremental patch
(e.g., a JSON merge patch or JSON patch), if possible, describing the
changes from the last version of the data. This document refers to
these as full replacement and incremental change, respectively. The
encoding of a full replacement is defined by its defining document
(e.g., network and cost map messages by <span>[<a href="#RFC7285" class="xref">RFC7285</a>]</span>) and
uses the media type defined in that document. The encoding of JSON
merge patch is defined by <span>[<a href="#RFC7396" class="xref">RFC7396</a>]</span>, with the media
type "application/merge-patch+json"; the encoding of JSON patch is
defined by <span>[<a href="#RFC6902" class="xref">RFC6902</a>]</span>, with media type
"application/json-patch+json".<a href="#section-5.2-2" class="pilcrow">¶</a></p>
<p id="section-5.2-3">The 'data-id' subfield identifies the ALTO data to which the data
update message applies.<a href="#section-5.2-3" class="pilcrow">¶</a></p>
<p id="section-5.2-4">First, consider the case that the resource contains only a single
JSON object. For example, since an ALTO client can request data
updates for both a cost map resource (object) and its dependent
network map resource (object) in the same update stream, to
distinguish the updates, the client assigns a substream-id for each
resource receiving data updates. Substream-ids <span class="bcp14">MUST</span> be
unique within an update stream but need not be globally unique. A
substream-id is encoded as a JSON string with the same format as that
of the type ResourceID (<span><a href="https://www.rfc-editor.org/rfc/rfc7285#section-10.2" class="relref">Section 10.2</a> of [<a href="#RFC7285" class="xref">RFC7285</a>]</span>). The type SubstreamID is used in this document to
indicate a string of this format. The substream-id of a single JSON
object is the 'data-id'.<a href="#section-5.2-4" class="pilcrow">¶</a></p>
<p id="section-5.2-5">As an example, assume that the ALTO client assigns substream-id "1"
in its request to receive updates to the network map and substream-id
"2" to the cost map. Then, the substream-ids are the data-ids
indicating which objects will be updated. <a href="#alto-sse-example" class="xref">Figure 3</a> shows some examples of ALTO data update
messages:<a href="#section-5.2-5" class="pilcrow">¶</a></p>
<span id="name-examples-of-alto-data-updat"></span><div id="alto-sse-example">
<figure id="figure-3">
<div id="section-5.2-6.1">
<pre class="sourcecode">
event: application/alto-networkmap+json,1
data: { ... full network map message ... }
event: application/alto-costmap+json,2
data: { ... full cost map message ... }
event: application/merge-patch+json,2
data: { ... JSON merge patch update for the cost map ... }
</pre>
</div>
<figcaption><a href="#figure-3" class="selfRef">Figure 3</a>:
<a href="#name-examples-of-alto-data-updat" class="selfRef">Examples of ALTO Data Update Messages</a>
</figcaption></figure>
</div>
<p id="section-5.2-7">Next, consider the case that a resource may include multiple JSON
objects. This document considers the case that a resource may contain
multiple components (parts), and they are encoded using the media type
"multipart/related" <span>[<a href="#RFC2387" class="xref">RFC2387</a>]</span>. Each part of this
multipart response <span class="bcp14">MUST</span> be an HTTP message including a
Content-ID header and a JSON object body. Each component requiring the
update stream service (defined in <a href="#UpdateStreamService" class="xref">Section 6</a>)
<span class="bcp14">MUST</span> be identified by a unique Content-ID to be defined
in its defining document.<a href="#section-5.2-7" class="pilcrow">¶</a></p>
<p id="section-5.2-8">For a resource using the media type "multipart/related", the
'data-id' subfield <span class="bcp14">MUST</span> be the concatenation of the
substream-id, the '.' separator (U+002E), and the unique Content-ID, in
order.<a href="#section-5.2-8" class="pilcrow">¶</a></p>
</section>
</div>
<div id="ALTO.SSE.ControlEvents">
<section id="section-5.3">
<h3 id="name-alto-control-update-message">
<a href="#section-5.3" class="section-number selfRef">5.3. </a><a href="#name-alto-control-update-message" class="section-name selfRef">ALTO Control Update Message</a>
</h3>
<p id="section-5.3-1">
Control update messages have the media type
"application/alto-updatestreamcontrol+json",
and the data is of type UpdateStreamControlEvent:<a href="#section-5.3-1" class="pilcrow">¶</a></p>
<div id="section-5.3-2">
<pre class="sourcecode">
object {
[String control-uri;]
[SubstreamID started<1..*>;]
[SubstreamID stopped<1..*>;]
[String description;]
} UpdateStreamControlEvent;
</pre><a href="#section-5.3-2" class="pilcrow">¶</a>
</div>
<span class="break"></span><dl class="dlNewline" id="section-5.3-3">
<dt id="section-5.3-3.1">control-uri:</dt>
<dd style="margin-left: 1.5em" id="section-5.3-3.2">the URI providing stream control for this update stream
(see <a href="#UpdateStreamController" class="xref">Section 7</a>).
The server sends a control update message notifying the client of the
control-uri. This control
update message notifying the control-uri will be sent once and
<span class="bcp14">MUST</span> be the first event in an update stream.
If the URI value is NULL, the update stream server does not support
stream control for this update stream; otherwise, the update stream
server provides stream control through the given URI.<a href="#section-5.3-3.2" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-5.3-3.3">started:</dt>
<dd style="margin-left: 1.5em" id="section-5.3-3.4">a list of substream-ids of resources. It notifies the ALTO client that
the update stream server will start sending data update messages for
each resource listed.<a href="#section-5.3-3.4" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-5.3-3.5">stopped:</dt>
<dd style="margin-left: 1.5em" id="section-5.3-3.6">
a list of substream-ids of resources. It notifies the ALTO client that
the update stream server will no longer send data update messages for
the listed resources. There can be multiple reasons for an update
stream server to stop sending data update messages for a resource,
including a request from the ALTO client using stream control (<a href="#UpdateStreamService.Response.Sequence" class="xref">Section 6.7.1</a>) or an internal
server event.<a href="#section-5.3-3.6" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-5.3-3.7">description:</dt>
<dd style="margin-left: 1.5em" id="section-5.3-3.8">
a non-normative, human-readable text providing an explanation for the
control event. When an update stream server stops sending data update
messages for a resource, it is <span class="bcp14">RECOMMENDED</span> that the update stream
server use the description field to provide details. There can be
multiple reasons that trigger a "stopped" event; see above. The
intention of this field is to provide a human-readable text for the
developer and/or the administrator to diagnose potential problems.<a href="#section-5.3-3.8" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
</dl>
</section>
</div>
</section>
</div>
<div id="UpdateStreamService">
<section id="section-6">
<h2 id="name-update-stream-service">
<a href="#section-6" class="section-number selfRef">6. </a><a href="#name-update-stream-service" class="section-name selfRef">Update Stream Service</a>
</h2>
<p id="section-6-1">An update stream service returns a stream of update messages, as
defined in <a href="#ALTO.SSE.Events" class="xref">Section 5</a>. An ALTO server's IRD
(Information Resource Directory) <span class="bcp14">MAY</span> define one or more
update stream services, which ALTO clients use to request new update
stream instances. An IRD entry defining an update stream service
<span class="bcp14">MUST</span> define the media type, HTTP method, and capabilities
and uses as follows.<a href="#section-6-1" class="pilcrow">¶</a></p>
<section id="section-6.1">
<h3 id="name-media-type">
<a href="#section-6.1" class="section-number selfRef">6.1. </a><a href="#name-media-type" class="section-name selfRef">Media Type</a>
</h3>
<p id="section-6.1-1">
The media type of an ALTO update stream service is
"text/event-stream", as defined by <span>[<a href="#SSE" class="xref">SSE</a>]</span>.<a href="#section-6.1-1" class="pilcrow">¶</a></p>
</section>
<section id="section-6.2">
<h3 id="name-http-method">
<a href="#section-6.2" class="section-number selfRef">6.2. </a><a href="#name-http-method" class="section-name selfRef">HTTP Method</a>
</h3>
<p id="section-6.2-1">An ALTO update stream service is requested using the HTTP POST
method.<a href="#section-6.2-1" class="pilcrow">¶</a></p>
</section>
<div id="UpdateStreamService.Capabilities">
<section id="section-6.3">
<h3 id="name-capabilities">
<a href="#section-6.3" class="section-number selfRef">6.3. </a><a href="#name-capabilities" class="section-name selfRef">Capabilities</a>
</h3>
<p id="section-6.3-1">The capabilities are defined as an object of type
UpdateStreamCapabilities:<a href="#section-6.3-1" class="pilcrow">¶</a></p>
<div id="section-6.3-2">
<pre class="sourcecode">
object {
IncrementalUpdateMediaTypes incremental-change-media-types;
Boolean support-stream-control;
} UpdateStreamCapabilities;
object-map {
ResourceID -> String;
} IncrementalUpdateMediaTypes;
</pre><a href="#section-6.3-2" class="pilcrow">¶</a>
</div>
<p id="section-6.3-3">If this update stream can provide data update messages with
incremental changes for a resource, the
"incremental-change-media-types" field has an entry for that
resource-id, and the value is the supported media types of the
incremental change separated by commas. Normally, this will be
"application/merge-patch+json", "application/json-patch+json", or
"application/merge-patch+json,application/json-patch+json", because,
as described in <a href="#ALTO.SSE.Events" class="xref">Section 5</a>, they are the only
incremental change types defined by this document. However, future
extensions may define other types of incremental changes.<a href="#section-6.3-3" class="pilcrow">¶</a></p>
<p id="section-6.3-4">When choosing the media types to encode incremental changes for a
resource, the update stream server <span class="bcp14">MUST</span> consider the
limitations of the encoding. For example, when a JSON merge patch
specifies that the value of a field is null, its semantics are that
the field is removed from the target and hence the field is no longer
defined (i.e., undefined); see the MergePatch algorithm in <a href="#MergePatchOverview" class="xref">Section 3.1.1</a> on how null value is processed. This,
however, may not be the intended result for the resource, when null
and undefined have different semantics for the resource. In such a
case, the update stream server <span class="bcp14">MUST</span> choose JSON patch
over JSON merge patch if JSON patch is indicated as a capability of
the update stream server. If the server does not support JSON patch to
handle such a case, the server then need to send a full
replacement.<a href="#section-6.3-4" class="pilcrow">¶</a></p>
<p id="section-6.3-5">The "support-stream-control" field specifies whether the given update
stream supports stream control. If the "support-stream-control" field is
"true", the update stream server will use the stream control specified
in this document; otherwise, the update stream server may use other
mechanisms to provide the same functionality as stream control.<a href="#section-6.3-5" class="pilcrow">¶</a></p>
</section>
</div>
<div id="UpdateStreamService.Uses">
<section id="section-6.4">
<h3 id="name-uses">
<a href="#section-6.4" class="section-number selfRef">6.4. </a><a href="#name-uses" class="section-name selfRef">Uses</a>
</h3>
<p id="section-6.4-1">
The "uses" attribute <span class="bcp14">MUST</span> be an array with the
resource-ids of every resource for which this update stream can
provide updates. Each resource specified in the "uses"
<span class="bcp14">MUST</span> support full replacement; the update stream server
can always send full replacement, and the ALTO client
<span class="bcp14">MUST</span> accept full replacement.<a href="#section-6.4-1" class="pilcrow">¶</a></p>
<p id="section-6.4-2">
This set may be any subset of the ALTO server's resources
and may include resources defined in linked IRDs.
However, it is <span class="bcp14">RECOMMENDED</span> that the ALTO server selects a set
that is closed under the resource dependency relationship.
That is, if an update stream's "uses" set includes resource R1
and resource R1 depends on ("uses") resource R0, then
the update stream's "uses" set <span class="bcp14">SHOULD</span> include R0 as well as R1.
For example, an update stream for a cost map <span class="bcp14">SHOULD</span> also provide
updates for the network map upon which that cost map depends.<a href="#section-6.4-2" class="pilcrow">¶</a></p>
</section>
</div>
<div id="UpdateInput.media-type">
<section id="section-6.5">
<h3 id="name-request-accept-input-parame">
<a href="#section-6.5" class="section-number selfRef">6.5. </a><a href="#name-request-accept-input-parame" class="section-name selfRef">Request: Accept Input Parameters</a>
</h3>
<p id="section-6.5-1">An ALTO client specifies the parameters for the new update stream
by sending an HTTP POST body with the media type
"application/alto-updatestreamparams+json". That body contains a JSON
object of type UpdateStreamReq, where:<a href="#section-6.5-1" class="pilcrow">¶</a></p>
<div id="section-6.5-2">
<pre class="sourcecode">
object {
[AddUpdatesReq add;]
[SubstreamID remove<0..*>;]
} UpdateStreamReq;
object-map {
SubstreamID -> AddUpdateReq;
} AddUpdatesReq;
object {
ResourceID resource-id;
[JSONString tag;]
[Boolean incremental-changes;]
[Object input;]
} AddUpdateReq;
</pre><a href="#section-6.5-2" class="pilcrow">¶</a>
</div>
<span class="break"></span><dl class="dlNewline" id="section-6.5-3">
<dt id="section-6.5-3.1">add:</dt>
<dd style="margin-left: 1.5em" id="section-6.5-3.2">Specifies the resources (and the parameters for the resources)
for which the ALTO client wants updates. In the scope of the same
update stream, the ALTO client <span class="bcp14">MUST</span> assign a
substream-id that is unique in the scope of the update stream (<a href="#ALTO.SSE.UpdateEvents" class="xref">Section 5.2</a>) for each entry and use those
substream-ids as the keys in the "add" field.<a href="#section-6.5-3.2" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-6.5-3.3">resource-id:</dt>
<dd style="margin-left: 1.5em" id="section-6.5-3.4">The resource-id of an ALTO resource and <span class="bcp14">MUST</span> be
in the update stream's "uses" list (<a href="#UpdateStreamService.Uses" class="xref">Section 6.4</a>). If the resource-id is a
GET-mode resource with a version tag (or "vtag"), as defined in
Sections <a href="https://www.rfc-editor.org/rfc/rfc7285#section-6.3" class="relref">6.3</a>
and <a href="https://www.rfc-editor.org/rfc/rfc7285#section-10.3" class="relref">10.3</a> of
<span>[<a href="#RFC7285" class="xref">RFC7285</a>]</span>, and the ALTO client has
previously retrieved a version of that resource from the update
stream server, the ALTO client <span class="bcp14">MAY</span> set the "tag"
field to the tag part of the client's version of that resource. If
that version is not current, the update stream server
<span class="bcp14">MUST</span> send a full replacement before sending any
incremental changes, as described in <a href="#UpdateStreamService.Response.Sequence" class="xref">Section 6.7.1</a>. If that version is
still current, the update stream server <span class="bcp14">MAY</span> omit the
initial full replacement.<a href="#section-6.5-3.4" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-6.5-3.5">incremental-changes:</dt>
<dd style="margin-left: 1.5em" id="section-6.5-3.6">The ALTO client specifies whether it is willing to
receive incremental changes from the update stream server for this substream.
If the "incremental-changes" field is "true", the update stream server <span class="bcp14">MAY</span> send
incremental changes for this substream. In this case, the client <span class="bcp14">MUST</span>
support all incremental methods from the set announced in the server's
capabilities for this resource;
see <a href="#UpdateStreamService.Capabilities" class="xref">Section 6.3</a> for the server's
announcement of potential incremental methods. If a client does not
support
all incremental methods from the set announced in the server's capabilities,
the client can set "incremental-changes" to "false", and the update stream server then
<span class="bcp14">MUST NOT</span> send incremental changes for that substream. The default value for
"incremental-changes" is "true", so to suppress incremental changes, the
ALTO client <span class="bcp14">MUST</span> explicitly set "incremental-changes" to "false".
An alternative design of incremental-changes control
is a more fine-grained control, by allowing a client to select a subset of
incremental methods from the set announced in the server's capabilities.
But this alternative design is not adopted in this document, because it adds
complexity to the server, which is more likely to be the bottleneck.
Note that
the ALTO client cannot suppress full replacement. When the ALTO client sets
"incremental-changes" to "false", the update
stream server
<span class="bcp14">MUST</span> send a full replacement instead of an incremental
change to the ALTO client.
The
update stream server <span class="bcp14">MAY</span> wait until more changes are available and send
a single full replacement with those changes. Thus, an ALTO client that
declines to accept incremental changes may not get updates as quickly as
an ALTO client that does.<a href="#section-6.5-3.6" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-6.5-3.7">input:</dt>
<dd style="margin-left: 1.5em" id="section-6.5-3.8">
If the resource is a POST-mode service that requires input, the
ALTO client <span class="bcp14">MUST</span> set the "input" field to a JSON object with the
parameters that the resource expects.<a href="#section-6.5-3.8" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-6.5-3.9">remove:</dt>
<dd style="margin-left: 1.5em" id="section-6.5-3.10">
It is used in update stream control requests
(<a href="#UpdateStreamController" class="xref">Section 7</a>) and is not allowed
in the update stream request. The update stream server <span class="bcp14">SHOULD</span>
ignore this field if it is included in the request.<a href="#section-6.5-3.10" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
</dl>
<p id="section-6.5-4">
If a request has any errors, the update stream server <span class="bcp14">MUST NOT</span> create an update stream.
Also, the update stream server will send an error response to the ALTO client, as
specified in <a href="#UpdateStreamService.Response" class="xref">Section 6.6</a>.<a href="#section-6.5-4" class="pilcrow">¶</a></p>
</section>
</div>
<div id="UpdateStreamService.Response">
<section id="section-6.6">
<h3 id="name-response">
<a href="#section-6.6" class="section-number selfRef">6.6. </a><a href="#name-response" class="section-name selfRef">Response</a>
</h3>
<p id="section-6.6-1">
If the update stream request has any errors, the update stream server
<span class="bcp14">MUST</span> return an HTTP "400 Bad Request" to the ALTO client; the
body of the response follows the generic ALTO error response format specified
in <span><a href="https://www.rfc-editor.org/rfc/rfc7285#section-8.5.2" class="relref">Section 8.5.2</a> of [<a href="#RFC7285" class="xref">RFC7285</a>]</span>. Hence, an
example ALTO error response has the format:<a href="#section-6.6-1" class="pilcrow">¶</a></p>
<div id="section-6.6-2">
<pre class="sourcecode">
HTTP/1.1 400 Bad Request
Content-Length: 131
Content-Type: application/alto-error+json
Connection: Closed
{
"meta":{
"code": "E_INVALID_FIELD_VALUE",
"field": "add/my-network-map/resource-id",
"value": "my-networkmap/#"
}
}
</pre><a href="#section-6.6-2" class="pilcrow">¶</a>
</div>
<p id="section-6.6-3">Note that "field" and "value" are optional fields. If the "value"
field exists, the "field" field <span class="bcp14">MUST</span> exist.<a href="#section-6.6-3" class="pilcrow">¶</a></p>
<ul class="normal">
<li class="normal" id="section-6.6-4.1">If an update stream request does not have an "add" field
specifying one or more resources, the error code of the error
message <span class="bcp14">MUST</span> be E_MISSING_FIELD and the "field" field
<span class="bcp14">SHOULD</span> be "add". The update stream server
<span class="bcp14">MUST</span> close the stream without sending any
events.<a href="#section-6.6-4.1" class="pilcrow">¶</a>
</li>
<li class="normal" id="section-6.6-4.2">If the "resource-id" field is invalid or is not associated with
the update stream, the error code of the error message
<span class="bcp14">MUST</span> be E_INVALID_FIELD_VALUE. The "field" field
<span class="bcp14">SHOULD</span> be the full path of the "resource-id" field,
and the "value" field <span class="bcp14">SHOULD</span> be the invalid
resource-id. If there are more than one invalid resource-ids, the
update stream server <span class="bcp14">SHOULD</span> pick one and return
it. The update stream server <span class="bcp14">MUST</span> close the stream
(i.e., TCP connection) without sending any events.<a href="#section-6.6-4.2" class="pilcrow">¶</a>
</li>
<li class="normal" id="section-6.6-4.3">
If the resource is a POST-mode service that requires input, the client
<span class="bcp14">MUST</span> set the "input" field to a JSON object with the parameters that that
resource expects. If the "input" field is missing or invalid, the update
stream server
<span class="bcp14">MUST</span> return the same error response that that resource would
return for missing or invalid input (see <span>[<a href="#RFC7285" class="xref">RFC7285</a>]</span>).
In this case, the
update stream server <span class="bcp14">MUST</span> close the update stream without
sending any events. If the
input for several POST-mode resources is missing or invalid, the update stream server
<span class="bcp14">MUST</span> pick one and return it.<a href="#section-6.6-4.3" class="pilcrow">¶</a>
</li>
</ul>
<p id="section-6.6-5">The response to a valid request is a stream of update
messages. <a href="#ALTO.SSE.Events" class="xref">Section 5</a> defines the update
messages, and <span>[<a href="#SSE" class="xref">SSE</a>]</span> defines how they are encoded into a
stream.<a href="#section-6.6-5" class="pilcrow">¶</a></p>
<p id="section-6.6-6">An update stream server <span class="bcp14">SHOULD</span> send updates only
when the underlying values change. However, it may be difficult for an
update stream server to guarantee that in all circumstances. Therefore,
a client <span class="bcp14">MUST NOT</span> assume that an update message
represents an actual change.<a href="#section-6.6-6" class="pilcrow">¶</a></p>
</section>
</div>
<div id="AddReq">
<section id="section-6.7">
<h3 id="name-additional-requirements-on-">
<a href="#section-6.7" class="section-number selfRef">6.7. </a><a href="#name-additional-requirements-on-" class="section-name selfRef">Additional Requirements on Update Stream Service</a>
</h3>
<div id="UpdateStreamService.Response.Sequence">
<section id="section-6.7.1">
<h4 id="name-event-sequence-requirements">
<a href="#section-6.7.1" class="section-number selfRef">6.7.1. </a><a href="#name-event-sequence-requirements" class="section-name selfRef">Event Sequence Requirements</a>
</h4>
<ul class="normal">
<li class="normal" id="section-6.7.1-1.1">The first event <span class="bcp14">MUST</span> be a control update
message with the URI of the update stream control service (see
<a href="#UpdateStreamController" class="xref">Section 7</a>) for this update
stream. Note that the value of the control-uri can be "null",
indicating that there is no control stream service.<a href="#section-6.7.1-1.1" class="pilcrow">¶</a>
</li>
<li class="normal" id="section-6.7.1-1.2">
As soon as possible, after the ALTO client initiates the connection, the
update stream server checks the "tag" field for each added update request.
If the "tag" field is not specified in an added update request, the update stream server
<span class="bcp14">MUST</span> first send a full replacement for the request. If the "tag" field
is specified, the client can accept incremental changes, and the server can
compute an incremental update based on the "tag" (the server needs to
ensure that for a POST resource with input, the "tag" should indicate
the correct result for different inputs); the update stream server
<span class="bcp14">MAY</span> omit the initial full replacement.<a href="#section-6.7.1-1.2" class="pilcrow">¶</a>
</li>
<li class="normal" id="section-6.7.1-1.3">If this update stream provides updates for resource-ids R0 and R1
and if R1 depends on R0, then the update stream server
<span class="bcp14">MUST</span> send the update for R0 before sending the related
updates for R1. For example, suppose an update stream provides updates
to a network map and its dependent cost maps. When the network map
changes, the update stream server <span class="bcp14">MUST</span> send the network
map update before sending the cost map updates.<a href="#section-6.7.1-1.3" class="pilcrow">¶</a>
</li>
<li class="normal" id="section-6.7.1-1.4">When the ALTO client uses the stream control service to stop
updates for one or more resources (<a href="#UpdateStreamController" class="xref">Section 7</a>), the ALTO client
<span class="bcp14">MUST</span> send a stream control request. The update stream
server <span class="bcp14">MUST</span> send a control update message whose
"stopped" field has the substream-ids of all stopped resources.<a href="#section-6.7.1-1.4" class="pilcrow">¶</a>
</li>
</ul>
</section>
</div>
<div id="UpdateStream.Response.Consistency">
<section id="section-6.7.2">
<h4 id="name-cross-stream-consistency-re">
<a href="#section-6.7.2" class="section-number selfRef">6.7.2. </a><a href="#name-cross-stream-consistency-re" class="section-name selfRef">Cross-Stream Consistency Requirements</a>
</h4>
<p id="section-6.7.2-1">If multiple ALTO clients create multiple update streams from the
same update stream resource and with the same update request
parameters (i.e., same resource and same input), the update stream
server <span class="bcp14">MUST</span> send the same updates to all of
them. However, the update stream server <span class="bcp14">MAY</span> pack data
items into different patch events, as long as the net result of
applying those updates is the same.<a href="#section-6.7.2-1" class="pilcrow">¶</a></p>
<p id="section-6.7.2-2">
For example, suppose two different ALTO clients
create two different update streams for the same cost map,
and suppose the update stream server processes
three separate cost point updates
with a brief pause between each update.
The server <span class="bcp14">MUST</span> send all three new cost points to both clients.
But the update stream server <span class="bcp14">MAY</span> send a single patch event
(with all three cost points) to one ALTO client
while sending three separate patch events
(with one cost point per event) to the other ALTO client.<a href="#section-6.7.2-2" class="pilcrow">¶</a></p>
<p id="section-6.7.2-3">
An update stream server <span class="bcp14">MAY</span> offer several different update stream resources
that provide updates to the same underlying resource
(that is, a resource-id may appear in the "uses" field
of more than one update stream resource).
In this case, those update stream resources
<span class="bcp14">MUST</span> return the same update.<a href="#section-6.7.2-3" class="pilcrow">¶</a></p>
</section>
</div>
<div id="UpdateStreamService.Response.Multipart">
<section id="section-6.7.3">
<h4 id="name-multipart-update-requiremen">
<a href="#section-6.7.3" class="section-number selfRef">6.7.3. </a><a href="#name-multipart-update-requiremen" class="section-name selfRef">Multipart Update Requirements</a>
</h4>
<p id="section-6.7.3-1">This design allows any valid media type for full
replacement. Hence, it supports ALTO resources using multipart to
contain multiple JSON objects. This realizes the push benefit but
not the incremental encoding benefit of SSE.<a href="#section-6.7.3-1" class="pilcrow">¶</a></p>
<p id="section-6.7.3-2">
JSON patch and merge patch provide the incremental encoding benefit
but can be applied to only a single JSON object. If an update stream
service supports a resource providing a multipart media type, which
we refer to as a multipart resource, then the update
stream service needs to handle the issue that the message of a full multipart
resource can include multiple JSON objects. To address the issue, when an
update stream service specifies that it supports JSON patch or merge patch incremental
updates for a multipart resource, the service <span class="bcp14">MUST</span>
ensure that (1) each part of a multipart message is a single JSON object,
(2) each part is specified by a static Content-ID in the initial full message, (3) each
data update event applies to only one part, and (4) each data update specifies
substream-id.content-id as the "event" field of the event, to identify the part
to be updated.<a href="#section-6.7.3-2" class="pilcrow">¶</a></p>
</section>
</div>
</section>
</div>
<div id="UpdateStreamService.keep-alive">
<section id="section-6.8">
<h3 id="name-keep-alive-messages">
<a href="#section-6.8" class="section-number selfRef">6.8. </a><a href="#name-keep-alive-messages" class="section-name selfRef">Keep-Alive Messages</a>
</h3>
<p id="section-6.8-1">
In an SSE stream, any line that starts with a colon (U+003A) character
is a comment, and an ALTO client <span class="bcp14">MUST</span> ignore that
line <span>[<a href="#SSE" class="xref">SSE</a>]</span>.
As recommended in <span>[<a href="#SSE" class="xref">SSE</a>]</span>,
an update stream server <span class="bcp14">SHOULD</span> send a comment line
(or an event) every 15 seconds
to prevent ALTO clients and proxy servers from dropping the HTTP connection.
Note that
although TCP also provides a Keep-Alive function, the interval between
TCP Keep-Alive messages can depend on the OS configuration and varies.
The preceding recommended SSE Keep-Alive allows the SSE client to detect
the status of the update stream server with more certainty.<a href="#section-6.8-1" class="pilcrow">¶</a></p>
</section>
</div>
</section>
</div>
<div id="UpdateStreamController">
<section id="section-7">
<h2 id="name-stream-control-service">
<a href="#section-7" class="section-number selfRef">7. </a><a href="#name-stream-control-service" class="section-name selfRef">Stream Control Service</a>
</h2>
<p id="section-7-1">
A stream control service allows an ALTO client
to remove resources from the set of resources that
are monitored by an update stream or add additional resources
to that set. The service also allows an ALTO client
to gracefully shut down an update stream.<a href="#section-7-1" class="pilcrow">¶</a></p>
<p id="section-7-2">
When an update stream server creates a new update stream and if the
update stream server supports stream control for the update stream,
the update stream server creates a stream control service for that
update stream.
An ALTO client uses the stream control service to remove resources
from the update stream instance
or to request updates for additional resources.
An ALTO client cannot obtain the stream control service through the IRD.
Instead, the first event that the update stream server sends to the ALTO client
has the URI for the associated stream control service
(see <a href="#ALTO.SSE.ControlEvents" class="xref">Section 5.3</a>).<a href="#section-7-2" class="pilcrow">¶</a></p>
<p id="section-7-3">
Each stream control request is an individual HTTP request.
The ALTO client <span class="bcp14">MAY</span> send multiple stream control requests
to the stream control server using the same HTTP connection.<a href="#section-7-3" class="pilcrow">¶</a></p>
<section id="section-7.1">
<h3 id="name-uri">
<a href="#section-7.1" class="section-number selfRef">7.1. </a><a href="#name-uri" class="section-name selfRef">URI</a>
</h3>
<p id="section-7.1-1">The URI for a stream control service, by itself,
<span class="bcp14">MUST</span> uniquely specify the
update stream instance that it controls.
The stream control server <span class="bcp14">MUST NOT</span> use other properties of an HTTP request,
such as cookies or the client's IP address,
to determine the update stream.
Furthermore, an update stream server <span class="bcp14">MUST NOT</span> reuse a control service URI
once the associated update stream has been closed.<a href="#section-7.1-1" class="pilcrow">¶</a></p>
<p id="section-7.1-2">
The ALTO client <span class="bcp14">MUST</span> evaluate a relative control URI
reference <span>[<a href="#RFC3986" class="xref">RFC3986</a>]</span>
(for example, a URI reference without a host or with a relative path)
in the context of the URI used to create the update stream.
The stream control service's host <span class="bcp14">MAY</span> be different
from the update stream's host.<a href="#section-7.1-2" class="pilcrow">¶</a></p>
<p id="section-7.1-3">
It is expected that there is an internal mechanism to map a stream control
URI to the unique update stream instance to be controlled. For example,
the update stream service may assign a unique, internal stream id to
each update stream instance. However, the exact
mechanism is left to the update stream service provider.<a href="#section-7.1-3" class="pilcrow">¶</a></p>
<p id="section-7.1-4">
To prevent an attacker from forging a stream control URI and
sending bogus requests to disrupt other update streams, the service
should consider two security issues. First, if http, not https, is
used, the stream control URI can be exposed to an on-path attacker.
To address this issue, in a setting where the path from the server
to the client can traverse such an attacker, the server <span class="bcp14">SHOULD</span> use
https. Second, even without direct exposure, an off-path attacker
may guess valid stream control URIs. To address this issue, the
server <span class="bcp14">SHOULD</span> choose stream control URIs with enough randomness to
make guessing difficult; the server <span class="bcp14">SHOULD</span> introduce mechanisms
that detect repeated guesses indicating an attack (e.g., keeping
track of the number of failed stream control attempts). Please see
the W3C's "Good Practices for Capability URLs"
<span><<a href="https://www.w3.org/TR/capability-urls/">https://www.w3.org/TR/capability-urls/</a>></span>.<a href="#section-7.1-4" class="pilcrow">¶</a></p>
</section>
<section id="section-7.2">
<h3 id="name-media-type-2">
<a href="#section-7.2" class="section-number selfRef">7.2. </a><a href="#name-media-type-2" class="section-name selfRef">Media Type</a>
</h3>
<p id="section-7.2-1">
An ALTO stream control response does not have
a specific media type.<a href="#section-7.2-1" class="pilcrow">¶</a></p>
</section>
<section id="section-7.3">
<h3 id="name-http-method-2">
<a href="#section-7.3" class="section-number selfRef">7.3. </a><a href="#name-http-method-2" class="section-name selfRef">HTTP Method</a>
</h3>
<p id="section-7.3-1">
An ALTO update stream control resource is requested using the HTTP POST method.<a href="#section-7.3-1" class="pilcrow">¶</a></p>
</section>
<section id="section-7.4">
<h3 id="name-ird-capabilities-uses">
<a href="#section-7.4" class="section-number selfRef">7.4. </a><a href="#name-ird-capabilities-uses" class="section-name selfRef">IRD Capabilities & Uses</a>
</h3>
<p id="section-7.4-1">
None (Stream control services do not appear in the IRD).<a href="#section-7.4-1" class="pilcrow">¶</a></p>
</section>
<div id="ControlStream.media-type">
<section id="section-7.5">
<h3 id="name-request-accept-input-paramet">
<a href="#section-7.5" class="section-number selfRef">7.5. </a><a href="#name-request-accept-input-paramet" class="section-name selfRef">Request: Accept Input Parameters</a>
</h3>
<p id="section-7.5-1">
A stream control service accepts the same input media
type and input parameters as the update stream service
(<a href="#UpdateInput.media-type" class="xref">Section 6.5</a>).
The only difference is that a stream control service
also accepts the "remove" field.<a href="#section-7.5-1" class="pilcrow">¶</a></p>
<p id="section-7.5-2">
If specified, the "remove" field is an array of substream-ids
the ALTO client previously added to this update stream.
An empty "remove" array is equivalent to a list
of all currently active resources; the update stream server responds
by removing all resources and closing the stream.<a href="#section-7.5-2" class="pilcrow">¶</a></p>
<p id="section-7.5-3">
An ALTO client <span class="bcp14">MAY</span> use the "add" field to add additional resources.
The ALTO client <span class="bcp14">MUST</span> assign a unique substream-id to each additional
resource. Substream-ids <span class="bcp14">MUST</span> be unique over the lifetime
of this update stream; an ALTO client <span class="bcp14">MUST NOT</span> reuse
a previously removed substream-id. The processing of an "add" resource
is the same as discussed in Sections <a href="#UpdateInput.media-type" class="xref">6.5</a> and <a href="#UpdateStreamService.Response" class="xref">6.6</a>.<a href="#section-7.5-3" class="pilcrow">¶</a></p>
<p id="section-7.5-4">If a request has any errors, the update stream server <span class="bcp14">MUST NOT</span> add or remove any resources from the associated update
stream. Also, the stream control server will return an error response
to the client, as specified in <a href="#ControlStream.Response" class="xref">Section 7.6</a>.<a href="#section-7.5-4" class="pilcrow">¶</a></p>
</section>
</div>
<div id="ControlStream.Response">
<section id="section-7.6">
<h3 id="name-response-2">
<a href="#section-7.6" class="section-number selfRef">7.6. </a><a href="#name-response-2" class="section-name selfRef">Response</a>
</h3>
<p id="section-7.6-1">
The stream control server <span class="bcp14">MUST</span> process the "add" field before the
"remove" field. If the request removes all active resources without adding
any additional resources, the update stream server <span class="bcp14">MUST</span>
close the update stream.
Thus, an update stream cannot have zero resources.<a href="#section-7.6-1" class="pilcrow">¶</a></p>
<p id="section-7.6-2">
If the request has any errors, the stream control server
<span class="bcp14">MUST</span> return
an HTTP "400 Bad Request" to the ALTO client.
The body part of the
response follows the generic ALTO error response format specified
in <span><a href="https://www.rfc-editor.org/rfc/rfc7285#section-8.5.2" class="relref">Section 8.5.2</a> of [<a href="#RFC7285" class="xref">RFC7285</a>]</span>.
An error response has the same format as specified in
<a href="#UpdateStreamService.Response" class="xref">Section 6.6</a>. Detailed error code and
error
information are specified as below.<a href="#section-7.6-2" class="pilcrow">¶</a></p>
<ul class="normal">
<li class="normal" id="section-7.6-3.1">
If the "add" request does not satisfy the requirements in
<a href="#UpdateInput.media-type" class="xref">Section 6.5</a>, the stream control server <span class="bcp14">MUST</span>
return the ALTO error message defined in
<a href="#UpdateStreamService.Response" class="xref">Section 6.6</a>.<a href="#section-7.6-3.1" class="pilcrow">¶</a>
</li>
<li class="normal" id="section-7.6-3.2">If any substream-id in the "remove" field was not added in a
prior request, the error code of the error message
<span class="bcp14">MUST</span> be E_INVALID_FIELD_VALUE, the "field" field
<span class="bcp14">SHOULD</span> be "remove", and the "value" field
<span class="bcp14">SHOULD</span> be an array of the invalid
substream-ids. Thus, it is illegal to "add" and "remove" the same
substream-id in the same request. However, it is legal to remove a
substream-id twice. To support the preceding checking, the update
stream server <span class="bcp14">MUST</span> keep track of previously used but
now closed substream-ids.<a href="#section-7.6-3.2" class="pilcrow">¶</a>
</li>
<li class="normal" id="section-7.6-3.3">
If any substream-id in the "add" field has been used before in this stream,
the error code of the error message <span class="bcp14">MUST</span> be E_INVALID_FIELD_VALUE, the
"field" field <span class="bcp14">SHOULD</span> be "add", and the "value" field <span class="bcp14">SHOULD</span> be
an array of invalid substream-ids.<a href="#section-7.6-3.3" class="pilcrow">¶</a>
</li>
<li class="normal" id="section-7.6-3.4">If the request has a non-empty "add" field and a "remove" field
with an empty list of substream-ids (to replace all active resources
with a new set, the client <span class="bcp14">MUST</span> explicitly enumerate
the substream-ids to be removed), the error code of the error
message <span class="bcp14">MUST</span> be E_INVALID_FIELD_VALUE, the "field"
field <span class="bcp14">SHOULD</span> be "remove", and the "value" field
<span class="bcp14">SHOULD</span> be an empty array.<a href="#section-7.6-3.4" class="pilcrow">¶</a>
</li>
</ul>
<p id="section-7.6-4">
If the request is valid but the associated update stream has been
closed, then the stream control server <span class="bcp14">MUST</span> return an HTTP "404 Not
Found".<a href="#section-7.6-4" class="pilcrow">¶</a></p>
<p id="section-7.6-5">If the request is valid and the stream control server successfully
processes the request without error, the stream control server should
return either an HTTP "202 Accepted" response or an HTTP "204 No
Content" response. The difference is that for the latter case, the
stream control server is sure that the update stream server has also
processed the request. Regardless of a 202 or 204 HTTP response, the
final updates of related resources will be notified by the update
stream server using its control update message(s), due to the modular
design.<a href="#section-7.6-5" class="pilcrow">¶</a></p>
</section>
</div>
</section>
</div>
<div id="Examples">
<section id="section-8">
<h2 id="name-examples">
<a href="#section-8" class="section-number selfRef">8. </a><a href="#name-examples" class="section-name selfRef">Examples</a>
</h2>
<div id="IRD.example">
<section id="section-8.1">
<h3 id="name-example-ird-announcing-upda">
<a href="#section-8.1" class="section-number selfRef">8.1. </a><a href="#name-example-ird-announcing-upda" class="section-name selfRef">Example: IRD Announcing Update Stream Services</a>
</h3>
<p id="section-8.1-1">
Below is an example IRD announcing three
update stream services.
The first, which is named "update-my-costs", provides updates for the network map,
the "routingcost" and "hopcount" cost maps,
and a Filtered Cost Map resource.
The second, which is named "update-my-prop", provides updates to the
endpoint properties service.
The third, which is named "update-my-pv", provides updates to a
nonstandard ALTO service returning a multipart response.<a href="#section-8.1-1" class="pilcrow">¶</a></p>
<p id="section-8.1-2">
Note that in the "update-my-costs" update stream shown in the example
IRD, the update stream server uses JSON patch for network map, and it
uses JSON merge patch to update the other resources. Also, the update
stream will only provide full replacements for
"my-simple-filtered-cost-map".<a href="#section-8.1-2" class="pilcrow">¶</a></p>
<p id="section-8.1-3">
Also, note that this IRD defines two Filtered Cost Map resources.
They use the same cost types,
but "my-filtered-cost-map" accepts cost constraint tests,
while "my-simple-filtered-cost-map" does not.
To avoid the issues discussed in <a href="#UpdateStreamService.FCMConsiderations" class="xref">Section 9.3</a>,
the update stream provides updates for the second
but not the first.<a href="#section-8.1-3" class="pilcrow">¶</a></p>
<p id="section-8.1-4">This IRD also announces a nonstandard ALTO service, which is named
"my-pv". This service accepts an extended endpoint cost request as an
input and returns a multipart response, including an endpoint cost
resource and a property map resource. This document does not rely on
any other design details of this new service. In this document, the
"my-pv" service is only used to illustrate how the update stream
service provides updates to an ALTO resource returning a multipart
response.<a href="#section-8.1-4" class="pilcrow">¶</a></p>
<div id="section-8.1-5">
<pre class="sourcecode lang-json">
"my-network-map": {
"uri": "https://alto.example.com/networkmap",
"media-type": "application/alto-networkmap+json",
},
"my-routingcost-map": {
"uri": "https://alto.example.com/costmap/routingcost",
"media-type": "application/alto-costmap+json",
"uses": ["my-networkmap"],
"capabilities": {
"cost-type-names": ["num-routingcost"]
}
},
"my-hopcount-map": {
"uri": "https://alto.example.com/costmap/hopcount",
"media-type": "application/alto-costmap+json",
"uses": ["my-networkmap"],
"capabilities": {
"cost-type-names": ["num-hopcount"]
}
},
"my-filtered-cost-map": {
"uri": "https://alto.example.com/costmap/filtered/constraints",
"media-type": "application/alto-costmap+json",
"accepts": "application/alto-costmapfilter+json",
"uses": ["my-networkmap"],
"capabilities": {
"cost-type-names": ["num-routingcost", "num-hopcount"],
"cost-constraints": true
}
},
"my-simple-filtered-cost-map": {
"uri": "https://alto.example.com/costmap/filtered/simple",
"media-type": "application/alto-costmap+json",
"accepts": "application/alto-costmapfilter+json",
"uses": ["my-networkmap"],
"capabilities": {
"cost-type-names": ["num-routingcost", "num-hopcount"],
"cost-constraints": false
}
},
"my-props": {
"uri": "https://alto.example.com/properties",
"media-type": "application/alto-endpointprops+json",
"accepts": "application/alto-endpointpropparams+json",
"capabilities": {
"prop-types": ["priv:ietf-bandwidth"]
}
},
"my-pv": {
"uri": "https://alto.example.com/endpointcost/pv",
"media-type": "multipart/related;
type=application/alto-endpointcost+json",
"accepts": "application/alto-endpointcostparams+json",
"capabilities": {
"cost-type-names": [ "path-vector" ],
"ane-properties": [ "maxresbw", "persistent-entities" ]
}
},
"update-my-costs": {
"uri": "https://alto.example.com/updates/costs",
"media-type": "text/event-stream",
"accepts": "application/alto-updatestreamparams+json",
"uses": [
"my-network-map",
"my-routingcost-map",
"my-hopcount-map",
"my-simple-filtered-cost-map"
],
"capabilities": {
"incremental-change-media-types": {
"my-network-map": "application/json-patch+json",
"my-routingcost-map": "application/merge-patch+json",
"my-hopcount-map": "application/merge-patch+json"
},
"support-stream-control": true
}
},
"update-my-props": {
"uri": "https://alto.example.com/updates/properties",
"media-type": "text/event-stream",
"uses": [ "my-props" ],
"accepts": "application/alto-updatestreamparams+json",
"capabilities": {
"incremental-change-media-types": {
"my-props": "application/merge-patch+json"
},
"support-stream-control": true
}
},
"update-my-pv": {
"uri": "https://alto.example.com/updates/pv",
"media-type": "text/event-stream",
"uses": [ "my-pv" ],
"accepts": "application/alto-updatestreamparams+json",
"capabilities": {
"incremental-change-media-types": {
"my-pv": "application/merge-patch+json"
},
"support-stream-control": true
}
}
</pre><a href="#section-8.1-5" class="pilcrow">¶</a>
</div>
</section>
</div>
<section id="section-8.2">
<h3 id="name-example-simple-network-and-">
<a href="#section-8.2" class="section-number selfRef">8.2. </a><a href="#name-example-simple-network-and-" class="section-name selfRef">Example: Simple Network and Cost Map Updates</a>
</h3>
<p id="section-8.2-1">
Given the update streams announced in the preceding example IRD, the
section below shows an example of an ALTO client's request and the
update stream server's immediate response,
using the update stream resource "update-my-costs".
In the example, the ALTO client requests updates for the network map and
"routingcost" cost map but not for the "hopcount" cost map.
The ALTO client uses the ALTO server's resource-ids as the substream-ids.
Because the client does not provide a "tag" for the network map,
the update stream server must send a full replacement for the network map
as well as for the cost map.
The ALTO client does not set "incremental-changes" to "false",
so it defaults to "true".
Thus, the update stream server will send patch updates for the cost map and the network map.<a href="#section-8.2-1" class="pilcrow">¶</a></p>
<div id="section-8.2-2">
<pre class="sourcecode">
POST /updates/costs HTTP/1.1
Host: alto.example.com
Accept: text/event-stream,application/alto-error+json
Content-Type: application/alto-updatestreamparams+json
Content-Length: 155
{ "add": {
"my-network-map": {
"resource-id": "my-network-map"
},
"my-routingcost-map": {
"resource-id": "my-routingcost-map"
}
}
}
</pre><a href="#section-8.2-2" class="pilcrow">¶</a>
</div>
<div id="section-8.2-3">
<pre class="sourcecode">
HTTP/1.1 200 OK
Connection: keep-alive
Content-Type: text/event-stream
event: application/alto-updatestreamcontrol+json
data: {"control-uri":
data: "https://alto.example.com/updates/streams/3141592653589"}
event: application/alto-networkmap+json,my-network-map
data: {
data: "meta" : {
data: "vtag": {
data: "resource-id" : "my-network-map",
data: "tag" : "da65eca2eb7a10ce8b059740b0b2e3f8eb1d4785"
data: }
data: },
data: "network-map" : {
data: "PID1" : {
data: "ipv4" : [ "192.0.2.0/24", "198.51.100.0/25" ]
data: },
data: "PID2" : {
data: "ipv4" : [ "198.51.100.128/25" ]
data: },
data: "PID3" : {
data: "ipv4" : [ "0.0.0.0/0" ],
data: "ipv6" : [ "::/0" ]
data: }
data: }
data: }
data: }
event: application/alto-costmap+json,my-routingcost-map
data: {
data: "meta" : {
data: "dependent-vtags" : [{
data: "resource-id": "my-network-map",
data: "tag": "da65eca2eb7a10ce8b059740b0b2e3f8eb1d4785"
data: }],
data: "cost-type" : {
data: "cost-mode" : "numerical",
data: "cost-metric": "routingcost"
data: },
data: "vtag": {
data: "resource-id" : "my-routingcost-map",
data: "tag" : "3ee2cb7e8d63d9fab71b9b34cbf764436315542e"
data: }
data: },
data: "cost-map" : {
data: "PID1": { "PID1": 1, "PID2": 5, "PID3": 10 },
data: "PID2": { "PID1": 5, "PID2": 1, "PID3": 15 },
data: "PID3": { "PID1": 20, "PID2": 15 }
data: }
data: }
</pre><a href="#section-8.2-3" class="pilcrow">¶</a>
</div>
<p id="section-8.2-4">
After sending those events immediately,
the update stream server will send additional events
as the maps change. For example, the following
represents a small change to the cost map. PID1->PID2 is changed to
9 from 5, PID3->PID1 is no longer available, and PID3->PID3 is
now defined as 1:<a href="#section-8.2-4" class="pilcrow">¶</a></p>
<div id="section-8.2-5">
<pre class="sourcecode">
event: application/merge-patch+json,my-routingcost-map
data: {
data: "meta" : {
data: "vtag": {
data: "tag": "c0ce023b8678a7b9ec00324673b98e54656d1f6d"
data: }
data: },
data: "cost-map": {
data: "PID1" : { "PID2" : 9 },
data: "PID3" : { "PID1" : null, "PID3" : 1 }
data: }
data: }
</pre><a href="#section-8.2-5" class="pilcrow">¶</a>
</div>
<p id="section-8.2-6">As another example, the following represents a change to the
network map: an ipv4 prefix "203.0.113.0/25" is added to PID1. It
triggers changes to the cost map. The update stream server chooses to
send an incremental change for the network map and send a full
replacement instead of an incremental change for the cost map:<a href="#section-8.2-6" class="pilcrow">¶</a></p>
<div id="section-8.2-7">
<pre class="sourcecode">
event: application/json-patch+json,my-network-map
data: {
data: {
data: "op": "replace",
data: "path": "/meta/vtag/tag",
data: "value" :"a10ce8b059740b0b2e3f8eb1d4785acd42231bfe"
data: },
data: {
data: "op": "add",
data: "path": "/network-map/PID1/ipv4/2",
data: "value": "203.0.113.0/25"
data: }
data: }
event: application/alto-costmap+json,my-routingcost-map
data: {
data: "meta" : {
data: "vtag": {
data: "tag": "c0ce023b8678a7b9ec00324673b98e54656d1f6d"
data: }
data: },
data: "cost-map" : {
data: "PID1": { "PID1": 1, "PID2": 3, "PID3": 7 },
data: "PID2": { "PID1": 12, "PID2": 1, "PID3": 9 },
data: "PID3": { "PID1": 14, "PID2": 8 }
data: }
data: }
</pre><a href="#section-8.2-7" class="pilcrow">¶</a>
</div>
</section>
<section id="section-8.3">
<h3 id="name-example-advanced-network-an">
<a href="#section-8.3" class="section-number selfRef">8.3. </a><a href="#name-example-advanced-network-an" class="section-name selfRef">Example: Advanced Network and Cost Map Updates</a>
</h3>
<p id="section-8.3-1">
This example is similar to the previous one,
except that the ALTO client requests updates for the "hopcount" cost map
as well as the "routingcost" cost map
and provides the current version tag of the network map,
so the update stream server is not required to send
the full network map data update message
at the beginning of the stream.
In this example, the client uses the substream-ids "net",
"routing", and "hops" for those resources.
The update stream server sends the stream control URI and the full cost maps,
followed by updates for the network map
and cost maps as they become available:<a href="#section-8.3-1" class="pilcrow">¶</a></p>
<div id="section-8.3-2">
<pre class="sourcecode">
POST /updates/costs HTTP/1.1
Host: alto.example.com
Accept: text/event-stream,application/alto-error+json
Content-Type: application/alto-updatestreamparams+json
Content-Length: 244
{ "add": {
"net": {
"resource-id": "my-network-map",
"tag": "a10ce8b059740b0b2e3f8eb1d4785acd42231bfe"
},
"routing": {
"resource-id": "my-routingcost-map"
},
"hops": {
"resource-id": "my-hopcount-map"
}
}
}
</pre><a href="#section-8.3-2" class="pilcrow">¶</a>
</div>
<div id="section-8.3-3">
<pre class="sourcecode">
HTTP/1.1 200 OK
Connection: keep-alive
Content-Type: text/event-stream
event: application/alto-updatestreamcontrol+json
data: {"control-uri":
data: "https://alto.example.com/updates/streams/2718281828459"}
event: application/alto-costmap+json,routing
data: { ... full routingcost cost map message ... }
event: application/alto-costmap+json,hops
data: { ... full hopcount cost map message ... }
(pause)
event: application/merge-patch+json,routing
data: {"cost-map": {"PID2" : {"PID3" : 31}}}
event: application/merge-patch+json,hops
data: {"cost-map": {"PID2" : {"PID3" : 4}}}
</pre><a href="#section-8.3-3" class="pilcrow">¶</a>
</div>
<p id="section-8.3-4">
If the ALTO client wishes to stop receiving updates for the "hopcount"
cost map, the ALTO client can send a "remove" request
on the stream control URI:<a href="#section-8.3-4" class="pilcrow">¶</a></p>
<div id="section-8.3-5">
<pre class="sourcecode">
POST /updates/streams/2718281828459 HTTP/1.1
Host: alto.example.com
Accept: text/plain,application/alto-error+json
Content-Type: application/alto-updatestreamparams+json
Content-Length: 24
{
"remove": [ "hops" ]
}
HTTP/1.1 204 No Content
Content-Length: 0
(stream closed without sending data content)
</pre><a href="#section-8.3-5" class="pilcrow">¶</a>
</div>
<p id="section-8.3-6">
The update stream server sends a "stopped" control update message on the
original request stream to inform the ALTO client
that updates are stopped for that resource:<a href="#section-8.3-6" class="pilcrow">¶</a></p>
<div id="section-8.3-7">
<pre class="sourcecode">
event: application/alto-updatestreamcontrol+json
data: {
data: "stopped": ["hops"]
data: }
</pre><a href="#section-8.3-7" class="pilcrow">¶</a>
</div>
<p id="section-8.3-8">Below is an example of an invalid stream control request. The
"remove" field of the request includes an undefined substream-id, and
the stream control server will return an error response to the ALTO
client.<a href="#section-8.3-8" class="pilcrow">¶</a></p>
<div id="section-8.3-9">
<pre class="sourcecode">
POST /updates/streams/2718281828459 HTTP/1.1
Host: alto.example.com
Accept: text/plain,application/alto-error+json
Content-Type: application/alto-updatestreamparams+json
Content-Length: 31
{
"remove": [ "properties" ]
}
HTTP/1.1 400 Bad Request
Content-Length: 89
Content-Type: application/alto-error+json
{
"meta":{
"code": "E_INVALID_FIELD_VALUE",
"field": "remove",
"value": "properties"
}
</pre><a href="#section-8.3-9" class="pilcrow">¶</a>
</div>
<p id="section-8.3-10">
If the ALTO client no longer needs any updates
and wishes to shut the update stream down gracefully,
the client can send a "remove" request
with an empty array:<a href="#section-8.3-10" class="pilcrow">¶</a></p>
<div id="section-8.3-11">
<pre class="sourcecode">
POST /updates/streams/2718281828459 HTTP/1.1
Host: alto.example.com
Accept: text/plain,application/alto-error+json
Content-Type: application/alto-updatestreamparams+json
Content-Length: 17
{
"remove": [ ]
}
HTTP/1.1 204 No Content
Content-Length: 0
(stream closed without sending data content)
</pre><a href="#section-8.3-11" class="pilcrow">¶</a>
</div>
<p id="section-8.3-12">
The update stream server sends a final control update message on the
original request stream to inform the ALTO client
that all updates are stopped and then closes the stream:<a href="#section-8.3-12" class="pilcrow">¶</a></p>
<div id="section-8.3-13">
<pre class="sourcecode">
event: application/alto-updatestreamcontrol+json
data: {
data: "stopped": ["net", "routing"]
data: }
(server closes stream)
</pre><a href="#section-8.3-13" class="pilcrow">¶</a>
</div>
</section>
<section id="section-8.4">
<h3 id="name-example-endpoint-property-u">
<a href="#section-8.4" class="section-number selfRef">8.4. </a><a href="#name-example-endpoint-property-u" class="section-name selfRef">Example: Endpoint Property Updates</a>
</h3>
<p id="section-8.4-1">
As another example, here is how an ALTO client can request updates
for the property "priv:ietf-bandwidth" for one set of endpoints
and "priv:ietf-load" for another.
The update stream server immediately sends full replacements
with the property values for all endpoints.
After that, the update stream server sends data update messages
for the individual endpoints as their property values change.<a href="#section-8.4-1" class="pilcrow">¶</a></p>
<div id="section-8.4-2">
<pre class="sourcecode">
POST /updates/properties HTTP/1.1
Host: alto.example.com
Accept: text/event-stream
Content-Type: application/alto-updatestreamparams+json
Content-Length: 511
{ "add": {
"props-1": {
"resource-id": "my-props",
"input": {
"properties" : [ "priv:ietf-bandwidth" ],
"endpoints" : [
"ipv4:198.51.100.1",
"ipv4:198.51.100.2",
"ipv4:198.51.100.3"
]
}
},
"props-2": {
"resource-id": "my-props",
"input": {
"properties" : [ "priv:ietf-load" ],
"endpoints" : [
"ipv6:2001:db8:100::1",
"ipv6:2001:db8:100::2",
"ipv6:2001:db8:100::3"
]
}
}
}
}
</pre><a href="#section-8.4-2" class="pilcrow">¶</a>
</div>
<div id="section-8.4-3">
<pre class="sourcecode">
HTTP/1.1 200 OK
Connection: keep-alive
Content-Type: text/event-stream
event: application/alto-updatestreamcontrol+json
data: {"control-uri":
data: "https://alto.example.com/updates/streams/1414213562373"}
event: application/alto-endpointprops+json,props-1
data: { "endpoint-properties": {
data: "ipv4:198.51.100.1" : { "priv:ietf-bandwidth": "13" },
data: "ipv4:198.51.100.2" : { "priv:ietf-bandwidth": "42" },
data: "ipv4:198.51.100.3" : { "priv:ietf-bandwidth": "27" }
data: } }
event: application/alto-endpointprops+json,props-2
data: { "endpoint-properties": {
data: "ipv6:2001:db8:100::1" : { "priv:ietf-load": "8" },
data: "ipv6:2001:db8:100::2" : { "priv:ietf-load": "2" },
data: "ipv6:2001:db8:100::3" : { "priv:ietf-load": "9" }
data: } }
(pause)
event: application/merge-patch+json,props-1
data: { "endpoint-properties":
data: {"ipv4:198.51.100.1" : {"priv:ietf-bandwidth": "3"}}
data: }
(pause)
event: application/merge-patch+json,props-2
data: { "endpoint-properties":
data: {"ipv6:2001:db8:100::3" : {"priv:ietf-load": "7"}}
data: }
</pre><a href="#section-8.4-3" class="pilcrow">¶</a>
</div>
<p id="section-8.4-4">
If the ALTO client needs the "priv:ietf-bandwidth" property and
the "priv:ietf-load" property
for additional endpoints,
the ALTO client can send an "add" request
on the stream control URI:<a href="#section-8.4-4" class="pilcrow">¶</a></p>
<div id="section-8.4-5">
<pre class="sourcecode">
POST /updates/streams/1414213562373" HTTP/1.1
Host: alto.example.com
Accept: text/plain,application/alto-error+json
Content-Type: application/alto-updatestreamparams+json
Content-Length: 448
{ "add": {
"props-3": {
"resource-id": "my-props",
"input": {
"properties" : [ "priv:ietf-bandwidth" ],
"endpoints" : [
"ipv4:198.51.100.4",
"ipv4:198.51.100.5"
]
}
},
"props-4": {
"resource-id": "my-props",
"input": {
"properties" : [ "priv:ietf-load" ],
"endpoints" : [
"ipv6:2001:db8:100::4",
"ipv6:2001:db8:100::5"
]
}
}
}
}
HTTP/1.1 204 No Content
Content-Length: 0
(stream closed without sending data content)
</pre><a href="#section-8.4-5" class="pilcrow">¶</a>
</div>
<p id="section-8.4-6">
The update stream server sends full replacements
for the two new resources, followed by incremental
changes for all four requests as they arrive:<a href="#section-8.4-6" class="pilcrow">¶</a></p>
<div id="section-8.4-7">
<pre class="sourcecode">
event: application/alto-endpointprops+json,props-3
data: { "endpoint-properties": {
data: "ipv4:198.51.100.4" : { "priv:ietf-bandwidth": "25" },
data: "ipv4:198.51.100.5" : { "priv:ietf-bandwidth": "31" },
data: } }
event: application/alto-endpointprops+json,props-4
data: { "endpoint-properties": {
data: "ipv6:2001:db8:100::4" : { "priv:ietf-load": "6" },
data: "ipv6:2001:db8:100::5" : { "priv:ietf-load": "4" },
data: } }
(pause)
event: application/merge-patch+json,props-3
data: { "endpoint-properties":
data: {"ipv4:198.51.100.5" : {"priv:ietf-bandwidth": "15"}}
data: }
(pause)
event: application/merge-patch+json,props-2
data: { "endpoint-properties":
data: {"ipv6:2001:db8:100::2" : {"priv:ietf-load": "9"}}
data: }
(pause)
event: application/merge-patch+json,props-4
data: { "endpoint-properties":
data: {"ipv6:2001:db8:100::4" : {"priv:ietf-load": "3"}}
data: }
</pre><a href="#section-8.4-7" class="pilcrow">¶</a>
</div>
</section>
<div id="Multipart.Example">
<section id="section-8.5">
<h3 id="name-example-multipart-message-u">
<a href="#section-8.5" class="section-number selfRef">8.5. </a><a href="#name-example-multipart-message-u" class="section-name selfRef">Example: Multipart Message Updates</a>
</h3>
<p id="section-8.5-1">
This example shows how an ALTO client can request a nonstandard ALTO
service returning a multipart response. The update stream server
immediately sends full replacements of the multipart response. After
that, the update stream server sends data update messages for the
individual parts of the response as the ALTO data (object) in each
part changes.<a href="#section-8.5-1" class="pilcrow">¶</a></p>
<div id="section-8.5-2">
<pre class="sourcecode">
POST /updates/pv HTTP/1.1
Host: alto.example.com
Accept: text/event-stream
Content-Type: application/alto-updatestreamparams+json
Content-Length: 382
{
"add": {
"ecspvsub1": {
"resource-id": "my-pv",
"input": {
"cost-type": {
"cost-mode": "array",
"cost-metric": "ane-path"
},
"endpoints": {
"srcs": [ "ipv4:192.0.2.2" ],
"dsts": [ "ipv4:192.0.2.89", "ipv4:203.0.113.45" ]
},
"ane-properties": [ "maxresbw", "persistent-entities" ]
}
}
}
}
</pre><a href="#section-8.5-2" class="pilcrow">¶</a>
</div>
<div id="section-8.5-3">
<pre class="sourcecode">
HTTP/1.1 200 OK
Connection: keep-alive
Content-Type: text/event-stream
event: application/alto-updatestreamcontrol+json
data: {"control-uri":
data: "https://alto.example.com/updates/streams/1414"}
event: multipart/related;boundary=example-pv;
type=application/alto-endpointcost+json,ecspvsub1
data: --example-pv
data: Content-ID: ecsmap
data: Content-Type: application/alto-endpointcost+json
data:
data: { ... data (object) of an endpoint cost map ... }
data: --example-pv
data: Content-ID: propmap
data: Content-Type: application/alto-propmap+json
data:
data: { ... data (object) of a property map ... }
data: --example-pv--
(pause)
event: application/merge-patch+json,ecspvsub1.ecsmap
data: { ... merge patch for updates of ecspvsub1.ecsmap ... }
event: application/merge-patch+json,ecspvsub1.propmap
data: { ... merge patch for updates of ecspvsub1.propmap ... }
</pre><a href="#section-8.5-3" class="pilcrow">¶</a>
</div>
</section>
</div>
</section>
</div>
<div id="OperationProcessingConsiderations">
<section id="section-9">
<h2 id="name-operation-and-processing-co">
<a href="#section-9" class="section-number selfRef">9. </a><a href="#name-operation-and-processing-co" class="section-name selfRef">Operation and Processing Considerations</a>
</h2>
<div id="IncrUpdChoice">
<section id="section-9.1">
<h3 id="name-considerations-for-choosing">
<a href="#section-9.1" class="section-number selfRef">9.1. </a><a href="#name-considerations-for-choosing" class="section-name selfRef">Considerations for Choosing Data Update Messages</a>
</h3>
<p id="section-9.1-1">
The update stream server should be cognizant of the effects of
its update schedule, which includes both the choice of timing
(i.e., when/what to trigger an update) and the choice of message
format (i.e., given an update, send a full replacement or an
incremental change). In particular, the update schedule can have
effects on both the overhead and the freshness of information. To
minimize overhead, the server may choose to batch a sequence of
updates for resources that frequently change by sending
cumulative updates or a full replacement after a while. The
update stream server should be cognizant that batching reduces
the freshness of information. The server should also consider the
effect of such delays on client behaviors (see below on client
timeout on waiting for updates of dependent resources).<a href="#section-9.1-1" class="pilcrow">¶</a></p>
<p id="section-9.1-2">
For incremental updates, this design allows both JSON patch and JSON
merge patch for incremental changes. JSON merge patch is clearly
superior to JSON patch for describing incremental changes to
cost maps, endpoint costs, and endpoint properties.
For these data structures, JSON merge patch is more space efficient,
as well as simpler to apply. There is no advantage allowing a server
to use JSON patch for those resources.<a href="#section-9.1-2" class="pilcrow">¶</a></p>
<p id="section-9.1-3">
The case is not as clear for incremental changes to network maps.<a href="#section-9.1-3" class="pilcrow">¶</a></p>
<p id="section-9.1-4">
First, consider small changes, such as moving a prefix from one PID to another.
JSON patch could encode that as a simple insertion and deletion,
while JSON merge patch would have to replace the entire array of prefixes
for both PIDs.
On the other hand, to process a JSON patch update,
the ALTO client would have to retain the indexes of the prefixes for each PID.
Logically, the prefixes in a PID are an unordered set,
not an array; aside from handling updates,
a client has no need to retain the array indexes of the prefixes.
Hence, to take advantage of JSON patch for network maps,
ALTO clients would have to retain additional, otherwise unnecessary, data.<a href="#section-9.1-4" class="pilcrow">¶</a></p>
<p id="section-9.1-5">
Second, consider more involved changes, such as removing half of the
prefixes from a PID. JSON merge patch would send a new array for
that PID, while JSON patch would have to send a list of remove
operations and delete the prefix one by one.<a href="#section-9.1-5" class="pilcrow">¶</a></p>
<p id="section-9.1-6">
Therefore, each update stream server may decide on its own whether
to use JSON merge patch or JSON patch according to the changes in
network maps.<a href="#section-9.1-6" class="pilcrow">¶</a></p>
</section>
</div>
<div id="ClientActions">
<section id="section-9.2">
<h3 id="name-considerations-for-client-p">
<a href="#section-9.2" class="section-number selfRef">9.2. </a><a href="#name-considerations-for-client-p" class="section-name selfRef">Considerations for Client Processing Data Update Messages</a>
</h3>
<p id="section-9.2-1">
In general, when an ALTO client receives a full replacement
for a resource, the ALTO client should replace the current version
with the new version.
When an ALTO client receives an incremental change
for a resource, the ALTO client should apply those patches
to the current version of the resource.<a href="#section-9.2-1" class="pilcrow">¶</a></p>
<p id="section-9.2-2">
However, because resources can depend on other resources
(e.g., cost maps depend on network maps),
an ALTO client <span class="bcp14">MUST NOT</span> use a dependent resource
if the resource on which it depends has changed.
There are at least two ways an ALTO client can do that.
The following paragraphs illustrate these techniques by referring to
network and cost map messages,
although these techniques apply to any dependent resources.<a href="#section-9.2-2" class="pilcrow">¶</a></p>
<p id="section-9.2-3">
Note that when a network map changes,
the update stream server <span class="bcp14">MUST</span> send the network map update message
before sending the updates for the dependent cost maps
(see <a href="#UpdateStreamService.Response.Sequence" class="xref">Section 6.7.1</a>).<a href="#section-9.2-3" class="pilcrow">¶</a></p>
<p id="section-9.2-4">
One approach is for the ALTO client to save
the network map update message in a buffer
and continue to use the previous network map
and the associated cost maps
until the ALTO client receives the update messages
for all dependent cost maps.
The ALTO client then applies all network and cost map updates atomically.<a href="#section-9.2-4" class="pilcrow">¶</a></p>
<p id="section-9.2-5">Alternatively, the ALTO client <span class="bcp14">MAY</span> update the
network map immediately. In this case, the cost maps using the network
map become invalid because they are inconsistent with the current
network map; hence, the ALTO client <span class="bcp14">MUST</span> mark each such
dependent cost map as temporarily invalid and <span class="bcp14">MUST NOT</span>
use each such cost map until the ALTO client receives a cost map
update message indicating that it is based on the new network map
version tag.<a href="#section-9.2-5" class="pilcrow">¶</a></p>
<p id="section-9.2-6">The update stream server <span class="bcp14">SHOULD</span> send updates for
dependent resources (i.e., the cost maps in the preceding example) in
a timely fashion. However, if the ALTO client does not receive the
expected updates, a simple recovery method is that the ALTO client
closes the update stream connection, discards the dependent resources,
and reestablishes the update stream. The ALTO client
<span class="bcp14">MAY</span> retain the version tag of the last version of any
tagged resources and give those version tags when requesting the new
update stream. In this case, if a version is still current, the update
stream server will not resend that resource.<a href="#section-9.2-6" class="pilcrow">¶</a></p>
<p id="section-9.2-7">
Although not as efficient as possible, this recovery method is simple and reliable.<a href="#section-9.2-7" class="pilcrow">¶</a></p>
</section>
</div>
<div id="UpdateStreamService.FCMConsiderations">
<section id="section-9.3">
<h3 id="name-considerations-for-updates-">
<a href="#section-9.3" class="section-number selfRef">9.3. </a><a href="#name-considerations-for-updates-" class="section-name selfRef">Considerations for Updates to Filtered Cost Maps</a>
</h3>
<p id="section-9.3-1">If an update stream provides updates to a Filtered Cost Map that
allows constraint tests, then an ALTO client <span class="bcp14">MAY</span>
request updates to a Filtered Cost Map request with a constraint
test. In this case, when a cost changes, the update stream server
<span class="bcp14">MUST</span> send an update if the new value satisfies the
test. If the new value does not, whether the update stream server
sends an update depends on whether the previous value satisfied the
test. If it did not, the update stream server <span class="bcp14">SHOULD NOT</span> send an update to the ALTO client. But if the previous
value did, then the update stream server <span class="bcp14">MUST</span> send an
update with a "null" value to inform the ALTO client that this cost no
longer satisfies the criteria.<a href="#section-9.3-1" class="pilcrow">¶</a></p>
<p id="section-9.3-2">An update stream server can avoid having to handle such a
complicated behavior by offering update streams only for Filtered Cost
Maps that do not allow constraint tests.<a href="#section-9.3-2" class="pilcrow">¶</a></p>
</section>
</div>
<div id="UpdateStreamService.OrdinalConsiderations">
<section id="section-9.4">
<h3 id="name-considerations-for-updates-t">
<a href="#section-9.4" class="section-number selfRef">9.4. </a><a href="#name-considerations-for-updates-t" class="section-name selfRef">Considerations for Updates to Ordinal Mode Costs</a>
</h3>
<p id="section-9.4-1">
For an ordinal mode cost map, a change to a single cost point
may require updating many other costs.
As an extreme example, suppose the lowest cost changes to the highest cost.
For a numerical mode cost map, only that one cost changes.
But for an ordinal mode cost map, every cost might change.
While this document allows an update stream server to offer incremental updates
for ordinal mode cost maps, update stream server implementors should be aware
that incremental updates for ordinal costs are more complicated
than for numerical costs, and ALTO clients should be aware that
small changes may result in large updates.<a href="#section-9.4-1" class="pilcrow">¶</a></p>
<p id="section-9.4-2">
An update stream server can avoid this complication
by only offering full replacements for ordinal cost maps.<a href="#section-9.4-2" class="pilcrow">¶</a></p>
</section>
</div>
<div id="UpdateStreamService.SSELineLengthConsiderations">
<section id="section-9.5">
<h3 id="name-considerations-for-sse-text">
<a href="#section-9.5" class="section-number selfRef">9.5. </a><a href="#name-considerations-for-sse-text" class="section-name selfRef">Considerations for SSE Text Formatting and Processing</a>
</h3>
<p id="section-9.5-1">
SSE was designed for events that consist of relatively small amounts
of line-oriented text data, and SSE clients frequently read input one
line at a time. However, an update stream sends a full cost map as a
single events, and a cost map may involve megabytes, if not tens of
megabytes, of text. This has implications that the ALTO client and the
update stream server may consider.<a href="#section-9.5-1" class="pilcrow">¶</a></p>
<p id="section-9.5-2">
First, some SSE client libraries read all data for an event into
memory and then present it to the client as a character
array. However, a client may not have enough memory to hold the
entire JSON text for a large cost map. Hence, an ALTO client
<span class="bcp14">SHOULD</span> consider using an SSE library that presents
the event data in manageable chunks, so the ALTO client can parse
the cost map incrementally and store the underlying data in a more
compact format.<a href="#section-9.5-2" class="pilcrow">¶</a></p>
<p id="section-9.5-3">
Second, an SSE client library may use a low-level, generic socket
read library that stores each line of an event data, just in case
the higher-level parser may need the line delimiters as part of the
protocol formatting. A server sending a complete cost map as a
single line may then generate a multi-megabyte data "line", and such
a long line may then require complex memory management at the
client. It is <span class="bcp14">RECOMMENDED</span> that an update stream
server limit the lengths of data lines.<a href="#section-9.5-3" class="pilcrow">¶</a></p>
<p id="section-9.5-4">
Third, an SSE server may use a library, which may put line breaks in
places that would have semantic consequences for the ALTO updates;
see <a href="#FutureDesignConsiderations" class="xref">Section 11</a>. The update stream
server implementation <span class="bcp14">MUST</span> ensure that no line breaks
are introduced to change the semantics.<a href="#section-9.5-4" class="pilcrow">¶</a></p>
</section>
</div>
</section>
</div>
<div id="Security">
<section id="section-10">
<h2 id="name-security-considerations">
<a href="#section-10" class="section-number selfRef">10. </a><a href="#name-security-considerations" class="section-name selfRef">Security Considerations</a>
</h2>
<p id="section-10-1">
The security considerations (<span><a href="https://www.rfc-editor.org/rfc/rfc7285#section-15" class="relref">Section 15</a> of [<a href="#RFC7285" class="xref">RFC7285</a>]</span>) of the base protocol fully
apply to this extension. For example, the same authenticity and
integrity considerations (<span><a href="https://www.rfc-editor.org/rfc/rfc7285#section-15.1" class="relref">Section 15.1</a> of [<a href="#RFC7285" class="xref">RFC7285</a>]</span>) still fully
apply; the same considerations for the privacy of ALTO users (<span><a href="https://www.rfc-editor.org/rfc/rfc7285#section-15.4" class="relref">Section 15.4</a> of [<a href="#RFC7285" class="xref">RFC7285</a>]</span>) also still fully
apply.<a href="#section-10-1" class="pilcrow">¶</a></p>
<p id="section-10-2">
The additional services (addition of update streams and stream
control URIs) provided by this extension extend the attack surface
described in <span><a href="https://www.rfc-editor.org/rfc/rfc7285#section-15.1.1" class="relref">Section 15.1.1</a> of [<a href="#RFC7285" class="xref">RFC7285</a>]</span>. Below, we
discuss the additional risks and their remedies.<a href="#section-10-2" class="pilcrow">¶</a></p>
<section id="section-10.1">
<h3 id="name-update-stream-server-denial">
<a href="#section-10.1" class="section-number selfRef">10.1. </a><a href="#name-update-stream-server-denial" class="section-name selfRef">Update Stream Server: Denial-of-Service Attacks</a>
</h3>
<p id="section-10.1-1">
Allowing persistent update stream connections
enables a new class of Denial-of-Service attacks.<a href="#section-10.1-1" class="pilcrow">¶</a></p>
<p id="section-10.1-2">For the update stream server, an ALTO client might create an unreasonable
number of update stream connections
or add an unreasonable number of substream-ids
to one update stream.<a href="#section-10.1-2" class="pilcrow">¶</a></p>
<p id="section-10.1-3">
To avoid these attacks on the update stream server, the server <span class="bcp14">SHOULD</span> choose
to limit the number of active streams and
reject new requests when that threshold is reached.
An update stream server <span class="bcp14">SHOULD</span> also choose to limit the number of active
substream-ids on any given stream or limit the total
number of substream-ids used over the lifetime of a stream
and reject any stream control request
that would exceed those limits.
In these cases, the update stream server <span class="bcp14">SHOULD</span> return
the HTTP status "503 Service Unavailable".<a href="#section-10.1-3" class="pilcrow">¶</a></p>
<p id="section-10.1-4">It is important to note that the preceding approaches are not the
only possibilities. For example, it may be possible for the update
stream server to use somewhat more clever logic involving IP
reputation, rate-limiting, and compartmentalization of the overall
threshold into smaller thresholds that apply to subsets of potential
clients.<a href="#section-10.1-4" class="pilcrow">¶</a></p>
<p id="section-10.1-5">
While the preceding techniques prevent update stream DoS attacks from disrupting
an update stream server's other services, it does make it easier
for a DoS attack to disrupt the update stream service.
Therefore, an update stream server <span class="bcp14">MAY</span> prefer to restrict update stream
services to authorized clients, as discussed in <span><a href="https://www.rfc-editor.org/rfc/rfc7285#section-15" class="relref">Section 15</a> of [<a href="#RFC7285" class="xref">RFC7285</a>]</span>.<a href="#section-10.1-5" class="pilcrow">¶</a></p>
<p id="section-10.1-6">
Alternatively, an update stream server <span class="bcp14">MAY</span> return
the HTTP status "307 Temporary Redirect"
to redirect the client to another ALTO server
that can better handle a large number of update streams.<a href="#section-10.1-6" class="pilcrow">¶</a></p>
</section>
<section id="section-10.2">
<h3 id="name-alto-client-update-overload">
<a href="#section-10.2" class="section-number selfRef">10.2. </a><a href="#name-alto-client-update-overload" class="section-name selfRef">ALTO Client: Update Overloading or Instability</a>
</h3>
<p id="section-10.2-1">The availability of continuous updates can also cause overload for
an ALTO client, in particular, an ALTO client with limited processing
capabilities. The current design does not include any flow control
mechanisms for the client to reduce the update rates from the
server. Under overloading, the client <span class="bcp14">MAY</span> choose to
remove the information resources with high update rates.<a href="#section-10.2-1" class="pilcrow">¶</a></p>
<p id="section-10.2-2">Also, under overloading, the client may no longer be able to detect
whether information is still fresh or has become stale. In such a
case, the client should be careful in how it uses the information to
avoid stability or efficiency issues.<a href="#section-10.2-2" class="pilcrow">¶</a></p>
</section>
<section id="section-10.3">
<h3 id="name-stream-control-spoofed-cont">
<a href="#section-10.3" class="section-number selfRef">10.3. </a><a href="#name-stream-control-spoofed-cont" class="section-name selfRef">Stream Control: Spoofed Control Requests and Information Breakdown</a>
</h3>
<p id="section-10.3-1">
An outside party that can read the update stream response
or that can observe stream control requests
can obtain the control URI and use that
to send a fraudulent "remove" requests,
thus disabling updates for the valid ALTO client.
This can be avoided by encrypting the update stream
and stream control requests
(see <span><a href="https://www.rfc-editor.org/rfc/rfc7285#section-15" class="relref">Section 15</a> of [<a href="#RFC7285" class="xref">RFC7285</a>]</span>).
Also, the update stream server echoes the "remove" requests
on the update stream, so the valid ALTO client can detect
unauthorized requests.<a href="#section-10.3-1" class="pilcrow">¶</a></p>
<p id="section-10.3-2">In general, as the architecture allows the possibility for the update
stream server and the stream control server to be different entities, the
additional risks should be evaluated and remedied. For example, the
private communication path between the servers may be attacked, resulting
in a risk of communications breakdown between them, as well as invalid or
spoofed messages claiming to be on that private communications path. Proper
security mechanisms, including confidentiality, authenticity, and integrity
mechanisms, should be considered.<a href="#section-10.3-2" class="pilcrow">¶</a></p>
</section>
</section>
</div>
<div id="FutureDesignConsiderations">
<section id="section-11">
<h2 id="name-requirements-on-future-alto">
<a href="#section-11" class="section-number selfRef">11. </a><a href="#name-requirements-on-future-alto" class="section-name selfRef">Requirements on Future ALTO Services to Use This Design</a>
</h2>
<p id="section-11-1">Although this design is quite flexible, it has underlying requirements.<a href="#section-11-1" class="pilcrow">¶</a></p>
<p id="section-11-2">The key requirements are that (1) each data update message is for a
single resource and (2) an incremental change can be applied only to a
resource that is a single JSON object, as both JSON merge patch and JSON
patch can apply only to a single JSON object. Hence, if a future ALTO
resource can contain multiple objects, then either each individual
object also has a resource-id or an extension to this design is made.<a href="#section-11-2" class="pilcrow">¶</a></p>
<p id="section-11-3">At the low-level encoding level, new line in SSE has its own
semantics. Hence, this design requires that resource encoding does not
include new lines that can be confused with SSE encoding. In particular,
the
data update message <span class="bcp14">MUST NOT</span> include "event: " or "data:
" at a new line as part of data message.<a href="#section-11-3" class="pilcrow">¶</a></p>
<p id="section-11-4">If an update stream provides updates to a Filtered Cost Map that
allows constraint tests, the requirements for such services are stated
in <a href="#UpdateStreamService.FCMConsiderations" class="xref">Section 9.3</a>.<a href="#section-11-4" class="pilcrow">¶</a></p>
</section>
</div>
<div id="IANA">
<section id="section-12">
<h2 id="name-iana-considerations">
<a href="#section-12" class="section-number selfRef">12. </a><a href="#name-iana-considerations" class="section-name selfRef">IANA Considerations</a>
</h2>
<p id="section-12-1">
This document defines two new media types:
"application/alto-updatestreamparams+json",
as described in <a href="#UpdateInput.media-type" class="xref">Section 6.5</a>,
and "application/alto-updatestreamcontrol+json",
as described in <a href="#ALTO.SSE.ControlEvents" class="xref">Section 5.3</a>.
All other media types used in this document have already been registered,
either for ALTO, JSON merge patch, or JSON patch.<a href="#section-12-1" class="pilcrow">¶</a></p>
<div id="IANA.UpsateStreamParams">
<section id="section-12.1">
<h3 id="name-application-alto-updatestre">
<a href="#section-12.1" class="section-number selfRef">12.1. </a><a href="#name-application-alto-updatestre" class="section-name selfRef">application/alto-updatestreamparams+json Media Type</a>
</h3>
<span class="break"></span><dl class="dlParallel" id="section-12.1-1">
<dt id="section-12.1-1.1">Type name:</dt>
<dd style="margin-left: 1.5em" id="section-12.1-1.2">application<a href="#section-12.1-1.2" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-12.1-1.3">Subtype name:</dt>
<dd style="margin-left: 1.5em" id="section-12.1-1.4">alto-updatestreamparams+json<a href="#section-12.1-1.4" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-12.1-1.5">Required parameters:</dt>
<dd style="margin-left: 1.5em" id="section-12.1-1.6">N/A<a href="#section-12.1-1.6" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-12.1-1.7">Optional parameters:</dt>
<dd style="margin-left: 1.5em" id="section-12.1-1.8">N/A<a href="#section-12.1-1.8" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-12.1-1.9">Encoding considerations:</dt>
<dd style="margin-left: 1.5em" id="section-12.1-1.10">Encoding considerations are
identical to those specified for the "application/json" media type. See
<span>[<a href="#RFC8259" class="xref">RFC8259</a>]</span>.<a href="#section-12.1-1.10" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-12.1-1.11">Security considerations:</dt>
<dd style="margin-left: 1.5em" id="section-12.1-1.12">Security considerations relating
to the generation and consumption of ALTO Protocol messages are
discussed in <a href="#Security" class="xref">Section 10</a> of RFC 8895
and <span><a href="https://www.rfc-editor.org/rfc/rfc7285#section-15" class="relref">Section 15</a> of [<a href="#RFC7285" class="xref">RFC7285</a>]</span>.<a href="#section-12.1-1.12" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-12.1-1.13">Interoperability considerations:</dt>
<dd style="margin-left: 1.5em" id="section-12.1-1.14">RFC 8895 specifies
format of conforming messages and the interpretation thereof.<a href="#section-12.1-1.14" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-12.1-1.15">Published specification:</dt>
<dd style="margin-left: 1.5em" id="section-12.1-1.16">
<a href="#UpdateInput.media-type" class="xref">Section 6.5</a>
of RFC 8895.<a href="#section-12.1-1.16" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-12.1-1.17">Applications that use this media type:</dt>
<dd style="margin-left: 1.5em" id="section-12.1-1.18">ALTO servers and
ALTO clients either stand alone or are embedded within other
applications.<a href="#section-12.1-1.18" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-12.1-1.19">Fragment identifier considerations:</dt>
<dd style="margin-left: 1.5em" id="section-12.1-1.20">N/A<a href="#section-12.1-1.20" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-12.1-1.21">Additional information:</dt>
<dd style="margin-left: 1.5em" id="section-12.1-1.22">
<p id="section-12.1-1.22.1"><br></p>
<span class="break"></span><dl class="dlParallel" id="section-12.1-1.22.2">
<dt id="section-12.1-1.22.2.1">Deprecated alias names for this type:</dt>
<dd style="margin-left: 1.5em" id="section-12.1-1.22.2.2">N/A<a href="#section-12.1-1.22.2.2" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-12.1-1.22.2.3">Magic number(s):</dt>
<dd style="margin-left: 1.5em" id="section-12.1-1.22.2.4">N/A<a href="#section-12.1-1.22.2.4" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-12.1-1.22.2.5">File extension(s):</dt>
<dd style="margin-left: 1.5em" id="section-12.1-1.22.2.6">RFC 8895 uses the media type
to refer to protocol messages and thus does not require a file
extension.<a href="#section-12.1-1.22.2.6" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-12.1-1.22.2.7">Macintosh file type code(s):</dt>
<dd style="margin-left: 1.5em" id="section-12.1-1.22.2.8">N/A<a href="#section-12.1-1.22.2.8" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
</dl>
</dd>
<dd class="break"></dd>
<dt id="section-12.1-1.23">Person & email address to contact for further information:</dt>
<dd style="margin-left: 1.5em" id="section-12.1-1.24">
See Authors' Addresses section.<a href="#section-12.1-1.24" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-12.1-1.25">Intended usage:</dt>
<dd style="margin-left: 1.5em" id="section-12.1-1.26">COMMON<a href="#section-12.1-1.26" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-12.1-1.27">Restrictions on usage:</dt>
<dd style="margin-left: 1.5em" id="section-12.1-1.28">N/A<a href="#section-12.1-1.28" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-12.1-1.29">Author:</dt>
<dd style="margin-left: 1.5em" id="section-12.1-1.30">See Authors' Addresses section.<a href="#section-12.1-1.30" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-12.1-1.31">Change controller:</dt>
<dd style="margin-left: 1.5em" id="section-12.1-1.32">Internet Engineering Task Force (mailto:iesg@ietf.org).<a href="#section-12.1-1.32" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
</dl>
</section>
</div>
<div id="IANA.UpsateStreamControl">
<section id="section-12.2">
<h3 id="name-application-alto-updatestrea">
<a href="#section-12.2" class="section-number selfRef">12.2. </a><a href="#name-application-alto-updatestrea" class="section-name selfRef">application/alto-updatestreamcontrol+json Media Type</a>
</h3>
<span class="break"></span><dl class="dlParallel" id="section-12.2-1">
<dt id="section-12.2-1.1">Type name:</dt>
<dd style="margin-left: 1.5em" id="section-12.2-1.2">application<a href="#section-12.2-1.2" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-12.2-1.3">Subtype name:</dt>
<dd style="margin-left: 1.5em" id="section-12.2-1.4">alto-updatestreamcontrol+json<a href="#section-12.2-1.4" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-12.2-1.5">Required parameters:</dt>
<dd style="margin-left: 1.5em" id="section-12.2-1.6">N/A<a href="#section-12.2-1.6" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-12.2-1.7">Optional parameters:</dt>
<dd style="margin-left: 1.5em" id="section-12.2-1.8">N/A<a href="#section-12.2-1.8" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-12.2-1.9">Encoding considerations:</dt>
<dd style="margin-left: 1.5em" id="section-12.2-1.10">Encoding considerations are
identical to those specified for the "application/json" media type. See
<span>[<a href="#RFC8259" class="xref">RFC8259</a>]</span>.<a href="#section-12.2-1.10" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-12.2-1.11">Security considerations:</dt>
<dd style="margin-left: 1.5em" id="section-12.2-1.12">Security considerations relating
to the generation and consumption of ALTO Protocol messages are
discussed in <a href="#Security" class="xref">Section 10</a> of RFC 8895
and <span><a href="https://www.rfc-editor.org/rfc/rfc7285#section-15" class="relref">Section 15</a> of [<a href="#RFC7285" class="xref">RFC7285</a>]</span>.<a href="#section-12.2-1.12" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-12.2-1.13">Interoperability considerations:</dt>
<dd style="margin-left: 1.5em" id="section-12.2-1.14">RFC 8895 specifies
format of conforming messages and the interpretation thereof.<a href="#section-12.2-1.14" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-12.2-1.15">Published specification:</dt>
<dd style="margin-left: 1.5em" id="section-12.2-1.16">
<a href="#ALTO.SSE.ControlEvents" class="xref">Section 5.3</a>
of RFC 8895.<a href="#section-12.2-1.16" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-12.2-1.17">Applications that use this media type:</dt>
<dd style="margin-left: 1.5em" id="section-12.2-1.18">ALTO servers and
ALTO clients either stand alone or are embedded within other
applications.<a href="#section-12.2-1.18" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-12.2-1.19">Fragment identifier considerations:</dt>
<dd style="margin-left: 1.5em" id="section-12.2-1.20">N/A<a href="#section-12.2-1.20" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-12.2-1.21">Additional information:</dt>
<dd style="margin-left: 1.5em" id="section-12.2-1.22">
<p id="section-12.2-1.22.1"><br></p>
<span class="break"></span><dl class="dlParallel" id="section-12.2-1.22.2">
<dt id="section-12.2-1.22.2.1">Deprecated alias names for this type:</dt>
<dd style="margin-left: 1.5em" id="section-12.2-1.22.2.2">N/A<a href="#section-12.2-1.22.2.2" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-12.2-1.22.2.3">Magic number(s):</dt>
<dd style="margin-left: 1.5em" id="section-12.2-1.22.2.4">N/A<a href="#section-12.2-1.22.2.4" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-12.2-1.22.2.5">File extension(s):</dt>
<dd style="margin-left: 1.5em" id="section-12.2-1.22.2.6">RFC 8895 uses the media type
to refer to protocol messages and thus does not require a file
extension.<a href="#section-12.2-1.22.2.6" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-12.2-1.22.2.7">Macintosh file type code(s):</dt>
<dd style="margin-left: 1.5em" id="section-12.2-1.22.2.8">N/A<a href="#section-12.2-1.22.2.8" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
</dl>
</dd>
<dd class="break"></dd>
<dt id="section-12.2-1.23">Person & email address to contact for further information:</dt>
<dd style="margin-left: 1.5em" id="section-12.2-1.24">
See Authors' Addresses section.<a href="#section-12.2-1.24" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-12.2-1.25">Intended usage:</dt>
<dd style="margin-left: 1.5em" id="section-12.2-1.26">COMMON<a href="#section-12.2-1.26" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-12.2-1.27">Restrictions on usage:</dt>
<dd style="margin-left: 1.5em" id="section-12.2-1.28">N/A<a href="#section-12.2-1.28" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-12.2-1.29">Author:</dt>
<dd style="margin-left: 1.5em" id="section-12.2-1.30">See Authors' Addresses section.<a href="#section-12.2-1.30" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
<dt id="section-12.2-1.31">Change controller:</dt>
<dd style="margin-left: 1.5em" id="section-12.2-1.32">Internet Engineering Task Force (mailto:iesg@ietf.org).<a href="#section-12.2-1.32" class="pilcrow">¶</a>
</dd>
<dd class="break"></dd>
</dl>
</section>
</div>
</section>
</div>
<div id="DesignDecisions">
<section id="section-13">
<h2 id="name-appendix-design-decision-no">
<a href="#section-13" class="section-number selfRef">13. </a><a href="#name-appendix-design-decision-no" class="section-name selfRef">Appendix: Design Decision: Not Allowing Stream Restart</a>
</h2>
<p id="section-13-1">
If an update stream is closed accidentally,
when the ALTO client reconnects, the update stream server must
resend the full maps.
This is clearly inefficient.
To avoid that inefficiency,
the SSE specification allows an update stream server to assign an id
to each event. When an ALTO client reconnects,
the ALTO client can present the id of the last successfully
received event, and the update stream server restarts with the
next event.<a href="#section-13-1" class="pilcrow">¶</a></p>
<p id="section-13-2">
However, that mechanism adds additional complexity.
The update stream server must save SSE messages in a buffer
in case ALTO clients reconnect.
But that mechanism will never be perfect:
If the ALTO client waits too long to reconnect
or if the ALTO client sends an invalid ID,
then the update stream server will have to resend the complete maps anyway.<a href="#section-13-2" class="pilcrow">¶</a></p>
<p id="section-13-3">
Furthermore, this is unlikely to be a problem in practice.
ALTO clients who want continuous updates for large resources,
such as full network and cost maps,
are likely to be things like P2P trackers.
These ALTO clients will be well connected to the network;
they will rarely drop connections.<a href="#section-13-3" class="pilcrow">¶</a></p>
<p id="section-13-4">
Mobile devices certainly can and do drop connections
and will have to reconnect.
But mobile devices will not need continuous updates
for multi-megabyte cost maps.
If mobile devices need continuous updates at all,
they will need them for small queries,
such as the costs from a small set of media servers
from which the device can stream the currently playing movie.
If the mobile device drops the connection and reestablishes the update stream,
the update stream server will have to retransmit only a small amount
of redundant data.<a href="#section-13-4" class="pilcrow">¶</a></p>
<p id="section-13-5">
In short, using event ids to avoid resending the full map
adds a considerable amount of complexity to avoid a situation that
is very rare. The complexity is not worth the benefit.<a href="#section-13-5" class="pilcrow">¶</a></p>
<p id="section-13-6">
The update stream service does allow the ALTO client
to specify the tag of the last received version of any tagged
resource, and if that is still current, the update stream server need not
retransmit the full resource.
Hence, ALTO clients can use this to avoid retransmitting full network maps.
Cost maps are not tagged, so this will not work for them.
Of course, the ALTO protocol could be extended by adding version tags
to cost maps, which would solve the retransmission-on-reconnect problem.
However, adding tags to cost maps might add a new set of complications.<a href="#section-13-6" class="pilcrow">¶</a></p>
</section>
</div>
<section id="section-14">
<h2 id="name-references">
<a href="#section-14" class="section-number selfRef">14. </a><a href="#name-references" class="section-name selfRef">References</a>
</h2>
<section id="section-14.1">
<h3 id="name-normative-references">
<a href="#section-14.1" class="section-number selfRef">14.1. </a><a href="#name-normative-references" class="section-name selfRef">Normative References</a>
</h3>
<dl class="references">
<dt id="RFC2119">[RFC2119]</dt>
<dd>
<span class="refAuthor">Bradner, S.</span>, <span class="refTitle">"Key words for use in RFCs to Indicate Requirement Levels"</span>, <span class="seriesInfo">BCP 14</span>, <span class="seriesInfo">RFC 2119</span>, <span class="seriesInfo">DOI 10.17487/RFC2119</span>, <time datetime="1997-03" class="refDate">March 1997</time>, <span><<a href="https://www.rfc-editor.org/info/rfc2119">https://www.rfc-editor.org/info/rfc2119</a>></span>. </dd>
<dd class="break"></dd>
<dt id="RFC2387">[RFC2387]</dt>
<dd>
<span class="refAuthor">Levinson, E.</span>, <span class="refTitle">"The MIME Multipart/Related Content-type"</span>, <span class="seriesInfo">RFC 2387</span>, <span class="seriesInfo">DOI 10.17487/RFC2387</span>, <time datetime="1998-08" class="refDate">August 1998</time>, <span><<a href="https://www.rfc-editor.org/info/rfc2387">https://www.rfc-editor.org/info/rfc2387</a>></span>. </dd>
<dd class="break"></dd>
<dt id="RFC3986">[RFC3986]</dt>
<dd>
<span class="refAuthor">Berners-Lee, T.</span><span class="refAuthor">, Fielding, R.</span><span class="refAuthor">, and L. Masinter</span>, <span class="refTitle">"Uniform Resource Identifier (URI): Generic Syntax"</span>, <span class="seriesInfo">STD 66</span>, <span class="seriesInfo">RFC 3986</span>, <span class="seriesInfo">DOI 10.17487/RFC3986</span>, <time datetime="2005-01" class="refDate">January 2005</time>, <span><<a href="https://www.rfc-editor.org/info/rfc3986">https://www.rfc-editor.org/info/rfc3986</a>></span>. </dd>
<dd class="break"></dd>
<dt id="RFC6838">[RFC6838]</dt>
<dd>
<span class="refAuthor">Freed, N.</span><span class="refAuthor">, Klensin, J.</span><span class="refAuthor">, and T. Hansen</span>, <span class="refTitle">"Media Type Specifications and Registration Procedures"</span>, <span class="seriesInfo">BCP 13</span>, <span class="seriesInfo">RFC 6838</span>, <span class="seriesInfo">DOI 10.17487/RFC6838</span>, <time datetime="2013-01" class="refDate">January 2013</time>, <span><<a href="https://www.rfc-editor.org/info/rfc6838">https://www.rfc-editor.org/info/rfc6838</a>></span>. </dd>
<dd class="break"></dd>
<dt id="RFC6902">[RFC6902]</dt>
<dd>
<span class="refAuthor">Bryan, P., Ed.</span><span class="refAuthor"> and M. Nottingham, Ed.</span>, <span class="refTitle">"JavaScript Object Notation (JSON) Patch"</span>, <span class="seriesInfo">RFC 6902</span>, <span class="seriesInfo">DOI 10.17487/RFC6902</span>, <time datetime="2013-04" class="refDate">April 2013</time>, <span><<a href="https://www.rfc-editor.org/info/rfc6902">https://www.rfc-editor.org/info/rfc6902</a>></span>. </dd>
<dd class="break"></dd>
<dt id="RFC7285">[RFC7285]</dt>
<dd>
<span class="refAuthor">Alimi, R., Ed.</span><span class="refAuthor">, Penno, R., Ed.</span><span class="refAuthor">, Yang, Y., Ed.</span><span class="refAuthor">, Kiesel, S.</span><span class="refAuthor">, Previdi, S.</span><span class="refAuthor">, Roome, W.</span><span class="refAuthor">, Shalunov, S.</span><span class="refAuthor">, and R. Woundy</span>, <span class="refTitle">"Application-Layer Traffic Optimization (ALTO) Protocol"</span>, <span class="seriesInfo">RFC 7285</span>, <span class="seriesInfo">DOI 10.17487/RFC7285</span>, <time datetime="2014-09" class="refDate">September 2014</time>, <span><<a href="https://www.rfc-editor.org/info/rfc7285">https://www.rfc-editor.org/info/rfc7285</a>></span>. </dd>
<dd class="break"></dd>
<dt id="RFC7396">[RFC7396]</dt>
<dd>
<span class="refAuthor">Hoffman, P.</span><span class="refAuthor"> and J. Snell</span>, <span class="refTitle">"JSON Merge Patch"</span>, <span class="seriesInfo">RFC 7396</span>, <span class="seriesInfo">DOI 10.17487/RFC7396</span>, <time datetime="2014-10" class="refDate">October 2014</time>, <span><<a href="https://www.rfc-editor.org/info/rfc7396">https://www.rfc-editor.org/info/rfc7396</a>></span>. </dd>
<dd class="break"></dd>
<dt id="RFC8174">[RFC8174]</dt>
<dd>
<span class="refAuthor">Leiba, B.</span>, <span class="refTitle">"Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words"</span>, <span class="seriesInfo">BCP 14</span>, <span class="seriesInfo">RFC 8174</span>, <span class="seriesInfo">DOI 10.17487/RFC8174</span>, <time datetime="2017-05" class="refDate">May 2017</time>, <span><<a href="https://www.rfc-editor.org/info/rfc8174">https://www.rfc-editor.org/info/rfc8174</a>></span>. </dd>
<dd class="break"></dd>
<dt id="RFC8259">[RFC8259]</dt>
<dd>
<span class="refAuthor">Bray, T., Ed.</span>, <span class="refTitle">"The JavaScript Object Notation (JSON) Data Interchange Format"</span>, <span class="seriesInfo">STD 90</span>, <span class="seriesInfo">RFC 8259</span>, <span class="seriesInfo">DOI 10.17487/RFC8259</span>, <time datetime="2017-12" class="refDate">December 2017</time>, <span><<a href="https://www.rfc-editor.org/info/rfc8259">https://www.rfc-editor.org/info/rfc8259</a>></span>. </dd>
<dd class="break"></dd>
<dt id="SSE">[SSE]</dt>
<dd>
<span class="refAuthor">Hickson, I.</span>, <span class="refTitle">"Server-Sent Events"</span>, <span class="refContent">W3C Recommendation</span>, <time datetime="2015-02" class="refDate">February 2015</time>, <span><<a href="https://www.w3.org/TR/eventsource/">https://www.w3.org/TR/eventsource/</a>></span>. </dd>
<dd class="break"></dd>
</dl>
</section>
<section id="section-14.2">
<h3 id="name-informative-references">
<a href="#section-14.2" class="section-number selfRef">14.2. </a><a href="#name-informative-references" class="section-name selfRef">Informative References</a>
</h3>
<dl class="references">
<dt id="RFC4960">[RFC4960]</dt>
<dd>
<span class="refAuthor">Stewart, R., Ed.</span>, <span class="refTitle">"Stream Control Transmission Protocol"</span>, <span class="seriesInfo">RFC 4960</span>, <span class="seriesInfo">DOI 10.17487/RFC4960</span>, <time datetime="2007-09" class="refDate">September 2007</time>, <span><<a href="https://www.rfc-editor.org/info/rfc4960">https://www.rfc-editor.org/info/rfc4960</a>></span>. </dd>
<dd class="break"></dd>
<dt id="RFC5789">[RFC5789]</dt>
<dd>
<span class="refAuthor">Dusseault, L.</span><span class="refAuthor"> and J. Snell</span>, <span class="refTitle">"PATCH Method for HTTP"</span>, <span class="seriesInfo">RFC 5789</span>, <span class="seriesInfo">DOI 10.17487/RFC5789</span>, <time datetime="2010-03" class="refDate">March 2010</time>, <span><<a href="https://www.rfc-editor.org/info/rfc5789">https://www.rfc-editor.org/info/rfc5789</a>></span>. </dd>
<dd class="break"></dd>
<dt id="RFC7230">[RFC7230]</dt>
<dd>
<span class="refAuthor">Fielding, R., Ed.</span><span class="refAuthor"> and J. Reschke, Ed.</span>, <span class="refTitle">"Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing"</span>, <span class="seriesInfo">RFC 7230</span>, <span class="seriesInfo">DOI 10.17487/RFC7230</span>, <time datetime="2014-06" class="refDate">June 2014</time>, <span><<a href="https://www.rfc-editor.org/info/rfc7230">https://www.rfc-editor.org/info/rfc7230</a>></span>. </dd>
<dd class="break"></dd>
<dt id="RFC7231">[RFC7231]</dt>
<dd>
<span class="refAuthor">Fielding, R., Ed.</span><span class="refAuthor"> and J. Reschke, Ed.</span>, <span class="refTitle">"Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content"</span>, <span class="seriesInfo">RFC 7231</span>, <span class="seriesInfo">DOI 10.17487/RFC7231</span>, <time datetime="2014-06" class="refDate">June 2014</time>, <span><<a href="https://www.rfc-editor.org/info/rfc7231">https://www.rfc-editor.org/info/rfc7231</a>></span>. </dd>
<dd class="break"></dd>
<dt id="RFC7540">[RFC7540]</dt>
<dd>
<span class="refAuthor">Belshe, M.</span><span class="refAuthor">, Peon, R.</span><span class="refAuthor">, and M. Thomson, Ed.</span>, <span class="refTitle">"Hypertext Transfer Protocol Version 2 (HTTP/2)"</span>, <span class="seriesInfo">RFC 7540</span>, <span class="seriesInfo">DOI 10.17487/RFC7540</span>, <time datetime="2015-05" class="refDate">May 2015</time>, <span><<a href="https://www.rfc-editor.org/info/rfc7540">https://www.rfc-editor.org/info/rfc7540</a>></span>. </dd>
<dd class="break"></dd>
</dl>
</section>
</section>
<div id="Acknowledgments">
<section id="section-appendix.a">
<h2 id="name-acknowledgments">
<a href="#name-acknowledgments" class="section-name selfRef">Acknowledgments</a>
</h2>
<p id="section-appendix.a-1">Thank you to <span class="contact-name">Dawn Chen</span> (Tongji University),
<span class="contact-name">Shawn Lin</span> (Tongji University), and <span class="contact-name">Xiao Shi</span> (Yale University) for their contributions to an
earlier version of this document.<a href="#section-appendix.a-1" class="pilcrow">¶</a></p>
</section>
</div>
<div id="Contributors">
<section id="section-appendix.b">
<h2 id="name-contributors">
<a href="#name-contributors" class="section-name selfRef">Contributors</a>
</h2>
<p id="section-appendix.b-1">Sections <a href="#Terms" class="xref">2</a>, <a href="#ALTO.SSE.EventFormat" class="xref">5.1</a>, <a href="#ALTO.SSE.UpdateEvents" class="xref">5.2</a>, and <a href="#Multipart.Example" class="xref">8.5</a>
of this document are based on contributions from <span class="contact-name">Jingxuan Jensen Zhang</span>, and he is considered an author.<a href="#section-appendix.b-1" class="pilcrow">¶</a></p>
</section>
</div>
<div id="authors-addresses">
<section id="section-appendix.c">
<h2 id="name-authors-addresses">
<a href="#name-authors-addresses" class="section-name selfRef">Authors' Addresses</a>
</h2>
<address class="vcard">
<div dir="auto" class="left"><span class="fn nameRole">Wendy Roome</span></div>
<div dir="auto" class="left"><span class="org">Nokia Bell Labs (Retired)</span></div>
<div dir="auto" class="left"><span class="street-address">124 Burlington Rd</span></div>
<div dir="auto" class="left">
<span class="locality">Murray Hill</span>, <span class="region">NJ</span> <span class="postal-code">07974</span>
</div>
<div dir="auto" class="left"><span class="country-name">United States of America</span></div>
<div class="tel">
<span>Phone:</span>
<a href="tel:+1-908-464-6975" class="tel">+1-908-464-6975</a>
</div>
<div class="email">
<span>Email:</span>
<a href="mailto:wendy@wdroome.com" class="email">wendy@wdroome.com</a>
</div>
</address>
<address class="vcard">
<div dir="auto" class="left"><span class="fn nameRole">Y. Richard Yang</span></div>
<div dir="auto" class="left"><span class="org">Yale University</span></div>
<div dir="auto" class="left"><span class="street-address">51 Prospect St</span></div>
<div dir="auto" class="left">
<span class="locality">New Haven</span>, <span class="region">CT</span> </div>
<div dir="auto" class="left"><span class="country-name">United States of America</span></div>
<div class="email">
<span>Email:</span>
<a href="mailto:yry@cs.yale.edu" class="email">yry@cs.yale.edu</a>
</div>
</address>
</section>
</div>
<script>const toc = document.getElementById("toc");
toc.querySelector("h2").addEventListener("click", e => {
toc.classList.toggle("active");
});
toc.querySelector("nav").addEventListener("click", e => {
toc.classList.remove("active");
});
</script>
</body>
</html>
|