AutoBind LSP
A version of this page is also available for
4/8/2010
The AutoBind LSP is a WinSock Layered Service Provider (LSP). When an application makes a Connection Manager connection request, Connection Manager determines what IP interface the application should use to reach the destination network that has been requested. Connection manager passes this information along with the process ID to the AutoBind LSP.
If the application does not explicitly bind its sockets to an interface, the AutoBind LSP will implicitly bind the sockets to the interface that is specified by Connection Manager, ensuring that the packets that are sent over the socket will take the correct route to reach the intended destination.
It is still possible for applications to override this behavior. Applications can explicitly bind sockets to the desired interface before connecting through the sendto function for UDP connections or the connect (Windows Sockets) function for TCP. By not requesting the connection from Connection Manager, a single application can have open sockets on multiple IP interfaces.
Note
Although this method allows an application to make explicit bindings, it is not recommended that you use it. Because Connection Manager is not called, there is no guarantee that the IP interface is actually connected, or even if an IP interface is available, that it will not be disconnected at any time. In this situation, the application would not be notified, and it would be indeterminate what might happen if the application continued to send packets after that connection was suspended or disconnected. When the application is not calling ConnMgrEstablishConnection but instead explicitly binding sockets without going through Connection Manager, the socket can either be bound or be left unbound. If the socket is left unbound, it will allow the IP routing table to choose the "best" interface, provided that an interface is available.
Alternatively, calling bind (Windows Sockets) on a socket before calling ConnMgrEstablishConnection and before calling Winsock connect, should ensure that the socket uses the bound-to source IP address and, therefore, the selected IP interface to send and receive data.
Note
AutoBind LSP will bind only unbound sockets. It will not rebind sockets that were previously bound. AutoBind LSP will not work for applications that use WinInet because WinInet creates sockets internally.
See Also
Concepts
Multiple Transport Protocols
Desktop Passthrough LSP