A Discrete-Event Network Simulator
API
Socket
+ Collaboration diagram for Socket:

Classes

class  ns3::Ipv4RawSocketFactory
 API to create RAW socket instances. More...
 
class  ns3::Ipv4RawSocketFactoryImpl
 Implementation of IPv4 raw socket factory. More...
 
class  ns3::Ipv4RawSocketImpl
 Introspection did not find any typical Config paths. More...
 
class  ns3::Ipv6RawSocketFactory
 API to create IPv6 RAW socket instances. More...
 
class  ns3::Ipv6RawSocketFactoryImpl
 Implementation of IPv6 raw socket factory. More...
 
class  ns3::Ipv6RawSocketImpl
 Introspection did not find any typical Config paths. More...
 
class  ns3::NscTcpSocketImpl
 Socket logic for the NSC TCP sockets. More...
 
class  ns3::PacketSocket
 A PacketSocket is a link between an application and a net device. More...
 
class  ns3::PacketSocketClient
 A simple client. More...
 
class  ns3::PacketSocketFactory
 This can be used as an interface in a node in order for the node to generate PacketSockets that can connect to net devices. More...
 
class  ns3::PacketSocketServer
 A server using PacketSocket. More...
 
class  ns3::Socket
 A low-level Socket API based loosely on the BSD Socket API. More...
 
class  ns3::SocketFactory
 Object to create transport layer instances that provide a socket API to applications. More...
 
class  ns3::TcpSocket
 (abstract) base class of all TcpSockets More...
 
class  ns3::TcpSocketBase
 A base class for implementation of a stream socket using TCP. More...
 
class  ns3::TcpSocketFactory
 API to create TCP socket instances. More...
 
class  ns3::TcpWestwood
 An implementation of a stream socket using TCP. More...
 
class  ns3::UdpSocket
 (abstract) base class of all UdpSockets More...
 
class  ns3::UdpSocketFactory
 API to create UDP socket instances. More...
 

Enumerations

enum  ns3::Socket::Ipv6MulticastFilterMode { ns3::Socket::INCLUDE =1, ns3::Socket::EXCLUDE }
 Enumeration of the possible filter of a socket. More...
 
enum  ns3::Socket::SocketErrno {
  ns3::Socket::ERROR_NOTERROR, ns3::Socket::ERROR_ISCONN, ns3::Socket::ERROR_NOTCONN, ns3::Socket::ERROR_MSGSIZE,
  ns3::Socket::ERROR_AGAIN, ns3::Socket::ERROR_SHUTDOWN, ns3::Socket::ERROR_OPNOTSUPP, ns3::Socket::ERROR_AFNOSUPPORT,
  ns3::Socket::ERROR_INVAL, ns3::Socket::ERROR_BADF, ns3::Socket::ERROR_NOROUTETOHOST, ns3::Socket::ERROR_NODEV,
  ns3::Socket::ERROR_ADDRNOTAVAIL, ns3::Socket::ERROR_ADDRINUSE, ns3::Socket::SOCKET_ERRNO_LAST
}
 Enumeration of the possible errors returned by a socket. More...
 
enum  ns3::Socket::SocketType { ns3::Socket::NS3_SOCK_STREAM, ns3::Socket::NS3_SOCK_SEQPACKET, ns3::Socket::NS3_SOCK_DGRAM, ns3::Socket::NS3_SOCK_RAW }
 Enumeration of the possible socket types. More...
 
enum  ns3::PacketSocket::State { ns3::PacketSocket::STATE_OPEN, ns3::PacketSocket::STATE_BOUND, ns3::PacketSocket::STATE_CONNECTED, ns3::PacketSocket::STATE_CLOSED }
 States of the socket. More...
 
enum  ns3::TcpSocket::TcpStates_t {
  ns3::TcpSocket::CLOSED = 0, ns3::TcpSocket::LISTEN, ns3::TcpSocket::SYN_SENT, ns3::TcpSocket::SYN_RCVD,
  ns3::TcpSocket::ESTABLISHED, ns3::TcpSocket::CLOSE_WAIT, ns3::TcpSocket::LAST_ACK, ns3::TcpSocket::FIN_WAIT_1,
  ns3::TcpSocket::FIN_WAIT_2, ns3::TcpSocket::CLOSING, ns3::TcpSocket::TIME_WAIT, ns3::TcpSocket::LAST_STATE
}
 Names of the 11 TCP states. More...
 

Detailed Description

Enumeration Type Documentation

Enumeration of the possible filter of a socket.

A socket can have filters on specific sources to include only packets incoming from them, or to exclude packets incoming from specific sources. Moreover, inclusion and exclusion also works as a leave, since "joining" a group without allowed sources is equivalent to leaving it.

Enumerator
INCLUDE 
EXCLUDE 

Definition at line 122 of file socket.h.

Enumeration of the possible errors returned by a socket.

Enumerator
ERROR_NOTERROR 
ERROR_ISCONN 
ERROR_NOTCONN 
ERROR_MSGSIZE 
ERROR_AGAIN 
ERROR_SHUTDOWN 
ERROR_OPNOTSUPP 
ERROR_AFNOSUPPORT 
ERROR_INVAL 
ERROR_BADF 
ERROR_NOROUTETOHOST 
ERROR_NODEV 
ERROR_ADDRNOTAVAIL 
ERROR_ADDRINUSE 
SOCKET_ERRNO_LAST 

Definition at line 82 of file socket.h.

Enumeration of the possible socket types.

Enumerator
NS3_SOCK_STREAM 
NS3_SOCK_SEQPACKET 
NS3_SOCK_DGRAM 
NS3_SOCK_RAW 

Definition at line 104 of file socket.h.

States of the socket.

Enumerator
STATE_OPEN 
STATE_BOUND 
STATE_CONNECTED 
STATE_CLOSED 

Definition at line 173 of file packet-socket.h.

Names of the 11 TCP states.

Enumerator
CLOSED 

Socket is finished.

LISTEN 

Listening for a connection.

SYN_SENT 

Sent a connection request, waiting for ack.

SYN_RCVD 

Received a connection request, sent ack, waiting for final ack in three-way handshake.

ESTABLISHED 

Connection established.

CLOSE_WAIT 

Remote side has shutdown and is waiting for us to finish writing our data and to shutdown (we have to close() to move on to LAST_ACK)

LAST_ACK 

Our side has shutdown after remote has shutdown.

There may still be data in our buffer that we have to finish sending

FIN_WAIT_1 

Our side has shutdown, waiting to complete transmission of remaining buffered data.

FIN_WAIT_2 

All buffered data sent, waiting for remote to shutdown.

CLOSING 

Both sides have shutdown but we still have data we have to finish sending.

TIME_WAIT 

Timeout to catch resent junk before entering closed, can only be entered from FIN_WAIT2 or CLOSING.

Required because the other end may not have gotten our last ACK causing it to retransmit the data packet (which we ignore)

LAST_STATE 

Last state, used only in debug messages.

Definition at line 64 of file tcp-socket.h.