Hi,
I am writing a TDI protocol driver that sits in parallel with TCPIP and
binds to the same Ethernet adapter as TCPIP.
My question is, how does NDIS decide which protocol driver will receive data
when packets come from the network and sent up by the NIC.
I installed my sample along with TCPIP, but my ProtocolReceivePackets
routine never got called if i ran ping or some other command. Instead TCPIP
consumed all the packets.
Also i ran a simple IOCTL transer through TCP and received data but still my
protocol receive wasnt called.

Then i tested my protocol driver by opening it from an app and passing data
throgh it and that works fine. So my driver is fine, and its binding to the
NIC is fine.

Why am i still not being called by NDIS for data packets meant for TCPIP ?
Is there filetring going on ? Does NDIS send packets to TCPIP and if it
accepts then it doesnt bother to call other drivers sitting in parallel.


thanks
Pankaj

Re: TDI Protocol Driver and TCPIP Coexistence by Thomas

Thomas
Wed Jun 01 10:57:11 CDT 2005


"Pankaj" <Pankaj@discussions.microsoft.com> wrote in message
news:210C5E4A-8680-48AA-8343-270B6A3A15E4@microsoft.com...
> Hi,
> I am writing a TDI protocol driver that sits in parallel with TCPIP and
> binds to the same Ethernet adapter as TCPIP.
> My question is, how does NDIS decide which protocol driver will receive
> data
> when packets come from the network and sent up by the NIC.

The answer to this is simple: All top-level protocols above a given adapter
will receive all receive packets indicated by that adapter.

> I installed my sample along with TCPIP, but my ProtocolReceivePackets
> routine never got called if i ran ping or some other command. Instead
> TCPIP
> consumed all the packets.

It is likely that your protocol is being called at the ProtocolReceive
callback instead of ProtocolReceivePackets.

> Also i ran a simple IOCTL transer through TCP and received data but still
> my
> protocol receive wasnt called.
>
> Then i tested my protocol driver by opening it from an app and passing
> data
> throgh it and that works fine. So my driver is fine, and its binding to
> the
> NIC is fine.
>
> Why am i still not being called by NDIS for data packets meant for TCPIP ?
> Is there filetring going on ? Does NDIS send packets to TCPIP and if it
> accepts then it doesnt bother to call other drivers sitting in parallel.
>

Check for packets at your ProtocolReceive callback.

Good luck,

Thomas F. Divine, Windows DDK MVP
http://www.rawether.net


Re: TDI Protocol Driver and TCPIP Coexistence by Pankaj

Pankaj
Wed Jun 01 11:36:10 CDT 2005

I have breakpoints in both ProtocolReceivePackets and ProtocolReceive. I dont
hit any breakpoints ever when tcpip is being used.
I confirmed again my bindings with NIC are being created and i am returning
SUCCESS and also that i am expecting ethernet packets.

-pankaj

"Thomas F. Divine [DDK MVP]" wrote:

>
> "Pankaj" <Pankaj@discussions.microsoft.com> wrote in message
> news:210C5E4A-8680-48AA-8343-270B6A3A15E4@microsoft.com...
> > Hi,
> > I am writing a TDI protocol driver that sits in parallel with TCPIP and
> > binds to the same Ethernet adapter as TCPIP.
> > My question is, how does NDIS decide which protocol driver will receive
> > data
> > when packets come from the network and sent up by the NIC.
>
> The answer to this is simple: All top-level protocols above a given adapter
> will receive all receive packets indicated by that adapter.
>
> > I installed my sample along with TCPIP, but my ProtocolReceivePackets
> > routine never got called if i ran ping or some other command. Instead
> > TCPIP
> > consumed all the packets.
>
> It is likely that your protocol is being called at the ProtocolReceive
> callback instead of ProtocolReceivePackets.
>
> > Also i ran a simple IOCTL transer through TCP and received data but still
> > my
> > protocol receive wasnt called.
> >
> > Then i tested my protocol driver by opening it from an app and passing
> > data
> > throgh it and that works fine. So my driver is fine, and its binding to
> > the
> > NIC is fine.
> >
> > Why am i still not being called by NDIS for data packets meant for TCPIP ?
> > Is there filetring going on ? Does NDIS send packets to TCPIP and if it
> > accepts then it doesnt bother to call other drivers sitting in parallel.
> >
>
> Check for packets at your ProtocolReceive callback.
>
> Good luck,
>
> Thomas F. Divine, Windows DDK MVP
> http://www.rawether.net
>
>

