Protocol Architecture
RDP operates as a multi-layered protocol stack, with each layer providing specific functionality:Transport Layer (TPKT/TPDU)
The foundation uses ISO transport protocols:- TPKT (RFC 1006): Provides packet framing over TCP
- TPDU (ISO 8073): Connection-Oriented Transport Protocol
ironrdp-pdu/src/tpkt.rs and ironrdp-pdu/src/tpdu.rs.
Connection Layer (X.224)
X.224 handles connection establishment and data transfer. The protocol begins with a Connection Request (CR) and Connection Confirm (CC) exchange.ironrdp-pdu/src/x224.rs for the X.224 implementation.
MCS Layer (T.125)
Multipoint Communication Service (MCS) manages multiple channels over a single connection:- Domain attachment: Client joins an MCS domain
- Channel management: Up to 32 static channels (including the mandatory I/O channel)
- User attachment: Associates users with channels
ironrdp-pdu/src/mcs.rs using ASN.1 PER encoding (ironrdp-pdu/src/per.rs).
RDP Layer
The application layer handles:- Capability negotiation
- Graphics rendering
- Input event processing
- Virtual channel data
Security Protocols
IronRDP enforces modern security practices by design.Standard RDP Security (Deprecated)
The legacy RC4-based security is not supported in IronRDP:- No pre-authentication
- Full session establishment before credential validation
- Vulnerable to MITM attacks
- Exposes static channels (clipboard, drive redirection, etc.) to attackers
ironrdp-connector/src/connection.rs:266-268.
Enhanced RDP Security (TLS)
TLS wraps the RDP connection after X.224 negotiation:- The entire RDP session is established pre-authentication
- All static channels are joined and active
- Server and client attack surfaces are exposed
Security Recommendation: Set
enable_tls to false to enforce NLA when connecting to CredSSP-capable servers.Network Level Authentication (CredSSP)
NLA using CredSSP provides authentication before session establishment:- Authentication occurs before RDP session initialization
- Dramatically reduced attack surface
- Early user authorization result PDU support (HYBRID_EX)
- Server can deny access before credentials are fully submitted
sspi crate for CredSSP implementation. See ironrdp-connector/src/credssp.rs.
Protocol Phases
RDP connection establishment follows a strict sequence:// ironrdp-connector/src/connection.rs:270-279
let connection_request = nego::ConnectionRequest {
nego_data: self.config.request_data.clone().or_else(|| {
self.config.credentials.username()
.map(|username| nego::NegoRequestData::cookie(username.to_owned()))
}),
flags: nego::RequestFlags::empty(),
protocol: security_protocol,
};
Client and server exchange GCC (Global Conference Control) blocks via MCS Connect-Initial and Connect-Response PDUs:
Each static channel is joined using MCS Channel Join Request/Confirm. The server may skip this step if it advertises
SKIP_CHANNELJOIN_SUPPORTED.PDU Structure
All RDP PDUs follow this basic structure:ironrdp-core for core encoding primitives.
Configuration Example
References
- [MS-RDPBCGR]: Remote Desktop Protocol: Basic Connectivity and Graphics Remoting
- [MS-RDPELE]: Remote Desktop Protocol: Licensing Extension
- [MS-CSSP]: Credential Security Support Provider Protocol
- IronRDP Architecture:
ARCHITECTURE.mdin the source repository
IronRDP enforces strict architectural invariants: core tier crates (including
ironrdp-pdu, ironrdp-connector, ironrdp-session) never perform I/O, remain no_std-compatible, and avoid platform-specific code.
