INET Framework for OMNeT++/OMNEST
inet::NetPerfMeter Class Reference

Implementation of NetPerfMeter. More...

#include <NetPerfMeter.h>

Inheritance diagram for inet::NetPerfMeter:

Classes

class  ReceiverStatistics
 
class  SenderStatistics
 
struct  TraceEntry
 

Public Member Functions

 NetPerfMeter ()
 
 ~NetPerfMeter ()
 
virtual void initialize () override
 
virtual void finish () override
 
virtual void handleMessage (cMessage *msg) override
 
virtual void refreshDisplay () const override
 
void establishConnection ()
 
void successfullyEstablishedConnection (cMessage *msg, const unsigned int queueSize)
 
void teardownConnection (const bool stopTimeReached=false)
 
void receiveMessage (cMessage *msg)
 
void resetStatistics ()
 
void writeStatistics ()
 
void sendSCTPQueueRequest (const unsigned int queueSize)
 
void sendTCPQueueRequest (const unsigned int queueSize)
 

Protected Types

enum  Protocol { SCTP = 0, TCP = 1, UDP = 2 }
 
enum  TimerType {
  TIMER_CONNECT = 1, TIMER_START = 2, TIMER_RESET = 3, TIMER_STOP = 4,
  TIMER_TRANSMIT = 5, TIMER_OFF = 6, TIMER_ON = 7
}
 

Protected Attributes

Protocol TransportProtocol = (Protocol)-1
 
bool ActiveMode = false
 
bool SendingAllowed = false
 
bool HasFinished = false
 
unsigned int MaxMsgSize = 0
 
unsigned int QueueSize = 0
 
double UnorderedMode = NAN
 
double UnreliableMode = NAN
 
bool DecoupleSaturatedStreams = false
 
simtime_t ConnectTime
 
simtime_t StartTime
 
simtime_t ResetTime
 
simtime_t StopTime
 
cMessage * ConnectTimer = nullptr
 
cMessage * StartTimer = nullptr
 
cMessage * StopTimer = nullptr
 
cMessage * ResetTimer = nullptr
 
cMessage * OffTimer = nullptr
 
cMessage * OnTimer = nullptr
 
unsigned int OnOffCycleCounter = 0
 
int MaxOnOffCycles = 0
 
std::vector< NetPerfMeterTransmitTimer * > TransmitTimerVector
 
unsigned int RequestedOutboundStreams = 0
 
unsigned int MaxInboundStreams = 0
 
unsigned int ActualOutboundStreams = 0
 
unsigned int ActualInboundStreams = 0
 
std::vector< cDynamicExpression > FrameRateExpressionVector
 
std::vector< cDynamicExpression > FrameSizeExpressionVector
 
SCTPSocketSocketSCTP = nullptr
 
SCTPSocketIncomingSocketSCTP = nullptr
 
TCPSocketSocketTCP = nullptr
 
TCPSocketIncomingSocketTCP = nullptr
 
UDPSocketSocketUDP = nullptr
 
int ConnectionID = 0
 
L3Address PrimaryPath
 
std::vector< TraceEntryTraceVector
 
size_t TraceIndex = 0
 
simtime_t TransmissionStartTime
 
simtime_t ConnectionEstablishmentTime
 
simtime_t StatisticsResetTime
 
unsigned int LastStreamID = 0
 
simtime_t StatisticsStartTime
 

Private Member Functions

SenderStatisticsgetSenderStatistics (const unsigned int streamID)
 
ReceiverStatisticsgetReceiverStatistics (const unsigned int streamID)
 
double getFrameRate (const unsigned int streamID)
 
unsigned long getFrameSize (const unsigned int streamID)
 
void startSending ()
 
void stopSending ()
 
void sendDataOfTraceFile (const unsigned long long bytesAvailableInQueue)
 
void sendDataOfSaturatedStreams (const unsigned long long bytesAvailableInQueue, const SCTPSendQueueAbated *sendQueueAbatedIndication)
 
void sendDataOfNonSaturatedStreams (const unsigned long long bytesAvailableInQueue, const unsigned int streamID)
 
unsigned long transmitFrame (const unsigned int frameSize, const unsigned int streamID)
 
void createAndBindSocket ()
 
void handleTimer (cMessage *msg)
 

Static Private Member Functions

static opp_string format (const char *formatString,...)
 
static void parseExpressionVector (std::vector< cDynamicExpression > &expressionVector, const char *string, const char *delimiters=NULL)
 

Private Attributes

std::map< unsigned int, SenderStatistics * > SenderStatisticsMap
 
std::map< unsigned int, ReceiverStatistics * > ReceiverStatisticsMap
 

Detailed Description

Implementation of NetPerfMeter.

See NED file for more details.

Member Enumeration Documentation

Enumerator
SCTP 
TCP 
UDP 
73  {
74  SCTP = 0,
75  TCP = 1,
76  UDP = 2
77  };
Definition: NetPerfMeter.h:75
Definition: NetPerfMeter.h:74
Definition: NetPerfMeter.h:76
Enumerator
TIMER_CONNECT 
TIMER_START 
TIMER_RESET 
TIMER_STOP 
TIMER_TRANSMIT 
TIMER_OFF 
TIMER_ON 
78  {
79  TIMER_CONNECT = 1,
80  TIMER_START = 2,
81  TIMER_RESET = 3,
82  TIMER_STOP = 4,
83  TIMER_TRANSMIT = 5,
84  TIMER_OFF = 6,
85  TIMER_ON = 7
86  };
Definition: NetPerfMeter.h:85
Definition: NetPerfMeter.h:84
Definition: NetPerfMeter.h:81
Definition: NetPerfMeter.h:80
Definition: NetPerfMeter.h:82
Definition: NetPerfMeter.h:79
Definition: NetPerfMeter.h:83

Constructor & Destructor Documentation

inet::NetPerfMeter::NetPerfMeter ( )
80 {
81  SendingAllowed = false;
82  ConnectionID = 0;
84 }
int ConnectionID
Definition: NetPerfMeter.h:127
bool SendingAllowed
Definition: NetPerfMeter.h:90
void resetStatistics()
Definition: NetPerfMeter.cc:777
inet::NetPerfMeter::~NetPerfMeter ( )
89 {
90  cancelAndDelete(ConnectTimer);
91  ConnectTimer = nullptr;
92  cancelAndDelete(StartTimer);
93  StartTimer = nullptr;
94  cancelAndDelete(ResetTimer);
95  ResetTimer = nullptr;
96  cancelAndDelete(StopTimer);
97  StopTimer = nullptr;
98  for(auto & elem : TransmitTimerVector) {
99  cancelAndDelete(elem);
100  elem = nullptr;
101  }
102 }
std::vector< NetPerfMeterTransmitTimer * > TransmitTimerVector
Definition: NetPerfMeter.h:110
cMessage * ConnectTimer
Definition: NetPerfMeter.h:101
cMessage * StartTimer
Definition: NetPerfMeter.h:102
cMessage * ResetTimer
Definition: NetPerfMeter.h:104
cMessage * StopTimer
Definition: NetPerfMeter.h:103

Member Function Documentation

void inet::NetPerfMeter::createAndBindSocket ( )
private

Referenced by establishConnection(), and initialize().

682 {
683  const char* localAddress = par("localAddress");
684  const int localPort = par("localPort");
685  if( (ActiveMode == false) && (localPort == 0) ) {
686  throw cRuntimeError("No local port number given in active mode!");
687  }
688  L3Address localAddr;
689  if (*localAddress)
690  localAddr = L3AddressResolver().resolve(localAddress);
691 
692  if(TransportProtocol == SCTP) {
693  assert(SocketSCTP == nullptr);
694  SocketSCTP = new SCTPSocket;
697  SocketSCTP->setOutputGate(gate("sctpOut"));
698  SocketSCTP->bind(localPort);
699  if(ActiveMode == false) {
700  SocketSCTP->listen(true);
701  }
702  }
703  else if(TransportProtocol == TCP) {
704  assert(SocketTCP == nullptr);
705  SocketTCP = new TCPSocket;
706  SocketTCP->setOutputGate(gate("tcpOut"));
708  SocketTCP->bind(localAddr, localPort);
709  if(ActiveMode == false) {
710  SocketTCP->listen();
711  }
712  }
713  else if(TransportProtocol == UDP) {
714  assert(SocketUDP == nullptr);
715  SocketUDP = new UDPSocket;
716  SocketUDP->setOutputGate(gate("udpOut"));
717  SocketUDP->bind(localAddr, localPort);
718  }
719 }
SCTPSocket * SocketSCTP
Definition: NetPerfMeter.h:122
Protocol TransportProtocol
Definition: NetPerfMeter.h:88
Definition: NetPerfMeter.h:75
Definition: NetPerfMeter.h:74
Definition: NetPerfMeter.h:76
void setOutputGate(cGate *toUdp)
Sets the gate on which to send to UDP.
Definition: UDPSocket.h:110
bool ActiveMode
Definition: NetPerfMeter.h:89
unsigned int MaxInboundStreams
Definition: NetPerfMeter.h:113
UDPSocket * SocketUDP
Definition: NetPerfMeter.h:126
void bind(int localPort)
Bind the socket to a local port number.
Definition: SCTPSocket.cc:136
void bind(int localPort)
Bind the socket to a local port number.
Definition: TCPSocket.cc:101
TCPSocket * SocketTCP
Definition: NetPerfMeter.h:124
void setInboundStreams(int streams)
Definition: SCTPSocket.h:183
unsigned int RequestedOutboundStreams
Definition: NetPerfMeter.h:112
void listen(bool fork)
Definition: TCPSocket.cc:127
void setOutputGate(cGate *toTcp)
Sets the gate on which to send to TCP.
Definition: TCPSocket.h:228
void readDataTransferModePar(cComponent &component)
Read "dataTransferMode" parameter from ini/ned, and set dataTransferMode member value.
Definition: TCPSocket.cc:355
void setOutboundStreams(int streams)
Setter and getter methods for socket and API Parameters.
Definition: SCTPSocket.h:182
void listen(bool fork=true, bool streamReset=false, uint32 requests=0, uint32 messagesToPush=0)
Initiates passive OPEN.
Definition: SCTPSocket.cc:177
void setOutputGate(cGate *toSctp)
Sets the gate on which to send to SCTP.
Definition: SCTPSocket.h:177
void bind(int localPort)
Bind the socket to a local port number.
Definition: UDPSocket.cc:53
void inet::NetPerfMeter::establishConnection ( )

