Calculation of average throughput

90 views
Skip to first unread message

Aditi Gupta

unread,
Mar 28, 2020, 3:54:04 AM3/28/20
to omn...@googlegroups.com
I have two nodes with different payload which are sending packets to server.
Is the right way to calculate the  average throughput and end-to end delay at server.
void Server :: handleMessage(cMessage *msg)
{
    WATCH(numRecvd);
    pkt = check_and_cast<cPacket *>(msg);
   
    c_payload=c_payload+pkt->getByteLength();
   
    int avth=c_payload/simTime();//calculate average Throughput
   
    numRecvd++;//No.of packets received at server

    simtime_t eed = simTime() - msg->getCreationTime(); //End-to-End delay
   
    averageTroughput.record(avth);
    packetsRecieved.record(numRecvd);
    endToEndDelayVec.record(eed);

    delete pkt;
}



Ujjval Rathod

unread,
Mar 29, 2020, 5:43:22 AM3/29/20
to omn...@googlegroups.com
Only thing to tell from my side is that int avth should be simtime_t.



On Sat, Mar 28, 2020 at 8:54 AM Aditi Gupta <gupta8...@gmail.com> wrote:
I have two nodes with different payload which are sending packets to server.
Is the right way to calculate the throughput at server.
Enter code here...
void Server :: handleMessage(cMessage *msg)
{
    WATCH(numRecvd);
    pkt = check_and_cast<cPacket *>(msg);
   
    c_payload=c_payload+pkt->getByteLength();
   
    int avth=c_payload/simTime();//calculate average Throughput
   
    numRecvd++;//No.of packets received at server

    simtime_t eed = simTime() - msg->getCreationTime(); //End-to-End delay
   
    averageTroughput.record(avth);
    packetsRecieved.record(numRecvd);
    endToEndDelayVec.record(eed);

    delete pkt;

}


--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/omnetpp/fd625645-4481-4b65-858e-1fdba4bc9c08%40googlegroups.com.

Alfonso Ariza Quintana

unread,
Apr 1, 2020, 4:08:06 AM4/1/20
to omn...@googlegroups.com

 

The computation will depend what do you want to show. You are computing the accumulate throughput, that it is valid from the end result, but if you want to compute the variation of throughput in the simulation, you will need to compute in windows of time.

 

In this case you need to program a timer and measure the received data in the interval and divide it for the size of the time interval.

 

 

 

 

KK

unread,
Jun 16, 2020, 8:48:36 AM6/16/20
to OMNeT++ Users

Sir, can you say what is the function of the below command? Thanking you.

pkt = check_and_cast<cPacket *>(msg);

To unsubscribe from this group and stop receiving emails from it, send an email to omn...@googlegroups.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 unsubscribe from this group and stop receiving emails from it, send an email to omn...@googlegroups.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.

Alfonso Ariza Quintana

unread,
Jun 16, 2020, 10:35:43 AM6/16/20
to omn...@googlegroups.com
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/omnetpp/987513b0-902e-473d-b6ad-cb76e043f3f9o%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages