File: rfc1813.txt

package info (click to toggle)
doc-rfc 20170121-1
  • links: PTS, VCS
  • area: non-free
  • in suites: stretch
  • size: 541,932 kB
  • ctags: 32
  • sloc: xml: 267,963; sh: 101; python: 90; perl: 42; makefile: 13
file content (7059 lines) | stat: -rw-r--r-- 229,793 bytes parent folder | download | duplicates (6)
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
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059






Network Working Group                                       B. Callaghan
Request for Comments: 1813                                  B. Pawlowski
Category: Informational                                      P. Staubach
                                                  Sun Microsystems, Inc.
                                                               June 1995


                  NFS Version 3 Protocol Specification

Status of this Memo

   This memo provides information for the Internet community.
   This memo does not specify an Internet standard of any kind.
   Distribution of this memo is unlimited.

IESG Note

   Internet Engineering Steering Group comment: please note that
   the IETF is not involved in creating or maintaining this
   specification.  This is the significance of the specification
   not being on the standards track.

Abstract

   This paper describes the NFS version 3 protocol.  This paper is
   provided so that people can write compatible implementations.

Table of Contents

   1.    Introduction . . . . . . . . . . . . . . . . . . . . . . .   3
   1.1     Scope of the NFS version 3 protocol  . . . . . . . . . .   4
   1.2     Useful terms . . . . . . . . . . . . . . . . . . . . . .   5
   1.3     Remote Procedure Call  . . . . . . . . . . . . . . . . .   5
   1.4     External Data Representation . . . . . . . . . . . . . .   5
   1.5     Authentication and Permission Checking . . . . . . . . .   7
   1.6     Philosophy . . . . . . . . . . . . . . . . . . . . . . .   8
   1.7     Changes from the NFS version 2 protocol  . . . . . . . .  11
   2.    RPC Information  . . . . . . . . . . . . . . . . . . . . .  14
   2.1     Authentication . . . . . . . . . . . . . . . . . . . . .  14
   2.2     Constants  . . . . . . . . . . . . . . . . . . . . . . .  14
   2.3     Transport address  . . . . . . . . . . . . . . . . . . .  14
   2.4     Sizes  . . . . . . . . . . . . . . . . . . . . . . . . .  14
   2.5     Basic Data Types . . . . . . . . . . . . . . . . . . . .  15
   2.6     Defined Error Numbers  . . . . . . . . . . . . . . . . .  17
   3.    Server Procedures  . . . . . . . . . . . . . . . . . . . .  27
   3.1     General comments on attributes . . . . . . . . . . . . .  29
   3.2     General comments on filenames  . . . . . . . . . . . . .  30
   3.3.0   NULL: Do nothing . . . . . . . . . . . . . . . . . . . .  31



Callaghan, el al             Informational                      [Page 1]

RFC 1813                 NFS Version 3 Protocol                June 1995


   3.3.1   GETATTR: Get file attributes . . . . . . . . . . . . . .  32
   3.3.2   SETATTR: Set file attributes . . . . . . . . . . . . . .  33
   3.3.3   LOOKUP: Lookup filename  . . . . . . . . . . . . . . . .  37
   3.3.4   ACCESS: Check access permission  . . . . . . . . . . . .  40
   3.3.5   READLINK: Read from symbolic link  . . . . . . . . . . .  44
   3.3.6   READ: Read from file . . . . . . . . . . . . . . . . . .  46
   3.3.7   WRITE: Write to file . . . . . . . . . . . . . . . . . .  49
   3.3.8   CREATE: Create a file  . . . . . . . . . . . . . . . . .  54
   3.3.9   MKDIR: Create a directory  . . . . . . . . . . . . . . .  58
   3.3.10  SYMLINK: Create a symbolic link  . . . . . . . . . . . .  61
   3.3.11  MKNOD: Create a special device . . . . . . . . . . . . .  63
   3.3.12  REMOVE: Remove a file  . . . . . . . . . . . . . . . . .  67
   3.3.13  RMDIR: Remove a directory  . . . . . . . . . . . . . . .  69
   3.3.14  RENAME: Rename a file or directory . . . . . . . . . . .  71
   3.3.15  LINK: Create link to an object . . . . . . . . . . . . .  74
   3.3.16  READDIR: Read From directory . . . . . . . . . . . . . .  76
   3.3.17  READDIRPLUS: Extended read from directory  . . . . . . .  80
   3.3.18  FSSTAT: Get dynamic file system information  . . . . . .  84
   3.3.19  FSINFO: Get static file system information . . . . . . .  86
   3.3.20  PATHCONF: Retrieve POSIX information . . . . . . . . . .  90
   3.3.21  COMMIT: Commit cached data on a server to stable storage  92
   4.    Implementation issues  . . . . . . . . . . . . . . . . . .  96
   4.1     Multiple version support . . . . . . . . . . . . . . . .  96
   4.2     Server/client relationship . . . . . . . . . . . . . . .  96
   4.3     Path name interpretation . . . . . . . . . . . . . . . .  97
   4.4     Permission issues  . . . . . . . . . . . . . . . . . . .  98
   4.5     Duplicate request cache  . . . . . . . . . . . . . . . .  99
   4.6     File name component handling . . . . . . . . . . . . . . 101
   4.7     Synchronous modifying operations . . . . . . . . . . . . 101
   4.8     Stable storage . . . . . . . . . . . . . . . . . . . . . 101
   4.9     Lookups and name resolution  . . . . . . . . . . . . . . 102
   4.10    Adaptive retransmission  . . . . . . . . . . . . . . . . 102
   4.11    Caching policies . . . . . . . . . . . . . . . . . . . . 102
   4.12    Stable versus unstable writes. . . . . . . . . . . . . . 103
   4.13    32 bit clients/servers and 64 bit clients/servers. . . . 104
   5.    Appendix I: Mount protocol . . . . . . . . . . . . . . . . 106
   5.1     RPC Information  . . . . . . . . . . . . . . . . . . . . 106
   5.1.1     Authentication . . . . . . . . . . . . . . . . . . . . 106
   5.1.2     Constants  . . . . . . . . . . . . . . . . . . . . . . 106
   5.1.3     Transport address  . . . . . . . . . . . . . . . . . . 106
   5.1.4     Sizes  . . . . . . . . . . . . . . . . . . . . . . . . 106
   5.1.5     Basic Data Types . . . . . . . . . . . . . . . . . . . 106
   5.2     Server Procedures  . . . . . . . . . . . . . . . . . . . 107
   5.2.0     NULL: Do nothing . . . . . . . . . . . . . . . . . . . 108
   5.2.1     MNT: Add mount entry . . . . . . . . . . . . . . . . . 109
   5.2.2     DUMP: Return mount entries . . . . . . . . . . . . . . 110
   5.2.3     UMNT: Remove mount entry . . . . . . . . . . . . . . . 111
   5.2.4     UMNTALL: Remove all mount entries  . . . . . . . . . . 112



Callaghan, el al             Informational                      [Page 2]

RFC 1813                 NFS Version 3 Protocol                June 1995


   5.2.5     EXPORT: Return export list . . . . . . . . . . . . . . 113
   6.    Appendix II: Lock manager protocol . . . . . . . . . . . . 114
   6.1     RPC Information  . . . . . . . . . . . . . . . . . . . . 114
   6.1.1     Authentication . . . . . . . . . . . . . . . . . . . . 114
   6.1.2     Constants  . . . . . . . . . . . . . . . . . . . . . . 114
   6.1.3     Transport Address  . . . . . . . . . . . . . . . . . . 115
   6.1.4     Basic Data Types . . . . . . . . . . . . . . . . . . . 115
   6.2     NLM Procedures . . . . . . . . . . . . . . . . . . . . . 118
   6.2.0     NULL: Do nothing . . . . . . . . . . . . . . . . . . . 120
   6.3     Implementation issues  . . . . . . . . . . . . . . . . . 120
   6.3.1     64-bit offsets and lengths . . . . . . . . . . . . . . 120
   6.3.2     File handles . . . . . . . . . . . . . . . . . . . . . 120
   7.    Appendix III: Bibliography . . . . . . . . . . . . . . . . 122
   8.    Security Considerations  . . . . . . . . . . . . . . . . . 125
   9.    Acknowledgements . . . . . . . . . . . . . . . . . . . . . 125
   10.   Authors' Addresses . . . . . . . . . . . . . . . . . . . . 126

1. Introduction

   Sun's NFS protocol provides transparent remote access to shared
   file systems across networks. The NFS protocol is designed to be
   machine, operating system, network architecture, and transport
   protocol independent. This independence is achieved through the
   use of Remote Procedure Call (RPC) primitives built on top of an
   eXternal Data Representation (XDR).  Implementations of the NFS
   version 2 protocol exist for a variety of machines, from personal
   computers to supercomputers. The initial version of the NFS
   protocol is specified in the Network File System Protocol
   Specification [RFC1094]. A description of the initial
   implementation can be found in [Sandberg].

   The supporting MOUNT protocol performs the operating
   system-specific functions that allow clients to attach remote
   directory trees to a point within the local file system. The
   mount process also allows the server to grant remote access
   privileges to a restricted set of clients via export control.

   The Lock Manager provides support for file locking when used in
   the NFS environment. The Network Lock Manager (NLM) protocol
   isolates the inherently stateful aspects of file locking into a
   separate protocol.

   A complete description of the above protocols and their
   implementation is to be found in [X/OpenNFS].

   The purpose of this document is to:





Callaghan, el al             Informational                      [Page 3]

RFC 1813                 NFS Version 3 Protocol                June 1995


        o Specify the NFS version 3 protocol.

        o Describe semantics of the protocol through annotation
          and description of intended implementation.

        o Specify the MOUNT version 3 protocol.

        o Briefly describe the changes between the NLM version 3
          protocol and the NLM version 4 protocol.

   The normative text is the description of the RPC procedures and
   arguments and results, which defines the over-the-wire protocol,
   and the semantics of those procedures. The material describing
   implementation practice aids the understanding of the protocol
   specification and describes some possible implementation issues
   and solutions. It is not possible to describe all implementations
   and the UNIX operating system implementation of the NFS version 3
   protocol is most often used to provide examples. Given that, the
   implementation discussion does not bear the authority of the
   description of the over-the-wire protocol itself.

1.1 Scope of the NFS version 3 protocol

   This revision of the NFS protocol addresses new requirements.
   The need to support larger files and file systems has prompted
   extensions to allow 64 bit file sizes and offsets. The revision
   enhances security by adding support for an access check to be
   done on the server. Performance modifications are of three
   types:

   1. The number of over-the-wire packets for a given
      set of file operations is reduced by returning file
      attributes on every operation, thus decreasing the number
      of calls to get modified attributes.

   2. The write throughput bottleneck caused by the synchronous
      definition of write in the NFS version 2 protocol has been
      addressed by adding support so that the NFS server can do
      unsafe writes. Unsafe writes are writes which have not
      been committed to stable storage before the operation
      returns.  This specification defines a method for
      committing these unsafe writes to stable storage in a
      reliable way.

   3. Limitations on transfer sizes have been relaxed.

   The ability to support multiple versions of a protocol in RPC
   will allow implementors of the NFS version 3 protocol to define



Callaghan, el al             Informational                      [Page 4]

RFC 1813                 NFS Version 3 Protocol                June 1995


   clients and servers that provide backwards compatibility with
   the existing installed base of NFS version 2 protocol
   implementations.

   The extensions described here represent an evolution of the
   existing NFS protocol and most of the design features of the
   NFS protocol described in [Sandberg] persist. See Changes
   from the NFS version 2 protocol on page 11 for a more
   detailed summary of the changes introduced by this revision.

1.2 Useful terms

   In this specification, a "server" is a machine that provides
   resources to the network; a "client" is a machine that accesses
   resources over the network; a "user" is a person logged in on a
   client; an "application" is a program that executes on a client.

1.3 Remote Procedure Call

   The Sun Remote Procedure Call specification provides a
   procedure-oriented interface to remote services. Each server
   supplies a program, which is a set of procedures. The NFS
   service is one such program. The combination of host address,
   program number, version number, and procedure number specify one
   remote service procedure.  Servers can support multiple versions
   of a program by using different protocol version numbers.

   The NFS protocol was designed to not require any specific level
   of reliability from its lower levels so it could potentially be
   used on many underlying transport protocols. The NFS service is
   based on RPC which provides the abstraction above lower level
   network and transport protocols.

   The rest of this document assumes the NFS environment is
   implemented on top of Sun RPC, which is specified in [RFC1057].
   A complete discussion is found in [Corbin].

1.4 External Data Representation

   The eXternal Data Representation (XDR) specification provides a
   standard way of representing a set of data types on a network.
   This solves the problem of different byte orders, structure
   alignment, and data type representation on different,
   communicating machines.

   In this document, the RPC Data Description Language is used to
   specify the XDR format parameters and results to each of the RPC
   service procedures that an NFS server provides. The RPC Data



Callaghan, el al             Informational                      [Page 5]

RFC 1813                 NFS Version 3 Protocol                June 1995


   Description Language is similar to declarations in the C
   programming language. A few new constructs have been added.
   The notation:

      string  name[SIZE];
      string  data<DSIZE>;

   defines name, which is a fixed size block of SIZE bytes, and
   data, which is a variable sized block of up to DSIZE bytes. This
   notation indicates fixed-length arrays and arrays with a
   variable number of elements up to a fixed maximum. A
   variable-length definition with no size specified means there is
   no maximum size for the field.

   The discriminated union definition:

      union example switch (enum status) {
           case OK:
              struct {
                 filename      file1;
                 filename      file2;
                 integer       count;
              }
           case ERROR:
              struct {
                 errstat       error;
                 integer       errno;
              }
           default:
              void;
      }

   defines a structure where the first thing over the network is an
   enumeration type called status. If the value of status is OK,
   the next thing on the network will be the structure containing
   file1, file2, and count. Else, if the value of status is ERROR,
   the next thing on the network will be a structure containing
   error and errno.  If the value of status is neither OK nor
   ERROR, then there is no more data in the structure.

   The XDR type, hyper, is an 8 byte (64 bit) quantity. It is used
   in the same way as the integer type. For example:

      hyper          foo;
      unsigned hyper bar;

   foo is an 8 byte signed value, while bar is an 8 byte unsigned
   value.



Callaghan, el al             Informational                      [Page 6]

RFC 1813                 NFS Version 3 Protocol                June 1995


   Although RPC/XDR compilers exist to generate client and server
   stubs from RPC Data Description Language input, NFS
   implementations do not require their use. Any software that
   provides equivalent encoding and decoding to the canonical
   network order of data defined by XDR can be used to interoperate
   with other NFS implementations.

   XDR is described in [RFC1014].

1.5 Authentication and Permission Checking

   The RPC protocol includes a slot for authentication parameters
   on every call. The contents of the authentication parameters are
   determined by the type of authentication used by the server and
   client. A server may support several different flavors of
   authentication at once. The AUTH_NONE flavor provides null
   authentication, that is, no authentication information is
   passed. The AUTH_UNIX flavor provides UNIX-style user ID, group
   ID, and groups with each call. The AUTH_DES flavor provides
   DES-encrypted authentication parameters based on a network-wide
   name, with session keys exchanged via a public key scheme. The
   AUTH_KERB flavor provides DES encrypted authentication
   parameters based on a network-wide name with session keys
   exchanged via Kerberos secret keys.

   The NFS server checks permissions by taking the credentials from
   the RPC authentication information in each remote request. For
   example, using the AUTH_UNIX flavor of authentication, the
   server gets the user's effective user ID, effective group ID and
   groups on each call, and uses them to check access. Using user
   ids and group ids implies that the client and server either
   share the same ID list or do local user and group ID mapping.
   Servers and clients must agree on the mapping from user to uid
   and from group to gid, for those sites that do not implement a
   consistent user ID and group ID space. In practice, such mapping
   is typically performed on the server, following a static mapping
   scheme or a mapping established by the user from a client at
   mount time.

   The AUTH_DES and AUTH_KERB style of authentication is based on a
   network-wide name. It provides greater security through the use
   of DES encryption and public keys in the case of AUTH_DES, and
   DES encryption and Kerberos secret keys (and tickets) in the
   AUTH_KERB case. Again, the server and client must agree on the
   identity of a particular name on the network, but the name to
   identity mapping is more operating system independent than the
   uid and gid mapping in AUTH_UNIX. Also, because the
   authentication parameters are encrypted, a malicious user must



Callaghan, el al             Informational                      [Page 7]

RFC 1813                 NFS Version 3 Protocol                June 1995


   know another users network password or private key to masquerade
   as that user. Similarly, the server returns a verifier that is
   also encrypted so that masquerading as a server requires knowing
   a network password.

   The NULL procedure typically requires no authentication.

1.6 Philosophy

   This specification defines the NFS version 3 protocol, that is
   the over-the-wire protocol by which a client accesses a server.
   The protocol provides a well-defined interface to a server's
   file resources. A client or server implements the protocol and
   provides a mapping of the local file system semantics and
   actions into those defined in the NFS version 3 protocol.
   Implementations may differ to varying degrees, depending on the
   extent to which a given environment can support all the
   operations and semantics defined in the NFS version 3 protocol.
   Although implementations exist and are used to illustrate
   various aspects of the NFS version 3 protocol, the protocol
   specification itself is the final description of how clients
   access server resources.

   Because the NFS version 3 protocol is designed to be
   operating-system independent, it does not necessarily match the
   semantics of any existing system. Server implementations are
   expected to make a best effort at supporting the protocol.  If a
   server cannot support a particular protocol procedure, it may
   return the error, NFS3ERR_NOTSUP, that indicates that the
   operation is not supported.  For example, many operating systems
   do not support the notion of a hard link. A server that cannot
   support hard links should return NFS3ERR_NOTSUP in response to a
   LINK request. FSINFO describes the most commonly unsupported
   procedures in the properties bit map.  Alternatively, a server
   may not natively support a given operation, but can emulate it
   in the NFS version 3 protocol implementation to provide greater
   functionality.

   In some cases, a server can support most of the semantics
   described by the protocol but not all. For example, the ctime
   field in the fattr structure gives the time that a file's
   attributes were last modified. Many systems do not keep this
   information. In this case, rather than not support the GETATTR
   operation, a server could simulate it by returning the last
   modified time in place of ctime.  Servers must be careful when
   simulating attribute information because of possible side
   effects on clients. For example, many clients use file
   modification times as a basis for their cache consistency



Callaghan, el al             Informational                      [Page 8]

RFC 1813                 NFS Version 3 Protocol                June 1995


   scheme.

   NFS servers are dumb and NFS clients are smart. It is the
   clients that do the work required to convert the generalized
   file access that servers provide into a file access method that
   is useful to applications and users. In the LINK example given
   above, a UNIX client that received an NFS3ERR_NOTSUP error from
   a server would do the recovery necessary to either make it look
   to the application like the link request had succeeded or return
   a reasonable error. In general, it is the burden of the client
   to recover.

   The NFS version 3 protocol assumes a stateless server
   implementation.  Statelessness means that the server does not
   need to maintain state about any of its clients in order to
   function correctly. Stateless servers have a distinct advantage
   over stateful servers in the event of a crash. With stateless
   servers, a client need only retry a request until the server
   responds; the client does not even need to know that the server
   has crashed. See additional comments in Duplicate request cache
   on page 99.

   For a server to be useful, it holds nonvolatile state: data
   stored in the file system. Design assumptions in the NFS version
   3 protocol regarding flushing of modified data to stable storage
   reduce the number of failure modes in which data loss can occur.
   In this way, NFS version 3 protocol implementations can tolerate
   transient failures, including transient failures of the network.
   In general, server implementations of the NFS version 3 protocol
   cannot tolerate a non-transient failure of the stable storage
   itself. However, there exist fault tolerant implementations
   which attempt to address such problems.

   That is not to say that an NFS version 3 protocol server can't
   maintain noncritical state. In many cases, servers will maintain
   state (cache) about previous operations to increase performance.
   For example, a client READ request might trigger a read-ahead of
   the next block of the file into the server's data cache in the
   anticipation that the client is doing a sequential read and the
   next client READ request will be satisfied from the server's
   data cache instead of from the disk. Read-ahead on the server
   increases performance by overlapping server disk I/O with client
   requests. The important point here is that the read-ahead block
   is not necessary for correct server behavior. If the server
   crashes and loses its memory cache of read buffers, recovery is
   simple on reboot - clients will continue read operations
   retrieving data from the server disk.




Callaghan, el al             Informational                      [Page 9]

RFC 1813                 NFS Version 3 Protocol                June 1995


   Most data-modifying operations in the NFS protocol are
   synchronous.  That is, when a data modifying procedure returns
   to the client, the client can assume that the operation has
   completed and any modified data associated with the request is
   now on stable storage. For example, a synchronous client WRITE
   request may cause the server to update data blocks, file system
   information blocks, and file attribute information - the latter
   information is usually referred to as metadata. When the WRITE
   operation completes, the client can assume that the write data
   is safe and discard it.  This is a very important part of the
   stateless nature of the server. If the server did not flush
   dirty data to stable storage before returning to the client, the
   client would have no way of knowing when it was safe to discard
   modified data. The following data modifying procedures are
   synchronous: WRITE (with stable flag set to FILE_SYNC), CREATE,
   MKDIR, SYMLINK, MKNOD, REMOVE, RMDIR, RENAME, LINK, and COMMIT.

   The NFS version 3 protocol introduces safe asynchronous writes
   on the server, when the WRITE procedure is used in conjunction
   with the COMMIT procedure. The COMMIT procedure provides a way
   for the client to flush data from previous asynchronous WRITE
   requests on the server to stable storage and to detect whether
   it is necessary to retransmit the data. See the procedure
   descriptions of WRITE on page 49 and COMMIT on page 92.

   The LOOKUP procedure is used by the client to traverse
   multicomponent file names (pathnames). Each call to LOOKUP is
   used to resolve one segment of a pathname. There are two reasons
   for restricting LOOKUP to a single segment: it is hard to
   standardize a common format for hierarchical file names and the
   client and server may have different mappings of pathnames to
   file systems. This would imply that either the client must break
   the path name at file system attachment points, or the server
   must know about the client's file system attachment points. In
   NFS version 3 protocol implementations, it is the client that
   constructs the hierarchical file name space using mounts to
   build a hierarchy. Support utilities, such as the Automounter,
   provide a way to manage a shared, consistent image of the file
   name space while still being driven by the client mount
   process.

   Clients can perform caching in varied manner. The general
   practice with the NFS version 2 protocol was to implement a
   time-based client-server cache consistency mechanism. It is
   expected NFS version 3 protocol implementations will use a
   similar mechanism. The NFS version 3 protocol has some explicit
   support, in the form of additional attribute information to
   eliminate explicit attribute checks. However, caching is not



Callaghan, el al             Informational                     [Page 10]

RFC 1813                 NFS Version 3 Protocol                June 1995


   required, nor is any caching policy defined by the protocol.
   Neither the NFS version 2 protocol nor the NFS version 3
   protocol provide a means of maintaining strict client-server
   consistency (and, by implication, consistency across client
   caches).

1.7 Changes from the NFS Version 2 Protocol

   The ROOT and WRITECACHE procedures have been removed. A MKNOD
   procedure has been defined to allow the creation of special
   files, eliminating the overloading of CREATE. Caching on the
   client is not defined nor dictated by the NFS version 3
   protocol, but additional information and hints have been added
   to the protocol to allow clients that implement caching to
   manage their caches more effectively. Procedures that affect the
   attributes of a file or directory may now return the new
   attributes after the operation has completed to optimize out a
   subsequent GETATTR used in validating attribute caches. In
   addition, operations that modify the directory in which the
   target object resides return the old and new attributes of the
   directory to allow clients to implement more intelligent cache
   invalidation procedures.  The ACCESS procedure provides access
   permission checking on the server, the FSSTAT procedure returns
   dynamic information about a file system, the FSINFO procedure
   returns static information about a file system and server, the
   READDIRPLUS procedure returns file handles and attributes in
   addition to directory entries, and the PATHCONF procedure
   returns POSIX pathconf information about a file.

   Below is a list of the important changes between the NFS version
   2 protocol and the NFS version 3 protocol.

   File handle size
         The file handle has been increased to a variable-length
         array of 64 bytes maximum from a fixed array of 32
         bytes. This addresses some known requirements for a
         slightly larger file handle size. The file handle was
         converted from fixed length to variable length to
         reduce local storage and network bandwidth requirements
         for systems which do not utilize the full 64 bytes of
         length.

   Maximum data sizes
         The maximum size of a data transfer used in the READ
         and WRITE procedures is now set by values in the FSINFO
         return structure. In addition, preferred transfer sizes
         are returned by FSINFO. The protocol does not place any
         artificial limits on the maximum transfer sizes.



