doc/manual/tcp.texi
author Tom Henderson <tomh@tomh.org>
Mon, 19 Oct 2009 07:54:31 -0700
changeset 5434 81a3858041a8
parent 4755 04a9a7e9a624
child 6611 693b34a6e655
permissions -rw-r--r--
additional manual cleanup
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3707
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     1
@node TCP
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     2
@chapter TCP models in ns-3
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     3
@anchor{chap:TCP}
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     4
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     5
This chapter describes the TCP models available in ns-3.
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     6
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     7
@section Generic support for TCP
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     8
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
     9
ns-3 was written to support multiple TCP implementations.  The 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    10
implementations inherit from a few common header classes in the
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    11
@code{src/node} directory, so that user code can swap out implementations
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    12
with minimal changes to the scripts.
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    13
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    14
There are two important abstract base classes:
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    15
@itemize @bullet
4411
a0b70aae6217 fix texinfo errors
Tom Henderson <tomh@tomh.org>
parents: 3707
diff changeset
    16
@item @code{class TcpSocket}:  This is defined in @code{src/node/tcp-socket.@{cc,h@}}.  This class exists for hosting TcpSocket attributes that can be
3707
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    17
reused across different implementations.  For instance, 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    18
@code{TcpSocket::SetInitialCwnd()} can be used for any of the implementations
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    19
that derive from @code{class TcpSocket}.
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    20
@item @code{class TcpSocketFactory}:  This is used by applications to
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    21
create TCP sockets.  A typical usage can be seen in this snippet:
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    22
@verbatim
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    23
  // Create the socket if not already created
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    24
  if (!m_socket)
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    25
    {
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    26
      m_socket = Socket::CreateSocket (GetNode(), m_tid);
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    27
      m_socket->Bind (m_local);
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    28
      ...
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    29
    }
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    30
@end verbatim
4755
04a9a7e9a624 Manual spelling fixes from Johannes Buchner
Tom Henderson <tomh@tomh.org>
parents: 4411
diff changeset
    31
