ETT Function

27 views
Skip to first unread message

Mohsen Sichani

unread,
Sep 18, 2014, 6:10:38 AM9/18/14
to omn...@googlegroups.com
Hello All

Could you please let me know which function calculates the ETT between two adjacent nodes.

Is it "int Ieee80211Etx::getEtt(const MACAddress &add, double &val)"?

If yes, 

Actually, I am a little confused, I want to store the ETT values of two adjacent nodes in an array and keep them for later use until two nodes loses their connectivity, but I do not know where  I should write my code. 
Should the storing arrays be Global or local?should they define outside of the first loop "for"

 Any help is highly appreciated.

Best Regards
Mohsen

For your convenience , I have pasted the original code of the function,


int Ieee80211Etx::getEtt(const MACAddress &add, double &val)
{
if (ettInterval <= 0 || ettSize1 <= 0 || ettSize2 <= 0)
return -1;
val = 1e300;
int interface = -1;
for (unsigned int i = 0; i < neighbors.size(); i++)
{
NeighborsMap::iterator it = neighbors[i].find(add);
MacEtxNeighbor *neig;
if (it == neighbors[i].end())
{
continue;
}
else
{
neig = &(it->second);
if (neig->timeETT.empty())
continue;
int expectedPk = etxMeasureInterval / etxInterval;
int pkRec = neig->timeVector.size();
double pr = (double) pkRec / (double)expectedPk;
double ps = (double) neig->getPackets() / (double) expectedPk;
if (pr > 1)
pr = 1;
if (ps>1)
ps = 1;
double result;
if (ps == 0 || pr == 0)
result = 1e100;
else
{
double etx = 1 / (ps * pr);
simtime_t minTime = 100.0;
for (unsigned int i = 0; i < neig->timeETT.size(); i++)
if (minTime > neig->timeETT[i].delay)
minTime = neig->timeETT[i].delay;
double bw = (double) ettSize2 / SIMTIME_DBL(minTime);
result = etx * (etxSize / bw);
}
if (result<val)
{
val = result;
interface = (int)i;
}
}
}
return interface;
}

Alfonso Ariza Quintana

unread,
Sep 18, 2014, 7:29:29 AM9/18/14
to omn...@googlegroups.com

These method compute the ETT based in the values stored in a vector.

 

Periodically the module sends two packets to every neighbor, a short packet a and big packet, and the neighbor resends the packets and the node compute the ETT using the delay between both packets, the node stored the latest 10 values and uses like ETT the best of the 10 values.

 

If you want shared the value between the different nodes the value must be global, in other case the value must be local. If you want to model the problem of transmit the values in the network, in this case the value mas be local and it is necessary to include a protocol that allows to transmit the value to the different nodes. But if you don’t have interest in this problem now, it is better to use a global value, because it avoids the necessity of implements a protocol that could transmit the values to the different nodes.

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

Mohsen Sichani

unread,
Sep 18, 2014, 10:52:57 PM9/18/14
to omn...@googlegroups.com, aari...@hotmail.com
Hi dear Alfonso

I think I did that correctly. Thanks a million, I appreciate that, You are so supportive and kind.


I wish you all the best.

Cheers
Mohsen

...
Reply all
Reply to author
Forward
0 new messages