[Ns-developers] Requesting help for csma promiscuous mode
craigdo@ee.washington.edu
craigdo at ee.washington.edu
Mon Jul 7 12:01:12 PDT 2008
> > I think that linux has a number of bits that you can set to
> enable various
> > promiscuity levels: RxStation, RxMulticast, RxBroadcast, RxProm.
>
> Really ? Where did you see that ? The only promiscuous things I know
> about are from "man ifconfig":
Okay, maybe I shouldn't have said linux, I should have said at least one
linux net device driver. It's from a particular driver implementation (3com
etherlink) I was looking at, where all of the receive promiscuity levels are
broken out nicely corresponding to bits available in the NIC hardware:
3c509.c has the following code:
00744 if (dev->flags&IFF_PROMISC) {
00745 outw(SetRxFilter | RxStation | RxMulticast | RxBroadcast | RxProm,
00746 ioaddr + EL3_CMD);
00747 }
00748 else if (dev->mc_count || (dev->flags&IFF_ALLMULTI)) {
00749 outw(SetRxFilter | RxStation | RxMulticast | RxBroadcast,
ioaddr + EL3_CMD);
00750 }
00751 else
00752 outw(SetRxFilter | RxStation | RxBroadcast, ioaddr + EL3_CMD);
dev->flags has the IFF_PROMISC and IFF_ALLMULTI bits and the net device
further breaks them down into MAC address-based possibilities. This seemed
useful/flexible to me.
> [-]promisc
> Enable or disable the promiscuous mode of the interface. If
> selected, all packets on the network will be received by the
> interface.
>
> and, looking at the include/linux/netdevice.h header, I see only a
> single promiscuity count, not a mask for different levels (see
> __dev_set_promiscuity in net/core/dev.c)
>
> There is an "allmulti" mode but that seems orthogonal to promisc mode
> (i.e., send up all multicast packets without filtering)
>
> > Anyway, I think having devices always in promiscuous mode is weird.
>
> agreed.
>
> Mathieu
More information about the Ns-developers
mailing list