ns-3
|
A layer between the sockets interface and IP. More...
#include <tcp-l4-protocol.h>
Public Member Functions | |
TcpL4Protocol () | |
Constructor. | |
void | SetNode (Ptr< Node > node) |
virtual int | GetProtocolNumber (void) const |
Ptr< Socket > | CreateSocket (void) |
Ptr< Socket > | CreateSocket (TypeId socketTypeId) |
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, Ptr< NetDevice > oif=0) |
Send a packet via TCP. | |
virtual enum Ipv4L4Protocol::RxStatus | Receive (Ptr< Packet > p, Ipv4Header const &header, Ptr< Ipv4Interface > incomingInterface) |
Receive a packet up the protocol stack. | |
virtual void | SetDownTarget (Ipv4L4Protocol::DownTargetCallback cb) |
virtual Ipv4L4Protocol::DownTargetCallback | GetDownTarget (void) const |
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) |
virtual void | NotifyNewAggregate () |
Friends | |
class | TcpSocketBase |
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 receives packets from IP, and forwards them up to the endpoints.
Ptr< Socket > ns3::TcpL4Protocol::CreateSocket | ( | void | ) |
Referenced by ns3::TcpSocketFactoryImpl::CreateSocket().
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.
It is safe to call GetObject from within this method.
Reimplemented from ns3::Object.
References NS_LOG_FUNCTION_NOARGS.
Ipv4L4Protocol::DownTargetCallback ns3::TcpL4Protocol::GetDownTarget | ( | void | ) | const [virtual] |
This method allows a caller to get the current down target callback set for this L4 protocol, for
Implements ns3::Ipv4L4Protocol.
int ns3::TcpL4Protocol::GetProtocolNumber | ( | void | ) | const [virtual] |
Implements ns3::Ipv4L4Protocol.
TypeId ns3::TcpL4Protocol::GetTypeId | ( | void | ) | [static] |
This method returns the TypeId associated to ns3::TcpL4Protocol.
This object is accessible through the following paths with Config::Set and Config::Connect:
Attributes defined for this type:
Attributes defined in parent class ns3::Ipv4L4Protocol:
No TraceSources defined for this type.
Reimplemented from ns3::Ipv4L4Protocol.
References ns3::TcpNewReno::GetTypeId(), ns3::RttMeanDeviation::GetTypeId(), and ns3::TypeId::SetParent().
void ns3::TcpL4Protocol::NotifyNewAggregate | ( | void | ) | [protected, virtual] |
This method is invoked whenever two sets of objects are aggregated together. It is invoked exactly once for each object in both sets. This method can be overriden by subclasses who wish to be notified of aggregation events. These subclasses must chain up to their base class NotifyNewAggregate method. It is safe to call GetObject and AggregateObject from within this method.
This function must be implemented in the stack that needs to notify other stacks connected to the node of their presence in the node.
Reimplemented from ns3::Object.
References ns3::Object::AggregateObject(), ns3::Ipv4::Insert(), ns3::MakeCallback(), ns3::Ipv4::Send(), and SetDownTarget().
enum Ipv4L4Protocol::RxStatus ns3::TcpL4Protocol::Receive | ( | Ptr< Packet > | p, |
Ipv4Header const & | header, | ||
Ptr< Ipv4Interface > | incomingInterface | ||
) | [virtual] |
Receive a packet up the protocol stack.
p | The Packet to dump the contents into |
header | IPv4 Header information |
incomingInterface | The Ipv4Interface it was received on |
Implements ns3::Ipv4L4Protocol.
References ns3::Node::ChecksumEnabled(), ns3::TcpHeader::EnableChecksums(), ns3::TcpHeader::GetAckNumber(), ns3::Ipv4Header::GetDestination(), ns3::TcpHeader::GetDestinationPort(), ns3::TcpHeader::GetFlags(), ns3::TcpHeader::GetSequenceNumber(), ns3::Packet::GetSize(), ns3::Ipv4Header::GetSource(), ns3::TcpHeader::GetSourcePort(), ns3::TcpHeader::InitializeChecksum(), ns3::TcpHeader::IsChecksumOk(), NS_ASSERT_MSG, NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC, ns3::Packet::PeekHeader(), ns3::Ipv4Address::Print(), and ns3::TcpHeader::SetFlags().
void ns3::TcpL4Protocol::Send | ( | Ptr< Packet > | packet, |
Ipv4Address | saddr, | ||
Ipv4Address | daddr, | ||
uint16_t | sport, | ||
uint16_t | dport, | ||
Ptr< NetDevice > | oif = 0 |
||
) |
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 |
oif | The output interface bound. Defaults to null (unspecified). |
References ns3::Packet::AddHeader(), ns3::Node::ChecksumEnabled(), ns3::TcpHeader::EnableChecksums(), ns3::Object::GetObject(), ns3::Ipv4::GetRoutingProtocol(), ns3::TcpHeader::InitializeChecksum(), NS_LOG_ERROR, NS_LOG_FUNCTION, ns3::Ipv4RoutingProtocol::RouteOutput(), ns3::Ipv4::Send(), ns3::TcpHeader::SetAckNumber(), ns3::Ipv4Header::SetDestination(), ns3::TcpHeader::SetDestinationPort(), ns3::TcpHeader::SetFlags(), ns3::Ipv4Header::SetProtocol(), and ns3::TcpHeader::SetSourcePort().
void ns3::TcpL4Protocol::SetDownTarget | ( | Ipv4L4Protocol::DownTargetCallback | cb | ) | [virtual] |
This method allows a caller to set the current down target callback set for this L4 protocol
cb | current Callback for the L4 protocol |
Implements ns3::Ipv4L4Protocol.
Referenced by NotifyNewAggregate().