|
| 1 | +# RFC Compliance Documentation |
| 2 | + |
| 3 | +This RPC implementation supports all three major RPC RFCs: |
| 4 | + |
| 5 | +- **RFC 1057** (1988) - RPC: Remote Procedure Call, Version 2 |
| 6 | +- **RFC 1831** (1995) - RPC: Remote Procedure Call Protocol Specification Version 2 |
| 7 | +- **RFC 5531** (2009) - RPC: Remote Procedure Call Protocol Specification Version 2 (Internet Standard) |
| 8 | + |
| 9 | +## Changes from RFC 1057 to Full RFC Compliance |
| 10 | + |
| 11 | +### 1. Authentication Flavors (RFC 1831/5531) |
| 12 | + |
| 13 | +#### RFC 1057 (Original) |
| 14 | + |
| 15 | +- AUTH_NULL (0) |
| 16 | +- AUTH_UNIX (1) |
| 17 | +- AUTH_SHORT (2) |
| 18 | +- AUTH_DES (3) |
| 19 | + |
| 20 | +#### RFC 1831 (Updated naming) |
| 21 | + |
| 22 | +- AUTH_NONE (0) - renamed from AUTH_NULL |
| 23 | +- AUTH_SYS (1) - renamed from AUTH_UNIX |
| 24 | +- AUTH_SHORT (2) |
| 25 | +- AUTH_DES (3) - refined but optional |
| 26 | + |
| 27 | +#### RFC 5531 (Additional flavors) |
| 28 | + |
| 29 | +- AUTH_NONE (0) |
| 30 | +- AUTH_SYS (1) |
| 31 | +- AUTH_SHORT (2) |
| 32 | +- AUTH_DH (3) - Diffie-Hellman (obsolete, insecure per RFC 2695) |
| 33 | +- AUTH_KERB (4) - Kerberos |
| 34 | +- AUTH_RSA (5) |
| 35 | +- RPCSEC_GSS (6) - GSS-based security with integrity/privacy (RFC 2203, RFC 5403) |
| 36 | + |
| 37 | +**Implementation Note**: The code maintains backward compatibility by keeping AUTH_NULL as an alias for AUTH_NONE, and AUTH_UNIX as an alias for AUTH_SYS. AUTH_DES is also an alias for AUTH_DH. |
| 38 | + |
| 39 | +### 2. Authentication Status Values (RFC 5531) |
| 40 | + |
| 41 | +#### RFC 1057 |
| 42 | + |
| 43 | +- AUTH_BADCRED (1) |
| 44 | +- AUTH_REJECTEDCRED (2) |
| 45 | +- AUTH_BADVERF (3) |
| 46 | +- AUTH_REJECTEDVERF (4) |
| 47 | +- AUTH_TOOWEAK (5) |
| 48 | + |
| 49 | +#### RFC 5531 (Additional values) |
| 50 | + |
| 51 | +- AUTH_OK (0) - Added for completeness |
| 52 | +- AUTH_INVALIDRESP (6) |
| 53 | +- AUTH_FAILED (7) |
| 54 | +- AUTH_KERB_GENERIC (8) |
| 55 | +- AUTH_TIMEEXPIRE (9) |
| 56 | +- AUTH_TKT_FILE (10) |
| 57 | +- AUTH_DECODE (11) |
| 58 | +- AUTH_NET_ADDR (12) |
| 59 | +- RPCSEC_GSS_CREDPROBLEM (13) - RPCSEC_GSS credential problem |
| 60 | +- RPCSEC_GSS_CTXPROBLEM (14) - RPCSEC_GSS context problem |
| 61 | + |
| 62 | +### 3. Accept Status Values (RFC 5531) |
| 63 | + |
| 64 | +#### RFC 1057 |
| 65 | + |
| 66 | +- SUCCESS (0) |
| 67 | +- PROG_UNAVAIL (1) |
| 68 | +- PROG_MISMATCH (2) |
| 69 | +- PROC_UNAVAIL (3) |
| 70 | +- GARBAGE_ARGS (4) |
| 71 | + |
| 72 | +#### RFC 5531 (Addition) |
| 73 | + |
| 74 | +- SYSTEM_ERR (5) - Added for issues like memory allocation failures |
| 75 | + |
| 76 | +### 4. Data Size Limits |
| 77 | + |
| 78 | +#### RFC 1057 |
| 79 | + |
| 80 | +- Opaque authentication bodies: Limited by XDR |
| 81 | +- Fragment sizes: Limited by implementation |
| 82 | + |
| 83 | +#### RFC 1831/5531 |
| 84 | + |
| 85 | +- Opaque authentication bodies: Up to 400 bytes |
| 86 | +- Fragment sizes: Up to 2^31-1 bytes for stream transports (TCP) |
| 87 | + |
| 88 | +**Implementation**: The decoder enforces the 400-byte limit for auth bodies. Fragment size limits for record marking are enforced by the separate `rm` module. |
| 89 | + |
| 90 | +### 5. Batching and Broadcast (RFC 1831) |
| 91 | + |
| 92 | +RFC 1831 explicitly formalized: |
| 93 | + |
| 94 | +- **Batching**: Pipelining sequences of calls without immediate replies over reliable transports |
| 95 | +- **Broadcast/Multicast RPC**: Support for multicast RPC over packet-based protocols like UDP |
| 96 | + |
| 97 | +**Implementation Note**: This codec handles message encoding/decoding. Batching and broadcast semantics are implemented at the transport layer by the application. |
| 98 | + |
| 99 | +### 6. Security Considerations (RFC 5531) |
| 100 | + |
| 101 | +RFC 5531 emphasizes: |
| 102 | + |
| 103 | +- AUTH_NONE and AUTH_SYS are weak and SHOULD NOT be used for modifiable data |
| 104 | +- Future Standards Track RPC programs MUST support RPCSEC_GSS |
| 105 | +- External security measures (e.g., privileged ports) may be necessary |
| 106 | + |
| 107 | +**Implementation Note**: This codec provides the wire format for all authentication flavors. Security policy enforcement is the responsibility of the application layer. |
| 108 | + |
| 109 | +## Program Number Ranges |
| 110 | + |
| 111 | +### RFC 1057 |
| 112 | + |
| 113 | +- Simple assignment scheme |
| 114 | + |
| 115 | +### RFC 1831 |
| 116 | + |
| 117 | +- 0x00000000-0x1fffffff: Defined by Sun/central authority |
| 118 | +- 0x20000000-0x3fffffff: User-defined |
| 119 | +- 0x40000000-0x5fffffff: Transient |
| 120 | +- 0x60000000-0xffffffff: Reserved |
| 121 | + |
| 122 | +### RFC 5531 (IANA Administration) |
| 123 | + |
| 124 | +- Assignment authority transferred to IANA |
| 125 | +- Formal policies: First Come First Served for small blocks, Specification Required for larger ones |
| 126 | +- 0x20000000-0x3fffffff: Site-specific use |
| 127 | +- Appendix C lists Sun-assigned numbers (e.g., portmapper=100000, NFS=100003) |
| 128 | + |
| 129 | +**Implementation Note**: Program number validation and assignment is not enforced by this codec. |
| 130 | + |
| 131 | +## XDR References |
| 132 | + |
| 133 | +- **RFC 1057**: References original XDR specification |
| 134 | +- **RFC 1831**: References RFC 1832 (XDR update) |
| 135 | +- **RFC 5531**: References RFC 4506 (STD 67) |
| 136 | + |
| 137 | +This implementation follows XDR encoding as specified in these standards. |
| 138 | + |
| 139 | +## Transport Independence |
| 140 | + |
| 141 | +All RFC versions maintain transport independence. The RPC protocol: |
| 142 | + |
| 143 | +- Does NOT provide reliability (must be provided by transport or application) |
| 144 | +- Does NOT attach specific semantics to remote procedures |
| 145 | +- Supports both connection-oriented (TCP) and connectionless (UDP) transports |
| 146 | + |
| 147 | +**Record Marking**: For TCP and other stream-oriented transports, RFC 1057 Section 10 specifies a record marking standard. This is implemented in the separate `rm` module (`src/rm/`). |
| 148 | + |
| 149 | +## Compatibility |
| 150 | + |
| 151 | +The implementation is designed to be compatible with all three RFC versions: |
| 152 | + |
| 153 | +- Uses RPC_VERSION = 2 (compatible with all versions) |
| 154 | +- Supports all authentication flavors (old and new names) |
| 155 | +- Handles all error conditions defined across all RFCs |
| 156 | +- Enforces size limits as specified in later RFCs |
| 157 | + |
| 158 | +## References |
| 159 | + |
| 160 | +1. RFC 1057 - RPC: Remote Procedure Call, Version 2 (June 1988) |
| 161 | +2. RFC 1831 - RPC: Remote Procedure Call Protocol Specification Version 2 (August 1995) |
| 162 | +3. RFC 5531 - RPC: Remote Procedure Call Protocol Specification Version 2 (May 2009) |
| 163 | +4. RFC 2203 - RPCSEC_GSS Protocol Specification |
| 164 | +5. RFC 5403 - RPCSEC_GSS Version 2 |
| 165 | +6. RFC 2623 - NFS Version 2 and Version 3 Security Issues and the NFS Protocol's Use of RPCSEC_GSS and Kerberos V5 |
0 commit comments