Why sometime port number required for SQL Server Instance connectivity?



Situation:

Sometime as a Database administrator, we come across a problem with the SQL Server instance connectivity. Application team has reported a problem that they are unable to connect to the newly deployed SQL Server sever from their web application server. In this scenario, the application web server sits in the DMZ zone and SQL Server is residing in transit zone.  SQL server instance port number (other than default port 1433) is opened on the fireball to allow this communication. However, still application team is getting the connectivity issues.


Solution:

When we install a SQL Server instance then SQL Server Browser service is also get installed as part of the installation. If server has only default instance then browser service would remain in the disabled state. However, for named instance, it plays a significant role while connecting to the SQL Server instance.

Browser service always listen on the UDP port 1434. When client requested to make connection with named instance then its provide the correct port number to the requesting application. For instance, if client has requested to make a connection with Server\SQLNamedInstnace then browser service replies to the client application through UDP port 1434 with the correct TCP/IP port number that the application is intended to connect with. The TCP port number could either be dynamic or static depending upon the infrastructure requirements. The browser service detect all the running NAMED SQL instances and bypass the DEFAULT instance. When client application send a request to connect with the default instance then browser service does not respond to the request. However, service only respond for the named instance connection.

As mentioned earlier, SQL server instance port is opened on the firewall that allows communication between the client application and SQL server instance. At the sametime,it is mandatory to open the UDP port 1434 on firewall as well, to allow browser service to respond to the application request with the correct instance port number. If UDP port is NOT open on the firewall then, client application MUST have to specify the SQL instance port number while connecting to the instance like Server\SQLNamesInstance,1185 else client application will get the below error:


"A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. "

We can use Windows Telnet command to test if a client application is able to communicate with the specific SQL port. Run below command from command prompt window :

> Telnet  <SQL Server IP>  <SQL Port number>

it should show us a blank screen attached below:



However if there is an error then error cmd window looks like this:














Regards,
Ashish

Comments

Popular posts from this blog

Property Size is not available for Database '[tempdb]'

Split backup files for faster SQL Backups

Resolve SQL Server I/O bottleneck issues