Default LSPs in WM 5.0 [autobind_lsp].


The following description of the autobind_lsp is copied  from
http://www.intrinsyc.com/whitepapers/RIL_whitepaper_MS_Intrinsyc_June2004.pdf"

When an application makes a Connection Manager connection request, Connection Manager determines which IP interface the application should use to reach the destination network requested.  Connection manager passes this information to the AutoBind LSP.  If the application does not explicitly bind its sockets to an interface, then the AutoBind LSP will implicitly bind the sockets to the interface specified by Connection Manager, ensuring that the packets sent over the socket will take the correct route to reach the intended destination.

autobind_LSP effects the following winsock calls:

def WSPConnect(addr):
if not alreadyBound() and not isLoopback(addr):
doHardBindIfRequired()

let_connect_call_passthrough_to(addr)


def WSPBind(addr):
if not alreadyBound():
doHardBindIfRequired()

let_bind_call_passthrough_to(addr)


def WSPRecvFrom(addr):
if not alreadyBound():
doHardBindIfRequired()

let_recvFrom_call_passthrough_to(addr)

def WSPSendTo(addr):
if not alreadyBound():
doHardBindIfRequired()

let_sendTo_call_passthrough_to(addr)

def
doHardBindIfRequired():
interfaceToBindTo = ConnectionManager::GetInterfaceToBindTo(GetProcessID())
if (interfaceToBindTo)
TCPStack::ForceHardBind(interfaceToBindTo)
alreadyBound = True

[Author: Igor Dvorkin]

Comments (5)

  1. HP Briegel says:

    Thanks for good information. I have found this very helpful. I have one additional question. How do you tell the connection manager which interface to use? We want it to bind to our ethernet NIC, but when I enable the built WiFi NIC on the device I am testing on (a QTEK9100) it will always use that regardless that our NIC reports a much higher bandwidth. Are there registry entries that are needed? If Yes, do you know where those are documented?

    Thanks in advance,

    HP

  2. iping says:

    Hi Igor,

    From MS document, it states "It is still possible for applications to override this behavior by explicitly binding sockets to the desired interface before connecting. In this way it is possible for a single application to have open sockets on multiple IP interfaces.", so an application can perform binding to an interface on its own, and to avoid AutoBind’s hard binding.

    My question is, how does an application perform bind to an interface so that the AutoBind knows a socket has been hard binded to an interface? I tried use bind(..) API, to bind to an WIFI’s IP while the device is dual-home for both WIFI and DTPT. But then,  it will fail to connect to a remote site via the WIFI interface. I also tried to use WSAIoctl(.., SIO_UCAST_IF, ..) followed by bind(..). But it still wouldn’t work under dual-homing.

    Thanks in advance,

    iping

  3. cenet says:

    > How do you tell the connection manager which interface to use?

    An application tells Connection Manager (CM) which interface it wants to use implicitly by choosing the destination network it requires.  In a case where more than one connection points to the same destination network, CM will choose the most optimal connection.  In Windows Mobile 5, if an app wants to override CM’s choice, it can select the connection explicitly using ConnMgrMapConRef() API.

    > how does an application perform bind to an interface so that the AutoBind knows a socket has been hard binded to an interface?

    An application can use the explicit bind() call to bind its sockets to any IP interface available on device.  Note that this assumes that the interface is available, ex. connected by CM for another application.  Note also that if explicit bind() is used, CM will not be aware of the interface used by the application — this may result in the interface being disconnected before the application is finished using it.

    > bind to an WIFI’s IP while the device is dual-home for both WIFI and DTPT.

    Multi-homing with DTPT, i.e. having DTPT and another connected connection such as WiFi, GPRS, etc., is not supported in Windows Mobile 5 due to possible security threats.

    Adam Dyba

  4. aniketk says:

    I am trying to build a connection manager kind of fucntionality in WinCE. For that I need knowledge on autobind LSP. How does it really do the hardbinding. Any detail explanation other than what is given above? If connection manager is not present then how canwe do it?

  5. cenet says:

    Hardbinding a socket to a particular interface entails first finding an IP address on the chosen interface using iphlpapi, then calling bind() specifying that IP address, and finally calling ioctlsocket(SIO_UCAST_IF).

Skip to main content