[MC-SMP]:
Session Multiplex Protocol

Intellectual Property Rights Notice for Open Specifications Documentation

§  Technical Documentation. Microsoft publishes Open Specifications documentation for protocols, file formats, languages, standards as well as overviews of the interaction among each of these technologies.

§  Copyrights. This documentation is covered by Microsoft copyrights. Regardless of any other terms that are contained in the terms of use for the Microsoft website that hosts this documentation, you may make copies of it in order to develop implementations of the technologies described in the Open Specifications and may distribute portions of it in your implementations using these technologies or your documentation as necessary to properly document the implementation. You may also distribute in your implementation, with or without modification, any schema, IDL’s, or code samples that are included in the documentation. This permission also applies to any documents that are referenced in the Open Specifications.

§  No Trade Secrets. Microsoft does not claim any trade secret rights in this documentation.

§  Patents. Microsoft has patents that may cover your implementations of the technologies described in the Open Specifications. Neither this notice nor Microsoft's delivery of the documentation grants any licenses under those or any other Microsoft patents. However, a given Open Specification may be covered by Microsoft Open Specification Promise or the Community Promise. If you would prefer a written license, or if the technologies described in the Open Specifications are not covered by the Open Specifications Promise or Community Promise, as applicable, patent licenses are available by contacting .

§  Trademarks. The names of companies and products contained in this documentation may be covered by trademarks or similar intellectual property rights. This notice does not grant any licenses under those rights. For a list of Microsoft trademarks, visit www.microsoft.com/trademarks.

§  Fictitious Names. The example companies, organizations, products, domain names, email addresses, logos, people, places, and events depicted in this documentation are fictitious. No association with any real company, organization, product, domain name, email address, logo, person, place, or event is intended or should be inferred.

Reservation of Rights. All other rights are reserved, and this notice does not grant any rights other than specifically described above, whether by implication, estoppel, or otherwise.

Tools. The Open Specifications do not require the use of Microsoft programming tools or programming environments in order for you to develop an implementation. If you have access to Microsoft programming tools and environments you are free to take advantage of them. Certain Open Specifications are intended for use in conjunction with publicly available standard specifications and network programming art, and assumes that the reader either is familiar with the aforementioned material or has immediate access to it.

Revision Summary

Date / Revision History / Revision Class / Comments /
08/10/2007 / 0.1 / Major / Initial Availability
09/28/2007 / 0.2 / Minor / Updated the technical content.
10/23/2007 / 0.2.1 / Editorial / Revised and edited the technical content.
11/30/2007 / 0.2.2 / Editorial / Revised and edited the technical content.
01/25/2008 / 0.2.3 / Editorial / Revised and edited the technical content.
03/14/2008 / 0.2.4 / Editorial / Revised and edited the technical content.
05/16/2008 / 0.2.5 / Editorial / Revised and edited the technical content.
06/20/2008 / 0.3 / Minor / Updated the technical content.
07/25/2008 / 0.3.1 / Editorial / Revised and edited the technical content.
08/29/2008 / 1.0 / Major / Updated and revised the technical content.
10/24/2008 / 1.0.1 / Editorial / Revised and edited the technical content.
01/16/2009 / 1.0.2 / Editorial / Revised and edited the technical content.
02/27/2009 / 1.0.3 / Editorial / Revised and edited the technical content.
04/10/2009 / 1.0.4 / Editorial / Revised and edited the technical content.
05/22/2009 / 2.0 / Major / Updated and revised the technical content.
07/02/2009 / 2.0.1 / Editorial / Revised and edited the technical content.
08/14/2009 / 2.0.2 / Editorial / Revised and edited the technical content.
09/25/2009 / 2.1 / Minor / Updated the technical content.
11/06/2009 / 3.0 / Major / Updated and revised the technical content.
12/18/2009 / 3.0.1 / Editorial / Revised and edited the technical content.
01/29/2010 / 3.1 / Minor / Updated the technical content.
03/12/2010 / 4.0 / Major / Updated and revised the technical content.
04/23/2010 / 5.0 / Major / Updated and revised the technical content.
06/04/2010 / 5.0.1 / Editorial / Revised and edited the technical content.
07/16/2010 / 5.0.1 / No change / No changes to the meaning, language, or formatting of the technical content.
08/27/2010 / 5.0.1 / No change / No changes to the meaning, language, or formatting of the technical content.
10/08/2010 / 6.0 / Major / Significantly changed the technical content.
11/19/2010 / 7.0 / Major / Significantly changed the technical content.
01/07/2011 / 8.0 / Major / Significantly changed the technical content.
02/11/2011 / 8.0 / No change / No changes to the meaning, language, or formatting of the technical content.
03/25/2011 / 8.0 / No change / No changes to the meaning, language, or formatting of the technical content.
05/06/2011 / 9.0 / Major / Significantly changed the technical content.
06/17/2011 / 9.1 / Minor / Clarified the meaning of the technical content.
09/23/2011 / 9.2 / Minor / Clarified the meaning of the technical content.
12/16/2011 / 10.0 / Major / Significantly changed the technical content.
03/30/2012 / 10.0 / No change / No changes to the meaning, language, or formatting of the technical content.
07/12/2012 / 10.0 / No change / No changes to the meaning, language, or formatting of the technical content.
10/25/2012 / 10.0 / No change / No changes to the meaning, language, or formatting of the technical content.
01/31/2013 / 10.0 / No change / No changes to the meaning, language, or formatting of the technical content.
08/08/2013 / 11.0 / Major / Significantly changed the technical content.
11/14/2013 / 11.0 / No change / No changes to the meaning, language, or formatting of the technical content.
02/13/2014 / 12.0 / Major / Significantly changed the technical content.