Referenced by handleTimer().

515 {
516  const char* remoteAddress = par("remoteAddress");
517  const int remotePort = par("remotePort");
518 
519  // ====== Establish connection ===========================================
520  if(ActiveMode == true) {
522 
523  const char* primaryPath = par("primaryPath");
524  PrimaryPath = (primaryPath[0] != 0x00) ?
525  L3AddressResolver().resolve(primaryPath) : L3Address();
526 
527  if(TransportProtocol == SCTP) {
528  AddressVector remoteAddressList;
529  remoteAddressList.push_back(L3AddressResolver().resolve(remoteAddress));
530  SocketSCTP->connectx(remoteAddressList, remotePort);
531  }
532  else if(TransportProtocol == TCP) {
534  SocketTCP->connect(L3AddressResolver().resolve(remoteAddress), remotePort);
535  }
536  else if(TransportProtocol == UDP) {
537  SocketUDP->connect(L3AddressResolver().resolve(remoteAddress), remotePort);
538  // Just start sending, since UDP is connection-less
540  }
541  ConnectionEstablishmentTime = simTime();
542  }
543  else {
544  // ------ Handle UDP on passive side ----------------
545  if(TransportProtocol == UDP) {
546  SocketUDP->connect(L3AddressResolver().resolve(remoteAddress), remotePort);
548  }
549  }
550  EV << simTime() << ", " << getFullPath() << ": Sending allowed" << endl;
551  SendingAllowed = true;
552 }
SCTPSocket * SocketSCTP
Definition: NetPerfMeter.h:122
Protocol TransportProtocol
Definition: NetPerfMeter.h:88
Definition: NetPerfMeter.h:75
void connectx(AddressVector remoteAddresses, int32 remotePort, bool streamReset=false, int32 prMethod=0, uint32 numRequests=0)
Active OPEN to the given remote socket.
Definition: SCTPSocket.cc:335
Definition: NetPerfMeter.h:74
void createAndBindSocket()
Definition: NetPerfMeter.cc:681
Definition: NetPerfMeter.h:76
bool SendingAllowed
Definition: NetPerfMeter.h:90
bool ActiveMode
Definition: NetPerfMeter.h:89
void connect(L3Address remoteAddr, int remotePort)
Connects to a remote UDP socket.
Definition: UDPSocket.cc:72
UDPSocket * SocketUDP
Definition: NetPerfMeter.h:126
std::vector< L3Address > AddressVector
Definition: SCTPCommand_m.h:41
L3Address PrimaryPath
Definition: NetPerfMeter.h:128
TCPSocket * SocketTCP
Definition: NetPerfMeter.h:124
void connect(L3Address remoteAddr, int remotePort)
Active OPEN to the given remote socket.
Definition: TCPSocket.cc:148
simtime_t ConnectionEstablishmentTime
Definition: NetPerfMeter.h:141
void successfullyEstablishedConnection(cMessage *msg, const unsigned int queueSize)
Definition: NetPerfMeter.cc:556
void renewSocket()
Required to re-connect with a "used" TCPSocket object.
Definition: TCPSocket.cc:226
void inet::NetPerfMeter::finish ( )
overridevirtual
234 {
235  if(TransportProtocol == SCTP) {
236  }
237  else if(TransportProtocol == TCP) {
238  }
239  else if(TransportProtocol == UDP) {
240  }
241 
242  std::map<unsigned int, SenderStatistics*>::iterator senderStatisticsIterator = SenderStatisticsMap.begin();
243  while(senderStatisticsIterator != SenderStatisticsMap.end()) {
244  delete senderStatisticsIterator->second;
245  SenderStatisticsMap.erase(senderStatisticsIterator);
246  senderStatisticsIterator = SenderStatisticsMap.begin();
247  }
248  std::map<unsigned int, ReceiverStatistics*>::iterator receiverStatisticsIterator = ReceiverStatisticsMap.begin();
249  while(receiverStatisticsIterator != ReceiverStatisticsMap.end()) {
250  delete receiverStatisticsIterator->second;
251  ReceiverStatisticsMap.erase(receiverStatisticsIterator);
252  receiverStatisticsIterator = ReceiverStatisticsMap.begin();
253  }
254 }
Protocol TransportProtocol
Definition: NetPerfMeter.h:88
Definition: NetPerfMeter.h:75
std::map< unsigned int, ReceiverStatistics * > ReceiverStatisticsMap
Definition: NetPerfMeter.h:185
Definition: NetPerfMeter.h:74
Definition: NetPerfMeter.h:76
std::map< unsigned int, SenderStatistics * > SenderStatisticsMap
Definition: NetPerfMeter.h:184
opp_string inet::NetPerfMeter::format ( const char *  formatString,
  ... 
)
staticprivate

Referenced by writeStatistics().

1232 {
1233  char str[1024];
1234  va_list args;
1235  va_start(args, formatString);
1236  vsnprintf((char*)&str, sizeof(str), formatString, args);
1237  va_end(args);
1238  return(opp_string(str));
1239 }
double inet::NetPerfMeter::getFrameRate ( const unsigned int  streamID)
private

Referenced by sendDataOfNonSaturatedStreams(), and sendDataOfSaturatedStreams().

976 {
977  double frameRate;
978  if(FrameRateExpressionVector.size() == 0) {
979  frameRate = par("frameRate");
980  }
981  else {
982  frameRate =
984  doubleValue(this, "Hz");
985  if(frameRate < 0) {
986  frameRate = par("frameRate");
987  }
988  }
989  return(frameRate);
990 }
std::vector< cDynamicExpression > FrameRateExpressionVector
Definition: NetPerfMeter.h:117
unsigned long inet::NetPerfMeter::getFrameSize ( const unsigned int  streamID)
private

Referenced by sendDataOfNonSaturatedStreams(), and sendDataOfSaturatedStreams().

995 {
996  unsigned long frameSize;
997  if(FrameSizeExpressionVector.size() == 0) {
998  frameSize = par("frameSize");
999  }
1000  else {
1001  double doubleSize =
1002  FrameSizeExpressionVector[streamID % FrameSizeExpressionVector.size()].doubleValue(this, "B");
1003  frameSize = (doubleSize >= 0.0) ? (long)doubleSize : par("frameSize");
1004  }
1005  return(frameSize);
1006 }
std::vector< cDynamicExpression > FrameSizeExpressionVector
Definition: NetPerfMeter.h:119
ReceiverStatistics* inet::NetPerfMeter::getReceiverStatistics ( const unsigned int  streamID)
inlineprivate

Referenced by receiveMessage().

192  {
193  std::map<unsigned int, ReceiverStatistics*>::iterator found = ReceiverStatisticsMap.find(streamID);
194  assert(found != ReceiverStatisticsMap.end());
195  return(found->second);
196  }
std::map< unsigned int, ReceiverStatistics * > ReceiverStatisticsMap
Definition: NetPerfMeter.h:185
SenderStatistics* inet::NetPerfMeter::getSenderStatistics ( const unsigned int  streamID)
inlineprivate

Referenced by transmitFrame().

