RE: Why no internet when i configure NDIS mobile broadband changes ?

When you connect without your stuff added, what shows ipconfig for this connection?
The DHCP thing looks suspicious, maybe your carrier provides the address in some other way.

– pa

Actually my application is VPN application , which bind all adapter and provide VPN service . So this is very non-specific and simply is related to IP networking . My application contain a filter driver , which bind all adapters . So this is working fine in Ethernet,Wifi .

But when i put Mobile broadband (it conain 2 interface RAS , NDIS ) . RAS (modem) interface is detecting fine . But when i changes the Mobile broadband interface NDIS , it will not reflect in my application . But when i add “ppip” in my filter INF file as

HKR, Ndi\Interfaces, FilterMediaTypes, , “nolower, ethernet, wan ,ppip”

this is detecting only when i change the IP address automatically , but this time there is no internet . This is the actual issue .

If the didn’t change IP address automatically , it is not detecting in my application but internet is there .

with out installing my application , the mobile broadband is working fine when i changes IP automatically and with out changes IP automatically .

How can i solve this ? any idea ?

i checked the IP , Sub Net , Gateway . all thing set . But there is no internet . I think the problem due to
Mobile broadband chnages in windows 7 .

I set some flags on Send and receive function of Miniport driver . What about

1 . OID_WWAN_CONNECT oid . is it required ?

any other changes for mobile broadband driver support .

Ethernet , Wifi is working fine , but the problems are on Mobile broad band adapter .

The actual things is ::

I have a application which has a miniport, filter driver . the existing filter media as Ethernet , Wifi , Bluetooth . So I need to add Mobile broadband support to this application, that is I need to add mobile broadband as filter media . So after binding this media type , i can detect this on my application interface list .

With the help of Microsoft document for the Mobile broadband changes on windows 7 , I undersatand NdisWirelesswan as Filter medium . So I add this filter media to the filter INF file and set this to filter attach function like this :

INF file : (added ppip here )
*************************************************
HKR, Ndi\Interfaces, UpperRange, , “noupper”
HKR, Ndi\Interfaces, LowerRange, , “nolower”
HKR, Ndi\Interfaces, FilterMediaTypes, , “ethernet, wan,ppip”
HKR, Ndi, FilterRunType, 0x00010001, 1
*********************************************************

And in filter attach function : ( added NdisMediumWirelessWan here )

****************************************
if ((AttachParameters->MiniportMediaType != NdisMedium802_3)
&& (AttachParameters->MiniportMediaType != NdisMediumWan)
&& (AttachParameters->MiniportMediaType != NdisMediumNative802_11)
&& (AttachParameters->MiniportMediaType != NdisMediumWirelessWan)
) {
status = NDIS_STATUS_INVALID_PARAMETER;
}
*****************************************

After that I am accessing IP address , Sub net mask , Gateway through Registry of the interface for adding this interface to my application (active device)
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces]

So if there is DHCP not disabled ( = 0 ) , I am trying to get this value ? IPAddress, SubnetMask, DefaultGateway ? from registry . If there is Dehcp enabled ( = 1) accessing , ? DhcpIPAddress, DhcpSubnetMask, DhcpDefaultGateway ? from registry .
So when I connect my broadband adapter , I can see that they are using DHCP = 0 . but I can?t see anything like IPAddress in that interface registry .
But when I change automatic IP , I can get this values . But that time internet is not working . Why ?
With out my application this is working fine . So is it anything misses for to get support of Mobile broadband adapter ? any one ? any idea about this issue ?

> So when I connect my broadband adapter , I can see that they are using DHCP = 0
but I can?t see anything like IPAddress in that interface registry

They may indeed use OID_WWAN_CONNECT, OID_WSWAN_PACKET_SERVICE and their friends. Do you see any OID_WWAN sent to your driver?

Thanks for your valuable suggestion .

yes i saw OID_WWAN_CONNECT, OID_WSWAN_PACKET_SERVICE to my Filter Status function . i don’t how to support this OID . I should handle this OID’s in Miniport or Filter ?

When i insert the dongle . Some OID_WWAN_CONNECT, OID_WSWAN_PACKET_SERVICE OID’s are coming to my Filter functions . I am not handle this OID in my miniport driver . Is this cause no internet when this adapter bind to my filter ?

> I am not handle this OID in my miniport driver

