Radio state in InetManet

39 views
Skip to first unread message

Lynda Algerienne

unread,
Feb 10, 2012, 3:34:59 PM2/10/12
to omn...@googlegroups.com
hello,

I am writing a simulation for scheduling my transmissions in inetmanet and I only used the physical layer.

I have the following error:

error in module radio

trying to send a message while already transmitting.


I will appreciate any help.

Lynda Algerienne

unread,
Feb 11, 2012, 11:01:00 AM2/11/12
to omn...@googlegroups.com

Alfonso Ariza Quintana

unread,
Feb 13, 2012, 3:47:53 AM2/13/12
to omn...@googlegroups.com

 

You need to check the status of the physical layer, theMAC layer only can send messages to the physical layer when the status is idle. The physical layer send a notification every time that his status changes, your mac layer must capture this notification and to synchronize his actions with the physical layer, if the physical layer is transmitting or receiving the MAC  layer must delay the transmission of the current packet until the physical layer change to idle.

--
Sent from the OMNeT++ mailing list. To configure your membership,
visit http://groups.google.com/group/omnetpp

Lynda Algerienne

unread,
Feb 13, 2012, 9:01:13 AM2/13/12
to omn...@googlegroups.com
Hello,

Thank you so much for your reply.

I tried to write this code:

cModule * mod1 = getParentModule()->getsubmodule("radio");
Radio state  s1 (mod1->getId())

if (s.getradiostate == RadioState::IDLE)
{

Send (...)

}


But I have always the same error.

Could your please help me to write my code correctly

Best regards,





2012/2/13 Alfonso Ariza Quintana <aari...@hotmail.com>

Alfonso Ariza Quintana

unread,
Feb 13, 2012, 11:46:30 AM2/13/12
to omn...@googlegroups.com
 
In inet and inetmanet the mac layer uses the notification NF_RADIOSTATE_CHANGED
 
void Ieee80211NewMac::receiveChangeNotification(int category, const cObject *details)
{
    Enter_Method_Silent();
    printNotificationBanner(category, details);
 
    if (category == NF_RADIOSTATE_CHANGED)
    {
        RadioState * rstate = check_and_cast<RadioState *>(details);
        if (rstate->getRadioId()!=getRadioModuleId())
            return;
 
        RadioState::State newRadioState = rstate->getState();
 
 
 
        // FIXME: double recording, because there's no sample hold in the gui
        radioStateVector.record(radioState);
        radioStateVector.record(newRadioState);
 
        radioState = newRadioState;
 
        handleWithFSM(mediumStateChange);

Lynda Algerienne

unread,
Feb 13, 2012, 5:15:36 PM2/13/12
to omn...@googlegroups.com
Hello,

Thank you very much for your help.

I tried to add the Nf_RADIOSTATE_Changed to my NewMac and also handleWithFSm and all needed variables.

But the method
receiveChangeNotification
is never executed.


I point to you that I put INotifiable in my class.

I have not any syntax error but I cannot see the execution of this method.

Please I need any help from you.



Alfonso Ariza Quintana

unread,
Feb 14, 2012, 3:21:36 AM2/14/12
to omn...@googlegroups.com
You must subscrive the module. See in the initialize method

Lynda Algerienne

unread,
Feb 14, 2012, 1:47:48 PM2/14/12
to omn...@googlegroups.com
Hello,

Thank you very much.
I subscribed the module. The radio state changed but the state of the FSM is always the same.
Could you please help me.



2012/2/14 Alfonso Ariza Quintana <aari...@hotmail.com>

Alfonso Ariza Quintana

unread,
Feb 14, 2012, 2:53:04 PM2/14/12
to omn...@googlegroups.com
 
it’s your code that must change the mac FSM
The notification only notify to the mac layer the changes in the physical layer

Lynda Algerienne

unread,
Feb 14, 2012, 3:11:55 PM2/14/12
to omn...@googlegroups.com
hello,

Thank you very much for your useful explanation. I understood you perfectly.


I have another problem in my simulation.
Each node should transmit in a specified fraction of time and it should make several transmissions in order to deliver the packet to at least one of its neighbors.

The fraction of time and the number of transmissions have been estimated separately.

My problem is as follow:

node1 should for example make 4 transmissions. the 4 packets arrive at my Mac layer at the same time and they are scheduled in the first fraction. when they are handled by the handlemessage method the radio state is IDLE and they will be transmitted at the same time. So, I have always the same message and I cannot find a way for my transmissions.
Reply all
Reply to author
Forward
0 new messages