A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
tcp-tx-item.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2018 Natale Patriciello <natale.patriciello@gmail.com>
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
*/
7
#ifndef TCP_TX_ITEM_H
8
#define TCP_TX_ITEM_H
9
10
#include "ns3/nstime.h"
11
#include "ns3/packet.h"
12
#include "ns3/sequence-number.h"
13
14
namespace
ns3
15
{
16
/**
17
* @ingroup tcp
18
*
19
* @brief Item that encloses the application packet and some flags for it
20
*/
21
class
TcpTxItem
22
{
23
public
:
24
// Default constructor, copy-constructor, destructor
25
26
/**
27
* @brief Print the time
28
* @param os ostream
29
* @param unit Time::Unit
30
*/
31
void
Print
(std::ostream& os,
Time::Unit
unit =
Time::S
)
const
;
32
33
/**
34
* @brief Get the size in the sequence number space
35
*
36
* @return 1 if the packet size is 0 or there's no packet, otherwise the size of the packet
37
*/
38
uint32_t
GetSeqSize
()
const
;
39
40
/**
41
* @brief Is the item sacked?
42
* @return true if the item is sacked, false otherwise
43
*/
44
bool
IsSacked
()
const
;
45
46
/**
47
* @brief Is the item retransmitted?
48
* @return true if the item have been retransmitted
49
*/
50
bool
IsRetrans
()
const
;
51
52
/**
53
* @brief Get a copy of the Packet underlying this item
54
* @return a copy of the Packet
55
*/
56
Ptr<Packet>
GetPacketCopy
()
const
;
57
58
/**
59
* @brief Get the Packet underlying this item
60
* @return a pointer to a const Packet
61
*/
62
Ptr<const Packet>
GetPacket
()
const
;
63
64
/**
65
* @brief Get a reference to the time the packet was sent for the last time
66
* @return a reference to the last sent time
67
*/
68
const
Time
&
GetLastSent
()
const
;
69
70
/**
71
* @brief Various rate-related information, can be accessed by TcpRateOps.
72
*
73
* Note: This is not enforced through C++, but you developer must honour
74
* this description.
75
*/
76
struct
RateInformation
77
{
78
uint64_t
m_delivered
{0};
//!< Connection's delivered data at the time the packet was sent
79
Time
m_deliveredTime
{
80
Time::Max
()};
//!< Connection's delivered time at the time the packet was sent
81
Time
m_firstSent
{
82
Time::Max
()};
//!< Connection's first sent time at the time the packet was sent
83
bool
m_isAppLimited
{
false
};
//!< Connection's app limited at the time the packet was sent
84
};
85
86
/**
87
* @brief Get (to modify) the Rate Information of this item
88
*
89
* @return A reference to the rate information.
90
*/
91
RateInformation&
GetRateInformation
();
92
93
bool
m_retrans
{
false
};
//!< Indicates if the segment is retransmitted
94
95
private
:
96
// Only TcpTxBuffer is allowed to touch this part of the TcpTxItem, to manage
97
// its internal lists and counters
98
friend
class
TcpTxBuffer
;
99
100
SequenceNumber32
m_startSeq
{0};
//!< Sequence number of the item (if transmitted)
101
Ptr<Packet>
m_packet
{
nullptr
};
//!< Application packet (can be null)
102
bool
m_lost
{
false
};
//!< Indicates if the segment has been lost (RTO)
103
Time
m_lastSent
{
104
Time::Max
()};
//!< Timestamp of the time at which the segment has been sent last time
105
bool
m_sacked
{
false
};
//!< Indicates if the segment has been SACKed
106
107
RateInformation
m_rateInfo
;
//!< Rate information of the item
108
};
109
110
}
// namespace ns3
111
112
#endif
/* TCP_TX_ITEM_H */
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::SequenceNumber< uint32_t, int32_t >
ns3::TcpTxBuffer
Tcp sender buffer.
Definition
tcp-tx-buffer.h:113
ns3::TcpTxItem
Item that encloses the application packet and some flags for it.
Definition
tcp-tx-item.h:22
ns3::TcpTxItem::m_sacked
bool m_sacked
Indicates if the segment has been SACKed.
Definition
tcp-tx-item.h:105
ns3::TcpTxItem::m_retrans
bool m_retrans
Indicates if the segment is retransmitted.
Definition
tcp-tx-item.h:93
ns3::TcpTxItem::m_startSeq
SequenceNumber32 m_startSeq
Sequence number of the item (if transmitted)
Definition
tcp-tx-item.h:100
ns3::TcpTxItem::IsSacked
bool IsSacked() const
Is the item sacked?
Definition
tcp-tx-item.cc:56
ns3::TcpTxItem::m_lastSent
Time m_lastSent
Timestamp of the time at which the segment has been sent last time.
Definition
tcp-tx-item.h:103
ns3::TcpTxItem::m_rateInfo
RateInformation m_rateInfo
Rate information of the item.
Definition
tcp-tx-item.h:107
ns3::TcpTxItem::GetPacket
Ptr< const Packet > GetPacket() const
Get the Packet underlying this item.
Definition
tcp-tx-item.cc:74
ns3::TcpTxItem::GetSeqSize
uint32_t GetSeqSize() const
Get the size in the sequence number space.
Definition
tcp-tx-item.cc:50
ns3::TcpTxItem::GetPacketCopy
Ptr< Packet > GetPacketCopy() const
Get a copy of the Packet underlying this item.
Definition
tcp-tx-item.cc:68
ns3::TcpTxItem::GetLastSent
const Time & GetLastSent() const
Get a reference to the time the packet was sent for the last time.
Definition
tcp-tx-item.cc:80
ns3::TcpTxItem::GetRateInformation
RateInformation & GetRateInformation()
Get (to modify) the Rate Information of this item.
Definition
tcp-tx-item.cc:86
ns3::TcpTxItem::m_lost
bool m_lost
Indicates if the segment has been lost (RTO)
Definition
tcp-tx-item.h:102
ns3::TcpTxItem::m_packet
Ptr< Packet > m_packet
Application packet (can be null)
Definition
tcp-tx-item.h:101
ns3::TcpTxItem::IsRetrans
bool IsRetrans() const
Is the item retransmitted?
Definition
tcp-tx-item.cc:62
ns3::TcpTxItem::Print
void Print(std::ostream &os, Time::Unit unit=Time::S) const
Print the time.
Definition
tcp-tx-item.cc:13
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition
nstime.h:94
ns3::Time::Unit
Unit
The unit to use to interpret a number representing time.
Definition
nstime.h:100
ns3::Time::S
@ S
second
Definition
nstime.h:105
ns3::Time::Max
static Time Max()
Maximum representable Time Not to be confused with Max(Time,Time).
Definition
nstime.h:286
uint32_t
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::TcpTxItem::RateInformation
Various rate-related information, can be accessed by TcpRateOps.
Definition
tcp-tx-item.h:77
ns3::TcpTxItem::RateInformation::m_isAppLimited
bool m_isAppLimited
Connection's app limited at the time the packet was sent.
Definition
tcp-tx-item.h:83
ns3::TcpTxItem::RateInformation::m_delivered
uint64_t m_delivered
Connection's delivered data at the time the packet was sent.
Definition
tcp-tx-item.h:78
ns3::TcpTxItem::RateInformation::m_deliveredTime
Time m_deliveredTime
Connection's delivered time at the time the packet was sent.
Definition
tcp-tx-item.h:79
ns3::TcpTxItem::RateInformation::m_firstSent
Time m_firstSent
Connection's first sent time at the time the packet was sent.
Definition
tcp-tx-item.h:81
src
internet
model
tcp-tx-item.h
Generated on Wed Dec 4 2024 18:20:42 for ns-3 by
1.11.0