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.cc
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
#include "
tcp-tx-item.h
"
8
9
namespace
ns3
10
{
11
12
void
13
TcpTxItem::Print
(std::ostream& os,
Time::Unit
unit
/* = Time::S */
)
const
14
{
15
bool
comma =
false
;
16
os <<
"["
<<
m_startSeq
<<
";"
<<
m_startSeq
+
GetSeqSize
() <<
"|"
<<
GetSeqSize
() <<
"]"
;
17
18
if
(
m_lost
)
19
{
20
os <<
"[lost]"
;
21
comma =
true
;
22
}
23
if
(
m_retrans
)
24
{
25
if
(comma)
26
{
27
os <<
","
;
28
}
29
30
os <<
"[retrans]"
;
31
comma =
true
;
32
}
33
if
(
m_sacked
)
34
{
35
if
(comma)
36
{
37
os <<
","
;
38
}
39
os <<
"[sacked]"
;
40
comma =
true
;
41
}
42
if
(comma)
43
{
44
os <<
","
;
45
}
46
os <<
"["
<<
m_lastSent
.
As
(unit) <<
"]"
;
47
}
48
49
uint32_t
50
TcpTxItem::GetSeqSize
()
const
51
{
52
return
m_packet
&&
m_packet
->
GetSize
() > 0 ?
m_packet
->
GetSize
() : 1;
53
}
54
55
bool
56
TcpTxItem::IsSacked
()
const
57
{
58
return
m_sacked
;
59
}
60
61
bool
62
TcpTxItem::IsRetrans
()
const
63
{
64
return
m_retrans
;
65
}
66
67
Ptr<Packet>
68
TcpTxItem::GetPacketCopy
()
const
69
{
70
return
m_packet
->
Copy
();
71
}
72
73
Ptr<const Packet>
74
TcpTxItem::GetPacket
()
const
75
{
76
return
m_packet
;
77
}
78
79
const
Time
&
80
TcpTxItem::GetLastSent
()
const
81
{
82
return
m_lastSent
;
83
}
84
85
TcpTxItem::RateInformation
&
86
TcpTxItem::GetRateInformation
()
87
{
88
return
m_rateInfo
;
89
}
90
91
}
// namespace ns3
ns3::Packet::GetSize
uint32_t GetSize() const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
Definition
packet.h:850
ns3::Packet::Copy
Ptr< Packet > Copy() const
performs a COW copy of the packet.
Definition
packet.cc:120
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
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::As
TimeWithUnit As(const Unit unit=Time::AUTO) const
Attach a unit to a Time, to facilitate output in a specific unit.
Definition
time.cc:404
ns3::Time::Unit
Unit
The unit to use to interpret a number representing time.
Definition
nstime.h:100
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
tcp-tx-item.h
src
internet
model
tcp-tx-item.cc
Generated on Fri Nov 8 2024 13:59:01 for ns-3 by
1.11.0