187  {
188  std::map<unsigned int, SenderStatistics*>::iterator found = SenderStatisticsMap.find(streamID);
189  assert(found != SenderStatisticsMap.end());
190  return(found->second);
191  }
std::map< unsigned int, SenderStatistics * > SenderStatisticsMap
Definition: NetPerfMeter.h:184
void inet::NetPerfMeter::handleMessage ( cMessage *  msg)
overridevirtual
379 {
380  // ====== Timer handling =================================================
381  if(msg->isSelfMessage()) {
382  handleTimer(msg);
383  }
384 
385  // ====== SCTP ===========================================================
386  else if(TransportProtocol == SCTP) {
387  switch(msg->getKind()) {
388  // ------ Data -----------------------------------------------------
389  case SCTP_I_DATA:
390  receiveMessage(msg);
391  break;
392  // ------ Data Arrival Indication ----------------------------------
394  // Data has arrived -> request it from the SCTP module.
395  const SCTPCommand* dataIndication =
396  check_and_cast<const SCTPCommand*>(msg->getControlInfo());
397  SCTPSendInfo* command = new SCTPSendInfo("SendCommand");
398  command->setAssocId(dataIndication->getAssocId());
399  command->setSid(dataIndication->getSid());
400  command->setNumMsgs(dataIndication->getNumMsgs());
401  cPacket* cmsg = new cPacket("ReceiveRequest");
402  cmsg->setKind(SCTP_C_RECEIVE);
403  cmsg->setControlInfo(command);
404  send(cmsg, "sctpOut");
405  }
406  break;
407  // ------ Connection established -----------------------------------
408  case SCTP_I_ESTABLISHED: {
409  const SCTPConnectInfo* connectInfo =
410  check_and_cast<const SCTPConnectInfo*>(msg->getControlInfo());
411  ActualOutboundStreams = connectInfo->getOutboundStreams();
412  if(ActualOutboundStreams > RequestedOutboundStreams) {
413  ActualOutboundStreams = RequestedOutboundStreams;
414  }
415  ActualInboundStreams = connectInfo->getInboundStreams();
418  }
419  LastStreamID = ActualOutboundStreams - 1;
420  // NOTE: Start sending on stream 0!
422  }
423  break;
424  // ------ Queue indication -----------------------------------------
426  const SCTPSendQueueAbated* sendQueueAbatedIndication =
427  check_and_cast<SCTPSendQueueAbated*>(msg->getControlInfo());
428  assert(sendQueueAbatedIndication != nullptr);
429  // Queue is underfull again -> give it more data.
430  SendingAllowed = true;
431  if(TraceVector.size() == 0) {
432  sendDataOfSaturatedStreams(sendQueueAbatedIndication->getBytesAvailable(),
433  sendQueueAbatedIndication);
434  }
435  }
436  break;
438  SendingAllowed = false;
439  break;
440  // ------ Errors ---------------------------------------------------
441  case SCTP_I_PEER_CLOSED:
442  case SCTP_I_CLOSED:
445  case SCTP_I_TIMED_OUT:
446  case SCTP_I_ABORT:
447  case SCTP_I_CONN_LOST:
450  break;
451  default:
452  // printf("SCTP: kind=%d\n", msg->getKind());
453  break;
454  }
455  }
456 
457  // ====== TCP ============================================================
458  else if(TransportProtocol == TCP) {
459  short kind = msg->getKind();
460  switch(kind) {
461  // ------ Data -----------------------------------------------------
462  case TCP_I_DATA:
463  case TCP_I_URGENT_DATA:
464  receiveMessage(msg);
465  break;
466  // ------ Connection established -----------------------------------
467  case TCP_I_ESTABLISHED:
469  break;
470  // ------ Queue indication -----------------------------------------
471  case TCP_I_SEND_MSG: {
472  const TCPCommand* tcpCommand =
473  check_and_cast<TCPCommand*>(msg->getControlInfo());
474  assert(tcpCommand != nullptr);
475  // Queue is underfull again -> give it more data.
476  if(SocketTCP != nullptr) { // T.D. 16.11.2011: Ensure that there is still a TCP socket!
477  SendingAllowed = true;
478  if(TraceVector.size() == 0) {
479  sendDataOfSaturatedStreams(tcpCommand->getUserId(), nullptr);
480  }
481  }
482  }
483  break;
484  // ------ Errors ---------------------------------------------------
485  case TCP_I_PEER_CLOSED:
486  case TCP_I_CLOSED:
489  case TCP_I_TIMED_OUT:
491  break;
492  }
493  }
494 
495  // ====== UDP ============================================================
496  else if(TransportProtocol == UDP) {
497  switch(msg->getKind()) {
498  // ------ Data -----------------------------------------------------
499  case UDP_I_DATA:
500  receiveMessage(msg);
501  break;
502  // ------ Error ----------------------------------------------------
503  case UDP_I_ERROR:
505  break;
506  }
507  }
508 
509  delete msg;
510 }
Protocol TransportProtocol
Definition: NetPerfMeter.h:88
Definition: NetPerfMeter.h:75
Definition: SCTPCommand.h:76
void teardownConnection(const bool stopTimeReached=false)
Definition: NetPerfMeter.cc:723
unsigned int QueueSize
Definition: NetPerfMeter.h:93
Definition: NetPerfMeter.h:74
Definition: TCPCommand_m.h:102
Definition: UDPControlInfo_m.h:83
Definition: TCPCommand_m.h:101
Definition: SCTPCommand.h:67
Definition: TCPCommand_m.h:100
Definition: TCPCommand_m.h:104
Definition: SCTPCommand.h:77
Definition: TCPCommand_m.h:99
void handleTimer(cMessage *msg)
Definition: NetPerfMeter.cc:283
Definition: SCTPCommand.h:68
Definition: SCTPCommand.h:73
Definition: SCTPCommand.h:63
void sendDataOfSaturatedStreams(const unsigned long long bytesAvailableInQueue, const SCTPSendQueueAbated *sendQueueAbatedIndication)
Definition: NetPerfMeter.cc:1010
Definition: NetPerfMeter.h:76
bool SendingAllowed
Definition: NetPerfMeter.h:90
unsigned int MaxInboundStreams
Definition: NetPerfMeter.h:113
Definition: UDPControlInfo_m.h:84
Definition: SCTPCommand.h:37
Definition: SCTPCommand.h:65
Definition: SCTPCommand.h:69
unsigned int LastStreamID
Definition: NetPerfMeter.h:145
Definition: SCTPCommand.h:75
Definition: SCTPCommand.h:66
std::vector< TraceEntry > TraceVector
Definition: NetPerfMeter.h:136
Definition: SCTPCommand.h:64
TCPSocket * SocketTCP
Definition: NetPerfMeter.h:124
void receiveMessage(cMessage *msg)
Definition: NetPerfMeter.cc:1158
Definition: SCTPCommand.h:72
unsigned int ActualOutboundStreams
Definition: NetPerfMeter.h:114
Definition: SCTPCommand.h:70
unsigned int RequestedOutboundStreams
Definition: NetPerfMeter.h:112
Definition: TCPCommand_m.h:98
void successfullyEstablishedConnection(cMessage *msg, const unsigned int queueSize)
Definition: NetPerfMeter.cc:556
unsigned int ActualInboundStreams
Definition: NetPerfMeter.h:115
Definition: TCPCommand_m.h:107
Definition: TCPCommand_m.h:103
Definition: TCPCommand_m.h:105
void inet::NetPerfMeter::handleTimer ( cMessage *  msg)
private

Referenced by handleMessage().

