IT++ Logo
tcp.h
Go to the documentation of this file.
1 
32 #ifndef TCP_H
33 #define TCP_H
34 
35 #include <itpp/base/vec.h>
36 
37 #if (defined(_MSC_VER) && defined(ITPP_SHARED_LIB) && !(defined(itpp_EXPORTS) || defined(itpp_debug_EXPORTS)))
38 
39 #ifndef ITPP_PROTOCOL_EXCLUDED
40 #define ITPP_PROTOCOL_EXCLUDED
41 #pragma message( "PROTOCOL definitions are not available for MSVC shared builds" )
42 #endif
43 
44 #else
45 
46 #include <itpp/base/converters.h>
47 #include <itpp/protocol/packet.h>
48 #include <itpp/protocol/events.h>
49 
50 
51 namespace itpp
52 {
53 
55 
56 
72 {
73 public:
75  Sequence_Number() : seq(0) { }
79  Sequence_Number &operator=(const Sequence_Number &n) { seq = n.seq; return *this; }
81  Sequence_Number &operator=(const int &rep) { seq = rep; return *this; }
82 
83  //relational operators
85  bool operator==(const Sequence_Number &n) const { return seq == n.seq; }
87  bool operator!=(const Sequence_Number &n) const { return seq != n.seq; }
89  bool operator>(const Sequence_Number &n) const { return (seq - n.seq) > 0; }
91  bool operator>=(const Sequence_Number &n) const { return (seq - n.seq) >= 0; }
93  bool operator<(const Sequence_Number &n) const { return (seq - n.seq) < 0; }
95  bool operator<=(const Sequence_Number &n) const { return (seq - n.seq) <= 0; }
96 
97  //addition and subtraction
99  Sequence_Number operator+(const int n) const { return Sequence_Number(seq + n); }
101  Sequence_Number &operator+=(const int n) { seq += n; return *this; }
103  Sequence_Number operator-(const int n) const { return Sequence_Number(seq - n); }
105  Sequence_Number &operator-=(const int n) { seq -= n; return *this; }
107  int operator-(const Sequence_Number &n) const { return seq - n.seq; }
108 
110  int value() const { return seq; }
111 
113  friend Sequence_Number operator+(const int n1, const Sequence_Number &n2) { return Sequence_Number(n1 + n2.seq); }
115  friend std::ostream &operator<<(std::ostream &os, const Sequence_Number &n) { os << n.seq; return os; }
116 
117 protected:
119  Sequence_Number(int n) : seq(n) {}
121  int seq;
122 };
123 
125 inline const Sequence_Number & min(const Sequence_Number &n1, const Sequence_Number &n2) { return (n1 < n2) ? n1 : n2; }
127 inline const Sequence_Number & max(const Sequence_Number &n1, const Sequence_Number &n2) { return (n1 > n2) ? n1 : n2; }
128 
129 
130 
146 {
147 public:
151  TCP_Segment(const Sequence_Number &sn_begin, const Sequence_Number &sn_end);
153  TCP_Segment(const TCP_Segment &segment);
154 
155  //modification
159  void set_begin(const Sequence_Number &sn);
161  void set_end(const Sequence_Number &sn);
163  void combine(const TCP_Segment &segment);
164 
165  //query
167  bool operator==(const TCP_Segment &segment) const;
169  bool operator!=(const TCP_Segment &segment) const;
171  bool can_be_combined(const TCP_Segment &segment) const;
173  bool is_contained(const TCP_Segment &segment) const;
175  unsigned length() const;
177  Sequence_Number begin() const { return seq_begin; }
179  Sequence_Number end() const { return seq_end; }
180 
182  friend std::ostream & operator<<(std::ostream &os, const TCP_Segment &segment);
183 
184 protected:
187 };
188 
189 
211 class TCP_Packet : public itpp::Packet
212 {
213 public:
217  TCP_Packet(const TCP_Packet &packet);
219  virtual ~TCP_Packet();
221  virtual TCP_Packet &clone() const;
222 
223  //TCP window mechanism
225  void set_segment(const TCP_Segment &seg) { fSegment = seg; }
227  TCP_Segment get_segment() const { return fSegment; }
229  void set_wnd(unsigned val) { fWnd = val; }
231  unsigned get_wnd() const { return fWnd; }
233  void set_ACK(Sequence_Number val) { fACK = val; }
235  Sequence_Number get_ACK() const { return fACK; }
236 
237  //session control
239  void set_session_id(int val) { fSessionId = val; }
241  int get_session_id() const { return fSessionId; }
242 
243  //debugging support
245  void set_destination_port(unsigned val) { fDestinationPort = val; }
247  unsigned get_destination_port() const { return fDestinationPort; }
249  void set_source_port(unsigned val) { fSourcePort = val; }
251  unsigned get_source_port() const { return fSourcePort; }
253  void set_info(unsigned ssThresh, unsigned recWnd, unsigned cWnd, double estRTT, Sequence_Number sndUna, Sequence_Number sndNxt, bool isRtx);
255  virtual void print_header(std::ostream &) const;
256 
257 protected:
261  unsigned fSourcePort;
262 
265  unsigned fWnd;
268  //Tracing
269 
271  struct TDebugInfo {
272  unsigned fSSThresh;
273  unsigned fRecWnd;
274  unsigned fCWnd;
275  double fRTTEstimate;
278  bool fRtxFlag;
279  };
280 
283 
285  friend std::ostream & operator<<(std::ostream &, TCP_Packet &);
286 };
287 
288 
324 {
325 public:
327  TCP_Sender(int label);
328 
330  virtual ~TCP_Sender();
331 
332  //connection control
334  virtual void setup();
336  virtual void release(std::string trace_filename = "");
337 
339  virtual void print_item(std::ostream &, const std::string &);
340 
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);
349 
358 
359 
360  //Signal<itpp::Packet*> TcpSendSignal;
361  //Slot<TCP_Sender, itpp::Packet*> TcpRecvAckSlot;
362  //Slot<TCP_Sender, itpp::Packet*> SocketWriteSlot;
363  //Slot<TCP_Sender, string> ReleaseSlot;
364 
365 private:
366  std::queue<itpp::Packet*> SocketWriteQueue;
367 
368  virtual void InitStatistics();
369  virtual void HandleACK(TCP_Packet &);
370  virtual void SendNewData(bool skipSWSA = false);
371  virtual void UnaRetransmit();
372  virtual void FinishFastRecovery();
373  virtual void ReduceSSThresh();
374  virtual void SendMsg(TCP_Packet & msg);
375  virtual void HandleRtxTimeout(Ttype);
376  virtual void IdleCheck();
377  virtual void HandleSWSATimeout(Ttype);
378  virtual unsigned GetNextSegmentSize(const Sequence_Number & begin);
379  virtual unsigned SendWindow() const;
380  virtual double CalcRTOValue() const;
381  virtual void SetRtxTimer();
382  virtual void UpdateRTTVariables(double sampleRTT);
383  virtual void TraceCWnd();
384  virtual void TraceSentSeqNo(const Sequence_Number sn);
385  virtual void TraceACKedSeqNo(const Sequence_Number sn);
386  virtual void TraceRTTVariables(double sampleRTT);
387  virtual void TraceSSThresh();
388  virtual std::string GenerateFilename();
389 
390  void StopTransientPhase();
392  enum eTCPVersion {kTahoe, kReno, kNewReno};
393 
394  virtual void set_label(int label);
395 
396  //socket variables
397  unsigned fLabel; // end point identification also used at receiver
398 
399  //message handling
400  virtual void HandleUserMessageIndication(itpp::Packet *user_data);
401  virtual void ReceiveMessageFromNet(itpp::Packet *msg);
402 
403  //parameters parsed from input file
404  eTCPVersion fTCPVersion; // one of Reno, Tahoe, NewReno
405  unsigned fMSS; // maximum segment size
406  unsigned fTCPIPHeaderLength;
407  double fInitialRTT;
408  unsigned fInitialCWnd;
409  unsigned fInitialSSThresh;
410  unsigned fMaxCWnd;
411  unsigned fDupACKThreshold;
412  double fTimerGranularity;
413  double fMaxRTO; // max value of retransmission TO
414  unsigned fMaxBackoff;
415  bool fImmediateBackoffReset;
416  bool fKarn;
417  bool fGoBackN;
418  bool fFlightSizeRecovery;// use flight size on fast rec. exit
419  bool fRenoConservation;
420  bool fCarefulSSThreshReduction;
421  bool fIgnoreDupACKOnTORecovery;
422  bool fCarefulMulFastRtxAvoidance;
423  bool fNagle;
424  double fSWSATimerValue;
425  bool fRestartAfterIdle;
426  bool fTraceCWnd; // print CWnd trace to cout
427  bool fTraceSentSeqNo;
428  bool fTraceACKedSeqNo;
429  bool fDebug; // print additional information to cout
430  bool fTrace; // store trace info in vectors
431 
432  //session identification
433  int fSessionId;
435  //TCP flow control (RFC 793)
436  Sequence_Number fSndUna; // lowest unacknowledged sn
437  Sequence_Number fSndNxt; // next byte to be sent
438  Sequence_Number fSndMax;
439  unsigned fRecWnd; // receiver advertised window
440  unsigned fMaxRecWnd;
441  Sequence_Number fUserNxt; // next byte to be received from user
442 
443  //TCP congestion avoidance (RFC 2581, RFC 2001, RFC 2582)
444  unsigned fCWnd; // congestion window
445  unsigned fSSThresh;
446  unsigned fDupACKCnt;
447  Sequence_Number fRecoveryDupACK;
448  Sequence_Number fRecoveryTO;
450  //TCP timers
451  TTimer<TCP_Sender> fRtxTimer;
452  Sequence_Number fTimUna;
453  TTimer<TCP_Sender> fSWSATimer;
454  int fBackoff;
455  bool fPendingBackoffReset;
456  Ttype fLastSendTime;
458  //round trip time measurement (RTTM)
459  double fSRTT;
460  double fRTTVar;
461  double fRTTEstimate;
462  Sequence_Number fRTTMByte;
463  bool fRTTMPending;
464  double fRTTMStartTime;
466  //statistic counters
467  unsigned long fNumberOfTimeouts;
468  unsigned long fNumberOfFastRetransmits;
469  unsigned long fNumberOfRTTMeasurements;
470  unsigned long fNumberOfReceivedACKs;
471  unsigned long fNumberOfIdleTimeouts;
472 
473  vec CWnd_val;
474  vec CWnd_time;
475  int CWnd_index;
476 
477  vec SSThresh_val;
478  vec SSThresh_time;
479  int SSThresh_index;
480 
481  ivec sent_seq_num_val;
482  vec sent_seq_num_time;
483  int sent_seq_num_index;
484 
485  ivec sender_recv_ack_seq_num_val;
486  vec sender_recv_ack_seq_num_time;
487  int sender_recv_ack_seq_num_index;
488 
489  vec RTTEstimate_val;
490  vec RTTEstimate_time;
491  int RTTEstimate_index;
492 
493  vec RTTsample_val;
494  vec RTTsample_time;
495  int RTTsample_index;
496 };
497 
498 
520 {
521 public:
528 
529  void reset();
531  void write(TCP_Segment newBlock);
532  void read(unsigned noOfBytes);
534  unsigned first_block_size() const;
535  Sequence_Number first_byte() const;
536  Sequence_Number last_byte() const;
538  unsigned window() const;
540 
541  std::ostream &info(std::ostream &os, int detail = 0) const;
543 protected:
546  std::list <TCP_Segment> fBufList;
548 };
549 
550 
551 
552 
583 {
584 public:
585 
587  TCP_Receiver(int label);
589  virtual ~TCP_Receiver();
590 
591  //name connection control
593  virtual void setup();
595  virtual void release(std::string trace_filename = "");
596 
597  //message handling
601  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);
609 
617 
618 private:
619  void IndicateUserMessage();
620  virtual void ReceiveMessageFromNet(itpp::Packet* msg);
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);
629  virtual void TraceReceivedSeqNo(const Sequence_Number &sn);
630  virtual std::string GenerateFilename();
631 
632  //basic variables
633  TCP_Receiver_Buffer fReceiverBuffer;
634  unsigned fLabel;
635 
636  //parameters read by the parser
637  unsigned fTCPIPHeaderLength;
638  unsigned fMSS;
639  unsigned fBufferSize;
640  bool fDelayedACK;
641  Ttype fACKDelayTime;
642  bool fSendPeriodicACKs;
643  bool fStrictPeriodicACKs;
644  Ttype fPeriodicACKInterval;// interval after which an ACK is repeated
645  Ttype fACKSchedulingDelay;
646  bool fACKOnBufferWrite;
647  bool fACKOnBufferRead;
648  unsigned fMaxUserBlockSize;
649  unsigned fMinUserBlockSize;
650  double fUserBlockProcDelay;
651  bool fTrace;
652  bool fDebug;
654  //specific TCP variables
655  Sequence_Number fAdvRcvNxt;
656  unsigned fAdvRcvWnd;
658  //session management
659  int fSessionId;
661  //ACK timers
662  TTimer<TCP_Receiver> fDelayedACKTimer;
663  TTimer<TCP_Receiver> fPeriodicACKTimer;
664  TTimer<TCP_Receiver> fACKSchedulingTimer;
665  TCP_Packet * fWaitingACKMsg;
666 
667  //user data delivery
668  Packet * fUserMessage;
669  TTimer<TCP_Receiver> fUserBlockProcTimer;
670 
671 
672  //statistic counters
673  ivec received_seq_num_val;
674  vec received_seq_num_time;
675  int received_seq_num_index;
676 
677 };
678 
679 
680 
681 // ------------------------------- Inline definitions ---------------------------------------------
682 
683 
684 
686 {
687  return fFirstByte;
688 }
689 
690 
692 {
693  if (fBufList.empty()) {
694  return fFirstByte;
695  }
696  else {
697  return fBufList.back().end();
698  }
699 }
700 
701 
703 {
704  return fFirstByte + first_block_size();
705 }
706 
707 
709 {
710  seq_begin = sn;
711 
712  it_assert(seq_begin <= seq_end, "TCP_Segment::begin, end byte " + to_str(seq_end.value()) + " < begin byte " + to_str(seq_begin.value()));
713 }
714 
715 
716 inline void TCP_Segment::set_end(const Sequence_Number &sn)
717 {
718  seq_end = sn;
719 
720  it_assert(seq_begin <= seq_end, "TCP_Segment::set_begin, end byte " + to_str(seq_end.value()) + " < begin byte " + to_str(seq_begin.value()));
721 }
722 
723 
724 inline bool TCP_Segment::operator==(const TCP_Segment &segment) const
725 {
726  return (this->seq_begin == segment.seq_begin) && (this->seq_end == segment.seq_end);
727 }
728 
729 
730 inline bool TCP_Segment::operator!=(const TCP_Segment &segment) const
731 {
732  return (this->seq_begin != segment.seq_begin) || (this->seq_end != segment.seq_end);
733 }
734 
735 
736 inline bool TCP_Segment::can_be_combined(const TCP_Segment &segment) const
737 {
738  return (this->seq_begin <= segment.seq_end) && (segment.seq_begin <= this->seq_end);
739 }
740 
741 
742 inline bool TCP_Segment::is_contained(const TCP_Segment &segment) const
743 {
744  return (segment.seq_begin <= this->seq_begin) && (this->seq_end <= segment.seq_end);
745 }
746 
747 
748 inline unsigned TCP_Segment::length() const
749 {
750  return seq_end - seq_begin;
751 }
752 
754 
755 
756 } // namespace itpp
757 
758 #endif
759 
760 #endif // #ifndef TCP_H
761 
itpp::Sequence_Number::operator+
Sequence_Number operator+(const int n) const
ADD DOCUMENTATION HERE.
Definition: tcp.h:99
itpp::TCP_Packet::TDebugInfo::fCWnd
unsigned fCWnd
ADD DOCUMENTATION HERE.
Definition: tcp.h:274
itpp::TCP_Packet::set_session_id
void set_session_id(int val)
ADD DOCUMENTATION HERE.
Definition: tcp.h:239
itpp::TCP_Sender::tcp_socket_write
Slot< TCP_Sender, itpp::Packet * > tcp_socket_write
ADD DOCUMENTATION HERE.
Definition: tcp.h:355
itpp::TCP_Segment::operator==
bool operator==(const TCP_Segment &segment) const
ADD DOCUMENTATION HERE.
Definition: tcp.h:724
itpp::Sequence_Number::operator>=
bool operator>=(const Sequence_Number &n) const
ADD DOCUMENTATION HERE.
Definition: tcp.h:91
itpp::TCP_Sender::setup
virtual void setup()
ADD DOCUMENTATION HERE.
itpp::TCP_Receiver::is_user_message_available
bool is_user_message_available()
called by higher layer
itpp::TCP_Receiver_Buffer::info
std::ostream & info(std::ostream &os, int detail=0) const
print info
itpp::TCP_Packet::fSessionId
int fSessionId
session identifier
Definition: tcp.h:266
itpp::Sequence_Number::operator==
bool operator==(const Sequence_Number &n) const
ADD DOCUMENTATION HERE.
Definition: tcp.h:85
itpp::TCP_Packet::TDebugInfo::fSndUna
Sequence_Number fSndUna
ADD DOCUMENTATION HERE.
Definition: tcp.h:276
itpp::TCP_Sender::release
virtual void release(std::string trace_filename="")
ADD DOCUMENTATION HERE.
itpp::TCP_Packet::get_destination_port
unsigned get_destination_port() const
ADD DOCUMENTATION HERE.
Definition: tcp.h:247
itpp::TCP_Packet::TDebugInfo::fSSThresh
unsigned fSSThresh
ADD DOCUMENTATION HERE.
Definition: tcp.h:272
itpp::TCP_Packet::TDebugInfo::fRecWnd
unsigned fRecWnd
ADD DOCUMENTATION HERE.
Definition: tcp.h:273
itpp::TCP_Packet::set_destination_port
void set_destination_port(unsigned val)
ADD DOCUMENTATION HERE.
Definition: tcp.h:245
itpp::Ttype
double Ttype
64-bit floating point time
Definition: events.h:54
itpp::TCP_Receiver_Buffer::last_byte
Sequence_Number last_byte() const
highest byte received (+1)
Definition: tcp.h:691
itpp::TCP_Packet::~TCP_Packet
virtual ~TCP_Packet()
ADD DOCUMENTATION HERE.
itpp::TCP_Segment::operator<<
friend std::ostream & operator<<(std::ostream &os, const TCP_Segment &segment)
ADD DOCUMENTATION HERE.
itpp::TCP_Packet::set_ACK
void set_ACK(Sequence_Number val)
ADD DOCUMENTATION HERE.
Definition: tcp.h:233
itpp::Signal< itpp::Packet * >
itpp::TCP_Receiver::TCP_Receiver
TCP_Receiver(int label)
ADD DOCUMENTATION HERE.
itpp::TCP_Segment::TCP_Segment
TCP_Segment(const TCP_Segment &segment)
ADD DOCUMENTATION HERE.
itpp::TCP_Packet::get_ACK
Sequence_Number get_ACK() const
ADD DOCUMENTATION HERE.
Definition: tcp.h:235
itpp::Sequence_Number::operator<<
friend std::ostream & operator<<(std::ostream &os, const Sequence_Number &n)
ADD DOCUMENTATION HERE.
Definition: tcp.h:115
itpp::TCP_Sender::tcp_receive_ack
Slot< TCP_Sender, itpp::Packet * > tcp_receive_ack
ADD DOCUMENTATION HERE.
Definition: tcp.h:353
itpp::TCP_Receiver_Buffer::next_expected
Sequence_Number next_expected() const
first byte missing
Definition: tcp.h:702
itpp::Sequence_Number::Sequence_Number
Sequence_Number()
Default constructor.
Definition: tcp.h:75
itpp::TCP_Packet::set_source_port
void set_source_port(unsigned val)
ADD DOCUMENTATION HERE.
Definition: tcp.h:249
itpp
itpp namespace
Definition: itmex.h:37
itpp::TCP_Receiver::tcp_send_ack
Signal< itpp::Packet * > tcp_send_ack
ADD DOCUMENTATION HERE.
Definition: tcp.h:611
itpp::TCP_Segment::end
Sequence_Number end() const
ADD DOCUMENTATION HERE.
Definition: tcp.h:179
itpp::Sequence_Number::operator<=
bool operator<=(const Sequence_Number &n) const
ADD DOCUMENTATION HERE.
Definition: tcp.h:95
itpp::TCP_Segment::seq_end
Sequence_Number seq_end
no. of last byte of segment + 1
Definition: tcp.h:186
itpp::TCP_Receiver::set_debug
virtual void set_debug(bool enable_debug, bool enable_signal_debug)
ADD DOCUMENTATION HERE.
itpp::TCP_Packet::TDebugInfo::fRTTEstimate
double fRTTEstimate
ADD DOCUMENTATION HERE.
Definition: tcp.h:275
itpp::TCP_Packet::fDestinationPort
unsigned fDestinationPort
ADD DOCUMENTATION HERE.
Definition: tcp.h:259
itpp::TCP_Sender::~TCP_Sender
virtual ~TCP_Sender()
ADD DOCUMENTATION HERE.
itpp::TCP_Segment::seq_begin
Sequence_Number seq_begin
no. of first byte of segment
Definition: tcp.h:185
itpp::TCP_Sender::tcp_release
Slot< TCP_Sender, std::string > tcp_release
ADD DOCUMENTATION HERE.
Definition: tcp.h:357
itpp::Sequence_Number::operator<
bool operator<(const Sequence_Number &n) const
ADD DOCUMENTATION HERE.
Definition: tcp.h:93
itpp::Sequence_Number
Definition: tcp.h:72
itpp::TCP_Segment::begin
Sequence_Number begin() const
ADD DOCUMENTATION HERE.
Definition: tcp.h:177
itpp::TCP_Packet::get_segment
TCP_Segment get_segment() const
ADD DOCUMENTATION HERE.
Definition: tcp.h:227
itpp::TCP_Sender::set_debug
virtual void set_debug(bool enable_debug, bool enable_signal_debug)
ADD DOCUMENTATION HERE.
itpp::TCP_Packet::TCP_Packet
TCP_Packet()
ADD DOCUMENTATION HERE.
itpp::TCP_Sender::set_trace
virtual void set_trace(const bool enable_trace=true)
ADD DOCUMENTATION HERE.
itpp::TCP_Packet::set_info
void set_info(unsigned ssThresh, unsigned recWnd, unsigned cWnd, double estRTT, Sequence_Number sndUna, Sequence_Number sndNxt, bool isRtx)
ADD DOCUMENTATION HERE.
itpp::Sequence_Number::operator+=
Sequence_Number & operator+=(const int n)
ADD DOCUMENTATION HERE.
Definition: tcp.h:101
events.h
Definitions of an event-based simulation class.
itpp::TCP_Packet::clone
virtual TCP_Packet & clone() const
ADD DOCUMENTATION HERE.
itpp::TCP_Receiver
Definition: tcp.h:583
itpp::Sequence_Number::operator-
int operator-(const Sequence_Number &n) const
ADD DOCUMENTATION HERE.
Definition: tcp.h:107
itpp::TCP_Receiver_Buffer
Definition: tcp.h:520
itpp::Sequence_Number::operator-=
Sequence_Number & operator-=(const int n)
ADD DOCUMENTATION HERE.
Definition: tcp.h:105
itpp::min
T min(const Vec< T > &in)
Minimum value of vector.
Definition: min_max.h:125
itpp::TCP_Segment::length
unsigned length() const
ADD DOCUMENTATION HERE.
Definition: tcp.h:748
itpp::TCP_Sender
Definition: tcp.h:324
itpp::TCP_Receiver::release
virtual void release(std::string trace_filename="")
ADD DOCUMENTATION HERE.
itpp::TCP_Packet::operator<<
friend std::ostream & operator<<(std::ostream &, TCP_Packet &)
ADD DOCUMENTATION HERE.
itpp::Sequence_Number::operator>
bool operator>(const Sequence_Number &n) const
ADD DOCUMENTATION HERE.
Definition: tcp.h:89
itpp::TCP_Receiver_Buffer::TCP_Receiver_Buffer
TCP_Receiver_Buffer(const TCP_Receiver_Buffer &)
ADD DOCUMENTATION HERE.
itpp::TCP_Packet::fACK
Sequence_Number fACK
acknowledgment (next expected sn)
Definition: tcp.h:264
itpp::Slot
Slot Class.
Definition: signals_slots.h:221
itpp::TCP_Segment
Definition: tcp.h:146
itpp::TCP_Packet::fInfo
TDebugInfo * fInfo
ADD DOCUMENTATION HERE.
Definition: tcp.h:282
itpp::TCP_Receiver::tcp_new_data
Signal< int > tcp_new_data
indicate new data to higher layer
Definition: tcp.h:614
itpp::TCP_Packet::get_wnd
unsigned get_wnd() const
ADD DOCUMENTATION HERE.
Definition: tcp.h:231
itpp::to_str
std::string to_str(const T &i)
Convert anything to string.
Definition: converters.h:444
itpp::TCP_Receiver_Buffer::TCP_Receiver_Buffer
TCP_Receiver_Buffer()
ADD DOCUMENTATION HERE.
itpp::TCP_Sender::set_debug
virtual void set_debug(const bool enable_debug=true)
ADD DOCUMENTATION HERE.
itpp::TCP_Receiver_Buffer::fFirstByte
Sequence_Number fFirstByte
first byte stored or missing
Definition: tcp.h:544
itpp::TTimer
Definition: signals_slots.h:297
itpp::TCP_Receiver_Buffer::write
void write(TCP_Segment newBlock)
add segment to the queue
itpp::TCP_Packet::print_header
virtual void print_header(std::ostream &) const
ADD DOCUMENTATION HERE.
itpp::max
T max(const Vec< T > &v)
Maximum value of vector.
Definition: min_max.h:45
itpp::TCP_Packet
Definition: tcp.h:212
itpp::TCP_Segment::can_be_combined
bool can_be_combined(const TCP_Segment &segment) const
ADD DOCUMENTATION HERE.
Definition: tcp.h:736
itpp::TCP_Receiver_Buffer::fBufList
std::list< TCP_Segment > fBufList
ADD DOCUMENTATION HERE.
Definition: tcp.h:547
itpp::TCP_Packet::get_source_port
unsigned get_source_port() const
ADD DOCUMENTATION HERE.
Definition: tcp.h:251
itpp::TCP_Packet::TDebugInfo::fSndNxt
Sequence_Number fSndNxt
ADD DOCUMENTATION HERE.
Definition: tcp.h:277
itpp::TCP_Receiver::setup
virtual void setup()
ADD DOCUMENTATION HERE.
itpp::TCP_Segment::set_begin
void set_begin(const Sequence_Number &sn)
ADD DOCUMENTATION HERE.
Definition: tcp.h:708
itpp::TCP_Sender::save_trace
virtual void save_trace(std::string filename)
ADD DOCUMENTATION HERE.
itpp::TCP_Packet::fWnd
unsigned fWnd
window size (advertised by receiver)
Definition: tcp.h:265
itpp::TCP_Receiver_Buffer::~TCP_Receiver_Buffer
~TCP_Receiver_Buffer()
ADD DOCUMENTATION HERE.
itpp::TCP_Sender::print_item
virtual void print_item(std::ostream &, const std::string &)
Print support.
itpp::Sequence_Number::operator=
Sequence_Number & operator=(const int &rep)
ADD DOCUMENTATION HERE.
Definition: tcp.h:81
itpp::TCP_Receiver_Buffer::first_byte
Sequence_Number first_byte() const
first byte stored or missing
Definition: tcp.h:685
itpp::TCP_Packet::TCP_Packet
TCP_Packet(const TCP_Packet &packet)
ADD DOCUMENTATION HERE.
itpp::TCP_Receiver::save_trace
virtual void save_trace(std::string filename)
ADD DOCUMENTATION HERE.
itpp::Sequence_Number::Sequence_Number
Sequence_Number(int n)
ADD DOCUMENTATION HERE.
Definition: tcp.h:119
itpp::TCP_Receiver_Buffer::reset
void reset()
clears internal list structure
itpp::TCP_Packet::get_session_id
int get_session_id() const
ADD DOCUMENTATION HERE.
Definition: tcp.h:241
packet.h
Definition of a Packet class.
itpp::TCP_Packet::TDebugInfo::fRtxFlag
bool fRtxFlag
ADD DOCUMENTATION HERE.
Definition: tcp.h:278
itpp::Sequence_Number::operator!=
bool operator!=(const Sequence_Number &n) const
ADD DOCUMENTATION HERE.
Definition: tcp.h:87
itpp::Sequence_Number::value
int value() const
Access to internal representation.
Definition: tcp.h:110
itpp::TCP_Sender::TCP_Sender
TCP_Sender(int label)
ADD DOCUMENTATION HERE.
itpp::TCP_Receiver::set_trace
virtual void set_trace(const bool enable_trace=true)
ADD DOCUMENTATION HERE.
itpp::TCP_Sender::tcp_send
Signal< itpp::Packet * > tcp_send
ADD DOCUMENTATION HERE.
Definition: tcp.h:351
itpp::TCP_Segment::set_end
void set_end(const Sequence_Number &sn)
ADD DOCUMENTATION HERE.
Definition: tcp.h:716
itpp::Packet
Definition: packet.h:56
vec.h
Templated Vector Class Definitions.
itpp::TCP_Segment::TCP_Segment
TCP_Segment(const Sequence_Number &sn_begin, const Sequence_Number &sn_end)
ADD DOCUMENTATION HERE.
itpp::TCP_Receiver_Buffer::window
unsigned window() const
ADD DOCUMENTATION HERE.
itpp::TCP_Receiver::~TCP_Receiver
virtual ~TCP_Receiver()
ADD DOCUMENTATION HERE.
itpp::TCP_Packet::set_segment
void set_segment(const TCP_Segment &seg)
ADD DOCUMENTATION HERE.
Definition: tcp.h:225
itpp::TCP_Segment::operator=
TCP_Segment & operator=(const TCP_Segment &segment)
ADD DOCUMENTATION HERE.
itpp::Sequence_Number::operator=
Sequence_Number & operator=(const Sequence_Number &n)
ADD DOCUMENTATION HERE.
Definition: tcp.h:79
itpp::TCP_Receiver::tcp_release
Slot< TCP_Receiver, std::string > tcp_release
ADD DOCUMENTATION HERE.
Definition: tcp.h:616
itpp::Sequence_Number::seq
int seq
ADD DOCUMENTATION HERE.
Definition: tcp.h:121
itpp::TCP_Packet::set_wnd
void set_wnd(unsigned val)
ADD DOCUMENTATION HERE.
Definition: tcp.h:229
itpp::TCP_Receiver::get_user_message
itpp::Packet & get_user_message()
called by higher layer
converters.h
Definitions of converters between different vector and matrix types.
itpp::TCP_Segment::is_contained
bool is_contained(const TCP_Segment &segment) const
ADD DOCUMENTATION HERE.
Definition: tcp.h:742
itpp::TCP_Receiver_Buffer::read
void read(unsigned noOfBytes)
read up to "noOfBytes" bytes from queue
itpp::TCP_Packet::TDebugInfo
ADD DOCUMENTATION HERE.
Definition: tcp.h:271
itpp::TCP_Packet::fSourcePort
unsigned fSourcePort
ADD DOCUMENTATION HERE.
Definition: tcp.h:261
itpp::Sequence_Number::operator+
friend Sequence_Number operator+(const int n1, const Sequence_Number &n2)
ADD DOCUMENTATION HERE.
Definition: tcp.h:113
itpp::TCP_Packet::fSegment
TCP_Segment fSegment
data segment to be transmitted
Definition: tcp.h:263
itpp::Sequence_Number::Sequence_Number
Sequence_Number(const Sequence_Number &n)
ADD DOCUMENTATION HERE.
Definition: tcp.h:77
itpp::TCP_Receiver::tcp_receive
Slot< TCP_Receiver, itpp::Packet * > tcp_receive
ADD DOCUMENTATION HERE.
Definition: tcp.h:613
itpp::TCP_Receiver_Buffer::first_block_size
unsigned first_block_size() const
size of first complete block
itpp::TCP_Segment::TCP_Segment
TCP_Segment()
ADD DOCUMENTATION HERE.
itpp::TCP_Segment::operator!=
bool operator!=(const TCP_Segment &segment) const
ADD DOCUMENTATION HERE.
Definition: tcp.h:730
itpp::TCP_Segment::combine
void combine(const TCP_Segment &segment)
ADD DOCUMENTATION HERE.
itpp::TCP_Receiver::set_debug
virtual void set_debug(const bool enable_debug=true)
ADD DOCUMENTATION HERE.
it_assert
#define it_assert(t, s)
Abort if t is not true.
Definition: itassert.h:94
itpp::Sequence_Number::operator-
Sequence_Number operator-(const int n) const
ADD DOCUMENTATION HERE.
Definition: tcp.h:103

Generated on Sun Jan 3 2021 11:31:33 for IT++ by Doxygen 1.8.20