Hi,

It looks like when an NDIS (say 5.1)packet is sent down to a miniport
driver, it already has a MAC header (not sure whether this is a Ethernet-II
header or a 802.3 header???).

Isn't it the miniport driver's job to create this header? Why is NDIS doing
this? Or does NDIS only create a placeholder which needs to be filled in by
the underlying miniport driver? If so, does NDIS fill in any of the fields?
Is there some document/reference which shows who fills what?

Thanks.

Re: NDIS - what layer 2 header fields does it fill? by Maxim

Maxim
Fri Jul 25 12:26:31 CDT 2008

> It looks like when an NDIS (say 5.1)packet is sent down to a miniport
> driver, it already has a MAC header (not sure whether this is a Ethernet-II
> header or a 802.3 header???).

Yes. Protocol creates it. Can use any framing.

> Isn't it the miniport driver's job to create this header?

No.

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


Re: NDIS - what layer 2 header fields does it fill? by Gammaraman

Gammaraman
Fri Jul 25 17:06:07 CDT 2008

Thank you.

Can you please elaborate what you mean by protocol? Do you mean for example
an IP protocol driver? If so, IP is layer 3 why should it worry about layer2
headers? Further, how can this protocol have all the info it needs to fill
MAC header?

"Maxim S. Shatskih" wrote:

> > It looks like when an NDIS (say 5.1)packet is sent down to a miniport
> > driver, it already has a MAC header (not sure whether this is a Ethernet-II
> > header or a 802.3 header???).
>
> Yes. Protocol creates it. Can use any framing.
>
> > Isn't it the miniport driver's job to create this header?
>
> No.
>
> --
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> maxim@storagecraft.com
> http://www.storagecraft.com
>
>

Re: NDIS - what layer 2 header fields does it fill? by Maxim

Maxim
Sat Jul 26 10:33:15 CDT 2008

> Can you please elaborate what you mean by protocol?

NDIS protocol driver.

>Do you mean for example an IP protocol driver?

Yes.

>If so, IP is layer 3 why should it worry about layer2 headers?

Because MS does not follow OSI model strictly.

In NDIS, level 3 protocol drivers must create and parse (at least to determine
the protocol ID) the layer 2 headers.

The only thing where NDIS interprets the layer 2 headers is in the receive
path, and only to determine the packet type of
promiscuous/local/broadcast/multicast, nothing else.

>Further, how can this protocol have all the info it needs to fill MAC header?

From ARP, DHCP and the OID queries to the miniport.

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


Re: NDIS - what layer 2 header fields does it fill? by Gammaraman

Gammaraman
Sat Jul 26 14:58:00 CDT 2008

Thanks, Maxim.

"Maxim S. Shatskih" wrote:

> > Can you please elaborate what you mean by protocol?
>
> NDIS protocol driver.
>
> >Do you mean for example an IP protocol driver?
>
> Yes.
>
> >If so, IP is layer 3 why should it worry about layer2 headers?
>
> Because MS does not follow OSI model strictly.
>
> In NDIS, level 3 protocol drivers must create and parse (at least to determine
> the protocol ID) the layer 2 headers.
>
> The only thing where NDIS interprets the layer 2 headers is in the receive
> path, and only to determine the packet type of
> promiscuous/local/broadcast/multicast, nothing else.
>
> >Further, how can this protocol have all the info it needs to fill MAC header?
>
> From ARP, DHCP and the OID queries to the miniport.
>
> --
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> maxim@storagecraft.com
> http://www.storagecraft.com
>
>