284 {
285  // ====== Transmit timer =================================================
286  const NetPerfMeterTransmitTimer* transmitTimer =
287  dynamic_cast<NetPerfMeterTransmitTimer*>(msg);
288  if(transmitTimer) {
289  TransmitTimerVector[transmitTimer->getStreamID()] = nullptr;
290  if(TraceVector.size() > 0) {
292  }
293  else {
294  sendDataOfNonSaturatedStreams(QueueSize, transmitTimer->getStreamID());
295  }
296  }
297 
298  // ====== Off timer ======================================================
299  else if(msg == OffTimer) {
300  EV << simTime() << ", " << getFullPath() << ": Entering OFF mode" << endl;
301 
302  OffTimer = nullptr;
303  stopSending();
304  }
305 
306  // ====== On timer =======================================================
307  else if(msg == OnTimer) {
308  EV << simTime() << ", " << getFullPath() << ": Entering ON mode" << endl;
309 
310  OnTimer = nullptr;
311  startSending();
312  }
313 
314  // ====== Reset timer ====================================================
315  else if(msg == ResetTimer) {
316  EV << simTime() << ", " << getFullPath() << ": Reset" << endl;
317 
318  ResetTimer = nullptr;
319  resetStatistics();
320 
321  assert(StopTimer == nullptr);
322  if(StopTime > 0.0) {
323  StopTimer = new cMessage("StopTimer");
324  StopTimer->setKind(TIMER_STOP);
325  scheduleAt(simTime() + StopTime, StopTimer);
326  }
327  }
328 
329  // ====== Stop timer =====================================================
330  else if(msg == StopTimer) {
331  EV << simTime() << ", " << getFullPath() << ": STOP" << endl;
332 
333  StopTimer = nullptr;
334  if(OffTimer) {
335  cancelAndDelete(OffTimer);
336  OffTimer = nullptr;
337  }
338  if(OnTimer) {
339  cancelAndDelete(OnTimer);
340  OnTimer = nullptr;
341  }
342 
343  if(TransportProtocol == SCTP) {
344  if(IncomingSocketSCTP != nullptr) {
346  }
347  else if(SocketSCTP != nullptr) {
348  SocketSCTP->close();
349  }
350  }
351  else if(TransportProtocol == TCP) {
352  if(SocketTCP != nullptr) {
353  SocketTCP->close();
354  }
355  }
356  teardownConnection(true);
357  }
358 
359  // ====== Start timer ====================================================
360  else if(msg == StartTimer) {
361  EV << simTime() << ", " << getFullPath() << ": Start" << endl;
362 
363  StartTimer = nullptr;
364  startSending();
365  }
366 
367  // ====== Connect timer ==================================================
368  else if(msg == ConnectTimer) {
369  EV << simTime() << ", " << getFullPath() << ": Connect" << endl;
370 
371  ConnectTimer = nullptr;
373  }
374 }
SCTPSocket * SocketSCTP
Definition: NetPerfMeter.h:122
Protocol TransportProtocol
Definition: NetPerfMeter.h:88
Definition: NetPerfMeter.h:75
cMessage * OnTimer
Definition: NetPerfMeter.h:106
void teardownConnection(const bool stopTimeReached=false)
Definition: NetPerfMeter.cc:723
SCTPSocket * IncomingSocketSCTP
Definition: NetPerfMeter.h:123
unsigned int QueueSize
Definition: NetPerfMeter.h:93
Definition: NetPerfMeter.h:74
void sendDataOfNonSaturatedStreams(const unsigned long long bytesAvailableInQueue, const unsigned int streamID)
Definition: NetPerfMeter.cc:1071
void sendDataOfTraceFile(const unsigned long long bytesAvailableInQueue)
Definition: NetPerfMeter.cc:1122
void close(int id=-1)
Closes the local end of the connection.
Definition: SCTPSocket.cc:410
std::vector< NetPerfMeterTransmitTimer * > TransmitTimerVector
Definition: NetPerfMeter.h:110
Definition: NetPerfMeter.h:82
cMessage * ConnectTimer
Definition: NetPerfMeter.h:101
cMessage * StartTimer
Definition: NetPerfMeter.h:102
std::vector< TraceEntry > TraceVector
Definition: NetPerfMeter.h:136
TCPSocket * SocketTCP
Definition: NetPerfMeter.h:124
void stopSending()
Definition: NetPerfMeter.cc:659
cMessage * ResetTimer
Definition: NetPerfMeter.h:104
void startSending()
Definition: NetPerfMeter.cc:636
void establishConnection()
Definition: NetPerfMeter.cc:514
void resetStatistics()
Definition: NetPerfMeter.cc:777
simtime_t StopTime
Definition: NetPerfMeter.h:100
void close()
Closes the local end of the connection.
Definition: TCPSocket.cc:192
cMessage * StopTimer
Definition: NetPerfMeter.h:103
cMessage * OffTimer
Definition: NetPerfMeter.h:105
void inet::NetPerfMeter::initialize ( )
overridevirtual
123 {
124  // ====== Handle parameters ==============================================
125  ActiveMode = (bool)par("activeMode");
126  if(strcmp((const char*)par("protocol"), "TCP") == 0) {
128  }
129  else if(strcmp((const char*)par("protocol"), "SCTP") == 0) {
131  }
132  else if(strcmp((const char*)par("protocol"), "UDP") == 0) {
134  }
135  else {
136  throw cRuntimeError("Bad protocol setting!");
137  }
138 
140  MaxInboundStreams = 1;
143  LastStreamID = 1;
144  MaxMsgSize = par("maxMsgSize");
145  QueueSize = par("queueSize");
146  DecoupleSaturatedStreams = par("decoupleSaturatedStreams");
147  RequestedOutboundStreams = par("outboundStreams");
148  if((RequestedOutboundStreams < 1) || (RequestedOutboundStreams > 65535)) {
149  throw cRuntimeError("Invalid number of outbound streams; use range from [1, 65535]");
150  }
151  MaxInboundStreams = par("maxInboundStreams");
152  if((MaxInboundStreams < 1) || (MaxInboundStreams > 65535)) {
153  throw cRuntimeError("Invalid number of inbound streams; use range from [1, 65535]");
154  }
155  UnorderedMode = par("unordered");
156  if((UnorderedMode < 0.0) || (UnorderedMode > 1.0)) {
157  throw cRuntimeError("Bad value for unordered probability; use range from [0.0, 1.0]");
158  }
159  UnreliableMode = par("unreliable");
160  if((UnreliableMode < 0.0) || (UnreliableMode > 1.0)) {
161  throw cRuntimeError("Bad value for unreliable probability; use range from [0.0, 1.0]");
162  }
163  parseExpressionVector(FrameRateExpressionVector, par("frameRateString"), ";");
164  parseExpressionVector(FrameSizeExpressionVector, par("frameSizeString"), ";");
165 
166  TraceIndex = ~0;
167  if(strcmp((const char*)par("traceFile"), "") != 0) {
168  std::fstream traceFile((const char*)par("traceFile"));
169  if(!traceFile.good()) {
170  throw cRuntimeError("Unable to load trace file");
171  }
172  while(!traceFile.eof()) {
173  TraceEntry traceEntry;
174  traceEntry.InterFrameDelay = 0;
175  traceEntry.FrameSize = 0;
176  traceEntry.StreamID = 0;
177 
178  char line[256];
179  traceFile.getline((char*)&line, sizeof(line), '\n');
180  if(sscanf(line, "%lf %u %u", &traceEntry.InterFrameDelay, &traceEntry.FrameSize, &traceEntry.StreamID) >= 2) {
181  // std::cout << "Frame: " << traceEntry.InterFrameDelay << "\t" << traceEntry.FrameSize << "\t" << traceEntry.StreamID << endl;
182  TraceVector.push_back(traceEntry);
183  }
184  }
185  }
186 
187  // ====== Initialize and bind socket =====================================
188  SocketSCTP = IncomingSocketSCTP = nullptr;
189  SocketTCP = IncomingSocketTCP = nullptr;
190  SocketUDP = nullptr;
191 
192  for(unsigned int i = 0;i < RequestedOutboundStreams;i++) {
193  SenderStatistics* senderStatistics = new SenderStatistics;
194  SenderStatisticsMap.insert(std::pair<unsigned int, SenderStatistics*>(i, senderStatistics));
195  }
196  for(unsigned int i = 0;i < MaxInboundStreams;i++) {
197  ReceiverStatistics* receiverStatistics = new ReceiverStatistics;
198  ReceiverStatisticsMap.insert(std::pair<unsigned int, ReceiverStatistics*>(i, receiverStatistics));
199  }
200 
201  ConnectTime = par("connectTime");
202  StartTime = par("startTime");
203  ResetTime = par("resetTime");
204  StopTime = par("stopTime");
205  MaxOnOffCycles = par("maxOnOffCycles");
206 
207  HasFinished = false;
208  OffTimer = nullptr;
209  OnTimer = nullptr;
210  OnOffCycleCounter = 0;
211 
212  EV << simTime() << ", " << getFullPath() << ": Initialize"
213  << "\tConnectTime=" << ConnectTime
214  << "\tStartTime=" << StartTime
215  << "\tResetTime=" << ResetTime
216  << "\tStopTime=" << StopTime
217  << endl;
218 
219  if(ActiveMode == false) {
220  // Passive mode: create and bind socket immediately.
221  // For active mode, the socket will be created just before connect().
223  }
224 
225  // ====== Schedule Connect Timer =========================================
226  ConnectTimer = new cMessage("ConnectTimer");
227  ConnectTimer->setKind(TIMER_CONNECT);
228  scheduleAt(ConnectTime, ConnectTimer);
229 }
SCTPSocket * SocketSCTP
Definition: NetPerfMeter.h:122
Protocol TransportProtocol
Definition: NetPerfMeter.h:88
Definition: NetPerfMeter.h:75
simtime_t ResetTime
Definition: NetPerfMeter.h:99
cMessage * OnTimer
Definition: NetPerfMeter.h:106
std::map< unsigned int, ReceiverStatistics * > ReceiverStatisticsMap
Definition: NetPerfMeter.h:185
double UnorderedMode
Definition: NetPerfMeter.h:94
unsigned int OnOffCycleCounter
Definition: NetPerfMeter.h:107
SCTPSocket * IncomingSocketSCTP
Definition: NetPerfMeter.h:123
unsigned int QueueSize
Definition: NetPerfMeter.h:93
Definition: NetPerfMeter.h:74
TCPSocket * IncomingSocketTCP
Definition: NetPerfMeter.h:125
simtime_t ConnectTime
Definition: NetPerfMeter.h:97
void createAndBindSocket()
Definition: NetPerfMeter.cc:681
std::vector< cDynamicExpression > FrameRateExpressionVector
Definition: NetPerfMeter.h:117
std::vector< cDynamicExpression > FrameSizeExpressionVector
Definition: NetPerfMeter.h:119
static void parseExpressionVector(std::vector< cDynamicExpression > &expressionVector, const char *string, const char *delimiters=NULL)
Definition: NetPerfMeter.cc:106
Definition: NetPerfMeter.h:76
bool ActiveMode
Definition: NetPerfMeter.h:89
unsigned int MaxInboundStreams
Definition: NetPerfMeter.h:113
UDPSocket * SocketUDP
Definition: NetPerfMeter.h:126
std::map< unsigned int, SenderStatistics * > SenderStatisticsMap
Definition: NetPerfMeter.h:184
int MaxOnOffCycles
Definition: NetPerfMeter.h:108
unsigned int LastStreamID
Definition: NetPerfMeter.h:145
cMessage * ConnectTimer
Definition: NetPerfMeter.h:101
bool HasFinished
Definition: NetPerfMeter.h:91
std::vector< TraceEntry > TraceVector
Definition: NetPerfMeter.h:136
size_t TraceIndex
Definition: NetPerfMeter.h:137
TCPSocket * SocketTCP
Definition: NetPerfMeter.h:124
simtime_t StartTime
Definition: NetPerfMeter.h:98
double UnreliableMode
Definition: NetPerfMeter.h:95
unsigned int ActualOutboundStreams
Definition: NetPerfMeter.h:114
unsigned int MaxMsgSize
Definition: NetPerfMeter.h:92
Definition: NetPerfMeter.h:79
unsigned int RequestedOutboundStreams
Definition: NetPerfMeter.h:112
bool DecoupleSaturatedStreams
Definition: NetPerfMeter.h:96
unsigned int ActualInboundStreams
Definition: NetPerfMeter.h:115
simtime_t StopTime
Definition: NetPerfMeter.h:100
cMessage * OffTimer
Definition: NetPerfMeter.h:105
void inet::NetPerfMeter::parseExpressionVector ( std::vector< cDynamicExpression > &  expressionVector,
const char *  string,
const char *  delimiters = NULL 
)
staticprivate

Referenced by initialize().

109 {
110  expressionVector.clear();
111  cStringTokenizer tokenizer(string, delimiters);
112  while(tokenizer.hasMoreTokens()) {
113  const char* token = tokenizer.nextToken();
114  cDynamicExpression expression;
115  expression.parse(token);
116  expressionVector.push_back(expression);
117  }
118 }
void inet::NetPerfMeter::receiveMessage ( cMessage *  msg)

Referenced by handleMessage().

1159 {
1160  const cPacket* dataMessage =
1161  dynamic_cast<const cPacket*>(msg);
1162  if(dataMessage != nullptr) {
1163  unsigned int streamID = 0;
1164  const simtime_t delay = simTime() - dataMessage->getCreationTime();
1165 
1166  if(TransportProtocol == SCTP) {
1167  const SCTPRcvInfo* receiveCommand =
1168  check_and_cast<const SCTPRcvInfo*>(dataMessage->getControlInfo());
1169  streamID = receiveCommand->getSid();
1170  }
1171 
1172  ReceiverStatistics* receiverStatistics = getReceiverStatistics(streamID);
1173  receiverStatistics->ReceivedMessages++;
1174  receiverStatistics->ReceivedBytes += dataMessage->getByteLength();
1175  receiverStatistics->ReceivedDelayHistogram.collect(delay);
1176  }
1177 }
Protocol TransportProtocol
Definition: NetPerfMeter.h:88
Definition: NetPerfMeter.h:74
ReceiverStatistics * getReceiverStatistics(const unsigned int streamID)
Definition: NetPerfMeter.h:192
void inet::NetPerfMeter::refreshDisplay ( ) const
overridevirtual
258  {
259  unsigned long long totalSentBytes = 0;
260  for(std::map<unsigned int, SenderStatistics*>::const_iterator iterator = SenderStatisticsMap.begin();
261  iterator != SenderStatisticsMap.end(); iterator++) {
262  const SenderStatistics* senderStatistics = iterator->second;
263  totalSentBytes += senderStatistics->SentBytes;
264  }
265 
266  unsigned long long totalReceivedBytes = 0;
267  for(std::map<unsigned int, ReceiverStatistics*>::const_iterator iterator = ReceiverStatisticsMap.begin();
268  iterator != ReceiverStatisticsMap.end(); iterator++) {
269  const ReceiverStatistics* receiverStatistics = iterator->second;
270  totalReceivedBytes += receiverStatistics->ReceivedBytes;
271  }
272 
273  char status[64];
274  snprintf((char*)&status, sizeof(status), "In: %llu, Out: %llu",
275  totalReceivedBytes, totalSentBytes);
276  getDisplayString().setTagArg("t", 0, status);
277  //TODO also was setStatusString("Connecting"), setStatusString("Closed")
278 
279 }
std::map< unsigned int, ReceiverStatistics * > ReceiverStatisticsMap
Definition: NetPerfMeter.h:185
std::map< unsigned int, SenderStatistics * > SenderStatisticsMap
Definition: NetPerfMeter.h:184
void inet::NetPerfMeter::resetStatistics ( )