2/2

[MC-SMP] — v20140124

Session Multiplex Protocol

Copyright © 2014 Microsoft Corporation.

Release: Thursday, February 13, 2014

Contents

1 Introduction 6

1.1 Glossary 6

1.2 References 7

1.2.1 Normative References 7

1.2.2 Informative References 7

1.3 Overview 7

1.4 Relationship to Other Protocols 9

1.5 Prerequisites/Preconditions 9

1.6 Applicability Statement 9

1.7 Versioning and Capability Negotiation 9

1.8 Vendor-Extensible Fields 10

1.9 Standards Assignments 10

2 Messages 11

2.1 Transport 11

2.2 Message Syntax 11

2.2.1 Header 11

2.2.1.1 Control Flags 12

2.2.2 SYN Packet 12

2.2.3 ACK Packet 13

2.2.4 FIN Packet 13

2.2.5 DATA Packet 14

3 Protocol Details 16

3.1 Common Details 16

3.1.1 Abstract Data Model 16

3.1.1.1 Session-Specific Structures 16

3.1.1.2 Session States 17

3.1.2 Timers 17

3.1.3 Initialization 17

3.1.3.1 Session-Specific Structure 17

3.1.4 Higher-Layer Triggered Events 18

3.1.4.1 Initialize by Higher Layer 18

3.1.4.2 Read by Higher Layer 18

3.1.4.3 Higher Layer Initiates Sending of Data 18

3.1.4.4 Close by Higher Layer 19

3.1.4.5 Shutdown by Higher Layer 19

3.1.5 Message Processing Events and Sequencing Rules 19

3.1.5.1 Receiving a Packet 19

3.1.5.1.1 Receiving a DATA Packet 20

3.1.5.1.2 Receiving an ACK Packet 20

3.1.5.1.3 Receiving a FIN Packet 20

3.1.5.2 Flow Control Algorithm 21

3.1.5.2.1 Session Variable Relationships for the Sender 21

3.1.5.2.2 Session Variable Relationships for the Receiver 21

3.1.5.2.3 Update Sender's HighWaterForSend Variable Using an ACK Packet 22

3.1.6 Timer Events 22

3.1.7 Other Local Events 22

3.2 Server Details 22

3.2.1 Initialization 23

3.2.2 Higher-Layer Triggered Events 23

3.2.2.1 Initialize by Higher Layer 23

3.2.3 Session States 24

3.2.4 Processing Events and Sequencing Rules 24

3.2.4.1 Receiving a SYN Packet 24

3.3 Client Details 24

3.3.1 Initialization 25

3.3.2 Higher-Layer Triggered Events 25

3.3.2.1 Initialize by Higher Layer 25

3.3.2.2 Open by Higher Layer 25

3.3.3 Processing Events and Sequencing Rules 26

3.3.3.1 Receiving a SYN Packet 26

4 Protocol Examples 27

4.1 Opening a Session 27

4.2 Update Window - ACK 27

4.3 First Command in a Session 28

4.4 Closing a Session 28

5 Security 30

5.1 Security Considerations for Implementers 30

5.2 Index of Security Parameters 30

6 Appendix A: Product Behavior 31

7 Change Tracking 32

8 Index 34

2/2

[MC-SMP] — v20140124

Session Multiplex Protocol

Copyright © 2014 Microsoft Corporation.

Release: Thursday, February 13, 2014

1 Introduction

The Session Multiplex Protocol (SMP) is an application-layer protocol that provides session management capabilities between a database client and a database server. Specifically, SMP enables multiple logical client connections to a single server over a lower-layer transport connection.

Sections 1.8, 2, and 3 of this specification are normative and can contain the terms MAY, SHOULD, MUST, MUST NOT, and SHOULD NOT as defined in RFC 2119. Sections 1.5 and 1.9 are also normative but cannot contain those terms. All other sections and examples in this specification are informative.

