The SQL Server Resolution Protocol is a simple UDP-based application-layer protocol for discovering SQL Server database instances and retrieving their network connection endpoints. The protocol operates over UDP port 1434 and supports both unicast and broadcast/multicast communication patterns.
- Protocol: UDP (RFC 768)
- Port: 1434
- Addressing: Supports IPv4 unicast/broadcast and IPv6 unicast/multicast
- Security: No authentication, encryption, or reliability mechanisms
All integer fields use little-endian byte order. Text strings use multibyte character set (MBCS) encoding based on the system code page. String matching is case-insensitive.
| Message Type | Byte Value | Structure | Purpose |
|---|---|---|---|
| CLNT_BCAST_EX | 0x02 | Single byte | Broadcast/multicast request for all instances on network |
| CLNT_UCAST_EX | 0x03 | Single byte | Unicast request for all instances on specific machine |
| CLNT_UCAST_INST | 0x04 | Byte + instance name + null | Request for specific named instance |
| CLNT_UCAST_DAC | 0x0F | Byte + 0x01 + instance name + null | Request for dedicated administrator connection port |
CLNT_UCAST_INST structure: [0x04][InstanceName\0]
- Instance name must be null-terminated MBCS string
- Maximum 32 bytes excluding null terminator
CLNT_UCAST_DAC structure: [0x0F][0x01][InstanceName\0]
- Protocol version byte is always 0x01
- Instance name must be null-terminated MBCS string
- Maximum 32 bytes excluding null terminator
SVR_RESP structure: [0x05][RESP_SIZE:2][RESP_DATA:variable]
- SVR_RESP: Single byte with value 0x05
- RESP_SIZE: 2-byte unsigned integer (little-endian) indicating RESP_DATA length in bytes
- RESP_DATA: Variable-length MBCS string containing response information
Size limits:
- CLNT_UCAST_INST responses: Maximum 1,024 bytes
- CLNT_BCAST_EX and CLNT_UCAST_EX responses: Maximum 65,535 bytes
- Per-instance information should not exceed 1,024 bytes
SVR_RESP (DAC) structure: [0x05][0x0006][0x01][TCP_PORT:2]
- RESP_SIZE: Always 0x0006 (6 bytes total response)
- Protocol version: Single byte 0x01
- TCP_PORT: 2-byte port number for dedicated administrator connection
Response data is a semicolon-delimited string with key-value pairs. Multiple instances are separated by double semicolons ;;.
Basic instance information:
ServerName;<name>;InstanceName;<name>;IsClustered;<Yes|No>;Version;<version>;
Protocol information (one or more may be present):
- TCP:
tcp;<port>; - Named Pipes:
np;<pipe_path>; - VIA:
via;<netbios>,<nic>:<port>,...; - RPC:
rpc;<computer_name>; - SPX:
spx;<service_name>; - ADSP:
adsp;<object_name>; - Banyan VINES:
bv;<item>;<group>;<item>;<group>;<org>;
Field specifications:
- ServerName: Machine name, maximum 255 bytes
- InstanceName: Instance name, maximum 255 bytes (recommended ?16 characters)
- IsClustered: Literal string "Yes" or "No"
- Version: Dotted decimal format (e.g., "15.0.2000.5"), maximum 16 bytes, must contain only digits and periods
- TCP port: Decimal port number as string
- Pipe name: Named pipe path (e.g.,
\\SERVERNAME\pipe\MSSQL$INSTANCE\sql\query)
Each instance entry is terminated with double semicolons ;;. Protocol information tokens may appear in any order but must not be duplicated within a single instance entry.
-
Request transmission:
- Create UDP socket bound to ephemeral port
- Send appropriate request message to server port 1434
- Start timeout timer
-
Timeout values (recommended):
- CLNT_UCAST_INST and CLNT_UCAST_DAC: 1 second
- CLNT_UCAST_EX and CLNT_BCAST_EX: Implementation-defined (typically 0.5-5 seconds)
-
Response handling:
- For unicast instance/DAC requests: Accept first valid response or timeout
- For broadcast/multicast requests: Collect all responses until timeout
- Ignore invalid or malformed responses
- Validate response format before passing to higher layer
-
Response validation:
- Verify SVR_RESP byte is 0x05
- Check RESP_SIZE matches actual payload length
- Parse RESP_DATA according to request type
- Reject responses where protocol parameter lengths exceed 255 bytes
-
Listening: Bind UDP socket to port 1434 and listen for incoming requests
-
Request processing:
- CLNT_BCAST_EX / CLNT_UCAST_EX: Return information for all available instances
- CLNT_UCAST_INST: Return information for specified instance only
- CLNT_UCAST_DAC: Return DAC port for specified instance
- Invalid/unknown requests: Silently ignore (no response)
-
Response construction:
- Include protocol information only if valid and within size limits
- If adding protocol info would exceed 1,024 bytes per instance, omit it
- Prefer including complete protocol information over partial data
- Return IPv4 endpoints for IPv4 requests, IPv6 endpoints for IPv6 requests
-
Error handling:
- If requested instance doesn't exist: No response
- If no valid endpoint information available: No response
- Invalid request format: Silently ignore
Single instance with TCP:
ServerName;MYSERVER;InstanceName;SQLEXPRESS;IsClustered;No;Version;15.0.2000.5;tcp;1433;;
Multiple instances:
ServerName;SRV1;InstanceName;INST1;IsClustered;No;Version;15.0.2000.5;tcp;1433;;ServerName;SRV1;InstanceName;INST2;IsClustered;No;Version;16.0.1000.6;tcp;1434;np;\\SRV1\pipe\MSSQL$INST2\sql\query;;
- Split response data by double semicolons
;;to separate instances - For each instance, split by single semicolon
;to get tokens - Process tokens in pairs as key-value
- Recognize protocol keywords:
tcp,np,via,rpc,spx,adsp,bv - Build map of instance attributes and available connection protocols
- Stateless: Single request-response exchange, no connection state
- Idempotent: Requests can be repeated without side effects
- Best-effort: UDP provides no delivery guarantees
- Unsecured: No authentication or encryption; suitable for trusted networks only
- Non-deterministic: Broadcast/multicast responses may vary based on network conditions and timing