So do you pass it through?

Next, do you see OID_GEN_NETWORK_LAYER_ADDRESSES sent to you?

Nope i can’t see OID_GEN_NETWORK_LAYER_ADDRESSES .

when i print this OID : in my filter status function i can see :

OID_GEN_NETWORK_LAYER_ADDRESSES
NDIS_STATUS_WWAN_RADIO_STATE
NDIS_STATUS_WWAN_VENDOR_SPECIFIC

But i am not handle this in my filter status :

My question is Why i handle this ? I need only internet and bind this Wireless 3g adapter bind with my filter . Bind is success when i change IP automatically . now the problem is no internet when bind this adapter with my Filter .

Is it Internet issue related These OID handle ??

my filter status function is like :

VOID CFilter::Status(
IN PNDIS_STATUS_INDICATION StatusIndication
{
NdisFIndicateStatus(m_hFilter, StatusIndication);

if (StatusIndication->StatusCode == NDIS_STATUS_LINK_STATE)
{
if (StatusIndication->StatusBufferSize == NDIS_SIZEOF_LINK_STATE_REVISION_1)
{
PNDIS_LINK_STATE pNdisLinkState = (PNDIS_LINK_STATE) StatusIndication->StatusBuffer;
m_eNdisMediaConnectState = pNdisLinkState->MediaConnectState ;

if (m_eNdisMediaConnectState == MediaConnectStateConnected) {
if (!m_fPaused) {
m_pScheduler->ScheduleEvent(SCHEDULER_EVENT_ADD, “CFilter::Status(NDIS_STATUS_LINK_STATE): MediaConnectStateConnected:”);
}
}
else if (m_eNdisMediaConnectState == MediaConnectStateDisconnected) {
m_pScheduler->ScheduleEvent(SCHEDULER_EVENT_REMOVE, “CFilter::Status(NDIS_STATUS_LINK_STATE): MediaConnectStateDisconnected”);
} else {
m_pScheduler->ScheduleEvent(SCHEDULER_EVENT_REMOVE, “CFilter::Status(NDIS_STATUS_LINK_STATE): MediaConnectStateUnknown”);
}

else if (StatusIndication->StatusCode == NDIS_STATUS_WAN_LINE_UP) {

/*
some codes
* /
}

else if ( StatusIndication->StatusCode == NDIS_STATUS_WAN_LINE_DOWN)
{
/* some code /*
}

}

My question is how can i handle this WWAN related Status ? or should i handle or not ?
Why no Internet is when i bind my Filter ?? With out these OID why this is not working ? or any other things missing ?

> Why no Internet is when i bind my Filter ??

Most likely, because you do not pass some OIDs down, or indications up.

See the documentation for StatusHandler:
https://msdn.microsoft.com/en-us/library/windows/hardware/ff549973(v=vs.85).aspx

“A filter driver usually calls the NdisFIndicateStatus function at the end of its FilterStatus function to pass on the status indication to overlying drivers.”

Does your StatusHandler call NdisFIndicateStatus?

But other things could be missing too. Try to arrange code review with somebody who knows Mobile Broadband details.

Regards,
– pa

yes i am calling NdisFIndicateStatus inside the Status Function :

VOID CFilter::Status(
IN PNDIS_STATUS_INDICATION StatusIndication
) {

NdisFIndicateStatus(m_hFilter, StatusIndication);

if (StatusIndication->StatusCode == NDIS_STATUS_LINK_STATE) {
/*checking conditions*/

}

else if (StatusIndication->StatusCode == NDIS_STATUS_WAN_LINE_UP) {
/*checking conditions*/
}

else if (StatusIndication->StatusCode == NDIS_STATUS_WAN_LINE_DOWN) {
/*checking conditions*/
}

}

But it’ work on Ethernet , WIfi . I don’t know about Mobile broadband .

And some interesting thing i noticed about Mobile broadband is :

/*************************************

Filter driver (to bid different Filter medium ) and a miniport driver . In that application i have a active interface adapter list which shows whether the adapter is active or not .

The active is deciding using whether there is adapter is connecting , valid network configuration etc . using Addinterface () function inside Filter driver i am checking the adapter interface is active or not . I am fetching the IP address using DHCP condition .

If DHCP = 0 (No DHCP) then i am fetching the registry entry like :

char_t* IpAddressKey = L"IPAddress";
char_t* SubnetMaskKey = L"SubnetMask";
char_t* DefaultGatewayKey = L"DefaultGateway";

if DHCP = 1 (DHCP enabled ) then i am taking the values using :

IpAddressKey = L"DhcpIPAddress";
SubnetMaskKey = L"DhcpSubnetMask";
DefaultGatewayKey = L"DhcpDefaultGateway";

So in case of Ethernet , WiFi i got values in the registry fields . But when i connect mobile broadband NDIS type (Vodafone 3G dongle) , the dongle first time in static mode ( DHCP = 0 ) . means they are using TCP/IP configuration like

"use the following Ip address & use the following DNS server "

But i can’t see any values in that Fields of TCP/IP properties when i checked the mobile broadband 3G card Adapter . And also there is No IPAddress char_t* IpAddressKey = L"IPAddress"; filed in this registry "

L"\REGISTRY\Machine\SYSTEM\CurrentControlSet\Services\TcpIp\Parameters\In
terfaces\

So my application got error when i fetching this key and this Interface is not detecting in my application adapter interface page . Why ?

Then i change this adapter TCP/IP properties to :

obtain an IP address Automatically
obtain DNS server address Automatically

At that time i got DhcpIPaddrss in the registry Field . But there is no internet . So i think my Filter doing anything wrong ? But when i type Ipconfig in CMD . I can see that when i put obtain an IP address Automatically & obtain DNS server address Automatically , the driver fetching DhcpIPaddress and Local Ipconfig ip address are different . But in case of Ethernet and WIFI it’s working Fine for both static and Dynamic TCP/IP configuration . How to solve this error ? Should i assign the Local Ip address to regisrty ? How can i do this in Kernel mode . How can i do it in Filter Driver ?

Is this cause no internet Connectivity on Mobile broadband adapter ?

Sorry I’ve missed that you call NdisFIndicateStatus.

It is likely that the carrier provides the ip address and dns not via DHCP. Try to get its address from IP Helper API.

– pa

The application is specific to IP .because I am trying to create a VPN application . This is pretty works in Ethernet and Wi-Fi . I want to connect with mobile broadband . My filter driver is binding well . But after that I can’t get internet . After putting log I can see that I send function is working well in filter driver . But there is no receiving logs . So the receive function is not working . Why ? Why this is only for mobile broadband ? It’s using raw IP packet instead of Ethernet IP packet .

I done changes with respect to this document

https://msdn.microsoft.com/en-us/library/windows/hardware/ff559110(v=vs.85).aspx

why this is not receive any packet only for Mobile broadband ?? Any suggestions ??

Or, maybe, you need to implement some “optional” handler, as in this case:

http://tinyurl.com/jpn9q6y

i am already including these optional handlers in my driver . So attach and driver characteristics are included there . The binding is working well after i added “ppip” in filter INF file . But there is no packet is receiving in receive function .

as per the MB changes document they said like :

Net buffer list (NBL) flags for RAW IP packet processing

For IPv4 packets

The NblFlags member of the NET_BUFFER_LIST structure must be set to
NDIS_NBL_FLAGS_IS_IPV4.

The NetBufferListFrameType member of the NET_BUFFER_LIST structure must be set to 0x0800 (Ethertype IPv4) in network byte order.

For IPv6 packets:

The NblFlags member of NET_BUFFER_LIST structure must be set to NDIS_NBL_FLAGS_IS_IPV6.

The NetBufferListFrameType member of the NET_BUFFER_LIST structure must be set to 0x86dd (Ethertype IPv6) in network byte order.

Miniport drivers can use the NdisSetNblFlag macro to set flags in the net buffer list. The following line demonstrates how to set IPv4 packet flag in the net buffer list:

NdisSetNblFlag(pNbl, NDIS_NBL_FLAGS_IS_IPV4);

Miniport drivers can use the NET_BUFFER_LIST_INFO to get and set information in a net buffer list. The following line demonstrates how to modify the NetBufferListFrameType OOB in the network buffer list for IPV4 packets:

Value = ConvertToNetworkByteOrder(0x0800);

NET_BUFFER_LIST_INFO(pNbl, NetBufferListFrameType) = Value;

So the conclusion is like

Send Path Processing :

The MB Service will set these flags in the NBL before passing the list to the miniport driver to send across the network. The miniport driver can verify the flags in the input NBL.

Receive Path Processing :

Miniport drivers should set flags in the NBL before passing the NBL to the MB Service for received packets.

and in my miniport send & receive function i done like this ::

miniport send ( ) :

{

DbgPrintEx(DPFLTR_IHVNETWORK_ID, DPFLTR_ERROR_LEVEL, " MB service Sending Packeet to Miniport \n");

USHORT value;

value = (USHORT) NET_BUFFER_LIST_INFO(NetBufferLists, NetBufferListFrameType);

DbgPrintEx(DPFLTR_IHVNETWORK_ID, DPFLTR_ERROR_LEVEL, " MB service sending NetBufferListFrameType = %lu\n", value);

}

*************************************************************

and in miniport return ( ) function :

{

DbgPrintEx(DPFLTR_IHVNETWORK_ID, DPFLTR_ERROR_LEVEL, CMiniport::ReturnNetBufferLists():\n");

NdisSetNblFlag(NetBufferLists, NDIS_NBL_FLAGS_IS_IPV4);

PVOID Value = (PVOID)RtlUshortByteSwap(0x0800);

NET_BUFFER_LIST_INFO(NetBufferLists, NetBufferListFrameType) = Value;

}

But why there is no internet when i install my filter driver & miniport driver ?

Sorry. Am out of “abstract ideas” at this point. Hope you can find a local consultant to debug this hands-on (peek at ndis level, confirm that it actually works via raw ip, see all oids, indications etc that need to pass up and down). Sometimes just extra pair of eyes may help… or not.

Regards,
– pa

I am working on a similar problem with filter drivers, WIFI/MBB, and capturing the proper packets. Since this post was the closest one that I ran across (so far) I figured I would share my current understanding from basically “bumping around in the dark”…there is very little documentation on how to handle capturing packets (both inbound and outbound) using WFP (not LWF).
This is what I have found to be true about WFP callout filters, VPN connections, and WIFI/MBB type network interfaces:
—Only the FWPS_LAYER_OUTBOUND_MAC_FRAME_NATIVE and FWPS_LAYER_INBOUND_MAC_FRAME_NATIVE filter types will be able to capture both inbound and outbound packets during a secured VPN connection without having to deal with upper layer TCP IPSEC related issues (even the infamous FWPS_LAYER_OUTBOUND_MAC_FRAME_ETHERNET and FWPS_LAYER_INBOUND_MAC_FRAME_ETHERNET will get bypassed by the VPN connection).

—Additionally, WIFI/MBB devices seem to *completely bypass the FWPS_LAYER_OUTBOUND_MAC_FRAME_NATIVE and FWPS_LAYER_INBOUND_MAC_FRAME_NATIVE filter types. I am not quite sure why this was designed this way, but I think it has to do with WIFI/MBB devices using NWIFI.SYS? (anyone want to shed some light on this?)

So, if you are developing a WFP Callout Filter driver and plan on doing any form of packet inspection and/or manipulation with both a WIFI/MBB device during a secured VPN connection (tunneling through the device) then it would appear it is literally impossible (using only the WFP driver for packet modification/inspection) as VPN connections bypass everything above the MAC_FRAME_NATIVE filters up to the TCP IPSEC related filters and WIFI/MBB devices bypass the MAC_FRAME_NATIVE filter layers! doh

This brings me to two general questions (would love a response if you know the answers):

  1. If I were to port my WFP filter down to an NDIS LWF, would I see the exact same behavior (as described above) or would I be able to see the inbound and outbound frames prior to being sent to the WIFI/MBB device?
    If yes (same behavior as described above), then is there any other way to capture the 802.3 frames (not 802.11) prior to them being sent to the WIFI/MBB device that would not get bypassed by a secured VPN connection?

Any input on this would be greatly appreciated…
One would think that the WFP lower stack (i.e. MAC_NATIVE) would still show the 802.3 frames on WIFI/MBB devices…but then again I am not an expert in that area and as such it could just be “the way it is” (if so that would kind of suck for me).

Good job, Mr. NILC! Following-up a post that’s three years old.

No necroposting. Please. Is that really so much to ask? It’s not like this is a unique rules that we started in this forum.

Thread has been closed. Don’t necropost. Start a new thread.

Peter