The power of TDS technique for well test interpretation: a ...
MS-TDS Protocol and Test Suite - Microsoft · MS-TDS Protocol and Test Suite Introduction Baoming...
Transcript of MS-TDS Protocol and Test Suite - Microsoft · MS-TDS Protocol and Test Suite Introduction Baoming...
![Page 1: MS-TDS Protocol and Test Suite - Microsoft · MS-TDS Protocol and Test Suite Introduction Baoming Yu SQL OIPI Test Development Team. Agenda TDS Introduction Transport Layers Typical](https://reader030.fdocuments.in/reader030/viewer/2022040409/5ec59d37967bcd16002ad29d/html5/thumbnails/1.jpg)
![Page 2: MS-TDS Protocol and Test Suite - Microsoft · MS-TDS Protocol and Test Suite Introduction Baoming Yu SQL OIPI Test Development Team. Agenda TDS Introduction Transport Layers Typical](https://reader030.fdocuments.in/reader030/viewer/2022040409/5ec59d37967bcd16002ad29d/html5/thumbnails/2.jpg)
MS-TDS Protocol and Test Suite Introduction
Baoming Yu
SQL OIPI Test Development Team
![Page 3: MS-TDS Protocol and Test Suite - Microsoft · MS-TDS Protocol and Test Suite Introduction Baoming Yu SQL OIPI Test Development Team. Agenda TDS Introduction Transport Layers Typical](https://reader030.fdocuments.in/reader030/viewer/2022040409/5ec59d37967bcd16002ad29d/html5/thumbnails/3.jpg)
Agenda
TDS Introduction
Transport Layers
Typical Message Sequence
Typical Protocol Objects
Test Suite Overview
Test Suite Architecture
Resource
![Page 4: MS-TDS Protocol and Test Suite - Microsoft · MS-TDS Protocol and Test Suite Introduction Baoming Yu SQL OIPI Test Development Team. Agenda TDS Introduction Transport Layers Typical](https://reader030.fdocuments.in/reader030/viewer/2022040409/5ec59d37967bcd16002ad29d/html5/thumbnails/4.jpg)
What is TDS?The Tabular Data Stream (TDS) protocol is an application layer request/response protocol that facilitates interaction with a database server and provides for the following:
✓ Authentication and channel encryption negotiation.
✓ Specification of requests in SQL (including Bulk Insert).
✓ Invocation of a stored procedure or user-defined function,
also known as a remote procedure call (RPC).
✓ The return of data.
✓ Transaction manager requests.
![Page 5: MS-TDS Protocol and Test Suite - Microsoft · MS-TDS Protocol and Test Suite Introduction Baoming Yu SQL OIPI Test Development Team. Agenda TDS Introduction Transport Layers Typical](https://reader030.fdocuments.in/reader030/viewer/2022040409/5ec59d37967bcd16002ad29d/html5/thumbnails/5.jpg)
How does TDS work?
Disco
nn
ect
Time Line
* N
![Page 6: MS-TDS Protocol and Test Suite - Microsoft · MS-TDS Protocol and Test Suite Introduction Baoming Yu SQL OIPI Test Development Team. Agenda TDS Introduction Transport Layers Typical](https://reader030.fdocuments.in/reader030/viewer/2022040409/5ec59d37967bcd16002ad29d/html5/thumbnails/6.jpg)
Agenda
TDS Introduction
Transport Layers
Typical Message Sequence
Typical Protocol Objects
Test Suite Overview
Test Suite Architecture
Resource
![Page 7: MS-TDS Protocol and Test Suite - Microsoft · MS-TDS Protocol and Test Suite Introduction Baoming Yu SQL OIPI Test Development Team. Agenda TDS Introduction Transport Layers Typical](https://reader030.fdocuments.in/reader030/viewer/2022040409/5ec59d37967bcd16002ad29d/html5/thumbnails/7.jpg)
The TDS protocol does not prescribe a specific underlying transport protocol to use on the Internet or on other networks. TDS only presumes a reliable transport that guarantees in-sequence delivery of data.
Transport Layers
The chosen transport can be either stream-oriented or message-oriented. If a message-
oriented transport is used, any TDS packet sent from a TDS client to a TDS server MUST be
contained within a single transport data unit.
The current version of the TDS protocol has implementations over the following transports:
✓ TCP [RFC793].
✓ A reliable transport over the Virtual Interface Architecture (VIA) interface [VIA2002].
✓ Named Pipes [MSDN-NP].
✓ Shared memory [MSDN-TDSENDPT].
![Page 8: MS-TDS Protocol and Test Suite - Microsoft · MS-TDS Protocol and Test Suite Introduction Baoming Yu SQL OIPI Test Development Team. Agenda TDS Introduction Transport Layers Typical](https://reader030.fdocuments.in/reader030/viewer/2022040409/5ec59d37967bcd16002ad29d/html5/thumbnails/8.jpg)
Transport LayersTransport LayersOptionally, the TDS protocol has implementations for the following two protocols on top of the preceding transports:
✓ Transport Layer Security (TLS)
[RFC2246]/Secure Socket Layer (SSL), in
case TLS/SSL encryption is negotiated.
✓ Session Multiplex Protocol (SMP) [MC-
SMP], in case the Multiple Active Result
Sets (MARS) feature [MSDN-MARS] is
requested.
TDS
Network Transport(TCP/IP)
![Page 9: MS-TDS Protocol and Test Suite - Microsoft · MS-TDS Protocol and Test Suite Introduction Baoming Yu SQL OIPI Test Development Team. Agenda TDS Introduction Transport Layers Typical](https://reader030.fdocuments.in/reader030/viewer/2022040409/5ec59d37967bcd16002ad29d/html5/thumbnails/9.jpg)
Demo
FOR MARS
![Page 10: MS-TDS Protocol and Test Suite - Microsoft · MS-TDS Protocol and Test Suite Introduction Baoming Yu SQL OIPI Test Development Team. Agenda TDS Introduction Transport Layers Typical](https://reader030.fdocuments.in/reader030/viewer/2022040409/5ec59d37967bcd16002ad29d/html5/thumbnails/10.jpg)
Agenda
TDS Introduction
Transport Layers
Typical Message Sequence
Typical Protocol Objects
Test Suite Overview
Test Suite Architecture
Resource
![Page 11: MS-TDS Protocol and Test Suite - Microsoft · MS-TDS Protocol and Test Suite Introduction Baoming Yu SQL OIPI Test Development Team. Agenda TDS Introduction Transport Layers Typical](https://reader030.fdocuments.in/reader030/viewer/2022040409/5ec59d37967bcd16002ad29d/html5/thumbnails/11.jpg)
Disco
nn
ect
* N
![Page 12: MS-TDS Protocol and Test Suite - Microsoft · MS-TDS Protocol and Test Suite Introduction Baoming Yu SQL OIPI Test Development Team. Agenda TDS Introduction Transport Layers Typical](https://reader030.fdocuments.in/reader030/viewer/2022040409/5ec59d37967bcd16002ad29d/html5/thumbnails/12.jpg)
TLS
/SSL
Tra
nsp
ort
Lay
er T
LS/S
SL T
ransp
ort Laye
r
Typical Message Sequence (Pre-login)
Created connection successfully (Pre-login state)
Initial Pre-Login Request with ENCRYPTION_ON
Initial Pre-Login Response with ENCRYPTION_ON
Login state
TLS Exchange 1 Request
TLS Exchange 1 Response
TLS Exchange 2 Request
TLS Exchange 2 Response
![Page 13: MS-TDS Protocol and Test Suite - Microsoft · MS-TDS Protocol and Test Suite Introduction Baoming Yu SQL OIPI Test Development Team. Agenda TDS Introduction Transport Layers Typical](https://reader030.fdocuments.in/reader030/viewer/2022040409/5ec59d37967bcd16002ad29d/html5/thumbnails/13.jpg)
TLS Handshakes
• Client Hello
• Client Key Exchange• Change Cipher Spec• Client Finished Message• …
• Server Hello• Server Certificate• Server Hello Done• …
• Change Cipher Spec• Server Finished Message
![Page 14: MS-TDS Protocol and Test Suite - Microsoft · MS-TDS Protocol and Test Suite Introduction Baoming Yu SQL OIPI Test Development Team. Agenda TDS Introduction Transport Layers Typical](https://reader030.fdocuments.in/reader030/viewer/2022040409/5ec59d37967bcd16002ad29d/html5/thumbnails/14.jpg)
Typical Message Sequence (Login State)
Created connection successfully (Pre-login state)
Login7 Request with SPNEGO Exchange 1
SPNEGO Exchange 1 Response
SPNEGO Exchange 2 Request
Login7 Response (LOGINACK)
Post-Login Success State
![Page 15: MS-TDS Protocol and Test Suite - Microsoft · MS-TDS Protocol and Test Suite Introduction Baoming Yu SQL OIPI Test Development Team. Agenda TDS Introduction Transport Layers Typical](https://reader030.fdocuments.in/reader030/viewer/2022040409/5ec59d37967bcd16002ad29d/html5/thumbnails/15.jpg)
Disco
nn
ect
* N
![Page 16: MS-TDS Protocol and Test Suite - Microsoft · MS-TDS Protocol and Test Suite Introduction Baoming Yu SQL OIPI Test Development Team. Agenda TDS Introduction Transport Layers Typical](https://reader030.fdocuments.in/reader030/viewer/2022040409/5ec59d37967bcd16002ad29d/html5/thumbnails/16.jpg)
Typical Message Sequence (Post-Login Success)
Post-Login Success State
(Server is now ready to accept command from client)
SQL Command Request
Table Response
SQL Command Request
Table Response with attention acknowledgement
Attention Request
Post-Login Success State
(Server is now ready to accept command from client)
![Page 17: MS-TDS Protocol and Test Suite - Microsoft · MS-TDS Protocol and Test Suite Introduction Baoming Yu SQL OIPI Test Development Team. Agenda TDS Introduction Transport Layers Typical](https://reader030.fdocuments.in/reader030/viewer/2022040409/5ec59d37967bcd16002ad29d/html5/thumbnails/17.jpg)
Typical Message Sequence (Post-Login Success)Post-Login Success State
(Server is now ready to accept command from client)
Remote Procedure Call Request
Table Response
Remote Procedure Call Request
Table Response with attention acknowledgement
Attention Request
Post-Login Success State
(Server is now ready to accept command from client)
![Page 18: MS-TDS Protocol and Test Suite - Microsoft · MS-TDS Protocol and Test Suite Introduction Baoming Yu SQL OIPI Test Development Team. Agenda TDS Introduction Transport Layers Typical](https://reader030.fdocuments.in/reader030/viewer/2022040409/5ec59d37967bcd16002ad29d/html5/thumbnails/18.jpg)
Typical Message Sequence (Post-Login Success)Post-Login Success State
(Server is now ready to accept command from client)
Transaction Manager Request
Table Response
Transaction Manager Request
Table Response with attention acknowledgement
Attention Request
Post-Login Success State
(Server is now ready to accept command from client)
![Page 19: MS-TDS Protocol and Test Suite - Microsoft · MS-TDS Protocol and Test Suite Introduction Baoming Yu SQL OIPI Test Development Team. Agenda TDS Introduction Transport Layers Typical](https://reader030.fdocuments.in/reader030/viewer/2022040409/5ec59d37967bcd16002ad29d/html5/thumbnails/19.jpg)
Typical Message Sequence (Post-Login Success)Post-Login Success State
(Server is now ready to accept command from client)
SQL Command with Insert Bulk
Table Response
SQL Command with Binary Data (Bulk Load Data)
Table Response
Post-Login Success State
(Server is now ready to accept command from client)
SQL Command with Insert Bulk
Table Response
SQL Command with Binary Data (Bulk Load Data)
Table Response with attention acknowledgement
Attention Request
![Page 20: MS-TDS Protocol and Test Suite - Microsoft · MS-TDS Protocol and Test Suite Introduction Baoming Yu SQL OIPI Test Development Team. Agenda TDS Introduction Transport Layers Typical](https://reader030.fdocuments.in/reader030/viewer/2022040409/5ec59d37967bcd16002ad29d/html5/thumbnails/20.jpg)
Demo
FOR BULK INSERT
![Page 21: MS-TDS Protocol and Test Suite - Microsoft · MS-TDS Protocol and Test Suite Introduction Baoming Yu SQL OIPI Test Development Team. Agenda TDS Introduction Transport Layers Typical](https://reader030.fdocuments.in/reader030/viewer/2022040409/5ec59d37967bcd16002ad29d/html5/thumbnails/21.jpg)
Agenda
TDS Introduction
Transport Layers
Typical Message Sequence
Typical Protocol Objects
Test Suite Overview
Test Suite Architecture
Resource
![Page 22: MS-TDS Protocol and Test Suite - Microsoft · MS-TDS Protocol and Test Suite Introduction Baoming Yu SQL OIPI Test Development Team. Agenda TDS Introduction Transport Layers Typical](https://reader030.fdocuments.in/reader030/viewer/2022040409/5ec59d37967bcd16002ad29d/html5/thumbnails/22.jpg)
Typical Protocol Objects
LOGIN7: Defines the authentication rules for use between client and server.
• Packet Header type 0x10.• The length of a LOGIN7 stream
MUST NOT be longer than 128K-1(byte) bytes.
• …
![Page 23: MS-TDS Protocol and Test Suite - Microsoft · MS-TDS Protocol and Test Suite Introduction Baoming Yu SQL OIPI Test Development Team. Agenda TDS Introduction Transport Layers Typical](https://reader030.fdocuments.in/reader030/viewer/2022040409/5ec59d37967bcd16002ad29d/html5/thumbnails/23.jpg)
LOGINACK: Used to send a response to a login request (LOGIN7) to the client.
LOGINACK
The identifier of the stream LOGINACK
The total length of the stream LOGINACK
The interface type accepted by server
The TDS version used by server side
The server name
The server version number
Typical Protocol Objects
![Page 24: MS-TDS Protocol and Test Suite - Microsoft · MS-TDS Protocol and Test Suite Introduction Baoming Yu SQL OIPI Test Development Team. Agenda TDS Introduction Transport Layers Typical](https://reader030.fdocuments.in/reader030/viewer/2022040409/5ec59d37967bcd16002ad29d/html5/thumbnails/24.jpg)
Agenda
TDS Introduction
Transport Layers
Typical Message Sequence
Typical Protocol Objects
Test Suite Overview
Test Suite Architecture
Resource
![Page 25: MS-TDS Protocol and Test Suite - Microsoft · MS-TDS Protocol and Test Suite Introduction Baoming Yu SQL OIPI Test Development Team. Agenda TDS Introduction Transport Layers Typical](https://reader030.fdocuments.in/reader030/viewer/2022040409/5ec59d37967bcd16002ad29d/html5/thumbnails/25.jpg)
Test Suite Production Workflow
Test Suite(Simulates protocol client)
Requirement SpecificationOpen Specification
![Page 26: MS-TDS Protocol and Test Suite - Microsoft · MS-TDS Protocol and Test Suite Introduction Baoming Yu SQL OIPI Test Development Team. Agenda TDS Introduction Transport Layers Typical](https://reader030.fdocuments.in/reader030/viewer/2022040409/5ec59d37967bcd16002ad29d/html5/thumbnails/26.jpg)
Agenda
TDS Introduction
Transport Layers
Typical Message Sequence
Typical Protocol Objects
Test Suite Overview
Test Suite Architecture
Resource
![Page 27: MS-TDS Protocol and Test Suite - Microsoft · MS-TDS Protocol and Test Suite Introduction Baoming Yu SQL OIPI Test Development Team. Agenda TDS Introduction Transport Layers Typical](https://reader030.fdocuments.in/reader030/viewer/2022040409/5ec59d37967bcd16002ad29d/html5/thumbnails/27.jpg)
Test Suite Architecture
Test Case
Protocol Adapter
SUT Control Adapter
Transport Layer
Server
SUT
SQL Server
Client
![Page 28: MS-TDS Protocol and Test Suite - Microsoft · MS-TDS Protocol and Test Suite Introduction Baoming Yu SQL OIPI Test Development Team. Agenda TDS Introduction Transport Layers Typical](https://reader030.fdocuments.in/reader030/viewer/2022040409/5ec59d37967bcd16002ad29d/html5/thumbnails/28.jpg)
Test Suite Architecture
Test Case
Protocol Adapter
SUT Control Adapter
Transport Layer
Server
SUT
SQL Server
Client
![Page 29: MS-TDS Protocol and Test Suite - Microsoft · MS-TDS Protocol and Test Suite Introduction Baoming Yu SQL OIPI Test Development Team. Agenda TDS Introduction Transport Layers Typical](https://reader030.fdocuments.in/reader030/viewer/2022040409/5ec59d37967bcd16002ad29d/html5/thumbnails/29.jpg)
Agenda
TDS Introduction
Transport Layers
Typical Message Sequence
Typical Protocol Objects
Test Suite Overview
Test Suite Architecture
Resource
![Page 30: MS-TDS Protocol and Test Suite - Microsoft · MS-TDS Protocol and Test Suite Introduction Baoming Yu SQL OIPI Test Development Team. Agenda TDS Introduction Transport Layers Typical](https://reader030.fdocuments.in/reader030/viewer/2022040409/5ec59d37967bcd16002ad29d/html5/thumbnails/30.jpg)
Resource
MS-TDS Protocol:
https://docs.microsoft.com/en-us/openspecs/windows_protocols/MS-
TDS/b46a581a-39de-4745-b076-ec4dbb7d13ec
TLS/SSL Details:
https://docs.microsoft.com/en-us/previous-versions/windows/it-
pro/windows-server-2003/cc785811(v=ws.10)
Named Pipes:
https://docs.microsoft.com/en-us/windows/desktop/ipc/named-pipes
![Page 31: MS-TDS Protocol and Test Suite - Microsoft · MS-TDS Protocol and Test Suite Introduction Baoming Yu SQL OIPI Test Development Team. Agenda TDS Introduction Transport Layers Typical](https://reader030.fdocuments.in/reader030/viewer/2022040409/5ec59d37967bcd16002ad29d/html5/thumbnails/31.jpg)
![Page 32: MS-TDS Protocol and Test Suite - Microsoft · MS-TDS Protocol and Test Suite Introduction Baoming Yu SQL OIPI Test Development Team. Agenda TDS Introduction Transport Layers Typical](https://reader030.fdocuments.in/reader030/viewer/2022040409/5ec59d37967bcd16002ad29d/html5/thumbnails/32.jpg)