A layer between the sockets interface and IP. More...
#include <tcp-l4-protocol.h>
Public Member Functions | |
TcpL4Protocol () | |
Constructor. | |
virtual | ~TcpL4Protocol () |
void | SetNode (Ptr< Node > node) |
virtual int | GetProtocolNumber (void) const |
Ptr< Socket > | CreateSocket (void) |
Ipv4EndPoint * | Allocate (void) |
Ipv4EndPoint * | Allocate (Ipv4Address address) |
Ipv4EndPoint * | Allocate (uint16_t port) |
Ipv4EndPoint * | Allocate (Ipv4Address address, uint16_t port) |
Ipv4EndPoint * | Allocate (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< Node > | m_node |
Ipv4EndPointDemux * | m_endPoints |
ObjectFactory | m_rttFactory |
bool | m_goodChecksum |
bool | m_calcChecksum |
Friends | |
class | TcpSocketImpl |
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.
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.
Ipv4EndPoint * ns3::TcpL4Protocol::Allocate | ( | Ipv4Address | localAddress, | |
uint16_t | localPort, | |||
Ipv4Address | peerAddress, | |||
uint16_t | peerPort | |||
) |
Definition at line 419 of file tcp-l4-protocol.cc.
References ns3::Ipv4EndPointDemux::Allocate(), m_endPoints, and NS_LOG_FUNCTION.
Ipv4EndPoint * ns3::TcpL4Protocol::Allocate | ( | Ipv4Address | address, | |
uint16_t | port | |||
) |
Definition at line 412 of file tcp-l4-protocol.cc.
References ns3::Ipv4EndPointDemux::Allocate(), m_endPoints, and NS_LOG_FUNCTION.
Ipv4EndPoint * ns3::TcpL4Protocol::Allocate | ( | uint16_t | port | ) |
Definition at line 405 of file tcp-l4-protocol.cc.
References ns3::Ipv4EndPointDemux::Allocate(), m_endPoints, and NS_LOG_FUNCTION.
Ipv4EndPoint * ns3::TcpL4Protocol::Allocate | ( | Ipv4Address | address | ) |
Definition at line 398 of file tcp-l4-protocol.cc.
References ns3::Ipv4EndPointDemux::Allocate(), m_endPoints, and NS_LOG_FUNCTION.
Ipv4EndPoint * ns3::TcpL4Protocol::Allocate | ( | void | ) |
Definition at line 391 of file tcp-l4-protocol.cc.
References ns3::Ipv4EndPointDemux::Allocate(), m_endPoints, and NS_LOG_FUNCTION_NOARGS.
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 | ) |
Definition at line 428 of file tcp-l4-protocol.cc.
References ns3::Ipv4EndPointDemux::DeAllocate(), m_endPoints, and NS_LOG_FUNCTION.
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] |
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:
Attributes defined in parent class ns3::Ipv4L4Protocol:
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] |
Recieve a packet up the protocol stack.
p | The Packet to dump the contents into | |
source | The source's Ipv4Address | |
destination | The destinations Ipv4Address | |
incomingInterface | The Ipv4Interface it was received on |
Implements ns3::Ipv4L4Protocol.
Definition at line 435 of file tcp-l4-protocol.cc.
References ns3::TcpHeader::EnableChecksums(), ns3::TcpHeader::GetAckNumber(), ns3::TcpHeader::GetDestinationPort(), ns3::TcpHeader::GetFlags(), ns3::TcpHeader::GetSequenceNumber(), ns3::TcpHeader::GetSourcePort(), ns3::TcpHeader::InitializeChecksum(), ns3::TcpHeader::IsChecksumOk(), ns3::Ipv4EndPointDemux::Lookup(), m_calcChecksum, m_endPoints, NS_ASSERT_MSG, NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC, ns3::Ipv4Address::Print(), PROT_NUMBER, ns3::Ipv4L4Protocol::RX_CSUM_FAILED, ns3::Ipv4L4Protocol::RX_ENDPOINT_UNREACH, and ns3::Ipv4L4Protocol::RX_OK.
void ns3::TcpL4Protocol::Send | ( | Ptr< Packet > | packet, | |
Ipv4Address | saddr, | |||
Ipv4Address | daddr, | |||
uint16_t | sport, | |||
uint16_t | dport | |||
) |
Send a packet via TCP.
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] |
Definition at line 516 of file tcp-l4-protocol.cc.
References ns3::TcpHeader::EnableChecksums(), ns3::TcpHeader::GetAckNumber(), ns3::TcpHeader::GetFlags(), ns3::TcpHeader::GetSequenceNumber(), ns3::TcpHeader::InitializeChecksum(), m_calcChecksum, m_node, NS_FATAL_ERROR, NS_LOG_FUNCTION, NS_LOG_LOGIC, PROT_NUMBER, and ns3::TcpHeader::SetLength().
Definition at line 354 of file tcp-l4-protocol.cc.
References m_node.
friend class TcpSocketImpl [friend] |
Definition at line 116 of file tcp-l4-protocol.h.
bool ns3::TcpL4Protocol::m_calcChecksum [private] |
Definition at line 122 of file tcp-l4-protocol.h.
Referenced by GetTypeId(), Receive(), Send(), and SendPacket().
Ipv4EndPointDemux* ns3::TcpL4Protocol::m_endPoints [private] |
Definition at line 113 of file tcp-l4-protocol.h.
Referenced by Allocate(), DeAllocate(), DoDispose(), and Receive().
bool ns3::TcpL4Protocol::m_goodChecksum [private] |
Definition at line 121 of file tcp-l4-protocol.h.
Ptr<Node> ns3::TcpL4Protocol::m_node [private] |
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().