Callaghan, el al             Informational                     [Page 11]

RFC 1813                 NFS Version 3 Protocol                June 1995


         Filenames and pathnames are now specified as strings of
         variable length. The actual length restrictions are
         determined by the client and server implementations as
         appropriate.  The protocol does not place any
         artificial limits on the length. The error,
         NFS3ERR_NAMETOOLONG, is provided to allow the server to
         return an indication to the client that it received a
         pathname that was too long for it to handle.

   Error return
         Error returns in some instances now return data (for
         example, attributes). nfsstat3 now defines the full set
         of errors that can be returned by a server. No other
         values are allowed.

   File type
         The file type now includes NF3CHR and NF3BLK for
         special files. Attributes for these types include
         subfields for UNIX major and minor devices numbers.
         NF3SOCK and NF3FIFO are now defined for sockets and
         fifos in the file system.

   File attributes
         The blocksize (the size in bytes of a block in the
         file) field has been removed. The mode field no longer
         contains file type information. The size and fileid
         fields have been widened to eight-byte unsigned
         integers from four-byte integers. Major and minor
         device information is now presented in a distinct
         structure.  The blocks field name has been changed to
         used and now contains the total number of bytes used by
         the file. It is also an eight-byte unsigned integer.

   Set file attributes
         In the NFS version 2 protocol, the settable attributes
         were represented by a subset of the file attributes
         structure; the client indicated those attributes which
         were not to be modified by setting the corresponding
         field to -1, overloading some unsigned fields. The set
         file attributes structure now uses a discriminated
         union for each field to tell whether or how to set that
         field. The atime and mtime fields can be set to either
         the server's current time or a time supplied by the
         client.

   LOOKUP
         The LOOKUP return structure now includes the attributes
         for the directory searched.



Callaghan, el al             Informational                     [Page 12]

RFC 1813                 NFS Version 3 Protocol                June 1995


   ACCESS
         An ACCESS procedure has been added to allow an explicit
         over-the-wire permissions check. This addresses known
         problems with the superuser ID mapping feature in many
         server implementations (where, due to mapping of root
         user, unexpected permission denied errors could occur
         while reading from or writing to a file).  This also
         removes the assumption which was made in the NFS
         version 2 protocol that access to files was based
         solely on UNIX style mode bits.

   READ
         The reply structure includes a Boolean that is TRUE if
         the end-of-file was encountered during the READ.  This
         allows the client to correctly detect end-of-file.

   WRITE
         The beginoffset and totalcount fields were removed from
         the WRITE arguments. The reply now includes a count so
         that the server can write less than the requested
         amount of data, if required. An indicator was added to
         the arguments to instruct the server as to the level of
         cache synchronization that is required by the client.

   CREATE
         An exclusive flag and a create verifier was added for
         the exclusive creation of regular files.

   MKNOD
         This procedure was added to support the creation of
         special files. This avoids overloading fields of CREATE
         as was done in some NFS version 2 protocol
         implementations.

   READDIR
         The READDIR arguments now include a verifier to allow
         the server to validate the cookie. The cookie is now a
         64 bit unsigned integer instead of the 4 byte array
         which was used in the NFS version 2 protocol.  This
         will help to reduce interoperability problems.

   READDIRPLUS
         This procedure was added to return file handles and
         attributes in an extended directory list.

   FSINFO
         FSINFO was added to provide nonvolatile information
         about a file system. The reply includes preferred and



Callaghan, el al             Informational                     [Page 13]

RFC 1813                 NFS Version 3 Protocol                June 1995


         maximum read transfer size, preferred and maximum write
         transfer size, and flags stating whether links or
         symbolic links are supported.  Also returned are
         preferred transfer size for READDIR procedure replies,
         server time granularity, and whether times can be set
         in a SETATTR request.

   FSSTAT
         FSSTAT was added to provide volatile information about
         a file system, for use by utilities such as the Unix
         system df command. The reply includes the total size
         and free space in the file system specified in bytes,
         the total number of files and number of free file slots
         in the file system, and an estimate of time between
         file system modifications (for use in cache consistency
         checking algorithms).

   COMMIT
         The COMMIT procedure provides the synchronization
         mechanism to be used with asynchronous WRITE
         operations.

2. RPC Information

2.1 Authentication

   The NFS service uses AUTH_NONE in the NULL procedure. AUTH_UNIX,
   AUTH_DES, or AUTH_KERB are used for all other procedures. Other
   authentication types may be supported in the future.

2.2 Constants

   These are the RPC constants needed to call the NFS Version 3
   service.  They are given in decimal.

      PROGRAM  100003
      VERSION  3

2.3 Transport address

   The NFS protocol is normally supported over the TCP and UDP
   protocols.  It uses port 2049, the same as the NFS version 2
   protocol.

2.4 Sizes

   These are the sizes, given in decimal bytes, of various XDR
   structures used in the NFS version 3 protocol:



Callaghan, el al             Informational                     [Page 14]

RFC 1813                 NFS Version 3 Protocol                June 1995


   NFS3_FHSIZE 64
      The maximum size in bytes of the opaque file handle.

   NFS3_COOKIEVERFSIZE 8
      The size in bytes of the opaque cookie verifier passed by
      READDIR and READDIRPLUS.

   NFS3_CREATEVERFSIZE 8
      The size in bytes of the opaque verifier used for
      exclusive CREATE.

   NFS3_WRITEVERFSIZE 8
      The size in bytes of the opaque verifier used for
      asynchronous WRITE.

2.5 Basic Data Types

   The following XDR definitions are basic definitions that are
   used in other structures.

   uint64
         typedef unsigned hyper uint64;

   int64
         typedef hyper int64;

   uint32
         typedef unsigned long uint32;

   int32
         typedef long int32;

   filename3
         typedef string filename3<>;

   nfspath3
         typedef string nfspath3<>;

   fileid3
         typedef uint64 fileid3;

   cookie3
         typedef uint64 cookie3;

   cookieverf3
         typedef opaque cookieverf3[NFS3_COOKIEVERFSIZE];





Callaghan, el al             Informational                     [Page 15]

RFC 1813                 NFS Version 3 Protocol                June 1995


   createverf3
         typedef opaque createverf3[NFS3_CREATEVERFSIZE];

   writeverf3
         typedef opaque writeverf3[NFS3_WRITEVERFSIZE];

   uid3
         typedef uint32 uid3;

   gid3
         typedef uint32 gid3;

   size3
         typedef uint64 size3;

   offset3
         typedef uint64 offset3;

   mode3
         typedef uint32 mode3;

   count3
         typedef uint32 count3;

   nfsstat3
      enum nfsstat3 {
         NFS3_OK             = 0,
         NFS3ERR_PERM        = 1,
         NFS3ERR_NOENT       = 2,
         NFS3ERR_IO          = 5,
         NFS3ERR_NXIO        = 6,
         NFS3ERR_ACCES       = 13,
         NFS3ERR_EXIST       = 17,
         NFS3ERR_XDEV        = 18,
         NFS3ERR_NODEV       = 19,
         NFS3ERR_NOTDIR      = 20,
         NFS3ERR_ISDIR       = 21,
         NFS3ERR_INVAL       = 22,
         NFS3ERR_FBIG        = 27,
         NFS3ERR_NOSPC       = 28,
         NFS3ERR_ROFS        = 30,
         NFS3ERR_MLINK       = 31,
         NFS3ERR_NAMETOOLONG = 63,
         NFS3ERR_NOTEMPTY    = 66,
         NFS3ERR_DQUOT       = 69,
         NFS3ERR_STALE       = 70,
         NFS3ERR_REMOTE      = 71,
         NFS3ERR_BADHANDLE   = 10001,



Callaghan, el al             Informational                     [Page 16]

RFC 1813                 NFS Version 3 Protocol                June 1995


         NFS3ERR_NOT_SYNC    = 10002,
         NFS3ERR_BAD_COOKIE  = 10003,
         NFS3ERR_NOTSUPP     = 10004,
         NFS3ERR_TOOSMALL    = 10005,
         NFS3ERR_SERVERFAULT = 10006,
         NFS3ERR_BADTYPE     = 10007,
         NFS3ERR_JUKEBOX     = 10008
      };

   The nfsstat3 type is returned with every procedure's results
   except for the NULL procedure. A value of NFS3_OK indicates that
   the call completed successfully. Any other value indicates that
   some error occurred on the call, as identified by the error
   code. Note that the precise numeric encoding must be followed.
   No other values may be returned by a server. Servers are
   expected to make a best effort mapping of error conditions to
   the set of error codes defined. In addition, no error
   precedences are specified by this specification.  Error
   precedences determine the error value that should be returned
   when more than one error applies in a given situation. The error
   precedence will be determined by the individual server
   implementation. If the client requires specific error
   precedences, it should check for the specific errors for
   itself.

2.6 Defined Error Numbers

   A description of each defined error follows:

   NFS3_OK
       Indicates the call completed successfully.

   NFS3ERR_PERM
       Not owner. The operation was not allowed because the
       caller is either not a privileged user (root) or not the
       owner of the target of the operation.

   NFS3ERR_NOENT
       No such file or directory. The file or directory name
       specified does not exist.

   NFS3ERR_IO
       I/O error. A hard error (for example, a disk error)
       occurred while processing the requested operation.

   NFS3ERR_NXIO
       I/O error. No such device or address.




Callaghan, el al             Informational                     [Page 17]

RFC 1813                 NFS Version 3 Protocol                June 1995


   NFS3ERR_ACCES
       Permission denied. The caller does not have the correct
       permission to perform the requested operation. Contrast
       this with NFS3ERR_PERM, which restricts itself to owner
       or privileged user permission failures.

   NFS3ERR_EXIST
       File exists. The file specified already exists.

   NFS3ERR_XDEV
       Attempt to do a cross-device hard link.

   NFS3ERR_NODEV
       No such device.

   NFS3ERR_NOTDIR
       Not a directory. The caller specified a non-directory in
       a directory operation.

   NFS3ERR_ISDIR
       Is a directory. The caller specified a directory in a
       non-directory operation.

   NFS3ERR_INVAL
       Invalid argument or unsupported argument for an
       operation. Two examples are attempting a READLINK on an
       object other than a symbolic link or attempting to
       SETATTR a time field on a server that does not support
       this operation.

   NFS3ERR_FBIG
       File too large. The operation would have caused a file to
       grow beyond the server's limit.

   NFS3ERR_NOSPC
       No space left on device. The operation would have caused
       the server's file system to exceed its limit.

   NFS3ERR_ROFS
       Read-only file system. A modifying operation was
       attempted on a read-only file system.

   NFS3ERR_MLINK
       Too many hard links.

   NFS3ERR_NAMETOOLONG
       The filename in an operation was too long.




Callaghan, el al             Informational                     [Page 18]

RFC 1813                 NFS Version 3 Protocol                June 1995


   NFS3ERR_NOTEMPTY

       An attempt was made to remove a directory that was not
       empty.

   NFS3ERR_DQUOT
       Resource (quota) hard limit exceeded. The user's resource
       limit on the server has been exceeded.

   NFS3ERR_STALE
       Invalid file handle. The file handle given in the
       arguments was invalid. The file referred to by that file
       handle no longer exists or access to it has been
       revoked.

   NFS3ERR_REMOTE
       Too many levels of remote in path. The file handle given
       in the arguments referred to a file on a non-local file
       system on the server.

   NFS3ERR_BADHANDLE
       Illegal NFS file handle. The file handle failed internal
       consistency checks.

   NFS3ERR_NOT_SYNC
       Update synchronization mismatch was detected during a
       SETATTR operation.

   NFS3ERR_BAD_COOKIE
       READDIR or READDIRPLUS cookie is stale.

   NFS3ERR_NOTSUPP
       Operation is not supported.

   NFS3ERR_TOOSMALL
       Buffer or request is too small.

   NFS3ERR_SERVERFAULT
       An error occurred on the server which does not map to any
       of the legal NFS version 3 protocol error values.  The
       client should translate this into an appropriate error.
       UNIX clients may choose to translate this to EIO.

   NFS3ERR_BADTYPE
       An attempt was made to create an object of a type not
       supported by the server.





Callaghan, el al             Informational                     [Page 19]

RFC 1813                 NFS Version 3 Protocol                June 1995


   NFS3ERR_JUKEBOX
       The server initiated the request, but was not able to
       complete it in a timely fashion. The client should wait
       and then try the request with a new RPC transaction ID.
       For example, this error should be returned from a server
       that supports hierarchical storage and receives a request
       to process a file that has been migrated. In this case,
       the server should start the immigration process and
       respond to client with this error.

   ftype3

      enum ftype3 {
         NF3REG    = 1,
         NF3DIR    = 2,
         NF3BLK    = 3,
         NF3CHR    = 4,
         NF3LNK    = 5,
         NF3SOCK   = 6,
         NF3FIFO   = 7
      };

   The enumeration, ftype3, gives the type of a file. The type,
   NF3REG, is a regular file, NF3DIR is a directory, NF3BLK is a
   block special device file, NF3CHR is a character special device
   file, NF3LNK is a symbolic link, NF3SOCK is a socket, and
   NF3FIFO is a named pipe. Note that the precise enum encoding
   must be followed.

   specdata3

      struct specdata3 {
           uint32     specdata1;
           uint32     specdata2;
      };

   The interpretation of the two words depends on the type of file
   system object. For a block special (NF3BLK) or character special
   (NF3CHR) file, specdata1 and specdata2 are the major and minor
   device numbers, respectively.  (This is obviously a
   UNIX-specific interpretation.) For all other file types, these
   two elements should either be set to 0 or the values should be
   agreed upon by the client and server. If the client and server
   do not agree upon the values, the client should treat these
   fields as if they are set to 0. This data field is returned as
   part of the fattr3 structure and so is available from all
   replies returning attributes. Since these fields are otherwise
   unused for objects which are not devices, out of band



Callaghan, el al             Informational                     [Page 20]

RFC 1813                 NFS Version 3 Protocol                June 1995


   information can be passed from the server to the client.
   However, once again, both the server and the client must agree
   on the values passed.

   nfs_fh3

      struct nfs_fh3 {
         opaque       data<NFS3_FHSIZE>;
      };

   The nfs_fh3 is the variable-length opaque object returned by the
   server on LOOKUP, CREATE, SYMLINK, MKNOD, LINK, or READDIRPLUS
   operations, which is used by the client on subsequent operations
   to reference the file. The file handle contains all the
   information the server needs to distinguish an individual file.
   To the client, the file handle is opaque. The client stores file
   handles for use in a later request and can compare two file
   handles from the same server for equality by doing a
   byte-by-byte comparison, but cannot otherwise interpret the
   contents of file handles. If two file handles from the same
   server are equal, they must refer to the same file, but if they
   are not equal, no conclusions can be drawn. Servers should try
   to maintain a one-to-one correspondence between file handles and
   files, but this is not required. Clients should use file handle
   comparisons only to improve performance, not for correct
   behavior.

   Servers can revoke the access provided by a file handle at any
   time.  If the file handle passed in a call refers to a file
   system object that no longer exists on the server or access for
   that file handle has been revoked, the error, NFS3ERR_STALE,
   should be returned.

   nfstime3

      struct nfstime3 {
         uint32   seconds;
         uint32   nseconds;
      };

   The nfstime3 structure gives the number of seconds and
   nanoseconds since midnight January 1, 1970 Greenwich Mean Time.
   It is used to pass time and date information. The times
   associated with files are all server times except in the case of
   a SETATTR operation where the client can explicitly set the file
   time. A server converts to and from local time when processing
   time values, preserving as much accuracy as possible. If the
   precision of timestamps stored for a file is less than that



Callaghan, el al             Informational                     [Page 21]

RFC 1813                 NFS Version 3 Protocol                June 1995


   defined by NFS version 3 protocol, loss of precision can occur.
   An adjunct time maintenance protocol is recommended to reduce
   client and server time skew.

   fattr3

      struct fattr3 {
         ftype3     type;
         mode3      mode;
         uint32     nlink;
         uid3       uid;
         gid3       gid;
         size3      size;
         size3      used;
         specdata3  rdev;
         uint64     fsid;
         fileid3    fileid;
         nfstime3   atime;
         nfstime3   mtime;
         nfstime3   ctime;
      };

   This structure defines the attributes of a file system object.
   It is returned by most operations on an object; in the case of
   operations that affect two objects (for example, a MKDIR that
   modifies the target directory attributes and defines new
   attributes for the newly created directory), the attributes for
   both may be returned. In some cases, the attributes are returned
   in the structure, wcc_data, which is defined below; in other
   cases the attributes are returned alone.  The main changes from
   the NFS version 2 protocol are that many of the fields have been
   widened and the major/minor device information is now presented
   in a distinct structure rather than being packed into a word.

   The fattr3 structure contains the basic attributes of a file.
   All servers should support this set of attributes even if they
   have to simulate some of the fields. Type is the type of the
   file. Mode is the protection mode bits. Nlink is the number of
   hard links to the file - that is, the number of different names
   for the same file. Uid is the user ID of the owner of the file.
   Gid is the group ID of the group of the file. Size is the size
   of the file in bytes. Used is the number of bytes of disk space
   that the file actually uses (which can be smaller than the size
   because the file may have holes or it may be larger due to
   fragmentation). Rdev describes the device file if the file type
   is NF3CHR or NF3BLK - see specdata3 on page 20. Fsid is the file
   system identifier for the file system. Fileid is a number which
   uniquely identifies the file within its file system (on UNIX



Callaghan, el al             Informational                     [Page 22]

RFC 1813                 NFS Version 3 Protocol                June 1995


   this would be the inumber). Atime is the time when the file data
   was last accessed. Mtime is the time when the file data was last
   modified.  Ctime is the time when the attributes of the file
   were last changed.  Writing to the file changes the ctime in
   addition to the mtime.

   The mode bits are defined as follows:

      0x00800 Set user ID on execution.
      0x00400 Set group ID on execution.
      0x00200 Save swapped text (not defined in POSIX).
      0x00100 Read permission for owner.
      0x00080 Write permission for owner.
      0x00040 Execute permission for owner on a file. Or lookup
              (search) permission for owner in directory.
      0x00020 Read permission for group.
      0x00010 Write permission for group.
      0x00008 Execute permission for group on a file. Or lookup
              (search) permission for group in directory.
      0x00004 Read permission for others.
      0x00002 Write permission for others.
      0x00001 Execute permission for others on a file. Or lookup
              (search) permission for others in directory.

   post_op_attr

      union post_op_attr switch (bool attributes_follow) {
      case TRUE:
         fattr3   attributes;
      case FALSE:
         void;
      };

   This structure is used for returning attributes in those
   operations that are not directly involved with manipulating
   attributes. One of the principles of this revision of the NFS
   protocol is to return the real value from the indicated
   operation and not an error from an incidental operation. The
   post_op_attr structure was designed to allow the server to
   recover from errors encountered while getting attributes.

   This appears to make returning attributes optional. However,
   server implementors are strongly encouraged to make best effort
   to return attributes whenever possible, even when returning an
   error.






Callaghan, el al             Informational                     [Page 23]

RFC 1813                 NFS Version 3 Protocol                June 1995


   wcc_attr

      struct wcc_attr {
         size3       size;
         nfstime3    mtime;
         nfstime3    ctime;
      };

   This is the subset of pre-operation attributes needed to better
   support the weak cache consistency semantics. Size is the file
   size in bytes of the object before the operation. Mtime is the
   time of last modification of the object before the operation.
   Ctime is the time of last change to the attributes of the object
   before the operation. See discussion in wcc_attr on page 24.

   The use of mtime by clients to detect changes to file system
   objects residing on a server is dependent on the granularity of
   the time base on the server.

   pre_op_attr

      union pre_op_attr switch (bool attributes_follow) {
      case TRUE:
           wcc_attr  attributes;
      case FALSE:
           void;
      };

   wcc_data

      struct wcc_data {
         pre_op_attr    before;
         post_op_attr   after;
      };

   When a client performs an operation that modifies the state of a
   file or directory on the server, it cannot immediately determine
   from the post-operation attributes whether the operation just
   performed was the only operation on the object since the last
   time the client received the attributes for the object. This is
   important, since if an intervening operation has changed the
   object, the client will need to invalidate any cached data for
   the object (except for the data that it just wrote).

   To deal with this, the notion of weak cache consistency data or
   wcc_data is introduced. A wcc_data structure consists of certain
   key fields from the object attributes before the operation,
   together with the object attributes after the operation. This



Callaghan, el al             Informational                     [Page 24]

RFC 1813                 NFS Version 3 Protocol                June 1995


   information allows the client to manage its cache more
   accurately than in NFS version 2 protocol implementations. The
   term, weak cache consistency, emphasizes the fact that this
   mechanism does not provide the strict server-client consistency
   that a cache consistency protocol would provide.

   In order to support the weak cache consistency model, the server
   will need to be able to get the pre-operation attributes of the
   object, perform the intended modify operation, and then get the
   post-operation attributes atomically. If there is a window for
   the object to get modified between the operation and either of
   the get attributes operations, then the client will not be able
   to determine whether it was the only entity to modify the
   object. Some information will have been lost, thus weakening the
   weak cache consistency guarantees.

   post_op_fh3

      union post_op_fh3 switch (bool handle_follows) {
      case TRUE:
           nfs_fh3  handle;
      case FALSE:
           void;
      };

   One of the principles of this revision of the NFS protocol is to
   return the real value from the indicated operation and not an
   error from an incidental operation. The post_op_fh3 structure
   was designed to allow the server to recover from errors
   encountered while constructing a file handle.

   This is the structure used to return a file handle from the
   CREATE, MKDIR, SYMLINK, MKNOD, and READDIRPLUS requests. In each
   case, the client can get the file handle by issuing a LOOKUP
   request after a successful return from one of the listed
   operations. Returning the file handle is an optimization so that
   the client is not forced to immediately issue a LOOKUP request
   to get the file handle.

   sattr3

      enum time_how {
         DONT_CHANGE        = 0,
         SET_TO_SERVER_TIME = 1,
         SET_TO_CLIENT_TIME = 2
      };

      union set_mode3 switch (bool set_it) {



Callaghan, el al             Informational                     [Page 25]

RFC 1813                 NFS Version 3 Protocol                June 1995


      case TRUE:
         mode3    mode;
      default:
         void;
      };

      union set_uid3 switch (bool set_it) {
      case TRUE:
         uid3     uid;
      default:
         void;
      };

      union set_gid3 switch (bool set_it) {
      case TRUE:
         gid3     gid;
      default:
         void;
      };

      union set_size3 switch (bool set_it) {
      case TRUE:
         size3    size;
      default:
         void;
      };

      union set_atime switch (time_how set_it) {
      case SET_TO_CLIENT_TIME:
         nfstime3  atime;
      default:
         void;
      };

      union set_mtime switch (time_how set_it) {
      case SET_TO_CLIENT_TIME:
         nfstime3  mtime;
      default:
         void;
      };

      struct sattr3 {
         set_mode3   mode;
         set_uid3    uid;
         set_gid3    gid;
         set_size3   size;
         set_atime   atime;
         set_mtime   mtime;



Callaghan, el al             Informational                     [Page 26]

RFC 1813                 NFS Version 3 Protocol                June 1995


      };

   The sattr3 structure contains the file attributes that can be
   set from the client. The fields are the same as the similarly
   named fields in the fattr3 structure. In the NFS version 3
   protocol, the settable attributes are described by a structure
   containing a set of discriminated unions. Each union indicates
   whether the corresponding attribute is to be updated, and if so,
   how.

   There are two forms of discriminated unions used. In setting the
   mode, uid, gid, or size, the discriminated union is switched on
   a boolean, set_it; if it is TRUE, a value of the appropriate
   type is then encoded.

   In setting the atime or mtime, the union is switched on an
   enumeration type, set_it. If set_it has the value DONT_CHANGE,
   the corresponding attribute is unchanged. If it has the value,
   SET_TO_SERVER_TIME, the corresponding attribute is set by the
   server to its local time; no data is provided by the client.
   Finally, if set_it has the value, SET_TO_CLIENT_TIME, the
   attribute is set to the time passed by the client in an nfstime3
   structure. (See FSINFO on page 86, which addresses the issue of
   time granularity).

   diropargs3

      struct diropargs3 {
         nfs_fh3     dir;
         filename3   name;
      };

   The diropargs3 structure is used in directory operations. The
   file handle, dir, identifies the directory in which to
   manipulate or access the file, name. See additional comments in
   File name component handling on page 101.