The parameter @code{m_tid} controls the TypeId of the actual TCP Socket
3707
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    32
implementation that is instantiated.  This way, the application can be
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    33
written generically and different socket implementations can be swapped out
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    34
by specifying the TypeId.
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    35
@end itemize  
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    36
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    37
@section ns-3 TCP
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    38
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    39
ns-3 contains a port of the TCP model from 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    40
@uref{http://www.ece.gatech.edu/research/labs/MANIACS/GTNetS/index.html,,GTNetS}.  This model is a full TCP, in that it is 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    41
bidirectional and attempts to model the connection setup and
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    42
close logic.  In fact, it is a more complete implementation of the TCP
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    43
state machine than ns-2's "FullTcp" model.  This TCP model was originally 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    44
written by George Riley
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    45
as part of GTNetS and ported to ns-3 by Raj Bhattacharjea.
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    46
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    47
The implementation of TCP is contained in the following files:
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    48
@verbatim
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    49
src/internet-stack/tcp-header.{cc,h}
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    50
src/internet-stack/tcp-l4-protocol.{cc,h}
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    51
src/internet-stack/tcp-socket-factory-impl.{cc,h}
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    52
src/internet-stack/tcp-socket-impl.{cc,h}
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    53
src/internet-stack/tcp-typedefs.h
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    54
src/internet-stack/rtt-estimator.{cc,h}
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    55
src/internet-stack/sequence-number.{cc,h}
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    56
@end verbatim
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    57
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    58
@subsection Usage
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    59
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    60
The file @code{examples/tcp-star-server.cc} contains an example that
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    61
makes use of @code{ns3::OnOffApplication} and @code{ns3::PacketSink} 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    62
applications.
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    63
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    64
Using the helper functions defined in @code{src/helper}, here is how
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    65
one would create a TCP receiver:
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    66
@verbatim
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    67
  // Create a packet sink on the star "hub" to receive these packets
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    68
  uint16_t port = 50000;
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    69
  Address sinkLocalAddress(InetSocketAddress (Ipv4Address::GetAny (), port));
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    70
  PacketSinkHelper sinkHelper ("ns3::TcpSocketFactory", sinkLocalAddress);
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    71
  ApplicationContainer sinkApp = sinkHelper.Install (serverNode);
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    72
  sinkApp.Start (Seconds (1.0));
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    73
  sinkApp.Stop (Seconds (10.0));
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    74
@end verbatim
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    75
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    76
Similarly, the below snippet configures OnOffApplication traffic
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    77
source to use
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    78
TCP:
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    79
@verbatim
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    80
  // Create the OnOff applications to send TCP to the server
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    81
  OnOffHelper clientHelper ("ns3::TcpSocketFactory", Address ());
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    82
@end verbatim
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    83
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    84
The careful reader will note above that we have specified the TypeId
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    85
of an abstract base class @code{TcpSocketFactory}.  How does the
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    86
script tell ns-3 that it wants the native ns-3 TCP vs. some other one?
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    87
Well, when internet stacks are added to the node, the default
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    88
TCP implementation that is aggregated to the node is the ns-3 TCP.
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    89
This can be overridden as we show below when using Network
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    90
Simulation Cradle.  So, by default, when using the ns-3 helper API,
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    91
the TCP that is aggregated to nodes with an Internet stack is the
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    92
native ns-3 TCP.
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    93
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    94
Once a TCP socket is created, you will want to follow conventional
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    95
socket logic and either connect() and send() (for a TCP client)
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    96
or bind(), listen(), and accept() (for a TCP server).  
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    97
@xref{Sockets APIs,,Sockets API} for a review of how sockets are used
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    98
in ns-3.
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
    99
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   100
To configure behavior of TCP, a number of parameters are exported through
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   101
the @ref{Attributes,,ns-3 attribute system}.  These are documented in the
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   102
@uref{http://www.nsnam.org/doxygen/classns3_1_1_tcp_socket.html,,Doxygen} 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   103
for @code{class TcpSocket}.
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   104
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   105
@subsection Current limitations
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   106
@itemize @bullet
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   107
@item Only Tahoe congestion control is presently supported.
5434
81a3858041a8 additional manual cleanup
Tom Henderson <tomh@tomh.org>
parents: 4755
diff changeset
   108
@item Only IPv4 is supported (IPv6 support will start to be added after ns-3.6).
3707
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   109
@end itemize
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   110
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   111
@section Network Simulation Cradle
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   112
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   113
The @uref{http://www.wand.net.nz/~stj2/nsc/,,Network Simulation Cradle (NSC)} 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   114
is a framework for wrapping real-world network
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   115
code into simulators, allowing simulation of real-world behavior at little 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   116
extra cost.  This work has been validated by comparing situations using 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   117
a test network with the same situations in the simulator. To date, it has 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   118
been shown that the NSC is able to produce extremely accurate results.
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   119
NSC supports four real world stacks: FreeBSD, OpenBSD, lwIP and Linux.
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   120
Emphasis has been placed on not changing any of the network stacks by hand. 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   121
Not a single line of code has been changed in the network protocol 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   122
implementations of any of the above four stacks. However, a custom C 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   123
parser was built to programmatically change source code.
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   124
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   125
NSC has previously been ported to ns-2 and OMNeT++, and recently 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   126
was added to ns-3.  This section describes the ns-3 port of NSC and
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   127
how to use it.
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   128
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   129
@subsection Prerequisites
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   130
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   131
Presently, NSC has been tested and shown to work on these platforms:
5434
81a3858041a8 additional manual cleanup
Tom Henderson <tomh@tomh.org>
parents: 4755
diff changeset
   132
Linux i386 and Linux x86-64.  NSC does not support powerpc.
3707
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   133
5434
81a3858041a8 additional manual cleanup
Tom Henderson <tomh@tomh.org>
parents: 4755
diff changeset
   134
Building NSC requires the packages flex and bison.  
3707
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   135
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   136
@subsection Configuring and Downloading
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   137
5434
81a3858041a8 additional manual cleanup
Tom Henderson <tomh@tomh.org>
parents: 4755
diff changeset
   138
Using the @code{build.py} script in ns-3-allinone directory, NSC will be
81a3858041a8 additional manual cleanup
Tom Henderson <tomh@tomh.org>
parents: 4755
diff changeset
   139
enabled by default unless the platform does not support it.  To disable
81a3858041a8 additional manual cleanup
Tom Henderson <tomh@tomh.org>
parents: 4755
diff changeset
   140
it when building ns-3, type:
3707
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   141
@verbatim
5434
81a3858041a8 additional manual cleanup
Tom Henderson <tomh@tomh.org>
parents: 4755
diff changeset
   142
./waf configure --disable-nsc
3707
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   143
@end verbatim
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   144
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   145
@subsection Building and validating
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   146
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   147
Building ns-3 with nsc support is the same as building it without; no
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   148
additional arguments are needed for waf.  Building nsc may take some time
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   149
compared to ns-3; it is interleaved in the ns-3 building process.
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   150
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   151
Try running the regression tests: @code{./waf --regression}.  If NSC has
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   152
been successfully built, the following test should show up in the results:
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   153
@verbatim
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   154
PASS test-tcp-nsc-lfn
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   155
@end verbatim
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   156
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   157
This confirms that NSC is ready to use.
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   158
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   159
@subsection Usage
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   160
There are a few example files.  Try
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   161
@verbatim
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   162
./waf --run tcp-nsc-zoo
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   163
./waf --run tcp-nsc-lfn
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   164
@end verbatim
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   165
These examples will deposit some @code{.pcap} files in your directory,
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   166
which can be examined by tcpdump or wireshark.
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   167
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   168
Let's look at the @code{examples/tcp-nsc-zoo.cc} file for some typical
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   169
usage.  How does it differ from using native ns-3 TCP?  There is one
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   170
main configuration line, when using NSC and the ns-3 helper API, that needs
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   171
to be set:
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   172
@verbatim
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   173
  InternetStackHelper internetStack;
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   174
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   175
  internetStack.SetNscStack ("liblinux2.6.26.so");
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   176
  // this switches nodes 0 and 1 to NSCs Linux 2.6.26 stack.
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   177
  internetStack.Install (n.Get(0));
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   178
  internetStack.Install (n.Get(1));
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   179
@end verbatim
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   180
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   181
The key line is the @code{SetNscStack}.  This tells the InternetStack
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   182
helper to aggregate instances of NSC TCP instead of native ns-3 TCP
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   183
to the remaining nodes.  It is important that this function be called
4755
04a9a7e9a624 Manual spelling fixes from Johannes Buchner
Tom Henderson <tomh@tomh.org>
parents: 4411
diff changeset
   184
@strong{before} calling the @code{Install()} function, as shown above.
3707
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   185
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   186
Which stacks are available to use?  Presently, the focus has been on
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   187
Linux 2.6.18 and Linux 2.6.26 stacks for ns-3.  To see which stacks
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   188
were built, one can execute the following find command at the ns-3 top level
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   189
directory:
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   190
@verbatim
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   191
~/ns-3.2> find nsc -name "*.so" -type f 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   192
nsc/linux-2.6.18/liblinux2.6.18.so
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   193
nsc/linux-2.6.26/liblinux2.6.26.so
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   194
@end verbatim
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   195
This tells us that we may either pass the library name liblinux2.6.18.so or 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   196
liblinux2.6.26.so to the above configuration step.
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   197
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   198
@subsection Stack configuration
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   199
NSC TCP shares the same configuration attributes that are common
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   200
across TCP sockets, as described above and documented in 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   201
@uref{http://www.nsnam.org/doxygen/classns3_1_1_tcp_socket.html,,Doxygen} 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   202
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   203
Additionally, NSC TCP exports a lot of configuration variables into the 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   204
ns-3 @ref{Attributes} system, via a @uref{http://en.wikipedia.org/wiki/Sysctl,,
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   205
sysctl}-like interface.  In the @code{examples/tcp-nsc-zoo} example, you
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   206
can see the following configuration:
5434
81a3858041a8 additional manual cleanup
Tom Henderson <tomh@tomh.org>
parents: 4755
diff changeset
   207
@smallformat
81a3858041a8 additional manual cleanup
Tom Henderson <tomh@tomh.org>
parents: 4755
diff changeset
   208
@example
81a3858041a8 additional manual cleanup
Tom Henderson <tomh@tomh.org>
parents: 4755
diff changeset
   209
  // this disables TCP SACK, wscale and timestamps on node 1 (the attributes 
81a3858041a8 additional manual cleanup
Tom Henderson <tomh@tomh.org>
parents: 4755
diff changeset
   210
represent sysctl-values).
81a3858041a8 additional manual cleanup
Tom Henderson <tomh@tomh.org>
parents: 4755
diff changeset
   211
  Config::Set ("/NodeList/1/$ns3::Ns3NscStack<linux2.6.26>/net.ipv4.tcp_sack", 
81a3858041a8 additional manual cleanup
Tom Henderson <tomh@tomh.org>
parents: 4755
diff changeset
   212
StringValue ("0"));
81a3858041a8 additional manual cleanup
Tom Henderson <tomh@tomh.org>
parents: 4755
diff changeset
   213
  Config::Set ("/NodeList/1/$ns3::Ns3NscStack<linux2.6.26>/net.ipv4.tcp_timestamps", 
81a3858041a8 additional manual cleanup
Tom Henderson <tomh@tomh.org>
parents: 4755
diff changeset
   214
StringValue ("0"));
81a3858041a8 additional manual cleanup
Tom Henderson <tomh@tomh.org>
parents: 4755
diff changeset
   215
  Config::Set ("/NodeList/1/$ns3::Ns3NscStack<linux2.6.26>/net.ipv4.tcp_window_scaling", 
81a3858041a8 additional manual cleanup
Tom Henderson <tomh@tomh.org>
parents: 4755
diff changeset
   216
StringValue ("0"));
81a3858041a8 additional manual cleanup
Tom Henderson <tomh@tomh.org>
parents: 4755
diff changeset
   217
@end example
81a3858041a8 additional manual cleanup
Tom Henderson <tomh@tomh.org>
parents: 4755
diff changeset
   218
@end smallformat
3707
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   219
These additional configuration variables are not available to native ns-3
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   220
TCP.
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   221
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   222
@subsection NSC API
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   223
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   224
This subsection describes the API that NSC presents to ns-3 or any other
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   225
simulator.  NSC provides its API in the form of a number of classes that
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   226
are defined in @code{sim/sim_interface.h} in the nsc directory.
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   227
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   228
@itemize @bullet
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   229
@item @strong{INetStack}
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   230
INetStack contains the 'low level' operations for the operating system 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   231
network stack, e.g. in and output functions from and to the network stack 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   232
(think of this as the 'network driver interface'. There are also functions 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   233
to create new TCP or UDP sockets.
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   234
@item @strong{ISendCallback}
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   235
This is called by NSC when a packet should be sent out to the network. 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   236
This simulator should use this callback to re-inject the packet into the 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   237
simulator so the actual data can be delivered/routed to its destination, 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   238
where it will eventually be handed into Receive() (and eventually back to the 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   239
receivers NSC instance via INetStack->if_receive() ).
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   240
@item @strong{INetStreamSocket}
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   241
This is the structure defining a particular connection endpoint (file 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   242
descriptor). It contains methods to operate on this endpoint, e.g. connect, 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   243
disconnect, accept, listen, send_data/read_data, ...
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   244
@item @strong{IInterruptCallback}
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   245
This contains the wakeup callback, which is called by NSC whenever 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   246
something of interest happens. Think of wakeup() as a replacement of the 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   247
operating systems wakeup function: Whenever the operating system would 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   248
wake up a process that has been waiting for an operation to complete (for 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   249
example the TCP handshake during connect()), NSC invokes the wakeup() callback 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   250
to allow the simulator to check for state changes in its connection endpoints. 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   251
@end itemize
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   252
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   253
@subsection ns-3 implementation
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   254
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   255
The ns-3 implementation makes use of the above NSC API, and is implemented
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   256
as follows.
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   257
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   258
The three main parts are:
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   259
@itemize @bullet
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   260
@item @code{ns3::NscTcpL4Protocol}:  a subclass of Ipv4L4Protocol (and two nsc classes: ISendCallback and IInterruptCallback)
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   261
@item @code{ns3::NscTcpSocketImpl}: a subclass of TcpSocket 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   262
@item @code{ns3::NscTcpSocketFactoryImpl}:  a factory to create new NSC
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   263
sockets
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   264
@end itemize
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   265
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   266
@code{src/internet-stack/nsc-tcp-l4-protocol} is the main class. Upon 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   267
Initialization, it loads an nsc network stack to use (via dlopen()). Each 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   268
instance of this class may use a different stack. The stack 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   269
(=shared library) to use is set using the SetNscLibrary() method (at 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   270
this time its called indirectly via the internet stack helper). The nsc 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   271
stack is then set up accordingly (timers etc). The 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   272
NscTcpL4Protocol::Receive() function hands the packet it receives (must be 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   273
a complete tcp/ip packet) to the nsc stack for further processing. 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   274
To be able to send packets, this class implements the nsc send_callback 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   275
method. This method is called by nsc whenever the nsc stack wishes to 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   276
send a packet out to the network. Its arguments are a raw buffer, 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   277
containing a complete TCP/IP packet, and a length value. This method 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   278
therefore has to convert the raw data to a Ptr<Packet> usable by ns-3. 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   279
In order to avoid various ipv4 header issues, the nsc ip header is not 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   280
included. Instead, the tcp header and the actual payload are put into the 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   281
Ptr<Packet>, after this the Packet is passed down to layer 3 for sending 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   282
the packet out (no further special treatment is needed in the send code 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   283
path).
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   284
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   285
This class calls @code{ns3::NscTcpSocketImpl} both from the nsc wakeup() 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   286
callback and from the Receive path (to ensure that possibly queued data 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   287
is scheduled for sending).
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   288
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   289
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   290
@code{src/internet-stack/nsc-tcp-socket-impl} implements the nsc socket 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   291
interface. Each instance has its own nscTcpSocket. Data that is Send() 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   292
will be handed to the nsc stack via m_nscTcpSocket->send_data(). (and not 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   293
to nsc-tcp-l4, this is the major difference compared to ns-3 TCP). The 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   294
class also queues up data that is Send() before the underlying 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   295
descriptor has entered an ESTABLISHED state. This class is called from 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   296
the nsc-tcp-l4 class, when the nsc-tcp-l4 wakeup() callback is invoked by 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   297
nsc. nsc-tcp-socket-impl then checks the current connection state 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   298
(SYN_SENT, ESTABLISHED, LISTEN...) and schedules appropriate callbacks as 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   299
needed, e.g. a LISTEN socket will schedule Accept to see if a new 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   300
connection must be accepted, an ESTABLISHED socket schedules any pending 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   301
data for writing, schedule a read callback, etc.
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   302
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   303
Note that @code{ns3::NscTcpSocketImpl} does not interact with nsc-tcp 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   304
directly: instead, data is redirected to nsc. nsc-tcp calls the 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   305
nsc-tcp-sockets of a node when its wakeup callback is invoked by nsc. 
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   306
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   307
@subsection Limitations
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   308
@itemize @bullet
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   309
@item NSC only works on single-interface nodes; attempting to run it on
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   310
a multi-interface node will cause a program error.  This limitation should
5434
81a3858041a8 additional manual cleanup
Tom Henderson <tomh@tomh.org>
parents: 4755
diff changeset
   311
be fixed by ns-3.7.
81a3858041a8 additional manual cleanup
Tom Henderson <tomh@tomh.org>
parents: 4755
diff changeset
   312
@item Cygwin and OS X PPC are not supported
81a3858041a8 additional manual cleanup
Tom Henderson <tomh@tomh.org>
parents: 4755
diff changeset
   313
@item The non-Linux stacks of NSC are not supported in ns-3
81a3858041a8 additional manual cleanup
Tom Henderson <tomh@tomh.org>
parents: 4755
diff changeset
   314
@item Not all socket API callbacks are supported
3707
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   315
@end itemize
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   316
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   317
For more information, see
857ef81c572d new manual chapter on TCP
Tom Henderson <tomh@tomh.org>
parents:
diff changeset
   318
@uref{http://www.nsnam.org/wiki/index.php/Network_Simulation_Cradle_Integration,, this wiki page}.