Re: MAC bridging and sniffing packets with specific Ethertype
From: Jeff Kelley [MS] (jeffkel_at_online.microsoft.com)
Date: 10/13/04
- Next message: Chuck Zalinski: "Re: ?Anybody get it?"
- Previous message: Kamila: "MAC bridging and sniffing packets with specific Ethertype"
- In reply to: Kamila: "MAC bridging and sniffing packets with specific Ethertype"
- Next in thread: Kamila: "Re: MAC bridging and sniffing packets with specific Ethertype"
- Reply: Kamila: "Re: MAC bridging and sniffing packets with specific Ethertype"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 13 Oct 2004 10:52:58 -0700
It sounds like you are on the right track. The bindings of the networking
drivers would look something like this (my apologies for ASCII art that may
not look pretty depending upon font):
(your custom bridge management
application)
|
(TCPIP) NDISUIO
| |
MBRIDGE1 (miniport driver)
------- MBRIDGE (protocol driver)
| | |
Adapter1 Adapter2 ... AdapterN
That is, the Ethernet adapters are bound to the Mbridge driver (which, since
Mbridge is a layered intermediate driver, consists of an NDIS protocol
driver at its lower edge and an NDIS miniport driver at its upper edge).
Mbridge handles the bridging of packets between the adapters. For packets
that are to be received locally (e.g. broadcast packets or those whose
destination MAC address is that of one of the Ethernet adapters), Mbridge
passes them up to the protocol drivers that are bound ot Mbridge's miniport
driver instance, MBRIDGE1. It passes all of them up, regardless of EthType
(except for one special EthType that MBRIDGE itself uses).
In this case, we have TCPIP and NDISUIO bound to MBRIDGE1 so they both
receive these packets. TCPIP will look at the EthType and process IP and
ARP. NDISUIO will look at the EthType and ignore any packets that do not
match its configured EthType. So, as you note you would configure this value
using IOCTL_NDISUIO_SET_ETHER_TYPE to your special EthType so that your
application would receive the special packets that it is interested in.
Your application can send whatever packets it wants via NDISUIO, they get
passed down as is to MBRIDGE and then to an Ethernet adapter. Note that the
application using NDISUIO is responsible for entire packet including the
Ethernet header, so it must fill in the destination and source MAC addresses
and the EthType.
Some sample code for receiving packets and filtering on EthType can be found
in the NDISUIO driver source code. In the Platform Builder tree you can look
at public\common\oak\drivers\ndisuio\recv.c. See the function
NdisuioReceivePacket.
-- Jeff Kelley Microsoft / Windows CE Networking This posting is provided AS IS with no warranties, and confers no rights. "Kamila" <camol@gazeta.pl> wrote in message news:8077d64.0410130839.353cdbd6@posting.google.com... > We are considering development of a simple bridge base on the Windows > CE 4.2 or 5.0. > We plan to use Mbridge.dll for this purpose. On one of the interfaces > (802.3) additionally to the IP traffic, which will be bridged, there > will traffic destined to the bridge interface card. The bridge will > use this traffic to exchange with the device, directly connected to > this interface, some configuration information. The proprietary > protocol will be used for this purpose. This protocol is defined > directly above Ethernet header (no IP header). We want to filter this > traffic based on the Ethertype or SNAP header. > > It looks like that it is possible to write an application to receive > and send Ethernet packet using NDISUIO protocol driver (ReadFile, > WriteFile operations). There is an IOCTL_NDISUIO_SET_ETHER_TYPE > operation allowing to set type of Ethernet packet to be filtered (by > default it is 0x8001). > If we change it, does it mean that application will receive only this > type of Ethernet packets or the NDIS driver will filter these packets > and won't allow receiving any other packets on this interface? > Would it take any effect on the Mbridge? Will the Mbridge module > receive packets with other Ethertypes from this interface? > What about packets filtered by our application? Would they be sent to > the Mbridge module as well? I found info in the msdn that for the > simultaneous access for multiple application operations requiring > packets replication within NDIS are not supported. However in this > case the Mbridge is not typical application acting in the user mode, > it operates in the kernel mode. Does it matter in this case? > > If you could provide me with some example code to filter Ethernet > packets with specific Ethertype field, it would be great! > > Maybe I am wrong approaching the problem in this way. Any advises? > > Thanks in advance for any help! > > Kamila Piechota
- Next message: Chuck Zalinski: "Re: ?Anybody get it?"
- Previous message: Kamila: "MAC bridging and sniffing packets with specific Ethertype"
- In reply to: Kamila: "MAC bridging and sniffing packets with specific Ethertype"
- Next in thread: Kamila: "Re: MAC bridging and sniffing packets with specific Ethertype"
- Reply: Kamila: "Re: MAC bridging and sniffing packets with specific Ethertype"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|