Re: TDI Protocol Driver and TCPIP Coexistence by pavel_a

pavel_a
Wed Jun 01 11:42:04 CDT 2005

Have you enabled receive by setting a non-zero packet filter?

--PA

"Pankaj" wrote:
> I have breakpoints in both ProtocolReceivePackets and ProtocolReceive. I dont
> hit any breakpoints ever when tcpip is being used.
> I confirmed again my bindings with NIC are being created and i am returning
> SUCCESS and also that i am expecting ethernet packets.
>
> -pankaj
>
> "Thomas F. Divine [DDK MVP]" wrote:
>
> >
> > "Pankaj" <Pankaj@discussions.microsoft.com> wrote in message
> > news:210C5E4A-8680-48AA-8343-270B6A3A15E4@microsoft.com...
> > > Hi,
> > > I am writing a TDI protocol driver that sits in parallel with TCPIP and
> > > binds to the same Ethernet adapter as TCPIP.
> > > My question is, how does NDIS decide which protocol driver will receive
> > > data
> > > when packets come from the network and sent up by the NIC.
> >
> > The answer to this is simple: All top-level protocols above a given adapter
> > will receive all receive packets indicated by that adapter.
> >
> > > I installed my sample along with TCPIP, but my ProtocolReceivePackets
> > > routine never got called if i ran ping or some other command. Instead
> > > TCPIP
> > > consumed all the packets.
> >
> > It is likely that your protocol is being called at the ProtocolReceive
> > callback instead of ProtocolReceivePackets.
> >
> > > Also i ran a simple IOCTL transer through TCP and received data but still
> > > my
> > > protocol receive wasnt called.
> > >
> > > Then i tested my protocol driver by opening it from an app and passing
> > > data
> > > throgh it and that works fine. So my driver is fine, and its binding to
> > > the
> > > NIC is fine.
> > >
> > > Why am i still not being called by NDIS for data packets meant for TCPIP ?
> > > Is there filetring going on ? Does NDIS send packets to TCPIP and if it
> > > accepts then it doesnt bother to call other drivers sitting in parallel.
> > >
> >
> > Check for packets at your ProtocolReceive callback.
> >
> > Good luck,
> >
> > Thomas F. Divine, Windows DDK MVP
> > http://www.rawether.net
> >
> >

Re: TDI Protocol Driver and TCPIP Coexistence by Pankaj

Pankaj
Wed Jun 01 11:52:24 CDT 2005

How do you set that ? I have set the packet types for 802.3
What call shall i use for this non zero packet filter.

"Pavel A." wrote:

> Have you enabled receive by setting a non-zero packet filter?
>
> --PA
>
> "Pankaj" wrote:
> > I have breakpoints in both ProtocolReceivePackets and ProtocolReceive. I dont
> > hit any breakpoints ever when tcpip is being used.
> > I confirmed again my bindings with NIC are being created and i am returning
> > SUCCESS and also that i am expecting ethernet packets.
> >
> > -pankaj
> >
> > "Thomas F. Divine [DDK MVP]" wrote:
> >
> > >
> > > "Pankaj" <Pankaj@discussions.microsoft.com> wrote in message
> > > news:210C5E4A-8680-48AA-8343-270B6A3A15E4@microsoft.com...
> > > > Hi,
> > > > I am writing a TDI protocol driver that sits in parallel with TCPIP and
> > > > binds to the same Ethernet adapter as TCPIP.
> > > > My question is, how does NDIS decide which protocol driver will receive
> > > > data
> > > > when packets come from the network and sent up by the NIC.
> > >
> > > The answer to this is simple: All top-level protocols above a given adapter
> > > will receive all receive packets indicated by that adapter.
> > >
> > > > I installed my sample along with TCPIP, but my ProtocolReceivePackets
> > > > routine never got called if i ran ping or some other command. Instead
> > > > TCPIP
> > > > consumed all the packets.
> > >
> > > It is likely that your protocol is being called at the ProtocolReceive
> > > callback instead of ProtocolReceivePackets.
> > >
> > > > Also i ran a simple IOCTL transer through TCP and received data but still
> > > > my
> > > > protocol receive wasnt called.
> > > >
> > > > Then i tested my protocol driver by opening it from an app and passing
> > > > data
> > > > throgh it and that works fine. So my driver is fine, and its binding to
> > > > the
> > > > NIC is fine.
> > > >
> > > > Why am i still not being called by NDIS for data packets meant for TCPIP ?
> > > > Is there filetring going on ? Does NDIS send packets to TCPIP and if it
> > > > accepts then it doesnt bother to call other drivers sitting in parallel.
> > > >
> > >
> > > Check for packets at your ProtocolReceive callback.
> > >
> > > Good luck,
> > >
> > > Thomas F. Divine, Windows DDK MVP
> > > http://www.rawether.net
> > >
> > >

