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;}
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.
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/omnetpp/CAGg5NNUcvDiVga27bvrqzPRU0mqbq%2BTrtc%3DEu4n4nK6md2O_3A%40mail.gmail.com.
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/omnetpp/fd625645-4481-4b65-858e-1fdba4bc9c08%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/CAGg5NNUcvDiVga27bvrqzPRU0mqbq%2BTrtc%3DEu4n4nK6md2O_3A%40mail.gmail.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/fd625645-4481-4b65-858e-1fdba4bc9c08%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.