Referenced by handleTimer(), NetPerfMeter(), and writeStatistics().

778 {
779  StatisticsStartTime = simTime();
780  for(auto & elem : SenderStatisticsMap) {
781  SenderStatistics* senderStatistics = elem.second;
782  senderStatistics->reset();
783  }
784  for(auto & elem : ReceiverStatisticsMap) {
785  ReceiverStatistics* receiverStatistics = elem.second;
786  receiverStatistics->reset();
787  }
788 }
std::map< unsigned int, ReceiverStatistics * > ReceiverStatisticsMap
Definition: NetPerfMeter.h:185
simtime_t StatisticsStartTime
Definition: NetPerfMeter.h:148
std::map< unsigned int, SenderStatistics * > SenderStatisticsMap
Definition: NetPerfMeter.h:184
void inet::NetPerfMeter::sendDataOfNonSaturatedStreams ( const unsigned long long  bytesAvailableInQueue,
const unsigned int  streamID 
)
private

Referenced by handleTimer(), and startSending().

1073 {
1074  assert(OnTimer == nullptr);
1075 
1076  // ====== Is there something to send? ====================================
1077  const double frameRate = getFrameRate(streamID);
1078  if(frameRate <= 0.0) {
1079  // No non-saturated transmission on this stream
1080  // => no need to re-schedule timer!
1081  return;
1082  }
1083 
1084  // ====== Is sending allowed (i.e. space in the queue)? ==================
1085  if(SendingAllowed) {
1086  const long frameSize = getFrameSize(streamID);
1087  if(frameSize < 1) {
1088  return;
1089  }
1090  if( (frameRate <= 0.0) &&
1091  ((TransportProtocol == TCP) || (TransportProtocol == UDP)) ) {
1092  throw cRuntimeError("TCP and UDP do not support \"send as much as possible\" mode (frameRate=0)!");
1093  }
1094 
1095  // ====== Transmit frame ==============================================
1096 /*
1097  EV << simTime() << ", " << getFullPath() << ": Stream #" << streamID
1098  << ":\tframeRate=" << frameRate
1099  << "\tframeSize=" << frameSize << endl;
1100 */
1101  transmitFrame(frameSize, streamID);
1102  }
1103  else {
1104  // No transmission allowed -> skip this frame!
1105  }
1106 
1107  // ====== Schedule next frame transmission ===============================
1108  assert(TransmitTimerVector[streamID] == nullptr);
1109  TransmitTimerVector[streamID] = new NetPerfMeterTransmitTimer("TransmitTimer");
1110  TransmitTimerVector[streamID]->setKind(TIMER_TRANSMIT);
1111  TransmitTimerVector[streamID]->setStreamID(streamID);
1112  const double nextFrameTime = 1.0 / frameRate;
1113 /*
1114  EV << simTime() << ", " << getFullPath()
1115  << ": Next on stream #" << streamID << " in " << nextFrameTime << "s" << endl;
1116 */
1117  scheduleAt(simTime() + nextFrameTime, TransmitTimerVector[streamID]);
1118 }
Protocol TransportProtocol
Definition: NetPerfMeter.h:88
Definition: NetPerfMeter.h:75
cMessage * OnTimer
Definition: NetPerfMeter.h:106
double getFrameRate(const unsigned int streamID)
Definition: NetPerfMeter.cc:975
Definition: NetPerfMeter.h:76
unsigned long getFrameSize(const unsigned int streamID)
Definition: NetPerfMeter.cc:994
bool SendingAllowed
Definition: NetPerfMeter.h:90
std::vector< NetPerfMeterTransmitTimer * > TransmitTimerVector
Definition: NetPerfMeter.h:110
unsigned long transmitFrame(const unsigned int frameSize, const unsigned int streamID)
Definition: NetPerfMeter.cc:879
Definition: NetPerfMeter.h:83
void inet::NetPerfMeter::sendDataOfSaturatedStreams ( const unsigned long long  bytesAvailableInQueue,
const SCTPSendQueueAbated sendQueueAbatedIndication 
)
private

Referenced by handleMessage(), and startSending().

1012 {
1013  if(OnTimer != nullptr) {
1014  // We are in Off mode -> nothing to send!
1015  return;
1016  }
1017 
1018  // ====== Is sending allowed (i.e. space in the queue)? ==================
1019  if(SendingAllowed) {
1020  // ====== SCTP tells current queue occupation for each stream =========
1021  unsigned long long contingent;
1022  unsigned long long queued[ActualOutboundStreams];
1023  if(sendQueueAbatedIndication == nullptr) {
1024  // At the moment, the actual queue size is unknown.
1025  // => Assume it to be bytesAvailableInQueue.
1026  contingent = bytesAvailableInQueue / ActualOutboundStreams;
1027  for(unsigned int streamID = 0; streamID < ActualOutboundStreams; streamID++) {
1028  queued[streamID] = 0;
1029  }
1030  }
1031  else {
1032  assert(ActualOutboundStreams <= sendQueueAbatedIndication->getQueuedForStreamArraySize());
1033  for(unsigned int streamID = 0; streamID < ActualOutboundStreams; streamID++) {
1034  queued[streamID] = sendQueueAbatedIndication->getQueuedForStream(streamID);
1035  }
1036  contingent = sendQueueAbatedIndication->getBytesLimit() / ActualOutboundStreams;
1037  }
1038 
1039  // ====== Send, but care for per-stream contingent ====================
1040  LastStreamID = (LastStreamID + 1) % ActualOutboundStreams;
1041  unsigned int startStreamID = LastStreamID;
1042  unsigned long long newlyQueuedBytes = 0;
1043  bool progress;
1044  do {
1045  // ====== Perform one round ========================================
1046  progress = false; // Will be set to true on any transmission progress
1047  // during the next round
1048  do {
1049  const double frameRate = getFrameRate(LastStreamID);
1050  if(frameRate < 0.0000001) { // Saturated stream
1051  if( (DecoupleSaturatedStreams == false) ||
1052  (queued[LastStreamID] < contingent) ) {
1053  // ====== Send one frame ==================================
1054  const unsigned long frameSize = getFrameSize(LastStreamID);
1055  if(frameSize >= 1) {
1056  const unsigned long long sent = transmitFrame(frameSize, LastStreamID);
1057  newlyQueuedBytes += sent;
1058  queued[LastStreamID] += sent;
1059  progress = true;
1060  }
1061  }
1062  }
1063  LastStreamID = (LastStreamID + 1) % ActualOutboundStreams;
1064  } while(LastStreamID != startStreamID);
1065  } while( (newlyQueuedBytes < bytesAvailableInQueue) && (progress == true) );
1066  }
1067 }
cMessage * OnTimer
Definition: NetPerfMeter.h:106
double getFrameRate(const unsigned int streamID)
Definition: NetPerfMeter.cc:975
unsigned long getFrameSize(const unsigned int streamID)
Definition: NetPerfMeter.cc:994
bool SendingAllowed
Definition: NetPerfMeter.h:90
unsigned int LastStreamID
Definition: NetPerfMeter.h:145
unsigned long transmitFrame(const unsigned int frameSize, const unsigned int streamID)
Definition: NetPerfMeter.cc:879
unsigned int ActualOutboundStreams
Definition: NetPerfMeter.h:114
bool DecoupleSaturatedStreams
Definition: NetPerfMeter.h:96
void inet::NetPerfMeter::sendDataOfTraceFile ( const unsigned long long  bytesAvailableInQueue)
private

Referenced by handleTimer(), and startSending().

1123 {
1124  if(TraceIndex < TraceVector.size()) {
1125  const unsigned int frameSize = TraceVector[TraceIndex].FrameSize;
1126  unsigned int streamID = TraceVector[TraceIndex].StreamID;
1127  if(streamID >= ActualOutboundStreams) {
1128  if(TransportProtocol == SCTP) {
1129  throw cRuntimeError("Invalid streamID in trace");
1130  }
1131  streamID = 0;
1132  }
1133  transmitFrame(frameSize, streamID);
1134  TraceIndex++;
1135  }
1136 
1137  if(TraceIndex >= TraceVector.size()) {
1138  TraceIndex = 0;
1139  }
1140 
1141  // ====== Schedule next frame transmission ===============================
1142  if(TraceIndex < TraceVector.size()) {
1143  const double nextFrameTime = TraceVector[TraceIndex].InterFrameDelay;
1144  assert(TransmitTimerVector[0] == nullptr);
1145  TransmitTimerVector[0] = new NetPerfMeterTransmitTimer("TransmitTimer");
1146  TransmitTimerVector[0]->setKind(TIMER_TRANSMIT);
1147  TransmitTimerVector[0]->setStreamID(0);
1148 
1149  // std::cout << simTime() << ", " << getFullPath()
1150  // << ": Next in " << nextFrameTime << "s" << endl;
1151 
1152  scheduleAt(simTime() + nextFrameTime, TransmitTimerVector[0]);
1153  }
1154 }
Protocol TransportProtocol
Definition: NetPerfMeter.h:88
Definition: NetPerfMeter.h:74
std::vector< NetPerfMeterTransmitTimer * > TransmitTimerVector
Definition: NetPerfMeter.h:110
std::vector< TraceEntry > TraceVector
Definition: NetPerfMeter.h:136
size_t TraceIndex
Definition: NetPerfMeter.h:137
unsigned long transmitFrame(const unsigned int frameSize, const unsigned int streamID)
Definition: NetPerfMeter.cc:879
unsigned int ActualOutboundStreams
Definition: NetPerfMeter.h:114
Definition: NetPerfMeter.h:83
void inet::NetPerfMeter::sendSCTPQueueRequest ( const unsigned int  queueSize)

