How to calculate Channel Busy Ratio (CBR) in Veins by using Clear Channel Assessment (CCA)

703 views
Skip to first unread message

Tian Bin

unread,
Feb 1, 2016, 10:53:39 AM2/1/16
to OMNeT++ Users
Dear Mr. Sommer and every experts of Veins

I want to get CBR from PHY layer of Veins. Currently, I can get an approximate CBR from Decider80211p::processNewSignal(AirFrame* msg). I use a calculation window to get "busyTime" every second as follows:

simtime_t Decider80211p::processNewSignal(AirFrame* msg) {

AirFrame11p *frame = check_and_cast<AirFrame11p *>(msg);

// get the receiving power of the Signal at start-time and center frequency
Signal& signal = frame->getSignal();

Argument start(DimensionSet::timeFreqDomain);
start.setTime(signal.getReceptionStart());
start.setArgValue(Dimension::frequency_static(), centerFrequency);

signalStates[frame] = EXPECT_END;

double recvPower = signal.getReceivingPower()->getValue(start);

if (recvPower < sensitivity) {
//annotate the frame, so that we won't try decoding it at its end
frame->setUnderSensitivity(true);
//check channel busy status. a superposition of low power frames might turn channel status to busy
if (cca(simTime(), NULL) == false) {
setChannelIdleStatus(false);
}
return signal.getReceptionEnd();
}
else {

setChannelIdleStatus(false);

if (phy11p->getRadioState() == Radio::TX) {
frame->setBitError(true);
frame->setWasTransmitting(true);
DBG_D11P << "AirFrame: " << frame->getId() << " (" << recvPower << ") received, while already sending. Setting BitErrors to true" << std::endl;
}
else {

if (!currentSignal.first) {
//NIC is not yet synced to any frame, so lock and try to decode this frame
currentSignal.first = frame;
DBG_D11P << "AirFrame: " << frame->getId() << " with (" << recvPower << " > " << sensitivity << ") -> Trying to receive AirFrame." << std::endl;
}
else {
//NIC is currently trying to decode another frame. this frame will be simply treated as interference
DBG_D11P << "AirFrame: " << frame->getId() << " with (" << recvPower << " > " << sensitivity << ") -> Already synced to another AirFrame. Treating AirFrame as interference." << std::endl;
}


//channel turned busy
//measure communication density
myBusyTime += signal.getDuration().dbl();

                        // Measure Channel Busy Ratio
                        myCBR += signal.getDuration().dbl();
}
return signal.getReceptionEnd();
}
}

The myCBR is accumulated in 1 second and reset to 0, and then be accumulated again, so on so forth. But, some myCBRs are more than 1 in dense network of my simulation, the maximum myCBR reaches 1.5 ! It's impossible because my calculation window is 1 second. So is there someone who can help me out please? We may use cca() directly? Any suggestion is welcome.

Thanks in advance.

David Eckhoff

unread,
Feb 1, 2016, 11:07:19 AM2/1/16
to omn...@googlegroups.com
Thing is, processNewSignal() is called for every arriving signal, even
when your radio is already receiving another packet. This doesnt mean
that these packets can be decoded, but they have to be processed for
accurate computation of signal to interference ratios. You should
measure the CBR e.g. in the setChannelIdleStatus function.

-david
> --
> You received this message because you are subscribed to the Google
> Groups "OMNeT++ Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to omnetpp+u...@googlegroups.com
> <mailto:omnetpp+u...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/omnetpp.
> For more options, visit https://groups.google.com/d/optout.


--
Dipl.-Inf. Univ. David Eckhoff
Computer Networks and Communication Systems
University of Erlangen, Germany
Phone: +49 9131 85-27627 / Fax: +49 9131 85-27409
mailto:david....@fau.de
http://www7.cs.fau.de/en/people/eckhoff/

Tian Bin

unread,
Feb 1, 2016, 12:00:00 PM2/1/16
to OMNeT++ Users, d...@cs.fau.de
Understood, thanks a lot, David.

David Eckhoff

unread,
Feb 1, 2016, 1:04:53 PM2/1/16
to omn...@googlegroups.com, artisa...@gmail.com
to add to my previous statement, the best place to add something like that is probably the mac layer.
the phy already tells the mac when the channel status changes, and we also already collect statistics there if i recall correctly. just add your stuff there so you dont have to worry about the internals of the decider or the phy.

- david
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.

Visit this group at https://groups.google.com/group/omnetpp.
For more options, visit https://groups.google.com/d/optout.
-- 
Dipl.-Inf. Univ. David Eckhoff
Computer Networks and Communication Systems
University of Erlangen, Germany
Phone: +49 9131 85-27627 / Fax: +49 9131 85-27409

Tian Bin

unread,
Feb 2, 2016, 4:40:22 AM2/2/16
to OMNeT++ Users, artisa...@gmail.com, d...@cs.fau.de
You are right. You indeed collected the statsTotalBusyTime at Mac1609_4::channelIdle(bool afterSwitch), which is exactly what I want to calculate CBR. I just need to move my stuff in Mac1609_4 module and mainly in Mac1609_4::channelIdle(bool afterSwitch) to calculate CBR by using a window. 
Reply all
Reply to author
Forward
0 new messages