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
|
Reliable Data Protocol
RFC-908
David Velten
Robert Hinden
Jack Sax
BBN Communications Corporation
July 1984
Status of This Memo
This RFC specifies a proposed protocol for the ARPA Internet
community, and requests discussion and suggestions for
improvements. Distribution of this memo is unlimited.
^L
^L
RDP Specification
Table of Contents
1 Introduction.......................................... 1
2 General Description................................... 3
2.1 Motivation.......................................... 3
2.2 Relation to Other Protocols......................... 5
3 Protocol Operation.................................... 7
3.1 Protocol Service Objectives......................... 7
3.2 RDP Connection Management........................... 7
3.2.1 Opening a Connection.............................. 8
3.2.2 Ports............................................. 8
3.2.3 Connection States................................. 8
3.2.4 Connection Record................................ 11
3.2.5 Closing a Connection............................. 13
3.2.6 Detecting an Half-Open Connection................ 14
3.3 Data Communication................................. 14
3.4 Reliable Communication............................. 15
3.4.1 Segment Sequence Numbers......................... 15
3.4.2 Checksums........................................ 16
3.4.3 Positive Acknowledgement of Segments............. 16
3.4.4 Retransmission Timeout........................... 17
3.5 Flow Control and Window Management................. 17
3.6 User Interface..................................... 19
3.7 Event Processing................................... 20
3.7.1 User Request Events.............................. 21
3.7.2 Segment Arrival Events........................... 24
3.7.3 Timeout Events................................... 29
4 RDP Segments and Formats............................. 31
4.1 IP Header Format................................... 31
4.2 RDP Header Format.................................. 32
4.2.1 RDP Header Fields................................ 33
4.3 SYN Segment........................................ 36
4.3.1 SYN Segment Format............................... 36
4.3.2 SYN Segment Fields............................... 37
4.4 ACK Segment........................................ 38
4.4.1 ACK Segment Format............................... 38
4.4.2 ACK Segment Fields............................... 39
4.5 Extended ACK Segment............................... 40
4.5.1 EACK Segment Format.............................. 40
4.5.2 EACK Segment Fields.............................. 40
Page i
^L
RFC-908 July 1984
4.6 RST Segment........................................ 42
4.6.1 RST Segment Format............................... 42
4.7 NUL Segment........................................ 43
4.7.1 NUL segment format............................... 43
5 Examples of Operation................................ 45
5.1 Connection Establishment........................... 45
5.2 Simultaneous Connection Establishment.............. 46
5.3 Lost Segments...................................... 47
5.4 Segments Received Out of Order..................... 48
5.5 Communication Over Long Delay Path................. 49
5.6 Communication Over Long Delay Path With Lost
Segments
.................................................... 50
5.7 Detecting a Half-Open Connection on Crash
Recovery
.................................................... 51
5.8 Detecting a Half-Open Connection from the
Active Side
.................................................... 52
A Implementing a Minimal RDP........................... 53
Page ii
^L
RDP Specification
FIGURES
1 Relation to Other Protocols............................ 5
2 Form of Data Exchange Between Layers................... 6
3 RDP Connection State Diagram.......................... 10
4 Segment Format........................................ 31
5 RDP Header Format..................................... 32
6 SYN Segment Format.................................... 37
7 ACK Segment Format.................................... 38
8 EACK Segment Format................................... 41
9 RST Segment Format.................................... 42
10 NUL Segment Format................................... 43
Page iii
^L
^L
CHAPTER 1
Introduction
The Reliable Data Protocol (RDP) is designed to provide a
reliable data transport service for packet-based applications
such as remote loading and debugging. The protocol is intended
to be simple to implement but still be efficient in environments
where there may be long transmission delays and loss or non-
sequential delivery of message segments.
Although this protocol was designed with applications such
as remote loading and debugging in mind, it may be suitable for
other applications that require reliable message services, such
as computer mail, file transfer, transaction processing, etc.
Some of the concepts used come from a variety of sources.
The authors wish credit to be given to Eric Rosen, Rob Gurwitz,
Jack Haverty, and to acknowledge material adapted from "RFC-793,
The Transmission Control Protocol", edited by Jon Postel. Thanks
to John Linn for the checksum algorithm.
Page 1
^L
RFC-908 July 1984
Page 2
^L
RDP Specification General Description
CHAPTER 2
General Description
2.1 Motivation
RDP is a transport protocol designed to efficiently support
the bulk transfer of data for such host monitoring and control
applications as loading/dumping and remote debugging. It
attempts to provide only those services necessary, in order to be
efficient in operation and small in size. Before designing the
protocol, it was necessary to consider what minimum set of
transport functions would satisfy the requirements of the
intended applications.
The following is a list of requirements for such a transport
protocol:
o Reliable delivery of packets is required. When loading
or dumping a memory image, it is necessary that all
memory segments be delivered. A 'hole' left in the
memory image is not acceptable. However, the internet
environment is a lossy one in which packets can get
damaged or lost. So a positive acknowledgement and
retransmission mechanism is a necessary component of the
protocol.
o Since loading and dumping of memory images over the
internet involves the bulk transfer of large amounts of
data over a lossy network with potentially long delays,
it is necessary that the protocol move data efficiently.
In particular, unnecessary retransmission of segments
should be avoided. If a single segment has been lost but
succeeding segments correctly received, the protocol
should not require the retransmission of all of the
segments.
o Loading and dumping are applications that do not
necessarily require sequenced delivery of segments, as
long as all segments eventually are delivered. So the
protocol need not force sequenced delivery. For these
types of applications, segments may be delivered in the
order in which they arrive.
Page 3
^L
RFC-908 July 1984
o However, some applications may need to know that a
particular piece of data has been delivered before
sending the next. For example, a debugger will want to
know that a command inserting a breakpoint into a host
memory image has been delivered before sending a
"proceed" command. If those segments arrived out of
sequence, the intended results would not be achieved.
The protocol should allow a user to optionally specify
that a connection must deliver segments in sequence-
number order.
o The loading/dumping and debugging applications are well-
defined and lend themselves to easy packetization of the
transferred data. They do not require a complex byte-
stream transfer mechanism.
In order to combine the requirements for bulk transfers of
data and reliable delivery, it is necessary to design a
connection-oriented protocol using a three-way handshake to
synchronize sequence numbers. The protocol seems to be
approaching TCP in complexity, so why was TCP not, in fact,
chosen? The answer is that TCP has some disadvantages for these
applications. In particular:
o TCP is oriented toward a more general environment,
supporting the transfer of a stream of bytes between two
communicating parties. TCP is best suited to an
environment where there is no obvious demarcation of data
in a communications exchange. Much of the difficulty in
developing a TCP implementation stems from the complexity
of supporting this general byte-stream transfer, and thus
a significant amount of complexity can be avoided by
using another protocol. This is not just an
implementation consideration, but also one of efficiency.
o Since TCP does not allow a byte to be acknowledged until
all prior bytes have been acknowledged, it often forces
unnecessary retransmission of data. Therefore, it does
not meet another of the requirements stated above.
o TCP provides sequenced delivery of data to the
application. If the application does not require such
sequenced delivery, a large amount of resources are
wasted in providing it. For example, buffers may be tied
up buffering data until a segment with an earlier
sequence number arrives. The protocol should not force
its segment-sequencing desires on the application.
Page 4
^L
RDP Specification General Description
RDP supports a much simpler set of functions than TCP. The
flow control, buffering, and connection management schemes of RDP
are considerably simpler and less complex. The goal is a
protocol that can be easily and efficiently implemented and that
will serve a range of applications.
RDP functions can also be subset to further reduce the size
of a particular implementation. For example, a target processor
requiring down-loading from another host might implement an RDP
module supporting only the passive Open function and a single
connection. The module might also choose not to implement out-
of-sequence acknowledgements.
2.2 Relation to Other Protocols
RDP is a transport protocol that fits into the layered
internet protocol environment. Figure 1 illustrates the place of
RDP in the protocol hierarchy:
+------+ +-----+ +-----+ +------+
|TELNET| | FTP | |Debug| ... |Loader| Application Layer
+------+ +-----+ +-----+ +------+
| | | |
+-----+----+ +------+------+
| |
+------+ +-------+
| TCP | | RDP | Transport Layer
+------+ +-------+
| |
+--------------------------------+
| Internet Protocol & ICMP | Internetwork Layer
+--------------------------------+
|
+-------------------------+
| Network Access Protocol | Network Layer
+-------------------------+
Relation to Other Protocols
Figure 1
Page 5
^L
RFC-908 July 1984
RDP provides the application layer with a reliable message
transport service. The interface between users and RDP transfers
data in units of messages. When implemented in the internet
environment, RDP is layered on the Internet Protocol (IP), which
provides an unreliable datagram service to RDP. Data is passed
across the RDP/IP interface in the form of segments. RDP uses
the standard IP interface primitives to send and receive RDP
segments as IP datagrams. At the internet level, IP exchanges
datagrams with the network layer. An internet packet may contain
an entire datagram or a fragment of a datagram.
# %
? * !
@ )
+------+ +-----+ +----+ $ = ^ +
| |Messages | |Segments | | Datagrams *
| User |<------->| RDP |<------->| IP |<-------> Internet
| | | | | | , ?
+------+ +-----+ +----+ ! )
* % $
@ ^ !
Form of Data Exchange Between Layers
Figure 2
If internetwork services are not required, it should be
possible to use the RDP without the IP layer. As long as the
encapsulating protocol provides the RDP with such necessary
information as addressing and protocol demultiplexing, it should
be possible to run RDP layered on a variety of different
protocols.
Page 6
^L
RDP Specification Protocol Operation
CHAPTER 3
Protocol Operation
3.1 Protocol Service Objectives
The RDP protocol has the following goals:
o RDP will provide a full-duplex communications channel
between the two ports of each transport connection.
o RDP will attempt to reliably deliver all user messages
and will report a failure to the user if it cannot
deliver a message. RDP extends the datagram service of
IP to include reliable delivery.
o RDP will attempt to detect and discard all damaged and
duplicate segments. It will use a checksum and sequence
number in each segment header to achieve this goal.
o RDP will optionally provide sequenced delivery of
segments. Sequenced delivery of segments must be
specified when the connection is established.
o RDP will acknowledge segments received out of sequence,
as they arrive. This will free up resources on the
sending side.
3.2 RDP Connection Management
RDP is a connection-oriented protocol in which each
connection acts as a full-duplex communication channel between
two processes. Segments from a sender are directed to a port on
the destination host. The two 8-bit source and destination port
identifiers in the RDP header are used in conjunction with the
network source and destination addresses to uniquely identify
each connection.
Page 7
^L
RFC-908 July 1984
3.2.1 Opening a Connection
Connections are opened by issuing the Open request, which
can be either active or passive. A passive Open request puts RDP
into the Listen state, during which it passively listens for a
request to open a connection from a remote site. The active Open
request attempts to establish a connection with a specified port
at a remote site.
The active Open request requires that a specific remote port
and host address be specified with the request. The passive Open
may optionally specify a specific remote port and network
address, or it may specify that an open be accepted from anyone.
If a specific remote port and host address were specified, an
arriving request to open a connection must exactly match the
specified remote port and address.
3.2.2 Ports
Valid port numbers range from 1 to 255 (decimal). There are
two types of ports: "well known" ports and "allocable" ports.
Well-known ports have numbers in the range 1 to 63 (decimal) and
allocable ports are given numbers in the range 64 to 255.
The user, when issuing an active Open request, must specify
both the remote host and port and may optionally specify the
local port. If the local port was not specified, RDP will select
an unused port from the range of allocable ports. When issuing a
passive Open request, the user must specify the local port
number. Generally, in this case the local port will be a well-
known port.
3.2.3 Connection States
An RDP connection will progress through a series of states
during its lifetime. The states are shown in Figure 3 and are
individually described below. In Figure 3, the boxes represent
the states of the RDP FSM and the arcs represent changes in
state. Each arc is annotated with the event causing the state
change and the resulting output.
Page 8
^L
RDP Specification Protocol Operation
CLOSED
The CLOSED state exists when no connection exists and there
is no connection record allocated.
LISTEN
The LISTEN state is entered after a passive Open request is
processed. A connection record is allocated and RDP waits
for an active request to establish a connection from a
remote site.
SYN-SENT
The SYN-SENT state is entered after processing an active
Open request. A connection record is allocated, an initial
sequence number is generated, and a SYN segment is sent to
the remote site. RDP then waits in the SYN-SENT state for
acknowledgement of its Open request.
SYN-RCVD
The SYN-RCVD state may be reached from either the LISTEN
state or from the SYN-SENT state. SYN-RCVD is reached from
the LISTEN state when a SYN segment requesting a connection
is received from a remote host. In reply, the local RDP
generates an initial sequence number for its side of the
connection, and then sends the sequence number and an
acknowledgement of the SYN segment to the remote site. It
then waits for an acknowledgement.
The SYN-RCVD state is reached from the SYN-SENT state when a
SYN segment is received from the remote host without an
accompanying acknowledgement of the SYN segment sent to that
remote host by the local RDP. This situation is caused by
simultaneous attempts to open a connection, with the SYN
segments passing each other in transit. The action is to
repeat the SYN segment with the same sequence number, but
now including an ACK of the remote host's SYN segment to
indicate acceptance of the Open request.
Page 9
^L
RFC-908 July 1984
+------------+
Passive Open | |<-------------------------+
+----------------| CLOSED | |
| Request | |---------------+ |
V +------------+ | |
+------------+ | |
| | | |
| LISTEN | | |
| | | |
+------------+ | |
| Active | |
| rcv SYN Open Request | |
| ----------- ------------ | |
| snd SYN,ACK snd SYN | |
V rcv SYN V |
+------------+ ----------- +------------+ |
| | snd SYN,ACK | | |
| SYN-RCVD |<-------------------------------| SYN-SENT | |
| | | | |
+------------+ +------------+ |
| rcv ACK rcv SYN,ACK | |
| ---------- ------------- | |
| xxx +------------+ snd ACK | |
| | | | |
+--------------->| OPEN |<--------------+ |
| | |
+------------+ |
rcv RST | Close request |
----------- | --------------- |
xxx | snd RST |
V |
+------------+ |
| | |
| CLOSE-WAIT |--------------------------+
| | After a Delay
+------------+
RDP Connection State Diagram
Figure 3
Page 10
^L
RDP Specification Protocol Operation
OPEN
The OPEN state exists when a connection has been established
by the successful exchange of state information between the
two sides of the connection. Each side has exchanged and
received such data as initial sequence number, maximum
segment size, and maximum number of unacknowledged segments
that may be outstanding. In the Open state data may be sent
between the two parties of the connection.
CLOSE-WAIT
The CLOSE-WAIT state is entered from either a Close request
or from the receipt of an RST segment from the remote site.
RDP has sent an RST segment and is waiting a delay period
for activity on the connection to complete.
3.2.4 Connection Record
The variables that define the state of a connection are
stored in a connection record maintained for each connection.
The following describes some of the variables that would be
stored in a typical RDP connection record. It is not intended to
be an implementation specification nor is it a complete
description. The purpose of naming and describing some of the
connection record fields is to simplify the description of RDP
protocol operation, particularly event processing.
The connection record fields and their descriptions follow:
STATE
The current state of the connection. Legal values are OPEN,
LISTEN, CLOSED, SYN-SENT, SYN-RCVD, and CLOSE-WAIT.
Send Sequence Number Variables:
SND.NXT
The sequence number of the next segment that is to be sent.
Page 11
^L
RFC-908 July 1984
SND.UNA
The sequence number of the oldest unacknowledged segment.
SND.MAX
The maximum number of outstanding (unacknowledged) segments
that can be sent. The sender should not send more than this
number of segments without getting an acknowledgement.
SND.ISS
The initial send sequence number. This is the sequence
number that was sent in the SYN segment.
Receive Sequence Number Variables:
RCV.CUR
The sequence number of the last segment received correctly
and in sequence.
RCV.MAX
The maximum number of segments that can be buffered for this
connection.
RCV.IRS
The initial receive sequence number. This is the sequence
number of the SYN segment that established this connection.
RCVDSEQNO[n]
The array of sequence numbers of segments that have been
received and acknowledged out of sequence.
Other Variables:
CLOSEWAIT
A timer used to time out the CLOSE-WAIT state.
SBUF.MAX
The largest possible segment (in octets) that can legally be
sent. This variable is specified by the foreign host in the
Page 12
^L
RDP Specification Protocol Operation
SYN segment during connection establishment.
RBUF.MAX
The largest possible segment (in octets) that can be
received. This variable is specified by the user when the
connection is opened. The variable is sent to the foreign
host in the SYN segment.
Variables from Current Segment:
SEG.SEQ
The sequence number of the segment currently being
processed.
SEG.ACK
The acknowledgement sequence number in the segment currently
being processed.
SEG.MAX
The maximum number of outstanding segments the receiver is
willing to hold, as specified in the SYN segment that
established the connection.
SEG.BMAX
The maximum segment size (in octets) accepted by the foreign
host on a connection, as specified in the SYN segment that
established the connection.
3.2.5 Closing a Connection
The closing of a connection can be initiated by a Close
request from the user process or by receipt of an RST segment
from the other end of the connection. In the case of the Close
request, RDP will send an RST segment to the other side of the
connection and then enter the CLOSE-WAIT state for a period of
time. While in the CLOSE-WAIT state, RDP will discard segments
received from the other side of the connection. When the time-
out period expires, the connection record is deallocated and the
connection ceases to exist. This simple connection closing
facility requires that users determine that all data has been
Page 13
^L
RFC-908 July 1984
reliably delivered before requesting a close of the connection.
3.2.6 Detecting an Half-Open Connection
If one side of a connection crashes, the connection may be
left with the other side still active. This situation is termed
to be an half-open connection. For many cases, the active RDP
will eventually detect the half-open connection and reset. Two
examples of recovery from half-open connections are provided in
sections 5.7 and 5.8. Recovery is usually achieved by user
activity or by the crashed host's attempts to re-establish the
connection.
However, there are cases where recovery is not possible
without action by the RDP itself. For example, if all connection
blocks are in use, attempts to re-establish a broken connection
will be rejected. In this case, the RDP may attempt to free
resources by verifying that connections are fully open. It does
this by sending a NUL segment to each of the other RDPs. An
acknowledgement indicates the connection is still open and valid.
To minimize network overhead, verification of connections
should only be done when necessary to prevent a deadlock
situation. Only inactive connections should be verified. An
inactive connection is defined to be a connection that has no
outstanding unacknowledged segments, has no segments in the user
input or output queues, and that has not had any traffic for some
period of time.
3.3 Data Communication
Data flows through an RDP connection in the form of
segments. Each user message submitted with a Send request is
packaged for transport as a single RDP segment. Each RDP segment
is packaged as an RDP header and one or more octets of data. RDP
will not attempt to fragment a large user message into smaller
segments and re-assemble the message on the receiving end. This
differs from a byte-stream protocol such as TCP which supports
the transfer of an indeterminate length stream of data between
ports, buffering data until it is requested by the receiver.
Page 14
^L
RDP Specification Protocol Operation
At the RDP level, outgoing segments, as they are created,
are queued as input to the IP layer. Each segment is held by the
sending RDP until it is acknowledged by the foreign host.
Incoming segments are queued as input to the user process through
the user interface. Segments are acknowledged when they have
been accepted by the receiving RDP.
The receiving end of each connection specifies the maximum
segment size it will accept. Any attempt by the sender to
transmit a larger segment is an error. If RDP determines that a
buffer submitted with a Send request exceeds the maximum size
segment permitted on the connection, RDP will return an error to
the user. In addition, RDP will abort a connection with an RST
segment if an incoming segment contains more data than the
maximum acceptable segment size. No attempt will be made to
recover from or otherwise overcome this error condition.
If sequenced delivery of segments is necessary for a
connection, the requirement must be stated when the connection is
established. Sequenced delivery is specified when the Open
request is made. Sequenced delivery of segments will then be the
mode of delivery for the life of the connection.
3.4 Reliable Communication
RDP implements a reliable message service through a number
of mechanisms. These include the insertion of sequence numbers
and checksums into segments, the positive acknowledgement of
segment receipt, and timeout and retransmission of missing
segments.
3.4.1 Segment Sequence Numbers
Each segment transporting data has a sequence number that
uniquely identifies it among all other segments in the same
connection. The initial sequence number is chosen when the
connection is opened and is selected by reading a value from a
monotonically increasing clock. Each time a segment containing
data is transmitted, the sequence number is incremented.
Segments containing no data do not increment the sequence number.
However, the SYN and NUL segments, which cannot contain data, are
exceptions. The SYN segment is always sent with a unique
sequence number, the initial sequence number. The NUL segment is
Page 15
^L
RFC-908 July 1984
sent with the next valid sequence number.
3.4.2 Checksums
Each RDP segment contains a checksum to allow the receiver
to detect damaged segments. RDP uses a non-linear checksum
algorithm to compute a checksum that is 32-bits wide and operates
on data in units of four octets (32 bits). The area that is
covered by the checksum includes both the RDP header and the RDP
data area.
If a segment contains a number of header and data octets
that is not an integral multiple of 4 octets, the last octet is
padded on the right with zeros to form a 32-bit quantity for
computation purposes. The padding zeros are not transmitted as
part of the segment. While computing the checksum, the checksum
field itself is replaced with zeros. The actual algorithm is
described in Section 4.2.1.
3.4.3 Positive Acknowledgement of Segments
RDP assumes it has only an unreliable datagram service to
deliver segments. To guarantee delivery of segments in this
environment, RDP uses positive acknowledgement and retransmission
of segments. Each segment containing data and the SYN and NUL
segments are acknowledged when they are correctly received and
accepted by the destination host. Segments containing only an
acknowledgement are not acknowledged. Damaged segments are
discarded and are not acknowledged. Segments are retransmitted
when there is no timely acknowledgement of the segment by the
destination host.
RDP allows two types of acknowledgement. A cumulative
acknowledgement is used to acknowledge all segments up to a
specified sequence number. This type of acknowledgement can be
sent using fixed length fields within the RDP header.
Specifically, the ACK control flag is set and the last
acknowledged sequence number is placed in the Acknowledgement
Number field.
The extended or non-cumulative acknowledgement allows the
receiver to acknowledge segments out of sequence. This type of
acknowledgement is sent using the EACK control flag and the
Page 16
^L
RDP Specification Protocol Operation
variable length fields in the RDP segment header. The variable
length header fields are used to hold the sequence numbers of the
acknowledged out-of-sequence segments.
The type of acknowledgement used is simply a function of the
order in which segments arrive. Whenever possible, segments are
acknowledged using the cumulative acknowledgement segment. Only
out-of-sequence segments are acknowledged using the extended
acknowledgement option.
The user process, when initiating the connection, cannot
restrict the type of acknowledgement used on the connection. The
receiver may choose not to implement out-of-sequence
acknowledgements. On the other hand, the sender may choose to
ignore out-of-sequence acknowledgements.
3.4.4 Retransmission Timeout
Segments may be lost in transmission for two reasons: they
may be lost or damaged due to the effects of the lossy
transmission media; or they may be discarded by the receiving
RDP. The positive acknowledgement policy requires the receiver
to acknowledge a segment only when the segment has been correctly
received and accepted.
To detect missing segments, the sending RDP must use a
retransmission timer for each segment transmitted. The timer is
set to a value approximating the transmission time of the segment
in the network. When an acknowledgement is received for a
segment, the timer is cancelled for that segment. If the timer
expires before an acknowledgement is received for a segment, that
segment is retransmitted and the timer is restarted.
3.5 Flow Control and Window Management
RDP employs a simple flow control mechanism that is based on
the number of unacknowledged segments sent and the maximum
allowed number of outstanding (unacknowledged) segments. Each
RDP connection has an associated set of flow control parameters
that include the maximum number of outstanding segments for each
side of a connection. These parameters are specified when the
connection is opened with the Open request, with each side of the
connection specifying its own parameters. The parameters are
Page 17
^L
RFC-908 July 1984
passed from one host to another in the initial connection
segments.
The values specified for these parameters should be based on
the amount and size of buffers that the RDP is willing to
allocate to a connection. The particular RDP implementation can
set the parameters to values that are optimal for its buffering
scheme. Once these parameters are set they remain unchanged
throughout the life of the connection.
RDP employs the concept of a sequence number window for
acceptable segment sequence numbers. The left edge of the window
is the number of the last in-sequence acknowledged sequence
number plus one. The right edge of the window is equal to the
left edge plus twice the allowed maximum number of outstanding
segments. The allowed maximum number of outstanding segments is
the number of segments the transmitting RDP software is allowed
to send without receiving any acknowledgement.
The flow control and window management parameters are used
as follows. The RDP module in the transmitting host sends
segments until it reaches the connection's segment limit
specified by the receiving process. Once this limit is reached,
the transmitting RDP module may only send a new segment for each
acknowledged segment.
When a received segment has a sequence number that falls
within the acceptance window, it is acknowledged. If the
sequence number is equal to the left-hand edge (i.e., it is the
next sequence number expected), the segment is acknowledged with
a cumulative acknowledgement (ACK). The acceptance window is
adjusted by adding one to the value of the edges. If the
sequence number is within the acceptance window but is out of
sequence, it is acknowledged with a non-cumulative
acknowledgement (EACK). The window is not adjusted, but the
receipt of the out-of-sequence segment is recorded.
When segments are acknowledged out of order, the
transmitting RDP module must not transmit beyond the acceptance
window. This could occur if one segment is not acknowledged but
all subsequent segments are received and acknowledged. This
condition will fix the left edge of the window at the sequence
number of the unacknowledged segment. As additional segments are
transmitted, the next segment to be sent will approach and
eventually overtake the right window edge. At this point all
transmission of new segments will cease until the unacknowledged
segment is acknowledged.
Page 18
^L
RDP Specification Protocol Operation
3.6 User Interface
The user interface to RDP is implementation dependent and
may use system calls, function calls or some other mechanism.
The list of requests that follows is not intended to suggest a
particular implementation.
OPEN Request
Opens a connection. Parameters include type (active or
passive), local port, remote port, remote host address,
maximum segment size, maximum number of unacknowledged
segments, delivery mode (sequenced or non-sequenced). The
connection id, including any allocated port number, is
returned to the user.
SEND Request
Sends a user message. Parameters include connection
identifier, buffer address and data count.
RECEIVE Request
Receives a user message. Parameters include connection
identifier, buffer address and data count.
CLOSE Request
Closes a specified connection. The single parameter is the
connection identifier.
STATUS Request
Returns the status of a connection. The parameters include
the connection identifier and the address of the status
buffer.
Page 19
^L
RFC-908 July 1984
3.7 Event Processing
This section describes one possible sequence for processing
events. It is not intended to suggest a particular
implementation, but any actual implementation should vary from
this description only in detail and not significantly in
substance. The following are the kinds of events that may occur:
USER REQUESTS
Open
Send
Receive
Close
Status
ARRIVING SEGMENT
Segment Arrives
TIMEOUTS
Retransmission Timeout
Close-Wait Timeout
User request processing always terminates with a return to
the caller, with a possible error indication. Error responses
are given as a character string. A delayed response is also
possible in some situations and is returned to the user by
whatever event or pseudo interrupt mechanism is available. The
term "signal" is used to refer to delayed responses.
Processing of arriving segments usually follows this general
sequence: the sequence number is checked for validity and, if
valid, the segment is queued and processed in sequence-number
order. For all events, unless a state change is specified, RDP
remains in the same state.
Page 20
^L
RDP Specification Protocol Operation
3.7.1 User Request Events
The following scenarios demonstrate the processing of events
caused by the issuance of user requests:
Open Request
CLOSED STATE
Create a connection record
If none available
Return "Error - insufficient resources"
Endif
If passive Open
If local port not specified
Return "Error - local port not specified"
Endif
Generate SND.ISS
Set SND.NXT = SND.ISS + 1
SND.UNA = SND.ISS
Fill in SND.MAX, RMAX.BUF from Open parameters
Set State = LISTEN
Return
Endif
If active Open
If remote port not specified
Return "Error - remote port not specified"
Endif
Generate SND.ISS
Set SND.NXT = SND.ISS + 1
SND.UNA = SND.ISS
Fill in SND.MAX, RMAX.BUF from Open parameters
If local port not specified
Allocate a local port
Endif
Send <SEQ=SND.ISS><MAX=SND.MAX><MAXBUF=RMAX.BUF><SYN>
Set State = SYN-SENT
Return (local port, connection identifier)
Endif
Page 21
^L
RFC-908 July 1984
LISTEN STATE
SYN-SENT STATE
SYN-RCVD STATE
OPEN STATE
CLOSE-WAIT STATE
Return "Error - connection already open"
Close Request
OPEN STATE
Send <SEQ=SND.NXT><RST>
Set State = CLOSE-WAIT
Start TIMWAIT Timer
Return
LISTEN STATE
Set State = CLOSED
Deallocate connection record
Return
SYN-RCVD STATE
SYN-SENT STATE
Send <SEQ=SND.NXT><RST>
Set State = CLOSED
Return
CLOSE-WAIT STATE
Return "Error - connection closing"
CLOSE STATE
Return "Error - connection not open"
Page 22
^L
RDP Specification Protocol Operation
Receive Request
OPEN STATE
If Data is pending
Return with data
else
Return with "no data" indication
Endif
LISTEN STATE
SYN-RCVD STATE
SYN-SENT STATE
Return with "no data" indication
CLOSE STATE
CLOSE-WAIT STATE
Return "Error - connection not open"
Send Request
OPEN STATE
If SND.NXT < SND.UNA + SND.MAX
Send <SEQ=SND.NXT><ACK=RCV.CUR><ACK><Data>
Set SND.NXT = SND.NXT + 1
Return
else
Return "Error - insufficient resources to send data"
Endif
LISTEN STATE
SYN-RCVD STATE
SYN-SENT STATE
CLOSE STATE
CLOSE-WAIT STATE
Return "Error - connection not open"
Status Request
Return with:
Page 23
^L
RFC-908 July 1984
State of connection (OPEN, LISTEN, etc.)
Number of segments unacknowledged
Number of segments received not given to user
Maximum segment size for the send side of the connection
Maximum segment size for the receive side of the connection
3.7.2 Segment Arrival Events
The following scenarios describe the processing of the event
caused by the arrival of a RDP segment from a remote host. The
assumption is made that the segment was addressed to the local
port associated with the connection record.
If State = CLOSED
If RST set
Discard segment
Return
Endif
If ACK or NUL set
Send <SEQ=SEG.ACK + 1><RST>
Discard segment
Return
else
Send <SEQ=0><RST><ACK=RCV.CUR><ACK>
Discard segment
Return
Endif
Endif
If State = CLOSE-WAIT
If RST set
Set State = CLOSED
Discard segment
Cancel TIMWAIT timer
Deallocate connection record
else
Discard segment
Endif
Return
Endif
Page 24
^L
RDP Specification Protocol Operation
If State = LISTEN
If RST set
Discard the segment
Return
Endif
If ACK or NUL set
Send <SEQ=SEG.ACK + 1><RST>
Return
Endif
If SYN set
Set RCV.CUR = SEG.SEQ
RCV.IRS = SEG.SEQ
SND.MAX = SEG.MAX
SBUF.MAX = SEG.BMAX
Send <SEQ=SND.ISS><ACK=RCV.CUR><MAX=RCV.MAX><BUFMAX=RBUF.MAX>
<ACK><SYN>
Set State = SYN-RCVD
Return
Endif
If anything else (should never get here)
Discard segment
Return
Endif
Endif
If State = SYN-SENT
If ACK set
If RST clear and SEG.ACK != SND.ISS
Send <SEQ=SEG.ACK + 1><RST>
Endif
Discard segment; Return
Endif
If RST set
If ACK set
Signal "Connection Refused"
Set State = CLOSED
Deallocate connection record
Endif
Discard segment
Return
Endif
Page 25
^L
RFC-908 July 1984
If SYN set
Set RCV.CUR = SEG.SEQ
RCV.IRS = SEG.SEQ
SND.MAX = SEG.MAX
RBUF.MAX = SEG.BMAX
If ACK set
Set SND.UNA = SEG.ACK
State = OPEN
Send <SEQ=SND.NXT><ACK=RCV.CUR><ACK>
else
Set State = SYN-RCVD
Send <SEQ=SND.ISS><ACK=RCV.CUR><MAX=RCV.MAX><BUFMAX=RBUF.MAX>
<SYN><ACK>
Endif
Return
Endif
If anything else
Discard segment
Return
Endif
Endif
If State = SYN-RCVD
If RCV.IRS < SEG.SEQ =< RCV.CUR + (RCV.MAX * 2)
Segment sequence number acceptable
else
Send <SEQ=SND.NXT><ACK=RCV.CUR><ACK>
Discard segment
Return
Endif
If RST set
If passive Open
Set State = LISTEN
else
Set State = CLOSED
Signal "Connection Refused"
Discard segment
Deallocate connection record
Endif
Return
Endif
Page 26
^L
RDP Specification Protocol Operation
If SYN set
Send <SEQ=SEG.ACK + 1><RST>
Set State = CLOSED
Signal "Connection Reset"
Discard segment
Deallocate connection record
Return
Endif
If EACK set
Send <SEQ=SEG.ACK + 1><RST>
Discard segment
Return
Endif
If ACK set
If SEG.ACK = SND.ISS
Set State = OPEN
else
Send <SEQ=SEG.ACK + 1><RST>
Discard segment
Return
Endif
else
Discard segment
Return
Endif
If Data in segment or NUL set
If the received segment is in sequence
Copy the data (if any) to user buffers
Set RCV.CUR=SEG.SEQ
Send <SEQ=SND.NXT><ACK=RCV.CUR><ACK>
else
If out-of-sequence delivery permitted
Copy the data (if any) to user buffers
Endif
Send <SEQ=SND.NXT><ACK=RCV.CUR><ACK><EACK><RCVDSEQNO1>
...<RCVDSEQNOn>
Endif
Endif
Endif
Page 27
^L
RFC-908 July 1984
If State = OPEN
If RCV.CUR < SEG.SEQ =< RCV.CUR + (RCV.MAX * 2)
Segment sequence number acceptable
else
Send <SEQ=SND.NXT><ACK=RCV.CUR><ACK>
Discard segment and return
Endif
If RST set
Set State = CLOSE-WAIT
Signal "Connection Reset"
Return
Endif
If NUL set
Set RCV.CUR=SEG.SEQ
Send <SEQ=SND.NXT><ACK=RCV.CUR><ACK>
Discard segment
Return
Endif
If SYN set
Send <SEQ=SEG.ACK + 1><RST>
Set State = CLOSED
Signal "Connection Reset"
Discard segment
Deallocate connection record
Return
Endif
If ACK set
If SND.UNA =< SEG.ACK < SND.NXT
Set SND.UNA = SEG.ACK
Flush acknowledged segments
Endif
Endif
If EACK set
Flush acknowledged segments
Endif
Page 28
^L
RDP Specification Protocol Operation
If Data in segment
If the received segment is in sequence
Copy the data to user buffers
Set RCV.CUR=SEG.SEQ
Send <SEQ=SND.NXT><ACK=RCV.CUR><ACK>
else
If out-of-sequence delivery permitted
Copy the data to user buffers
Endif
Send <SEQ=SND.NXT><ACK=RCV.CUR><ACK><EACK><RCVDSEQNO1>
...<RCVDSEQNOn>
Endif
Endif
Endif
3.7.3 Timeout Events
Timeout events occur when a timer expires and signals the
RDP. Two types of timeout events can occur, as described below:
RETRANSMISSION TIMEOUTS
If timeout on segment at head of retransmission queue
Resend the segment at head of queue
Restart the retransmission timer for the segment
Requeue the segment on retransmission queue
Return
Endif
CLOSE-WAIT TIMEOUTS
Set State = CLOSED
Deallocate connection record
Return
Page 29
^L
RFC-908 July 1984
Page 30
^L
RDP Specification RDP Segments and Formats
CHAPTER 4
RDP Segments and Formats
The segments sent by the application layer are encapsulated
in headers by the transport, internet and network layers, as
follows:
+----------------+
| Network Access |
| Header |
+----------------+
| IP Header |
+----------------+
| RDP Header |
+----------------+
| D |
| A |
| T |
| A |
+----------------+
Segment Format
Figure 4
4.1 IP Header Format
When used in the internet environment, RDP segments are sent
using the version 4 IP header as described in RFC791, "Internet
Protocol." The RDP protocol number is ??? (decimal). The time-
to-live field should be set to a reasonable value for the
network.
All other fields should be set as specified in RFC-791.
Page 31
^L
RFC-908 July 1984
4.2 RDP Header Format
Every RDP segment is prefaced with an RDP header. The
format of the header is shown in Figure 5 below. The RDP header
is variable in length and its size is indicated by a field in a
fixed location within the header.
0 0 0 1 1
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+-+-+-+-+-+-+---+---------------+
|S|A|E|R|N| |Ver| Header |
0 |Y|C|A|S|U|0|No.| Length |
|N|K|K|T|L| | | |
+-+-+-+-+-+-+---+---------------+
1 | Source Port | Dest. Port |
+---------------+---------------+
2 | Data Length |
+---------------+---------------+
3 | |
+--- Sequence Number ---+
4 | |
+---------------+---------------+
5 | |
+--- Acknowledgement Number ---+
6 | |
+---------------+---------------+
7 | |
+--- Checksum ---+
8 | |
+---------------+---------------+
9 | Variable Header Area |
. .
. .
| |
+---------------+---------------+
RDP Header Format
Figure 5
Page 32
^L
RDP Specification RDP Segments and Formats
4.2.1 RDP Header Fields
Control Flags
This 8-bit field occupies the first octet of word one in the
header. It is bit encoded with the following bits currently
defined:
Bit # Bit Name Description
0 SYN Establish connection and
synchronize sequence numbers.
1 ACK Acknowledge field significant.
2 EACK Non-cumulative (Extended) acknowledgement.
3 RST Reset the connection.
4 NUL This is a null (zero data length) segment.
5 Unused.
Note that the SYN and RST are sent as separate segments and
may not contain any data. The ACK may accompany any
message. The NUL segment must have a zero data length, but
may be accompanied by ACK and EACK information. The other
control bit is currently unused and is defined to be zero.
Version Number
This field occupies bits 6-7 of the first octet. It
contains the version number of the protocol described by
this document. Current value is one (1).
Header Length
The length of the RDP header in units of two (2) octets,
including this field. This field allows RDP to find the
start of the Data field, given a pointer to the head of the
segment. This field is 8 bits in length. For a segment
with no variable header section, the header length field
will have the value 9.
Source and Destination Ports
The Source and Destination Ports are used to identify the
processes in the two hosts that are communicating with each
other. The combination of the port identifiers with the
source and destination addresses in the network access
Page 33
^L
RFC-908 July 1984
protocol header serves to fully qualify the connection and
constitutes the connection identifier. This permits RDP to
distinguish multiple connections between two hosts. Each
field is 8 bits in length, allowing port numbers from 0 to
255 (decimal).
Data Length
The length in octets of the data in this segment. The data
length does not include the RDP header. This field is 16
bits in length.
Sequence Number
The sequence number of this segment. This field is 32 bits
in length.
Acknowledgement Number
If the ACK bit is set in the header, this is the sequence
number of the segment that the sender of this segment last
received correctly and in sequence. Once a connection is
established this should always be sent. This field is 32
bits in length.
Checksum
This field is a 32-bit checksum of the segment header and
data. The algorithm description below includes two
variables, the checksum accumulator and the checksum
pointer. The checksum accumulator is an actual 32-bit
register in which the checksum is formed. The checksum
pointer is included for purposes of description, to
represent the operation of advancing through the data four
octets (32-bits) at a time. It need not be maintained in a
register by an implementation.
1) The checksum pointer is set to zero, to correspond to the
beginning of the area to be checksummed. The checksum
accumulator is also initialized to zero before beginning the
computation of the checksum.
2) The 32-bit memory word located at the address referenced
by the checksum pointer is added arithmetically to the
checksum accumulator. Any carry propagated out of the
checksum accumulator is ignored. The checksum field itself
is replaced with zeros when being added to the checksum
Page 34
^L
RDP Specification RDP Segments and Formats
accumulator.
3) The checksum accumulator is rotated left one bit
position. The checksum pointer is advanced to correspond to
the address of the next 32-bit word in the segment.
4) Steps 2 and 3 are repeated until the entire segment has
been summed. If a segment contains a number of header and
data octets that is not an integral multiple of 4 octets,
the last octet is padded on the right with zeros to form a
32-bit quantity for computation purposes.
Variable Header Area
This area is used to transmit parameters for the SYN and
EACK segments.
Page 35
^L
RFC-908 July 1984
4.3 SYN Segment
The SYN is used to establish a connection and synchronize
sequence numbers between two hosts. The SYN segment also
contains information to inform the remote host of the maximum
number of segments the local RDP is willing to accept and the
maximum segment size it can accept. The SYN may be combined with
an ACK in a segment but is never combined with user data.
4.3.1 SYN Segment Format
0 0 0 1 1
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+-+-+-+-+-+-+---+---------------+
0 |1|0|0|0|0|0|0 1| Header Length |
+-+-+-+-+-+-+---+---------------+
1 | Source Port | Dest. Port |
+---------------+---------------+
2 | Data Length = 0 |
+---------------+---------------+
3 | |
+--- Sequence Number ---+
4 | |
+---------------+---------------+
5 | |
+--- Acknowledgement Number ---+
6 | |
+---------------+---------------+
7 | |
+--- Checksum ---+
8 | |
+---------------+---------------+
9 | Max. # of Outstanding Segments|
+---------------+---------------+
10 | Max. Segment Size |
+-------------------------------+
11 | Options Flag Field |
+---------------+---------------+
SYN Segment Format
Figure 6
Page 36
^L
RDP Specification RDP Segments and Formats
4.3.2 SYN Segment Fields
Sequence Number
Contains the initial sequence number selected for this
connection.
Acknowledgement Number
This field is valid only if the ACK flag is set. In that
case, this field will contain the sequence number of the SYN
segment received from the other RDP.
Maximum Number of Outstanding Segments
The maximum number of segments that should be sent without
getting an acknowledgement. This is used by the receiver as
a means of flow control. The number is selected during
connection initiation and may not be changed later in the
life of the connection.
Maximum Segment Size
The maximum size segment in octets that the sender should
send. It informs the sender how big the receiver's buffers
are. The specified size includes the length of the IP
header, RDP header, and data. It does not include the
network access layer's header length.
Options Flag Field
This field of two octets contains a set of options flags
that specify the set of optional functions that are desired
for this connection. The flags are defined as follows:
Bit # Bit Name Description
0 SDM Sequenced delivery mode.
The sequenced delivery mode flag specifies whether delivery
of segments to the user is sequenced (delivered in
sequence-number order) or non-sequenced (delivered in
arrival order, regardless of sequence number). A value of 0
specifies non-sequenced delivery of segments, and a value of
1 specifies sequenced delivery.
Page 37
^L
RFC-908 July 1984
4.4 ACK Segment
The ACK segment is used to acknowledge in-sequence segments.
It contains both the next send sequence number and the
acknowledgement sequence number in the RDP header. The ACK
segment may be sent as a separate segment, but it should be
combined with data whenever possible. Data segments must always
include the ACK bit and Acknowledgement Number field.
4.4.1 ACK Segment Format
0 0 0 1 1
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+-+-+-+-+-+-+---+---------------+
0 |0|1|0|0|0|0|0 1| Header Length |
+-+-+-+-+-+-+---+---------------+
1 | Source Port | Dest. Port |
+---------------+---------------+
2 | Data Length |
+---------------+---------------+
3 | |
+--- Sequence Number ---+
4 | |
+---------------+---------------+
5 | |
+--- Acknowledgement Number ---+
6 | |
+---------------+---------------+
7 | |
+--- Checksum ---+
8 | |
+---------------+---------------+
| |
| Data |
. .
. .
+---------------+---------------+
ACK Segment Format
Figure 7
Page 38
^L
RDP Specification RDP Segments and Formats
4.4.2 ACK Segment Fields
Data Length
A non-zero Data Length field indicates that there is data
present in the segment.
Sequence Number
The value of the Sequence Number field is advanced to the
next sequence number only if there is data present in the
segment. An ACK segment without data does not use sequence
number space.
Acknowledgement Number
The Acknowledgement Number field contains the sequence
number of the last segment received in sequential order.
Page 39
^L
RFC-908 July 1984
4.5 Extended ACK Segment
The EACK segment is used to acknowledge segments received
out of sequence. It contains the sequence numbers of one or more
segments received with a correct checksum, but out of sequence.
The EACK is always combined with an ACK in the segment, giving
the sequence number of the last segment received in sequence.
The EACK segment may also include user data.
4.5.1 EACK Segment Format
The EACK segment has the format shown in Figure 8.
4.5.2 EACK Segment Fields
Data Length
A non-zero Data Length field indicates that there is data
present in the segment.
Sequence Number
The value of the Sequence Number field is advanced to the
next sequence number only if there is data present in the
segment. An EACK segment without data does not use sequence
number space.
Acknowledgement Number
The Acknowledgement Number field contains the sequence
number of the last segment received in sequential order.
Sequence # Received OK
Each entry is the sequence number of a segment that was
received with a correct checksum, but out of sequence.
Page 40
^L
RDP Specification RDP Segments and Formats
0 0 0 1 1
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+-+-+-+-+-+-+---+---------------+
0 |0|1|1|0|0|0|0 1| Header Length |
+-+-+-+-+-+-+---+---------------+
1 | Source Port | Dest. Port |
+---------------+---------------+
2 | Data Length |
+---------------+---------------+
3 | |
+--- Sequence Number ---|
4 | |
+---------------+---------------+
5 | |
+--- Acknowledgement Number ---+
6 | |
+---------------+---------------+
7 | |
+--- Checksum ---+
8 | |
+---------------+---------------+
9 | |
+--- Sequence # Received OK ---+
10 | |
+---------------+---------------+
11 | |
+--- Sequence # Received OK ---+
12 | |
+---------------+---------------+
: . :
: . :
: . :
+---------------+---------------+
| |
| Data |
| |
+---------------+---------------+
EACK Segment Format
Figure 8
Page 41
^L
RFC-908 July 1984
4.6 RST Segment
The RST segment is used to close or reset a connection.
Upon receipt of an RST segment, the sender must stop sending and
must abort any unserviced requests. The RST is sent as a
separate segment and does not include any data.
4.6.1 RST Segment Format
0 0 0 1 1
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+-+-+-+-+-+-+---+---------------+
0 |0|0|0|1|0|0|0 1| Header Length |
+-+-+-+-+-+-+---+---------------+
1 | Source Port | Dest. Port |
+---------------+---------------+
2 | Data Length = 0 |
+---------------+---------------+
3 | |
+--- Sequence Number ---+
4 | |
+---------------+---------------+
5 | |
+--- Acknowledgement Number ---+
6 | |
+---------------+---------------+
7 | |
+--- Checksum ---+
8 | |
+-------------------------------+
RST Segment Format
Figure 9
Page 42
^L
RDP Specification RDP Segments and Formats
4.7 NUL Segment
The NUL segment is used to determine if the other side of a
connection is still active. When a NUL segment is received, an
RDP implementation must acknowledge the segment if a valid
connection exists and the segment sequence number falls within
the acceptance window. The segment is then discarded. The NUL
may be combined with an ACK in a segment but is never combined
with user data.
4.7.1 NUL segment format
0 0 0 1 1
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+-+-+-+-+-+-+---+---------------+
0 |0|0|0|0|1|0|0 1| Header Length |
+-+-+-+-+-+-+---+---------------+
1 | Source Port | Dest. Port |
+---------------+---------------+
2 | Data Length = 0 |
+---------------+---------------+
3 | |
+--- Sequence Number ---+
4 | |
+---------------+---------------+
5 | |
+--- Acknowledgement Number ---+
6 | |
+---------------+---------------+
7 | |
+--- Checksum ---+
8 | |
+-------------------------------+
NUL Segment Format
Figure 10
Page 43
^L
RFC-908 July 1984
Page 44
^L
RDP Specification Examples of Operation
CHAPTER 5
Examples of Operation
5.1 Connection Establishment
This is an example of a connection being established between
Host A and Host B. Host B has done a passive Open and is in
LISTEN state. Host A does an active Open to establish the
connection.
Host A Host B
Time State State
1. CLOSED LISTEN
2. SYN-SENT <SEQ=100><SYN> --->
3. <--- <SEQ=200><ACK=100><SYN,ACK>
SYN-RCVD
4. OPEN <SEQ=101><ACK=200> ---> OPEN
5. <SEQ=101><ACK=200><Data> --->
6. <--- <SEQ=201><ACK=101>
Page 45
^L
RFC-908 July 1984
5.2 Simultaneous Connection Establishment
This is an example of two hosts trying to establishing
connections to each other at the same time. Host A sends a SYN
request to Host B at the same time Host B sends a SYN request to
Host A.
Host A Host B
Time State State
1. CLOSED CLOSED
2. SYN-SENT <SEQ=100><SYN> --->
<--- <SEQ=200><SYN> SYN-SENT
3. SYN-RCVD SYN-RCVD
<SEQ=100><ACK=200><SYN,ACK> --->
<--- <SEQ=200><ACK=100><SYN,ACK>
4. OPEN OPEN
Page 46
^L
RDP Specification Examples of Operation
5.3 Lost Segments
This is an example of what happens when a segment is lost.
It shows how segments can be acknowledged out of sequence and
that only the missing segment need be retransmitted. Note that
in this and the following examples "EA" stands for "Out of
Sequence Acknowledgement."
Time Host A Host B
1. <SEQ=100><ACK=200><Data> --->
2. <--- <SEQ=201><ACK=100>
3. <SEQ=101><ACK=200><Data> (segment lost)
4.
5. <SEQ=102><ACK=200><Data> --->
6. <-- <SEQ=201><ACK=100><EA=102>
7. <SEQ=103><ACK=200><Data> --->
8. <--- <SEQ=201><ACK=100>
<EA=102,103>
9. <SEQ=101><ACK=200><Data> --->
10. <--- <SEQ=201><ACK=103>
11. <SEQ=104><ACK=200><Data> --->
12. <--- <SEQ=201><ACK=104>
Page 47
^L
RFC-908 July 1984
5.4 Segments Received Out of Order
This an example of segments received out of order. It
further illustrates the use of acknowledging segments out of
order to prevent needless retransmissions.
Time Host A Host B
1. <SEQ=100><ACK=200><Data> --->
2. <--- <SEQ=201><ACK=100>
3. <SEQ=101><ACK=200><Data> (delayed)
4.
5. <SEQ=102><ACK=200><Data> --->
6. <--- <SEQ=201><ACK=100><EA=102>
7. <SEQ=103><ACK=200><Data> --->
---> (delayed segment 101 arrives)
8. <--- <SEQ=201><ACK=103>
9. <SEQ=104><ACK=200><Data> --->
10. <--- <SEQ=201><ACK=104>
Page 48
^L
RDP Specification Examples of Operation
5.5 Communication Over Long Delay Path
This is an example of a data transfer over a long delay
path. In this example, Host A is permitted to have as many as
five unacknowledged segments. The example shows that it is not
necessary to wait for an acknowledgement in order to send
additional data.
Time Host A Host B
1. <SEQ=100><ACK=200><Data> -1->
2. <SEQ=101><ACK=200><Data> -2->
3. <SEQ=102><ACK=200><Data> -3->
-1-> (received)
4. <-4- <SEQ=201><ACK=100>
5. <SEQ=103><ACK=200><Data> -5->
-2-> (received)
6. <-6- <SEQ=201><ACK=101>
7. <SEQ=104><ACK=200><Data> -7->
-3-> (received)
8. <-8- <SEQ=201><ACK=102>
(received) <-4-
9. <SEQ=105><ACK=200><Data> -9->
-5-> (received)
10. <-10- <SEQ=201><ACK=103>
(received) <-6-
11. <SEQ=106><ACK=200><Data> -11->
-7-> (received)
12. <-12- <SEQ=201><ACK=104>
(received) <-8-
13. -9-> (received)
14. <-13- <SEQ=201><ACK=105>
(received) <-10-
15. -11-> (received)
16. <-14- <SEQ=201><ACK=106>
(received) <-12-
17. (received) <-13-
18. (received) <-14-
Page 49
^L
RFC-908 July 1984
5.6 Communication Over Long Delay Path With Lost Segments
This is an example of communication over a long delay path
with a lost segment. It shows that by acknowledging segments out
of sequence, only the lost segment need be retransmitted.
Time Host A Host B
1. <SEQ=100><ACK=200><Data> -1->
2. <SEQ=101><ACK=200><Data> -2->
3. <SEQ=102><ACK=200><Data> -3->
-1-> (received)
4. <-4- <SEQ=201><ACK=100>
5. <SEQ=103><ACK=200><Data> (segment lost)
-2-> (received)
6. <-5- <SEQ=201><ACK=101>
7. <SEQ=104><ACK=200><Data> -6->
-3-> (received)
8. <-7- <SEQ=201><ACK=102>
(received) <-4-
9. <SEQ=105><ACK=200><Data> -8->
10.
(received) <-5-
11. <SEQ=106><ACK=200><Data> -10->
-6-> (received)
12. <-11- <SEQ=201><ACK=102><EA=104>
(received) <-7-
-8-> (received)
13. <-12- <SEQ=201><ACK=102><EA=104,105>
-10-> (received)
14. <-13- <SEQ=201><ACK=102><EA=104-106>
(received) <-11-
15. <SEQ=103><ACK=200><Data> -14->
(received) <-12-
16. (received) <-13-
-14-> (received)
17. <-15- <SEQ=201><ACK=106>
18.
19. (received) <-15-
Page 50
^L
RDP Specification Examples of Operation
5.7 Detecting a Half-Open Connection on Crash Recovery
This is an example of a host detecting a half-open
connection due to the crash and subsequent restart of the host.
In this example, Host A crashes during a communication session,
then recovers and tries to reopen the connection. During the
reopen attempt, it discovers that a half-open connection still
exists and it then resets the other side. Both sides were in the
OPEN state prior to the crash.
Host A Host B
Time
1. OPEN OPEN
(crash!) <--- <SEQ=200><ACK=100><ACK>
2. CLOSED OPEN
(recover)
3. SYN-SENT OPEN
<SEQ=400><SYN> ---> (?)
4. SYN-SENT OPEN
(!) <--- <SEQ=200><ACK=100><ACK>
5. SYN-SENT OPEN
<SEQ=101><RST> ---> (abort)
6. SYN-SENT CLOSED
7. SYN-SENT <SEQ=400><SYN> --->
Page 51
^L
RFC-908 July 1984
5.8 Detecting a Half-Open Connection from the Active Side
This is another example of detecting a half-open connection
due to the crash and restart of a host involved in a connection.
In this example, host A again crashes and restarts. Host B is
still active and tries to send data to host A. Since host A has
no knowledge of the connection, it rejects the data with an RST
segment, causing host B to reset the connection.
Host A Host B
Time
1. (crash!) OPEN
2. CLOSED <--- <SEQ=200><ACK=100><Data> OPEN
3. CLOSED <SEQ=101><RST> ---> (abort)
4. CLOSED CLOSED
Page 52
^L
RDP Specification Examples of Operation
APPENDIX A
Implementing a Minimal RDP
It is not necessary to implement the entire RDP
specification to be able to use RDP. For simple applications
such as a loader, where size of the protocol module may be
important, a subset of RDP may be used. For example, an
implementation of RDP for loading may employ the following
restrictions:
o Only one connection and connection record is supported.
This is the connection used to load the device.
o A single, well-known port is used as the loader port.
Allocable ports are not implemented.
o Only the passive Open request is implemented. Active Opens
are not supported.
o The sequenced delivery option is not supported. Messages
arriving out of order are delivered in the order they
arrive.
o If efficiency is less important than protocol size, the
extended acknowledgement feature need not be supported.
Page 53
^L
RFC-908 July 1984
INDEX
ACK.......................................... 16, 33, 34, 38
ACK segment format....................................... 38
acknowledgement number field......... 16, 34, 37, 38, 39, 40
byte-stream protocols................................. 4, 14
checksum................................................. 16
checksum field........................................... 34
Close request............................................ 13
Closed state.......................................... 9, 10
CLOSEWAIT................................................ 12
Close-Wait state................................. 10, 11, 13
CLOSE-WAIT timeouts...................................... 29
connection, closing of............................... 13, 42
connection, establishment of...................... 8, 11, 45
connection identifier................................. 7, 33
connection management..................................... 7
connection record..................................... 9, 11
connection state diagram................................. 10
connection states......................................... 8
control flags field...................................... 33
cumulative acknowledgement............................... 16
data communication....................................... 14
data length field................................ 34, 39, 40
datagrams................................................. 6
debugging.............................................. 1, 3
dumping................................................... 3
EACK......................................... 16, 33, 35, 40
EACK segment format...................................... 40
event processing......................................... 20
extended acknowledgement................................. 16
flow control............................................. 17
half-open connection, detection of............... 14, 51, 52
initial sequence number....................... 9, 11, 12, 15
internet protocols........................................ 5
IP................................................ 6, 15, 31
IP header............................................ 31, 37
Listen state................................... 8, 9, 10, 45
loading................................................ 1, 3
maximum segment size..................... 11, 12, 13, 15, 37
maximum unacknowledged segments.............. 11, 12, 17, 37
message fragmentation.................................... 14
non-cumulative acknowledgement........................... 16
Page 54
^L
RDP Specification Examples of Operation
NUL.................................................. 33, 43
NUL segment format....................................... 43
Open request.......................................... 8, 17
Open request, active................................... 8, 9
Open request, passive.................................. 8, 9
Open state....................................... 10, 11, 45
options flag field....................................... 37
out-of-sequence acknowledgement.................. 12, 16, 18
ports................................................. 7, 33
ports, well-known......................................... 8
positive acknowledgement............................. 15, 16
RBUF.MAX................................................. 13
RCV.CUR.................................................. 12
RCVDSEQNO................................................ 12
RCV.IRS.................................................. 12
RCV.MAX.................................................. 12
RDP connection........................................... 14
RDP header................................... 14, 16, 32, 37
RDP header length........................................ 33
RDP segment format....................................... 31
reliable communication................................... 15
retransmission of segments....................... 15, 16, 17
retransmission timeout............................... 17, 29
RST.................................................. 33, 42
RST segment.......................................... 13, 52
RST segment format....................................... 42
SBUF.MAX................................................. 12
SDM...................................................... 37
SEG.ACK.................................................. 13
SEG.BMAX................................................. 13
SEG.MAX.................................................. 13
segment arrival events............................... 20, 24
segments................................................. 14
SEG.SEQ.................................................. 13
Send request......................................... 14, 15
sequence number...................................... 12, 15
sequence number acceptance window........................ 18
sequence number field........................ 34, 37, 39, 40
sequenced delivery................................. 3, 4, 37
sequential acknowledgement................................ 4
SND.ISS.................................................. 12
SND.MAX.................................................. 12
SND.NXT.................................................. 11
SND.UNA.................................................. 12
STATE.................................................... 11
SYN.................................. 12, 13, 15, 33, 35, 36
SYN segment........................................... 9, 36
Page 55
^L
RFC-908 July 1984
Syn-Rcvd state........................................ 9, 10
Syn-Sent state........................................ 9, 10
TCP................................................... 4, 14
three-way handshake....................................... 4
user request events.................................. 20, 21
version number field..................................... 33
Page 56
^L
RDP Specification Examples of Operation
Page 57
|