Re: TDI Protocol Driver and TCPIP Coexistence by Calvin

Calvin
Wed Jun 01 12:40:14 CDT 2005

You need to call NdisRequest with OID_GEN_CURRENT_PACKET_FILTER to enable RX
on at least one filter. They are all documented in DDK.

Most frequent used packet filters are:
NDIS_PACKET_TYPE_DIRECTED
NDIS_PACKET_TYPE_MULTICAST

--
Calvin Guan Windows DDK MVP
Staff SW Engineer, NetXtreme MINIPORT
Enterprise Network Controller Engineering
Broadcom Corporation www.broadcom.com

"Pankaj" <Pankaj@discussions.microsoft.com> wrote in message
news:83380439-1B75-4576-834A-C663CB9549BC@microsoft.com...
> How do you set that ? I have set the packet types for 802.3
> What call shall i use for this non zero packet filter.
>
> "Pavel A." wrote:
>
>> Have you enabled receive by setting a non-zero packet filter?
>>
>> --PA
>>
>> "Pankaj" wrote:
>> > I have breakpoints in both ProtocolReceivePackets and ProtocolReceive.
>> > I dont
>> > hit any breakpoints ever when tcpip is being used.
>> > I confirmed again my bindings with NIC are being created and i am
>> > returning
>> > SUCCESS and also that i am expecting ethernet packets.
>> >
>> > -pankaj
>> >
>> > "Thomas F. Divine [DDK MVP]" wrote:
>> >
>> > >
>> > > "Pankaj" <Pankaj@discussions.microsoft.com> wrote in message
>> > > news:210C5E4A-8680-48AA-8343-270B6A3A15E4@microsoft.com...
>> > > > Hi,
>> > > > I am writing a TDI protocol driver that sits in parallel with TCPIP
>> > > > and
>> > > > binds to the same Ethernet adapter as TCPIP.
>> > > > My question is, how does NDIS decide which protocol driver will
>> > > > receive
>> > > > data
>> > > > when packets come from the network and sent up by the NIC.
>> > >
>> > > The answer to this is simple: All top-level protocols above a given
>> > > adapter
>> > > will receive all receive packets indicated by that adapter.
>> > >
>> > > > I installed my sample along with TCPIP, but my
>> > > > ProtocolReceivePackets
>> > > > routine never got called if i ran ping or some other command.
>> > > > Instead
>> > > > TCPIP
>> > > > consumed all the packets.
>> > >
>> > > It is likely that your protocol is being called at the
>> > > ProtocolReceive
>> > > callback instead of ProtocolReceivePackets.
>> > >
>> > > > Also i ran a simple IOCTL transer through TCP and received data but
>> > > > still
>> > > > my
>> > > > protocol receive wasnt called.
>> > > >
>> > > > Then i tested my protocol driver by opening it from an app and
>> > > > passing
>> > > > data
>> > > > throgh it and that works fine. So my driver is fine, and its
>> > > > binding to
>> > > > the
>> > > > NIC is fine.
>> > > >
>> > > > Why am i still not being called by NDIS for data packets meant for
>> > > > TCPIP ?
>> > > > Is there filetring going on ? Does NDIS send packets to TCPIP and
>> > > > if it
>> > > > accepts then it doesnt bother to call other drivers sitting in
>> > > > parallel.
>> > > >
>> > >
>> > > Check for packets at your ProtocolReceive callback.
>> > >
>> > > Good luck,
>> > >
>> > > Thomas F. Divine, Windows DDK MVP
>> > > http://www.rawether.net
>> > >
>> > >