3. Server Procedures

   The following sections define the RPC procedures that are
   supplied by an NFS version 3 protocol server. The RPC
   procedure number is given at the top of the page with the
   name. The SYNOPSIS provides the name of the procedure, the
   list of the names of the arguments, the list of the names of
   the results, followed by the XDR argument declarations and
   results declarations. The information in the SYNOPSIS is
   specified in RPC Data Description Language as defined in
   [RFC1014]. The DESCRIPTION section tells what the procedure



Callaghan, el al             Informational                     [Page 27]

RFC 1813                 NFS Version 3 Protocol                June 1995


   is expected to do and how its arguments and results are used.
   The ERRORS section lists the errors returned for specific
   types of failures. These lists are not intended to be the
   definitive statement of all of the errors which can be
   returned by any specific procedure, but as a guide for the
   more common errors which may be returned.  Client
   implementations should be prepared to deal with unexpected
   errors coming from a server. The IMPLEMENTATION field gives
   information about how the procedure is expected to work and
   how it should be used by clients.

      program NFS_PROGRAM {
         version NFS_V3 {

            void
             NFSPROC3_NULL(void)                    = 0;

            GETATTR3res
             NFSPROC3_GETATTR(GETATTR3args)         = 1;

            SETATTR3res
             NFSPROC3_SETATTR(SETATTR3args)         = 2;

            LOOKUP3res
             NFSPROC3_LOOKUP(LOOKUP3args)           = 3;

            ACCESS3res
             NFSPROC3_ACCESS(ACCESS3args)           = 4;

            READLINK3res
             NFSPROC3_READLINK(READLINK3args)       = 5;

            READ3res
             NFSPROC3_READ(READ3args)               = 6;

            WRITE3res
             NFSPROC3_WRITE(WRITE3args)             = 7;

            CREATE3res
             NFSPROC3_CREATE(CREATE3args)           = 8;

            MKDIR3res
             NFSPROC3_MKDIR(MKDIR3args)             = 9;

            SYMLINK3res
             NFSPROC3_SYMLINK(SYMLINK3args)         = 10;





Callaghan, el al             Informational                     [Page 28]

RFC 1813                 NFS Version 3 Protocol                June 1995


            MKNOD3res
             NFSPROC3_MKNOD(MKNOD3args)             = 11;

            REMOVE3res
             NFSPROC3_REMOVE(REMOVE3args)           = 12;

            RMDIR3res
             NFSPROC3_RMDIR(RMDIR3args)             = 13;

            RENAME3res
             NFSPROC3_RENAME(RENAME3args)           = 14;

            LINK3res
             NFSPROC3_LINK(LINK3args)               = 15;

            READDIR3res
             NFSPROC3_READDIR(READDIR3args)         = 16;

            READDIRPLUS3res
             NFSPROC3_READDIRPLUS(READDIRPLUS3args) = 17;

            FSSTAT3res
             NFSPROC3_FSSTAT(FSSTAT3args)           = 18;

            FSINFO3res
             NFSPROC3_FSINFO(FSINFO3args)           = 19;

            PATHCONF3res
             NFSPROC3_PATHCONF(PATHCONF3args)       = 20;

            COMMIT3res
             NFSPROC3_COMMIT(COMMIT3args)           = 21;

         } = 3;
      } = 100003;

   Out of range (undefined) procedure numbers result in RPC
   errors.  Refer to [RFC1057] for more detail.

3.1 General comments on attributes and consistency data on failure

   For those procedures that return either post_op_attr or wcc_data
   structures on failure, the discriminated union may contain the
   pre-operation attributes of the object or object parent
   directory.  This depends on the error encountered and may also
   depend on the particular server implementation. Implementors are
   strongly encouraged to return as much attribute data as possible
   upon failure, but client implementors need to be aware that



Callaghan, el al             Informational                     [Page 29]

RFC 1813                 NFS Version 3 Protocol                June 1995


   their implementation must correctly handle the variant return
   instance where no attributes or consistency data is returned.

3.2 General comments on filenames

   The following comments apply to all NFS version 3 protocol
   procedures in which the client provides one or more filenames in
   the arguments: LOOKUP, CREATE, MKDIR, SYMLINK, MKNOD, REMOVE,
   RMDIR, RENAME, and LINK.

   1. The filename must not be null nor may it be the null
      string.  The server should return the error, NFS3ERR_ACCES, if
      it receives such a filename. On some clients, the filename, ``''
      or a null string, is assumed to be an alias for the current
      directory. Clients which require this functionality should
      implement it for themselves and not depend upon the server to
      support such semantics.

   2. A filename having the value of "." is assumed to be an
      alias for the current directory. Clients which require this
      functionality should implement it for themselves and not depend
      upon the server to support such semantics. However, the server
      should be able to handle such a filename correctly.

   3. A filename having the value of ".." is assumed to be an
      alias for the parent of the current directory, i.e. the
      directory which contains the current directory. The server
      should be prepared to handle this semantic, if it supports
      directories, even if those directories do not contain UNIX-style
      "." or ".." entries.

   4. If the filename is longer than the maximum for the file
      system (see PATHCONF on page 90, specifically name_max), the
      result depends on the value of the PATHCONF flag, no_trunc. If
      no_trunc is FALSE, the filename will be silently truncated to
      name_max bytes. If no_trunc is TRUE and the filename exceeds the
      server's file system maximum filename length, the operation will
      fail with the error, NFS3ERR_NAMETOOLONG.

   5. In general, there will be characters that a server will
      not be able to handle as part of a filename. This set of
      characters will vary from server to server and from
      implementation to implementation.  In most cases, it is the
      server which will control the client's view of the file system.
      If the server receives a filename containing characters that it
      can not handle, the error, NFS3ERR_EACCES, should be returned.
      Client implementations should be prepared to handle this side
      affect of heterogeneity.



Callaghan, el al             Informational                     [Page 30]

RFC 1813                 NFS Version 3 Protocol                June 1995


   See also comments in File name component handling on page 101.

3.3.0 Procedure 0: NULL - Do nothing

   SYNOPSIS

      void NFSPROC3_NULL(void) = 0;

   DESCRIPTION

      Procedure NULL does not do any work. It is made available to
      allow server response testing and timing.

   IMPLEMENTATION

      It is important that this procedure do no work at all so
      that it can be used to measure the overhead of processing
      a service request. By convention, the NULL procedure
      should never require any authentication. A server may
      choose to ignore this convention, in a more secure
      implementation, where responding to the NULL procedure
      call acknowledges the existence of a resource to an
      unauthenticated client.

   ERRORS

      Since the NULL procedure takes no NFS version 3 protocol
      arguments and returns no NFS version 3 protocol response,
      it can not return an NFS version 3 protocol error.
      However, it is possible that some server implementations
      may return RPC errors based on security and authentication
      requirements.



















Callaghan, el al             Informational                     [Page 31]

RFC 1813                 NFS Version 3 Protocol                June 1995


3.3.1 Procedure 1: GETATTR - Get file attributes

   SYNOPSIS

      GETATTR3res NFSPROC3_GETATTR(GETATTR3args) = 1;

      struct GETATTR3args {
         nfs_fh3  object;
      };

      struct GETATTR3resok {
         fattr3   obj_attributes;
      };

      union GETATTR3res switch (nfsstat3 status) {
      case NFS3_OK:
         GETATTR3resok  resok;
      default:
         void;
      };

   DESCRIPTION

      Procedure GETATTR retrieves the attributes for a specified
      file system object. The object is identified by the file
      handle that the server returned as part of the response
      from a LOOKUP, CREATE, MKDIR, SYMLINK, MKNOD, or
      READDIRPLUS procedure (or from the MOUNT service,
      described elsewhere). On entry, the arguments in
      GETATTR3args are:

      object
         The file handle of an object whose attributes are to be
         retrieved.

      On successful return, GETATTR3res.status is NFS3_OK and
      GETATTR3res.resok contains:

      obj_attributes
         The attributes for the object.

      Otherwise, GETATTR3res.status contains the error on failure and
      no other results are returned.

   IMPLEMENTATION

      The attributes of file system objects is a point of major
      disagreement between different operating systems. Servers



Callaghan, el al             Informational                     [Page 32]

RFC 1813                 NFS Version 3 Protocol                June 1995


      should make a best attempt to support all of the
      attributes in the fattr3 structure so that clients can
      count on this as a common ground. Some mapping may be
      required to map local attributes to those in the fattr3
      structure.

      Today, most client NFS version 3 protocol implementations
      implement a time-bounded attribute caching scheme to
      reduce over-the-wire attribute checks.

   ERRORS

      NFS3ERR_IO
      NFS3ERR_STALE
      NFS3ERR_BADHANDLE
      NFS3ERR_SERVERFAULT

   SEE ALSO

      ACCESS.

3.3.2 Procedure 2: SETATTR - Set file attributes

   SYNOPSIS

      SETATTR3res NFSPROC3_SETATTR(SETATTR3args) = 2;

      union sattrguard3 switch (bool check) {
      case TRUE:
         nfstime3  obj_ctime;
      case FALSE:
         void;
      };

      struct SETATTR3args {
         nfs_fh3      object;
         sattr3       new_attributes;
         sattrguard3  guard;
      };

      struct SETATTR3resok {
         wcc_data  obj_wcc;
      };

      struct SETATTR3resfail {
         wcc_data  obj_wcc;
      };




Callaghan, el al             Informational                     [Page 33]

RFC 1813                 NFS Version 3 Protocol                June 1995


      union SETATTR3res switch (nfsstat3 status) {
      case NFS3_OK:
         SETATTR3resok   resok;
      default:
         SETATTR3resfail resfail;
      };

   DESCRIPTION

      Procedure SETATTR changes one or more of the attributes of
      a file system object on the server. The new attributes are
      specified by a sattr3 structure. On entry, the arguments
      in SETATTR3args are:

      object
         The file handle for the object.

      new_attributes
         A sattr3 structure containing booleans and
         enumerations describing the attributes to be set and the new
         values for those attributes.

      guard
         A sattrguard3 union:

         check
            TRUE if the server is to verify that guard.obj_ctime
            matches the ctime for the object; FALSE otherwise.

      A client may request that the server check that the object
      is in an expected state before performing the SETATTR
      operation. To do this, it sets the argument guard.check to
      TRUE and the client passes a time value in guard.obj_ctime.
      If guard.check is TRUE, the server must compare the value of
      guard.obj_ctime to the current ctime of the object. If the
      values are different, the server must preserve the object
      attributes and must return a status of NFS3ERR_NOT_SYNC.
      If guard.check is FALSE, the server will not perform this
      check.

      On successful return, SETATTR3res.status is NFS3_OK and
      SETATTR3res.resok contains:

         obj_wcc
            A wcc_data structure containing the old and new
            attributes for the object.





Callaghan, el al             Informational                     [Page 34]

RFC 1813                 NFS Version 3 Protocol                June 1995


      Otherwise, SETATTR3res.status contains the error on
      failure and SETATTR3res.resfail contains the following:

         obj_wcc
            A wcc_data structure containing the old and new
            attributes for the object.

   IMPLEMENTATION

      The guard.check mechanism allows the client to avoid
      changing the attributes of an object on the basis of stale
      attributes. It does not guarantee exactly-once semantics.
      In particular, if a reply is lost and the server does not
      detect the retransmission of the request, the procedure
      can fail with the error, NFS3ERR_NOT_SYNC, even though the
      attribute setting was previously performed successfully.
      The client can attempt to recover from this error by
      getting fresh attributes from the server and sending a new
      SETATTR request using the new ctime.  The client can
      optionally check the attributes to avoid the second
      SETATTR request if the new attributes show that the
      attributes have already been set as desired (though it may
      not have been the issuing client that set the
      attributes).

      The new_attributes.size field is used to request changes
      to the size of a file. A value of 0 causes the file to be
      truncated, a value less than the current size of the file
      causes data from new size to the end of the file to be
      discarded, and a size greater than the current size of the
      file causes logically zeroed data bytes to be added to the
      end of the file.  Servers are free to implement this using
      holes or actual zero data bytes. Clients should not make
      any assumptions regarding a server's implementation of
      this feature, beyond that the bytes returned will be
      zeroed. Servers must support extending the file size via
      SETATTR.

      SETATTR is not guaranteed atomic. A failed SETATTR may
      partially change a file's attributes.

      Changing the size of a file with SETATTR indirectly
      changes the mtime. A client must account for this as size
      changes can result in data deletion.

      If server and client times differ, programs that compare
      client time to file times can break. A time maintenance
      protocol should be used to limit client/server time skew.



Callaghan, el al             Informational                     [Page 35]

RFC 1813                 NFS Version 3 Protocol                June 1995


      In a heterogeneous environment, it is quite possible that
      the server will not be able to support the full range of
      SETATTR requests. The error, NFS3ERR_INVAL, may be
      returned if the server can not store a uid or gid in its
      own representation of uids or gids, respectively.  If the
      server can only support 32 bit offsets and sizes, a
      SETATTR request to set the size of a file to larger than
      can be represented in 32 bits will be rejected with this
      same error.

   ERRORS

      NFS3ERR_PERM
      NFS3ERR_IO
      NFS3ERR_ACCES
      NFS3ERR_INVAL
      NFS3ERR_NOSPC
      NFS3ERR_ROFS
      NFS3ERR_DQUOT
      NFS3ERR_NOT_SYNC
      NFS3ERR_STALE
      NFS3ERR_BADHANDLE
      NFS3ERR_SERVERFAULT

   SEE ALSO

      CREATE, MKDIR, SYMLINK, and MKNOD.
























Callaghan, el al             Informational                     [Page 36]

RFC 1813                 NFS Version 3 Protocol                June 1995


3.3.3 Procedure 3: LOOKUP -  Lookup filename

   SYNOPSIS

      LOOKUP3res NFSPROC3_LOOKUP(LOOKUP3args) = 3;

      struct LOOKUP3args {
           diropargs3  what;
      };

      struct LOOKUP3resok {
           nfs_fh3      object;
           post_op_attr obj_attributes;
           post_op_attr dir_attributes;
      };

      struct LOOKUP3resfail {
           post_op_attr dir_attributes;
      };

      union LOOKUP3res switch (nfsstat3 status) {
      case NFS3_OK:
           LOOKUP3resok    resok;
      default:
           LOOKUP3resfail  resfail;
      };

   DESCRIPTION

      Procedure LOOKUP searches a directory for a specific name
      and returns the file handle for the corresponding file
      system object. On entry, the arguments in LOOKUP3args
      are:

      what
         Object to look up:

         dir
            The file handle for the directory to search.

         name
            The filename to be searched for. Refer to General
            comments on filenames on page 30.

      On successful return, LOOKUP3res.status is NFS3_OK and
      LOOKUP3res.resok contains:





Callaghan, el al             Informational                     [Page 37]

RFC 1813                 NFS Version 3 Protocol                June 1995


      object
         The file handle of the object corresponding to
         what.name.

      obj_attributes
         The attributes of the object corresponding to
         what.name.

      dir_attributes
         The post-operation attributes of the directory,
         what.dir.

      Otherwise, LOOKUP3res.status contains the error on failure and
      LOOKUP3res.resfail contains the following:

      dir_attributes
         The post-operation attributes for the directory,
         what.dir.

   IMPLEMENTATION

      At first glance, in the case where what.name refers to a
      mount point on the server, two different replies seem
      possible. The server can return either the file handle for
      the underlying directory that is mounted on or the file
      handle of the root of the mounted directory.  This
      ambiguity is simply resolved. A server will not allow a
      LOOKUP operation to cross a mountpoint to the root of a
      different filesystem, even if the filesystem is exported.
      This does not prevent a client from accessing a hierarchy
      of filesystems exported by a server, but the client must
      mount each of the filesystems individually so that the
      mountpoint crossing takes place on the client.  A given
      server implementation may refine these rules given
      capabilities or limitations particular to that
      implementation. Refer to [X/OpenNFS] for a discussion on
      exporting file systems.

      Two filenames are distinguished, as in the NFS version 2
      protocol.  The name, ".", is an alias for the current
      directory and the name, "..", is an alias for the parent
      directory; that is, the directory that includes the
      specified directory as a member. There is no facility for
      dealing with a multiparented directory and the NFS
      protocol assumes a hierarchical organization, organized as
      a single-rooted tree.





Callaghan, el al             Informational                     [Page 38]

RFC 1813                 NFS Version 3 Protocol                June 1995


      Note that this procedure does not follow symbolic links.
      The client is responsible for all parsing of filenames
      including filenames that are modified by symbolic links
      encountered during the lookup process.

   ERRORS

      NFS3ERR_IO
      NFS3ERR_NOENT
      NFS3ERR_ACCES
      NFS3ERR_NOTDIR
      NFS3ERR_NAMETOOLONG
      NFS3ERR_STALE
      NFS3ERR_BADHANDLE
      NFS3ERR_SERVERFAULT

   SEE ALSO

      CREATE, MKDIR, SYMLINK, MKNOD, READDIRPLUS, and PATHCONF.
































Callaghan, el al             Informational                     [Page 39]

RFC 1813                 NFS Version 3 Protocol                June 1995


3.3.4 Procedure 4: ACCESS - Check Access Permission

   SYNOPSIS

      ACCESS3res NFSPROC3_ACCESS(ACCESS3args) = 4;

      const ACCESS3_READ    = 0x0001;
      const ACCESS3_LOOKUP  = 0x0002;
      const ACCESS3_MODIFY  = 0x0004;
      const ACCESS3_EXTEND  = 0x0008;
      const ACCESS3_DELETE  = 0x0010;
      const ACCESS3_EXECUTE = 0x0020;

      struct ACCESS3args {
           nfs_fh3  object;
           uint32   access;
      };

      struct ACCESS3resok {
           post_op_attr   obj_attributes;
           uint32         access;
      };

      struct ACCESS3resfail {
           post_op_attr   obj_attributes;
      };

      union ACCESS3res switch (nfsstat3 status) {
      case NFS3_OK:
           ACCESS3resok   resok;
      default:
           ACCESS3resfail resfail;
      };

   DESCRIPTION

      Procedure ACCESS determines the access rights that a user,
      as identified by the credentials in the request, has with
      respect to a file system object. The client encodes the
      set of permissions that are to be checked in a bit mask.
      The server checks the permissions encoded in the bit mask.
      A status of NFS3_OK is returned along with a bit mask
      encoded with the permissions that the client is allowed.

      The results of this procedure are necessarily advisory in
      nature.  That is, a return status of NFS3_OK and the
      appropriate bit set in the bit mask does not imply that
      such access will be allowed to the file system object in



Callaghan, el al             Informational                     [Page 40]

RFC 1813                 NFS Version 3 Protocol                June 1995


      the future, as access rights can be revoked by the server
      at any time.

      On entry, the arguments in ACCESS3args are:

      object
         The file handle for the file system object to which
         access is to be checked.

      access
         A bit mask of access permissions to check.

      The following access permissions may be requested:

         ACCESS3_READ
            Read data from file or read a directory.

         ACCESS3_LOOKUP
            Look up a name in a directory (no meaning for
            non-directory objects).

         ACCESS3_MODIFY
            Rewrite existing file data or modify existing
            directory entries.

         ACCESS3_EXTEND
            Write new data or add directory entries.

         ACCESS3_DELETE
            Delete an existing directory entry.

         ACCESS3_EXECUTE
            Execute file (no meaning for a directory).

      On successful return, ACCESS3res.status is NFS3_OK. The
      server should return a status of NFS3_OK if no errors
      occurred that prevented the server from making the
      required access checks. The results in ACCESS3res.resok
      are:

      obj_attributes
         The post-operation attributes of object.

      access
         A bit mask of access permissions indicating access
         rights for the authentication credentials provided with
         the request.




Callaghan, el al             Informational                     [Page 41]

RFC 1813                 NFS Version 3 Protocol                June 1995


      Otherwise, ACCESS3res.status contains the error on failure
      and ACCESS3res.resfail contains the following:

      obj_attributes
         The attributes of object - if access to attributes is
         permitted.

   IMPLEMENTATION

      In general, it is not sufficient for the client to attempt
      to deduce access permissions by inspecting the uid, gid,
      and mode fields in the file attributes, since the server
      may perform uid or gid mapping or enforce additional
      access control restrictions. It is also possible that the
      NFS version 3 protocol server may not be in the same ID
      space as the NFS version 3 protocol client. In these cases
      (and perhaps others), the NFS version 3 protocol client
      can not reliably perform an access check with only current
      file attributes.

      In the NFS version 2 protocol, the only reliable way to
      determine whether an operation was allowed was to try it
      and see if it succeeded or failed. Using the ACCESS
      procedure in the NFS version 3 protocol, the client can
      ask the server to indicate whether or not one or more
      classes of operations are permitted.  The ACCESS operation
      is provided to allow clients to check before doing a
      series of operations. This is useful in operating systems
      (such as UNIX) where permission checking is done only when
      a file or directory is opened. This procedure is also
      invoked by NFS client access procedure (called possibly
      through access(2)). The intent is to make the behavior of
      opening a remote file more consistent with the behavior of
      opening a local file.

      The information returned by the server in response to an
      ACCESS call is not permanent. It was correct at the exact
      time that the server performed the checks, but not
      necessarily afterwards. The server can revoke access
      permission at any time.

      The NFS version 3 protocol client should use the effective
      credentials of the user to build the authentication
      information in the ACCESS request used to determine access
      rights. It is the effective user and group credentials
      that are used in subsequent read and write operations. See
      the comments in Permission issues on page 98 for more
      information on this topic.



Callaghan, el al             Informational                     [Page 42]

RFC 1813                 NFS Version 3 Protocol                June 1995


      Many implementations do not directly support the
      ACCESS3_DELETE permission. Operating systems like UNIX
      will ignore the ACCESS3_DELETE bit if set on an access
      request on a non-directory object. In these systems,
      delete permission on a file is determined by the access
      permissions on the directory in which the file resides,
      instead of being determined by the permissions of the file
      itself.  Thus, the bit mask returned for such a request
      will have the ACCESS3_DELETE bit set to 0, indicating that
      the client does not have this permission.

   ERRORS

      NFS3ERR_IO
      NFS3ERR_STALE
      NFS3ERR_BADHANDLE
      NFS3ERR_SERVERFAULT

   SEE ALSO

      GETATTR.






























Callaghan, el al             Informational                     [Page 43]

RFC 1813                 NFS Version 3 Protocol                June 1995


