OfirD
OfirD

Reputation: 10490

Relationship between SQL Server drivers and SQL Server Network Interface

Learning about SQL Server architecture, I got confused with the terminology and the relationships between client\server components. I hope that answers to several related questions would help me understand things better:

  1. As stated here, ADO.NET Server driver is a C# implementation of the TDS protocol. As explained here, using SqlConnection means using ADO.NET. Where, then, does the Server Network Interface (SNI) comes into play? Continuing the SqlConnection example: Is the SNI being established when calling new SqlConnection?
  2. This is what Wikipedia has to say about OLE DB in relation to ODBC:

OLE DB providers are analogous to ODBC drivers, JDBC drivers, and ADO.NET data providers.

And also:

An OLE DB-ODBC bridge consists of an OLE DB Provider which uses the services of an ODBC driver to connect to a target database. This provider translates OLE DB method calls into ODBC function calls.

I'm not sure why these are considered "analogous", but anyway: What is the role of the provider and/or the driver in establishing the SNI and transferring the TDS packet?

  1. Let's take SSMS as another example: What driver/provider does it use when connecting to SQL Server? Is there a TDS packet being transffered when establishing the connection?

Upvotes: 2

Views: 716

Answers (1)

Gani
Gani

Reputation: 46

This is my understanding of the SNI:

  1. The SNI replaces the net-libraries found in SQL server 2000 and the Microsoft Data Access Components (MDAC), which are included with Windows.
  2. SNI encapsulates the TDS packet inside a standard communication protocol such as TCP\IP or Named Pipes.
  3. On the client side, the SNI is implemented using the SQL Native CLient. However, Microsoft now recommends using alternatives like ODBC drivers instead of SQL Native Client as support for SQL Native Client would be discontinued for versions of SQL Server later than 2012.
  4. OLEDB driver and ADO driver are legacy and are going to be discontinued.
  5. So, from the client side, when the connection is established with the server, the SNI protocol layer (the protocol layer within the architecture of SQL Server), would ensure that the TDS packets are encapsulated within network packets.
  6. SQL Server listens to the TDS packets on the TSQL endpoints depending on the protocols being used. The server side implementation of the SNI protocol layer is where the Network packets are decapsulated back to TDS packets.
  7. Further, there are network libraries within the Database Engine which are going to retrieve the queries from the TDS packets.
  8. On the client side, the SNI is implemented by the drivers and facilitated by the SNI protocol layer on the server.

Upvotes: 3

Related Questions