Re: TDI Protocol Driver and TCPIP Coexistence by Pankaj

Pankaj
Wed Jun 01 13:45:01 CDT 2005

Thanks. That Worked.

"Calvin Guan" wrote:

> You need to call NdisRequest with OID_GEN_CURRENT_PACKET_FILTER to enable RX
> on at least one filter. They are all documented in DDK.
>
> Most frequent used packet filters are:
> NDIS_PACKET_TYPE_DIRECTED
> NDIS_PACKET_TYPE_MULTICAST
>
> --
> Calvin Guan Windows DDK MVP
> Staff SW Engineer, NetXtreme MINIPORT
> Enterprise Network Controller Engineering
> Broadcom Corporation www.broadcom.com
>
> "Pankaj" <Pankaj@discussions.microsoft.com> wrote in message
> news:83380439-1B75-4576-834A-C663CB9549BC@microsoft.com...
> > How do you set that ? I have set the packet types for 802.3
> > What call shall i use for this non zero packet filter.
> >
> > "Pavel A." wrote:
> >
> >> Have you enabled receive by setting a non-zero packet filter?
> >>
> >> --PA
> >>
> >> "Pankaj" wrote:
> >> > I have breakpoints in both ProtocolReceivePackets and ProtocolReceive.
> >> > I dont
> >> > hit any breakpoints ever when tcpip is being used.
> >> > I confirmed again my bindings with NIC are being created and i am
> >> > returning
> >> > SUCCESS and also that i am expecting ethernet packets.
> >> >
> >> > -pankaj
> >> >
> >> > "Thomas F. Divine [DDK MVP]" wrote:
> >> >
> >> > >
> >> > > "Pankaj" <Pankaj@discussions.microsoft.com> wrote in message
> >> > > news:210C5E4A-8680-48AA-8343-270B6A3A15E4@microsoft.com...
> >> > > > Hi,
> >> > > > I am writing a TDI protocol driver that sits in parallel with TCPIP
> >> > > > and
> >> > > > binds to the same Ethernet adapter as TCPIP.
> >> > > > My question is, how does NDIS decide which protocol driver will
> >> > > > receive
> >> > > > data
> >> > > > when packets come from the network and sent up by the NIC.
> >> > >
> >> > > The answer to this is simple: All top-level protocols above a given
> >> > > adapter
> >> > > will receive all receive packets indicated by that adapter.
> >> > >
> >> > > > I installed my sample along with TCPIP, but my
> >> > > > ProtocolReceivePackets
> >> > > > routine never got called if i ran ping or some other command.
> >> > > > Instead
> >> > > > TCPIP
> >> > > > consumed all the packets.
> >> > >
> >> > > It is likely that your protocol is being called at the
> >> > > ProtocolReceive
> >> > > callback instead of ProtocolReceivePackets.
> >> > >
> >> > > > Also i ran a simple IOCTL transer through TCP and received data but
> >> > > > still
> >> > > > my
> >> > > > protocol receive wasnt called.
> >> > > >
> >> > > > Then i tested my protocol driver by opening it from an app and
> >> > > > passing
> >> > > > data
> >> > > > throgh it and that works fine. So my driver is fine, and its
> >> > > > binding to
> >> > > > the
> >> > > > NIC is fine.
> >> > > >
> >> > > > Why am i still not being called by NDIS for data packets meant for
> >> > > > TCPIP ?
> >> > > > Is there filetring going on ? Does NDIS send packets to TCPIP and
> >> > > > if it
> >> > > > accepts then it doesnt bother to call other drivers sitting in
> >> > > > parallel.
> >> > > >
> >> > >
> >> > > Check for packets at your ProtocolReceive callback.
> >> > >
> >> > > Good luck,
> >> > >
> >> > > Thomas F. Divine, Windows DDK MVP
> >> > > http://www.rawether.net
> >> > >
> >> > >
>
>
>

Re: TDI Protocol Driver and TCPIP Coexistence by Maxim

Maxim
Thu Jun 02 01:54:58 CDT 2005

> My question is, how does NDIS decide which protocol driver will receive data
> when packets come from the network and sent up by the NIC.

This is not NDIS's decision but the protocol's one. The protocol must have the
"our - not our" logic and just ignore the packets which are "not our".

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com