[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ns] broadcast agent on mac layer for wireless simulation -> need some help !
This answer is valid if you use ns-allinone-2.1b6a.
You say nothing about your agent so it's difficult to tell you
from which class it should be derived, however you could have a
look at the AODV code, ns/aodv/aodv.cc for example.
rougthly, what is coming from the mac layer will arrive direclty
in the AODV::recv function, and when you want to send a packet
to the mac layer you will use something like
/*
* Jitter the sending of broadcast packets by 10ms
*/
Scheduler::instance().schedule(target_, p, 0.01 * Random::uniform());
here the mac layer is lurking in "target_" .
Well, not exactly. there is in fact a queue between the agent
and the mac layer, and the arp lurking somewhere, ready to drop
a good part of your packets. However, if you tinker with arp as
follows, you will eliminate these dropped packets (arp won't be
realistic anymore). And, if you use the mac-null.cc class I
posted some time ago, there will never be any packets in the
queue, since the bandwidth of this mac layer is infinite (and I
checked, there are no packets in the queue).
The mac-802_11.cc has some bugs in ns-allinone-2.1b6a, search
the mailing list archive to learn more, or read the section
7. About the bandwidth
of http://www.ee.cornell.edu/~robin/README
you might also want to read
http://www.isi.edu/nsnam/archive/ns-users/webarch/2000/msg03870.html
and
http://www.isi.edu/nsnam/archive/ns-users/webarch/2000/msg03863.html
ARP TINKERING
in arp.cc, replace (in the ARPTable::arpresolve function)
if(llinfo && llinfo->up_) {
mac_->hdr_dst((char*) HDR_MAC(p), llinfo->macaddr_);
return 0;
}
by
hdr_cmn *ch = HDR_CMN(p);
if(1) {
mac_->hdr_dst((char*) HDR_MAC(p), ch->next_hop());
return 0;
}
On Thu, 09 Nov 2000, Jean-Pierre Schmit wrote:
> Hi everybody !
>
>
> Working on a wireless network project, I have to implement an agent that
> broadcasts messages directly on the mac layer and that is able to answer to
> these messages.
>
> Unfortunately, after one week of work, I still do not have a clue on how to do
> this !
>
> Can anyone give me some guidelines and/or suggestions on
> how and where to access the maclayer
> from which class this agent should be derived?
>
> Sample code would be most welcome !
>
>
> Many, many thanks in advance, I am really beginning to despair,
>
>
> Jean-Pierre.
>
>
>
> ----------------------------------
> Jean-Pierre Schmit
> EPFL - Swiss Institute of Technology Lausanne
> www.epfl.ch
--
Robin