Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Before Posting...
Please check out the Community Guidelines in the Announcements and Administration Category.

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

Pavel_APavel_A Member Posts: 2,674
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

Comments

  • vinay_kpvinay_kp Member Posts: 182
    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 ?
  • vinay_kpvinay_kp Member Posts: 182
    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 .
  • vinay_kpvinay_kp Member Posts: 182
    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 ?
  • Pavel_APavel_A Member Posts: 2,674
    > 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?
  • vinay_kpvinay_kp Member Posts: 182
    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 ?
  • vinay_kpvinay_kp Member Posts: 182
    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 ?
  • Pavel_APavel_A Member Posts: 2,674
    > 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?
  • vinay_kpvinay_kp Member Posts: 182
    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 ?
  • Pavel_APavel_A Member Posts: 2,674
    > 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
  • vinay_kpvinay_kp Member Posts: 182
    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 ?
  • Pavel_APavel_A Member Posts: 2,674
    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
  • vinay_kpvinay_kp Member Posts: 182
    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 ??
  • Pavel_APavel_A Member Posts: 2,674
    Or, maybe, you need to implement some "optional" handler, as in this case:

    http://tinyurl.com/jpn9q6y
  • vinay_kpvinay_kp Member Posts: 182
    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 ?
  • Pavel_APavel_A Member Posts: 2,674
    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
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Upcoming OSR Seminars
Developing Minifilters 29 July 2019 OSR Seminar Space
Writing WDF Drivers 23 Sept 2019 OSR Seminar Space
Kernel Debugging 21 Oct 2019 OSR Seminar Space
Internals & Software Drivers 18 Nov 2019 Dulles, VA