1.1 Glossary

The following terms are defined in [MS-GLOS]:

client
little-endian
server
session

The following terms are specific to this document:

Multiple Active Result Sets (MARS): A feature in SQLServer that allows applications to have more than one pending request per connection. For more information, see [MSDN-MARS].

peer: The entity on either end of an established SMP session.

receiver: The entity that is receiving information from its peer. Both client and server can be receivers.

recycle: A process where SMP releases a Session object, such that the session identifier (SID) in use is made available again for a new session.

sender: The entity that is sending information to its peer. Both client and server can be senders.

session identifier (SID): A unique value provided by the SID field of a SYN packet to each session established over an SMP connection.

Session object: An instance of SMP created by a SYN packet, which corresponds to the SESSION ESTABLISHED state (section 3.1) and is designated by a unique session identifier (SID).

Session variable: Members of a Session object instance, which contain data to facilitate various SMP operations, such as messaging, event processing, and packet flow control.

Tabular Data Stream (TDS): An application-level protocol that is used by SQLServer to facilitate requests and responses between a database server and client as specified in [MS-TDS].

Virtual Interface Architecture (VIA): A high-speed interconnect requiring special hardware and drivers provided by third parties, as specified in [VIA].

window: The number of SMP DATA packets that can be sent in the current sender state, per the SMP flow control algorithm that facilitates fairness among SMP sessions. This value is recalculated whenever a packet is sent or received.

MAY, SHOULD, MUST, SHOULD NOT, MUST NOT: These terms (in all caps) are used as described in [RFC2119]. All statements of optional behavior use either MAY, SHOULD, or SHOULD NOT.

1.2 References

References to Microsoft Open Specifications documentation do not include a publishing year because links are to the latest version of the documents, which are updated frequently. References to other documents include a publishing year when one is available.

A reference marked "(Archived)" means that the reference document was either retired and is no longer being maintained or was replaced with a new document that provides current implementation details. We archive our documents online [Windows Protocol].

1.2.1 Normative References

We conduct frequent surveys of the normative references to assure their continued availability. If you have any issue with finding a normative reference, please contact . We will assist you in finding the relevant information.

[MS-DTYP] Microsoft Corporation, "Windows Data Types".

[RFC793] Postel, J., "Transmission Control Protocol", STD 7, RFC 793, September 1981, http://www.ietf.org/rfc/rfc0793.txt

[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997, http://www.rfc-editor.org/rfc/rfc2119.txt

[RFC2246] Dierks, T., and Allen, C., "The TLS Protocol Version 1.0", RFC 2246, January 1999, http://www.ietf.org/rfc/rfc2246.txt

[SSL3] Netscape, "SSL 3.0 Specification", http://tools.ietf.org/html/draft-ietf-tls-ssl-version3-00

1.2.2 Informative References

[MS-GLOS] Microsoft Corporation, "Windows Protocols Master Glossary".

[MSDN-MARS] Microsoft Corporation, "Multiple Active Result Sets (MARS) in SQL Server 2005", http://msdn.microsoft.com/en-us/library/ms345109.aspx

[MS-TDS] Microsoft Corporation, "Tabular Data Stream Protocol".

[PIPE] Microsoft Corporation, "Named Pipes", http://msdn.microsoft.com/en-us/library/aa365590.aspx

[VIA] Intel Corporation, "Intel Virtual Interface (VI) Architecture Developer's Guide", September 1998, http://www.t10.org/ftp/t11/document.07/07-159v0.pdf

1.3 Overview

Session Multiplex Protocol (SMP) is an application protocol that facilitates session management by providing a mechanism to create multiple lightweight communication channels (sessions) over a lower-layer transport connection. SMP does this by multiplexing data streams from different sessions on top of a single reliable stream-oriented transport.

SMP is beneficial in situations where database connections from the client and server are synchronous. In this context, "synchronous" means that the client application can only have one outstanding command or transaction per connection. Rather than incur the expense of creating multiple connections to the server, SMP is capable of simultaneously executing multiple database queries over a single connection.

SMP provides the following:

§ The ability to interleave data from several different sessions and preserve message boundaries.

§ A sliding window-based flow-control mechanism to facilitate fairness among sessions.

NoteSMP is defined as a transport-independent mechanism. It relies on an underlying transport mechanism such as Transmission Control Protocol (TCP), as specified in [RFC793], to ensure byte alignment, loss detection and recovery, and reliable in-order delivery. The scheduling algorithm that enforces fairness between sessions is an implementation issue for the application that implements SMP.

The following diagram shows typical SMP communication flow for an arbitrary session.

Figure 1: Example of a communication flow in SMP

1.4 Relationship to Other Protocols