3.3.5 Procedure 5: READLINK - Read from symbolic link

   SYNOPSIS

      READLINK3res NFSPROC3_READLINK(READLINK3args) = 5;

      struct READLINK3args {
           nfs_fh3  symlink;
      };

      struct READLINK3resok {
           post_op_attr   symlink_attributes;
           nfspath3       data;
      };

      struct READLINK3resfail {
           post_op_attr   symlink_attributes;
      };

      union READLINK3res switch (nfsstat3 status) {
      case NFS3_OK:
           READLINK3resok   resok;
      default:
           READLINK3resfail resfail;
      };

   DESCRIPTION

      Procedure READLINK reads the data associated with a
      symbolic link.  The data is an ASCII string that is opaque
      to the server.  That is, whether created by the NFS
      version 3 protocol software from a client or created
      locally on the server, the data in a symbolic link is not
      interpreted when created, but is simply stored. On entry,
      the arguments in READLINK3args are:

      symlink
         The file handle for a symbolic link (file system object
         of type NF3LNK).

      On successful return, READLINK3res.status is NFS3_OK and
      READLINK3res.resok contains:

      data
         The data associated with the symbolic link.

      symlink_attributes
         The post-operation attributes for the symbolic link.



Callaghan, el al             Informational                     [Page 44]

RFC 1813                 NFS Version 3 Protocol                June 1995


      Otherwise, READLINK3res.status contains the error on
      failure and READLINK3res.resfail contains the following:

      symlink_attributes
         The post-operation attributes for the symbolic link.

   IMPLEMENTATION

      A symbolic link is nominally a pointer to another file.
      The data is not necessarily interpreted by the server,
      just stored in the file.  It is possible for a client
      implementation to store a path name that is not meaningful
      to the server operating system in a symbolic link.  A
      READLINK operation returns the data to the client for
      interpretation. If different implementations want to share
      access to symbolic links, then they must agree on the
      interpretation of the data in the symbolic link.

      The READLINK operation is only allowed on objects of type,
      NF3LNK.  The server should return the error,
      NFS3ERR_INVAL, if the object is not of type, NF3LNK.
      (Note: The X/Open XNFS Specification for the NFS version 2
      protocol defined the error status in this case as
      NFSERR_NXIO. This is inconsistent with existing server
      practice.)

   ERRORS

      NFS3ERR_IO
      NFS3ERR_INVAL
      NFS3ERR_ACCES
      NFS3ERR_STALE
      NFS3ERR_BADHANDLE
      NFS3ERR_NOTSUPP
      NFS3ERR_SERVERFAULT

   SEE ALSO

      READLINK, SYMLINK.












Callaghan, el al             Informational                     [Page 45]

RFC 1813                 NFS Version 3 Protocol                June 1995


3.3.6 Procedure 6: READ - Read From file

   SYNOPSIS

      READ3res NFSPROC3_READ(READ3args) = 6;

      struct READ3args {
           nfs_fh3  file;
           offset3  offset;
           count3   count;
      };

      struct READ3resok {
           post_op_attr   file_attributes;
           count3         count;
           bool           eof;
           opaque         data<>;
      };

      struct READ3resfail {
           post_op_attr   file_attributes;
      };

      union READ3res switch (nfsstat3 status) {
      case NFS3_OK:
           READ3resok   resok;
      default:
           READ3resfail resfail;
      };

   DESCRIPTION

      Procedure READ reads data from a file.  On entry, the
      arguments in READ3args are:

      file
         The file handle of the file from which data is to be
         read.  This must identify a file system object of type,
         NF3REG.

      offset
         The position within the file at which the read is to
         begin.  An offset of 0 means to read data starting at
         the beginning of the file. If offset is greater than or
         equal to the size of the file, the status, NFS3_OK, is
         returned with count set to 0 and eof set to TRUE,
         subject to access permissions checking.




Callaghan, el al             Informational                     [Page 46]

RFC 1813                 NFS Version 3 Protocol                June 1995


      count
         The number of bytes of data that are to be read. If
         count is 0, the READ will succeed and return 0 bytes of
         data, subject to access permissions checking. count
         must be less than or equal to the value of the rtmax
         field in the FSINFO reply structure for the file system
         that contains file. If greater, the server may return
         only rtmax bytes, resulting in a short read.

      On successful return, READ3res.status is NFS3_OK and
      READ3res.resok contains:

      file_attributes
         The attributes of the file on completion of the read.

      count
         The number of bytes of data returned by the read.

      eof
         If the read ended at the end-of-file (formally, in a
         correctly formed READ request, if READ3args.offset plus
         READ3resok.count is equal to the size of the file), eof
         is returned as TRUE; otherwise it is FALSE. A
         successful READ of an empty file will always return eof
         as TRUE.

      data
         The counted data read from the file.

      Otherwise, READ3res.status contains the error on failure
      and READ3res.resfail contains the following:

      file_attributes
         The post-operation attributes of the file.

   IMPLEMENTATION

      The nfsdata type used for the READ and WRITE operations in
      the NFS version 2 protocol defining the data portion of a
      request or reply has been changed to a variable-length
      opaque byte array.  The maximum size allowed by the
      protocol is now limited by what XDR and underlying
      transports will allow. There are no artificial limits
      imposed by the NFS version 3 protocol. Consult the FSINFO
      procedure description for details.






Callaghan, el al             Informational                     [Page 47]

RFC 1813                 NFS Version 3 Protocol                June 1995


      It is possible for the server to return fewer than count
      bytes of data. If the server returns less than the count
      requested and eof set to FALSE, the client should issue
      another READ to get the remaining data. A server may
      return less data than requested under several
      circumstances. The file may have been truncated by another
      client or perhaps on the server itself, changing the file
      size from what the requesting client believes to be the
      case. This would reduce the actual amount of data
      available to the client. It is possible that the server
      may back off the transfer size and reduce the read request
      return. Server resource exhaustion may also occur
      necessitating a smaller read return.

      Some NFS version 2 protocol client implementations chose
      to interpret a short read response as indicating EOF. The
      addition of the eof flag in the NFS version 3 protocol
      provides a correct way of handling EOF.

      Some NFS version 2 protocol server implementations
      incorrectly returned NFSERR_ISDIR if the file system
      object type was not a regular file. The correct return
      value for the NFS version 3 protocol is NFS3ERR_INVAL.

   ERRORS

      NFS3ERR_IO
      NFS3ERR_NXIO
      NFS3ERR_ACCES
      NFS3ERR_INVAL
      NFS3ERR_STALE
      NFS3ERR_BADHANDLE
      NFS3ERR_SERVERFAULT

   SEE ALSO

      READLINK.














Callaghan, el al             Informational                     [Page 48]

RFC 1813                 NFS Version 3 Protocol                June 1995


3.3.7 Procedure 7: WRITE - Write to file

   SYNOPSIS

      WRITE3res NFSPROC3_WRITE(WRITE3args) = 7;

      enum stable_how {
           UNSTABLE  = 0,
           DATA_SYNC = 1,
           FILE_SYNC = 2
      };

      struct WRITE3args {
           nfs_fh3     file;
           offset3     offset;
           count3      count;
           stable_how  stable;
           opaque      data<>;
      };

      struct WRITE3resok {
           wcc_data    file_wcc;
           count3      count;
           stable_how  committed;
           writeverf3  verf;
      };

      struct WRITE3resfail {
           wcc_data    file_wcc;
      };

      union WRITE3res switch (nfsstat3 status) {
      case NFS3_OK:
           WRITE3resok    resok;
      default:
           WRITE3resfail  resfail;
      };

   DESCRIPTION

      Procedure WRITE writes data to a file. On entry, the
      arguments in WRITE3args are:

      file
         The file handle for the file to which data is to be
         written.  This must identify a file system object of
         type, NF3REG.




Callaghan, el al             Informational                     [Page 49]

RFC 1813                 NFS Version 3 Protocol                June 1995


      offset
         The position within the file at which the write is to
         begin.  An offset of 0 means to write data starting at
         the beginning of the file.

      count
         The number of bytes of data to be written. If count is
         0, the WRITE will succeed and return a count of 0,
         barring errors due to permissions checking. The size of
         data must be less than or equal to the value of the
         wtmax field in the FSINFO reply structure for the file
         system that contains file. If greater, the server may
         write only wtmax bytes, resulting in a short write.

      stable
         If stable is FILE_SYNC, the server must commit the data
         written plus all file system metadata to stable storage
         before returning results. This corresponds to the NFS
         version 2 protocol semantics. Any other behavior
         constitutes a protocol violation. If stable is
         DATA_SYNC, then the server must commit all of the data
         to stable storage and enough of the metadata to
         retrieve the data before returning.  The server
         implementor is free to implement DATA_SYNC in the same
         fashion as FILE_SYNC, but with a possible performance
         drop.  If stable is UNSTABLE, the server is free to
         commit any part of the data and the metadata to stable
         storage, including all or none, before returning a
         reply to the client. There is no guarantee whether or
         when any uncommitted data will subsequently be
         committed to stable storage. The only guarantees made
         by the server are that it will not destroy any data
         without changing the value of verf and that it will not
         commit the data and metadata at a level less than that
         requested by the client. See the discussion on COMMIT
         on page 92 for more information on if and when
         data is committed to stable storage.

      data
         The data to be written to the file.

      On successful return, WRITE3res.status is NFS3_OK and
      WRITE3res.resok contains:

      file_wcc
         Weak cache consistency data for the file. For a client
         that requires only the post-write file attributes,
         these can be found in file_wcc.after.



Callaghan, el al             Informational                     [Page 50]

RFC 1813                 NFS Version 3 Protocol                June 1995


      count
         The number of bytes of data written to the file. The
         server may write fewer bytes than requested. If so, the
         actual number of bytes written starting at location,
         offset, is returned.

      committed
         The server should return an indication of the level of
         commitment of the data and metadata via committed. If
         the server committed all data and metadata to stable
         storage, committed should be set to FILE_SYNC. If the
         level of commitment was at least as strong as
         DATA_SYNC, then committed should be set to DATA_SYNC.
         Otherwise, committed must be returned as UNSTABLE. If
         stable was FILE_SYNC, then committed must also be
         FILE_SYNC: anything else constitutes a protocol
         violation. If stable was DATA_SYNC, then committed may
         be FILE_SYNC or DATA_SYNC: anything else constitutes a
         protocol violation. If stable was UNSTABLE, then
         committed may be either FILE_SYNC, DATA_SYNC, or
         UNSTABLE.

      verf
         This is a cookie that the client can use to determine
         whether the server has changed state between a call to
         WRITE and a subsequent call to either WRITE or COMMIT.
         This cookie must be consistent during a single instance
         of the NFS version 3 protocol service and must be
         unique between instances of the NFS version 3 protocol
         server, where uncommitted data may be lost.

      Otherwise, WRITE3res.status contains the error on failure
      and WRITE3res.resfail contains the following:

      file_wcc
         Weak cache consistency data for the file. For a client
         that requires only the post-write file attributes,
         these can be found in file_wcc.after. Even though the
         write failed, full wcc_data is returned to allow the
         client to determine whether the failed write resulted
         in any change to the file.

      If a client writes data to the server with the stable
      argument set to UNSTABLE and the reply yields a committed
      response of DATA_SYNC or UNSTABLE, the client will follow
      up some time in the future with a COMMIT operation to
      synchronize outstanding asynchronous data and metadata
      with the server's stable storage, barring client error. It



Callaghan, el al             Informational                     [Page 51]

RFC 1813                 NFS Version 3 Protocol                June 1995


      is possible that due to client crash or other error that a
      subsequent COMMIT will not be received by the server.

   IMPLEMENTATION

      The nfsdata type used for the READ and WRITE operations in
      the NFS version 2 protocol defining the data portion of a
      request or reply has been changed to a variable-length
      opaque byte array.  The maximum size allowed by the
      protocol is now limited by what XDR and underlying
      transports will allow. There are no artificial limits
      imposed by the NFS version 3 protocol. Consult the FSINFO
      procedure description for details.

      It is possible for the server to write fewer than count
      bytes of data. In this case, the server should not return
      an error unless no data was written at all. If the server
      writes less than count bytes, the client should issue
      another WRITE to write the remaining data.

      It is assumed that the act of writing data to a file will
      cause the mtime of the file to be updated. However, the
      mtime of the file should not be changed unless the
      contents of the file are changed.  Thus, a WRITE request
      with count set to 0 should not cause the mtime of the file
      to be updated.

      The NFS version 3 protocol introduces safe asynchronous
      writes.  The combination of WRITE with stable set to
      UNSTABLE followed by a COMMIT addresses the performance
      bottleneck found in the NFS version 2 protocol, the need
      to synchronously commit all writes to stable storage.

      The definition of stable storage has been historically a
      point of contention. The following expected properties of
      stable storage may help in resolving design issues in the
      implementation. Stable storage is persistent storage that
      survives:

      1. Repeated power failures.

      2. Hardware failures (of any board, power supply, and so on.).

      3. Repeated software crashes, including reboot cycle.

      This definition does not address failure of the stable
      storage module itself.




Callaghan, el al             Informational                     [Page 52]

RFC 1813                 NFS Version 3 Protocol                June 1995


      A cookie, verf, is defined to allow a client to detect
      different instances of an NFS version 3 protocol server
      over which cached, uncommitted data may be lost. In the
      most likely case, the verf allows the client to detect
      server reboots. This information is required so that the
      client can safely determine whether the server could have
      lost cached data. If the server fails unexpectedly and the
      client has uncommitted data from previous WRITE requests
      (done with the stable argument set to UNSTABLE and in
      which the result committed was returned as UNSTABLE as
      well) it may not have flushed cached data to stable
      storage. The burden of recovery is on the client and the
      client will need to retransmit the data to the server.

      A suggested verf cookie would be to use the time that the
      server was booted or the time the server was last started
      (if restarting the server without a reboot results in lost
      buffers).

      The committed field in the results allows the client to do
      more effective caching. If the server is committing all
      WRITE requests to stable storage, then it should return
      with committed set to FILE_SYNC, regardless of the value
      of the stable field in the arguments. A server that uses
      an NVRAM accelerator may choose to implement this policy.
      The client can use this to increase the effectiveness of
      the cache by discarding cached data that has already been
      committed on the server.

      Some implementations may return NFS3ERR_NOSPC instead of
      NFS3ERR_DQUOT when a user's quota is exceeded.

      Some NFS version 2 protocol server implementations
      incorrectly returned NFSERR_ISDIR if the file system
      object type was not a regular file. The correct return
      value for the NFS version 3 protocol is NFS3ERR_INVAL.

   ERRORS

      NFS3ERR_IO
      NFS3ERR_ACCES
      NFS3ERR_FBIG
      NFS3ERR_DQUOT
      NFS3ERR_NOSPC
      NFS3ERR_ROFS
      NFS3ERR_INVAL
      NFS3ERR_STALE
      NFS3ERR_BADHANDLE



Callaghan, el al             Informational                     [Page 53]

RFC 1813                 NFS Version 3 Protocol                June 1995


      NFS3ERR_SERVERFAULT

   SEE ALSO

      COMMIT.

3.3.8 Procedure 8: CREATE - Create a file

   SYNOPSIS

      CREATE3res NFSPROC3_CREATE(CREATE3args) = 8;

      enum createmode3 {
           UNCHECKED = 0,
           GUARDED   = 1,
           EXCLUSIVE = 2
      };

      union createhow3 switch (createmode3 mode) {
      case UNCHECKED:
      case GUARDED:
           sattr3       obj_attributes;
      case EXCLUSIVE:
           createverf3  verf;
      };

      struct CREATE3args {
           diropargs3   where;
           createhow3   how;
      };

      struct CREATE3resok {
           post_op_fh3   obj;
           post_op_attr  obj_attributes;
           wcc_data      dir_wcc;
      };

      struct CREATE3resfail {
           wcc_data      dir_wcc;
      };

      union CREATE3res switch (nfsstat3 status) {
      case NFS3_OK:
           CREATE3resok    resok;
      default:
           CREATE3resfail  resfail;
      };




Callaghan, el al             Informational                     [Page 54]

RFC 1813                 NFS Version 3 Protocol                June 1995


   DESCRIPTION

      Procedure CREATE creates a regular file. On entry, the
      arguments in CREATE3args are:

      where
         The location of the file to be created:

         dir
            The file handle for the directory in which the file
            is to be created.

         name
            The name that is to be associated with the created
            file.  Refer to General comments on filenames on
            page 30.

      When creating a regular file, there are three ways to
      create the file as defined by:

      how
         A discriminated union describing how the server is to
         handle the file creation along with the appropriate
         attributes:

      mode
         One of UNCHECKED, GUARDED, and EXCLUSIVE. UNCHECKED
         means that the file should be created without checking
         for the existence of a duplicate file in the same
         directory. In this case, how.obj_attributes is a sattr3
         describing the initial attributes for the file. GUARDED
         specifies that the server should check for the presence
         of a duplicate file before performing the create and
         should fail the request with NFS3ERR_EXIST if a
         duplicate file exists. If the file does not exist, the
         request is performed as described for UNCHECKED.
         EXCLUSIVE specifies that the server is to follow
         exclusive creation semantics, using the verifier to
         ensure exclusive creation of the target. No attributes
         may be provided in this case, since the server may use
         the target file metadata to store the createverf3
         verifier.

      On successful return, CREATE3res.status is NFS3_OK and the
      results in CREATE3res.resok are:

      obj
         The file handle of the newly created regular file.



Callaghan, el al             Informational                     [Page 55]

RFC 1813                 NFS Version 3 Protocol                June 1995


      obj_attributes
         The attributes of the regular file just created.

      dir_wcc
         Weak cache consistency data for the directory,
         where.dir. For a client that requires on the
         post-CREATE directory attributes, these can be found in
         dir_wcc.after.

      Otherwise, CREATE3res.status contains the error on failure
      and CREATE3res.resfail contains the following:

      dir_wcc
         Weak cache consistency data for the directory,
         where.dir. For a client that requires only the
         post-CREATE directory attributes, these can be found in
         dir_wcc.after. Even though the CREATE failed, full
         wcc_data is returned to allow the client to determine
         whether the failing CREATE resulted in any change to
         the directory.

   IMPLEMENTATION

      Unlike the NFS version 2 protocol, in which certain fields
      in the initial attributes structure were overloaded to
      indicate creation of devices and FIFOs in addition to
      regular files, this procedure only supports the creation
      of regular files. The MKNOD procedure was introduced in
      the NFS version 3 protocol to handle creation of devices
      and FIFOs. Implementations should have no reason in the
      NFS version 3 protocol to overload CREATE semantics.

      One aspect of the NFS version 3 protocol CREATE procedure
      warrants particularly careful consideration: the mechanism
      introduced to support the reliable exclusive creation of
      regular files. The mechanism comes into play when how.mode
      is EXCLUSIVE.  In this case, how.verf contains a verifier
      that can reasonably be expected to be unique.  A
      combination of a client identifier, perhaps the client
      network address, and a unique number generated by the
      client, perhaps the RPC transaction identifier, may be
      appropriate.

      If the file does not exist, the server creates the file
      and stores the verifier in stable storage. For file
      systems that do not provide a mechanism for the storage of
      arbitrary file attributes, the server may use one or more
      elements of the file metadata to store the verifier. The



Callaghan, el al             Informational                     [Page 56]

RFC 1813                 NFS Version 3 Protocol                June 1995


      verifier must be stored in stable storage to prevent
      erroneous failure on retransmission of the request. It is
      assumed that an exclusive create is being performed
      because exclusive semantics are critical to the
      application. Because of the expected usage, exclusive
      CREATE does not rely solely on the normally volatile
      duplicate request cache for storage of the verifier. The
      duplicate request cache in volatile storage does not
      survive a crash and may actually flush on a long network
      partition, opening failure windows.  In the UNIX local
      file system environment, the expected storage location for
      the verifier on creation is the metadata (time stamps) of
      the file. For this reason, an exclusive file create may
      not include initial attributes because the server would
      have nowhere to store the verifier.

      If the server can not support these exclusive create
      semantics, possibly because of the requirement to commit
      the verifier to stable storage, it should fail the CREATE
      request with the error, NFS3ERR_NOTSUPP.

      During an exclusive CREATE request, if the file already
      exists, the server reconstructs the file's verifier and
      compares it with the verifier in the request. If they
      match, the server treats the request as a success. The
      request is presumed to be a duplicate of an earlier,
      successful request for which the reply was lost and that
      the server duplicate request cache mechanism did not
      detect. If the verifiers do not match, the request is
      rejected with the status, NFS3ERR_EXIST.

      Once the client has performed a successful exclusive
      create, it must issue a SETATTR to set the correct file
      attributes.  Until it does so, it should not rely upon any
      of the file attributes, since the server implementation
      may need to overload file metadata to store the verifier.

      Use of the GUARDED attribute does not provide exactly-once
      semantics.  In particular, if a reply is lost and the
      server does not detect the retransmission of the request,
      the procedure can fail with NFS3ERR_EXIST, even though the
      create was performed successfully.

      Refer to General comments on filenames on page 30.







Callaghan, el al             Informational                     [Page 57]

RFC 1813                 NFS Version 3 Protocol                June 1995


   ERRORS

      NFS3ERR_IO
      NFS3ERR_ACCES
      NFS3ERR_EXIST
      NFS3ERR_NOTDIR
      NFS3ERR_NOSPC
      NFS3ERR_ROFS
      NFS3ERR_NAMETOOLONG
      NFS3ERR_DQUOT
      NFS3ERR_STALE
      NFS3ERR_BADHANDLE
      NFS3ERR_NOTSUPP
      NFS3ERR_SERVERFAULT

   SEE ALSO

      MKDIR, SYMLINK, MKNOD, and PATHCONF.

3.3.9 Procedure 9: MKDIR - Create a directory

   SYNOPSIS

      MKDIR3res NFSPROC3_MKDIR(MKDIR3args) = 9;

      struct MKDIR3args {
           diropargs3   where;
           sattr3       attributes;
      };

      struct MKDIR3resok {
           post_op_fh3   obj;
           post_op_attr  obj_attributes;
           wcc_data      dir_wcc;
      };

      struct MKDIR3resfail {
           wcc_data      dir_wcc;
      };

      union MKDIR3res switch (nfsstat3 status) {
      case NFS3_OK:
           MKDIR3resok   resok;
      default:
           MKDIR3resfail resfail;
      };





Callaghan, el al             Informational                     [Page 58]

RFC 1813                 NFS Version 3 Protocol                June 1995


   DESCRIPTION

      Procedure MKDIR creates a new subdirectory. On entry, the
      arguments in MKDIR3args are:

      where
         The location of the subdirectory to be created:

         dir
            The file handle for the directory in which the
            subdirectory is to be created.

         name
            The name that is to be associated with the created
            subdirectory. Refer to General comments on filenames
            on page 30.

      attributes
         The initial attributes for the subdirectory.

      On successful return, MKDIR3res.status is NFS3_OK and the
      results in MKDIR3res.resok are:

      obj
         The file handle for the newly created directory.

      obj_attributes
         The attributes for the newly created subdirectory.

      dir_wcc
         Weak cache consistency data for the directory,
         where.dir. For a client that requires only the
         post-MKDIR directory attributes, these can be found in
         dir_wcc.after.

      Otherwise, MKDIR3res.status contains the error on failure
      and MKDIR3res.resfail contains the following:

      dir_wcc
         Weak cache consistency data for the directory,
         where.dir. For a client that requires only the
         post-MKDIR directory attributes, these can be found in
         dir_wcc.after. Even though the MKDIR failed, full
         wcc_data is returned to allow the client to determine
         whether the failing MKDIR resulted in any change to the
         directory.





Callaghan, el al             Informational                     [Page 59]

RFC 1813                 NFS Version 3 Protocol                June 1995


   IMPLEMENTATION

      Many server implementations will not allow the filenames,
      "." or "..", to be used as targets in a MKDIR operation.
      In this case, the server should return NFS3ERR_EXIST.
      Refer to General comments on filenames on page 30.

   ERRORS

      NFS3ERR_IO
      NFS3ERR_ACCES
      NFS3ERR_EXIST
      NFS3ERR_NOTDIR
      NFS3ERR_NOSPC
      NFS3ERR_ROFS
      NFS3ERR_NAMETOOLONG
      NFS3ERR_DQUOT
      NFS3ERR_STALE
      NFS3ERR_BADHANDLE
      NFS3ERR_NOTSUPP
      NFS3ERR_SERVERFAULT

   SEE ALSO

      CREATE, SYMLINK, MKNOD, and PATHCONF.


























