|
INET Framework for OMNeT++/OMNEST
|
Implementation of NetPerfMeter.
More...
#include <NetPerfMeter.h>
|
| static opp_string | format (const char *formatString,...) |
| |
| static void | parseExpressionVector (std::vector< cDynamicExpression > &expressionVector, const char *string, const char *delimiters=nullptr) |
| |
Implementation of NetPerfMeter.
See NED file for more details.
◆ Protocol
◆ TimerType
| Enumerator |
|---|
| TIMER_CONNECT | |
| TIMER_START | |
| TIMER_RESET | |
| TIMER_STOP | |
| TIMER_TRANSMIT | |
| TIMER_OFF | |
| TIMER_ON | |
◆ NetPerfMeter()
| inet::NetPerfMeter::NetPerfMeter |
( |
| ) |
|
◆ ~NetPerfMeter()
| inet::NetPerfMeter::~NetPerfMeter |
( |
| ) |
|
88 cancelAndDelete(elem);
◆ createAndBindSocket()
| void inet::NetPerfMeter::createAndBindSocket |
( |
| ) |
|
|
private |
697 const char *localAddress = par(
"localAddress");
698 const int localPort = par(
"localPort");
699 if ((
ActiveMode ==
false) && (localPort == 0)) {
700 throw cRuntimeError(
"No local port number given in active mode!");
704 localAddr = L3AddressResolver().resolve(localAddress);
Referenced by establishConnection(), and initialize().
◆ establishConnection()
| void inet::NetPerfMeter::establishConnection |
( |
| ) |
|
542 const char *remoteAddress = par(
"remoteAddress");
543 const int remotePort = par(
"remotePort");
549 const char *primaryPath = par(
"primaryPath");
550 PrimaryPath = (primaryPath[0] != 0x00) ? L3AddressResolver().resolve(primaryPath) : L3Address();
554 remoteAddressList.push_back(L3AddressResolver().resolve(remoteAddress));
575 EV << simTime() <<
", " << getFullPath() <<
": Sending allowed" << endl;
Referenced by handleTimer().
◆ finish()
| void inet::NetPerfMeter::finish |
( |
| ) |
|
|
overridevirtual |
251 std::map<unsigned int, SenderStatistics *>::iterator senderStatisticsIterator =
SenderStatisticsMap.begin();
253 delete senderStatisticsIterator->second;
257 std::map<unsigned int, ReceiverStatistics *>::iterator receiverStatisticsIterator =
ReceiverStatisticsMap.begin();
259 delete receiverStatisticsIterator->second;
◆ format()
| opp_string inet::NetPerfMeter::format |
( |
const char * |
formatString, |
|
|
|
... |
|
) |
| |
|
staticprivate |
1234 va_start(args, formatString);
1235 vsnprintf(str,
sizeof(str), formatString, args);
1237 return opp_string(str);
Referenced by writeStatistics().
◆ getFrameRate()
| double inet::NetPerfMeter::getFrameRate |
( |
const unsigned int |
streamID | ) |
|
|
private |
◆ getFrameSize()
| unsigned long inet::NetPerfMeter::getFrameSize |
( |
const unsigned int |
streamID | ) |
|
|
private |
◆ getReceiverStatistics()
| ReceiverStatistics* inet::NetPerfMeter::getReceiverStatistics |
( |
const unsigned int |
streamID | ) |
|
|
inlineprivate |
◆ getSenderStatistics()
| SenderStatistics* inet::NetPerfMeter::getSenderStatistics |
( |
const unsigned int |
streamID | ) |
|
|
inlineprivate |
◆ handleMessage()
| void inet::NetPerfMeter::handleMessage |
( |
cMessage * |
msg | ) |
|
|
overridevirtual |
379 if (msg->isSelfMessage()) {
384 switch (msg->getKind()) {
392 auto&
tags = check_and_cast<ITaggedObject *>(msg)->getTags();
393 auto dataIndication =
tags.getTag<SctpCommandReq>();
395 SctpInfoReq *command =
new SctpInfoReq();
396 command->setSocketId(dataIndication->getSocketId());
397 command->setSid(dataIndication->getSid());
398 command->setNumMsgs(dataIndication->getNumMsgs());
400 auto cmd = cmsg->addTag<SctpSendReq>();
401 cmd->setSocketId(dataIndication->getSocketId());
402 cmd->setSid(dataIndication->getSid());
403 cmsg->addTag<SocketReq>()->setSocketId(dataIndication->getSocketId());
405 send(cmsg,
"socketOut");
410 EV_INFO <<
"SCTP_I_AVAILABLE arrived\n";
411 Message *message = check_and_cast<Message *>(msg);
412 int newSockId = message->getTag<SctpAvailableReq>()->getNewSocketId();
413 EV_INFO <<
"new socket id = " << newSockId << endl;
415 cmsg->addTag<SctpAvailableReq>()->setSocketId(newSockId);
417 cmsg->addTag<SocketReq>()->setSocketId(newSockId);
418 EV_INFO <<
"Sending accept socket id request ..." << endl;
419 send(cmsg,
"socketOut");
424 Message *message = check_and_cast<Message *>(msg);
425 auto&
tags = message->getTags();
426 auto connectInfo =
tags.getTag<SctpConnectReq>();
442 Message *message = check_and_cast<Message *>(msg);
443 auto&
tags = message->getTags();
444 const auto& sendQueueAbatedIndication =
tags.getTag<SctpSendQueueAbatedReq>();
445 assert(sendQueueAbatedIndication !=
nullptr);
474 short kind = msg->getKind();
483 EV_INFO <<
"TCP_I_AVAILABLE arrived\n";
484 TcpAvailableInfo *availableInfo = check_and_cast<TcpAvailableInfo *>(msg->getControlInfo());
485 int newSockId = availableInfo->getNewSocketId();
486 EV_INFO <<
"new socket id = " << newSockId << endl;
487 Request *cmsg =
new Request(
"TCP_C_ACCEPT",
TCP_C_ACCEPT);
488 auto *acceptCmd =
new TcpAcceptCommand();
489 cmsg->setControlInfo(acceptCmd);
491 cmsg->addTag<SocketReq>()->setSocketId(newSockId);
492 EV_INFO <<
"Sending accept socket id request ..." << endl;
493 send(cmsg,
"socketOut");
502 const TcpCommand *tcpCommand = check_and_cast<TcpCommand *>(msg->getControlInfo());
524 switch (msg->getKind()) {
◆ handleTimer()
| void inet::NetPerfMeter::handleTimer |
( |
cMessage * |
msg | ) |
|
|
private |
295 const NetPerfMeterTransmitTimer *transmitTimer =
dynamic_cast<NetPerfMeterTransmitTimer *
>(msg);
307 EV << simTime() <<
", " << getFullPath() <<
": Entering OFF mode" << endl;
313 EV << simTime() <<
", " << getFullPath() <<
": Entering ON mode" << endl;
319 EV << simTime() <<
", " << getFullPath() <<
": Reset" << endl;
332 EV << simTime() <<
", " << getFullPath() <<
": STOP" << endl;
361 EV << simTime() <<
", " << getFullPath() <<
": Start" << endl;
368 EV << simTime() <<
", " << getFullPath() <<
": Connect" << endl;
Referenced by handleMessage().
◆ initialize()
| void inet::NetPerfMeter::initialize |
( |
int |
stage | ) |
|
|
overridevirtual |
134 const char *protocolPar = par(
"protocol");
135 if (strcmp(protocolPar,
"TCP") == 0) {
138 else if (strcmp(protocolPar,
"SCTP") == 0) {
141 else if (strcmp(protocolPar,
"UDP") == 0) {
145 throw cRuntimeError(
"Bad protocol setting!");
158 throw cRuntimeError(
"Invalid number of outbound streams; use range from [1, 65535]");
162 throw cRuntimeError(
"Invalid number of inbound streams; use range from [1, 65535]");
166 throw cRuntimeError(
"Bad value for unordered probability; use range from [0.0, 1.0]");
170 throw cRuntimeError(
"Bad value for unreliable probability; use range from [0.0, 1.0]");
176 if (strcmp(par(
"traceFile").stringValue(),
"") != 0) {
177 std::fstream traceFile(par(
"traceFile").stringValue());
178 if (!traceFile.good()) {
179 throw cRuntimeError(
"Unable to load trace file");
181 while (!traceFile.eof()) {
182 TraceEntry traceEntry;
183 traceEntry.InterFrameDelay = 0;
184 traceEntry.FrameSize = 0;
185 traceEntry.StreamID = 0;
188 traceFile.getline(line,
sizeof(line),
'\n');
189 if (sscanf(line,
"%lf %u %u", &traceEntry.InterFrameDelay, &traceEntry.FrameSize, &traceEntry.StreamID) >= 2) {
203 SenderStatistics *senderStatistics =
new SenderStatistics;
204 SenderStatisticsMap.insert(std::pair<unsigned int, SenderStatistics *>(i, senderStatistics));
207 ReceiverStatistics *receiverStatistics =
new ReceiverStatistics;
222 EV << simTime() <<
", " << getFullPath() <<
": Initialize"
◆ numInitStages()
| virtual int inet::NetPerfMeter::numInitStages |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ parseExpressionVector()
| void inet::NetPerfMeter::parseExpressionVector |
( |
std::vector< cDynamicExpression > & |
expressionVector, |
|
|
const char * |
string, |
|
|
const char * |
delimiters = nullptr |
|
) |
| |
|
staticprivate |
118 expressionVector.clear();
119 cStringTokenizer tokenizer(
string, delimiters);
120 while (tokenizer.hasMoreTokens()) {
121 const char *token = tokenizer.nextToken();
122 cDynamicExpression expression;
123 expression.parse(token);
124 expressionVector.push_back(expression);
Referenced by initialize().
◆ receiveMessage()
| void inet::NetPerfMeter::receiveMessage |
( |
cMessage * |
msg | ) |
|
1166 if (
const Packet *dataMessage =
dynamic_cast<const Packet *
>(msg)) {
1167 unsigned int streamID = 0;
1168 const auto& smsg = dataMessage->peekData();
1171 auto&
tags = check_and_cast<ITaggedObject *>(msg)->getTags();
1172 auto& receiveCommand =
tags.findTag<SctpRcvReq>();
1173 streamID = receiveCommand->getSid();
1177 receiverStatistics->ReceivedMessages++;
1178 receiverStatistics->ReceivedBytes +=
B(smsg->getChunkLength()).get();
1179 for (
auto& region : smsg->getAllTags<CreationTimeTag>())
1180 receiverStatistics->ReceivedDelayHistogram.collect(simTime() - region.getTag()->getCreationTime());
Referenced by handleMessage().
◆ refreshDisplay()
| void inet::NetPerfMeter::refreshDisplay |
( |
| ) |
const |
|
overridevirtual |
268 unsigned long long totalSentBytes = 0;
269 for (std::map<unsigned int, SenderStatistics *>::const_iterator iterator =
SenderStatisticsMap.begin();
272 const SenderStatistics *senderStatistics = iterator->second;
273 totalSentBytes += senderStatistics->SentBytes;
276 unsigned long long totalReceivedBytes = 0;
277 for (std::map<unsigned int, ReceiverStatistics *>::const_iterator iterator =
ReceiverStatisticsMap.begin();
280 const ReceiverStatistics *receiverStatistics = iterator->second;
281 totalReceivedBytes += receiverStatistics->ReceivedBytes;
285 snprintf(status,
sizeof(status),
"In: %llu, Out: %llu",
286 totalReceivedBytes, totalSentBytes);
287 getDisplayString().setTagArg(
"t", 0, status);
◆ resetStatistics()
| void inet::NetPerfMeter::resetStatistics |
( |
| ) |
|
792 SenderStatistics *senderStatistics = elem.second;
793 senderStatistics->reset();
796 ReceiverStatistics *receiverStatistics = elem.second;
797 receiverStatistics->reset();
Referenced by handleTimer(), NetPerfMeter(), and writeStatistics().
◆ sendDataOfNonSaturatedStreams()
| void inet::NetPerfMeter::sendDataOfNonSaturatedStreams |
( |
const unsigned long long |
bytesAvailableInQueue, |
|
|
const unsigned int |
streamID |
|
) |
| |
|
private |
1089 if (frameRate <= 0.0) {
1098 if (frameSize < 1) {
1102 throw cRuntimeError(
"TCP and UDP do not support \"send as much as possible\" mode (frameRate=0)!");
1121 const double nextFrameTime = 1.0 / frameRate;
Referenced by handleTimer(), and startSending().
◆ sendDataOfSaturatedStreams()
| void inet::NetPerfMeter::sendDataOfSaturatedStreams |
( |
const unsigned long long |
bytesAvailableInQueue, |
|
|
const Ptr< const SctpSendQueueAbatedReq > & |
sendQueueAbatedIndication |
|
) |
| |
|
private |
1034 unsigned long long contingent;
1036 if (sendQueueAbatedIndication ==
nullptr) {
1041 queued[streamID] = 0;
1045 assert(ActualOutboundStreams <= sendQueueAbatedIndication->getQueuedForStreamArraySize());
1047 queued[streamID] = sendQueueAbatedIndication->getQueuedForStream(streamID);
1055 unsigned long long newlyQueuedBytes = 0;
1063 if (frameRate < 0.0000001) {
1067 if (frameSize >= 1) {
1069 newlyQueuedBytes += sent;
1077 }
while ((newlyQueuedBytes < bytesAvailableInQueue) && (progress ==
true));
Referenced by handleMessage(), and startSending().
◆ sendDataOfTraceFile()
| void inet::NetPerfMeter::sendDataOfTraceFile |
( |
const unsigned long long |
bytesAvailableInQueue | ) |
|
|
private |
◆ sendSCTPQueueRequest()
| void inet::NetPerfMeter::sendSCTPQueueRequest |
( |
const unsigned int |
queueSize | ) |
|
◆ sendTCPQueueRequest()
| void inet::NetPerfMeter::sendTCPQueueRequest |
( |
const unsigned int |
queueSize | ) |
|
1215 TcpCommand *queueInfo =
new TcpCommand();
1216 queueInfo->setUserId(queueSize);
1219 request->setControlInfo(queueInfo);
1220 request->addTag<SocketReq>()->setSocketId(
ConnectionID);
Referenced by successfullyEstablishedConnection().
◆ startSending()
| void inet::NetPerfMeter::startSending |
( |
| ) |
|
|
private |
667 const simtime_t onTime = par(
"onTime");
668 if (onTime.dbl() > 0.0) {
Referenced by handleTimer().
◆ stopSending()
| void inet::NetPerfMeter::stopSending |
( |
| ) |
|
|
private |
679 cancelAndDelete(elem);
685 const simtime_t offDuration = par(
"offTime");
686 if ((offDuration.dbl() > 0.0)
690 scheduleAfter(offDuration,
OnTimer);
Referenced by handleTimer().
◆ successfullyEstablishedConnection()
| void inet::NetPerfMeter::successfullyEstablishedConnection |
( |
cMessage * |
msg, |
|
|
const unsigned int |
queueSize |
|
) |
| |
584 EV <<
"Already finished -> no new connection!" << endl;
585 SctpSocket newSocket(msg);
591 if (queueSize != 0) {
593 EV << simTime() <<
", " << getFullPath() <<
": Got queue size " <<
QueueSize <<
" from transport protocol" << endl;
607 ConnectionID = check_and_cast<Indication *>(msg)->getTag<SocketInd>()->getSocketId();
620 ConnectionID = check_and_cast<Indication *>(msg)->getTag<SocketInd>()->getSocketId();
636 throw cRuntimeError(
"Connection establishment has been too late. Check startTime parameter!");
Referenced by establishConnection(), and handleMessage().
◆ teardownConnection()
| void inet::NetPerfMeter::teardownConnection |
( |
const bool |
stopTimeReached = false | ) |
|
◆ transmitFrame()
| unsigned long inet::NetPerfMeter::transmitFrame |
( |
const unsigned int |
frameSize, |
|
|
const unsigned int |
streamID |
|
) |
| |
|
private |
892 EV << simTime() <<
", " << getFullPath() <<
": Transmit frame of size "
893 << frameSize <<
" on stream #" << streamID << endl;
897 unsigned long newlyQueuedBytes = 0;
900 auto cmsg =
new Packet(
"NetPerfMeterDataMessage");
901 auto dataMessage = makeShared<BytesChunk>();
902 std::vector<uint8_t> vec;
903 vec.resize(frameSize);
904 for (uint32_t i = 0; i < frameSize; i++)
905 vec[i] = ((i & 1) ?
'D' :
'T');
906 dataMessage->setBytes(vec);
907 dataMessage->addTag<CreationTimeTag>()->setCreationTime(simTime());
908 cmsg->insertAtBack(dataMessage);
917 newlyQueuedBytes += frameSize;
919 senderStatistics->SentBytes += frameSize;
920 senderStatistics->SentMessages++;
924 unsigned int bytesToSend = frameSize;
931 #ifdef INET_WITH_SCTP
936 auto cmsg =
new Packet(
"NetPerfMeterDataMessage");
937 auto dataMessage = makeShared<BytesChunk>();
938 std::vector<uint8_t> vec;
940 for (uint32_t i = 0; i < msgSize; i++)
941 vec[i] = ((i & 1) ?
'D' :
'T');
942 dataMessage->setBytes(vec);
943 dataMessage->addTag<CreationTimeTag>()->setCreationTime(simTime());
944 cmsg->insertAtBack(dataMessage);
947 auto command = cmsg->addTag<SctpSendReq>();
949 command->setSid(streamID);
951 command->setLast(
true);
954 command->setPrValue(1);
955 command->setPrMethod((sendUnreliable ==
true) ? 2 : 0);
959 send(cmsg,
"socketOut");
962 senderStatistics->SentBytes += msgSize;
963 senderStatistics->SentMessages++;
968 auto cmsg =
new Packet(
"NetPerfMeterDataMessage");
969 auto dataMessage = makeShared<BytesChunk>();
970 std::vector<uint8_t> vec;
972 for (uint32_t i = 0; i < msgSize; i++)
973 vec[i] = ((i & 1) ?
'D' :
'T');
974 dataMessage->setBytes(vec);
975 dataMessage->addTag<CreationTimeTag>()->setCreationTime(simTime());
976 cmsg->insertAtBack(dataMessage);
981 senderStatistics->SentBytes += msgSize;
982 senderStatistics->SentMessages++;
985 newlyQueuedBytes += msgSize;
986 bytesToSend -= msgSize;
987 }
while (bytesToSend > 0);
989 return newlyQueuedBytes;
Referenced by sendDataOfNonSaturatedStreams(), sendDataOfSaturatedStreams(), and sendDataOfTraceFile().
◆ writeStatistics()
| void inet::NetPerfMeter::writeStatistics |
( |
| ) |
|
804 const simtime_t statisticsStopTime = simTime();
807 recordScalar(
"Total Measurement Duration", duration);
811 unsigned long long totalSentBytes = 0;
812 unsigned long long totalSentMessages = 0;
813 for (std::map<unsigned int, SenderStatistics *>::const_iterator iterator =
817 const unsigned int streamID = iterator->first;
821 const SenderStatistics *senderStatistics = iterator->second;
822 totalSentBytes += senderStatistics->SentBytes;
823 totalSentMessages += senderStatistics->SentMessages;
825 const double transmissionBitRate = (duration > 0.0) ? (8 * senderStatistics->SentBytes / duration) : 0.0;
826 const double transmissionByteRate = (duration > 0.0) ? (senderStatistics->SentBytes / duration) : 0.0;
827 const double transmissionMessageRate = (duration > 0.0) ? (senderStatistics->SentMessages / duration) : 0.0;
828 recordScalar(
format(
"Transmission Bit Rate Stream #%u", streamID).c_str(), transmissionBitRate);
829 recordScalar(
format(
"Transmission Byte Rate Stream #%u", streamID).c_str(), transmissionByteRate);
830 recordScalar(
format(
"Transmission Message Rate Stream #%u", streamID).c_str(), transmissionMessageRate);
831 recordScalar(
format(
"Sent Bytes Stream #%u", streamID).c_str(), senderStatistics->SentBytes);
832 recordScalar(
format(
"Sent Messages Stream #%u", streamID).c_str(), senderStatistics->SentMessages);
835 unsigned long long totalReceivedBytes = 0;
836 unsigned long long totalReceivedMessages = 0;
838 const unsigned int streamID = elem.first;
842 ReceiverStatistics *receiverStatistics = elem.second;
843 totalReceivedBytes += receiverStatistics->ReceivedBytes;
844 totalReceivedMessages += receiverStatistics->ReceivedMessages;
849 const double receptionBitRate = (duration > 0.0) ? (8 * receiverStatistics->ReceivedBytes / duration) : 0.0;
850 const double receptionByteRate = (duration > 0.0) ? (receiverStatistics->ReceivedBytes / duration) : 0.0;
851 const double receptionMessageRate = (duration > 0.0) ? (receiverStatistics->ReceivedMessages / duration) : 0.0;
852 recordScalar(
format(
"Reception Bit Rate Stream #%u", streamID).c_str(), receptionBitRate);
853 recordScalar(
format(
"Reception Byte Rate Stream #%u", streamID).c_str(), receptionByteRate);
854 recordScalar(
format(
"Reception Message Rate Stream #%u", streamID).c_str(), receptionMessageRate);
855 recordScalar(
format(
"Received Bytes Stream #%u", streamID).c_str(), receiverStatistics->ReceivedBytes);
856 recordScalar(
format(
"Received Messages Stream #%u", streamID).c_str(), receiverStatistics->ReceivedMessages);
857 receiverStatistics->ReceivedDelayHistogram.recordAs(
format(
"Received Message Delay Stream #%u", streamID).c_str(),
"s");
864 const double totalReceptionBitRate = (duration > 0.0) ? (8 * totalReceivedBytes / duration) : 0.0;
865 const double totalReceptionByteRate = (duration > 0.0) ? (totalReceivedBytes / duration) : 0.0;
866 const double totalReceptionMessageRate = (duration > 0.0) ? (totalReceivedMessages / duration) : 0.0;
867 const double totalTransmissionBitRate = (duration > 0.0) ? (8 * totalSentBytes / duration) : 0.0;
868 const double totalTransmissionByteRate = (duration > 0.0) ? (totalSentBytes / duration) : 0.0;
869 const double totalTransmissionMessageRate = (duration > 0.0) ? (totalSentMessages / duration) : 0.0;
873 recordScalar(
"Total Transmission Bit Rate", totalTransmissionBitRate);
874 recordScalar(
"Total Transmission Byte Rate", totalTransmissionByteRate);
875 recordScalar(
"Total Transmission Message Rate", totalTransmissionMessageRate);
876 recordScalar(
"Total Sent Bytes", totalSentBytes);
877 recordScalar(
"Total Sent Messages", totalSentMessages);
879 recordScalar(
"Total Reception Bit Rate", totalReceptionBitRate);
880 recordScalar(
"Total Reception Byte Rate", totalReceptionByteRate);
881 recordScalar(
"Total Reception Message Rate", totalReceptionMessageRate);
882 recordScalar(
"Total Received Bytes", totalReceivedBytes);
883 recordScalar(
"Total Received Messages", totalReceivedMessages);
Referenced by teardownConnection().
◆ ActiveMode
| bool inet::NetPerfMeter::ActiveMode = false |
|
protected |
◆ ActualInboundStreams
| unsigned int inet::NetPerfMeter::ActualInboundStreams = 0 |
|
protected |
◆ ActualOutboundStreams
| unsigned int inet::NetPerfMeter::ActualOutboundStreams = 0 |
|
protected |
◆ ConnectionEstablishmentTime
| simtime_t inet::NetPerfMeter::ConnectionEstablishmentTime |
|
protected |
◆ ConnectionID
| int inet::NetPerfMeter::ConnectionID = 0 |
|
protected |
◆ ConnectTime
| simtime_t inet::NetPerfMeter::ConnectTime |
|
protected |
◆ ConnectTimer
| cMessage* inet::NetPerfMeter::ConnectTimer = nullptr |
|
protected |
◆ DecoupleSaturatedStreams
| bool inet::NetPerfMeter::DecoupleSaturatedStreams = false |
|
protected |
◆ FrameRateExpressionVector
| std::vector<cDynamicExpression> inet::NetPerfMeter::FrameRateExpressionVector |
|
protected |
◆ FrameSizeExpressionVector
| std::vector<cDynamicExpression> inet::NetPerfMeter::FrameSizeExpressionVector |
|
protected |
◆ HasFinished
| bool inet::NetPerfMeter::HasFinished = false |
|
protected |
◆ IncomingSocketSCTP
| SctpSocket* inet::NetPerfMeter::IncomingSocketSCTP = nullptr |
|
protected |
◆ IncomingSocketTCP
| TcpSocket* inet::NetPerfMeter::IncomingSocketTCP = nullptr |
|
protected |
◆ LastStreamID
| unsigned int inet::NetPerfMeter::LastStreamID = 0 |
|
protected |
◆ MaxInboundStreams
| unsigned int inet::NetPerfMeter::MaxInboundStreams = 0 |
|
protected |
◆ MaxMsgSize
| unsigned int inet::NetPerfMeter::MaxMsgSize = 0 |
|
protected |
◆ MaxOnOffCycles
| int inet::NetPerfMeter::MaxOnOffCycles = 0 |
|
protected |
◆ OffTimer
| cMessage* inet::NetPerfMeter::OffTimer = nullptr |
|
protected |
◆ OnOffCycleCounter
| unsigned int inet::NetPerfMeter::OnOffCycleCounter = 0 |
|
protected |
◆ OnTimer
| cMessage* inet::NetPerfMeter::OnTimer = nullptr |
|
protected |
◆ PrimaryPath
◆ QueueSize
| unsigned int inet::NetPerfMeter::QueueSize = 0 |
|
protected |
◆ ReceiverStatisticsMap
◆ RequestedOutboundStreams
| unsigned int inet::NetPerfMeter::RequestedOutboundStreams = 0 |
|
protected |
◆ ResetTime
| simtime_t inet::NetPerfMeter::ResetTime |
|
protected |
◆ ResetTimer
| cMessage* inet::NetPerfMeter::ResetTimer = nullptr |
|
protected |
◆ SenderStatisticsMap
| std::map<unsigned int, SenderStatistics *> inet::NetPerfMeter::SenderStatisticsMap |
|
private |
◆ SendingAllowed
| bool inet::NetPerfMeter::SendingAllowed = false |
|
protected |
◆ SocketSCTP
| SctpSocket* inet::NetPerfMeter::SocketSCTP = nullptr |
|
protected |
◆ SocketTCP
| TcpSocket* inet::NetPerfMeter::SocketTCP = nullptr |
|
protected |
◆ SocketUDP
| UdpSocket* inet::NetPerfMeter::SocketUDP = nullptr |
|
protected |
◆ StartTime
| simtime_t inet::NetPerfMeter::StartTime |
|
protected |
◆ StartTimer
| cMessage* inet::NetPerfMeter::StartTimer = nullptr |
|
protected |
◆ StatisticsResetTime
| simtime_t inet::NetPerfMeter::StatisticsResetTime |
|
protected |
◆ StatisticsStartTime
| simtime_t inet::NetPerfMeter::StatisticsStartTime |
|
protected |
◆ StopTime
| simtime_t inet::NetPerfMeter::StopTime |
|
protected |
◆ StopTimer
| cMessage* inet::NetPerfMeter::StopTimer = nullptr |
|
protected |
◆ TraceIndex
| size_t inet::NetPerfMeter::TraceIndex = 0 |
|
protected |
◆ TraceVector
| std::vector<TraceEntry> inet::NetPerfMeter::TraceVector |
|
protected |
◆ TransmissionStartTime
| simtime_t inet::NetPerfMeter::TransmissionStartTime |
|
protected |
◆ TransmitTimerVector
◆ TransportProtocol
Referenced by createAndBindSocket(), establishConnection(), finish(), handleMessage(), handleTimer(), initialize(), receiveMessage(), sendDataOfNonSaturatedStreams(), sendDataOfTraceFile(), successfullyEstablishedConnection(), teardownConnection(), and transmitFrame().
◆ UnorderedMode
| double inet::NetPerfMeter::UnorderedMode = NAN |
|
protected |
◆ UnreliableMode
| double inet::NetPerfMeter::UnreliableMode = NAN |
|
protected |
The documentation for this class was generated from the following files:
@ TCP_I_TIMED_OUT
Definition: TcpCommand_m.h:133
void setOutputGate(cGate *toUdp)
Sets the gate on which to send to UDP.
Definition: UdpSocket.h:117
@ TIMER_ON
Definition: NetPerfMeter.h:72
@ SCTP_C_SEND_UNORDERED
Definition: SctpCommand_m.h:138
@ TCP_C_QUEUE_BYTES_LIMIT
Definition: TcpCommand_m.h:89
virtual void send(Packet *msg) override
Sends data packet.
Definition: TcpSocket.cc:147
std::vector< L3Address > AddressVector
Definition: SctpCommand_m.h:70
TcpSocket * IncomingSocketTCP
Definition: NetPerfMeter.h:109
void setOutputGate(cGate *toSctp)
Sets the gate on which to send to SCTP.
Definition: SctpSocket.h:174
@ TIMER_TRANSMIT
Definition: NetPerfMeter.h:70
void bind(int localPort)
Bind the socket to a local port number.
Definition: UdpSocket.cc:34
@ TCP_I_CLOSED
Definition: TcpCommand_m.h:130
simtime_t ResetTime
Definition: NetPerfMeter.h:86
cMessage * OnTimer
Definition: NetPerfMeter.h:93
void sendDataOfNonSaturatedStreams(const unsigned long long bytesAvailableInQueue, const unsigned int streamID)
Definition: NetPerfMeter.cc:1082
@ SCTP_I_CLOSED
Definition: SctpCommand_m.h:201
unsigned int OnOffCycleCounter
Definition: NetPerfMeter.h:94
void sendDataOfSaturatedStreams(const unsigned long long bytesAvailableInQueue, const Ptr< const SctpSendQueueAbatedReq > &sendQueueAbatedIndication)
Definition: NetPerfMeter.cc:1023
std::map< unsigned int, SenderStatistics * > SenderStatisticsMap
Definition: NetPerfMeter.h:163
simtime_t StatisticsResetTime
Definition: NetPerfMeter.h:126
@ SCTP_I_SENDQUEUE_FULL
Definition: SctpCommand_m.h:210
void teardownConnection(const bool stopTimeReached=false)
Definition: NetPerfMeter.cc:735
void createAndBindSocket()
Definition: NetPerfMeter.cc:695
unsigned int QueueSize
Definition: NetPerfMeter.h:80
int ConnectionID
Definition: NetPerfMeter.h:111
static const Protocol tcp
Definition: Protocol.h:112
@ TCP_I_ESTABLISHED
Definition: TcpCommand_m.h:128
static opp_string format(const char *formatString,...)
Definition: NetPerfMeter.cc:1230
std::vector< cDynamicExpression > FrameRateExpressionVector
Definition: NetPerfMeter.h:102
@ TCP_I_PEER_CLOSED
Definition: TcpCommand_m.h:129
@ SCTP
Definition: NetPerfMeter.h:63
@ SCTP_I_SENDQUEUE_ABATED
Definition: SctpCommand_m.h:211
@ TIMER_START
Definition: NetPerfMeter.h:67
@ TIMER_RESET
Definition: NetPerfMeter.h:68
void sendDataOfTraceFile(const unsigned long long bytesAvailableInQueue)
Definition: NetPerfMeter.cc:1130
void sendRequest(cMessage *msg)
Send request.
Definition: SctpSocket.cc:389
simtime_t ConnectTime
Definition: NetPerfMeter.h:84
std::vector< cDynamicExpression > FrameSizeExpressionVector
Definition: NetPerfMeter.h:103
@ TCP_I_AVAILABLE
Definition: TcpCommand_m.h:127
removed DscpReq Ipv4ControlInfo Ipv6ControlInfo up L3AddressInd DispatchProtocolReq L4PortInd Ipv4ControlInfo Ipv6ControlInfo down DispatchProtocolReq
Definition: IUdp-gates.txt:25
void sendCommand(Request *msg)
Sends command.
Definition: TcpSocket.cc:156
void connect(L3Address remoteAddr, int remotePort)
Active OPEN to the given remote socket.
Definition: TcpSocket.cc:122
void handleTimer(cMessage *msg)
Definition: NetPerfMeter.cc:292
double getFrameRate(const unsigned int streamID)
Definition: NetPerfMeter.cc:993
@ SCTP_I_CONN_LOST
Definition: SctpCommand_m.h:207
@ TCP_C_ACCEPT
Definition: TcpCommand_m.h:84
void sendTCPQueueRequest(const unsigned int queueSize)
Definition: NetPerfMeter.cc:1207
@ SCTP_I_CONNECTION_REFUSED
Definition: SctpCommand_m.h:202
simtime_t StatisticsStartTime
Definition: NetPerfMeter.h:132
@ SCTP_C_ACCEPT_SOCKET_ID
Definition: SctpCommand_m.h:153
@ TCP_I_CONNECTION_RESET
Definition: TcpCommand_m.h:132
SctpSocket * SocketSCTP
Definition: NetPerfMeter.h:106
@ TCP_I_URGENT_DATA
Definition: TcpCommand_m.h:126
bool ActiveMode
Definition: NetPerfMeter.h:76
bool isUnspecified() const
Definition: L3Address.cc:138
@ SCTP_C_RECEIVE
Definition: SctpCommand_m.h:136
@ SCTP_I_DATA
Definition: SctpCommand_m.h:197
SctpSocket * IncomingSocketSCTP
Definition: NetPerfMeter.h:107
virtual void send(Packet *msg) override
Sends a data packet to the address and port specified previously in a connect() call.
Definition: UdpSocket.cc:80
ReceiverStatistics * getReceiverStatistics(const unsigned int streamID)
Definition: NetPerfMeter.h:172
void close(int id)
Closes the local end of the connection.
Definition: SctpSocket.cc:394
void writeStatistics()
Definition: NetPerfMeter.cc:802
static void parseExpressionVector(std::vector< cDynamicExpression > &expressionVector, const char *string, const char *delimiters=nullptr)
Definition: NetPerfMeter.cc:114
@ SCTP_I_ESTABLISHED
Definition: SctpCommand_m.h:199
unsigned long getFrameSize(const unsigned int streamID)
Definition: NetPerfMeter.cc:1009
void connect(L3Address remoteAddr, int remotePort)
Connects to a remote UDP socket.
Definition: UdpSocket.cc:53
bool SendingAllowed
Definition: NetPerfMeter.h:77
intscale< b, 1, 8 > B
Definition: Units.h:1168
void listen(bool fork=true, bool streamReset=false, uint32_t requests=0, uint32_t messagesToPush=0)
Initiates passive OPEN.
Definition: SctpSocket.cc:183
@ SCTP_C_SEND_ORDERED
Definition: SctpCommand_m.h:137
unsigned int MaxInboundStreams
Definition: NetPerfMeter.h:99
unsigned int LastStreamID
Definition: NetPerfMeter.h:129
void setOutboundStreams(int streams)
Setter and getter methods for socket and API Parameters.
Definition: SctpSocket.h:179
@ SCTP_I_CONNECTION_RESET
Definition: SctpCommand_m.h:203
cMessage * ConnectTimer
Definition: NetPerfMeter.h:88
@ UDP
Definition: NetPerfMeter.h:63
@ SCTP_C_QUEUE_BYTES_LIMIT
Definition: SctpCommand_m.h:140
@ SCTP_I_SHUTDOWN_RECEIVED
Definition: SctpCommand_m.h:209
bool HasFinished
Definition: NetPerfMeter.h:78
@ SCTP_I_PEER_CLOSED
Definition: SctpCommand_m.h:200
std::vector< TraceEntry > TraceVector
Definition: NetPerfMeter.h:120
@ TIMER_STOP
Definition: NetPerfMeter.h:69
void listen(bool fork)
Definition: TcpSocket.cc:95
@ TIMER_CONNECT
Definition: NetPerfMeter.h:66
int MaxOnOffCycles
Definition: NetPerfMeter.h:95
INET_API InitStage INITSTAGE_LOCAL
Initialization of local state that don't use or affect other modules includes:
double UnreliableMode
Definition: NetPerfMeter.h:82
removed DscpReq kind
Definition: IUdp-gates.txt:12
SenderStatistics * getSenderStatistics(const unsigned int streamID)
Definition: NetPerfMeter.h:166
L3Address PrimaryPath
Definition: NetPerfMeter.h:112
cMessage * StartTimer
Definition: NetPerfMeter.h:89
std::map< unsigned int, ReceiverStatistics * > ReceiverStatisticsMap
Definition: NetPerfMeter.h:164
#define NUM_INIT_STAGES
Definition: InitStageRegistry.h:73
@ SCTP_I_DATA_NOTIFICATION
Definition: SctpCommand_m.h:198
unsigned int ActualOutboundStreams
Definition: NetPerfMeter.h:100
size_t TraceIndex
Definition: NetPerfMeter.h:121
simtime_t ConnectionEstablishmentTime
Definition: NetPerfMeter.h:125
@ SCTP_I_TIMED_OUT
Definition: SctpCommand_m.h:204
unsigned int MaxMsgSize
Definition: NetPerfMeter.h:79
void receiveMessage(cMessage *msg)
Definition: NetPerfMeter.cc:1164
void stopSending()
Definition: NetPerfMeter.cc:675
simtime_t StartTime
Definition: NetPerfMeter.h:85
simtime_t TransmissionStartTime
Definition: NetPerfMeter.h:124
INET_API InitStage INITSTAGE_APPLICATION_LAYER
Initialization of applications.
void connectx(AddressVector remoteAddresses, int32_t remotePort, bool streamReset=false, int32_t prMethod=0, uint32_t numRequests=0)
Active OPEN to the given remote socket.
Definition: SctpSocket.cc:348
@ COMPLETE_MESG_ORDERED
Definition: SctpCommand_m.h:236
@ UDP_I_DATA
Definition: UdpControlInfo_m.h:157
@ SCTP_I_ABORT
Definition: SctpCommand_m.h:206
static const Protocol sctp
Definition: Protocol.h:108
void sendSCTPQueueRequest(const unsigned int queueSize)
Definition: NetPerfMeter.cc:1185
unsigned long transmitFrame(const unsigned int frameSize, const unsigned int streamID)
Definition: NetPerfMeter.cc:889
void establishConnection()
Definition: NetPerfMeter.cc:540
@ COMPLETE_MESG_UNORDERED
Definition: SctpCommand_m.h:235
* tags
Definition: IUdp-gates.txt:3
bool DecoupleSaturatedStreams
Definition: NetPerfMeter.h:83
simtime_t StopTime
Definition: NetPerfMeter.h:87
@ TCP
Definition: NetPerfMeter.h:63
cMessage * ResetTimer
Definition: NetPerfMeter.h:91
void startSending()
Definition: NetPerfMeter.cc:654
unsigned int RequestedOutboundStreams
Definition: NetPerfMeter.h:98
std::vector< NetPerfMeterTransmitTimer * > TransmitTimerVector
Definition: NetPerfMeter.h:96
void abort()
Aborts the connection.
Definition: TcpSocket.cc:175
cMessage * StopTimer
Definition: NetPerfMeter.h:90
void bind(int localPort)
Bind the socket to a local port number.
Definition: TcpSocket.cc:69
TcpSocket * SocketTCP
Definition: NetPerfMeter.h:108
void setOutputGate(cGate *toTcp)
Sets the gate on which to send to TCP.
Definition: TcpSocket.h:242
@ TCP_I_DATA
Definition: TcpCommand_m.h:125
void close() override
Closes the local end of the connection.
Definition: TcpSocket.cc:161
void resetStatistics()
Definition: NetPerfMeter.cc:788
@ TIMER_OFF
Definition: NetPerfMeter.h:71
void bind(int localPort)
Bind the socket to a local port number.
Definition: SctpSocket.cc:142
void successfullyEstablishedConnection(cMessage *msg, const unsigned int queueSize)
Definition: NetPerfMeter.cc:580
@ UDP_I_ERROR
Definition: UdpControlInfo_m.h:158
unsigned int ActualInboundStreams
Definition: NetPerfMeter.h:101
@ TCP_I_SEND_MSG
Definition: TcpCommand_m.h:135
void renewSocket()
Required to re-connect with a "used" TcpSocket object.
Definition: TcpSocket.cc:249
void setInboundStreams(int streams)
Definition: SctpSocket.h:180
@ SCTP_I_AVAILABLE
Definition: SctpCommand_m.h:218
cMessage * OffTimer
Definition: NetPerfMeter.h:92
UdpSocket * SocketUDP
Definition: NetPerfMeter.h:110
Protocol TransportProtocol
Definition: NetPerfMeter.h:75
double UnorderedMode
Definition: NetPerfMeter.h:81
@ TCP_I_CONNECTION_REFUSED
Definition: TcpCommand_m.h:131