324 virtual void setup();
326 virtual void release(std::string trace_filename =
"");
329 virtual void print_item(std::ostream &,
const std::string &);
332 virtual void set_debug(
const bool enable_debug =
true);
334 virtual void set_debug(
bool enable_debug,
bool enable_signal_debug);
336 virtual void set_trace(
const bool enable_trace =
true);
338 virtual void save_trace(std::string filename);
356 std::queue<itpp::Packet*> SocketWriteQueue;
358 virtual void InitStatistics();
360 virtual void SendNewData(
bool skipSWSA =
false);
361 virtual void UnaRetransmit();
362 virtual void FinishFastRecovery();
363 virtual void ReduceSSThresh();
365 virtual void HandleRtxTimeout(
Ttype);
366 virtual void IdleCheck();
367 virtual void HandleSWSATimeout(
Ttype);
369 virtual unsigned SendWindow()
const;
370 virtual double CalcRTOValue()
const;
371 virtual void SetRtxTimer();
372 virtual void UpdateRTTVariables(
double sampleRTT);
373 virtual void TraceCWnd();
376 virtual void TraceRTTVariables(
double sampleRTT);
377 virtual void TraceSSThresh();
378 virtual std::string GenerateFilename();
380 void StopTransientPhase();
382 enum eTCPVersion {kTahoe, kReno, kNewReno};
384 virtual void set_label(
int label);
390 virtual void HandleUserMessageIndication(
itpp::Packet *user_data);
394 eTCPVersion fTCPVersion;
396 unsigned fTCPIPHeaderLength;
398 unsigned fInitialCWnd;
399 unsigned fInitialSSThresh;
401 unsigned fDupACKThreshold;
402 double fTimerGranularity;
404 unsigned fMaxBackoff;
405 bool fImmediateBackoffReset;
408 bool fFlightSizeRecovery;
409 bool fRenoConservation;
410 bool fCarefulSSThreshReduction;
411 bool fIgnoreDupACKOnTORecovery;
412 bool fCarefulMulFastRtxAvoidance;
414 double fSWSATimerValue;
415 bool fRestartAfterIdle;
417 bool fTraceSentSeqNo;
418 bool fTraceACKedSeqNo;
445 bool fPendingBackoffReset;
454 double fRTTMStartTime;
457 unsigned long fNumberOfTimeouts;
458 unsigned long fNumberOfFastRetransmits;
459 unsigned long fNumberOfRTTMeasurements;
460 unsigned long fNumberOfReceivedACKs;
461 unsigned long fNumberOfIdleTimeouts;
471 ivec sent_seq_num_val;
472 vec sent_seq_num_time;
473 int sent_seq_num_index;
475 ivec sender_recv_ack_seq_num_val;
476 vec sender_recv_ack_seq_num_time;
477 int sender_recv_ack_seq_num_index;
480 vec RTTEstimate_time;
481 int RTTEstimate_index;
522 void read(
unsigned noOfBytes);
531 std::ostream &
info(std::ostream &os,
int detail = 0)
const;
583 virtual void setup();
585 virtual void release(std::string trace_filename =
"");
592 virtual void set_debug(
const bool enable_debug =
true);
594 virtual void set_debug(
bool enable_debug,
bool enable_signal_debug);
596 virtual void set_trace(
const bool enable_trace =
true);
598 virtual void save_trace(std::string filename);
609 void IndicateUserMessage();
612 virtual void ReceiveDataPacket(
TCP_Packet & packet);
613 virtual void SendACK(
bool);
614 virtual void ScheduleACKMessage();
615 virtual void SendACKMessage(
Ttype);
616 virtual void DelayedACKHandler(
Ttype);
617 virtual void PeriodicACKHandler(
Ttype);
618 virtual void HandleEndOfProcessing(
Ttype);
620 virtual std::string GenerateFilename();
627 unsigned fTCPIPHeaderLength;
629 unsigned fBufferSize;
632 bool fSendPeriodicACKs;
633 bool fStrictPeriodicACKs;
634 Ttype fPeriodicACKInterval;
635 Ttype fACKSchedulingDelay;
636 bool fACKOnBufferWrite;
637 bool fACKOnBufferRead;
638 unsigned fMaxUserBlockSize;
639 unsigned fMinUserBlockSize;
640 double fUserBlockProcDelay;
663 ivec received_seq_num_val;
664 vec received_seq_num_time;
665 int received_seq_num_index;
748 #endif // #ifndef TCP_H