Callaghan, el al             Informational                     [Page 60]

RFC 1813                 NFS Version 3 Protocol                June 1995


3.3.10 Procedure 10: SYMLINK - Create a symbolic link

   SYNOPSIS

      SYMLINK3res NFSPROC3_SYMLINK(SYMLINK3args) = 10;

      struct symlinkdata3 {
           sattr3    symlink_attributes;
           nfspath3  symlink_data;
      };

      struct SYMLINK3args {
           diropargs3    where;
           symlinkdata3  symlink;
      };

      struct SYMLINK3resok {
           post_op_fh3   obj;
           post_op_attr  obj_attributes;
           wcc_data      dir_wcc;
      };

      struct SYMLINK3resfail {
           wcc_data      dir_wcc;
      };

      union SYMLINK3res switch (nfsstat3 status) {
      case NFS3_OK:
           SYMLINK3resok   resok;
      default:
           SYMLINK3resfail resfail;
      };

   DESCRIPTION

      Procedure SYMLINK creates a new symbolic link. On entry,
      the arguments in SYMLINK3args are:

      where
         The location of the symbolic link to be created:

         dir
            The file handle for the directory in which the
            symbolic link is to be created.







Callaghan, el al             Informational                     [Page 61]

RFC 1813                 NFS Version 3 Protocol                June 1995


         name
            The name that is to be associated with the created
            symbolic link. Refer to General comments on
            filenames on page 30.

      symlink
         The symbolic link to create:

         symlink_attributes
            The initial attributes for the symbolic link.

         symlink_data
            The string containing the symbolic link data.

      On successful return, SYMLINK3res.status is NFS3_OK and
      SYMLINK3res.resok contains:

      obj
         The file handle for the newly created symbolic link.

      obj_attributes
         The attributes for the newly created symbolic link.

      dir_wcc
         Weak cache consistency data for the directory,
         where.dir. For a client that requires only the
         post-SYMLINK directory attributes, these can be found
         in dir_wcc.after.

      Otherwise, SYMLINK3res.status contains the error on
      failure and SYMLINK3res.resfail contains the following:

      dir_wcc
         Weak cache consistency data for the directory,
         where.dir. For a client that requires only the
         post-SYMLINK directory attributes, these can be found
         in dir_wcc.after. Even though the SYMLINK failed, full
         wcc_data is returned to allow the client to determine
         whether the failing SYMLINK changed the directory.

   IMPLEMENTATION

      Refer to General comments on filenames on page 30.

      For symbolic links, the actual file system node and its
      contents are expected to be created in a single atomic
      operation.  That is, once the symbolic link is visible,
      there must not be a window where a READLINK would fail or



Callaghan, el al             Informational                     [Page 62]

RFC 1813                 NFS Version 3 Protocol                June 1995


      return incorrect data.

   ERRORS

      NFS3ERR_IO
      NFS3ERR_ACCES
      NFS3ERR_EXIST
      NFS3ERR_NOTDIR
      NFS3ERR_NOSPC
      NFS3ERR_ROFS
      NFS3ERR_NAMETOOLONG
      NFS3ERR_DQUOT
      NFS3ERR_STALE
      NFS3ERR_BADHANDLE
      NFS3ERR_NOTSUPP
      NFS3ERR_SERVERFAULT

   SEE ALSO

      READLINK, CREATE, MKDIR, MKNOD, FSINFO, and PATHCONF.

3.3.11 Procedure 11: MKNOD - Create a special device

   SYNOPSIS

      MKNOD3res NFSPROC3_MKNOD(MKNOD3args) = 11;

      struct devicedata3 {
           sattr3     dev_attributes;
           specdata3  spec;
      };

      union mknoddata3 switch (ftype3 type) {
      case NF3CHR:
      case NF3BLK:
           devicedata3  device;
      case NF3SOCK:
      case NF3FIFO:
           sattr3       pipe_attributes;
      default:
           void;
      };

      struct MKNOD3args {
           diropargs3   where;
           mknoddata3   what;
      };




Callaghan, el al             Informational                     [Page 63]

RFC 1813                 NFS Version 3 Protocol                June 1995


      struct MKNOD3resok {
           post_op_fh3   obj;
           post_op_attr  obj_attributes;
           wcc_data      dir_wcc;
      };

      struct MKNOD3resfail {
           wcc_data      dir_wcc;
      };

      union MKNOD3res switch (nfsstat3 status) {
      case NFS3_OK:
           MKNOD3resok   resok;
      default:
           MKNOD3resfail resfail;
      };

   DESCRIPTION

      Procedure MKNOD creates a new special file of the type,
      what.type.  Special files can be device files or named
      pipes.  On entry, the arguments in MKNOD3args are:

      where
         The location of the special file to be created:

         dir
            The file handle for the directory in which the
            special file is to be created.

         name
            The name that is to be associated with the created
            special file. Refer to General comments on filenames
            on page 30.

      what
         A discriminated union identifying the type of the
         special file to be created along with the data and
         attributes appropriate to the type of the special
         file:

         type
            The type of the object to be created.

      When creating a character special file (what.type is
      NF3CHR) or a block special file (what.type is NF3BLK),
      what includes:




Callaghan, el al             Informational                     [Page 64]

RFC 1813                 NFS Version 3 Protocol                June 1995


      device
         A structure devicedata3 with the following components:

         dev_attributes
            The initial attributes for the special file.

         spec
            The major number stored in device.spec.specdata1 and
            the minor number stored in device.spec.specdata2.

      When creating a socket (what.type is NF3SOCK) or a FIFO
      (what.type is NF3FIFO), what includes:

         pipe_attributes
            The initial attributes for the special file.

      On successful return, MKNOD3res.status is NFS3_OK and
      MKNOD3res.resok contains:

      obj
         The file handle for the newly created special file.

      obj_attributes
         The attributes for the newly created special file.

      dir_wcc
         Weak cache consistency data for the directory,
         where.dir. For a client that requires only the
         post-MKNOD directory attributes, these can be found in
         dir_wcc.after.

      Otherwise, MKNOD3res.status contains the error on failure
      and MKNOD3res.resfail contains the following:

      dir_wcc
         Weak cache consistency data for the directory,
         where.dir. For a client that requires only the
         post-MKNOD directory attributes, these can be found in
         dir_wcc.after. Even though the MKNOD failed, full
         wcc_data is returned to allow the client to determine
         whether the failing MKNOD changed the directory.

   IMPLEMENTATION

      Refer to General comments on filenames on page 30.

      Without explicit support for special file type creation in
      the NFS version 2 protocol, fields in the CREATE arguments



Callaghan, el al             Informational                     [Page 65]

RFC 1813                 NFS Version 3 Protocol                June 1995


      were overloaded to indicate creation of certain types of
      objects.  This overloading is not necessary in the NFS
      version 3 protocol.

      If the server does not support any of the defined types,
      the error, NFS3ERR_NOTSUPP, should be returned. Otherwise,
      if the server does not support the target type or the
      target type is illegal, the error, NFS3ERR_BADTYPE, should
      be returned. Note that NF3REG, NF3DIR, and NF3LNK are
      illegal types for MKNOD. The procedures, CREATE, MKDIR,
      and SYMLINK should be used to create these file types,
      respectively, instead of MKNOD.

   ERRORS

      NFS3ERR_IO
      NFS3ERR_ACCES
      NFS3ERR_EXIST
      NFS3ERR_NOTDIR
      NFS3ERR_NOSPC
      NFS3ERR_ROFS
      NFS3ERR_NAMETOOLONG
      NFS3ERR_DQUOT
      NFS3ERR_STALE
      NFS3ERR_BADHANDLE
      NFS3ERR_NOTSUPP
      NFS3ERR_SERVERFAULT
      NFS3ERR_BADTYPE

   SEE ALSO

      CREATE, MKDIR, SYMLINK, and PATHCONF.



















Callaghan, el al             Informational                     [Page 66]

RFC 1813                 NFS Version 3 Protocol                June 1995


3.3.12 Procedure 12: REMOVE - Remove a File

   SYNOPSIS

      REMOVE3res NFSPROC3_REMOVE(REMOVE3args) = 12;

      struct REMOVE3args {
           diropargs3  object;
      };

      struct REMOVE3resok {
           wcc_data    dir_wcc;
      };

      struct REMOVE3resfail {
           wcc_data    dir_wcc;
      };

      union REMOVE3res switch (nfsstat3 status) {
      case NFS3_OK:
           REMOVE3resok   resok;
      default:
           REMOVE3resfail resfail;
      };

   DESCRIPTION

      Procedure REMOVE removes (deletes) an entry from a
      directory. If the entry in the directory was the last
      reference to the corresponding file system object, the
      object may be destroyed.  On entry, the arguments in
      REMOVE3args are:

      object
         A diropargs3 structure identifying the entry to be
         removed:

      dir
         The file handle for the directory from which the entry
         is to be removed.

      name
         The name of the entry to be removed. Refer to General
         comments on filenames on page 30.

      On successful return, REMOVE3res.status is NFS3_OK and
      REMOVE3res.resok contains:




Callaghan, el al             Informational                     [Page 67]

RFC 1813                 NFS Version 3 Protocol                June 1995


      dir_wcc
         Weak cache consistency data for the directory,
         object.dir.  For a client that requires only the
         post-REMOVE directory attributes, these can be found in
         dir_wcc.after.

      Otherwise, REMOVE3res.status contains the error on failure
      and REMOVE3res.resfail contains the following:

      dir_wcc
         Weak cache consistency data for the directory,
         object.dir.  For a client that requires only the
         post-REMOVE directory attributes, these can be found in
         dir_wcc.after. Even though the REMOVE failed, full
         wcc_data is returned to allow the client to determine
         whether the failing REMOVE changed the directory.

   IMPLEMENTATION

      In general, REMOVE is intended to remove non-directory
      file objects and RMDIR is to be used to remove
      directories.  However, REMOVE can be used to remove
      directories, subject to restrictions imposed by either the
      client or server interfaces.  This had been a source of
      confusion in the NFS version 2 protocol.

      The concept of last reference is server specific. However,
      if the nlink field in the previous attributes of the
      object had the value 1, the client should not rely on
      referring to the object via a file handle. Likewise, the
      client should not rely on the resources (disk space,
      directory entry, and so on.) formerly associated with the
      object becoming immediately available. Thus, if a client
      needs to be able to continue to access a file after using
      REMOVE to remove it, the client should take steps to make
      sure that the file will still be accessible. The usual
      mechanism used is to use RENAME to rename the file from
      its old name to a new hidden name.

      Refer to General comments on filenames on page 30.

   ERRORS

      NFS3ERR_NOENT
      NFS3ERR_IO
      NFS3ERR_ACCES
      NFS3ERR_NOTDIR
      NFS3ERR_NAMETOOLONG



Callaghan, el al             Informational                     [Page 68]

RFC 1813                 NFS Version 3 Protocol                June 1995


      NFS3ERR_ROFS
      NFS3ERR_STALE
      NFS3ERR_BADHANDLE
      NFS3ERR_SERVERFAULT

   SEE ALSO

      RMDIR and RENAME.

3.3.13 Procedure 13: RMDIR - Remove a Directory

   SYNOPSIS

      RMDIR3res NFSPROC3_RMDIR(RMDIR3args) = 13;

      struct RMDIR3args {
           diropargs3  object;
      };

      struct RMDIR3resok {
           wcc_data    dir_wcc;
      };

      struct RMDIR3resfail {
           wcc_data    dir_wcc;
      };

      union RMDIR3res switch (nfsstat3 status) {
      case NFS3_OK:
           RMDIR3resok   resok;
      default:
           RMDIR3resfail resfail;
      };

   DESCRIPTION

      Procedure RMDIR removes (deletes) a subdirectory from a
      directory. If the directory entry of the subdirectory is
      the last reference to the subdirectory, the subdirectory
      may be destroyed. On entry, the arguments in RMDIR3args
      are:

      object
         A diropargs3 structure identifying the directory entry
         to be removed:






Callaghan, el al             Informational                     [Page 69]

RFC 1813                 NFS Version 3 Protocol                June 1995


         dir
            The file handle for the directory from which the
            subdirectory is to be removed.

         name
            The name of the subdirectory to be removed. Refer to
            General comments on filenames on page 30.

      On successful return, RMDIR3res.status is NFS3_OK and
      RMDIR3res.resok contains:

      dir_wcc
         Weak cache consistency data for the directory,
         object.dir.  For a client that requires only the
         post-RMDIR directory attributes, these can be found in
         dir_wcc.after.

      Otherwise, RMDIR3res.status contains the error on failure
      and RMDIR3res.resfail contains the following:

      dir_wcc
         Weak cache consistency data for the directory,
         object.dir.  For a client that requires only the
         post-RMDIR directory attributes, these can be found in
         dir_wcc.after. Note that even though the RMDIR failed,
         full wcc_data is returned to allow the client to
         determine whether the failing RMDIR changed the
         directory.

   IMPLEMENTATION

      Note that on some servers, removal of a non-empty
      directory is disallowed.

      On some servers, the filename, ".", is illegal. These
      servers will return the error, NFS3ERR_INVAL. On some
      servers, the filename, "..", is illegal. These servers
      will return the error, NFS3ERR_EXIST. This would seem
      inconsistent, but allows these servers to comply with
      their own specific interface definitions.  Clients should
      be prepared to handle both cases.

      The client should not rely on the resources (disk space,
      directory entry, and so on.) formerly associated with the
      directory becoming immediately available.






Callaghan, el al             Informational                     [Page 70]

RFC 1813                 NFS Version 3 Protocol                June 1995


   ERRORS

      NFS3ERR_NOENT
      NFS3ERR_IO
      NFS3ERR_ACCES
      NFS3ERR_INVAL
      NFS3ERR_EXIST
      NFS3ERR_NOTDIR
      NFS3ERR_NAMETOOLONG
      NFS3ERR_ROFS
      NFS3ERR_NOTEMPTY
      NFS3ERR_STALE
      NFS3ERR_BADHANDLE
      NFS3ERR_NOTSUPP
      NFS3ERR_SERVERFAULT

   SEE ALSO

      REMOVE.

3.3.14 Procedure 14: RENAME - Rename a File or Directory

   SYNOPSIS

      RENAME3res NFSPROC3_RENAME(RENAME3args) = 14;

      struct RENAME3args {
           diropargs3   from;
           diropargs3   to;
      };

      struct RENAME3resok {
           wcc_data     fromdir_wcc;
           wcc_data     todir_wcc;
      };

      struct RENAME3resfail {
           wcc_data     fromdir_wcc;
           wcc_data     todir_wcc;
      };

      union RENAME3res switch (nfsstat3 status) {
      case NFS3_OK:
           RENAME3resok   resok;
      default:
           RENAME3resfail resfail;
      };




Callaghan, el al             Informational                     [Page 71]

RFC 1813                 NFS Version 3 Protocol                June 1995


   DESCRIPTION

      Procedure RENAME renames the file identified by from.name
      in the directory, from.dir, to to.name in the di- rectory,
      to.dir. The operation is required to be atomic to the
      client. To.dir and from.dir must reside on the same file
      system and server. On entry, the arguments in RENAME3args
      are:

      from
         A diropargs3 structure identifying the source (the file
         system object to be re-named):

         from.dir
            The file handle for the directory from which the
            entry is to be renamed.

         from.name
            The name of the entry that identifies the object to
            be renamed. Refer to General comments on filenames
            on page 30.

      to
         A diropargs3 structure identifying the target (the new
         name of the object):

         to.dir
            The file handle for the directory to which the
            object is to be renamed.

         to.name
            The new name for the object. Refer to General
            comments on filenames on page 30.

      If the directory, to.dir, already contains an entry with
      the name, to.name, the source object must be compatible
      with the target: either both are non-directories or both
      are directories and the target must be empty. If
      compatible, the existing target is removed before the
      rename occurs. If they are not compatible or if the target
      is a directory but not empty, the server should return the
      error, NFS3ERR_EXIST.

      On successful return, RENAME3res.status is NFS3_OK and
      RENAME3res.resok contains:






Callaghan, el al             Informational                     [Page 72]

RFC 1813                 NFS Version 3 Protocol                June 1995


      fromdir_wcc
         Weak cache consistency data for the directory,
         from.dir.

      todir_wcc
         Weak cache consistency data for the directory, to.dir.

      Otherwise, RENAME3res.status contains the error on failure
      and RENAME3res.resfail contains the following:

      fromdir_wcc
         Weak cache consistency data for the directory,
         from.dir.

      todir_wcc
         Weak cache consistency data for the directory, to.dir.

   IMPLEMENTATION
      The RENAME operation must be atomic to the client. The
      message "to.dir and from.dir must reside on the same file
      system on the server, [or the operation will fail]" means
      that the fsid fields in the attributes for the directories
      are the same. If they reside on different file systems,
      the error, NFS3ERR_XDEV, is returned. Even though the
      operation is atomic, the status, NFS3ERR_MLINK, may be
      returned if the server used a "unlink/link/unlink"
      sequence internally.

      A file handle may or may not become stale on a rename.
      However, server implementors are strongly encouraged to
      attempt to keep file handles from becoming stale in this
      fashion.

      On some servers, the filenames, "." and "..", are illegal
      as either from.name or to.name. In addition, neither
      from.name nor to.name can be an alias for from.dir. These
      servers will return the error, NFS3ERR_INVAL, in these
      cases.

      If from and to both refer to the same file (they might
      be hard links of each other), then RENAME should perform
      no action and return NFS3_OK.

      Refer to General comments on filenames on page 30.







Callaghan, el al             Informational                     [Page 73]

RFC 1813                 NFS Version 3 Protocol                June 1995


   ERRORS

      NFS3ERR_NOENT
      NFS3ERR_IO
      NFS3ERR_ACCES
      NFS3ERR_EXIST
      NFS3ERR_XDEV
      NFS3ERR_NOTDIR
      NFS3ERR_ISDIR
      NFS3ERR_INVAL
      NFS3ERR_NOSPC
      NFS3ERR_ROFS
      NFS3ERR_MLINK
      NFS3ERR_NAMETOOLONG
      NFS3ERR_NOTEMPTY
      NFS3ERR_DQUOT
      NFS3ERR_STALE
      NFS3ERR_BADHANDLE
      NFS3ERR_NOTSUPP
      NFS3ERR_SERVERFAULT

   SEE ALSO

   REMOVE and LINK.

3.3.15 Procedure 15: LINK - Create Link to an object

   SYNOPSIS

      LINK3res NFSPROC3_LINK(LINK3args) = 15;

      struct LINK3args {
           nfs_fh3     file;
           diropargs3  link;
      };

      struct LINK3resok {
           post_op_attr   file_attributes;
           wcc_data       linkdir_wcc;
      };

      struct LINK3resfail {
           post_op_attr   file_attributes;
           wcc_data       linkdir_wcc;
      };

      union LINK3res switch (nfsstat3 status) {
      case NFS3_OK:



Callaghan, el al             Informational                     [Page 74]

RFC 1813                 NFS Version 3 Protocol                June 1995


           LINK3resok    resok;
      default:
           LINK3resfail  resfail;
      };

   DESCRIPTION

      Procedure LINK creates a hard link from file to link.name,
      in the directory, link.dir. file and link.dir must reside
      on the same file system and server. On entry, the
      arguments in LINK3args are:

      file
         The file handle for the existing file system object.

      link
         The location of the link to be created:

         link.dir
            The file handle for the directory in which the link
            is to be created.

         link.name
            The name that is to be associated with the created
            link. Refer to General comments on filenames on page
            17.

      On successful return, LINK3res.status is NFS3_OK and
      LINK3res.resok contains:

      file_attributes
         The post-operation attributes of the file system object
         identified by file.

      linkdir_wcc
         Weak cache consistency data for the directory,
         link.dir.

      Otherwise, LINK3res.status contains the error on failure
      and LINK3res.resfail contains the following:

      file_attributes
         The post-operation attributes of the file system object
         identified by file.

      linkdir_wcc
         Weak cache consistency data for the directory,
         link.dir.



Callaghan, el al             Informational                     [Page 75]

RFC 1813                 NFS Version 3 Protocol                June 1995


   IMPLEMENTATION

      Changes to any property of the hard-linked files are
      reflected in all of the linked files. When a hard link is
      made to a file, the attributes for the file should have a
      value for nlink that is one greater than the value before
      the LINK.

      The comments under RENAME regarding object and target
      residing on the same file system apply here as well. The
      comments regarding the target name applies as well. Refer
      to General comments on filenames on page 30.

   ERRORS

      NFS3ERR_IO
      NFS3ERR_ACCES
      NFS3ERR_EXIST
      NFS3ERR_XDEV
      NFS3ERR_NOTDIR
      NFS3ERR_INVAL
      NFS3ERR_NOSPC
      NFS3ERR_ROFS
      NFS3ERR_MLINK
      NFS3ERR_NAMETOOLONG
      NFS3ERR_DQUOT
      NFS3ERR_STALE
      NFS3ERR_BADHANDLE
      NFS3ERR_NOTSUPP
      NFS3ERR_SERVERFAULT

   SEE ALSO

      SYMLINK, RENAME and FSINFO.

3.3.16 Procedure 16: READDIR - Read From Directory

   SYNOPSIS

      READDIR3res NFSPROC3_READDIR(READDIR3args) = 16;

      struct READDIR3args {
           nfs_fh3      dir;
           cookie3      cookie;
           cookieverf3  cookieverf;
           count3       count;
      };




Callaghan, el al             Informational                     [Page 76]

RFC 1813                 NFS Version 3 Protocol                June 1995


      struct entry3 {
           fileid3      fileid;
           filename3    name;
           cookie3      cookie;
           entry3       *nextentry;
      };

      struct dirlist3 {
           entry3       *entries;
           bool         eof;
      };

      struct READDIR3resok {
           post_op_attr dir_attributes;
           cookieverf3  cookieverf;
           dirlist3     reply;
      };

      struct READDIR3resfail {
           post_op_attr dir_attributes;
      };

      union READDIR3res switch (nfsstat3 status) {
      case NFS3_OK:
           READDIR3resok   resok;
      default:
           READDIR3resfail resfail;
      };

   DESCRIPTION

      Procedure READDIR retrieves a variable number of entries,
      in sequence, from a directory and returns the name and
      file identifier for each, with information to allow the
      client to request additional directory entries in a
      subsequent READDIR request. On entry, the arguments in
      READDIR3args are:

      dir
         The file handle for the directory to be read.

      cookie
         This should be set to 0 in the first request to read
         the directory. On subsequent requests, it should be a
         cookie as returned by the server.






Callaghan, el al             Informational                     [Page 77]

RFC 1813                 NFS Version 3 Protocol                June 1995


      cookieverf
         This should be set to 0 in the first request to read
         the directory. On subsequent requests, it should be a
         cookieverf as returned by the server. The cookieverf
         must match that returned by the READDIR in which the
         cookie was acquired.

      count
         The maximum size of the READDIR3resok structure, in
         bytes.  The size must include all XDR overhead. The
         server is free to return less than count bytes of
         data.

      On successful return, READDIR3res.status is NFS3_OK and
      READDIR3res.resok contains:

      dir_attributes
         The attributes of the directory, dir.

      cookieverf
         The cookie verifier.

      reply
         The directory list:

         entries
            Zero or more directory (entry3) entries.

         eof
            TRUE if the last member of reply.entries is the last
            entry in the directory or the list reply.entries is
            empty and the cookie corresponded to the end of the
            directory. If FALSE, there may be more entries to
            read.

      Otherwise, READDIR3res.status contains the error on
      failure and READDIR3res.resfail contains the following:

      dir_attributes
         The attributes of the directory, dir.

   IMPLEMENTATION

      In the NFS version 2 protocol, each directory entry
      returned included a cookie identifying a point in the
      directory. By including this cookie in a subsequent
      READDIR, the client could resume the directory read at any
      point in the directory.  One problem with this scheme was



Callaghan, el al             Informational                     [Page 78]

