37 #if (defined(_MSC_VER) && defined(ITPP_SHARED_LIB) && !(defined(itpp_EXPORTS) || defined(itpp_debug_EXPORTS)))
39 #ifndef ITPP_PROTOCOL_EXCLUDED
40 #define ITPP_PROTOCOL_EXCLUDED
41 #pragma message( "PROTOCOL definitions are not available for MSVC shared builds" )
334 virtual void setup();
336 virtual void release(std::string trace_filename =
"");
339 virtual void print_item(std::ostream &,
const std::string &);
342 virtual void set_debug(
const bool enable_debug =
true);
344 virtual void set_debug(
bool enable_debug,
bool enable_signal_debug);
346 virtual void set_trace(
const bool enable_trace =
true);
348 virtual void save_trace(std::string filename);
366 std::queue<itpp::Packet*> SocketWriteQueue;
368 virtual void InitStatistics();
370 virtual void SendNewData(
bool skipSWSA =
false);
371 virtual void UnaRetransmit();
372 virtual void FinishFastRecovery();
373 virtual void ReduceSSThresh();
375 virtual void HandleRtxTimeout(
Ttype);
376 virtual void IdleCheck();
377 virtual void HandleSWSATimeout(
Ttype);
379 virtual unsigned SendWindow()
const;
380 virtual double CalcRTOValue()
const;
381 virtual void SetRtxTimer();
382 virtual void UpdateRTTVariables(
double sampleRTT);
383 virtual void TraceCWnd();
386 virtual void TraceRTTVariables(
double sampleRTT);
387 virtual void TraceSSThresh();
388 virtual std::string GenerateFilename();
390 void StopTransientPhase();
392 enum eTCPVersion {kTahoe, kReno, kNewReno};
394 virtual void set_label(
int label);
400 virtual void HandleUserMessageIndication(
itpp::Packet *user_data);
404 eTCPVersion fTCPVersion;
406 unsigned fTCPIPHeaderLength;
408 unsigned fInitialCWnd;
409 unsigned fInitialSSThresh;
411 unsigned fDupACKThreshold;
412 double fTimerGranularity;
414 unsigned fMaxBackoff;
415 bool fImmediateBackoffReset;
418 bool fFlightSizeRecovery;
419 bool fRenoConservation;
420 bool fCarefulSSThreshReduction;
421 bool fIgnoreDupACKOnTORecovery;
422 bool fCarefulMulFastRtxAvoidance;
424 double fSWSATimerValue;
425 bool fRestartAfterIdle;
427 bool fTraceSentSeqNo;
428 bool fTraceACKedSeqNo;
455 bool fPendingBackoffReset;
464 double fRTTMStartTime;
467 unsigned long fNumberOfTimeouts;
468 unsigned long fNumberOfFastRetransmits;
469 unsigned long fNumberOfRTTMeasurements;
470 unsigned long fNumberOfReceivedACKs;
471 unsigned long fNumberOfIdleTimeouts;
481 ivec sent_seq_num_val;
482 vec sent_seq_num_time;
483 int sent_seq_num_index;
485 ivec sender_recv_ack_seq_num_val;
486 vec sender_recv_ack_seq_num_time;
487 int sender_recv_ack_seq_num_index;
490 vec RTTEstimate_time;
491 int RTTEstimate_index;
532 void read(
unsigned noOfBytes);
541 std::ostream &
info(std::ostream &os,
int detail = 0)
const;
593 virtual void setup();
595 virtual void release(std::string trace_filename =
"");
602 virtual void set_debug(
const bool enable_debug =
true);
604 virtual void set_debug(
bool enable_debug,
bool enable_signal_debug);
606 virtual void set_trace(
const bool enable_trace =
true);
608 virtual void save_trace(std::string filename);
619 void IndicateUserMessage();
622 virtual void ReceiveDataPacket(
TCP_Packet & packet);
623 virtual void SendACK(
bool);
624 virtual void ScheduleACKMessage();
625 virtual void SendACKMessage(
Ttype);
626 virtual void DelayedACKHandler(
Ttype);
627 virtual void PeriodicACKHandler(
Ttype);
628 virtual void HandleEndOfProcessing(
Ttype);
630 virtual std::string GenerateFilename();
637 unsigned fTCPIPHeaderLength;
639 unsigned fBufferSize;
642 bool fSendPeriodicACKs;
643 bool fStrictPeriodicACKs;
644 Ttype fPeriodicACKInterval;
645 Ttype fACKSchedulingDelay;
646 bool fACKOnBufferWrite;
647 bool fACKOnBufferRead;
648 unsigned fMaxUserBlockSize;
649 unsigned fMinUserBlockSize;
650 double fUserBlockProcDelay;
673 ivec received_seq_num_val;
674 vec received_seq_num_time;
675 int received_seq_num_index;
760 #endif // #ifndef TCP_H