Referenced by successfullyEstablishedConnection().

1182 {
1183  assert(SocketSCTP != nullptr);
1184 
1185  // Tell SCTP to limit the send queue to the number of bytes specified.
1186  // When the queue is able accept more data again, it will be indicated by
1187  // SCTP_I_SENDQUEUE_ABATED!
1188 
1189  SCTPInfo* queueInfo = new SCTPInfo();
1190  queueInfo->setText(queueSize);
1191  queueInfo->setAssocId(ConnectionID);
1192 
1193  cPacket* cmsg = new cPacket("QueueRequest");
1194  cmsg->setKind(SCTP_C_QUEUE_BYTES_LIMIT);
1195  cmsg->setControlInfo(queueInfo);
1196  if(IncomingSocketSCTP) {
1198  }
1199  else {
1200  SocketSCTP->sendRequest(cmsg);
1201  }
1202 }
void sendRequest(cMessage *msg)
Send request.
Definition: SCTPSocket.cc:405
SCTPSocket * SocketSCTP
Definition: NetPerfMeter.h:122
SCTPSocket * IncomingSocketSCTP
Definition: NetPerfMeter.h:123
int ConnectionID
Definition: NetPerfMeter.h:127
Definition: SCTPCommand.h:41
void inet::NetPerfMeter::sendTCPQueueRequest ( const unsigned int  queueSize)

Referenced by successfullyEstablishedConnection().

1207 {
1208  assert(SocketTCP != nullptr);
1209 
1210  // Tell TCP to limit the send queue to the number of bytes specified.
1211  // When the queue is able accept more data again, it will be indicated by
1212  // TCP_I_SEND_MSG!
1213 
1214  TCPCommand* queueInfo = new TCPCommand();
1215  queueInfo->setUserId(queueSize);
1216  queueInfo->setConnId(ConnectionID);
1217 
1218  cPacket* cmsg = new cPacket("QueueRequest");
1219  cmsg->setKind(TCP_C_QUEUE_BYTES_LIMIT);
1220  cmsg->setControlInfo(queueInfo);
1221  if(IncomingSocketTCP) {
1223  }
1224  else {
1225  SocketTCP->sendCommand(cmsg);
1226  }
1227 }
Definition: TCPCommand_m.h:67
TCPSocket * IncomingSocketTCP
Definition: NetPerfMeter.h:125
int ConnectionID
Definition: NetPerfMeter.h:127
void sendCommand(cMessage *msg)
Sends command.
Definition: TCPSocket.cc:187
TCPSocket * SocketTCP
Definition: NetPerfMeter.h:124
void inet::NetPerfMeter::startSending ( )
private

Referenced by handleTimer().

637 {
638  if(TraceVector.size() > 0) {
640  }
641  else {
642  for(unsigned int streamID = 0; streamID < ActualOutboundStreams; streamID++) {
644  }
646  }
647 
648  // ------ On/Off handling ------------------------------------------------
649  const simtime_t onTime = par("onTime");
650  if(onTime.dbl() > 0.0) {
651  OffTimer = new cMessage("OffTimer");
652  OffTimer->setKind(TIMER_OFF);
653  scheduleAt(simTime() + onTime, OffTimer);
654  }
655 }
Definition: NetPerfMeter.h:84
unsigned int QueueSize
Definition: NetPerfMeter.h:93
void sendDataOfNonSaturatedStreams(const unsigned long long bytesAvailableInQueue, const unsigned int streamID)
Definition: NetPerfMeter.cc:1071
void sendDataOfTraceFile(const unsigned long long bytesAvailableInQueue)
Definition: NetPerfMeter.cc:1122
void sendDataOfSaturatedStreams(const unsigned long long bytesAvailableInQueue, const SCTPSendQueueAbated *sendQueueAbatedIndication)
Definition: NetPerfMeter.cc:1010
std::vector< TraceEntry > TraceVector
Definition: NetPerfMeter.h:136
unsigned int ActualOutboundStreams
Definition: NetPerfMeter.h:114
cMessage * OffTimer
Definition: NetPerfMeter.h:105
void inet::NetPerfMeter::stopSending ( )
private

Referenced by handleTimer().

660 {
661  // ------ Stop all transmission timers ----------------------------------
662  for(auto & elem : TransmitTimerVector) {
663  cancelAndDelete(elem);
664  elem = nullptr;
665  }
667 
668  // ------ Schedule On timer ----------------------------------------------
669  const simtime_t offDuration = par("offTime");
670  if( (offDuration.dbl() > 0.0) &&
671  ((MaxOnOffCycles < 0) ||
672  (OnOffCycleCounter <= (unsigned int)MaxOnOffCycles)) ) {
673  OnTimer = new cMessage("OnTimer");
674  OnTimer->setKind(TIMER_ON);
675  scheduleAt(simTime() + offDuration, OnTimer);
676  }
677 }
Definition: NetPerfMeter.h:85
cMessage * OnTimer
Definition: NetPerfMeter.h:106
unsigned int OnOffCycleCounter
Definition: NetPerfMeter.h:107
int MaxOnOffCycles
Definition: NetPerfMeter.h:108
std::vector< NetPerfMeterTransmitTimer * > TransmitTimerVector
Definition: NetPerfMeter.h:110
void inet::NetPerfMeter::successfullyEstablishedConnection ( cMessage *  msg,
const unsigned int  queueSize 
)

Referenced by establishConnection(), and handleMessage().

558 {
559  if(HasFinished) {
560  EV << "Already finished -> no new connection!" << endl;
561  SCTPSocket newSocket(msg);
562  newSocket.abort();
563  return;
564  }
565 
566  // ====== Update queue size ==============================================
567  if(queueSize != 0) {
568  QueueSize = queueSize;
569  EV << simTime() << ", " << getFullPath() << ": Got queue size " << QueueSize << " from transport protocol" << endl;
570  }
571 
572  // ====== Get connection ID ==============================================
573  if(TransportProtocol == TCP) {
574  if(ActiveMode == false) {
575  assert(SocketTCP != nullptr);
576  if(IncomingSocketTCP != nullptr) {
577  delete IncomingSocketTCP;
578  }
579  IncomingSocketTCP = new TCPSocket(msg);
580  IncomingSocketTCP->setOutputGate(gate("tcpOut"));
582  }
583 
584  TCPCommand* connectInfo = check_and_cast<TCPCommand*>(msg->getControlInfo());
585  ConnectionID = connectInfo->getConnId();
586  sendTCPQueueRequest(QueueSize); // Limit the send queue as given.
587  }
588  else if(TransportProtocol == SCTP) {
589  if(ActiveMode == false) {
590  assert(SocketSCTP != nullptr);
591  if(IncomingSocketSCTP != nullptr) {
592  delete IncomingSocketSCTP;
593  }
594  IncomingSocketSCTP = new SCTPSocket(msg);
595  IncomingSocketSCTP->setOutputGate(gate("sctpOut"));
596  }
597 
598  SCTPConnectInfo* connectInfo = check_and_cast<SCTPConnectInfo*>(msg->getControlInfo());
599  ConnectionID = connectInfo->getAssocId();
600  sendSCTPQueueRequest(QueueSize); // Limit the send queue as given.
601  }
602 
603  // ====== Initialize TransmitTimerVector =================================
605  for(unsigned int i = 0; i < ActualOutboundStreams; i++) {
606  TransmitTimerVector[i] = nullptr;
607  }
608 
609  // ====== Schedule Start Timer to begin transmission =====================
610  if(OnOffCycleCounter == 0) {
611  assert(StartTimer == nullptr);
612  StartTimer = new cMessage("StartTimer");
613  StartTimer->setKind(TIMER_START);
615  if(TransmissionStartTime < simTime()) {
616  throw cRuntimeError("Connection establishment has been too late. Check startTime parameter!");
617  }
618  scheduleAt(TransmissionStartTime, StartTimer);
619 
620  // ====== Schedule Reset Timer to reset statistics ====================
621  assert(ResetTimer == nullptr);
622  ResetTimer = new cMessage("ResetTimer");
623  ResetTimer->setKind(TIMER_RESET);
625  scheduleAt(StatisticsResetTime, ResetTimer);
626  }
627  else {
628  // ====== Restart transmission immediately ============================
629  StartTimer = new cMessage("StartTimer");
630  scheduleAt(simTime(), StartTimer);
631  }
632 }
SCTPSocket * SocketSCTP
Definition: NetPerfMeter.h:122
Protocol TransportProtocol
Definition: NetPerfMeter.h:88
Definition: NetPerfMeter.h:75
simtime_t ResetTime
Definition: NetPerfMeter.h:99
unsigned int OnOffCycleCounter
Definition: NetPerfMeter.h:107
SCTPSocket * IncomingSocketSCTP
Definition: NetPerfMeter.h:123
unsigned int QueueSize
Definition: NetPerfMeter.h:93
Definition: NetPerfMeter.h:81
Definition: NetPerfMeter.h:74
TCPSocket * IncomingSocketTCP
Definition: NetPerfMeter.h:125
Definition: NetPerfMeter.h:80
simtime_t StatisticsResetTime
Definition: NetPerfMeter.h:142
simtime_t ConnectTime
Definition: NetPerfMeter.h:97
int ConnectionID
Definition: NetPerfMeter.h:127
void sendTCPQueueRequest(const unsigned int queueSize)
Definition: NetPerfMeter.cc:1206
bool ActiveMode
Definition: NetPerfMeter.h:89
std::vector< NetPerfMeterTransmitTimer * > TransmitTimerVector
Definition: NetPerfMeter.h:110
cMessage * StartTimer
Definition: NetPerfMeter.h:102
bool HasFinished
Definition: NetPerfMeter.h:91
TCPSocket * SocketTCP
Definition: NetPerfMeter.h:124
simtime_t StartTime
Definition: NetPerfMeter.h:98
unsigned int ActualOutboundStreams
Definition: NetPerfMeter.h:114
simtime_t TransmissionStartTime
Definition: NetPerfMeter.h:140
cMessage * ResetTimer
Definition: NetPerfMeter.h:104
void sendSCTPQueueRequest(const unsigned int queueSize)
Definition: NetPerfMeter.cc:1181
void setOutputGate(cGate *toTcp)
Sets the gate on which to send to TCP.
Definition: TCPSocket.h:228
void readDataTransferModePar(cComponent &component)
Read "dataTransferMode" parameter from ini/ned, and set dataTransferMode member value.
Definition: TCPSocket.cc:355
void setOutputGate(cGate *toSctp)
Sets the gate on which to send to SCTP.
Definition: SCTPSocket.h:177
void inet::NetPerfMeter::teardownConnection ( const bool  stopTimeReached = false)

