tcp.h
Go to the documentation of this file.
#ifndef TCP_H
#define TCP_H
#include <itpp/base/vec.h>
#if (defined(_MSC_VER) && defined(ITPP_SHARED_LIB) && !(defined(itpp_EXPORTS) || defined(itpp_debug_EXPORTS)))
#ifndef ITPP_PROTOCOL_EXCLUDED
#define ITPP_PROTOCOL_EXCLUDED
#pragma message( "PROTOCOL definitions are not available for MSVC shared builds" )
#endif
#else
#include <itpp/base/converters.h>
#include <itpp/protocol/packet.h>
#include <itpp/protocol/events.h>
namespace itpp
{
class Sequence_Number
{
public:
Sequence_Number() : seq(0) { }
Sequence_Number(const Sequence_Number &n) : seq(n.seq) { }
Sequence_Number &operator=(const Sequence_Number &n) { seq = n.seq; return *this; }
Sequence_Number &operator=(const int &rep) { seq = rep; return *this; }
//relational operators
bool operator==(const Sequence_Number &n) const { return seq == n.seq; }
bool operator!=(const Sequence_Number &n) const { return seq != n.seq; }
bool operator>(const Sequence_Number &n) const { return (seq - n.seq) > 0; }
bool operator>=(const Sequence_Number &n) const { return (seq - n.seq) >= 0; }
bool operator<(const Sequence_Number &n) const { return (seq - n.seq) < 0; }
bool operator<=(const Sequence_Number &n) const { return (seq - n.seq) <= 0; }
//addition and subtraction
Sequence_Number operator+(const int n) const { return Sequence_Number(seq + n); }
Sequence_Number &operator+=(const int n) { seq += n; return *this; }
Sequence_Number operator-(const int n) const { return Sequence_Number(seq - n); }
Sequence_Number &operator-=(const int n) { seq -= n; return *this; }
int operator-(const Sequence_Number &n) const { return seq - n.seq; }
int value() const { return seq; }
friend Sequence_Number operator+(const int n1, const Sequence_Number &n2) { return Sequence_Number(n1 + n2.seq); }
friend std::ostream &operator<<(std::ostream &os, const Sequence_Number &n) { os << n.seq; return os; }
protected:
Sequence_Number(int n) : seq(n) {}
int seq;
};
inline const Sequence_Number & min(const Sequence_Number &n1, const Sequence_Number &n2) { return (n1 < n2) ? n1 : n2; }
inline const Sequence_Number & max(const Sequence_Number &n1, const Sequence_Number &n2) { return (n1 > n2) ? n1 : n2; }
class TCP_Segment
{
public:
TCP_Segment();
TCP_Segment(const Sequence_Number &sn_begin, const Sequence_Number &sn_end);
TCP_Segment(const TCP_Segment &segment);
//modification
TCP_Segment &operator=(const TCP_Segment &segment);
void set_begin(const Sequence_Number &sn);
void set_end(const Sequence_Number &sn);
void combine(const TCP_Segment &segment);
//query
bool operator==(const TCP_Segment &segment) const;
bool operator!=(const TCP_Segment &segment) const;
bool can_be_combined(const TCP_Segment &segment) const;
bool is_contained(const TCP_Segment &segment) const;
unsigned length() const;
Sequence_Number begin() const { return seq_begin; }
Sequence_Number end() const { return seq_end; }
friend std::ostream & operator<<(std::ostream &os, const TCP_Segment &segment);
protected:
Sequence_Number seq_begin;
Sequence_Number seq_end;
};
class TCP_Packet : public itpp::Packet
{
public:
TCP_Packet();
TCP_Packet(const TCP_Packet &packet);
virtual ~TCP_Packet();
virtual TCP_Packet &clone() const;
//TCP window mechanism
void set_segment(const TCP_Segment &seg) { fSegment = seg; }
TCP_Segment get_segment() const { return fSegment; }
void set_wnd(unsigned val) { fWnd = val; }
unsigned get_wnd() const { return fWnd; }
void set_ACK(Sequence_Number val) { fACK = val; }
Sequence_Number get_ACK() const { return fACK; }
//session control
void set_session_id(int val) { fSessionId = val; }
int get_session_id() const { return fSessionId; }
//debugging support
void set_destination_port(unsigned val) { fDestinationPort = val; }
unsigned get_destination_port() const { return fDestinationPort; }
void set_source_port(unsigned val) { fSourcePort = val; }
unsigned get_source_port() const { return fSourcePort; }
void set_info(unsigned ssThresh, unsigned recWnd, unsigned cWnd, double estRTT, Sequence_Number sndUna, Sequence_Number sndNxt, bool isRtx);
virtual void print_header(std::ostream &) const;
protected:
unsigned fDestinationPort;
unsigned fSourcePort;
TCP_Segment fSegment;
Sequence_Number fACK;
unsigned fWnd;
int fSessionId;
//Tracing
struct TDebugInfo {
unsigned fSSThresh;
unsigned fRecWnd;
unsigned fCWnd;
double fRTTEstimate;
Sequence_Number fSndUna;
Sequence_Number fSndNxt;
bool fRtxFlag;
};
TDebugInfo *fInfo;
friend std::ostream & operator<<(std::ostream &, TCP_Packet &);
};
class TCP_Sender
{
public:
TCP_Sender(int label);
virtual ~TCP_Sender();
//connection control
virtual void setup();
virtual void release(std::string trace_filename = "");
virtual void print_item(std::ostream &, const std::string &);
virtual void set_debug(const bool enable_debug = true);
virtual void set_debug(bool enable_debug, bool enable_signal_debug);
virtual void set_trace(const bool enable_trace = true);
virtual void save_trace(std::string filename);
Signal<itpp::Packet*> tcp_send;
Slot<TCP_Sender, itpp::Packet*> tcp_receive_ack;
Slot<TCP_Sender, itpp::Packet*> tcp_socket_write;
Slot<TCP_Sender, std::string> tcp_release;
//Signal<itpp::Packet*> TcpSendSignal;
//Slot<TCP_Sender, itpp::Packet*> TcpRecvAckSlot;
//Slot<TCP_Sender, itpp::Packet*> SocketWriteSlot;
//Slot<TCP_Sender, string> ReleaseSlot;
private:
std::queue<itpp::Packet*> SocketWriteQueue;
virtual void InitStatistics();
virtual void HandleACK(TCP_Packet &);
virtual void SendNewData(bool skipSWSA = false);
virtual void UnaRetransmit();
virtual void FinishFastRecovery();
virtual void ReduceSSThresh();
virtual void SendMsg(TCP_Packet & msg);
virtual void HandleRtxTimeout(Ttype);
virtual void IdleCheck();
virtual void HandleSWSATimeout(Ttype);
virtual unsigned GetNextSegmentSize(const Sequence_Number & begin);
virtual unsigned SendWindow() const;
virtual double CalcRTOValue() const;
virtual void SetRtxTimer();
virtual void UpdateRTTVariables(double sampleRTT);
virtual void TraceCWnd();
virtual void TraceSentSeqNo(const Sequence_Number sn);
virtual void TraceACKedSeqNo(const Sequence_Number sn);
virtual void TraceRTTVariables(double sampleRTT);
virtual void TraceSSThresh();
virtual std::string GenerateFilename();
void StopTransientPhase();
enum eTCPVersion {kTahoe, kReno, kNewReno};
virtual void set_label(int label);
//socket variables
unsigned fLabel; // end point identification also used at receiver
//message handling
virtual void HandleUserMessageIndication(itpp::Packet *user_data);
virtual void ReceiveMessageFromNet(itpp::Packet *msg);
//parameters parsed from input file
eTCPVersion fTCPVersion; // one of Reno, Tahoe, NewReno
unsigned fMSS; // maximum segment size
unsigned fTCPIPHeaderLength;
double fInitialRTT;
unsigned fInitialCWnd;
unsigned fInitialSSThresh;
unsigned fMaxCWnd;
unsigned fDupACKThreshold;
double fTimerGranularity;
double fMaxRTO; // max value of retransmission TO
unsigned fMaxBackoff;
bool fImmediateBackoffReset;
bool fKarn;
bool fGoBackN;
bool fFlightSizeRecovery;// use flight size on fast rec. exit
bool fRenoConservation;
bool fCarefulSSThreshReduction;
bool fIgnoreDupACKOnTORecovery;
bool fCarefulMulFastRtxAvoidance;
bool fNagle;
double fSWSATimerValue;
bool fRestartAfterIdle;
bool fTraceCWnd; // print CWnd trace to cout
bool fTraceSentSeqNo;
bool fTraceACKedSeqNo;
bool fDebug; // print additional information to cout
bool fTrace; // store trace info in vectors
//session identification
int fSessionId;
//TCP flow control (RFC 793)
Sequence_Number fSndUna; // lowest unacknowledged sn
Sequence_Number fSndNxt; // next byte to be sent
Sequence_Number fSndMax;
unsigned fRecWnd; // receiver advertised window
unsigned fMaxRecWnd;
Sequence_Number fUserNxt; // next byte to be received from user
//TCP congestion avoidance (RFC 2581, RFC 2001, RFC 2582)
unsigned fCWnd; // congestion window
unsigned fSSThresh;
unsigned fDupACKCnt;
Sequence_Number fRecoveryDupACK;
Sequence_Number fRecoveryTO;
//TCP timers
TTimer<TCP_Sender> fRtxTimer;
Sequence_Number fTimUna;
TTimer<TCP_Sender> fSWSATimer;
int fBackoff;
bool fPendingBackoffReset;
Ttype fLastSendTime;
//round trip time measurement (RTTM)
double fSRTT;
double fRTTVar;
double fRTTEstimate;
Sequence_Number fRTTMByte;
bool fRTTMPending;
double fRTTMStartTime;
//statistic counters
unsigned long fNumberOfTimeouts;
unsigned long fNumberOfFastRetransmits;
unsigned long fNumberOfRTTMeasurements;
unsigned long fNumberOfReceivedACKs;
unsigned long fNumberOfIdleTimeouts;
vec CWnd_val;
vec CWnd_time;
int CWnd_index;
vec SSThresh_val;
vec SSThresh_time;
int SSThresh_index;
ivec sent_seq_num_val;
vec sent_seq_num_time;
int sent_seq_num_index;
ivec sender_recv_ack_seq_num_val;
vec sender_recv_ack_seq_num_time;
int sender_recv_ack_seq_num_index;
vec RTTEstimate_val;
vec RTTEstimate_time;
int RTTEstimate_index;
vec RTTsample_val;
vec RTTsample_time;
int RTTsample_index;
};
class TCP_Receiver_Buffer
{
public:
TCP_Receiver_Buffer();
TCP_Receiver_Buffer(const TCP_Receiver_Buffer &);
~TCP_Receiver_Buffer();
void reset();
void write(TCP_Segment newBlock);
void read(unsigned noOfBytes);
unsigned first_block_size() const;
Sequence_Number first_byte() const;
Sequence_Number last_byte() const;
Sequence_Number next_expected() const;
unsigned window() const;
std::ostream &info(std::ostream &os, int detail = 0) const;
protected:
Sequence_Number fFirstByte;
std::list <TCP_Segment> fBufList;
};
class TCP_Receiver
{
public:
TCP_Receiver(int label);
virtual ~TCP_Receiver();
//name connection control
virtual void setup();
virtual void release(std::string trace_filename = "");
//message handling
itpp::Packet & get_user_message();
bool is_user_message_available();
virtual void set_debug(const bool enable_debug = true);
virtual void set_debug(bool enable_debug, bool enable_signal_debug);
virtual void set_trace(const bool enable_trace = true);
virtual void save_trace(std::string filename);
Signal<itpp::Packet*> tcp_send_ack;
Slot<TCP_Receiver, itpp::Packet*> tcp_receive;
Signal<int> tcp_new_data;
Slot<TCP_Receiver, std::string> tcp_release;
private:
void IndicateUserMessage();
virtual void ReceiveMessageFromNet(itpp::Packet* msg);
virtual void ReceiveDataPacket(TCP_Packet & packet);
virtual void SendACK(bool);
virtual void ScheduleACKMessage();
virtual void SendACKMessage(Ttype);
virtual void DelayedACKHandler(Ttype);
virtual void PeriodicACKHandler(Ttype);
virtual void HandleEndOfProcessing(Ttype);
virtual void TraceReceivedSeqNo(const Sequence_Number &sn);
virtual std::string GenerateFilename();
//basic variables
TCP_Receiver_Buffer fReceiverBuffer;
unsigned fLabel;
//parameters read by the parser
unsigned fTCPIPHeaderLength;
unsigned fMSS;
unsigned fBufferSize;
bool fDelayedACK;
Ttype fACKDelayTime;
bool fSendPeriodicACKs;
bool fStrictPeriodicACKs;
Ttype fPeriodicACKInterval;// interval after which an ACK is repeated
Ttype fACKSchedulingDelay;
bool fACKOnBufferWrite;
bool fACKOnBufferRead;
unsigned fMaxUserBlockSize;
unsigned fMinUserBlockSize;
double fUserBlockProcDelay;
bool fTrace;
bool fDebug;
//specific TCP variables
Sequence_Number fAdvRcvNxt;
unsigned fAdvRcvWnd;
//session management
int fSessionId;
//ACK timers
TTimer<TCP_Receiver> fDelayedACKTimer;
TTimer<TCP_Receiver> fPeriodicACKTimer;
TTimer<TCP_Receiver> fACKSchedulingTimer;
TCP_Packet * fWaitingACKMsg;
//user data delivery
Packet * fUserMessage;
TTimer<TCP_Receiver> fUserBlockProcTimer;
//statistic counters
ivec received_seq_num_val;
vec received_seq_num_time;
int received_seq_num_index;
};
// ------------------------------- Inline definitions ---------------------------------------------
inline Sequence_Number TCP_Receiver_Buffer::first_byte() const
{
return fFirstByte;
}
inline Sequence_Number TCP_Receiver_Buffer::last_byte() const
{
if (fBufList.empty()) {
return fFirstByte;
}
else {
return fBufList.back().end();
}
}
inline Sequence_Number TCP_Receiver_Buffer::next_expected() const
{
return fFirstByte + first_block_size();
}
inline void TCP_Segment::set_begin(const Sequence_Number &sn)
{
seq_begin = sn;
it_assert(seq_begin <= seq_end, "TCP_Segment::begin, end byte " + to_str(seq_end.value()) + " < begin byte " + to_str(seq_begin.value()));
}
inline void TCP_Segment::set_end(const Sequence_Number &sn)
{
seq_end = sn;
it_assert(seq_begin <= seq_end, "TCP_Segment::set_begin, end byte " + to_str(seq_end.value()) + " < begin byte " + to_str(seq_begin.value()));
}
inline bool TCP_Segment::operator==(const TCP_Segment &segment) const
{
return (this->seq_begin == segment.seq_begin) && (this->seq_end == segment.seq_end);
}
inline bool TCP_Segment::operator!=(const TCP_Segment &segment) const
{
return (this->seq_begin != segment.seq_begin) || (this->seq_end != segment.seq_end);
}
inline bool TCP_Segment::can_be_combined(const TCP_Segment &segment) const
{
return (this->seq_begin <= segment.seq_end) && (segment.seq_begin <= this->seq_end);
}
inline bool TCP_Segment::is_contained(const TCP_Segment &segment) const
{
return (segment.seq_begin <= this->seq_begin) && (this->seq_end <= segment.seq_end);
}
inline unsigned TCP_Segment::length() const
{
return seq_end - seq_begin;
}
} // namespace itpp
#endif
#endif // #ifndef TCP_H
itpp::Array
General array class.
Definition array.h:105
itpp::Packet
Definition packet.h:56
itpp::Sequence_Number
Definition tcp.h:72
itpp::Sequence_Number::operator+
friend Sequence_Number operator+(const int n1, const Sequence_Number &n2)
ADD DOCUMENTATION HERE.
Definition tcp.h:113
itpp::Sequence_Number::value
int value() const
Access to internal representation.
Definition tcp.h:110
itpp::Sequence_Number::operator+
Sequence_Number operator+(const int n) const
ADD DOCUMENTATION HERE.
Definition tcp.h:99
itpp::Sequence_Number::Sequence_Number
Sequence_Number()
Default constructor.
Definition tcp.h:75
itpp::Sequence_Number::seq
int seq
ADD DOCUMENTATION HERE.
Definition tcp.h:121
itpp::Sequence_Number::operator=
Sequence_Number & operator=(const int &rep)
ADD DOCUMENTATION HERE.
Definition tcp.h:81
itpp::Sequence_Number::operator-=
Sequence_Number & operator-=(const int n)
ADD DOCUMENTATION HERE.
Definition tcp.h:105
itpp::Sequence_Number::operator-
int operator-(const Sequence_Number &n) const
ADD DOCUMENTATION HERE.
Definition tcp.h:107
itpp::Sequence_Number::operator=
Sequence_Number & operator=(const Sequence_Number &n)
ADD DOCUMENTATION HERE.
Definition tcp.h:79
itpp::Sequence_Number::operator<<
friend std::ostream & operator<<(std::ostream &os, const Sequence_Number &n)
ADD DOCUMENTATION HERE.
Definition tcp.h:115
itpp::Sequence_Number::Sequence_Number
Sequence_Number(int n)
ADD DOCUMENTATION HERE.
Definition tcp.h:119
itpp::Sequence_Number::operator<=
bool operator<=(const Sequence_Number &n) const
ADD DOCUMENTATION HERE.
Definition tcp.h:95
itpp::Sequence_Number::operator==
bool operator==(const Sequence_Number &n) const
ADD DOCUMENTATION HERE.
Definition tcp.h:85
itpp::Sequence_Number::operator!=
bool operator!=(const Sequence_Number &n) const
ADD DOCUMENTATION HERE.
Definition tcp.h:87
itpp::Sequence_Number::operator>
bool operator>(const Sequence_Number &n) const
ADD DOCUMENTATION HERE.
Definition tcp.h:89
itpp::Sequence_Number::Sequence_Number
Sequence_Number(const Sequence_Number &n)
ADD DOCUMENTATION HERE.
Definition tcp.h:77
itpp::Sequence_Number::operator-
Sequence_Number operator-(const int n) const
ADD DOCUMENTATION HERE.
Definition tcp.h:103
itpp::Sequence_Number::operator+=
Sequence_Number & operator+=(const int n)
ADD DOCUMENTATION HERE.
Definition tcp.h:101
itpp::Sequence_Number::operator<
bool operator<(const Sequence_Number &n) const
ADD DOCUMENTATION HERE.
Definition tcp.h:93
itpp::Sequence_Number::operator>=
bool operator>=(const Sequence_Number &n) const
ADD DOCUMENTATION HERE.
Definition tcp.h:91
itpp::TCP_Packet
Definition tcp.h:212
itpp::TCP_Packet::set_segment
void set_segment(const TCP_Segment &seg)
ADD DOCUMENTATION HERE.
Definition tcp.h:225
itpp::TCP_Packet::~TCP_Packet
virtual ~TCP_Packet()
ADD DOCUMENTATION HERE.
itpp::TCP_Packet::fSessionId
int fSessionId
session identifier
Definition tcp.h:266
itpp::TCP_Packet::get_source_port
unsigned get_source_port() const
ADD DOCUMENTATION HERE.
Definition tcp.h:251
itpp::TCP_Packet::fSegment
TCP_Segment fSegment
data segment to be transmitted
Definition tcp.h:263
itpp::TCP_Packet::fInfo
TDebugInfo * fInfo
ADD DOCUMENTATION HERE.
Definition tcp.h:282
itpp::TCP_Packet::clone
virtual TCP_Packet & clone() const
ADD DOCUMENTATION HERE.
itpp::TCP_Packet::fWnd
unsigned fWnd
window size (advertised by receiver)
Definition tcp.h:265
itpp::TCP_Packet::set_destination_port
void set_destination_port(unsigned val)
ADD DOCUMENTATION HERE.
Definition tcp.h:245
itpp::TCP_Packet::TCP_Packet
TCP_Packet(const TCP_Packet &packet)
ADD DOCUMENTATION HERE.
itpp::TCP_Packet::get_destination_port
unsigned get_destination_port() const
ADD DOCUMENTATION HERE.
Definition tcp.h:247
itpp::TCP_Packet::fDestinationPort
unsigned fDestinationPort
ADD DOCUMENTATION HERE.
Definition tcp.h:259
itpp::TCP_Packet::set_ACK
void set_ACK(Sequence_Number val)
ADD DOCUMENTATION HERE.
Definition tcp.h:233
itpp::TCP_Packet::set_session_id
void set_session_id(int val)
ADD DOCUMENTATION HERE.
Definition tcp.h:239
itpp::TCP_Packet::set_wnd
void set_wnd(unsigned val)
ADD DOCUMENTATION HERE.
Definition tcp.h:229
itpp::TCP_Packet::TCP_Packet
TCP_Packet()
ADD DOCUMENTATION HERE.
itpp::TCP_Packet::get_ACK
Sequence_Number get_ACK() const
ADD DOCUMENTATION HERE.
Definition tcp.h:235
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::TCP_Packet::get_segment
TCP_Segment get_segment() const
ADD DOCUMENTATION HERE.
Definition tcp.h:227
itpp::TCP_Packet::operator<<
friend std::ostream & operator<<(std::ostream &, TCP_Packet &)
ADD DOCUMENTATION HERE.
itpp::TCP_Packet::set_source_port
void set_source_port(unsigned val)
ADD DOCUMENTATION HERE.
Definition tcp.h:249
itpp::TCP_Packet::fSourcePort
unsigned fSourcePort
ADD DOCUMENTATION HERE.
Definition tcp.h:261
itpp::TCP_Packet::get_wnd
unsigned get_wnd() const
ADD DOCUMENTATION HERE.
Definition tcp.h:231
itpp::TCP_Packet::fACK
Sequence_Number fACK
acknowledgment (next expected sn)
Definition tcp.h:264
itpp::TCP_Packet::get_session_id
int get_session_id() const
ADD DOCUMENTATION HERE.
Definition tcp.h:241
itpp::TCP_Packet::print_header
virtual void print_header(std::ostream &) const
ADD DOCUMENTATION HERE.
itpp::TCP_Receiver_Buffer
Definition tcp.h:520
itpp::TCP_Receiver_Buffer::first_block_size
unsigned first_block_size() const
size of first complete block
itpp::TCP_Receiver_Buffer::read
void read(unsigned noOfBytes)
read up to "noOfBytes" bytes from queue
itpp::TCP_Receiver_Buffer::fFirstByte
Sequence_Number fFirstByte
first byte stored or missing
Definition tcp.h:544
itpp::TCP_Receiver_Buffer::next_expected
Sequence_Number next_expected() const
first byte missing
Definition tcp.h:702
itpp::TCP_Receiver_Buffer::TCP_Receiver_Buffer
TCP_Receiver_Buffer()
ADD DOCUMENTATION HERE.
itpp::TCP_Receiver_Buffer::~TCP_Receiver_Buffer
~TCP_Receiver_Buffer()
ADD DOCUMENTATION HERE.
itpp::TCP_Receiver_Buffer::info
std::ostream & info(std::ostream &os, int detail=0) const
print info
itpp::TCP_Receiver_Buffer::first_byte
Sequence_Number first_byte() const
first byte stored or missing
Definition tcp.h:685
itpp::TCP_Receiver_Buffer::last_byte
Sequence_Number last_byte() const
highest byte received (+1)
Definition tcp.h:691
itpp::TCP_Receiver_Buffer::TCP_Receiver_Buffer
TCP_Receiver_Buffer(const TCP_Receiver_Buffer &)
ADD DOCUMENTATION HERE.
itpp::TCP_Receiver_Buffer::window
unsigned window() const
ADD DOCUMENTATION HERE.
itpp::TCP_Receiver_Buffer::fBufList
std::list< TCP_Segment > fBufList
ADD DOCUMENTATION HERE.
Definition tcp.h:547
itpp::TCP_Receiver_Buffer::reset
void reset()
clears internal list structure
itpp::TCP_Receiver_Buffer::write
void write(TCP_Segment newBlock)
add segment to the queue
itpp::TCP_Receiver
Definition tcp.h:583
itpp::TCP_Receiver::release
virtual void release(std::string trace_filename="")
ADD DOCUMENTATION HERE.
itpp::TCP_Receiver::TCP_Receiver
TCP_Receiver(int label)
ADD DOCUMENTATION HERE.
itpp::TCP_Receiver::tcp_send_ack
Signal< itpp::Packet * > tcp_send_ack
ADD DOCUMENTATION HERE.
Definition tcp.h:611
itpp::TCP_Receiver::setup
virtual void setup()
ADD DOCUMENTATION HERE.
itpp::TCP_Receiver::tcp_receive
Slot< TCP_Receiver, itpp::Packet * > tcp_receive
ADD DOCUMENTATION HERE.
Definition tcp.h:613
itpp::TCP_Receiver::get_user_message
itpp::Packet & get_user_message()
called by higher layer
itpp::TCP_Receiver::save_trace
virtual void save_trace(std::string filename)
ADD DOCUMENTATION HERE.
itpp::TCP_Receiver::is_user_message_available
bool is_user_message_available()
called by higher layer
itpp::TCP_Receiver::~TCP_Receiver
virtual ~TCP_Receiver()
ADD DOCUMENTATION HERE.
itpp::TCP_Receiver::tcp_release
Slot< TCP_Receiver, std::string > tcp_release
ADD DOCUMENTATION HERE.
Definition tcp.h:616
itpp::TCP_Receiver::tcp_new_data
Signal< int > tcp_new_data
indicate new data to higher layer
Definition tcp.h:614
itpp::TCP_Receiver::set_trace
virtual void set_trace(const bool enable_trace=true)
ADD DOCUMENTATION HERE.
itpp::TCP_Receiver::set_debug
virtual void set_debug(bool enable_debug, bool enable_signal_debug)
ADD DOCUMENTATION HERE.
itpp::TCP_Receiver::set_debug
virtual void set_debug(const bool enable_debug=true)
ADD DOCUMENTATION HERE.
itpp::TCP_Segment
Definition tcp.h:146
itpp::TCP_Segment::operator<<
friend std::ostream & operator<<(std::ostream &os, const TCP_Segment &segment)
ADD DOCUMENTATION HERE.
itpp::TCP_Segment::begin
Sequence_Number begin() const
ADD DOCUMENTATION HERE.
Definition tcp.h:177
itpp::TCP_Segment::seq_end
Sequence_Number seq_end
no. of last byte of segment + 1
Definition tcp.h:186
itpp::TCP_Segment::operator!=
bool operator!=(const TCP_Segment &segment) const
ADD DOCUMENTATION HERE.
Definition tcp.h:730
itpp::TCP_Segment::end
Sequence_Number end() const
ADD DOCUMENTATION HERE.
Definition tcp.h:179
itpp::TCP_Segment::length
unsigned length() const
ADD DOCUMENTATION HERE.
Definition tcp.h:748
itpp::TCP_Segment::TCP_Segment
TCP_Segment(const TCP_Segment &segment)
ADD DOCUMENTATION HERE.
itpp::TCP_Segment::seq_begin
Sequence_Number seq_begin
no. of first byte of segment
Definition tcp.h:185
itpp::TCP_Segment::combine
void combine(const TCP_Segment &segment)
ADD DOCUMENTATION HERE.
itpp::TCP_Segment::TCP_Segment
TCP_Segment(const Sequence_Number &sn_begin, const Sequence_Number &sn_end)
ADD DOCUMENTATION HERE.
itpp::TCP_Segment::operator==
bool operator==(const TCP_Segment &segment) const
ADD DOCUMENTATION HERE.
Definition tcp.h:724
itpp::TCP_Segment::is_contained
bool is_contained(const TCP_Segment &segment) const
ADD DOCUMENTATION HERE.
Definition tcp.h:742
itpp::TCP_Segment::TCP_Segment
TCP_Segment()
ADD DOCUMENTATION HERE.
itpp::TCP_Segment::operator=
TCP_Segment & operator=(const TCP_Segment &segment)
ADD DOCUMENTATION HERE.
itpp::TCP_Segment::set_end
void set_end(const Sequence_Number &sn)
ADD DOCUMENTATION HERE.
Definition tcp.h:716
itpp::TCP_Segment::set_begin
void set_begin(const Sequence_Number &sn)
ADD DOCUMENTATION HERE.
Definition tcp.h:708
itpp::TCP_Segment::can_be_combined
bool can_be_combined(const TCP_Segment &segment) const
ADD DOCUMENTATION HERE.
Definition tcp.h:736
itpp::TCP_Sender
Definition tcp.h:324
itpp::TCP_Sender::TCP_Sender
TCP_Sender(int label)
ADD DOCUMENTATION HERE.
itpp::TCP_Sender::set_trace
virtual void set_trace(const bool enable_trace=true)
ADD DOCUMENTATION HERE.
itpp::TCP_Sender::release
virtual void release(std::string trace_filename="")
ADD DOCUMENTATION HERE.
itpp::TCP_Sender::tcp_release
Slot< TCP_Sender, std::string > tcp_release
ADD DOCUMENTATION HERE.
Definition tcp.h:357
itpp::TCP_Sender::tcp_receive_ack
Slot< TCP_Sender, itpp::Packet * > tcp_receive_ack
ADD DOCUMENTATION HERE.
Definition tcp.h:353
itpp::TCP_Sender::tcp_socket_write
Slot< TCP_Sender, itpp::Packet * > tcp_socket_write
ADD DOCUMENTATION HERE.
Definition tcp.h:355
itpp::TCP_Sender::~TCP_Sender
virtual ~TCP_Sender()
ADD DOCUMENTATION HERE.
itpp::TCP_Sender::set_debug
virtual void set_debug(bool enable_debug, bool enable_signal_debug)
ADD DOCUMENTATION HERE.
itpp::TCP_Sender::setup
virtual void setup()
ADD DOCUMENTATION HERE.
itpp::TCP_Sender::set_debug
virtual void set_debug(const bool enable_debug=true)
ADD DOCUMENTATION HERE.
itpp::TCP_Sender::tcp_send
Signal< itpp::Packet * > tcp_send
ADD DOCUMENTATION HERE.
Definition tcp.h:351
itpp::TCP_Sender::print_item
virtual void print_item(std::ostream &, const std::string &)
Print support.
itpp::TCP_Sender::save_trace
virtual void save_trace(std::string filename)
ADD DOCUMENTATION HERE.
converters.h
Definitions of converters between different vector and matrix types.
events.h
Definitions of an event-based simulation class.
it_assert
#define it_assert(t, s)
Abort if t is not true.
Definition itassert.h:94
itpp::min
T min(const Vec< T > &in)
Minimum value of vector.
Definition min_max.h:125
itpp::max
T max(const Vec< T > &v)
Maximum value of vector.
Definition min_max.h:45
itpp
itpp namespace
Definition itmex.h:37
itpp::Ttype
double Ttype
64-bit floating point time
Definition events.h:54
itpp::to_str
std::string to_str(const T &i)
Convert anything to string.
Definition converters.h:444
packet.h
Definition of a Packet class.
itpp::TCP_Packet::TDebugInfo
ADD DOCUMENTATION HERE.
Definition tcp.h:271
itpp::TCP_Packet::TDebugInfo::fRtxFlag
bool fRtxFlag
ADD DOCUMENTATION HERE.
Definition tcp.h:278
itpp::TCP_Packet::TDebugInfo::fCWnd
unsigned fCWnd
ADD DOCUMENTATION HERE.
Definition tcp.h:274
itpp::TCP_Packet::TDebugInfo::fRecWnd
unsigned fRecWnd
ADD DOCUMENTATION HERE.
Definition tcp.h:273
itpp::TCP_Packet::TDebugInfo::fRTTEstimate
double fRTTEstimate
ADD DOCUMENTATION HERE.
Definition tcp.h:275
itpp::TCP_Packet::TDebugInfo::fSndNxt
Sequence_Number fSndNxt
ADD DOCUMENTATION HERE.
Definition tcp.h:277
itpp::TCP_Packet::TDebugInfo::fSndUna
Sequence_Number fSndUna
ADD DOCUMENTATION HERE.
Definition tcp.h:276
itpp::TCP_Packet::TDebugInfo::fSSThresh
unsigned fSSThresh
ADD DOCUMENTATION HERE.
Definition tcp.h:272
vec.h
Templated Vector Class Definitions.

Generated on Mon Jun 10 2024 11:49:24 for IT++ by Doxygen 1.9.8