Can anyone suggest me if the following code is ok for this purpose? If not, can anyone please advice the correct code for this purpose?
if (!txQueue->isEmpty()) {
scheduleAt(simTime() + slotduration*3, c);
macState = send_data;
while(c == 0) {
senddatapacket();
}
}
Many thanks.
No necessarily, you can use an accumulate timer counter that is set to 0 at the beginning of the transmission, if the accumulate time since the node access to the channel is smaller than the limit + the packet pending in the queue it sends the packet, in other case change to listen (the timer is bigger or the queue is empty), this avoid the event and avoid that the timer could arrive in middle of a transmission.
If it doesn't matter to exceed the time for a bit, it is even more simple.
To view this discussion on the web visit https://groups.google.com/d/msgid/omnetpp/PR3P192MB066752D5D1DE3EE83FBAB2CE8C820%40PR3P192MB0667.EURP192.PROD.OUTLOOK.COM.
To unsubscribe from this group and stop receiving emails from it, send an email to omn...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/omnetpp/bced71d7-b1ba-47af-a0b5-0cbd906f23f9o%40googlegroups.com.
--
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 omn...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/omnetpp/PR3P192MB066752D5D1DE3EE83FBAB2CE8C820%40PR3P192MB0667.EURP192.PROD.OUTLOOK.COM.
--
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 omn...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/omnetpp/66d2fd79-c228-4d6a-9e63-7c1e278277cdo%40googlegroups.com.
if(!txQueue->isEmpty()) {
macState = SEND_DATA;
startSendDataState = simTime();
EV << "node " << address << " : Sending data" << endl;
sendDataPacket();
deleteCurrentTxFrame();
eduleAt(simTime() + checkinterval, wakeup);
}
The FSM can be complex in function if the node receives ACK or not
If they receives ack, in the ACK state
If (simTime() - startSendDataState < 5 && ¡txQueue->isEmpty()) {
macState = SEND_DATA;
sendDataPacket();
}
But you Will need to check if the changes in the FSM is correct.
Enviado desde Correo para Windows 10
if(!txQueue->isEmpty()) {
macState = SEND_DATA;
startSendDataState = simTime();
EV << "node " << address << " : Sending data" << endl;
sendDataPacket();
deleteCurrentTxFrame();
scheduleAt(simTime() + checkinterval, wakeup); //
}
If (simTime() - startSendDataState < 5 && ¡txQueue->isEmpty()) {
macState = SEND_DATA;
sendDataPacket(); // don't i need to delete the sent frames after this?
}
Sorry for asking these questions, Sir. I am a newbie in omnet.
Thank you for your answers.
To view this discussion on the web visit https://groups.google.com/d/msgid/omnetpp/PR3P192MB066792A9F7B9F78709D0BF958C830%40PR3P192MB0667.EURP192.PROD.OUTLOOK.COM.
I don’t know the FSM, the wakeup Will depend of the FSM. You have incldue it, I suppose that you have included for some reason.
You need to check the FSM, I suppose that this is in the CCA state, after the transmission end (you need to check the event) instead of to change the state, you need to continue en send state and send the next packet.
De: S Tanin
Enviado: miércoles, 10 de junio de 2020 13:16
Para: omn...@googlegroups.com
Asunto: Re: [Omnetpp-l] How to schedule data transmission duration based on queue status
Hello Alfonso,
Thank you Sir. I am confused about a couple of things. Would you please help me to understand these?
De: omn...@googlegroups.com <omn...@googlegroups.com> en nombre de S Tanin <stan...@gmail.com>
Enviado: Wednesday, June 10, 2020 12:17:57 PM
Para: OMNeT++ Users <omn...@googlegroups.com>
Asunto: Re: [Omnetpp-l] How to schedule data transmission duration based on queue status
Hello Alfonso,
Sir, would you kindly suggest me any sample code/syntax for this purpose?
Can you point me where the above code is in error?
I have been trying last 2 days, but could not figure out.
Kind Regards,
On Wednesday, June 10, 2020 at 8:03:58 PM UTC+10, Alfonso Ariza Quintana wrote:
I suspect that you are sending the timer several times
De: omn...@googlegroups.com <omn...@googlegroups.com> en nombre de S Tanin <stan...@gmail.com>
Enviado: miércoles, 10 de junio de 2020 8:58
Para: OMNeT++ Users <omn...@googlegroups.com>
Asunto: Re: [Omnetpp-l] How to schedule data transmission duration based on queue status
Hello Alfonso,
Sir, considering your suggestions, i have tried to implement it in different way but it is not working.
I am new in omnet++. Would you kindly correct my below code? Or can you suggest me code for this purpose?
if(!txQueue->isEmpty()) {
scheduleAt(simTime() + 5, timer); // max duration 5s
WATCH(timer);
macState = SEND_DATA;
if (timer == 0){
EV << "node " << address << " data transmission over" << endl;
}
else {
EV << "node " << address << " : Sending data" << endl;
sendDataPacket();
deleteCurrentTxFrame();
}
cancelEvent(timer);
scheduleAt(simTime() + checkinterval, wakeup);
}
Kind Regards,
On Tuesday, June 9, 2020 at 9:01:28 PM UTC+10, Alfonso Ariza Quintana wrote:
No necessarily, you can use an accumulate timer counter that is set to 0 at the beginning of the transmission, if the accumulate time since the node access to the channel is smaller than the limit + the packet pending in the queue it sends the packet, in other case change to listen (the timer is bigger or the queue is empty), this avoid the event and avoid that the timer could arrive in middle of a transmission.
If it doesn't matter to exceed the time for a bit, it is even more simple.
De: omn...@googlegroups.com <omn...@googlegroups.com> en nombre de S Tanin <stan...@gmail.com>
Enviado: martes, 9 de junio de 2020 12:45
Para: omn...@googlegroups.com <omn...@googlegroups.com>
Asunto: Re: [Omnetpp-l] How to schedule data transmission duration based on queue status
Hello Alfonso,
I want to implement a CSMA -based duty cycled protocol like BMAC/xmac. When a node finds the channel clear, it will schedule a timer to transmit all packets (one after another) that is in its queue. After sending all packets within that timer, it will go back to sleep.
So, i will need to schedule a timer to set data transmission duration. The node will keep sending packets until that time expires. I am not getting any change with the above mentioned code. Can you please correct me the code for this purpose?
Thank you.
On Tue, Jun 9, 2020 at 8:37 PM Alfonso Ariza Quintana <aari...@hotmail.com> wrote:
With your description it is not easy, byt I suppose that you want a TDMA protocol, you can use L-MAC like reference, LMac is a TDMA protocol
To view this discussion on the web visit https://groups.google.com/d/msgid/omnetpp/CAGnS17DS%3DhyaDu5gbxm-T5L_%2B2Yo3TgHpoC3MNEzwUpsVS9asw%40mail.gmail.com.
if(!txQueue->isEmpty()) {
macState = SEND_DATA;
startSendDataState = simTime(); // what data type of startSendDataState
EV << "node " << address << " : Sending data" << endl;
sendDataPacket();
deleteCurrentTxFrame();
scheduleAt(simTime() + checkinterval, wakeup); //
}
If (simTime() - startSendDataState < 5 && ¡txQueue->isEmpty()) {
macState = SEND_DATA;
sendDataPacket(); // don't i need to delete the sent frames after this?
}
Thank you Sir.
To view this discussion on the web visit https://groups.google.com/d/msgid/omnetpp/8ce50f4c-18c1-4afa-99a1-976d1fe54343o%40googlegroups.com.
--
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 omn...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/omnetpp/PR3P192MB066792A9F7B9F78709D0BF958C830%40PR3P192MB0667.EURP192.PROD.OUTLOOK.COM.
--
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 omn...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/omnetpp/CAGnS17DS%3DhyaDu5gbxm-T5L_%2B2Yo3TgHpoC3MNEzwUpsVS9asw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/omnetpp/c6c77221-a7db-4cb5-adbf-94b2433d5acco%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/omnetpp/91cbc01f-c6be-4eab-a2ca-2e2e017a961eo%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/omnetpp/481f75e7-1619-4045-8b12-648bd2828731o%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/omnetpp/9ddbbc19-4d0c-4246-9902-19ad1d2384eeo%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/omnetpp/9ddbbc19-4d0c-4246-9902-19ad1d2384eeo%40googlegroups.com.