Referenced by handleMessage(), and handleTimer().

724 {
725  for(auto & elem : TransmitTimerVector) {
726  cancelAndDelete(elem);
727  elem = nullptr;
728  }
729 
730  if(ActiveMode == false) {
731  if(TransportProtocol == SCTP) {
732  if(IncomingSocketSCTP != nullptr) {
733  delete IncomingSocketSCTP;
734  IncomingSocketSCTP = nullptr;
735  }
736  }
737  else if(TransportProtocol == TCP) {
738  if(IncomingSocketTCP != nullptr) {
739  delete IncomingSocketTCP;
740  IncomingSocketTCP = nullptr;
741  }
742  }
743  }
744  if( (stopTimeReached) || (ActiveMode == true) ) {
745  if(TransportProtocol == SCTP) {
746  if(SocketSCTP != nullptr) {
747  SocketSCTP->close();
748  delete SocketSCTP;
749  SocketSCTP = nullptr;
750  }
751  }
752  else if(TransportProtocol == TCP) {
753  if(SocketTCP != nullptr) {
754  SocketTCP->abort();
755  delete SocketTCP;
756  SocketTCP = nullptr;
757  }
758  }
759  else if(TransportProtocol == UDP) {
760  if(SocketUDP != nullptr) {
761  delete SocketUDP;
762  SocketUDP = nullptr;
763  }
764  }
765  SendingAllowed = false;
766  ConnectionID = 0;
767  }
768 
769  if(stopTimeReached) {
770  writeStatistics();
771  HasFinished = true;
772  }
773 }
SCTPSocket * SocketSCTP
Definition: NetPerfMeter.h:122
Protocol TransportProtocol
Definition: NetPerfMeter.h:88
Definition: NetPerfMeter.h:75
SCTPSocket * IncomingSocketSCTP
Definition: NetPerfMeter.h:123
Definition: NetPerfMeter.h:74
TCPSocket * IncomingSocketTCP
Definition: NetPerfMeter.h:125
int ConnectionID
Definition: NetPerfMeter.h:127
void abort()
Aborts the connection.
Definition: TCPSocket.cc:205
void close(int id=-1)
Closes the local end of the connection.
Definition: SCTPSocket.cc:410
void writeStatistics()
Definition: NetPerfMeter.cc:792
Definition: NetPerfMeter.h:76
bool SendingAllowed
Definition: NetPerfMeter.h:90
bool ActiveMode
Definition: NetPerfMeter.h:89
UDPSocket * SocketUDP
Definition: NetPerfMeter.h:126
std::vector< NetPerfMeterTransmitTimer * > TransmitTimerVector
Definition: NetPerfMeter.h:110
bool HasFinished
Definition: NetPerfMeter.h:91
TCPSocket * SocketTCP
Definition: NetPerfMeter.h:124
unsigned long inet::NetPerfMeter::transmitFrame ( const unsigned int  frameSize,
const unsigned int  streamID 
)
private

Referenced by sendDataOfNonSaturatedStreams(), sendDataOfSaturatedStreams(), and sendDataOfTraceFile().

