hello,
i reproduced the same behaviour with a simple model.
My new network model contain two wireless hosts,
using Ieee80211NicSTA (inet.linklayer.ieee80211.Ieee80211NicSTA), and
two access points using inet.nodes.wireless.WirelessAP.
One host acts as a sink using Sink module (inet.base.Sink)
and an other one generates packet using EtherAppCli
module (inet.applications.ethernet.EtherAppCli).
Along the simulation, i have noticed that the host acting as sink
can be associated to APs. But the host acting as source cannot
be associated and obviously can't send out packet.
To reproduce the behaviour launch the simulation which i attached with this mail.
But first of all you may change the Ieee80211Mac.cc code otherwise
the simulation crash due to ASSERT insctruction in
function void Ieee80211Mac::handleUpperMsg(cPacket *msg)
in file inet/src/linklayer/ieee80211/mac/Ieee80211Mac.cc
Change code like this:
****before change
void Ieee80211Mac::handleUpperMsg(cPacket *msg){ // check for queue overflow
if (maxQueueSize && (int)transmissionQueue.size() == maxQueueSize) {
EV << "message " << msg << " received from higher layer but MAC queue is full, dropping message\n";
delete msg; return; }
// must be a Ieee80211DataOrMgmtFrame, within the max size because we don't support fragmentation Ieee80211DataOrMgmtFrame *frame = check_and_cast<Ieee80211DataOrMgmtFrame *>(msg);
if (frame->getByteLength() > fragmentationThreshold) error("message from higher layer (%s)%s is too long for 802.11b, %d bytes (fragmentation is not supported yet)",
msg->getClassName(), msg->getName(), (int)(msg->getByteLength())); EV << "frame " << frame << " received from higher layer, receiver = " << frame->getReceiverAddress() << endl;
ASSERT(!frame->getReceiverAddress().isUnspecified()); // My comment: stop if host not yet associated to an access point
// fill in missing fields (receiver address, seq number), and insert into the queue frame->setTransmitterAddress(address);
frame->setSequenceNumber(sequenceNumber); sequenceNumber = (sequenceNumber+1) % 4096; //XXX seqNum must be checked upon reception of frames!
transmissionQueue.push_back(frame); handleWithFSM(frame);
}*****after change code: delete frame when host yet associated to an access point
void Ieee80211Mac::handleUpperMsg(cPacket *msg)
{ // check for queue overflow if (maxQueueSize && (int)transmissionQueue.size() == maxQueueSize)
{ EV << "message " << msg << " received from higher layer but MAC queue is full, dropping message\n";
delete msg; return; }
// must be a Ieee80211DataOrMgmtFrame, within the max size because we don't support fragmentation Ieee80211DataOrMgmtFrame *frame = check_and_cast<Ieee80211DataOrMgmtFrame *>(msg);
if (frame->getByteLength() > fragmentationThreshold) error("message from higher layer (%s)%s is too long for 802.11b, %d bytes (fragmentation is not supported yet)",
msg->getClassName(), msg->getName(), (int)(msg->getByteLength())); EV << "frame " << frame << " received from higher layer, receiver = " << frame->getReceiverAddress() << endl;
//XXX ASSERT(!frame->getReceiverAddress().isUnspecified());
if(frame->getReceiverAddress().isUnspecified()){
delete frame; return; //My comment delete frame if host not associated to an access point
} // fill in missing fields (receiver address, seq number), and insert into the queue
frame->setTransmitterAddress(address); frame->setSequenceNumber(sequenceNumber);
sequenceNumber = (sequenceNumber+1) % 4096; //XXX seqNum must be checked upon reception of frames! transmissionQueue.push_back(frame);
handleWithFSM(frame);}please help,
thanks,
Zieduz