RINASim  October 2016
Documentation of framework for OMNeT++
DTCP.cc
Go to the documentation of this file.
1 // The MIT License (MIT)
2 //
3 // Copyright (c) 2014-2016 Brno University of Technology, PRISTINE project
4 //
5 // Permission is hereby granted, free of charge, to any person obtaining a copy
6 // of this software and associated documentation files (the "Software"), to deal
7 // in the Software without restriction, including without limitation the rights
8 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 // copies of the Software, and to permit persons to whom the Software is
10 // furnished to do so, subject to the following conditions:
11 //
12 // The above copyright notice and this permission notice shall be included in
13 // all copies or substantial portions of the Software.
14 //
15 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 // THE SOFTWARE.
22 
23 #include "DTCP.h"
24 const char * SIG_STAT_DTCP_RX_SENT = "DTCP_RX_SENT";
25 
27 
29 // rxControl = NULL;
30 // flowControl = NULL;
31 
32  ecnPolicy = NULL;
33  rcvrFCPolicy = NULL;
34  rcvrAckPolicy = NULL;
35  receivingFCPolicy = NULL;
36  sendingAckPolicy = NULL;
37  lostControlPDUPolicy = NULL;
38  rcvrControlAckPolicy = NULL;
39  senderAckPolicy = NULL;
40  sndFcOverrunPolicy = NULL;
41  noOverridePeakPolicy = NULL;
42  txControlPolicy = NULL;
43  noRateSlowDownPolicy = NULL;
44  reconcileFCPolicy = NULL;
45  rateReductionPolicy = NULL;
46  ecnSlowDownPolicy = NULL;
47  rxTimerExpiryPolicy = NULL;
48 
49 
50 
51 
52 }
53 
55 {
56  return dtcpState;
57 }
58 
59 unsigned int DTCP::getSendingRate() const
60 {
61  return dtcpState->getSendingRate();
62 }
63 
64 void DTCP::setSendingRate(unsigned int sendingRate)
65 {
66  dtcpState->setSendingRate(sendingRate);
67 }
68 
69 unsigned int DTCP::getRcvrRate() const
70 {
71  return dtcpState->getRcvrRate();
72 }
73 
74 cModule* DTCP::createPolicyModule(const char* prefix, const char* name)
75 {
76  if (std::string(par(name).stringValue()).empty())
77  {
78  return NULL;
79  }else{
80  std::stringstream moduleName;
81  moduleName << prefix << par(name).stringValue();
82  cModuleType* policyType = cModuleType::get(moduleName.str().c_str());
83  return policyType->createScheduleInit(name, getParentModule());
84  }
85 }
86 
87 unsigned int DTCP::getSndLeftWinEdge() const
88 {
89  return dtcpState->getSndLeftWinEdge();
90 }
91 
92 void DTCP::setSenderLeftWinEdge(unsigned int senderLeftWinEdge)
93 {
94  dtcpState->setSenderLeftWinEdge(senderLeftWinEdge);
95 }
96 
98 {
99  this->rcvFcOverrunPolicy = rcvFcOverrunPolicy;
100 }
101 
103 {
104  sigStatDTCPRxCount = registerSignal(SIG_STAT_DTCP_RX_SENT);
105 }
106 
108 {
109  Enter_Method_Silent();
110  DTCPRendezvousTimer* rendezvousTimer = new DTCPRendezvousTimer();
111  rendezvousTimer->setSeqNum(dtcpState->getLastControlSeqNumSent());
112  rendezvousTimer->setCounter(0);
113  scheduleAt(simTime() + (dtp->state->getRtt() + dtp->state->getMPL()) / 2, rendezvousTimer);
114  dtcpState->setRendezvousTimer(rendezvousTimer);
115 }
116 
117 void DTCP::initialize(int step)
118 {
119  Enter_Method("initialize");
120  if(step == 1){
121  cDisplayString& disp = getDisplayString();
122  disp.setTagArg("p", 0, 340);
123  disp.setTagArg("p", 1, 140);
124 
125 // //TODO B1 Not necessary DTP reference is set during DTCP creation. -> IF IT WILL WORK THEN DELETE THE COMMENTED LINES
126 // dtp = getRINAModule<DTP*>(this, 1, {MOD_DTP});
127 
128 
130  }
131 }
132 
134 {
135  clearRxQ();
136 // delete dtcpState;
137 }
138 
140 {
141 
143 
144 }
145 
146 void DTCP::setDTP(DTP* dtp)
147 {
148  this->dtp = dtp;
149 }
150 
152 {
153 
154  Enter_Method_Silent("ECNPolicy");
155  ecnPolicy->call(dtpState, dtcpState);
156 
157  return false;
158 }
159 
160 
161 
163 {
165 }
166 
167 
169 {
170  Enter_Method_Silent("RcvrFCPolicy");
171  rcvrFCPolicy->call(dtpState, dtcpState);
172  return false;
173 }
174 
176 {
177  Enter_Method_Silent("RcvrAckPolicy");
178  rcvrAckPolicy->call(dtpState, dtcpState);
179  return false;
180 }
181 
183 {
184  Enter_Method_Silent("ReceivingFCPolicy");
185  receivingFCPolicy->call(dtpState, dtcpState);
186 
187  return false;
188 }
189 
190 
191 
193 {
194  Enter_Method_Silent("SendingAckPolicy");
195  sendingAckPolicy->call(dtpState, dtcpState);
196 
197  return false;
198 }
199 
201 {
202  Enter_Method_Silent("LostControlPDUPolicy");
203  lostControlPDUPolicy->call(dtpState, dtcpState);
204 
205  return false;
206 }
207 
209 {
210  Enter_Method_Silent("RcvrControlAckPolicy");
211  rcvrControlAckPolicy->call(dtpState, dtcpState);
212 
213  return false;
214 }
215 
217 {
218  Enter_Method_Silent("SenderAckPolicy");
219  senderAckPolicy->call(dtpState, dtcpState);
220 
221  return false;
222 }
223 
224 
226 {
227  Enter_Method_Silent("SndFCOverrunPolicy");
228  sndFcOverrunPolicy->call(dtpState, dtcpState);
229 
230  return false;
231 }
232 
234 {
235  Enter_Method_Silent("RcvFCOverrunPolicy");
236  rcvFcOverrunPolicy->call(dtpState, dtcpState);
237  return false;
238 }
239 
241 {
242  Enter_Method_Silent("NoOverridePeakPolicy");
243  noOverridePeakPolicy->call(dtpState, dtcpState);
244 
245  return false;
246 }
247 
248 
250 {
251  Enter_Method_Silent("TxControlPolicy");
252  txControlPolicy->call(dtpState, dtcpState);
253 
254  return false;
255 }
256 
258 {
259  Enter_Method_Silent("NoRateSlowDownPolicy");
260  noRateSlowDownPolicy->call(dtpState, dtcpState);
261 
262  return false;
263 }
264 
266 {
267  Enter_Method_Silent("ReconcileFCPolicy");
268 reconcileFCPolicy->call(dtpState, dtcpState);
269 
270  return false;
271 }
272 
274 {
275  Enter_Method_Silent("RateReductionPolicy");
276  rateReductionPolicy->call(dtpState, dtcpState);
277 
278  return false;
279 }
280 
281 
283 {
284 
285  Enter_Method_Silent("ECNSlowDownPolicy");
286  ecnSlowDownPolicy->call(dtpState, dtcpState);
287 
288  return false;
289 }
290 
291 
292 void DTCP::nackPDU(unsigned int startSeqNum, unsigned int endSeqNum)
293 {
294  Enter_Method_Silent();
295 
296  bool startTrue = false;
297  if(!endSeqNum){
298  startTrue = true;
299  endSeqNum = startSeqNum;
300  }
301 
302  std::vector<DTCPRxExpiryTimer*>* rxQ = dtcpState->getRxQ();
303  std::vector<DTCPRxExpiryTimer*>::iterator it;
304  unsigned int lastLen;
305  lastLen = rxQ->size();
306  for (unsigned int index = 0; index < rxQ->size(); )
307  {
308  DTCPRxExpiryTimer* timer = rxQ->at(index);
309  unsigned int seqNum = (timer->getPdu())->getSeqNum();
310 
311  if (seqNum >= startSeqNum && (seqNum <= endSeqNum || startTrue) )
312  {
314 
315  /* Timer might get deleted so we do not want to increment index */
316  if(lastLen != rxQ->size()){
317  continue;
318  }
319  }
320  index++;
321  }
322 }
323 
324 void DTCP::deleteRxTimer(unsigned int seqNum) {
325  std::vector<DTCPRxExpiryTimer*>* rxQ = dtcpState->getRxQ();
326  std::vector<DTCPRxExpiryTimer*>::iterator it;
327  for (it = rxQ->begin(); it != rxQ->end();) {
328  if (seqNum == (*it)->getPdu()->getSeqNum()) {
329  delete (*it)->getPdu();
330  // take((*it));
331  cancelEvent((*it));
332  delete (*it);
333  rxQ->erase(it);
334  return;
335  }
336  ++it;
337  }
338  return;
339 }
340 
341 void DTCP::ackPDU(unsigned int startSeqNum, unsigned int endSeqNum)
342 {
343  Enter_Method_Silent();
344  bool startTrue = false;
345  if(!endSeqNum){
346  startTrue = true;
347  endSeqNum = startSeqNum;
348  }
349 
350 
351  std::vector<DTCPRxExpiryTimer*>* rxQ = dtcpState->getRxQ();
352  std::vector<DTCPRxExpiryTimer*>::iterator it;
353 
354  for (unsigned int index = 0; index < rxQ->size(); )
355  {
356  DTCPRxExpiryTimer* timer = rxQ->at(index);
357  unsigned int seqNum =(timer->getPdu())->getSeqNum();
358 
359  if ((seqNum >= startSeqNum || startTrue) && seqNum <= endSeqNum)
360  {
361  deleteRxTimer(seqNum);
362  continue;
363  }
364  index++;
365  }
366 }
367 
368 
374 {
375  /* Canceling event is not needed for usual timer expiration but for direct calling this method */
376  cancelEvent(timer);
377  runRxTimerExpiryPolicy(timer);
378 
379 }
380 
382 {
383 
385 
387 
388 }
389 
391 {
392  Enter_Method_Silent();
393  DTCPRxExpiryTimer* rxExpTimer = new DTCPRxExpiryTimer("DTCPRxExpiryTimer");
394  take(pdu);
395  rxExpTimer->setPdu(pdu);
396  schedule(rxExpTimer);
397  dtcpState->pushBackToRxQ(rxExpTimer);
398 
399 }
400 
402  Enter_Method_Silent();
403  dtcpState->clearRxQ();
404 }
405 
406 unsigned int DTCP::getDataReXmitMax() const{
407  return dtcpState->getDataReXmitMax();
408 }
409 
410 void DTCP::schedule(DTCPTimers* timer, double time){
411 
412  Enter_Method_Silent();
413  switch (timer->getType())
414  {
415 
416  case (DTCP_RX_EXPIRY_TIMER): {
417  DTCPRxExpiryTimer* rxExpTimer = (DTCPRxExpiryTimer*)timer;
418  if(rxExpTimer->getExpiryCount() == 0){
419  rxExpTimer->setSent(simTime().dbl());
420  }
421  //TODO B1 (RTT + A + epsilon)
422 // double aTime = dtp->state->getQoSCube()->getATime();
423 // double rtt = dtp->state->getRtt();
424 // scheduleAt(simTime() + dtp->state->getRtt() + (double)dtp->state->getQoSCube()->getATime()/(double)1000 + DTP_EPSILON, rxExpTimer);
425  scheduleAt(simTime() + dtp->rttEstimatorPolicy->getRTO(), rxExpTimer);
426  break;
427  }
429  scheduleAt(simTime() + dtcpState->getTimeUnit() / 1000, timer);
430  break;
431  }
432  }
433 
434 }
435 
437 {
438  std::vector<DTCPRxExpiryTimer*>* rxQ = dtcpState->getRxQ();
439  std::vector<DTCPRxExpiryTimer*>::iterator it;
440  for (it = rxQ->begin(); it != rxQ->end(); ++it)
441  {
442  if (!(*it)->isScheduled())
443  {
444  schedule((*it));
445  break;
446  }
447  }
448 }
449 
450 //void DTCP::resetWindowTimer(){
451 // Enter_Method_Silent();
452 // cancelEvent(windowTimer);
453 // schedule(windowTimer);
454 //}
455 
457 {
459 }
460 
462 {
463  // handleRendezvousTimer(static_cast<DTCPRendezvousTimer*>(timer));
465 }
466 
468 {
469  cancelAndDelete(dtcpState->getReliableCpduTimer());
470 }
471 
473 {
474  Enter_Method_Silent();
475  DTCPReliableControlPDUTimer* reliableCPDUTimer = new DTCPReliableControlPDUTimer();
476  dtcpState->setReliableCpduTimer(reliableCPDUTimer);
477  scheduleAt(simTime() + (dtp->state->getMPL() + dtp->state->getRtt()) / 2, dtcpState->getReliableCpduTimer());
478 
479 
480 }
481 
482 void DTCP::handleMessage(cMessage *msg){
483  if(msg->isSelfMessage()){
484  /* Self message */
485  DTCPTimers* timer = static_cast<DTCPTimers*>(msg);
486 
487  switch(timer->getType()){
488 // case(DTCP_WINDOW_TIMER):{
489 // handleWindowTimer(static_cast<WindowTimer*>(timer));
490 // break;
491 // }
492  case(DTCP_RX_EXPIRY_TIMER):{
493  handleDTCPRxExpiryTimer(static_cast<DTCPRxExpiryTimer*>(timer));
494  break;
495  }
498  break;
499  }
500 
501  case (DTCP_RENDEZVOUS_TIMER): {
502  handleRendezvousTimer(static_cast<DTCPRendezvousTimer*>(timer));
503  delete msg;
504  break;
505  }
506 
507  case (DTCP_REL_C_PDU_TIMER): {
508  dtp->sendAckFlowPDU();
510  //TODO A! restart SenderInactivity Timer
511  delete msg;
512  break;
513  }
514 
515  }
516  }else{
517 
518  /* PANIC!! */
519  }
520 
521 }
522 
523 //void DTCP::handleWindowTimer(WindowTimer* timer){
524 // resetWindowTimer();
525 // dtp->sendControlAckPDU();
526 //
527 //}
528 
530 {
532 
534  schedule(timer);
535 }
536 
538 // return rxControl->getNextSndCtrlSeqNum();
540 }
541 
543 // return rxControl->getLastCtrlSeqNumRcv();
545 }
546 
547 void DTCP::setLastCtrlSeqnumRcvd(unsigned int ctrlSeqNum){
548 // rxControl->setLastCtrlSeqNumRcv(ctrlSeqNum);
549  dtcpState->setLastCtrlSeqNumRcv(ctrlSeqNum);
550 }
551 
552 void DTCP::setSndRtWinEdge(unsigned int sndRtWinEdge)
553 {
554 // flowControl->setSendRightWindowEdge(sndRtWinEdge);
555  dtcpState->setSenderRightWinEdge(sndRtWinEdge);
556 }
557 
558 unsigned int DTCP::getSndRtWinEdge()
559 {
560 
561 // return flowControl->getSendRightWindowEdge();
562  return dtcpState->getSndRightWinEdge();
563 
564 }
565 
566 void DTCP::setRcvRtWinEdge(unsigned int rcvRtWinEdge)
567 {
568 
569  dtcpState->setRcvRtWinEdge(rcvRtWinEdge);
570 
571 }
572 
574 {
575  return dtcpState->getRcvRightWinEdge();
576 }
577 
578 unsigned int DTCP::getRcvCredit()
579 {
580  return dtcpState->getRcvCredit();
581 }
582 
584 {
585  return dtcpState->getSendingTimeUnit();
586 }
587 
589 {
591 }
592 
593 void DTCP::setSendingRateFullfilled(bool rateFullfilled)
594 {
595  dtcpState->setSendingRateFullfilled(rateFullfilled);
596 }
597 
598 unsigned int DTCP::getPdusSentInTimeUnit() const
599 {
601 }
602 
603 unsigned int DTCP::getPdusRcvdInTimeUnit() const
604 {
606 }
607 
609 {
611 }
612 
613 void DTCP::setPdusSentInTimeUnit(unsigned int pdusSentInTimeUnit)
614 {
615  dtcpState->setPdusSentInTimeUnit(pdusSentInTimeUnit);
616 }
617 
619 {
620 // return;
621  Enter_Method_Silent();
622  if (!getEnvir()->isGUI())
623  {
624  return;
625  }
626 
627  cDisplayString& disp = getDisplayString();
628  disp.setTagArg("t", 1, "r");
629  std::ostringstream desc;
630 
631 
632  desc << "rRWE: " << getRcvRightWinEdge() << "\n";
633  desc << "sLWE: " << getSndLeftWinEdge() << "\n";
634  desc << "sRWE: " << getSndRtWinEdge() << "\n";
635 
636 
637  std::vector<DTCPRxExpiryTimer*>* rxQ = dtcpState->getRxQ();
638 
639  if (rxQ->empty())
640  {
641  desc << "RxQ: empty" << "\n";
642  }
643  else
644  {
645  desc << "RxQ: ";
646  std::vector<DTCPRxExpiryTimer*>::iterator it;
647  for (it = rxQ->begin(); it != rxQ->end(); ++it)
648  {
649  desc << (*it)->getPdu()->getSeqNum() << " | ";
650  }
651  desc << "\n";
652  }
653  desc << "rxSent: " << dtcpState->getRxSent() <<endl;
654 
656  {
657  desc << "closedWinQ: empty" << "\n";
658  }
659  else
660  {
661  desc << "closedWinQ: ";
662  std::vector<DataTransferPDU*>::iterator it;
663  std::vector<DataTransferPDU*>* pduQ;
664  pduQ = dtcpState->getClosedWindowQ();
665  for (it = pduQ->begin(); it != pduQ->end(); ++it)
666  {
667  desc << (*it)->getSeqNum() << " | ";
668  }
669  desc << "\n";
670  }
671 
672 
673  desc << "dup Acks: " << getDupAcks() << "\n";
674 
675 
676  disp.setTagArg("t", 0, desc.str().c_str());
677 
678 }
679 
681 {
683 }
684 
685 unsigned int DTCP::getDupAcks() const
686 {
687  return dtcpState->getDupAcks();
688 }
689 
690 
692 {
693  dtcpState->incDupFC();
694 }
695 
696 unsigned int DTCP::getDupFC() const
697 {
698  return dtcpState->getDupFC();
699 }
700 
702 {
703  return dtcpState->isClosedWinQClosed();
704 }
705 
706 void DTCP::updateSenderLWE(unsigned int seqNum)
707 {
708  dtcpState->updateSndLWE(seqNum);
709 }
710 
712 {
713  this->sndFcOverrunPolicy = sndFcOverrunPolicy;
714 }
715 
717 {
718  lostControlPDUPolicy = lostControlPduPolicy;
719 }
720 
722 {
723  this->noOverridePeakPolicy = noOverridePeakPolicy;
724 }
725 
727 {
728  this->noRateSlowDownPolicy = noRateSlowDownPolicy;
729 }
730 
732 {
733  this->rateReductionPolicy = rateReductionPolicy;
734 }
735 
737 {
738  this->rcvrAckPolicy = rcvrAckPolicy;
739 }
740 
742 {
743  this->rcvrControlAckPolicy = rcvrControlAckPolicy;
744 }
745 
747 {
748  rcvrFCPolicy = rcvrFcPolicy;
749 }
750 
752 {
753  receivingFCPolicy = receivingFcPolicy;
754 }
755 
757 {
758  reconcileFCPolicy = reconcileFcPolicy;
759 }
760 
762 {
763  this->rxTimerExpiryPolicy = rxTimerExpiryPolicy;
764 }
765 
767 {
768  this->senderAckPolicy = senderAckPolicy;
769 }
770 
772 {
773  this->sendingAckPolicy = sendingAckPolicy;
774 }
775 
777 {
778  this->txControlPolicy = txControlPolicy;
779 }
780 
782 {
783  this->ecnPolicy = ecnPolicy;
784 }
785 
787 {
788  this->ecnSlowDownPolicy = ecnSlowDownPolicy;
789 }
790 
792 {
793  this->dtcpState = dtcpState;
794 }
bool runSenderAckPolicy(DTPState *dtpState)
Definition: DTCP.cc:216
NoOverridePeakPolicyBase * noOverridePeakPolicy
Definition: DTCP.h:83
void setSenderLeftWinEdge(unsigned int senderLeftWinEdge)
Definition: DTCPState.cc:138
void incRcvRtWinEdge()
Definition: DTCPState.cc:188
void setSndFcOverrunPolicy(SndFCOverrunPolicyBase *sndFcOverrunPolicy)
Definition: DTCP.cc:711
DTPState * state
Definition: DTP.h:72
SendingAckPolicyBase * sendingAckPolicy
Definition: DTCP.h:77
virtual int getType() const
RcvFCOverrunPolicyBase * rcvFcOverrunPolicy
Definition: DTCP.h:82
RTTEstimatorPolicyBase * rttEstimatorPolicy
Definition: DTP.h:82
SndFCOverrunPolicyBase * sndFcOverrunPolicy
Definition: DTCP.h:81
void pushBackToRxQ(DTCPRxExpiryTimer *timer)
Definition: DTCPState.cc:269
unsigned int getDupFC() const
Definition: DTCPState.cc:418
void ackPDU(unsigned int startSeqNum, unsigned int endSeqNum=0)
Definition: DTCP.cc:341
void updateSenderLWE(unsigned int seqNum)
Definition: DTCP.cc:706
unsigned int getDupFC() const
Definition: DTCP.cc:696
void redrawGUI()
Definition: DTCP.cc:618
void setRcvrControlAckPolicy(RcvrControlAckPolicyBase *rcvrControlAckPolicy)
Definition: DTCP.cc:741
unsigned int getPdusRcvdInTimeUnit() const
Definition: DTCPState.cc:541
void setDTP(DTP *dtp)
Definition: DTCP.cc:146
unsigned int getRxSent() const
Definition: DTCPState.cc:484
double getMPL() const
Definition: DTPState.cc:33
Define_Module(DTCP)
void incRcvRtWinEdge()
Definition: DTCP.cc:162
unsigned int getDataReXmitMax() const
Definition: DTCPState.cc:254
void setSendingAckPolicy(SendingAckPolicyBase *sendingAckPolicy)
Definition: DTCP.cc:771
void setSenderRightWinEdge(unsigned int senderRightWinEdge)
Definition: DTCPState.cc:147
bool isClosedWinQClosed()
Definition: DTCP.cc:701
cModule * createPolicyModule(const char *prefix, const char *name)
Definition: DTCP.cc:74
void setRcvRtWinEdge(unsigned int rcvRtWinEdge)
Definition: DTCP.cc:566
RcvrControlAckPolicyBase * rcvrControlAckPolicy
Definition: DTCP.h:79
RateReductionPolicyBase * rateReductionPolicy
Definition: DTCP.h:87
DTCPState * dtcpState
Definition: DTCP.h:68
void startReliableCPDUTimer()
Definition: DTCP.cc:472
void setSendingRateFullfilled(bool sendingRateFullfilled)
Definition: DTCPState.cc:354
void handleRendezvousTimer(DTCPRendezvousTimer *rendezTimer)
Definition: DTCP.cc:461
unsigned int getSendingRate() const
Definition: DTCP.cc:59
virtual bool call(DTPState *dtpState, DTCPState *dtcpState)
Definition: EFCPPolicy.cc:44
void rendezvousCondition()
Definition: DTP.cc:1283
unsigned int getPdusSentInTimeUnit() const
Definition: DTCP.cc:598
const char * SIG_STAT_DTCP_RX_SENT
Definition: DTCP.cc:24
bool runRateReductionPolicy(DTPState *dtpState)
Definition: DTCP.cc:273
void setLastCtrlSeqNumRcv(unsigned int ctrlSeqNum)
Definition: DTCPState.cc:212
unsigned int getNextSndCtrlSeqNum()
Definition: DTCPState.cc:198
Definition: DTCP.h:63
bool runRcvrAckPolicy(DTPState *dtpState)
Definition: DTCP.cc:175
void setSendingRate(unsigned int sendingRate)
Definition: DTCP.cc:64
unsigned int getSndRightWinEdge() const
Definition: DTCPState.cc:142
DTP * dtp
Definition: DTCP.h:67
bool runTxControlPolicy(DTPState *dtpState, PDUQ_t *pduQ)
Definition: DTCP.cc:249
bool runECNPolicy(DTPState *dtpState)
Definition: DTCP.cc:151
bool isSendingRateFullfilled() const
Definition: DTCP.cc:588
bool runRcvrControlAckPolicy(DTPState *dtpState)
Definition: DTCP.cc:208
unsigned int getPdusSentInTimeUnit() const
Definition: DTCPState.cc:358
void setSenderLeftWinEdge(unsigned int senderLeftWinEdge)
Definition: DTCP.cc:92
unsigned int getDupAcks() const
Definition: DTCPState.cc:398
void updateRcvRtWinEdge(DTPState *dtpState)
Definition: DTCP.cc:456
virtual void setPdu(const DTPDU_p &pdu)
unsigned int getClosedWinQueLen() const
Definition: DTCPState.cc:337
void setNoOverridePeakPolicy(NoOverridePeakPolicyBase *noOverridePeakPolicy)
Definition: DTCP.cc:721
virtual DTPDU_p & getPdu()
void setPdusSentInTimeUnit(unsigned int pdusSentInTimeUnit)
Definition: DTCPState.cc:363
virtual void setSent(double sent)
unsigned long getSendingTimeUnit()
Definition: DTCP.cc:583
void setReliableCpduTimer(DTCPReliableControlPDUTimer *reliableCpduTimer)
Definition: DTCPState.cc:502
void setRcvrAckPolicy(RcvrAckPolicyBase *rcvrAckPolicy)
Definition: DTCP.cc:736
void incDupAcks()
Definition: DTCP.cc:680
void setPdusSentInTimeUnit(unsigned int pdusSentInTimeUnit)
Definition: DTCP.cc:613
unsigned int getSendingRate() const
Definition: DTCPState.cc:368
ECNSlowDownPolicyBase * ecnSlowDownPolicy
Definition: DTCP.h:73
unsigned int getLastControlSeqNumSent() const
Definition: DTCPState.cc:551
unsigned int getRcvCredit()
Definition: DTCP.cc:578
unsigned int getSndRtWinEdge()
Definition: DTCP.cc:558
void setECNSlowDownPolicy(ECNSlowDownPolicyBase *ecnSlowDownPolicy)
Definition: DTCP.cc:786
void setRxTimerExpiryPolicy(RxTimerExpiryPolicyBase *rxTimerExpiryPolicy)
Definition: DTCP.cc:761
void setRateReductionPolicy(RateReductionPolicyBase *rateReductionPolicy)
Definition: DTCP.cc:731
unsigned int getRcvLeftWinEdge() const
Definition: DTPState.cc:258
bool runRcvrFCPolicy(DTPState *dtpState)
Definition: DTCP.cc:168
bool runReceivingFCPolicy(DTPState *dtpState)
Definition: DTCP.cc:182
RcvrAckPolicyBase * rcvrAckPolicy
Definition: DTCP.h:75
void setSendingRateFullfilled(bool rateFullfilled)
Definition: DTCP.cc:593
std::vector< DataTransferPDU * > PDUQ_t
void setRcvRtWinEdge(unsigned int rcvRtWinEdge)
Definition: DTCPState.cc:183
void stopReliableCPDUTimer()
Definition: DTCP.cc:467
void setSendingRate(unsigned int sendingRate)
Definition: DTCPState.cc:393
void setRcvrFcPolicy(RcvrFCPolicyBase *rcvrFcPolicy)
Definition: DTCP.cc:746
unsigned int getPdusRcvdInTimeUnit() const
Definition: DTCP.cc:603
DTCPReliableControlPDUTimer * getReliableCpduTimer()
Definition: DTCPState.cc:497
unsigned int getRcvRightWinEdge() const
Definition: DTCPState.cc:178
virtual ~DTCP()
Definition: DTCP.cc:139
void incDupAcks()
Definition: DTCPState.cc:403
void setECNPolicy(ECNPolicyBase *ecnPolicy)
Definition: DTCP.cc:781
unsigned int getSndLeftWinEdge() const
Definition: DTCP.cc:87
bool runLostControlPDUPolicy(DTPState *dtpState)
Definition: DTCP.cc:200
bool runSendingAckPolicy(DTPState *dtpState, ATimer *timer)
Definition: DTCP.cc:192
unsigned int getRcvrRate() const
Definition: DTCP.cc:69
bool isSendingRateFullfilled() const
Definition: DTCPState.cc:350
void incDupFC()
Definition: DTCP.cc:691
void updateSndLWE(unsigned int seqNum)
Definition: DTCPState.cc:433
void sendAckFlowPDU(unsigned int seqNum=0, bool seqNumValid=false)
Definition: DTP.cc:565
unsigned int getSndLeftWinEdge() const
Definition: DTCPState.cc:134
void setTxControlPolicy(TxControlPolicyBase *txControlPolicy)
Definition: DTCP.cc:776
double getRtt() const
Definition: DTPState.cc:303
unsigned int getLastCtrlSeqNumRcv()
Definition: DTCPState.cc:208
unsigned int getRcvRightWinEdge()
Definition: DTCP.cc:573
virtual void setCounter(unsigned int counter)
void scheduleRxTimerExpiry()
Definition: DTCP.cc:436
void setReceivingFcPolicy(ReceivingFCPolicyBase *receivingFcPolicy)
Definition: DTCP.cc:751
bool runReconcileFCPolicy(DTPState *dtpState)
Definition: DTCP.cc:265
RcvrFCPolicyBase * rcvrFCPolicy
Definition: DTCP.h:74
unsigned int getDataReXmitMax() const
Definition: DTCP.cc:406
std::vector< DTCPRxExpiryTimer * > * getRxQ()
Definition: DTCPState.cc:264
unsigned int getRcvrRate() const
Definition: DTCPState.cc:373
void incPdusSentInTimeUnit()
Definition: DTCP.cc:608
simsignal_t sigStatDTCPRxCount
Definition: DTCP.h:230
bool runNoRateSlowDownPolicy(DTPState *dtpState)
Definition: DTCP.cc:257
DTCPState * getDTCPState() const
Definition: DTCP.cc:54
void deleteRxTimer(unsigned int seqNum)
Definition: DTCP.cc:324
void setSndRtWinEdge(unsigned int sndRtWinEdge)
Definition: DTCP.cc:552
RxTimerExpiryPolicyBase * rxTimerExpiryPolicy
Definition: DTCP.h:88
std::vector< DataTransferPDU * > * getClosedWindowQ()
Definition: DTCPState.cc:312
virtual unsigned int getExpiryCount() const
void setReconcileFcPolicy(ReconcileFCPolicyBase *reconcileFcPolicy)
Definition: DTCP.cc:756
void nackPDU(unsigned int startSeqNum, unsigned int endSeqNum=0)
Definition: DTCP.cc:292
void setRendezvousTimer(DTCPRendezvousTimer *rendezvousTimer)
Definition: DTCPState.cc:586
void startRendezvousTimer()
Definition: DTCP.cc:107
unsigned int getNextSndCtrlSeqNum()
Definition: DTCP.cc:537
void setSenderAckPolicy(SenderAckPolicyBase *senderAckPolicy)
Definition: DTCP.cc:766
unsigned int getDupAcks() const
Definition: DTCP.cc:685
void clearRxQ()
Definition: DTCP.cc:401
ReconcileFCPolicyBase * reconcileFCPolicy
Definition: DTCP.h:86
ReceivingFCPolicyBase * receivingFCPolicy
Definition: DTCP.h:76
void runRxTimerExpiryPolicy(DTCPRxExpiryTimer *timer)
Definition: DTCP.cc:381
SenderAckPolicyBase * senderAckPolicy
Definition: DTCP.h:80
bool runNoOverridePeakPolicy(DTPState *dtpState)
Definition: DTCP.cc:240
void clearRxQ()
Definition: DTCPState.cc:284
void setRcvFcOverrunPolicy(RcvFCOverrunPolicyBase *rcvFcOverrunPolicy)
Definition: DTCP.cc:97
void setLastCtrlSeqnumRcvd(unsigned int ctrlSeqNum)
Definition: DTCP.cc:547
void pushBackToRxQ(DataTransferPDU *pdu)
Definition: DTCP.cc:390
void setNoRateSlowDownPolicy(NoRateSlowDownPolicyBase *noRateSlowDownPolicy)
Definition: DTCP.cc:726
void flushAllQueuesAndPrepareToDie()
Definition: DTCP.cc:133
virtual void setSeqNum(unsigned int seqNum)
TxControlPolicyBase * txControlPolicy
Definition: DTCP.h:84
bool isClosedWinQClosed() const
Definition: DTCPState.cc:317
ECNPolicyBase * ecnPolicy
Definition: DTCP.h:72
unsigned int getLastCtrlSeqNumRcv()
Definition: DTCP.cc:542
void schedule(DTCPTimers *timer, double time=0.0)
Definition: DTCP.cc:410
void setDtcpState(DTCPState *dtcpState)
Definition: DTCP.cc:791
NoRateSlowDownPolicyBase * noRateSlowDownPolicy
Definition: DTCP.h:85
bool runSndFCOverrunPolicy(DTPState *dtpState)
Definition: DTCP.cc:225
unsigned long getTimeUnit() const
Definition: DTCPState.cc:413
LostControlPDUPolicyBase * lostControlPDUPolicy
Definition: DTCP.h:78
bool runRcvFCOverrunPolicy(DTPState *dtpState)
Definition: DTCP.cc:233
virtual void handleMessage(cMessage *msg)
Definition: DTCP.cc:482
void setLostControlPduPolicy(LostControlPDUPolicyBase *lostControlPduPolicy)
Definition: DTCP.cc:716
Definition: DTP.h:60
unsigned int getRcvCredit() const
Definition: DTCPState.cc:158
void incDupFC()
Definition: DTCPState.cc:408
unsigned long getSendingTimeUnit() const
Definition: DTCPState.cc:423
bool runECNSlowDownPolicy(DTPState *dtpState)
Definition: DTCP.cc:282
void handleSendingRateTimer(DTCPSendingRateTimer *timer)
Definition: DTCP.cc:529
void updateRcvRtWinEdge(unsigned int rcvLtWinEdge)
Definition: DTCPState.cc:193
void handleDTCPRxExpiryTimer(DTCPRxExpiryTimer *timer)
Definition: DTCP.cc:373
void initSignalsAndListeners()
Definition: DTCP.cc:102
DTCP()
Definition: DTCP.cc:28
virtual void initialize(int step)
Definition: DTCP.cc:117