881 {
882  EV << simTime() << ", " << getFullPath() << ": Transmit frame of size "
883  << frameSize << " on stream #" << streamID << endl;
884  assert(OnTimer == nullptr);
885 
886  // ====== TCP ============================================================
887  unsigned long newlyQueuedBytes = 0;
888  if(TransportProtocol == TCP) {
889  // TCP is stream-oriented: just pass the amount of frame data.
890  NetPerfMeterDataMessage* tcpMessage = new NetPerfMeterDataMessage;
891  tcpMessage->setCreationTime(simTime());
892  tcpMessage->setByteLength(frameSize);
893  tcpMessage->setKind(TCP_C_SEND);
894 
895  if(IncomingSocketTCP) {
896  IncomingSocketTCP->send(tcpMessage);
897  }
898  else {
899  SocketTCP->send(tcpMessage);
900  }
901 
902  newlyQueuedBytes += frameSize;
903  SenderStatistics* senderStatistics = getSenderStatistics(0);
904  senderStatistics->SentBytes += frameSize;
905  senderStatistics->SentMessages++;
906  }
907 
908  // ====== Message-Oriented Protocols =====================================
909  else {
910  unsigned int bytesToSend = frameSize;
911  do {
912  const unsigned int msgSize =
913  (bytesToSend > MaxMsgSize) ? MaxMsgSize : bytesToSend;
914 
915  // ====== SCTP =====================================================
916  if(TransportProtocol == SCTP) {
917  const bool sendUnordered = (UnorderedMode > 0.0) ? (uniform(0.0, 1.0) < UnorderedMode) : false;
918  const bool sendUnreliable = (UnreliableMode > 0.0) ? (uniform(0.0, 1.0) < UnreliableMode) : false;
919 
920  NetPerfMeterDataMessage* dataMessage = new NetPerfMeterDataMessage;
921  dataMessage->setCreationTime(simTime());
922  dataMessage->setByteLength(msgSize);
923  /*
924  dataMessage->setDataArraySize(msgSize);
925  for(unsigned long i = 0; i < msgSize; i++) {
926  dataMessage->setData(i, (i & 1) ? 'D' : 'T');
927  }
928  */
929  dataMessage->setDataLen(msgSize);
930 
931  SCTPSendInfo* command = new SCTPSendInfo("SendRequest");
932  command->setAssocId(ConnectionID);
933  command->setSid(streamID);
934  command->setSendUnordered( (sendUnordered == true) ?
936  command->setLast(true);
937  command->setPrimary(PrimaryPath.isUnspecified());
938  command->setRemoteAddr(PrimaryPath);
939  command->setPrValue(1);
940  command->setPrMethod( (sendUnreliable == true) ? 2 : 0 ); // PR-SCTP policy: RTX
941 
942  SCTPSendInfo* cmsg = new SCTPSendInfo("ControlInfo");
943  cmsg->encapsulate(dataMessage);
944  cmsg->setKind(SCTP_C_SEND);
945  cmsg->setControlInfo(command);
946  cmsg->setByteLength(msgSize);
947  send(cmsg, "sctpOut");
948 
949  SenderStatistics* senderStatistics = getSenderStatistics(streamID);
950  senderStatistics->SentBytes += msgSize;
951  senderStatistics->SentMessages++;
952  }
953 
954  // ====== UDP ===================================================
955  else if(TransportProtocol == UDP) {
956  NetPerfMeterDataMessage* dataMessage = new NetPerfMeterDataMessage;
957  dataMessage->setCreationTime(simTime());
958  dataMessage->setByteLength(msgSize);
959  SocketUDP->send(dataMessage);
960 
961  SenderStatistics* senderStatistics = getSenderStatistics(0);
962  senderStatistics->SentBytes += msgSize;
963  senderStatistics->SentMessages++;
964  }
965 
966  newlyQueuedBytes += msgSize;
967  bytesToSend -= msgSize;
968  } while(bytesToSend > 0);
969  }
970  return(newlyQueuedBytes);
971 }
Protocol TransportProtocol
Definition: NetPerfMeter.h:88
Definition: NetPerfMeter.h:75
cMessage * OnTimer
Definition: NetPerfMeter.h:106
double UnorderedMode
Definition: NetPerfMeter.h:94
Definition: NetPerfMeter.h:74
TCPSocket * IncomingSocketTCP
Definition: NetPerfMeter.h:125
int ConnectionID
Definition: NetPerfMeter.h:127
Definition: SCTPCommand.h:33
Definition: TCPCommand_m.h:63
Definition: NetPerfMeter.h:76
UDPSocket * SocketUDP
Definition: NetPerfMeter.h:126
bool isUnspecified() const
Definition: L3Address.cc:133
SenderStatistics * getSenderStatistics(const unsigned int streamID)
Definition: NetPerfMeter.h:187
L3Address PrimaryPath
Definition: NetPerfMeter.h:128
void send(cMessage *msg)
Sends data packet.
Definition: TCPSocket.cc:175
void send(cPacket *msg)
Sends a data packet to the address and port specified previously in a connect() call.
Definition: UDPSocket.cc:103
TCPSocket * SocketTCP
Definition: NetPerfMeter.h:124
double UnreliableMode
Definition: NetPerfMeter.h:95
unsigned int MaxMsgSize
Definition: NetPerfMeter.h:92
Definition: SCTPCommand.h:87
Definition: SCTPCommand.h:88
void inet::NetPerfMeter::writeStatistics ( )

Referenced by teardownConnection().

793 {
794  const simtime_t statisticsStopTime = simTime();
795  const double duration = statisticsStopTime.dbl() - StatisticsStartTime.dbl();
796 
797  recordScalar("Total Measurement Duration", duration);
798  recordScalar("On-Off Cycles", OnOffCycleCounter);
799 
800  // ====== Per-Stream Statistics ==========================================
801  unsigned long long totalSentBytes = 0;
802  unsigned long long totalSentMessages = 0;
803  for(std::map<unsigned int, SenderStatistics*>::const_iterator iterator = SenderStatisticsMap.begin();
804  iterator != SenderStatisticsMap.end(); iterator++) {
805  const unsigned int streamID = iterator->first;
806  if(streamID >= ActualOutboundStreams) {
807  break;
808  }
809  const SenderStatistics* senderStatistics = iterator->second;
810  totalSentBytes += senderStatistics->SentBytes;
811  totalSentMessages += senderStatistics->SentMessages;
812 
813  const double transmissionBitRate = (duration > 0.0) ? (8 * senderStatistics->SentBytes / duration) : 0.0;
814  const double transmissionByteRate = (duration > 0.0) ? (senderStatistics->SentBytes / duration) : 0.0;
815  const double transmissionMessageRate = (duration > 0.0) ? (senderStatistics->SentMessages / duration) : 0.0;
816  recordScalar(format("Transmission Bit Rate Stream #%u", streamID).c_str(), transmissionBitRate);
817  recordScalar(format("Transmission Byte Rate Stream #%u", streamID).c_str(), transmissionByteRate);
818  recordScalar(format("Transmission Message Rate Stream #%u", streamID).c_str(), transmissionMessageRate);
819  recordScalar(format("Sent Bytes Stream #%u", streamID).c_str(), senderStatistics->SentBytes);
820  recordScalar(format("Sent Messages Stream #%u", streamID).c_str(), senderStatistics->SentMessages);
821  }
822 
823  unsigned long long totalReceivedBytes = 0;
824  unsigned long long totalReceivedMessages = 0;
825  for(auto & elem : ReceiverStatisticsMap) {
826  const unsigned int streamID = elem.first;
827  if(streamID >= ActualInboundStreams) {
828  break;
829  }
830  ReceiverStatistics* receiverStatistics = elem.second;
831  totalReceivedBytes += receiverStatistics->ReceivedBytes;
832  totalReceivedMessages += receiverStatistics->ReceivedMessages;
833 
834  // NOTE: When sending "as much as possible", the transmission counters are
835  // set to 0 on reset. If the queue is long enough, there may be no
836  // need to fill it again => counters will be 0 here.
837  const double receptionBitRate = (duration > 0.0) ? (8 * receiverStatistics->ReceivedBytes / duration) : 0.0;
838  const double receptionByteRate = (duration > 0.0) ? (receiverStatistics->ReceivedBytes / duration) : 0.0;
839  const double receptionMessageRate = (duration > 0.0) ? (receiverStatistics->ReceivedMessages / duration) : 0.0;
840  recordScalar(format("Reception Bit Rate Stream #%u", streamID).c_str(), receptionBitRate);
841  recordScalar(format("Reception Byte Rate Stream #%u", streamID).c_str(), receptionByteRate);
842  recordScalar(format("Reception Message Rate Stream #%u", streamID).c_str(), receptionMessageRate);
843  recordScalar(format("Received Bytes Stream #%u", streamID).c_str(), receiverStatistics->ReceivedBytes);
844  recordScalar(format("Received Messages Stream #%u", streamID).c_str(), receiverStatistics->ReceivedMessages);
845  receiverStatistics->ReceivedDelayHistogram.recordAs(format("Received Message Delay Stream #%u", streamID).c_str(), "s");
846  }
847 
848 
849  // ====== Total Statistics ===============================================
850  // NOTE: When sending "as much as possible", the transmission counters are
851  // set to 0 on reset. If the queue is long enough, there may be no
852  // need to fill it again => counters will be 0 here.
853  const double totalReceptionBitRate = (duration > 0.0) ? (8 * totalReceivedBytes / duration) : 0.0;
854  const double totalReceptionByteRate = (duration > 0.0) ? (totalReceivedBytes / duration) : 0.0;
855  const double totalReceptionMessageRate = (duration > 0.0) ? (totalReceivedMessages / duration) : 0.0;
856  const double totalTransmissionBitRate = (duration > 0.0) ? (8 * totalSentBytes / duration) : 0.0;
857  const double totalTransmissionByteRate = (duration > 0.0) ? (totalSentBytes / duration) : 0.0;
858  const double totalTransmissionMessageRate = (duration > 0.0) ? (totalSentMessages / duration) : 0.0;
859 
860  // NOTE: The byte rate is redundant, but having bits and bytes
861  // makes manual reading of the results easier.
862  recordScalar("Total Transmission Bit Rate", totalTransmissionBitRate);
863  recordScalar("Total Transmission Byte Rate", totalTransmissionByteRate);
864  recordScalar("Total Transmission Message Rate", totalTransmissionMessageRate);
865  recordScalar("Total Sent Bytes", totalSentBytes);
866  recordScalar("Total Sent Messages", totalSentMessages);
867 
868  recordScalar("Total Reception Bit Rate", totalReceptionBitRate);
869  recordScalar("Total Reception Byte Rate", totalReceptionByteRate);
870  recordScalar("Total Reception Message Rate", totalReceptionMessageRate);
871  recordScalar("Total Received Bytes", totalReceivedBytes);
872  recordScalar("Total Received Messages", totalReceivedMessages);
873 
874  resetStatistics(); // Make sure that it is not mistakenly used later
875 }
std::map< unsigned int, ReceiverStatistics * > ReceiverStatisticsMap
Definition: NetPerfMeter.h:185
unsigned int OnOffCycleCounter
Definition: NetPerfMeter.h:107
static opp_string format(const char *formatString,...)
Definition: NetPerfMeter.cc:1231
simtime_t StatisticsStartTime
Definition: NetPerfMeter.h:148
std::map< unsigned int, SenderStatistics * > SenderStatisticsMap
Definition: NetPerfMeter.h:184
unsigned int ActualOutboundStreams
Definition: NetPerfMeter.h:114
void resetStatistics()
Definition: NetPerfMeter.cc:777
unsigned int ActualInboundStreams
Definition: NetPerfMeter.h:115

Member Data Documentation

bool inet::NetPerfMeter::ActiveMode = false
protected
unsigned int inet::NetPerfMeter::ActualInboundStreams = 0
protected
unsigned int inet::NetPerfMeter::ActualOutboundStreams = 0
protected
simtime_t inet::NetPerfMeter::ConnectionEstablishmentTime
protected

Referenced by establishConnection().

simtime_t inet::NetPerfMeter::ConnectTime
protected
cMessage* inet::NetPerfMeter::ConnectTimer = nullptr
protected
bool inet::NetPerfMeter::DecoupleSaturatedStreams = false
protected
std::vector<cDynamicExpression> inet::NetPerfMeter::FrameRateExpressionVector
protected

Referenced by getFrameRate(), and initialize().

std::vector<cDynamicExpression> inet::NetPerfMeter::FrameSizeExpressionVector
protected

Referenced by getFrameSize(), and initialize().

bool inet::NetPerfMeter::HasFinished = false
protected
SCTPSocket* inet::NetPerfMeter::IncomingSocketSCTP = nullptr
protected
TCPSocket* inet::NetPerfMeter::IncomingSocketTCP = nullptr
protected
unsigned int inet::NetPerfMeter::LastStreamID = 0
protected
unsigned int inet::NetPerfMeter::MaxInboundStreams = 0
protected
unsigned int inet::NetPerfMeter::MaxMsgSize = 0
protected

Referenced by initialize(), and transmitFrame().

int inet::NetPerfMeter::MaxOnOffCycles = 0
protected

Referenced by initialize(), and stopSending().

cMessage* inet::NetPerfMeter::OffTimer = nullptr
protected
unsigned int inet::NetPerfMeter::OnOffCycleCounter = 0
protected
cMessage* inet::NetPerfMeter::OnTimer = nullptr
protected
L3Address inet::NetPerfMeter::PrimaryPath
protected
unsigned int inet::NetPerfMeter::QueueSize = 0
protected
std::map<unsigned int, ReceiverStatistics*> inet::NetPerfMeter::ReceiverStatisticsMap
private
unsigned int inet::NetPerfMeter::RequestedOutboundStreams = 0
protected
simtime_t inet::NetPerfMeter::ResetTime
protected
cMessage* inet::NetPerfMeter::ResetTimer = nullptr
protected
std::map<unsigned int, SenderStatistics*> inet::NetPerfMeter::SenderStatisticsMap
private
bool inet::NetPerfMeter::SendingAllowed = false
protected
UDPSocket* inet::NetPerfMeter::SocketUDP = nullptr
protected
simtime_t inet::NetPerfMeter::StartTime
protected
cMessage* inet::NetPerfMeter::StartTimer = nullptr
protected
simtime_t inet::NetPerfMeter::StatisticsResetTime
protected
simtime_t inet::NetPerfMeter::StatisticsStartTime
protected

Referenced by resetStatistics(), and writeStatistics().

simtime_t inet::NetPerfMeter::StopTime
protected

Referenced by handleTimer(), and initialize().

cMessage* inet::NetPerfMeter::StopTimer = nullptr
protected

Referenced by handleTimer(), and ~NetPerfMeter().

size_t inet::NetPerfMeter::TraceIndex = 0
protected

Referenced by initialize(), and sendDataOfTraceFile().

std::vector<TraceEntry> inet::NetPerfMeter::TraceVector
protected
simtime_t inet::NetPerfMeter::TransmissionStartTime
protected
double inet::NetPerfMeter::UnorderedMode = NAN
protected

Referenced by initialize(), and transmitFrame().

double inet::NetPerfMeter::UnreliableMode = NAN
protected

Referenced by initialize(), and transmitFrame().


The documentation for this class was generated from the following files: