A Discrete-Event Network Simulator
API
tcp-socket-base.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2007 Georgia Tech Research Corporation
4  * Copyright (c) 2010 Adrian Sai-wah Tam
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation;
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Author: Adrian Sai-wah Tam <adrian.sw.tam@gmail.com>
20  */
21 #ifndef TCP_SOCKET_BASE_H
22 #define TCP_SOCKET_BASE_H
23 
24 #include <stdint.h>
25 #include <queue>
26 #include "ns3/traced-value.h"
27 #include "ns3/tcp-socket.h"
28 #include "ns3/ipv4-header.h"
29 #include "ns3/ipv6-header.h"
30 #include "ns3/timer.h"
31 #include "ns3/sequence-number.h"
32 #include "ns3/data-rate.h"
33 #include "ns3/node.h"
34 #include "ns3/tcp-socket-state.h"
35 
36 namespace ns3 {
37 
38 class Ipv4EndPoint;
39 class Ipv6EndPoint;
40 class Node;
41 class Packet;
42 class TcpL4Protocol;
43 class TcpHeader;
44 class TcpCongestionOps;
45 class TcpRecoveryOps;
46 class RttEstimator;
47 class TcpRxBuffer;
48 class TcpTxBuffer;
49 class TcpOption;
50 class Ipv4Interface;
51 class Ipv6Interface;
52 class TcpRateOps;
53 
60 {
61 public:
68  RttHistory (SequenceNumber32 s, uint32_t c, Time t);
73  RttHistory (const RttHistory& h); // Copy constructor
74 public:
76  uint32_t count;
78  bool retx;
79 };
80 
217 class TcpSocketBase : public TcpSocket
218 {
219 public:
225  static TypeId GetTypeId (void);
226 
231  virtual TypeId GetInstanceTypeId () const;
232 
237  friend class TcpGeneralTest;
238 
242  TcpSocketBase (void);
243 
249  TcpSocketBase (const TcpSocketBase& sock);
250  virtual ~TcpSocketBase (void);
251 
252  // Set associated Node, TcpL4Protocol, RttEstimator to this socket
253 
258  virtual void SetNode (Ptr<Node> node);
259 
264  virtual void SetTcp (Ptr<TcpL4Protocol> tcp);
265 
270  virtual void SetRtt (Ptr<RttEstimator> rtt);
271 
276  void SetMinRto (Time minRto);
277 
282  Time GetMinRto (void) const;
283 
288  void SetClockGranularity (Time clockGranularity);
289 
294  Time GetClockGranularity (void) const;
295 
300  Ptr<TcpTxBuffer> GetTxBuffer (void) const;
301 
306  Ptr<TcpRxBuffer> GetRxBuffer (void) const;
307 
312  void SetRetxThresh (uint32_t retxThresh);
313 
318  uint32_t GetRetxThresh (void) const { return m_retxThresh; }
319 
324 
329 
334 
339 
344 
349 
354 
359 
364 
369 
375  void UpdatePacingRateTrace (DataRate oldValue, DataRate newValue);
376 
382  void UpdateCwnd (uint32_t oldValue, uint32_t newValue);
383 
389  void UpdateCwndInfl (uint32_t oldValue, uint32_t newValue);
390 
396  void UpdateSsThresh (uint32_t oldValue, uint32_t newValue);
397 
405 
412  TcpSocketState::EcnState_t newValue);
413 
419  void UpdateHighTxMark (SequenceNumber32 oldValue, SequenceNumber32 newValue);
420 
426  void UpdateNextTxSequence (SequenceNumber32 oldValue, SequenceNumber32 newValue);
427 
433  void UpdateBytesInFlight (uint32_t oldValue, uint32_t newValue);
434 
440  void UpdateRtt (Time oldValue, Time newValue);
441 
448 
455 
462  inline uint8_t MarkEcnEct0 (uint8_t tos) const
463  {
464  return ((tos & 0xfc) | 0x02);
465  }
466 
473  inline uint8_t MarkEcnEct1 (uint8_t tos) const
474  {
475  return ((tos & 0xfc) | 0x01);
476  }
477 
484  inline uint8_t MarkEcnCe (uint8_t tos) const
485  {
486  return ((tos & 0xfc) | 0x03);
487  }
488 
495  inline uint8_t ClearEcnBits (uint8_t tos) const
496  {
497  return tos & 0xfc;
498  }
499 
506  inline bool CheckNoEcn (uint8_t tos) const
507  {
508  return ((tos & 0x03) == 0x00);
509  }
510 
517  inline bool CheckEcnEct0 (uint8_t tos) const
518  {
519  return ((tos & 0x03) == 0x02);
520  }
521 
528  inline bool CheckEcnEct1 (uint8_t tos) const
529  {
530  return ((tos & 0x03) == 0x01);
531  }
532 
539  inline bool CheckEcnCe (uint8_t tos) const
540  {
541  return ((tos & 0x03) == 0x03);
542  }
543 
551  inline uint8_t MarkEcnCodePoint (const uint8_t tos, const TcpSocketState::EcnCodePoint_t codePoint) const
552  {
553  return ((tos & 0xfc) | codePoint);
554  }
555 
561  void SetUseEcn (TcpSocketState::UseEcn_t useEcn);
562 
567  void SetPacingStatus (bool pacing);
568 
573  void SetPaceInitialWindow (bool paceWindow);
574 
575  // Necessary implementations of null functions from ns3::Socket
576  virtual enum SocketErrno GetErrno (void) const; // returns m_errno
577  virtual enum SocketType GetSocketType (void) const; // returns socket type
578  virtual Ptr<Node> GetNode (void) const; // returns m_node
579  virtual int Bind (void); // Bind a socket by setting up endpoint in TcpL4Protocol
580  virtual int Bind6 (void); // Bind a socket by setting up endpoint in TcpL4Protocol
581  virtual int Bind (const Address &address); // ... endpoint of specific addr or port
582  virtual int Connect (const Address &address); // Setup endpoint and call ProcessAction() to connect
583  virtual int Listen (void); // Verify the socket is in a correct state and call ProcessAction() to listen
584  virtual int Close (void); // Close by app: Kill socket upon tx buffer emptied
585  virtual int ShutdownSend (void); // Assert the m_shutdownSend flag to prevent send to network
586  virtual int ShutdownRecv (void); // Assert the m_shutdownRecv flag to prevent forward to app
587  virtual int Send (Ptr<Packet> p, uint32_t flags); // Call by app to send data to network
588  virtual int SendTo (Ptr<Packet> p, uint32_t flags, const Address &toAddress); // Same as Send(), toAddress is insignificant
589  virtual Ptr<Packet> Recv (uint32_t maxSize, uint32_t flags); // Return a packet to be forwarded to app
590  virtual Ptr<Packet> RecvFrom (uint32_t maxSize, uint32_t flags, Address &fromAddress); // ... and write the remote address at fromAddress
591  virtual uint32_t GetTxAvailable (void) const; // Available Tx buffer size
592  virtual uint32_t GetRxAvailable (void) const; // Available-to-read data size, i.e. value of m_rxAvailable
593  virtual int GetSockName (Address &address) const; // Return local addr:port in address
594  virtual int GetPeerName (Address &address) const;
595  virtual void BindToNetDevice (Ptr<NetDevice> netdevice); // NetDevice with my m_endPoint
596 
604  typedef void (* TcpTxRxTracedCallback)(const Ptr<const Packet> packet, const TcpHeader& header,
605  const Ptr<const TcpSocketBase> socket);
606 
607 protected:
608  // Implementing ns3::TcpSocket -- Attribute get/set
609  // inherited, no need to doc
610 
611  virtual void SetSndBufSize (uint32_t size);
612  virtual uint32_t GetSndBufSize (void) const;
613  virtual void SetRcvBufSize (uint32_t size);
614  virtual uint32_t GetRcvBufSize (void) const;
615  virtual void SetSegSize (uint32_t size);
616  virtual uint32_t GetSegSize (void) const;
617  virtual void SetInitialSSThresh (uint32_t threshold);
618  virtual uint32_t GetInitialSSThresh (void) const;
619  virtual void SetInitialCwnd (uint32_t cwnd);
620  virtual uint32_t GetInitialCwnd (void) const;
621  virtual void SetConnTimeout (Time timeout);
622  virtual Time GetConnTimeout (void) const;
623  virtual void SetSynRetries (uint32_t count);
624  virtual uint32_t GetSynRetries (void) const;
625  virtual void SetDataRetries (uint32_t retries);
626  virtual uint32_t GetDataRetries (void) const;
627  virtual void SetDelAckTimeout (Time timeout);
628  virtual Time GetDelAckTimeout (void) const;
629  virtual void SetDelAckMaxCount (uint32_t count);
630  virtual uint32_t GetDelAckMaxCount (void) const;
631  virtual void SetTcpNoDelay (bool noDelay);
632  virtual bool GetTcpNoDelay (void) const;
633  virtual void SetPersistTimeout (Time timeout);
634  virtual Time GetPersistTimeout (void) const;
635  virtual bool SetAllowBroadcast (bool allowBroadcast);
636  virtual bool GetAllowBroadcast (void) const;
637 
638 
639 
640  // Helper functions: Connection set up
641 
647  int SetupCallback (void);
648 
654  int DoConnect (void);
655 
659  void ConnectionSucceeded (void);
660 
666  int SetupEndpoint (void);
667 
673  int SetupEndpoint6 (void);
674 
687  virtual void CompleteFork (Ptr<Packet> p, const TcpHeader& tcpHeader,
688  const Address& fromAddress, const Address& toAddress);
689 
690 
691 
692  // Helper functions: Transfer operation
693 
702  bool IsValidTcpSegment (const SequenceNumber32 seq, const uint32_t tcpHeaderSize,
703  const uint32_t tcpPayloadSize);
704 
713  void ForwardUp (Ptr<Packet> packet, Ipv4Header header, uint16_t port, Ptr<Ipv4Interface> incomingInterface);
714 
723  void ForwardUp6 (Ptr<Packet> packet, Ipv6Header header, uint16_t port, Ptr<Ipv6Interface> incomingInterface);
724 
737  virtual void DoForwardUp (Ptr<Packet> packet, const Address &fromAddress,
738  const Address &toAddress);
739 
749  void ForwardIcmp (Ipv4Address icmpSource, uint8_t icmpTtl, uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo);
750 
760  void ForwardIcmp6 (Ipv6Address icmpSource, uint8_t icmpTtl, uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo);
761 
770  uint32_t SendPendingData (bool withAck = false);
771 
781  virtual uint32_t SendDataPacket (SequenceNumber32 seq, uint32_t maxSize, bool withAck);
782 
788  virtual void SendEmptyPacket (uint8_t flags);
789 
793  void SendRST (void);
794 
802  bool OutOfRange (SequenceNumber32 head, SequenceNumber32 tail) const;
803 
804 
805  // Helper functions: Connection close
806 
812  int DoClose (void);
813 
817  void CloseAndNotify (void);
818 
825  void Destroy (void);
826 
833  void Destroy6 (void);
834 
838  void DeallocateEndPoint (void);
839 
846  void PeerClose (Ptr<Packet> p, const TcpHeader& tcpHeader);
847 
851  void DoPeerClose (void);
852 
856  void CancelAllTimers (void);
857 
861  void TimeWait (void);
862 
863  // State transition functions
864 
873  void ProcessEstablished (Ptr<Packet> packet, const TcpHeader& tcpHeader); // Received a packet upon ESTABLISHED state
874 
883  void ProcessListen (Ptr<Packet> packet, const TcpHeader& tcpHeader,
884  const Address& fromAddress, const Address& toAddress);
885 
892  void ProcessSynSent (Ptr<Packet> packet, const TcpHeader& tcpHeader);
893 
902  void ProcessSynRcvd (Ptr<Packet> packet, const TcpHeader& tcpHeader,
903  const Address& fromAddress, const Address& toAddress);
904 
911  void ProcessWait (Ptr<Packet> packet, const TcpHeader& tcpHeader);
912 
919  void ProcessClosing (Ptr<Packet> packet, const TcpHeader& tcpHeader);
920 
927  void ProcessLastAck (Ptr<Packet> packet, const TcpHeader& tcpHeader);
928 
929  // Window management
930 
938  virtual uint32_t UnAckDataCount (void) const;
939 
947  virtual uint32_t BytesInFlight (void) const;
948 
953  virtual uint32_t Window (void) const;
954 
959  virtual uint32_t AvailableWindow (void) const;
960 
967  virtual uint16_t AdvertisedWindowSize (bool scale = true) const;
968 
981  void UpdateWindowSize (const TcpHeader& header);
982 
983 
984  // Manage data tx/rx
985 
990  virtual Ptr<TcpSocketBase> Fork (void);
991 
997  virtual void ReceivedAck (Ptr<Packet> packet, const TcpHeader& tcpHeader);
998 
1007  virtual void ProcessAck (const SequenceNumber32 &ackNumber, bool scoreboardUpdated,
1008  uint32_t currentDelivered, const SequenceNumber32 &oldHeadSequence);
1009 
1015  virtual void ReceivedData (Ptr<Packet> packet, const TcpHeader& tcpHeader);
1016 
1021  virtual void EstimateRtt (const TcpHeader& tcpHeader);
1022 
1031  virtual void UpdateRttHistory (const SequenceNumber32 &seq, uint32_t sz,
1032  bool isRetransmission);
1033 
1039  virtual void NewAck (SequenceNumber32 const& seq, bool resetRTO);
1040 
1046  void DupAck (uint32_t currentDelivered);
1047 
1053  void EnterCwr (uint32_t currentDelivered);
1054 
1060  void EnterRecovery (uint32_t currentDelivered);
1061 
1065  virtual void ReTxTimeout (void);
1066 
1070  virtual void DelAckTimeout (void);
1071 
1075  virtual void LastAckTimeout (void);
1076 
1080  virtual void PersistTimeout (void);
1081 
1086  void DoRetransmit (void);
1087 
1095  void AddOptions (TcpHeader& tcpHeader);
1096 
1105  void ReadOptions (const TcpHeader &tcpHeader, uint32_t *bytesSacked);
1106 
1113  bool IsTcpOptionEnabled (uint8_t kind) const;
1114 
1123  void ProcessOptionWScale (const Ptr<const TcpOption> option);
1132  void AddOptionWScale (TcpHeader& header);
1133 
1141  uint8_t CalculateWScale () const;
1142 
1152 
1159  uint32_t ProcessOptionSack(const Ptr<const TcpOption> option);
1160 
1166  void AddOptionSackPermitted (TcpHeader &header);
1167 
1173  void AddOptionSack (TcpHeader& header);
1174 
1185  void ProcessOptionTimestamp (const Ptr<const TcpOption> option,
1186  const SequenceNumber32 &seq);
1195  void AddOptionTimestamp (TcpHeader& header);
1196 
1206  static uint32_t SafeSubtraction (uint32_t a, uint32_t b);
1207 
1211  void NotifyPacingPerformed (void);
1212 
1217  bool IsPacingEnabled (void) const;
1218 
1222  void UpdatePacingRate (void);
1223 
1228  void AddSocketTags (const Ptr<Packet> &p) const;
1229 
1235  uint32_t GetRWnd (void) const;
1236 
1242  SequenceNumber32 GetHighRxAck (void) const;
1243 
1244 protected:
1245  // Counters and events
1251 
1252  // ACK management
1253  uint32_t m_dupAckCount {0};
1254  uint32_t m_delAckCount {0};
1255  uint32_t m_delAckMaxCount {0};
1256 
1257  // Nagle algorithm
1258  bool m_noDelay {false};
1259 
1260  // Retries
1261  uint32_t m_synCount {0};
1262  uint32_t m_synRetries {0};
1263  uint32_t m_dataRetrCount {0};
1264  uint32_t m_dataRetries {0};
1265 
1266  // Timeouts
1273 
1274  // History of RTT
1275  std::deque<RttHistory> m_history;
1276 
1277  // Connections to other layers of TCP/IP
1284 
1286 
1287  // Tx buffer management
1289 
1290  // State-related attributes
1292  mutable enum SocketErrno m_errno {ERROR_NOTERROR};
1293  bool m_closeNotified {false};
1294  bool m_closeOnEmpty {false};
1295  bool m_shutdownSend {false};
1296  bool m_shutdownRecv {false};
1297  bool m_connected {false};
1298  double m_msl {0.0};
1299 
1300  // Window management
1301  uint16_t m_maxWinSize {0};
1308 
1309  // Options
1310  bool m_sackEnabled {true};
1311  bool m_winScalingEnabled {true};
1312  uint8_t m_rcvWindShift {0};
1313  uint8_t m_sndWindShift {0};
1314  bool m_timestampEnabled {true};
1315  uint32_t m_timestampToEcho {0};
1316 
1318 
1319  // Fast Retransmit and Recovery
1321  bool m_recoverActive {false};
1322  uint32_t m_retxThresh {3};
1325  bool m_limitedTx {true};
1326 
1327  // Transmission Control Block
1332 
1333  // Guesses over the other connection end
1334  bool m_isFirstPartialAck {true};
1335 
1336  // The following two traces pass a packet with a TCP header
1339 
1342 
1343  // Pacing related variable
1345 
1346  // Parameters related to Explicit Congestion Notification
1350 };
1351 
1360  const TcpSocketState::TcpCongState_t newValue);
1361 
1370  const TcpSocketState::EcnState_t newValue);
1371 
1372 } // namespace ns3
1373 
1374 #endif /* TCP_SOCKET_BASE_H */
ns3::TcpSocketBase::Window
virtual uint32_t Window(void) const
Return the max possible number of unacked bytes.
Definition: tcp-socket-base.cc:3380
ns3::TcpSocketBase::SetRetxThresh
void SetRetxThresh(uint32_t retxThresh)
Set the retransmission threshold (dup ack threshold for a fast retransmit)
Definition: tcp-socket-base.cc:4346
ns3::TcpSocketBase::AddOptionTimestamp
void AddOptionTimestamp(TcpHeader &header)
Add the timestamp option to the header.
Definition: tcp-socket-base.cc:4249
ns3::TcpSocketBase::m_lastAckEvent
EventId m_lastAckEvent
Last ACK timeout event.
Definition: tcp-socket-base.h:1247
ns3::TcpSocketBase::SendEmptyPacket
virtual void SendEmptyPacket(uint8_t flags)
Send a empty packet that carries a flag, e.g., ACK.
Definition: tcp-socket-base.cc:2666
ns3::TypeId
a unique identifier for an interface.
Definition: type-id.h:59
ns3::TcpSocketBase::SetSynRetries
virtual void SetSynRetries(uint32_t count)
Set the number of connection retries before giving up.
Definition: tcp-socket-base.cc:3993
ns3::Ipv4Header
Packet header for IPv4.
Definition: ipv4-header.h:34
ns3::TcpSocketBase::SetTcp
virtual void SetTcp(Ptr< TcpL4Protocol > tcp)
Set the associated TCP L4 protocol.
Definition: tcp-socket-base.cc:481
ns3::TcpSocketBase::ForwardUp
void ForwardUp(Ptr< Packet > packet, Ipv4Header header, uint16_t port, Ptr< Ipv4Interface > incomingInterface)
Called by the L3 protocol when it received a packet to pass on to TCP.
Definition: tcp-socket-base.cc:1139
ns3::TcpSocketBase::m_ecnCWRSeq
TracedValue< SequenceNumber32 > m_ecnCWRSeq
Sequence number of the last sent CWR.
Definition: tcp-socket-base.h:1349
ns3::TcpSocketBase::AdvertisedWindowSize
virtual uint16_t AdvertisedWindowSize(bool scale=true) const
The amount of Rx window announced to the peer.
Definition: tcp-socket-base.cc:3394
ns3::TcpSocketBase::ForwardIcmp6
void ForwardIcmp6(Ipv6Address icmpSource, uint8_t icmpTtl, uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo)
Called by the L3 protocol when it received an ICMPv6 packet to pass on to TCP.
Definition: tcp-socket-base.cc:1231
ns3::TcpSocketBase::GetTxBuffer
Ptr< TcpTxBuffer > GetTxBuffer(void) const
Get a pointer to the Tx buffer.
Definition: tcp-socket-base.cc:4334
ns3::TcpSocketBase::AddSocketTags
void AddSocketTags(const Ptr< Packet > &p) const
Add Tags for the Socket.
Definition: tcp-socket-base.cc:2956
ns3::TcpSocketBase::m_sndWindShift
uint8_t m_sndWindShift
Window shift to apply to incoming segments.
Definition: tcp-socket-base.h:1313
ns3::TcpSocketBase::CheckEcnEct0
bool CheckEcnEct0(uint8_t tos) const
Checks for ECT(0) codepoint.
Definition: tcp-socket-base.h:517
ns3::TcpSocketBase::m_sendPendingDataEvent
EventId m_sendPendingDataEvent
micro-delay event to send pending data
Definition: tcp-socket-base.h:1317
ns3::EventId
An identifier for simulation events.
Definition: event-id.h:54
ns3::TcpSocketBase::SendRST
void SendRST(void)
Send reset and tear down this socket.
Definition: tcp-socket-base.cc:2794
ns3::TcpSocketBase::SetMinRto
void SetMinRto(Time minRto)
Sets the Minimum RTO.
Definition: tcp-socket-base.cc:4308
ns3::TcpSocketBase::UpdatePacingRate
void UpdatePacingRate(void)
Dynamically update the pacing rate.
Definition: tcp-socket-base.cc:4479
ns3::Socket::SocketErrno
SocketErrno
Enumeration of the possible errors returned by a socket.
Definition: socket.h:82
ns3::Callback
Callback template class.
Definition: callback.h:1279
ns3::TcpSocketBase::ShutdownSend
virtual int ShutdownSend(void)
Definition: tcp-socket-base.cc:774
ns3::TcpSocketBase::AddOptionSack
void AddOptionSack(TcpHeader &header)
Add the SACK option to the header.
Definition: tcp-socket-base.cc:4192
ns3::TcpSocketBase::UpdateCwndInfl
void UpdateCwndInfl(uint32_t oldValue, uint32_t newValue)
Callback function to hook to TcpSocketState inflated congestion window.
Definition: tcp-socket-base.cc:4365
ns3::TcpSocketBase::SetRcvBufSize
virtual void SetRcvBufSize(uint32_t size)
Set the receive buffer size.
Definition: tcp-socket-base.cc:3932
ns3::TcpSocketBase::SetupEndpoint6
int SetupEndpoint6(void)
Configure the endpoint v6 to a local address.
Definition: tcp-socket-base.cc:2856
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::TcpSocketBase::IsTcpOptionEnabled
bool IsTcpOptionEnabled(uint8_t kind) const
Return true if the specified option is enabled.
Definition: tcp-socket-base.cc:1529
ns3::RttHistory::RttHistory
RttHistory(SequenceNumber32 s, uint32_t c, Time t)
Constructor - builds an RttHistory with the given parameters.
Definition: tcp-socket-base.cc:4560
ns3::Ipv6EndPoint
A representation of an IPv6 endpoint/connection.
Definition: ipv6-end-point.h:51
ns3::TcpSocketBase::GetClockGranularity
Time GetClockGranularity(void) const
Get the Clock Granularity (used in RTO calcs).
Definition: tcp-socket-base.cc:4328
ns3::Socket::Recv
Ptr< Packet > Recv(void)
Read a single packet from the socket.
Definition: socket.cc:175
ns3::TcpSocketBase::~TcpSocketBase
virtual ~TcpSocketBase(void)
Definition: tcp-socket-base.cc:443
ns3::TcpSocketBase::m_delAckMaxCount
uint32_t m_delAckMaxCount
Number of packet to fire an ACK before delay timeout.
Definition: tcp-socket-base.h:1255
ns3::TcpSocketBase::ForwardIcmp
void ForwardIcmp(Ipv4Address icmpSource, uint8_t icmpTtl, uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo)
Called by the L3 protocol when it received an ICMP packet to pass on to TCP.
Definition: tcp-socket-base.cc:1217
ns3::TcpSocketBase::TcpTxRxTracedCallback
void(* TcpTxRxTracedCallback)(const Ptr< const Packet > packet, const TcpHeader &header, const Ptr< const TcpSocketBase > socket)
TracedCallback signature for tcp packet transmission or reception events.
Definition: tcp-socket-base.h:604
ns3::TcpSocketBase::m_node
Ptr< Node > m_node
the associated node
Definition: tcp-socket-base.h:1280
ns3::TcpSocketBase::DoConnect
int DoConnect(void)
Perform the real connection tasks: Send SYN if allowed, RST if invalid.
Definition: tcp-socket-base.cc:1023
ns3::TcpSocketBase::SetRecoveryAlgorithm
void SetRecoveryAlgorithm(Ptr< TcpRecoveryOps > recovery)
Install a recovery algorithm on this socket.
Definition: tcp-socket-base.cc:4425
ns3::TcpSocketBase::BytesInFlight
virtual uint32_t BytesInFlight(void) const
Return total bytes in flight.
Definition: tcp-socket-base.cc:3368
ns3::TcpSocketBase::PersistTimeout
virtual void PersistTimeout(void)
Send 1 byte probe to get an updated window size.
Definition: tcp-socket-base.cc:3797
ns3::TcpSocketBase::SetDataRetries
virtual void SetDataRetries(uint32_t retries)
Set the number of data transmission retries before giving up.
Definition: tcp-socket-base.cc:4006
ns3::TcpSocketBase::SetSegSize
virtual void SetSegSize(uint32_t size)
Set the segment size.
Definition: tcp-socket-base.cc:3964
ns3::TcpSocketBase::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition: tcp-socket-base.cc:73
ns3::TcpSocketBase::m_highTxMarkTrace
TracedCallback< SequenceNumber32, SequenceNumber32 > m_highTxMarkTrace
Callback pointer for high tx mark chaining.
Definition: tcp-socket-base.h:353
ns3::TcpSocketBase::SafeSubtraction
static uint32_t SafeSubtraction(uint32_t a, uint32_t b)
Performs a safe subtraction between a and b (a-b)
Definition: tcp-socket-base.cc:4438
ns3::TcpSocketBase::ProcessWait
void ProcessWait(Ptr< Packet > packet, const TcpHeader &tcpHeader)
Received a packet upon CLOSE_WAIT, FIN_WAIT_1, FIN_WAIT_2.
Definition: tcp-socket-base.cc:2417
ns3::TcpSocketBase::m_rcvWindShift
uint8_t m_rcvWindShift
Window shift to apply to outgoing segments.
Definition: tcp-socket-base.h:1312
ns3::TcpSocketBase::SetTcpNoDelay
virtual void SetTcpNoDelay(bool noDelay)
Enable/Disable Nagle's algorithm.
Definition: tcp-socket-base.cc:4046
ns3::TcpSocketBase::ShutdownRecv
virtual int ShutdownRecv(void)
Definition: tcp-socket-base.cc:808
ns3::TcpSocketState::TcpCongState_t
TcpCongState_t
Definition of the Congestion state machine.
Definition: tcp-socket-state.h:77
ns3::TcpSocketBase::m_ecnCESeq
TracedValue< SequenceNumber32 > m_ecnCESeq
Sequence number of the last received Congestion Experienced.
Definition: tcp-socket-base.h:1348
ns3::RttHistory::time
Time time
Time this one was sent.
Definition: tcp-socket-base.h:77
ns3::TcpSocketBase::m_closeOnEmpty
bool m_closeOnEmpty
Close socket upon tx buffer emptied.
Definition: tcp-socket-base.h:1294
ns3::TcpSocketBase::m_ecnEchoSeq
TracedValue< SequenceNumber32 > m_ecnEchoSeq
Sequence number of the last received ECN Echo.
Definition: tcp-socket-base.h:1347
ns3::TcpSocketBase::m_highRxMark
TracedValue< SequenceNumber32 > m_highRxMark
Highest seqno received.
Definition: tcp-socket-base.h:1306
ns3::TcpSocketBase::BindToNetDevice
virtual void BindToNetDevice(Ptr< NetDevice > netdevice)
Bind a socket to specific device.
Definition: tcp-socket-base.cc:978
ns3::TcpSocketBase::Close
virtual int Close(void)
Close a socket.
Definition: tcp-socket-base.cc:746
ns3::TcpSocketBase::DoForwardUp
virtual void DoForwardUp(Ptr< Packet > packet, const Address &fromAddress, const Address &toAddress)
Called by TcpSocketBase::ForwardUp{,6}().
Definition: tcp-socket-base.cc:1269
ns3::TcpSocketBase::ProcessSynRcvd
void ProcessSynRcvd(Ptr< Packet > packet, const TcpHeader &tcpHeader, const Address &fromAddress, const Address &toAddress)
Received a packet upon SYN_RCVD.
Definition: tcp-socket-base.cc:2306
ns3::TcpSocketBase::SetPaceInitialWindow
void SetPaceInitialWindow(bool paceWindow)
Enable or disable pacing of the initial window.
Definition: tcp-socket-base.cc:4533
ns3::TcpSocketBase::GetDelAckMaxCount
virtual uint32_t GetDelAckMaxCount(void) const
Get the number of packet to fire an ACK before delay timeout.
Definition: tcp-socket-base.cc:4040
ns3::Ipv4Address
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:41
ns3::Ipv6Address
Describes an IPv6 address.
Definition: ipv6-address.h:50
ns3::TcpSocketBase::AddOptions
void AddOptions(TcpHeader &tcpHeader)
Add options to TcpHeader.
Definition: tcp-socket-base.cc:4085
ns3::RttHistory::seq
SequenceNumber32 seq
First sequence number in packet sent.
Definition: tcp-socket-base.h:75
ns3::TcpSocketBase::MarkEcnEct1
uint8_t MarkEcnEct1(uint8_t tos) const
Mark ECT(1) codepoint.
Definition: tcp-socket-base.h:473
ns3::TcpSocketBase::m_retxEvent
EventId m_retxEvent
Retransmission event.
Definition: tcp-socket-base.h:1246
ns3::TcpSocketBase::m_shutdownSend
bool m_shutdownSend
Send no longer allowed.
Definition: tcp-socket-base.h:1295
ns3::TcpSocketBase::ReTxTimeout
virtual void ReTxTimeout(void)
An RTO event happened.
Definition: tcp-socket-base.cc:3626
ns3::TcpSocketBase::ProcessOptionTimestamp
void ProcessOptionTimestamp(const Ptr< const TcpOption > option, const SequenceNumber32 &seq)
Process the timestamp option from other side.
Definition: tcp-socket-base.cc:4221
ns3::TcpSocketBase::GetMinRto
Time GetMinRto(void) const
Get the Minimum RTO.
Definition: tcp-socket-base.cc:4315
ns3::TcpSocketBase::AvailableWindow
virtual uint32_t AvailableWindow(void) const
Return unfilled portion of window.
Definition: tcp-socket-base.cc:3386
ns3::TcpSocketState::EcnCodePoint_t
EcnCodePoint_t
ECN code points.
Definition: tcp-socket-state.h:123
ns3::TcpSocketBase::m_dupAckCount
uint32_t m_dupAckCount
Dupack counter.
Definition: tcp-socket-base.h:1253
ns3::TcpSocketBase::m_timestampToEcho
uint32_t m_timestampToEcho
Timestamp to echo.
Definition: tcp-socket-base.h:1315
ns3::TcpSocketBase::m_bytesInFlightTrace
TracedCallback< uint32_t, uint32_t > m_bytesInFlightTrace
Callback pointer for bytesInFlight trace chaining.
Definition: tcp-socket-base.h:363
ns3::TcpSocketBase::m_endPoint
Ipv4EndPoint * m_endPoint
the IPv4 endpoint
Definition: tcp-socket-base.h:1278
ns3::TcpSocketBase::GetErrno
virtual enum SocketErrno GetErrno(void) const
Get last error number.
Definition: tcp-socket-base.cc:495
ns3::TcpSocketBase
A base class for implementation of a stream socket using TCP.
Definition: tcp-socket-base.h:218
ns3::TcpSocketBase::m_recoveryOps
Ptr< TcpRecoveryOps > m_recoveryOps
Recovery Algorithm.
Definition: tcp-socket-base.h:1330
ns3::TcpSocketBase::m_tcb
Ptr< TcpSocketState > m_tcb
Congestion control information.
Definition: tcp-socket-base.h:1328
ns3::TcpSocketBase::SetupCallback
int SetupCallback(void)
Common part of the two Bind(), i.e.
Definition: tcp-socket-base.cc:997
ns3::Ipv6Header
Packet header for IPv6.
Definition: ipv6-header.h:36
ns3::TcpSocketBase::m_dataRetrCount
uint32_t m_dataRetrCount
Count of remaining data retransmission attempts.
Definition: tcp-socket-base.h:1263
ns3::TcpSocketBase::GetRWnd
uint32_t GetRWnd(void) const
Get the current value of the receiver's offered window (RCV.WND)
Definition: tcp-socket-base.cc:4547
ns3::RttHistory
Helper class to store RTT measurements.
Definition: tcp-socket-base.h:60
ns3::TcpSocketBase::UpdateCongState
void UpdateCongState(TcpSocketState::TcpCongState_t oldValue, TcpSocketState::TcpCongState_t newValue)
Callback function to hook to TcpSocketState congestion state.
Definition: tcp-socket-base.cc:4377
ns3::TcpSocketBase::ReadOptions
void ReadOptions(const TcpHeader &tcpHeader, uint32_t *bytesSacked)
Read TCP options before Ack processing.
Definition: tcp-socket-base.cc:1549
ns3::TcpSocketBase::ProcessOptionSackPermitted
void ProcessOptionSackPermitted(const Ptr< const TcpOption > option)
Read the SACK PERMITTED option.
Definition: tcp-socket-base.cc:4170
ns3::TcpSocketBase::Destroy
void Destroy(void)
Kill this socket by zeroing its attributes (IPv4)
Definition: tcp-socket-base.cc:2635
ns3::TcpSocketBase::m_shutdownRecv
bool m_shutdownRecv
Receive no longer allowed.
Definition: tcp-socket-base.h:1296
ns3::TcpSocketBase::m_noDelay
bool m_noDelay
Set to true to disable Nagle's algorithm.
Definition: tcp-socket-base.h:1258
ns3::Timer
A simple virtual Timer class.
Definition: timer.h:74
ns3::TcpSocketBase::m_maxWinSize
uint16_t m_maxWinSize
Maximum window size to advertise.
Definition: tcp-socket-base.h:1301
ns3::TcpSocketBase::UpdateEcnState
void UpdateEcnState(TcpSocketState::EcnState_t oldValue, TcpSocketState::EcnState_t newValue)
Callback function to hook to EcnState state.
Definition: tcp-socket-base.cc:4384
ns3::TcpSocketBase::m_advWnd
TracedValue< uint32_t > m_advWnd
Advertised Window size.
Definition: tcp-socket-base.h:1305
ns3::TcpSocketBase::RecvFrom
virtual Ptr< Packet > RecvFrom(uint32_t maxSize, uint32_t flags, Address &fromAddress)
Read a single packet from the socket and retrieve the sender address.
Definition: tcp-socket-base.cc:886
ns3::TcpSocketBase::GetDelAckTimeout
virtual Time GetDelAckTimeout(void) const
Get the time to delay an ACK.
Definition: tcp-socket-base.cc:4027
ns3::TcpSocketBase::UnAckDataCount
virtual uint32_t UnAckDataCount(void) const
Return count of number of unacked bytes.
Definition: tcp-socket-base.cc:3362
ns3::TcpSocketBase::GetInitialSSThresh
virtual uint32_t GetInitialSSThresh(void) const
Get the initial Slow Start Threshold.
Definition: tcp-socket-base.cc:630
ns3::Ptr< Node >
ns3::TcpSocketBase::m_tcp
Ptr< TcpL4Protocol > m_tcp
the associated TCP L4 protocol
Definition: tcp-socket-base.h:1281
ns3::DataRate
Class for representing data rates.
Definition: data-rate.h:89
ns3::TcpSocketBase::CheckEcnEct1
bool CheckEcnEct1(uint8_t tos) const
Checks for ECT(1) codepoint.
Definition: tcp-socket-base.h:528
ns3::TcpSocketBase::UpdateNextTxSequence
void UpdateNextTxSequence(SequenceNumber32 oldValue, SequenceNumber32 newValue)
Callback function to hook to TcpSocketState next tx sequence.
Definition: tcp-socket-base.cc:4391
ns3::TcpSocketBase::GetRetxThresh
uint32_t GetRetxThresh(void) const
Get the retransmission threshold (dup ack threshold for a fast retransmit)
Definition: tcp-socket-base.h:318
ns3::TcpSocketBase::DeallocateEndPoint
void DeallocateEndPoint(void)
Deallocate m_endPoint and m_endPoint6.
Definition: tcp-socket-base.cc:2804
ns3::RttHistory::retx
bool retx
True if this has been retransmitted.
Definition: tcp-socket-base.h:78
ns3::TcpSocketBase::DoClose
int DoClose(void)
Close a socket by sending RST, FIN, or FIN+ACK, depend on the current state.
Definition: tcp-socket-base.cc:1055
ns3::TcpCongStatesTracedValueCallback
void(* TcpCongStatesTracedValueCallback)(const TcpSocketState::TcpCongState_t oldValue, const TcpSocketState::TcpCongState_t newValue)
TracedValue Callback signature for TcpCongState_t.
Definition: tcp-socket-base.h:1359
ns3::TcpSocketBase::SendTo
virtual int SendTo(Ptr< Packet > p, uint32_t flags, const Address &toAddress)
Send data to a specified peer.
Definition: tcp-socket-base.cc:863
ns3::TcpSocketBase::m_bytesAckedNotProcessed
uint32_t m_bytesAckedNotProcessed
Bytes acked, but not processed.
Definition: tcp-socket-base.h:1302
ns3::TcpSocketBase::ProcessOptionWScale
void ProcessOptionWScale(const Ptr< const TcpOption > option)
Read and parse the Window scale option.
Definition: tcp-socket-base.cc:4096
ns3::TcpSocketBase::m_delAckTimeout
Time m_delAckTimeout
Time to delay an ACK.
Definition: tcp-socket-base.h:1270
ns3::TcpSocketBase::SetupEndpoint
int SetupEndpoint(void)
Configure the endpoint to a local address.
Definition: tcp-socket-base.cc:2826
ns3::Address
a polymophic address class
Definition: address.h:91
ns3::TcpSocketBase::m_delAckEvent
EventId m_delAckEvent
Delayed ACK timeout event.
Definition: tcp-socket-base.h:1248
ns3::TcpSocketBase::m_limitedTx
bool m_limitedTx
perform limited transmit
Definition: tcp-socket-base.h:1325
ns3::TcpSocketBase::ClearEcnBits
uint8_t ClearEcnBits(uint8_t tos) const
Clears ECN bits from TOS.
Definition: tcp-socket-base.h:495
ns3::TcpSocketBase::m_persistTimeout
Time m_persistTimeout
Time between sending 1-byte probes.
Definition: tcp-socket-base.h:1271
ns3::TcpSocketBase::GetNode
virtual Ptr< Node > GetNode(void) const
Return the node this socket is associated with.
Definition: tcp-socket-base.cc:509
ns3::TcpSocketBase::Connect
virtual int Connect(const Address &address)
Initiate a connection to a remote host.
Definition: tcp-socket-base.cc:652
ns3::TcpSocketBase::GetSndBufSize
virtual uint32_t GetSndBufSize(void) const
Get the send buffer size.
Definition: tcp-socket-base.cc:3926
ns3::TcpSocketBase::m_clockGranularity
Time m_clockGranularity
Clock Granularity used in RTO calcs.
Definition: tcp-socket-base.h:1269
ns3::TcpSocketBase::m_rateOps
Ptr< TcpRateOps > m_rateOps
Rate operations.
Definition: tcp-socket-base.h:1331
ns3::TcpSocketBase::m_lastRttTrace
TracedCallback< Time, Time > m_lastRttTrace
Callback pointer for RTT trace chaining.
Definition: tcp-socket-base.h:368
ns3::TcpSocket
(abstract) base class of all TcpSockets
Definition: tcp-socket.h:48
ns3::TcpSocketBase::GetRxBuffer
Ptr< TcpRxBuffer > GetRxBuffer(void) const
Get a pointer to the Rx buffer.
Definition: tcp-socket-base.cc:4340
ns3::TcpSocketBase::m_endPoint6
Ipv6EndPoint * m_endPoint6
the IPv6 endpoint
Definition: tcp-socket-base.h:1279
ns3::Time::Max
static Time Max()
Maximum representable Time Not to be confused with Max(Time,Time).
Definition: nstime.h:283
ns3::TcpSocketBase::m_dataRetries
uint32_t m_dataRetries
Number of data retransmission attempts.
Definition: tcp-socket-base.h:1264
ns3::TcpSocketBase::m_txBuffer
Ptr< TcpTxBuffer > m_txBuffer
Tx buffer.
Definition: tcp-socket-base.h:1288
ns3::TcpSocketBase::ReceivedAck
virtual void ReceivedAck(Ptr< Packet > packet, const TcpHeader &tcpHeader)
Received an ACK packet.
Definition: tcp-socket-base.cc:1766
ns3::Socket::SocketType
SocketType
Enumeration of the possible socket types.
Definition: socket.h:104
ns3::TcpSocketBase::GetDataRetries
virtual uint32_t GetDataRetries(void) const
Get the number of data transmission retries before giving up.
Definition: tcp-socket-base.cc:4013
ns3::TcpSocketBase::MarkEcnEct0
uint8_t MarkEcnEct0(uint8_t tos) const
Mark ECT(0) codepoint.
Definition: tcp-socket-base.h:462
ns3::TcpSocket::CLOSED
@ CLOSED
Socket is finished
Definition: tcp-socket.h:66
ns3::Socket::ERROR_NOTERROR
@ ERROR_NOTERROR
Definition: socket.h:83
ns3::EcnStatesTracedValueCallback
void(* EcnStatesTracedValueCallback)(const TcpSocketState::EcnState_t oldValue, const TcpSocketState::EcnState_t newValue)
TracedValue Callback signature for ECN state trace.
Definition: tcp-socket-base.h:1369
ns3::TcpSocketBase::SetDelAckTimeout
virtual void SetDelAckTimeout(Time timeout)
Set the time to delay an ACK.
Definition: tcp-socket-base.cc:4020
first.address
address
Definition: first.py:44
ns3::TcpSocketBase::OutOfRange
bool OutOfRange(SequenceNumber32 head, SequenceNumber32 tail) const
Check if a sequence number range is within the rx window.
Definition: tcp-socket-base.cc:1119
ns3::TcpSocketBase::m_nextTxSequenceTrace
TracedCallback< SequenceNumber32, SequenceNumber32 > m_nextTxSequenceTrace
Callback pointer for next tx sequence chaining.
Definition: tcp-socket-base.h:358
ns3::TcpSocketBase::SetNode
virtual void SetNode(Ptr< Node > node)
Set the associated node.
Definition: tcp-socket-base.cc:474
ns3::TcpSocketBase::ProcessEstablished
void ProcessEstablished(Ptr< Packet > packet, const TcpHeader &tcpHeader)
Received a packet upon ESTABLISHED state.
Definition: tcp-socket-base.cc:1451
ns3::TcpSocketBase::LastAckTimeout
virtual void LastAckTimeout(void)
Timeout at LAST_ACK, close the connection.
Definition: tcp-socket-base.cc:3771
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:104
ns3::TcpSocketBase::GetInitialCwnd
virtual uint32_t GetInitialCwnd(void) const
Get the initial Congestion Window.
Definition: tcp-socket-base.cc:645
ns3::TcpSocketBase::SendPendingData
uint32_t SendPendingData(bool withAck=false)
Send as much pending data as possible according to the Tx window.
Definition: tcp-socket-base.cc:3199
ns3::TcpHeader
Header for the Transmission Control Protocol.
Definition: tcp-header.h:45
ns3::TcpSocketBase::MarkEcnCodePoint
uint8_t MarkEcnCodePoint(const uint8_t tos, const TcpSocketState::EcnCodePoint_t codePoint) const
mark ECN code point
Definition: tcp-socket-base.h:551
ns3::TcpSocketBase::AddOptionSackPermitted
void AddOptionSackPermitted(TcpHeader &header)
Add the SACK PERMITTED option to the header.
Definition: tcp-socket-base.cc:4181
ns3::Timer::CANCEL_ON_DESTROY
@ CANCEL_ON_DESTROY
This policy cancels the event from the destructor of the Timer or from Suspend().
Definition: timer.h:93
ns3::TcpSocketBase::GetRcvBufSize
virtual uint32_t GetRcvBufSize(void) const
Get the receive buffer size.
Definition: tcp-socket-base.cc:3958
ns3::TcpSocketBase::CompleteFork
virtual void CompleteFork(Ptr< Packet > p, const TcpHeader &tcpHeader, const Address &fromAddress, const Address &toAddress)
Complete a connection by forking the socket.
Definition: tcp-socket-base.cc:2889
ns3::TcpSocketBase::EnterRecovery
void EnterRecovery(uint32_t currentDelivered)
Enter the CA_RECOVERY, and retransmit the head.
Definition: tcp-socket-base.cc:1601
ns3::TcpSocketBase::m_sackEnabled
bool m_sackEnabled
RFC SACK option enabled.
Definition: tcp-socket-base.h:1310
ns3::TcpSocketBase::CalculateWScale
uint8_t CalculateWScale() const
Calculate window scale value based on receive buffer space.
Definition: tcp-socket-base.cc:4117
ns3::TcpSocketState::EcnState_t
EcnState_t
Definition of the Ecn state machine.
Definition: tcp-socket-state.h:144
ns3::TcpSocketBase::GetSockName
virtual int GetSockName(Address &address) const
Get socket address.
Definition: tcp-socket-base.cc:927
ns3::TcpSocketBase::MarkEcnCe
uint8_t MarkEcnCe(uint8_t tos) const
Mark CE codepoint.
Definition: tcp-socket-base.h:484
ns3::TcpSocketBase::Listen
virtual int Listen(void)
Listen for incoming connections.
Definition: tcp-socket-base.cc:728
ns3::TcpSocketBase::GetTcpNoDelay
virtual bool GetTcpNoDelay(void) const
Check if Nagle's algorithm is enabled or not.
Definition: tcp-socket-base.cc:4053
ns3::TcpSocketBase::m_state
TracedValue< TcpStates_t > m_state
TCP state.
Definition: tcp-socket-base.h:1291
ns3::TcpGeneralTest
General infrastructure for TCP testing.
Definition: tcp-general-test.h:257
ns3::TcpSocketBase::SendDataPacket
virtual uint32_t SendDataPacket(SequenceNumber32 seq, uint32_t maxSize, bool withAck)
Extract at most maxSize bytes from the TxBuffer at sequence seq, add the TCP header,...
Definition: tcp-socket-base.cc:3038
ns3::TcpSocketBase::SetInitialCwnd
virtual void SetInitialCwnd(uint32_t cwnd)
Set the initial Congestion Window.
Definition: tcp-socket-base.cc:636
ns3::TcpSocketBase::GetInstanceTypeId
virtual TypeId GetInstanceTypeId() const
Get the instance TypeId.
Definition: tcp-socket-base.cc:245
ns3::TcpSocketBase::SetSndBufSize
virtual void SetSndBufSize(uint32_t size)
Set the send buffer size.
Definition: tcp-socket-base.cc:3919
ns3::TcpSocketBase::m_rxTrace
TracedCallback< Ptr< const Packet >, const TcpHeader &, Ptr< const TcpSocketBase > > m_rxTrace
Trace of received packets.
Definition: tcp-socket-base.h:1341
ns3::TcpSocketBase::m_rtt
Ptr< RttEstimator > m_rtt
Round trip time estimator.
Definition: tcp-socket-base.h:1285
ns3::TcpSocketBase::IsPacingEnabled
bool IsPacingEnabled(void) const
Return true if packets in the current window should be paced.
Definition: tcp-socket-base.cc:4457
ns3::TcpSocketBase::SetInitialSSThresh
virtual void SetInitialSSThresh(uint32_t threshold)
Set the initial Slow Start Threshold.
Definition: tcp-socket-base.cc:621
ns3::TcpSocketBase::GetSynRetries
virtual uint32_t GetSynRetries(void) const
Get the number of connection retries before giving up.
Definition: tcp-socket-base.cc:4000
ns3::TcpSocketBase::m_minRto
Time m_minRto
minimum value of the Retransmit timeout
Definition: tcp-socket-base.h:1268
ns3::TcpSocketBase::UpdateBytesInFlight
void UpdateBytesInFlight(uint32_t oldValue, uint32_t newValue)
Callback function to hook to TcpSocketState bytes inflight.
Definition: tcp-socket-base.cc:4405
ns3::TcpSocketBase::m_recover
SequenceNumber32 m_recover
Previous highest Tx seqnum for fast recovery (set it to initial seq number)
Definition: tcp-socket-base.h:1320
ns3::TcpSocketBase::SetAllowBroadcast
virtual bool SetAllowBroadcast(bool allowBroadcast)
Configure whether broadcast datagram transmissions are allowed.
Definition: tcp-socket-base.cc:4072
ns3::TcpSocketBase::UpdateRtt
void UpdateRtt(Time oldValue, Time newValue)
Callback function to hook to TcpSocketState rtt.
Definition: tcp-socket-base.cc:4411
ns3::TcpSocketBase::ForwardUp6
void ForwardUp6(Ptr< Packet > packet, Ipv6Header header, uint16_t port, Ptr< Ipv6Interface > incomingInterface)
Called by the L3 protocol when it received a packet to pass on to TCP.
Definition: tcp-socket-base.cc:1178
ns3::TcpSocketBase::m_congestionControl
Ptr< TcpCongestionOps > m_congestionControl
Congestion control.
Definition: tcp-socket-base.h:1329
ns3::TcpSocketBase::SetPacingStatus
void SetPacingStatus(bool pacing)
Enable or disable pacing.
Definition: tcp-socket-base.cc:4526
ns3::TcpSocketBase::m_msl
double m_msl
Max segment lifetime.
Definition: tcp-socket-base.h:1298
ns3::TcpSocketState::UseEcn_t
UseEcn_t
Parameter value related to ECN enable/disable functionality similar to sysctl for tcp_ecn.
Definition: tcp-socket-state.h:113
timeout
ns3::Time timeout
Definition: openflow-switch.cc:52
ns3::TcpSocketBase::UpdateWindowSize
void UpdateWindowSize(const TcpHeader &header)
Update the receiver window (RWND) based on the value of the window field in the header.
Definition: tcp-socket-base.cc:4263
ns3::TcpSocketBase::m_cWndInflTrace
TracedCallback< uint32_t, uint32_t > m_cWndInflTrace
Callback pointer for cWndInfl trace chaining.
Definition: tcp-socket-base.h:333
ns3::TcpSocketBase::ConnectionSucceeded
void ConnectionSucceeded(void)
Schedule-friendly wrapper for Socket::NotifyConnectionSucceeded()
Definition: tcp-socket-base.cc:2942
ns3::TcpSocketBase::SetDelAckMaxCount
virtual void SetDelAckMaxCount(uint32_t count)
Set the number of packet to fire an ACK before delay timeout.
Definition: tcp-socket-base.cc:4033
ns3::RttHistory::count
uint32_t count
Number of bytes sent.
Definition: tcp-socket-base.h:76
ns3::TcpSocketBase::m_delAckCount
uint32_t m_delAckCount
Delayed ACK counter.
Definition: tcp-socket-base.h:1254
ns3::TcpSocketBase::DoPeerClose
void DoPeerClose(void)
FIN is in sequence, notify app and respond with a FIN.
Definition: tcp-socket-base.cc:2594
ns3::TcpSocketBase::CheckNoEcn
bool CheckNoEcn(uint8_t tos) const
Checks if TOS has no ECN codepoints.
Definition: tcp-socket-base.h:506
ns3::TcpSocketBase::m_highRxAckMark
TracedValue< SequenceNumber32 > m_highRxAckMark
Highest ack received.
Definition: tcp-socket-base.h:1307
ns3::TcpSocketBase::GetPersistTimeout
virtual Time GetPersistTimeout(void) const
Get the timeout for persistent connection.
Definition: tcp-socket-base.cc:4066
ns3::TcpSocketBase::UpdateHighTxMark
void UpdateHighTxMark(SequenceNumber32 oldValue, SequenceNumber32 newValue)
Callback function to hook to TcpSocketState high tx mark.
Definition: tcp-socket-base.cc:4399
ns3::Seconds
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1289
ns3::TcpSocketBase::DoRetransmit
void DoRetransmit(void)
Retransmit the first segment marked as lost, without considering available window nor pacing.
Definition: tcp-socket-base.cc:3849
ns3::TracedValue< Time >
ns3::TcpSocketBase::m_synCount
uint32_t m_synCount
Count of remaining connection retries.
Definition: tcp-socket-base.h:1261
ns3::TcpSocketBase::m_history
std::deque< RttHistory > m_history
List of sent packet.
Definition: tcp-socket-base.h:1275
ns3::TcpSocketBase::m_rto
TracedValue< Time > m_rto
Retransmit timeout.
Definition: tcp-socket-base.h:1267
ns3::TcpSocketBase::SetConnTimeout
virtual void SetConnTimeout(Time timeout)
Set the connection timeout.
Definition: tcp-socket-base.cc:3980
ns3::TcpSocketBase::GetHighRxAck
SequenceNumber32 GetHighRxAck(void) const
Get the current value of the receiver's highest (in-sequence) sequence number acked.
Definition: tcp-socket-base.cc:4553
ns3::TcpSocketBase::ProcessListen
void ProcessListen(Ptr< Packet > packet, const TcpHeader &tcpHeader, const Address &fromAddress, const Address &toAddress)
Received a packet upon LISTEN state.
Definition: tcp-socket-base.cc:2182
ns3::TcpSocketBase::UpdateSsThresh
void UpdateSsThresh(uint32_t oldValue, uint32_t newValue)
Callback function to hook to TcpSocketState slow start threshold.
Definition: tcp-socket-base.cc:4371
ns3::TcpSocketBase::SetCongestionControlAlgorithm
void SetCongestionControlAlgorithm(Ptr< TcpCongestionOps > algo)
Install a congestion control algorithm on this socket.
Definition: tcp-socket-base.cc:4417
ns3::TcpSocketBase::ProcessClosing
void ProcessClosing(Ptr< Packet > packet, const TcpHeader &tcpHeader)
Received a packet upon CLOSING.
Definition: tcp-socket-base.cc:2489
ns3::TcpSocketBase::m_closeNotified
bool m_closeNotified
Told app to close socket.
Definition: tcp-socket-base.h:1293
ns3::TcpSocketBase::m_ecnStateTrace
TracedCallback< TcpSocketState::EcnState_t, TcpSocketState::EcnState_t > m_ecnStateTrace
Callback pointer for ECN state trace chaining.
Definition: tcp-socket-base.h:348
ns3::TcpSocketBase::ProcessOptionSack
uint32_t ProcessOptionSack(const Ptr< const TcpOption > option)
Read the SACK option.
Definition: tcp-socket-base.cc:4161
ns3::TcpSocketBase::m_isFirstPartialAck
bool m_isFirstPartialAck
First partial ACK during RECOVERY.
Definition: tcp-socket-base.h:1334
ns3::TcpSocketBase::Destroy6
void Destroy6(void)
Kill this socket by zeroing its attributes (IPv6)
Definition: tcp-socket-base.cc:2651
ns3::TcpSocketBase::m_congStateTrace
TracedCallback< TcpSocketState::TcpCongState_t, TcpSocketState::TcpCongState_t > m_congStateTrace
Callback pointer for congestion state trace chaining.
Definition: tcp-socket-base.h:343
ns3::TcpSocketBase::GetRxAvailable
virtual uint32_t GetRxAvailable(void) const
Return number of bytes which can be returned from one or multiple calls to Recv.
Definition: tcp-socket-base.cc:919
ns3::TcpSocketBase::m_persistEvent
EventId m_persistEvent
Persist event: Send 1 byte to probe for a non-zero Rx window.
Definition: tcp-socket-base.h:1249
ns3::TcpSocketBase::SetUseEcn
void SetUseEcn(TcpSocketState::UseEcn_t useEcn)
Set ECN mode of use on the socket.
Definition: tcp-socket-base.cc:4540
ns3::TcpSocketBase::UpdatePacingRateTrace
void UpdatePacingRateTrace(DataRate oldValue, DataRate newValue)
Callback function to hook to TcpSocketState pacing rate.
Definition: tcp-socket-base.cc:4353
ns3::TcpSocketBase::UpdateRttHistory
virtual void UpdateRttHistory(const SequenceNumber32 &seq, uint32_t sz, bool isRetransmission)
Update the RTT history, when we send TCP segments.
Definition: tcp-socket-base.cc:3173
ns3::TcpSocketBase::m_txTrace
TracedCallback< Ptr< const Packet >, const TcpHeader &, Ptr< const TcpSocketBase > > m_txTrace
Trace of transmitted packets.
Definition: tcp-socket-base.h:1338
ns3::TcpSocketBase::TcpSocketBase
TcpSocketBase(void)
Create an unbound TCP socket.
Definition: tcp-socket-base.cc:250
ns3::TcpSocketBase::DupAck
void DupAck(uint32_t currentDelivered)
Dupack management.
Definition: tcp-socket-base.cc:1659
ns3::TcpSocketBase::m_timestampEnabled
bool m_timestampEnabled
Timestamp option enabled.
Definition: tcp-socket-base.h:1314
ns3::TcpSocketBase::DelAckTimeout
virtual void DelAckTimeout(void)
Action upon delay ACK timeout, i.e.
Definition: tcp-socket-base.cc:3755
ns3::TcpSocketBase::m_winScalingEnabled
bool m_winScalingEnabled
Window Scale option enabled (RFC 7323)
Definition: tcp-socket-base.h:1311
ns3::TcpSocketBase::Bind6
virtual int Bind6(void)
Allocate a local IPv6 endpoint for this socket.
Definition: tcp-socket-base.cc:532
ns3::TcpSocketBase::GetSocketType
virtual enum SocketType GetSocketType(void) const
Definition: tcp-socket-base.cc:502
ns3::TcpSocketBase::ReceivedData
virtual void ReceivedData(Ptr< Packet > packet, const TcpHeader &tcpHeader)
Recv of a data, put into buffer, call L7 to get it if necessary.
Definition: tcp-socket-base.cc:3433
ns3::TcpSocketBase::SetClockGranularity
void SetClockGranularity(Time clockGranularity)
Sets the Clock Granularity (used in RTO calcs).
Definition: tcp-socket-base.cc:4321
ns3::TracedCallback
Forward calls to a chain of Callback.
Definition: traced-callback.h:53
ns3::TcpSocketBase::m_pacingTimer
Timer m_pacingTimer
Pacing Event.
Definition: tcp-socket-base.h:1344
ns3::TcpSocketBase::SetRtt
virtual void SetRtt(Ptr< RttEstimator > rtt)
Set the associated RTT estimator.
Definition: tcp-socket-base.cc:488
ns3::TcpSocketBase::m_retxThresh
uint32_t m_retxThresh
Fast Retransmit threshold.
Definition: tcp-socket-base.h:1324
ns3::TcpSocketBase::ProcessAck
virtual void ProcessAck(const SequenceNumber32 &ackNumber, bool scoreboardUpdated, uint32_t currentDelivered, const SequenceNumber32 &oldHeadSequence)
Process a received ack.
Definition: tcp-socket-base.cc:1882
ns3::TcpSocketBase::AddOptionWScale
void AddOptionWScale(TcpHeader &header)
Add the window scale option to the header.
Definition: tcp-socket-base.cc:4141
ns3::TcpSocketBase::GetTxAvailable
virtual uint32_t GetTxAvailable(void) const
Returns the number of bytes which can be sent in a single call to Send.
Definition: tcp-socket-base.cc:911
ns3::TcpSocketBase::EstimateRtt
virtual void EstimateRtt(const TcpHeader &tcpHeader)
Take into account the packet for RTT estimation.
Definition: tcp-socket-base.cc:3525
ns3::TcpSocketBase::ProcessSynSent
void ProcessSynSent(Ptr< Packet > packet, const TcpHeader &tcpHeader)
Received a packet upon SYN_SENT.
Definition: tcp-socket-base.cc:2212
ns3::TcpSocketBase::CloseAndNotify
void CloseAndNotify(void)
Peacefully close the socket by notifying the upper layer and deallocate end point.
Definition: tcp-socket-base.cc:1097
ns3::TcpSocketBase::GetSegSize
virtual uint32_t GetSegSize(void) const
Get the segment size.
Definition: tcp-socket-base.cc:3974
ns3::TcpSocketBase::m_cWndTrace
TracedCallback< uint32_t, uint32_t > m_cWndTrace
Callback pointer for cWnd trace chaining.
Definition: tcp-socket-base.h:328
ns3::TcpSocketBase::TimeWait
void TimeWait(void)
Move from CLOSING or FIN_WAIT_2 to TIME_WAIT state.
Definition: tcp-socket-base.cc:3897
ns3::TcpSocketBase::GetAllowBroadcast
virtual bool GetAllowBroadcast(void) const
Query whether broadcast datagram transmissions are allowed.
Definition: tcp-socket-base.cc:4079
ns3::TcpSocketBase::m_synRetries
uint32_t m_synRetries
Number of connection attempts.
Definition: tcp-socket-base.h:1262
ns3::TcpSocketBase::m_pacingRateTrace
TracedCallback< DataRate, DataRate > m_pacingRateTrace
Callback pointer for pacing rate trace chaining.
Definition: tcp-socket-base.h:323
ns3::TcpSocketBase::GetPeerName
virtual int GetPeerName(Address &address) const
Get the peer address of a connected socket.
Definition: tcp-socket-base.cc:948
ns3::TcpSocketBase::m_cnTimeout
Time m_cnTimeout
Timeout for connection retry.
Definition: tcp-socket-base.h:1272
ns3::TcpSocketBase::NotifyPacingPerformed
void NotifyPacingPerformed(void)
Notify Pacing.
Definition: tcp-socket-base.cc:4449
ns3::SequenceNumber< uint32_t, int32_t >
ns3::TcpSocketBase::SetPersistTimeout
virtual void SetPersistTimeout(Time timeout)
Set the timeout for persistent connection.
Definition: tcp-socket-base.cc:4059
ns3::TcpSocketBase::GetConnTimeout
virtual Time GetConnTimeout(void) const
Get the connection timeout.
Definition: tcp-socket-base.cc:3987
ns3::TcpSocketBase::m_icmpCallback6
Callback< void, Ipv6Address, uint8_t, uint8_t, uint8_t, uint32_t > m_icmpCallback6
ICMPv6 callback.
Definition: tcp-socket-base.h:1283
ns3::TcpSocketBase::Bind
virtual int Bind(void)
Allocate a local IPv4 endpoint for this socket.
Definition: tcp-socket-base.cc:516
ns3::TcpSocketBase::ProcessLastAck
void ProcessLastAck(Ptr< Packet > packet, const TcpHeader &tcpHeader)
Received a packet upon LAST_ACK.
Definition: tcp-socket-base.cc:2521
ns3::TcpSocketBase::CancelAllTimers
void CancelAllTimers(void)
Cancel all timer when endpoint is deleted.
Definition: tcp-socket-base.cc:3884
ns3::Ipv4EndPoint
A representation of an internet endpoint/connection.
Definition: ipv4-end-point.h:49
ns3::TcpSocketBase::Send
virtual int Send(Ptr< Packet > p, uint32_t flags)
Send data (or dummy data) to the remote host.
Definition: tcp-socket-base.cc:818
ns3::TcpSocketBase::IsValidTcpSegment
bool IsValidTcpSegment(const SequenceNumber32 seq, const uint32_t tcpHeaderSize, const uint32_t tcpPayloadSize)
Checks whether the given TCP segment is valid or not.
Definition: tcp-socket-base.cc:1245
ns3::TcpSocketBase::EnterCwr
void EnterCwr(uint32_t currentDelivered)
Enter CA_CWR state upon receipt of an ECN Echo.
Definition: tcp-socket-base.cc:1574
ns3::TcpSocketBase::m_icmpCallback
Callback< void, Ipv4Address, uint8_t, uint8_t, uint8_t, uint32_t > m_icmpCallback
ICMP callback.
Definition: tcp-socket-base.h:1282
ns3::TcpSocketBase::PeerClose
void PeerClose(Ptr< Packet > p, const TcpHeader &tcpHeader)
Received a FIN from peer, notify rx buffer.
Definition: tcp-socket-base.cc:2557
ns3::TcpSocketBase::Fork
virtual Ptr< TcpSocketBase > Fork(void)
Call CopyObject<> to clone me.
Definition: tcp-socket-base.cc:4432
ns3::TcpSocketBase::NewAck
virtual void NewAck(SequenceNumber32 const &seq, bool resetRTO)
Update buffers w.r.t.
Definition: tcp-socket-base.cc:3582
ns3::TcpSocketBase::CheckEcnCe
bool CheckEcnCe(uint8_t tos) const
Checks for CE codepoint.
Definition: tcp-socket-base.h:539
ns3::TcpSocketBase::m_highTxAck
SequenceNumber32 m_highTxAck
Highest ack sent.
Definition: tcp-socket-base.h:1303
ns3::TcpSocketBase::m_ssThTrace
TracedCallback< uint32_t, uint32_t > m_ssThTrace
Callback pointer for ssTh trace chaining.
Definition: tcp-socket-base.h:338
port
uint16_t port
Definition: dsdv-manet.cc:45
ns3::TcpSocketBase::m_rWnd
TracedValue< uint32_t > m_rWnd
Receiver window (RCV.WND in RFC793)
Definition: tcp-socket-base.h:1304
ns3::TcpSocketBase::m_recoverActive
bool m_recoverActive
Whether "m_recover" has been set/activated It is used to avoid comparing with the old m_recover value...
Definition: tcp-socket-base.h:1321
ns3::TcpSocketBase::UpdateCwnd
void UpdateCwnd(uint32_t oldValue, uint32_t newValue)
Callback function to hook to TcpSocketState congestion window.
Definition: tcp-socket-base.cc:4359
ns3::TcpSocketBase::m_timewaitEvent
EventId m_timewaitEvent
TIME_WAIT expiration event: Move this socket to CLOSED state.
Definition: tcp-socket-base.h:1250
ns3::TcpSocketBase::m_connected
bool m_connected
Connection established.
Definition: tcp-socket-base.h:1297