ns3::TcpL4Protocol Class Reference
[Tcp]

A layer between the sockets interface and IP. More...

#include <tcp-l4-protocol.h>

Inheritance diagram for ns3::TcpL4Protocol:
Inheritance graph
[legend]
Collaboration diagram for ns3::TcpL4Protocol:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 TcpL4Protocol ()
 Constructor.
virtual ~TcpL4Protocol ()
void SetNode (Ptr< Node > node)
virtual int GetProtocolNumber (void) const
Ptr< SocketCreateSocket (void)
Ipv4EndPointAllocate (void)
Ipv4EndPointAllocate (Ipv4Address address)
Ipv4EndPointAllocate (uint16_t port)
Ipv4EndPointAllocate (Ipv4Address address, uint16_t port)
Ipv4EndPointAllocate (Ipv4Address localAddress, uint16_t localPort, Ipv4Address peerAddress, uint16_t peerPort)
void DeAllocate (Ipv4EndPoint *endPoint)
void Send (Ptr< Packet > packet, Ipv4Address saddr, Ipv4Address daddr, uint16_t sport, uint16_t dport)
 Send a packet via TCP.
virtual enum
Ipv4L4Protocol::RxStatus 
Receive (Ptr< Packet > p, Ipv4Address const &source, Ipv4Address const &destination, Ptr< Ipv4Interface > incomingInterface)
 Recieve a packet up the protocol stack.

Static Public Member Functions

static TypeId GetTypeId (void)
 This method returns the TypeId associated to ns3::TcpL4Protocol.

Static Public Attributes

static const uint8_t PROT_NUMBER = 6

Protected Member Functions

virtual void DoDispose (void)

Private Member Functions

void SendPacket (Ptr< Packet >, TcpHeader, Ipv4Address, Ipv4Address)

Static Private Member Functions

static ObjectFactory GetDefaultRttEstimatorFactory (void)

Private Attributes

Ptr< Nodem_node
Ipv4EndPointDemuxm_endPoints
ObjectFactory m_rttFactory
bool m_goodChecksum
bool m_calcChecksum

Friends

class TcpSocketImpl

Detailed Description

A layer between the sockets interface and IP.

This class allocates "endpoint" objects (ns3::Ipv4EndPoint) for TCP, and SHOULD checksum packets its receives from the socket layer going down the stack , but currently checksumming is disabled. It also recieves packets from IP, and forwards them up to the endpoints.

Definition at line 53 of file tcp-l4-protocol.h.


Constructor & Destructor Documentation

ns3::TcpL4Protocol::TcpL4Protocol (  ) 

Constructor.

Definition at line 341 of file tcp-l4-protocol.cc.

References NS_LOG_FUNCTION_NOARGS, and NS_LOG_LOGIC.

ns3::TcpL4Protocol::~TcpL4Protocol (  )  [virtual]

Definition at line 348 of file tcp-l4-protocol.cc.

References NS_LOG_FUNCTION_NOARGS.


Member Function Documentation

Ipv4EndPoint * ns3::TcpL4Protocol::Allocate ( Ipv4Address  localAddress,
uint16_t  localPort,
Ipv4Address  peerAddress,
uint16_t  peerPort 
)
Ipv4EndPoint * ns3::TcpL4Protocol::Allocate ( Ipv4Address  address,
uint16_t  port 
)
Ipv4EndPoint * ns3::TcpL4Protocol::Allocate ( uint16_t  port  ) 
Ipv4EndPoint * ns3::TcpL4Protocol::Allocate ( Ipv4Address  address  ) 
Ipv4EndPoint * ns3::TcpL4Protocol::Allocate ( void   ) 
Ptr< Socket > ns3::TcpL4Protocol::CreateSocket ( void   ) 
Returns:
A smart Socket pointer to a TcpSocketImpl, allocated by this instance of the TCP protocol

Definition at line 379 of file tcp-l4-protocol.cc.

References ns3::ObjectFactory::Create(), m_node, m_rttFactory, and NS_LOG_FUNCTION_NOARGS.

void ns3::TcpL4Protocol::DeAllocate ( Ipv4EndPoint endPoint  ) 
void ns3::TcpL4Protocol::DoDispose ( void   )  [protected, virtual]

This method is called by Object::Dispose or by the object's destructor, whichever comes first.

Subclasses are expected to implement their real destruction code in an overriden version of this method and chain up to their parent's implementation once they are done. i.e., for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose method.