RFC 1813                 NFS Version 3 Protocol                June 1995


      that there was no easy way for a server to verify that a
      cookie was valid. If two READDIRs were separated by one or
      more operations that changed the directory in some way
      (for example, reordering or compressing it), it was
      possible that the second READDIR could miss entries, or
      process entries more than once. If the cookie was no
      longer usable, for example, pointing into the middle of a
      directory entry, the server would have to either round the
      cookie down to the cookie of the previous entry or round
      it up to the cookie of the next entry in the directory.
      Either way would possibly lead to incorrect results and
      the client would be unaware that any problem existed.

      In the NFS version 3 protocol, each READDIR request
      includes both a cookie and a cookie verifier. For the
      first call, both are set to 0.  The response includes a
      new cookie verifier, with a cookie per entry.  For
      subsequent READDIRs, the client must present both the
      cookie and the corresponding cookie verifier.  If the
      server detects that the cookie is no longer valid, the
      server will reject the READDIR request with the status,
      NFS3ERR_BAD_COOKIE. The client should be careful to
      avoid holding directory entry cookies across operations
      that modify the directory contents, such as REMOVE and
      CREATE.

      One implementation of the cookie-verifier mechanism might
      be for the server to use the modification time of the
      directory. This might be overly restrictive, however. A
      better approach would be to record the time of the last
      directory modification that changed the directory
      organization in a way that would make it impossible to
      reliably interpret a cookie. Servers in which directory
      cookies are always valid are free to use zero as the
      verifier always.

      The server may return fewer than count bytes of
      XDR-encoded entries.  The count specified by the client in
      the request should be greater than or equal to FSINFO
      dtpref.

      Since UNIX clients give a special meaning to the fileid
      value zero, UNIX clients should be careful to map zero
      fileid values to some other value and servers should try
      to avoid sending a zero fileid.






Callaghan, el al             Informational                     [Page 79]

RFC 1813                 NFS Version 3 Protocol                June 1995


   ERRORS

      NFS3ERR_IO
      NFS3ERR_ACCES
      NFS3ERR_NOTDIR
      NFS3ERR_BAD_COOKIE
      NFS3ERR_TOOSMALL
      NFS3ERR_STALE
      NFS3ERR_BADHANDLE
      NFS3ERR_SERVERFAULT

   SEE ALSO

      READDIRPLUS and FSINFO.

3.3.17 Procedure 17: READDIRPLUS - Extended read from directory

   SYNOPSIS

      READDIRPLUS3res NFSPROC3_READDIRPLUS(READDIRPLUS3args) = 17;

      struct READDIRPLUS3args {
           nfs_fh3      dir;
           cookie3      cookie;
           cookieverf3  cookieverf;
           count3       dircount;
           count3       maxcount;
      };

      struct entryplus3 {
           fileid3      fileid;
           filename3    name;
           cookie3      cookie;
           post_op_attr name_attributes;
           post_op_fh3  name_handle;
           entryplus3   *nextentry;
      };

      struct dirlistplus3 {
           entryplus3   *entries;
           bool         eof;
      };

      struct READDIRPLUS3resok {
           post_op_attr dir_attributes;
           cookieverf3  cookieverf;
           dirlistplus3 reply;
      };



Callaghan, el al             Informational                     [Page 80]

RFC 1813                 NFS Version 3 Protocol                June 1995



      struct READDIRPLUS3resfail {
           post_op_attr dir_attributes;
      };

      union READDIRPLUS3res switch (nfsstat3 status) {
      case NFS3_OK:
           READDIRPLUS3resok   resok;
      default:
           READDIRPLUS3resfail resfail;
      };

   DESCRIPTION

      Procedure READDIRPLUS retrieves a variable number of
      entries from a file system directory and returns complete
      information about each along with information to allow the
      client to request additional directory entries in a
      subsequent READDIRPLUS.  READDIRPLUS differs from READDIR
      only in the amount of information returned for each
      entry.  In READDIR, each entry returns the filename and
      the fileid.  In READDIRPLUS, each entry returns the name,
      the fileid, attributes (including the fileid), and file
      handle. On entry, the arguments in READDIRPLUS3args are:

      dir
         The file handle for the directory to be read.

      cookie
         This should be set to 0 on the first request to read a
         directory. On subsequent requests, it should be a
         cookie as returned by the server.

      cookieverf
         This should be set to 0 on the first request to read a
         directory. On subsequent requests, it should be a
         cookieverf as returned by the server. The cookieverf
         must match that returned by the READDIRPLUS call in
         which the cookie was acquired.

      dircount
         The maximum number of bytes of directory information
         returned. This number should not include the size of
         the attributes and file handle portions of the result.

      maxcount
         The maximum size of the READDIRPLUS3resok structure, in
         bytes. The size must include all XDR overhead. The



Callaghan, el al             Informational                     [Page 81]

RFC 1813                 NFS Version 3 Protocol                June 1995


         server is free to return fewer than maxcount bytes of
         data.

      On successful return, READDIRPLUS3res.status is NFS3_OK
      and READDIRPLUS3res.resok contains:

      dir_attributes
         The attributes of the directory, dir.

      cookieverf
         The cookie verifier.

      reply
         The directory list:

         entries
            Zero or more directory (entryplus3) entries.

         eof
            TRUE if the last member of reply.entries is the last
            entry in the directory or the list reply.entries is
            empty and the cookie corresponded to the end of the
            directory. If FALSE, there may be more entries to
            read.

      Otherwise, READDIRPLUS3res.status contains the error on
      failure and READDIRPLUS3res.resfail contains the following:

      dir_attributes
         The attributes of the directory, dir.

   IMPLEMENTATION

      Issues that need to be understood for this procedure
      include increased cache flushing activity on the client
      (as new file handles are returned with names which are
      entered into caches) and over-the-wire overhead versus
      expected subsequent LOOKUP elimination. It is thought that
      this procedure may improve performance for directory
      browsing where attributes are always required as on the
      Apple Macintosh operating system and for MS-DOS.

      The dircount and maxcount fields are included as an
      optimization.  Consider a READDIRPLUS call on a UNIX
      operating system implementation for 1048 bytes; the reply
      does not contain many entries because of the overhead due
      to attributes and file handles. An alternative is to issue
      a READDIRPLUS call for 8192 bytes and then only use the



Callaghan, el al             Informational                     [Page 82]

RFC 1813                 NFS Version 3 Protocol                June 1995


      first 1048 bytes of directory information. However, the
      server doesn't know that all that is needed is 1048 bytes
      of directory information (as would be returned by
      READDIR). It sees the 8192 byte request and issues a
      VOP_READDIR for 8192 bytes. It then steps through all of
      those directory entries, obtaining attributes and file
      handles for each entry.  When it encodes the result, the
      server only encodes until it gets 8192 bytes of results
      which include the attributes and file handles. Thus, it
      has done a larger VOP_READDIR and many more attribute
      fetches than it needed to. The ratio of the directory
      entry size to the size of the attributes plus the size of
      the file handle is usually at least 8 to 1. The server has
      done much more work than it needed to.

      The solution to this problem is for the client to provide
      two counts to the server. The first is the number of bytes
      of directory information that the client really wants,
      dircount.  The second is the maximum number of bytes in
      the result, including the attributes and file handles,
      maxcount. Thus, the server will issue a VOP_READDIR for
      only the number of bytes that the client really wants to
      get, not an inflated number.  This should help to reduce
      the size of VOP_READDIR requests on the server, thus
      reducing the amount of work done there, and to reduce the
      number of VOP_LOOKUP, VOP_GETATTR, and other calls done by
      the server to construct attributes and file handles.

   ERRORS

      NFS3ERR_IO
      NFS3ERR_ACCES
      NFS3ERR_NOTDIR
      NFS3ERR_BAD_COOKIE
      NFS3ERR_TOOSMALL
      NFS3ERR_STALE
      NFS3ERR_BADHANDLE
      NFS3ERR_NOTSUPP
      NFS3ERR_SERVERFAULT

   SEE ALSO

      READDIR.








Callaghan, el al             Informational                     [Page 83]

RFC 1813                 NFS Version 3 Protocol                June 1995


3.3.18 Procedure 18: FSSTAT - Get dynamic file system information

   SYNOPSIS

      FSSTAT3res NFSPROC3_FSSTAT(FSSTAT3args) = 18;

      struct FSSTAT3args {
           nfs_fh3   fsroot;
      };

      struct FSSTAT3resok {
           post_op_attr obj_attributes;
           size3        tbytes;
           size3        fbytes;
           size3        abytes;
           size3        tfiles;
           size3        ffiles;
           size3        afiles;
           uint32       invarsec;
      };

      struct FSSTAT3resfail {
           post_op_attr obj_attributes;
      };

      union FSSTAT3res switch (nfsstat3 status) {
      case NFS3_OK:
           FSSTAT3resok   resok;
      default:
           FSSTAT3resfail resfail;
      };

   DESCRIPTION

      Procedure FSSTAT retrieves volatile file system state
      information. On entry, the arguments in FSSTAT3args are:

      fsroot
         A file handle identifying a object in the file system.
         This is normally a file handle for a mount point for a
         file system, as originally obtained from the MOUNT
         service on the server.

      On successful return, FSSTAT3res.status is NFS3_OK and
      FSSTAT3res.resok contains:






Callaghan, el al             Informational                     [Page 84]

RFC 1813                 NFS Version 3 Protocol                June 1995


      obj_attributes
         The attributes of the file system object specified in
         fsroot.

      tbytes
         The total size, in bytes, of the file system.

      fbytes
         The amount of free space, in bytes, in the file
         system.

      abytes
         The amount of free space, in bytes, available to the
         user identified by the authentication information in
         the RPC.  (This reflects space that is reserved by the
         file system; it does not reflect any quota system
         implemented by the server.)

      tfiles
         The total number of file slots in the file system. (On
         a UNIX server, this often corresponds to the number of
         inodes configured.)

      ffiles
         The number of free file slots in the file system.

      afiles
         The number of free file slots that are available to the
         user corresponding to the authentication information in
         the RPC.  (This reflects slots that are reserved by the
         file system; it does not reflect any quota system
         implemented by the server.)

      invarsec
         A measure of file system volatility: this is the number
         of seconds for which the file system is not expected to
         change. For a volatile, frequently updated file system,
         this will be 0. For an immutable file system, such as a
         CD-ROM, this would be the largest unsigned integer. For
         file systems that are infrequently modified, for
         example, one containing local executable programs and
         on-line documentation, a value corresponding to a few
         hours or days might be used. The client may use this as
         a hint in tuning its cache management. Note however,
         this measure is assumed to be dynamic and may change at
         any time.





Callaghan, el al             Informational                     [Page 85]

RFC 1813                 NFS Version 3 Protocol                June 1995


      Otherwise, FSSTAT3res.status contains the error on failure
      and FSSTAT3res.resfail contains the following:

      obj_attributes
         The attributes of the file system object specified in
         fsroot.

   IMPLEMENTATION

      Not all implementations can support the entire list of
      attributes. It is expected that servers will make a best
      effort at supporting all the attributes.

   ERRORS

      NFS3ERR_IO
      NFS3ERR_STALE
      NFS3ERR_BADHANDLE
      NFS3ERR_SERVERFAULT

   SEE ALSO

      FSINFO.

3.3.19 Procedure 19: FSINFO - Get static file system Information

   SYNOPSIS

      FSINFO3res NFSPROC3_FSINFO(FSINFO3args) = 19;

      const FSF3_LINK        = 0x0001;
      const FSF3_SYMLINK     = 0x0002;
      const FSF3_HOMOGENEOUS = 0x0008;
      const FSF3_CANSETTIME  = 0x0010;

      struct FSINFOargs {
           nfs_fh3   fsroot;
      };

      struct FSINFO3resok {
           post_op_attr obj_attributes;
           uint32       rtmax;
           uint32       rtpref;
           uint32       rtmult;
           uint32       wtmax;
           uint32       wtpref;
           uint32       wtmult;
           uint32       dtpref;



Callaghan, el al             Informational                     [Page 86]

RFC 1813                 NFS Version 3 Protocol                June 1995


           size3        maxfilesize;
           nfstime3     time_delta;
           uint32       properties;
      };

      struct FSINFO3resfail {
           post_op_attr obj_attributes;
      };

      union FSINFO3res switch (nfsstat3 status) {
      case NFS3_OK:
           FSINFO3resok   resok;
      default:
           FSINFO3resfail resfail;
      };

   DESCRIPTION

      Procedure FSINFO retrieves nonvolatile file system state
      information and general information about the NFS version
      3 protocol server implementation. On entry, the arguments
      in FSINFO3args are:

      fsroot
         A file handle identifying a file object. Normal usage
         is to provide a file handle for a mount point for a
         file system, as originally obtained from the MOUNT
         service on the server.

      On successful return, FSINFO3res.status is NFS3_OK and
      FSINFO3res.resok contains:

      obj_attributes
         The attributes of the file system object specified in
         fsroot.

      rtmax
         The maximum size in bytes of a READ request supported
         by the server. Any READ with a number greater than
         rtmax will result in a short read of rtmax bytes or
         less.

      rtpref
         The preferred size of a READ request. This should be
         the same as rtmax unless there is a clear benefit in
         performance or efficiency.





Callaghan, el al             Informational                     [Page 87]

RFC 1813                 NFS Version 3 Protocol                June 1995


      rtmult
         The suggested multiple for the size of a READ request.

      wtmax
         The maximum size of a WRITE request supported by the
         server.  In general, the client is limited by wtmax
         since there is no guarantee that a server can handle a
         larger write. Any WRITE with a count greater than wtmax
         will result in a short write of at most wtmax bytes.

      wtpref
         The preferred size of a WRITE request. This should be
         the same as wtmax unless there is a clear benefit in
         performance or efficiency.

      wtmult
         The suggested multiple for the size of a WRITE
         request.

      dtpref
         The preferred size of a READDIR request.

      maxfilesize
         The maximum size of a file on the file system.

      time_delta
         The server time granularity. When setting a file time
         using SETATTR, the server guarantees only to preserve
         times to this accuracy. If this is {0, 1}, the server
         can support nanosecond times, {0, 1000000} denotes
         millisecond precision, and {1, 0} indicates that times
         are accurate only to the nearest second.

      properties
         A bit mask of file system properties. The following
         values are defined:

         FSF_LINK
            If this bit is 1 (TRUE), the file system supports
            hard links.

         FSF_SYMLINK
            If this bit is 1 (TRUE), the file system supports
            symbolic links.

         FSF_HOMOGENEOUS
            If this bit is 1 (TRUE), the information returned by
            PATHCONF is identical for every file and directory



Callaghan, el al             Informational                     [Page 88]

RFC 1813                 NFS Version 3 Protocol                June 1995


            in the file system. If it is 0 (FALSE), the client
            should retrieve PATHCONF information for each file
            and directory as required.

         FSF_CANSETTIME
            If this bit is 1 (TRUE), the server will set the
            times for a file via SETATTR if requested (to the
            accuracy indicated by time_delta). If it is 0
            (FALSE), the server cannot set times as requested.

      Otherwise, FSINFO3res.status contains the error on failure
      and FSINFO3res.resfail contains the following:

      attributes
         The attributes of the file system object specified in
         fsroot.

   IMPLEMENTATION

      Not all implementations can support the entire list of
      attributes. It is expected that a server will make a best
      effort at supporting all the attributes.

      The file handle provided is expected to be the file handle
      of the file system root, as returned to the MOUNT
      operation.  Since mounts may occur anywhere within an
      exported tree, the server should expect FSINFO requests
      specifying file handles within the exported file system.
      A server may export different types of file systems with
      different attributes returned to the FSINFO call. The
      client should retrieve FSINFO information for each mount
      completed. Though a server may return different FSINFO
      information for different files within a file system,
      there is no requirement that a client obtain FSINFO
      information for other than the file handle returned at
      mount.

      The maxfilesize field determines whether a server's
      particular file system uses 32 bit sizes and offsets or 64
      bit file sizes and offsets. This may affect a client's
      processing.

      The preferred sizes for requests are nominally tied to an
      exported file system mounted by a client. A surmountable
      issue arises in that the transfer size for an NFS version
      3 protocol request is not only dependent on
      characteristics of the file system but also on
      characteristics of the network interface, particularly the



Callaghan, el al             Informational                     [Page 89]

RFC 1813                 NFS Version 3 Protocol                June 1995


      maximum transfer unit (MTU). A server implementation can
      advertise different transfer sizes (for the fields, rtmax,
      rtpref, wtmax, wtpref, and dtpref) depending on the
      interface on which the FSINFO request is received. This is
      an implementation issue.

   ERRORS

      NFS3ERR_STALE
      NFS3ERR_BADHANDLE
      NFS3ERR_SERVERFAULT

   SEE ALSO

      READLINK, WRITE, READDIR, FSSTAT and PATHCONF.

3.3.20 Procedure 20: PATHCONF - Retrieve POSIX information

   SYNOPSIS

      PATHCONF3res NFSPROC3_PATHCONF(PATHCONF3args) = 20;

      struct PATHCONF3args {
           nfs_fh3   object;
      };

      struct PATHCONF3resok {
           post_op_attr obj_attributes;
           uint32       linkmax;
           uint32       name_max;
           bool         no_trunc;
           bool         chown_restricted;
           bool         case_insensitive;
           bool         case_preserving;
      };

      struct PATHCONF3resfail {
           post_op_attr obj_attributes;
      };

      union PATHCONF3res switch (nfsstat3 status) {
      case NFS3_OK:
           PATHCONF3resok   resok;
      default:
           PATHCONF3resfail resfail;
      };





Callaghan, el al             Informational                     [Page 90]

RFC 1813                 NFS Version 3 Protocol                June 1995


   DESCRIPTION

      Procedure PATHCONF retrieves the pathconf information for
      a file or directory. If the FSF_HOMOGENEOUS bit is set in
      FSFINFO3resok.properties, the pathconf information will be
      the same for all files and directories in the exported
      file system in which this file or directory resides. On
      entry, the arguments in PATHCONF3args are:

      object
         The file handle for the file system object.

      On successful return, PATHCONF3res.status is NFS3_OK and
      PATHCONF3res.resok contains:

      obj_attributes
         The attributes of the object specified by object.

      linkmax
         The maximum number of hard links to an object.

      name_max
         The maximum length of a component of a filename.

      no_trunc
         If TRUE, the server will reject any request that
         includes a name longer than name_max with the error,
         NFS3ERR_NAMETOOLONG. If FALSE, any length name over
         name_max bytes will be silently truncated to name_max
         bytes.

      chown_restricted
         If TRUE, the server will reject any request to change
         either the owner or the group associated with a file if
         the caller is not the privileged user. (Uid 0.)

      case_insensitive
         If TRUE, the server file system does not distinguish
         case when interpreting filenames.

      case_preserving
         If TRUE, the server file system will preserve the case
         of a name during a CREATE, MKDIR, MKNOD, SYMLINK,
         RENAME, or LINK operation.

      Otherwise, PATHCONF3res.status contains the error on
      failure and PATHCONF3res.resfail contains the following:




Callaghan, el al             Informational                     [Page 91]

RFC 1813                 NFS Version 3 Protocol                June 1995


      obj_attributes
         The attributes of the object specified by object.

   IMPLEMENTATION

      In some implementations of the NFS version 2 protocol,
      pathconf information was obtained at mount time through
      the MOUNT protocol.  The proper place to obtain it, is as
      here, in the NFS version 3 protocol itself.

   ERRORS

      NFS3ERR_STALE
      NFS3ERR_BADHANDLE
      NFS3ERR_SERVERFAULT

   SEE ALSO

      LOOKUP, CREATE, MKDIR, SYMLINK, MKNOD, RENAME, LINK and FSINFO.

3.3.21 Procedure 21: COMMIT - Commit cached data on a server to stable
       storage

   SYNOPSIS

      COMMIT3res NFSPROC3_COMMIT(COMMIT3args) = 21;

      struct COMMIT3args {
           nfs_fh3    file;
           offset3    offset;
           count3     count;
      };

      struct COMMIT3resok {
           wcc_data   file_wcc;
           writeverf3 verf;
      };

      struct COMMIT3resfail {
           wcc_data   file_wcc;
      };

      union COMMIT3res switch (nfsstat3 status) {
      case NFS3_OK:
           COMMIT3resok   resok;
      default:
           COMMIT3resfail resfail;
      };



Callaghan, el al             Informational                     [Page 92]

RFC 1813                 NFS Version 3 Protocol                June 1995



   DESCRIPTION

      Procedure COMMIT forces or flushes data to stable storage
      that was previously written with a WRITE procedure call
      with the stable field set to UNSTABLE. On entry, the
      arguments in COMMIT3args are:

      file
         The file handle for the file to which data is to be
         flushed (committed). This must identify a file system
         object of type, NF3REG.

      offset
         The position within the file at which the flush is to
         begin.  An offset of 0 means to flush data starting at
         the beginning of the file.

      count
         The number of bytes of data to flush. If count is 0, a
         flush from offset to the end of file is done.

      On successful return, COMMIT3res.status is NFS3_OK and
      COMMIT3res.resok contains:

      file_wcc
         Weak cache consistency data for the file. For a client
         that requires only the post-operation file attributes,
         these can be found in file_wcc.after.

      verf
         This is a cookie that the client can use to determine
         whether the server has rebooted between a call to WRITE
         and a subsequent call to COMMIT. This cookie must be
         consistent during a single boot session and must be
         unique between instances of the NFS version 3 protocol
         server where uncommitted data may be lost.

      Otherwise, COMMIT3res.status contains the error on failure
      and COMMIT3res.resfail contains the following:

      file_wcc
         Weak cache consistency data for the file. For a client
         that requires only the post-write file attributes,
         these can be found in file_wcc.after. Even though the
         COMMIT failed, full wcc_data is returned to allow the
         client to determine whether the file changed on the
         server between calls to WRITE and COMMIT.



Callaghan, el al             Informational                     [Page 93]

RFC 1813                 NFS Version 3 Protocol                June 1995


   IMPLEMENTATION

      Procedure COMMIT is similar in operation and semantics to
      the POSIX fsync(2) system call that synchronizes a file's
      state with the disk, that is it flushes the file's data
      and metadata to disk. COMMIT performs the same operation
      for a client, flushing any unsynchronized data and
      metadata on the server to the server's disk for the
      specified file. Like fsync(2), it may be that there is
      some modified data or no modified data to synchronize. The
      data may have been synchronized by the server's normal
      periodic buffer synchronization activity. COMMIT will
      always return NFS3_OK, unless there has been an unexpected
      error.

      COMMIT differs from fsync(2) in that it is possible for
      the client to flush a range of the file (most likely
      triggered by a buffer-reclamation scheme on the client
      before file has been completely written).

      The server implementation of COMMIT is reasonably simple.
      If the server receives a full file COMMIT request, that is
      starting at offset 0 and count 0, it should do the
      equivalent of fsync()'ing the file. Otherwise, it should
      arrange to have the cached data in the range specified by
      offset and count to be flushed to stable storage.  In both
      cases, any metadata associated with the file must be
      flushed to stable storage before returning. It is not an
      error for there to be nothing to flush on the server.
      This means that the data and metadata that needed to be
      flushed have already been flushed or lost during the last
      server failure.

      The client implementation of COMMIT is a little more
      complex.  There are two reasons for wanting to commit a
      client buffer to stable storage. The first is that the
      client wants to reuse a buffer. In this case, the offset
      and count of the buffer are sent to the server in the
      COMMIT request. The server then flushes any cached data
      based on the offset and count, and flushes any metadata
      associated with the file. It then returns the status of
      the flush and the verf verifier.  The other reason for the
      client to generate a COMMIT is for a full file flush, such
      as may be done at close. In this case, the client would
      gather all of the buffers for this file that contain
      uncommitted data, do the COMMIT operation with an offset
      of 0 and count of 0, and then free all of those buffers.
      Any other dirty buffers would be sent to the server in the



Callaghan, el al             Informational                     [Page 94]

