A Discrete-Event Network Simulator
API
tcp-tx-item.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2018 Natale Patriciello <natale.patriciello@gmail.com>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  */
19 #ifndef TCP_TX_ITEM_H
20 #define TCP_TX_ITEM_H
21 
22 #include "ns3/packet.h"
23 #include "ns3/nstime.h"
24 #include "ns3/sequence-number.h"
25 
26 namespace ns3 {
32 class TcpTxItem
33 {
34 public:
35  // Default constructor, copy-constructor, destructor
36 
41  void Print (std::ostream &os) const;
42 
48  uint32_t GetSeqSize (void) const;
49 
54  bool IsSacked (void) const;
55 
60  bool IsRetrans (void) const;
61 
66  Ptr<Packet> GetPacketCopy (void) const;
67 
72  Ptr<const Packet> GetPacket (void) const;
73 
78  const Time & GetLastSent (void) const;
79 
87  {
88  uint64_t m_delivered {0};
91  bool m_isAppLimited {false};
92  };
93 
99  RateInformation & GetRateInformation (void);
100 
101  bool m_retrans {false};
102 
103 private:
104  // Only TcpTxBuffer is allower to touch this part of the TcpTxItem, to manage
105  // its internal lists and counters
106  friend class TcpTxBuffer;
107 
109  Ptr<Packet> m_packet {nullptr};
110  bool m_lost {false};
112  bool m_sacked {false};
113 
115 };
116 
117 } //namespace ns3
118 
119 #endif /* TCP_TX_ITEM_H */
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:103
bool m_retrans
Indicates if the segment is retransmitted.
Definition: tcp-tx-item.h:101
uint32_t GetSeqSize(void) const
Get the size in the sequence number space.
Definition: tcp-tx-item.cc:62
bool IsRetrans(void) const
Is the item retransmitted?
Definition: tcp-tx-item.cc:74
static Time Max()
Maximum representable Time Not to be confused with Max(Time,Time).
Definition: nstime.h:282
Item that encloses the application packet and some flags for it.
Definition: tcp-tx-item.h:32
Time m_lastSent
Timestamp of the time at which the segment has been sent last time.
Definition: tcp-tx-item.h:111
uint64_t m_delivered
Connection&#39;s delivered data at the time the packet was sent.
Definition: tcp-tx-item.h:88
SequenceNumber32 m_startSeq
Sequence number of the item (if transmitted)
Definition: tcp-tx-item.h:108
bool m_isAppLimited
Connection&#39;s app limited at the time the packet was sent.
Definition: tcp-tx-item.h:91
RateInformation & GetRateInformation(void)
Get (to modify) the Rate Information of this item.
Definition: tcp-tx-item.cc:98
bool IsSacked(void) const
Is the item sacked?
Definition: tcp-tx-item.cc:68
Time m_firstSent
Connection&#39;s first sent time at the time the packet was sent.
Definition: tcp-tx-item.h:90
Tcp sender buffer.
RateInformation m_rateInfo
Rate information of the item.
Definition: tcp-tx-item.h:114
Various rate-related information, can be accessed by TcpRateOps.
Definition: tcp-tx-item.h:86
Ptr< Packet > m_packet
Application packet (can be null)
Definition: tcp-tx-item.h:109
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const Packet > GetPacket(void) const
Get the Packet underlying this item.
Definition: tcp-tx-item.cc:86
Ptr< Packet > GetPacketCopy(void) const
Get a copy of the Packet underlying this item.
Definition: tcp-tx-item.cc:80
Time m_deliveredTime
Connection&#39;s delivered time at the time the packet was sent.
Definition: tcp-tx-item.h:89
const Time & GetLastSent(void) const
Get a reference to the time the packet was sent for the last time.
Definition: tcp-tx-item.cc:92
bool m_sacked
Indicates if the segment has been SACKed.
Definition: tcp-tx-item.h:112
void Print(std::ostream &os) const
Print the time.
Definition: tcp-tx-item.cc:24
bool m_lost
Indicates if the segment has been lost (RTO)
Definition: tcp-tx-item.h:110