Reimplemented from ns3::Object.

Definition at line 366 of file tcp-l4-protocol.cc.

References m_endPoints, m_node, and NS_LOG_FUNCTION_NOARGS.

ObjectFactory ns3::TcpL4Protocol::GetDefaultRttEstimatorFactory ( void   )  [static, private]

Definition at line 315 of file tcp-l4-protocol.cc.

References ns3::RttMeanDeviation::GetTypeId(), and ns3::ObjectFactory::SetTypeId().

Referenced by GetTypeId().

int ns3::TcpL4Protocol::GetProtocolNumber ( void   )  const [virtual]
Returns:
the protocol number of this protocol.

Implements ns3::Ipv4L4Protocol.

Definition at line 360 of file tcp-l4-protocol.cc.

References PROT_NUMBER.

TypeId ns3::TcpL4Protocol::GetTypeId ( void   )  [static]

This method returns the TypeId associated to ns3::TcpL4Protocol.

Attributes defined for this type:

  • RttEstimatorFactory: How RttEstimator objects are created.
  • CalcChecksum: If true, we calculate the checksum of outgoing packets and verify the checksum of incoming packets.
    • Set with class: BooleanValue
    • Underlying type: bool
    • Initial value: false
    • Flags: construct write read

Attributes defined in parent class ns3::Ipv4L4Protocol:

  • ProtocolNumber: The Ipv4 protocol number.

No TraceSources defined for this type.

Reimplemented from ns3::Ipv4L4Protocol.

Definition at line 323 of file tcp-l4-protocol.cc.

References GetDefaultRttEstimatorFactory(), m_calcChecksum, m_rttFactory, and ns3::TypeId::SetParent().

enum Ipv4L4Protocol::RxStatus ns3::TcpL4Protocol::Receive ( Ptr< Packet p,
Ipv4Address const &  source,
Ipv4Address const &  destination,
Ptr< Ipv4Interface incomingInterface 
) [virtual]
void ns3::TcpL4Protocol::Send ( Ptr< Packet packet,
Ipv4Address  saddr,
Ipv4Address  daddr,
uint16_t  sport,
uint16_t  dport 
)

Send a packet via TCP.

Parameters:
packet The packet to send
saddr The source Ipv4Address
daddr The destination Ipv4Address
sport The source port number
dport The destination port number

Definition at line 486 of file tcp-l4-protocol.cc.

References ns3::TcpHeader::ACK, ns3::TcpHeader::EnableChecksums(), ns3::TcpHeader::InitializeChecksum(), m_calcChecksum, m_node, NS_LOG_FUNCTION, PROT_NUMBER, ns3::TcpHeader::SetAckNumber(), ns3::TcpHeader::SetDestinationPort(), ns3::TcpHeader::SetFlags(), and ns3::TcpHeader::SetSourcePort().

void ns3::TcpL4Protocol::SendPacket ( Ptr< Packet packet,
TcpHeader  outgoingHeader,
Ipv4Address  saddr,
Ipv4Address  daddr 
) [private]
void ns3::TcpL4Protocol::SetNode ( Ptr< Node node  ) 

Definition at line 354 of file tcp-l4-protocol.cc.

References m_node.


Friends And Related Function Documentation

friend class TcpSocketImpl [friend]

Definition at line 116 of file tcp-l4-protocol.h.


Member Data Documentation

Definition at line 122 of file tcp-l4-protocol.h.

Referenced by GetTypeId(), Receive(), Send(), and SendPacket().

Definition at line 113 of file tcp-l4-protocol.h.

Referenced by Allocate(), DeAllocate(), DoDispose(), and Receive().

Definition at line 121 of file tcp-l4-protocol.h.

Definition at line 112 of file tcp-l4-protocol.h.

Referenced by CreateSocket(), DoDispose(), Send(), SendPacket(), and SetNode().

Definition at line 114 of file tcp-l4-protocol.h.

Referenced by CreateSocket(), and GetTypeId().

const uint8_t ns3::TcpL4Protocol::PROT_NUMBER = 6 [static]

Definition at line 56 of file tcp-l4-protocol.h.

Referenced by GetProtocolNumber(), Receive(), Send(), and SendPacket().


The documentation for this class was generated from the following files:
Generated on Thu Dec 3 14:11:48 2009 for NS-3 by  doxygen 1.6.3