RFC 1813                 NFS Version 3 Protocol                June 1995


      normal fashion.

      This implementation will require some modifications to the
      buffer cache on the client. After a buffer is written with
      stable UNSTABLE, it must be considered as dirty by the
      client system until it is either flushed via a COMMIT
      operation or written via a WRITE operation with stable set
      to FILE_SYNC or DATA_SYNC. This is done to prevent the
      buffer from being freed and reused before the data can be
      flushed to stable storage on the server.

      When a response comes back from either a WRITE or a COMMIT
      operation that contains an unexpected verf, the client
      will need to retransmit all of the buffers containing
      uncommitted cached data to the server.  How this is to be
      done is up to the implementor. If there is only one buffer
      of interest, then it should probably be sent back over in
      a WRITE request with the appropriate stable flag. If there
      more than one, it might be worthwhile retransmitting all
      of the buffers in WRITE requests with stable set to
      UNSTABLE and then retransmitting the COMMIT operation to
      flush all of the data on the server to stable storage. The
      timing of these retransmissions is left to the
      implementor.

      The above description applies to page-cache-based systems
      as well as buffer-cache-based systems. In those systems,
      the virtual memory system will need to be modified instead
      of the buffer cache.

      See additional comments on WRITE on page 49.

   ERRORS

      NFS3ERR_IO
      NFS3ERR_STALE
      NFS3ERR_BADHANDLE
      NFS3ERR_SERVERFAULT

   SEE ALSO

      WRITE.









Callaghan, el al             Informational                     [Page 95]

RFC 1813                 NFS Version 3 Protocol                June 1995


4. Implementation issues

   The NFS version 3 protocol was designed to allow different
   operating systems to share files. However, since it was
   designed in a UNIX environment, many operations have
   semantics similar to the operations of the UNIX file system.
   This section discusses some of the general
   implementation-specific details and semantic issues.
   Procedure descriptions have implementation comments specific
   to that procedure.

   A number of papers have been written describing issues
   encountered when constructing an NFS version 2 protocol
   implementation. The best overview paper is still [Sandberg].
   [Israel], [Macklem], and [Pawlowski] describe other
   implementations. [X/OpenNFS] provides a complete description
   of the NFS version 2 protocol and supporting protocols, as
   well as a discussion on implementation issues and procedure
   and error semantics. Many of the issues encountered when
   constructing an NFS version 2 protocol implementation will be
   encountered when constructing an NFS version 3 protocol
   implementation.

4.1 Multiple version support

   The RPC protocol provides explicit support for versioning of
   a service. Client and server implementations of NFS version 3
   protocol should support both versions, for full backwards
   compatibility, when possible. Default behavior of the RPC
   binding protocol is the client and server bind using the
   highest version number they both support. Client or server
   implementations that cannot easily support both versions (for
   example, because of memory restrictions) will have to choose
   what version to support. The NFS version 2 protocol would be
   a safe choice since fully capable clients and servers should
   support both versions. However, this choice would need to be
   made keeping all requirements in mind.

4.2 Server/client relationship

   The NFS version 3 protocol is designed to allow servers to be
   as simple and general as possible. Sometimes the simplicity
   of the server can be a problem, if the client implements
   complicated file system semantics.

   For example, some operating systems allow removal of open
   files.  A process can open a file and, while it is open,
   remove it from the directory. The file can be read and



Callaghan, el al             Informational                     [Page 96]

RFC 1813                 NFS Version 3 Protocol                June 1995


   written as long as the process keeps it open, even though the
   file has no name in the file system.  It is impossible for a
   stateless server to implement these semantics.  The client
   can do some tricks such as renaming the file on remove (to a
   hidden name), and only physically deleting it on close. The
   NFS version 3 protocol provides sufficient functionality to
   implement most file system semantics on a client.

   Every NFS version 3 protocol client can also potentially be a
   server, and remote and local mounted file systems can be
   freely mixed. This leads to some problems when a client
   travels down the directory tree of a remote file system and
   reaches the mount point on the server for another remote file
   system. Allowing the server to follow the second remote mount
   would require loop detection, server lookup, and user
   revalidation. Instead, both NFS version 2 protocol and NFS
   version 3 protocol implementations do not typically let
   clients cross a server's mount point. When a client does a
   LOOKUP on a directory on which the server has mounted a file
   system, the client sees the underlying directory instead of
   the mounted directory.

   For example, if a server has a file system called /usr and
   mounts another file system on /usr/src, if a client mounts
   /usr, it does not see the mounted version of /usr/src. A
   client could do remote mounts that match the server's mount
   points to maintain the server's view.  In this example, the
   client would also have to mount /usr/src in addition to /usr,
   even if they are from the same server.

4.3 Path name interpretation

   There are a few complications to the rule that path names are
   always parsed on the client. For example, symbolic links
   could have different interpretations on different clients.
   There is no answer to this problem in this specification.

   Another common problem for non-UNIX implementations is the
   special interpretation of the pathname, "..", to mean the
   parent of a given directory. A future revision of the
   protocol may use an explicit flag to indicate the parent
   instead - however it is not a problem as many working
   non-UNIX implementations exist.








Callaghan, el al             Informational                     [Page 97]

RFC 1813                 NFS Version 3 Protocol                June 1995


4.4 Permission issues

   The NFS version 3 protocol, strictly speaking, does not
   define the permission checking used by servers. However, it
   is expected that a server will do normal operating system
   permission checking using AUTH_UNIX style authentication as
   the basis of its protection mechanism, or another stronger
   form of authentication such as AUTH_DES or AUTH_KERB. With
   AUTH_UNIX authentication, the server gets the client's
   effective uid, effective gid, and groups on each call and
   uses them to check permission. These are the so-called UNIX
   credentials. AUTH_DES and AUTH_KERB use a network name, or
   netname, as the basis for identification (from which a UNIX
   server derives the necessary standard UNIX credentials).
   There are problems with this method that have been solved.

   Using uid and gid implies that the client and server share
   the same uid list. Every server and client pair must have the
   same mapping from user to uid and from group to gid. Since
   every client can also be a server, this tends to imply that
   the whole network shares the same uid/gid space. If this is
   not the case, then it usually falls upon the server to
   perform some custom mapping of credentials from one
   authentication domain into another. A discussion of
   techniques for managing a shared user space or for providing
   mechanisms for user ID mapping is beyond the scope of this
   specification.

   Another problem arises due to the usually stateful open
   operation.  Most operating systems check permission at open
   time, and then check that the file is open on each read and
   write request. With stateless servers, the server cannot
   detect that the file is open and must do permission checking
   on each read and write call. UNIX client semantics of access
   permission checking on open can be provided with the ACCESS
   procedure call in this revision, which allows a client to
   explicitly check access permissions without resorting to
   trying the operation. On a local file system, a user can open
   a file and then change the permissions so that no one is
   allowed to touch it, but will still be able to write to the
   file because it is open. On a remote file system, by
   contrast, the write would fail. To get around this problem,
   the server's permission checking algorithm should allow the
   owner of a file to access it regardless of the permission
   setting. This is needed in a practical NFS version 3 protocol
   server implementation, but it does depart from correct local
   file system semantics. This should not affect the return
   result of access permissions as returned by the ACCESS



Callaghan, el al             Informational                     [Page 98]

RFC 1813                 NFS Version 3 Protocol                June 1995


   procedure, however.

   A similar problem has to do with paging in an executable
   program over the network. The operating system usually checks
   for execute permission before opening a file for demand
   paging, and then reads blocks from the open file. In a local
   UNIX file system, an executable file does not need read
   permission to execute (pagein). An NFS version 3 protocol
   server can not tell the difference between a normal file read
   (where the read permission bit is meaningful) and a demand
   pagein read (where the server should allow access to the
   executable file if the execute bit is set for that user or
   group or public). To make this work, the server allows
   reading of files if the uid given in the call has either
   execute or read permission on the file, through ownership,
   group membership or public access. Again, this departs from
   correct local file system semantics.

   In most operating systems, a particular user (on UNIX, the
   uid 0) has access to all files, no matter what permission and
   ownership they have. This superuser permission may not be
   allowed on the server, since anyone who can become superuser
   on their client could gain access to all remote files. A UNIX
   server by default maps uid 0 to a distinguished value
   (UID_NOBODY), as well as mapping the groups list, before
   doing its access checking. A server implementation may
   provide a mechanism to change this mapping. This works except
   for NFS version 3 protocol root file systems (required for
   diskless NFS version 3 protocol client support), where
   superuser access cannot be avoided.  Export options are used,
   on the server, to restrict the set of clients allowed
   superuser access.

4.5 Duplicate request cache

   The typical NFS version 3 protocol failure recovery model
   uses client time-out and retry to handle server crashes,
   network partitions, and lost server replies. A retried
   request is called a duplicate of the original.

   When used in a file server context, the term idempotent can
   be used to distinguish between operation types. An idempotent
   request is one that a server can perform more than once with
   equivalent results (though it may in fact change, as a side
   effect, the access time on a file, say for READ). Some NFS
   operations are obviously non-idempotent. They cannot be
   reprocessed without special attention simply because they may
   fail if tried a second time. The CREATE request, for example,



Callaghan, el al             Informational                     [Page 99]

RFC 1813                 NFS Version 3 Protocol                June 1995


   can be used to create a file for which the owner does not
   have write permission. A duplicate of this request cannot
   succeed if the original succeeded. Likewise, a file can be
   removed only once.

   The side effects caused by performing a duplicate
   non-idempotent request can be destructive (for example, a
   truncate operation causing lost writes). The combination of a
   stateless design with the common choice of an unreliable
   network transport (UDP) implies the possibility of
   destructive replays of non-idempotent requests. Though to be
   more accurate, it is the inherent stateless design of the NFS
   version 3 protocol on top of an unreliable RPC mechanism that
   yields the possibility of destructive replays of
   non-idempotent requests, since even in an implementation of
   the NFS version 3 protocol over a reliable
   connection-oriented transport, a connection break with
   automatic reestablishment requires duplicate request
   processing (the client will retransmit the request, and the
   server needs to deal with a potential duplicate
   non-idempotent request).

   Most NFS version 3 protocol server implementations use a
   cache of recent requests (called the duplicate request cache)
   for the processing of duplicate non-idempotent requests. The
   duplicate request cache provides a short-term memory
   mechanism in which the original completion status of a
   request is remembered and the operation attempted only once.
   If a duplicate copy of this request is received, then the
   original completion status is returned.

   The duplicate-request cache mechanism has been useful in
   reducing destructive side effects caused by duplicate NFS
   version 3 protocol requests. This mechanism, however, does
   not guarantee against these destructive side effects in all
   failure modes. Most servers store the duplicate request cache
   in RAM, so the contents are lost if the server crashes.  The
   exception to this may possibly occur in a redundant server
   approach to high availability, where the file system itself
   may be used to share the duplicate request cache state. Even
   if the cache survives server reboots (or failovers in the
   high availability case), its effectiveness is a function of
   its size. A network partition can cause a cache entry to be
   reused before a client receives a reply for the corresponding
   request. If this happens, the duplicate request will be
   processed as a new one, possibly with destructive side
   effects.




Callaghan, el al             Informational                    [Page 100]

RFC 1813                 NFS Version 3 Protocol                June 1995


   A good description of the implementation and use of a
   duplicate request cache can be found in [Juszczak].

4.6 File name component handling

   Server implementations of NFS version 3 protocol will
   frequently impose restrictions on the names which can be
   created. Many servers will also forbid the use of names that
   contain certain characters, such as the path component
   separator used by the server operating system. For example,
   the UFS file system will reject a name which contains "/",
   while "." and ".." are distinguished in UFS, and may not be
   specified as the name when creating a file system object.
   The exact error status values return for these errors is
   specified in the description of each procedure argument. The
   values (which conform to NFS version 2 protocol server
   practice) are not necessarily obvious, nor are they
   consistent from one procedure to the next.

4.7 Synchronous modifying operations

   Data-modifying operations in the NFS version 3 protocol are
   synchronous. When a procedure returns to the client, the
   client can assume that the operation has completed and any
   data associated with the request is now on stable storage.

4.8 Stable storage

   NFS version 3 protocol servers must be able to recover
   without data loss from multiple power failures (including
   cascading power failures, that is, several power failures in
   quick succession), operating system failures, and hardware
   failure of components other than the storage medium itself
   (for example, disk, nonvolatile RAM).

   Some examples of stable storage that are allowable for an NFS
   server include:

   1. Media commit of data, that is, the modified data has
      been successfully written to the disk media, for example,
      the disk platter.

   2. An immediate reply disk drive with battery-backed
      on-drive intermediate storage or uninterruptible power
      system (UPS).

   3. Server commit of data with battery-backed intermediate
      storage and recovery software.



Callaghan, el al             Informational                    [Page 101]

RFC 1813                 NFS Version 3 Protocol                June 1995


   4. Cache commit with uninterruptible power system (UPS) and
      recovery software.

   Conversely, the following are not examples of stable
   storage:

   1. An immediate reply disk drive without battery-backed
      on-drive intermediate storage or uninterruptible power
      system (UPS).

   2. Cache commit without both uninterruptible power system
      (UPS) and recovery software.

   The only exception to this (introduced in this protocol
   revision) is as described under the WRITE procedure on the
   handling of the stable bit, and the use of the COMMIT
   procedure.  It is the use of the synchronous COMMIT procedure
   that provides the necessary semantic support in the NFS
   version 3 protocol.

4.9 Lookups and name resolution

   A common objection to the NFS version 3 protocol is the
   philosophy of component-by-component LOOKUP by the client in
   resolving a name. The objection is that this is inefficient,
   as latencies for component-by-component LOOKUP would be
   unbearable.

   Implementation practice solves this issue. A name cache,
   providing component to file-handle mapping, is kept on the
   client to short circuit actual LOOKUP invocations over the
   wire.  The cache is subject to cache timeout parameters that
   bound attributes.

4.10 Adaptive retransmission

   Most client implementations use either an exponential
   back-off strategy to some maximum retransmission value, or a
   more adaptive strategy that attempts congestion avoidance.
   Congestion avoidance schemes in NFS request retransmission
   are modelled on the work presented in [Jacobson]. [Nowicki]
   and [Macklem] describe congestion avoidance schemes to be
   applied to the NFS protocol over UDP.

4.11 Caching policies

   The NFS version 3 protocol does not define a policy for
   caching on the client or server. In particular, there is no



Callaghan, el al             Informational                    [Page 102]

RFC 1813                 NFS Version 3 Protocol                June 1995


   support for strict cache consistency between a client and
   server, nor between different clients. See [Kazar] for a
   discussion of the issues of cache synchronization and
   mechanisms in several distributed file systems.

4.12 Stable versus unstable writes

   The setting of the stable field in the WRITE arguments, that
   is whether or not to do asynchronous WRITE requests, is
   straightforward on a UNIX client. If the NFS version 3
   protocol client receives a write request that is not marked
   as being asynchronous, it should generate the RPC with stable
   set to TRUE. If the request is marked as being asynchronous,
   the RPC should be generated with stable set to FALSE. If the
   response comes back with the committed field set to TRUE, the
   client should just mark the write request as done and no
   further action is required. If committed is set to FALSE,
   indicating that the buffer was not synchronized with the
   server's disk, the client will need to mark the buffer in
   some way which indicates that a copy of the buffer lives on
   the server and that a new copy does not need to be sent to
   the server, but that a commit is required.

   Note that this algorithm introduces a new state for buffers,
   thus there are now three states for buffers. The three states
   are dirty, done but needs to be committed, and done. This
   extra state on the client will likely require modifications
   to the system outside of the NFS version 3 protocol client.

   One proposal that was rejected was the addition of a boolean
   commit argument to the WRITE operation. It would be used to
   indicate whether the server should do a full file commit
   after doing the write. This seems as if it could be useful if
   the client knew that it was doing the last write on the file.
   It is difficult to see how this could be used, given existing
   client architectures though.

   The asynchronous write opens up the window of problems
   associated with write sharing. For example: client A writes
   some data asynchronously. Client A is still holding the
   buffers cached, waiting to commit them later. Client B reads
   the modified data and writes it back to the server. The
   server then crashes. When it comes back up, client A issues a
   COMMIT operation which returns with a different cookie as
   well as changed attributes. In this case, the correct action
   may or may not be to retransmit the cached buffers.
   Unfortunately, client A can't tell for sure, so it will need
   to retransmit the buffers, thus overwriting the changes from



Callaghan, el al             Informational                    [Page 103]

RFC 1813                 NFS Version 3 Protocol                June 1995


   client B.  Fortunately, write sharing is rare and the
   solution matches the current write sharing situation. Without
   using locking for synchronization, the behaviour will be
   indeterminate.

   In a high availability (redundant system) server
   implementation, two cases exist which relate to the verf
   changing.  If the high availability server implementation
   does not use a shared-memory scheme, then the verf should
   change on failover, since the unsynchronized data is not
   available to the second processor and there is no guarantee
   that the system which had the data cached was able to flush
   it to stable storage before going down. The client will need
   to retransmit the data to be safe. In a shared-memory high
   availability server implementation, the verf would not need
   to change because the server would still have the cached data
   available to it to be flushed. The exact policy regarding the
   verf in a shared memory high availability implementation,
   however, is up to the server implementor.

4.13 32 bit clients/servers and 64 bit clients/servers

   The 64 bit nature of the NFS version 3 protocol introduces
   several compatibility problems. The most notable two are
   mismatched clients and servers, that is, a 32 bit client and
   a 64 bit server or a 64 bit client and a 32 bit server.

   The problems of a 64 bit client and a 32 bit server are easy
   to handle. The client will never encounter a file that it can
   not handle. If it sends a request to the server that the
   server can not handle, the server should reject the request
   with an appropriate error.

   The problems of a 32 bit client and a 64 bit server are much
   harder to handle. In this situation, the server does not have
   a problem because it can handle anything that the client can
   generate. However, the client may encounter a file that it
   can not handle. The client will not be able to handle a file
   whose size can not be expressed in 32 bits. Thus, the client
   will not be able to properly decode the size of the file into
   its local attributes structure. Also, a file can grow beyond
   the limit of the client while the client is accessing the
   file.

   The solutions to these problems are left up to the individual
   implementor. However, there are two common approaches used to
   resolve this situation. The implementor can choose between
   them or even can invent a new solution altogether.



Callaghan, el al             Informational                    [Page 104]

RFC 1813                 NFS Version 3 Protocol                June 1995


   The most common solution is for the client to deny access to
   any file whose size can not be expressed in 32 bits. This is
   probably the safest, but does introduce some strange
   semantics when the file grows beyond the limit of the client
   while it is being access by that client. The file becomes
   inaccessible even while it is being accessed.

   The second solution is for the client to map any size greater
   than it can handle to the maximum size that it can handle.
   Effectively, it is lying to the application program. This
   allows the application access as much of the file as possible
   given the 32 bit offset restriction. This eliminates the
   strange semantic of the file effectively disappearing after
   it has been accessed, but does introduce other problems. The
   client will not be able to access the entire file.

   Currently, the first solution is the recommended solution.
   However, client implementors are encouraged to do the best
   that they can to reduce the effects of this situation.
































Callaghan, el al             Informational                    [Page 105]

RFC 1813                 NFS Version 3 Protocol                June 1995


5.0 Appendix I: Mount protocol

   The changes from the NFS version 2 protocol to the NFS version 3
   protocol have required some changes to be made in the MOUNT
   protocol.  To meet the needs of the NFS version 3 protocol, a
   new version of the MOUNT protocol has been defined. This new
   protocol satisfies the requirements of the NFS version 3
   protocol and addresses several other current market
   requirements.

5.1 RPC Information

5.1.1 Authentication

   The MOUNT service uses AUTH_NONE in the NULL procedure.
   AUTH_UNIX, AUTH_SHORT, AUTH_DES, or AUTH_KERB are used for all
   other procedures.  Other authentication types may be supported
   in the future.

5.1.2 Constants

   These are the RPC constants needed to call the MOUNT service.
   They are given in decimal.

      PROGRAM  100005
      VERSION  3

5.1.3 Transport address

   The MOUNT service is normally supported over the TCP and UDP
   protocols. The rpcbind daemon should be queried for the correct
   transport address.

5.1.4 Sizes

   const MNTPATHLEN = 1024;  /* Maximum bytes in a path name */
   const MNTNAMLEN  = 255;   /* Maximum bytes in a name */
   const FHSIZE3    = 64;    /* Maximum bytes in a V3 file handle */

5.1.5 Basic Data Types

   typedef opaque fhandle3<FHSIZE3>;
   typedef string dirpath<MNTPATHLEN>;
   typedef string name<MNTNAMLEN>;







Callaghan, el al             Informational                    [Page 106]

RFC 1813                 NFS Version 3 Protocol                June 1995


   enum mountstat3 {
      MNT3_OK = 0,                 /* no error */
      MNT3ERR_PERM = 1,            /* Not owner */
      MNT3ERR_NOENT = 2,           /* No such file or directory */
      MNT3ERR_IO = 5,              /* I/O error */
      MNT3ERR_ACCES = 13,          /* Permission denied */
      MNT3ERR_NOTDIR = 20,         /* Not a directory */
      MNT3ERR_INVAL = 22,          /* Invalid argument */
      MNT3ERR_NAMETOOLONG = 63,    /* Filename too long */
      MNT3ERR_NOTSUPP = 10004,     /* Operation not supported */
      MNT3ERR_SERVERFAULT = 10006  /* A failure on the server */
   };

5.2 Server Procedures

   The following sections define the RPC procedures  supplied by a
   MOUNT version 3 protocol server. The RPC procedure number is
   given at the top of the page with the name and version. The
   SYNOPSIS provides the name of the procedure, the list of the
   names of the arguments, the list of the names of the results,
   followed by the XDR argument declarations and results
   declarations. The information in the SYNOPSIS is specified in
   RPC Data Description Language as defined in [RFC1014]. The
   DESCRIPTION section tells what the procedure is expected to do
   and how its arguments and results are used. The ERRORS section
   lists the errors returned for specific types of failures. The
   IMPLEMENTATION field describes how the procedure is expected to
   work and how it should be used by clients.

      program MOUNT_PROGRAM {
         version MOUNT_V3 {
            void      MOUNTPROC3_NULL(void)    = 0;
            mountres3 MOUNTPROC3_MNT(dirpath)  = 1;
            mountlist MOUNTPROC3_DUMP(void)    = 2;
            void      MOUNTPROC3_UMNT(dirpath) = 3;
            void      MOUNTPROC3_UMNTALL(void) = 4;
            exports   MOUNTPROC3_EXPORT(void)  = 5;
         } = 3;
      } = 100005;












Callaghan, el al             Informational                    [Page 107]

RFC 1813                 NFS Version 3 Protocol                June 1995


5.2.0 Procedure 0: Null - Do nothing

   SYNOPSIS

      void MOUNTPROC3_NULL(void) = 0;

   DESCRIPTION

      Procedure NULL does not do any work. It is made available
      to allow server response testing and timing.

   IMPLEMENTATION

      It is important that this procedure do no work at all so
      that it can be used to measure the overhead of processing
      a service request. By convention, the NULL procedure
      should never require any authentication. A server may
      choose to ignore this convention, in a more secure
      implementation, where responding to the NULL procedure
      call acknowledges the existence of a resource to an
      unauthenticated client.

   ERRORS

      Since the NULL procedure takes no MOUNT protocol arguments
      and returns no MOUNT protocol response, it can not return
      a MOUNT protocol error. However, it is possible that some
      server implementations may return RPC errors based on
      security and authentication requirements.






















Callaghan, el al             Informational                    [Page 108]

RFC 1813                 NFS Version 3 Protocol                June 1995


5.2.1 Procedure 1: MNT - Add mount entry

   SYNOPSIS

      mountres3 MOUNTPROC3_MNT(dirpath) = 1;

      struct mountres3_ok {
           fhandle3   fhandle;
           int        auth_flavors<>;
      };

      union mountres3 switch (mountstat3 fhs_status) {
      case MNT_OK:
           mountres3_ok  mountinfo;
      default:
           void;
      };

   DESCRIPTION

      Procedure MNT maps a pathname on the server to a file
      handle.  The pathname is an ASCII string that describes a
      directory on the server. If the call is successful
      (MNT3_OK), the server returns an NFS version 3 protocol
      file handle and a vector of RPC authentication flavors
      that are supported with the client's use of the file
      handle (or any file handles derived from it).  The
      authentication flavors are defined in Section 7.2 and
      section 9 of [RFC1057].

   IMPLEMENTATION

      If mountres3.fhs_status is MNT3_OK, then
      mountres3.mountinfo contains the file handle for the
      directory and a list of acceptable authentication
      flavors.  This file handle may only be used in the NFS
      version 3 protocol.  This procedure also results in the
      server adding a new entry to its mount list recording that
      this client has mounted the directory. AUTH_UNIX
      authentication or better is required.

   ERRORS

      MNT3ERR_NOENT
      MNT3ERR_IO
      MNT3ERR_ACCES
      MNT3ERR_NOTDIR
      MNT3ERR_NAMETOOLONG



Callaghan, el al             Informational                    [Page 109]

RFC 1813                 NFS Version 3 Protocol                June 1995


5.2.2 Procedure 2: DUMP - Return mount entries

   SYNOPSIS

      mountlist MOUNTPROC3_DUMP(void) = 2;


      typedef struct mountbody *mountlist;

      struct mountbody {
           name       ml_hostname;
           dirpath    ml_directory;
           mountlist  ml_next;
      };

   DESCRIPTION

      Procedure DUMP returns the list of remotely mounted file
      systems. The mountlist contains one entry for each client
      host name and directory pair.

   IMPLEMENTATION

      This list is derived from a list maintained on the server
      of clients that have requested file handles with the MNT
      procedure.  Entries are removed from this list only when a
      client calls the UMNT or UMNTALL procedure. Entries may
      become stale if a client crashes and does not issue either
      UMNT calls for all of the file systems that it had
      previously mounted or a UMNTALL to remove all entries that
      existed for it on the server.

   ERRORS

      There are no MOUNT protocol errors which can be returned
      from this procedure. However, RPC errors may be returned
      for authentication or other RPC failures.














Callaghan, el al             Informational                    [Page 110]

RFC 1813                 NFS Version 3 Protocol                June 1995


5.2.3 Procedure 3: UMNT - Remove mount entry

   SYNOPSIS

      void MOUNTPROC3_UMNT(dirpath) = 3;

   DESCRIPTION

      Procedure UMNT removes the mount list entry for the
      directory that was previously the subject of a MNT call
      from this client.  AUTH_UNIX authentication or better is
      required.

   IMPLEMENTATION

      Typically, server implementations have maintained a list
      of clients which have file systems mounted. In the past,
      this list has been used to inform clients that the server
      was going to be shutdown.

   ERRORS

      There are no MOUNT protocol errors which can be returned
      from this procedure. However, RPC errors may be returned
      for authentication or other RPC failures.


























Callaghan, el al             Informational                    [Page 111]

RFC 1813                 NFS Version 3 Protocol                June 1995


5.2.4 Procedure 4: UMNTALL - Remove all mount entries

   SYNOPSIS

      void MOUNTPROC3_UMNTALL(void) = 4;

   DESCRIPTION

      Procedure UMNTALL removes all of the mount entries for
      this client previously recorded by calls to MNT. AUTH_UNIX
      authentication or better is required.

   IMPLEMENTATION

      This procedure should be used by clients when they are
      recovering after a system shutdown. If the client could
      not successfully unmount all of its file systems before
      being shutdown or the client crashed because of a software
      or hardware problem, there may be servers which still have
      mount entries for this client. This is an easy way for the
      client to inform all servers at once that it does not have
      any mounted file systems.  However, since this procedure
      is generally implemented using broadcast RPC, it is only
      of limited usefullness.

   ERRORS

      There are no MOUNT protocol errors which can be returned
      from this procedure. However, RPC errors may be returned
      for authentication or other RPC failures.





















Callaghan, el al             Informational                    [Page 112]

RFC 1813                 NFS Version 3 Protocol                June 1995


5.2.5 Procedure 5: EXPORT - Return export list

   SYNOPSIS

      exports MOUNTPROC3_EXPORT(void) = 5;

      typedef struct groupnode *groups;

      struct groupnode {
           name     gr_name;
           groups   gr_next;
      };

      typedef struct exportnode *exports;

      struct exportnode {
           dirpath  ex_dir;
           groups   ex_groups;
           exports  ex_next;
      };

   DESCRIPTION

      Procedure EXPORT returns a list of all the exported file
      systems and which clients are allowed to mount each one.
      The names in the group list are implementation-specific
      and cannot be directly interpreted by clients. These names
      can represent hosts or groups of hosts.

   IMPLEMENTATION

      This procedure generally returns the contents of a list of
      shared or exported file systems. These are the file
      systems which are made available to NFS version 3 protocol
      clients.

   ERRORS

      There are no MOUNT protocol errors which can be returned
      from this procedure. However, RPC errors may be returned
      for authentication or other RPC failures.










Callaghan, el al             Informational                    [Page 113]

RFC 1813                 NFS Version 3 Protocol                June 1995


6.0 Appendix II: Lock manager protocol

   Because the NFS version 2 protocol as well as the NFS version 3
   protocol is stateless, an additional Network Lock Manager (NLM)
   protocol is required to support locking of NFS-mounted files.
   The NLM version 3 protocol, which is used with the NFS version 2
   protocol, is documented in [X/OpenNFS].

   Some of the changes in the NFS version 3 protocol require a
   new version of the NLM protocol. This new protocol is the NLM
   version 4 protocol. The following table summarizes the
   correspondence between versions of the NFS protocol and NLM
   protocol.

       NFS and NLM protocol compatibility

               +---------+---------+
               |   NFS   |   NLM   |
               | Version | Version |
               +===================+
               |    2    |   1,3   |
               +---------+---------+
               |    3    |    4    |
               +---------+---------+

   This appendix only discusses the differences between the NLM
   version 3 protocol and the NLM version 4 protocol.  As in the
   NFS version 3 protocol, almost all the names in the NLM version
   4 protocol have been changed to include a version number. This
   appendix does not discuss changes that consist solely of a name
   change.

6.1 RPC Information

6.1.1 Authentication

   The NLM service uses AUTH_NONE in the NULL procedure.
   AUTH_UNIX, AUTH_SHORT, AUTH_DES, and AUTH_KERB are used for
   all other procedures. Other authentication types may be
   supported in the future.

6.1.2 Constants

   These are the RPC constants needed to call the NLM service.
   They are given in decimal.

      PROGRAM    100021
      VERSION    4



Callaghan, el al             Informational                    [Page 114]

RFC 1813                 NFS Version 3 Protocol                June 1995


6.1.3 Transport Address

   The NLM service is normally supported over the TCP and UDP
   protocols.  The rpcbind daemon should be queried for the
   correct transport address.

6.1.4 Basic Data Types

   uint64
      typedef unsigned hyper uint64;

   int64
      typedef hyper int64;

   uint32
      typedef unsigned long uint32;

   int32
      typedef long int32;

   These types are new for the NLM version 4 protocol. They are
   the same as in the NFS version 3 protocol.

   nlm4_stats

      enum nlm4_stats {
         NLM4_GRANTED = 0,
         NLM4_DENIED = 1,
         NLM4_DENIED_NOLOCKS = 2,
         NLM4_BLOCKED = 3,
         NLM4_DENIED_GRACE_PERIOD = 4,
         NLM4_DEADLCK = 5,
         NLM4_ROFS = 6,
         NLM4_STALE_FH = 7,
         NLM4_FBIG = 8,
         NLM4_FAILED = 9
      };

   Nlm4_stats indicates the success or failure of a call. This
   version contains several new error codes, so that clients can
   provide more precise failure information to applications.

   NLM4_GRANTED
      The call completed successfully.

   NLM4_DENIED
      The call failed. For attempts to set a lock, this status
      implies that if the client retries the call later, it may



Callaghan, el al             Informational                    [Page 115]

RFC 1813                 NFS Version 3 Protocol                June 1995


      succeed.

   NLM4_DENIED_NOLOCKS
      The call failed because the server could not allocate the
      necessary resources.

   NLM4_BLOCKED
      Indicates that a blocking request cannot be granted
      immediately. The server will issue an NLMPROC4_GRANTED
      callback to the client when the lock is granted.

   NLM4_DENIED_GRACE_PERIOD
      The call failed because the server is reestablishing old
      locks after a reboot and is not yet ready to resume normal
      service.

   NLM4_DEADLCK
      The request could not be granted and blocking would cause
      a deadlock.

   NLM4_ROFS
      The call failed because the remote file system is
      read-only.  For example, some server implementations might
      not support exclusive locks on read-only file systems.

   NLM4_STALE_FH
      The call failed because it uses an invalid file handle.
      This can happen if the file has been removed or if access
      to the file has been revoked on the server.

   NLM4_FBIG
      The call failed because it specified a length or offset
      that exceeds the range supported by the server.

   NLM4_FAILED
      The call failed for some reason not already listed.  The
      client should take this status as a strong hint not to
      retry the request.

   nlm4_holder

      struct nlm4_holder {
           bool     exclusive;
           int32    svid;
           netobj   oh;
           uint64   l_offset;
           uint64   l_len;
      };



Callaghan, el al             Informational                    [Page 116]

RFC 1813                 NFS Version 3 Protocol                June 1995


   This structure indicates the holder of a lock. The exclusive
   field tells whether the holder has an exclusive lock or a
   shared lock. The svid field identifies the process that is
   holding the lock. The oh field is an opaque object that
   identifies the host or process that is holding the lock. The
   l_len and l_offset fields identify the region that is locked.
   The only difference between the NLM version 3 protocol and
   the NLM version 4 protocol is that in the NLM version 3
   protocol, the l_len and l_offset fields are 32 bits wide,
   while they are 64 bits wide in the NLM version 4 protocol.

   nlm4_lock

      struct nlm4_lock {
           string   caller_name<LM_MAXSTRLEN>;
           netobj   fh;
           netobj   oh;
           int32    svid;
           uint64   l_offset;
           uint64   l_len;
      };

   This structure describes a lock request. The caller_name
   field identifies the host that is making the request. The fh
   field identifies the file to lock. The oh field is an opaque
   object that identifies the host or process that is making the
   request, and the svid field identifies the process that is
   making the request.  The l_offset and l_len fields identify
   the region of the file that the lock controls.  A l_len of 0
   means "to end of file".

   There are two differences between the NLM version 3 protocol
   and the NLM version 4 protocol versions of this structure.
   First, in the NLM version 3 protocol, the length and offset
   are 32 bits wide, while they are 64 bits wide in the NLM
   version 4 protocol.  Second, in the NLM version 3 protocol,
   the file handle is a fixed-length NFS version 2 protocol file
   handle, which is encoded as a byte count followed by a byte
   array. In the NFS version 3 protocol, the file handle is
   already variable-length, so it is copied directly into the fh
   field.  That is, the first four bytes of the fh field are the
   same as the byte count in an NFS version 3 protocol nfs_fh3.
   The rest of the fh field contains the byte array from the NFS
   version 3 protocol nfs_fh3.







Callaghan, el al             Informational                    [Page 117]

RFC 1813                 NFS Version 3 Protocol                June 1995


   nlm4_share

      struct nlm4_share {
           string      caller_name<LM_MAXSTRLEN>;
           netobj      fh;
           netobj      oh;
           fsh4_mode   mode;
           fsh4_access access;
      };

   This structure is used to support DOS file sharing. The
   caller_name field identifies the host making the request.
   The fh field identifies the file to be operated on. The oh
   field is an opaque object that identifies the host or process
   that is making the request. The mode and access fields
   specify the file-sharing and access modes. The encoding of fh
   is a byte count, followed by the file handle byte array. See
   the description of nlm4_lock for more details.

6.2 NLM Procedures

   The procedures in the NLM version 4 protocol are semantically
   the same as those in the NLM version 3 protocol. The only
   semantic difference is the addition of a NULL procedure that
   can be used to test for server responsiveness.  The procedure
   names with _MSG and _RES suffixes denote asynchronous
   messages; for these the void response implies no reply.  A
   syntactic change is that the procedures were renamed to avoid
   name conflicts with the values of nlm4_stats. Thus the
   procedure definition is as follows.

      version NLM4_VERS {
         void
            NLMPROC4_NULL(void)                  = 0;

         nlm4_testres
            NLMPROC4_TEST(nlm4_testargs)         = 1;

         nlm4_res
            NLMPROC4_LOCK(nlm4_lockargs)         = 2;

         nlm4_res
            NLMPROC4_CANCEL(nlm4_cancargs)       = 3;

         nlm4_res
            NLMPROC4_UNLOCK(nlm4_unlockargs)     = 4;





Callaghan, el al             Informational                    [Page 118]

RFC 1813                 NFS Version 3 Protocol                June 1995


         nlm4_res
            NLMPROC4_GRANTED(nlm4_testargs)      = 5;

         void
            NLMPROC4_TEST_MSG(nlm4_testargs)     = 6;

         void
            NLMPROC4_LOCK_MSG(nlm4_lockargs)     = 7;

         void
            NLMPROC4_CANCEL_MSG(nlm4_cancargs)   = 8;

         void
            NLMPROC4_UNLOCK_MSG(nlm4_unlockargs) = 9;

         void
            NLMPROC4_GRANTED_MSG(nlm4_testargs) = 10;

         void
            NLMPROC4_TEST_RES(nlm4_testres)     = 11;

         void
            NLMPROC4_LOCK_RES(nlm4_res)         = 12;

         void
            NLMPROC4_CANCEL_RES(nlm4_res)       = 13;

         void
            NLMPROC4_UNLOCK_RES(nlm4_res)       = 14;

         void
            NLMPROC4_GRANTED_RES(nlm4_res)      = 15;

         nlm4_shareres
            NLMPROC4_SHARE(nlm4_shareargs)      = 20;

         nlm4_shareres
            NLMPROC4_UNSHARE(nlm4_shareargs)    = 21;

         nlm4_res
            NLMPROC4_NM_LOCK(nlm4_lockargs)     = 22;

         void
            NLMPROC4_FREE_ALL(nlm4_notify)      = 23;

      } = 4;





Callaghan, el al             Informational                    [Page 119]

RFC 1813                 NFS Version 3 Protocol                June 1995


6.2.0 Procedure 0: NULL - Do nothing

   SYNOPSIS

      void NLMPROC4_NULL(void) = 0;

   DESCRIPTION

      The NULL procedure does no work. It is made available in
      all RPC services to allow server response testing and
      timing.

   IMPLEMENTATION

      It is important that this procedure do no work at all so
      that it can be used to measure the overhead of processing
      a service request. By convention, the NULL procedure
      should never require any authentication.

   ERRORS

      It is possible that some server implementations may return
      RPC errors based on security and authentication
      requirements.

6.3 Implementation issues

6.3.1 64-bit offsets and lengths

      Some NFS version 3 protocol servers can only support
      requests where the file offset or length fits in 32 or
      fewer bits.  For these servers, the lock manager will have
      the same restriction.  If such a lock manager receives a
      request that it cannot handle (because the offset or
      length uses more than 32 bits), it should return the
      error, NLM4_FBIG.

6.3.2 File handles

      The change in the file handle format from the NFS version
      2 protocol to the NFS version 3 protocol complicates the
      lock manager. First, the lock manager needs some way to
      tell when an NFS version 2 protocol file handle refers to
      the same file as an NFS version 3 protocol file handle.
      (This is assuming that the lock manager supports both NLM
      version 3 protocol clients and NLM version 4 protocol
      clients.) Second, if the lock manager runs the file handle
      through a hashing function, the hashing function may need



Callaghan, el al             Informational                    [Page 120]

RFC 1813                 NFS Version 3 Protocol                June 1995


      to be retuned to work with NFS version 3 protocol file
      handles as well as NFS version 2 protocol file handles.

















































Callaghan, el al             Informational                    [Page 121]

RFC 1813                 NFS Version 3 Protocol                June 1995


7.0 Appendix III: Bibliography

[Corbin]        Corbin, John, "The Art of Distributed
                Programming-Programming Techniques for Remote
                Procedure Calls." Springer-Verlag, New York, New
                York. 1991.  Basic description of RPC and XDR
                and how to program distributed applications
                using them.

[Glover]        Glover, Fred, "TNFS Protocol Specification,"
                Trusted System Interest Group, Work in
                Progress.

[Israel]        Israel, Robert K., Sandra Jett, James Pownell,
                George M. Ericson, "Eliminating Data Copies in
                UNIX-based NFS Servers," Uniforum Conference
                Proceedings, San Francisco, CA,
                February 27 - March 2, 1989.  Describes two
                methods for reducing data copies in NFS server
                code.

[Jacobson]      Jacobson, V., "Congestion Control and
                Avoidance," Proc. ACM SIGCOMM `88, Stanford, CA,
                August 1988.  The paper describing improvements
                to TCP to allow use over Wide Area Networks and
                through gateways connecting networks of varying
                capacity. This work was a starting point for the
                NFS Dynamic Retransmission work.

[Juszczak]      Juszczak, Chet, "Improving the Performance and
                Correctness of an NFS Server," USENIX Conference
                Proceedings, USENIX Association, Berkeley, CA,
                June 1990, pages 53-63.  Describes reply cache
                implementation that avoids work in the server by
                handling duplicate requests. More important,
                though listed as a side-effect, the reply cache
                aids in the avoidance of destructive
                non-idempotent operation re-application --
                improving correctness.

[Kazar]         Kazar, Michael Leon, "Synchronization and Caching
                Issues in the Andrew File System," USENIX Conference
                Proceedings, USENIX Association, Berkeley, CA,
                Dallas Winter 1988, pages 27-36.  A description
                of the cache consistency scheme in AFS.
                Contrasted with other distributed file systems.





Callaghan, el al             Informational                    [Page 122]

RFC 1813                 NFS Version 3 Protocol                June 1995


[Macklem]       Macklem, Rick, "Lessons Learned Tuning the
                4.3BSD Reno Implementation of the NFS Protocol,"
                Winter USENIX Conference Proceedings, USENIX
                Association, Berkeley, CA, January 1991.
                Describes performance work in tuning the 4.3BSD
                Reno NFS implementation. Describes performance
                improvement (reduced CPU loading) through
                elimination of data copies.

[Mogul]         Mogul, Jeffrey C., "A Recovery Protocol for Spritely
                NFS," USENIX File System Workshop Proceedings,
                Ann Arbor, MI, USENIX Association, Berkeley, CA,
                May 1992.  Second paper on Spritely NFS proposes
                a lease-based scheme for recovering state of
                consistency protocol.

[Nowicki]       Nowicki, Bill, "Transport Issues in the Network
                File System," ACM SIGCOMM newsletter Computer
                Communication Review, April 1989.  A brief
                description of the basis for the dynamic
                retransmission work.

[Pawlowski]     Pawlowski, Brian, Ron Hixon, Mark Stein, Joseph
                Tumminaro, "Network Computing in the UNIX and
                IBM Mainframe Environment," Uniforum `89 Conf.
                Proc., (1989) Description of an NFS server
                implementation for IBM's MVS operating system.

[RFC1014]       Sun Microsystems, Inc., "XDR: External Data
                Representation Standard", RFC 1014,
                Sun Microsystems, Inc., June 1987.
                Specification for canonical format for data
                exchange, used with RPC.

[RFC1057]       Sun Microsystems, Inc., "RPC: Remote Procedure
                Call Protocol Specification", RFC 1057,
                Sun Microsystems, Inc., June 1988.
                Remote procedure protocol specification.

[RFC1094]       Sun Microsystems, Inc., "Network Filesystem
                Specification", RFC 1094, Sun Microsystems, Inc.,
                March 1989.  NFS version 2 protocol
                specification.








Callaghan, el al             Informational                    [Page 123]

RFC 1813                 NFS Version 3 Protocol                June 1995


[Sandberg]      Sandberg, R., D. Goldberg, S. Kleiman, D. Walsh,
                B.  Lyon, "Design and Implementation of the Sun
                Network Filesystem," USENIX Conference
                Proceedings, USENIX Association, Berkeley, CA,
                Summer 1985.  The basic paper describing the
                SunOS implementation of the NFS version 2
                protocol, and discusses the goals, protocol
                specification and trade-offs.

[Srinivasan]    Srinivasan, V., Jeffrey C. Mogul, "Spritely
                NFS:  Implementation and Performance of Cache
                Consistency Protocols", WRL Research Report
                89/5, Digital Equipment Corporation Western
                Research Laboratory, 100 Hamilton Ave., Palo
                Alto, CA, 94301, May 1989.  This paper analyzes
                the effect of applying a Sprite-like consistency
                protocol applied to standard NFS. The issues of
                recovery in a stateful environment are covered
                in [Mogul].

[X/OpenNFS]     X/Open Company, Ltd., X/Open CAE Specification:
                Protocols for X/Open Internetworking: XNFS,
                X/Open Company, Ltd., Apex Plaza, Forbury Road,
                Reading Berkshire, RG1 1AX, United Kingdom,
                1991.  This is an indispensable reference for
                NFS version 2 protocol and accompanying
                protocols, including the Lock Manager and the
                Portmapper.

[X/OpenPCNFS]   X/Open Company, Ltd., X/Open CAE Specification:
                Protocols for X/Open Internetworking: (PC)NFS,
                Developer's Specification, X/Open Company, Ltd.,
                Apex Plaza, Forbury Road, Reading Berkshire, RG1
                1AX, United Kingdom, 1991.  This is an
                indispensable reference for NFS version 2
                protocol and accompanying protocols, including
                the Lock Manager and the Portmapper.














Callaghan, el al             Informational                    [Page 124]

RFC 1813                 NFS Version 3 Protocol                June 1995


8. Security Considerations

   Since sensitive file data may be transmitted or received
   from a server by the NFS protocol, authentication, privacy,
   and data integrity issues should be addressed by implementations
   of this protocol.

   As with the previous protocol revision (version 2), NFS
   version 3 defers to the authentication provisions of the
   supporting RPC protocol [RFC1057], and assumes that data
   privacy and integrity are provided by underlying transport
   layers as available in each implementation of the protocol.
   See section 4.4 for a discussion relating to file access
   permissions.

9. Acknowledgements

   This description of the protocol is derived from an original
   document written by Brian Pawlowski and revised by Peter
   Staubach.  This protocol is the result of a co-operative
   effort that comprises the contributions of Geoff Arnold,
   Brent Callaghan, John Corbin, Fred Glover, Chet Juszczak,
   Mike Eisler, John Gillono, Dave Hitz, Mike Kupfer, Rick
   Macklem, Ron Minnich, Brian Pawlowski, David Robinson, Rusty
   Sandberg, Craig Schamp, Spencer Shepler, Carl Smith, Mark
   Stein, Peter Staubach, Tom Talpey, Rob Thurlow, and Mark
   Wittle.
























Callaghan, el al             Informational                    [Page 125]

RFC 1813                 NFS Version 3 Protocol                June 1995


10. Authors' Addresses

   Address comments related to this protocol to:

      nfs3@eng.sun.com


   Brent Callaghan
   Sun Microsystems, Inc.
   2550 Garcia Avenue
   Mailstop UMTV05-44
   Mountain View, CA 94043-1100

   Phone: 1-415-336-1051
   Fax:   1-415-336-6015
   EMail: brent.callaghan@eng.sun.com


   Brian Pawlowski
   Network Appliance Corp.
   319 North Bernardo Ave.
   Mountain View, CA 94043

   Phone: 1-415-428-5136
   Fax:   1-415-428-5151
   EMail: beepy@netapp.com


   Peter Staubach
   Sun Microsystems, Inc.
   2550 Garcia Avenue
   Mailstop UMTV05-44
   Mountain View, CA 94043-1100

   Phone: 1-415-336-5615
   Fax:   1-415-336-6015
   EMail: peter.staubach@eng.sun.com














Callaghan, el al             Informational                    [Page 126]