Professional Documents
Culture Documents
Model Features
The section provides a list of the main features available in the TCP standard
model:
Persistence Time-out Timer enabling sending node to send one-byte data segments
to receiving node with a very small window size to poll remote
socket
• The TCP standard model is designed to be used with the IP standard model;
however, it could also be modified for use with other network layer protocols
• API package for model developers to help interfacing with higher layer
processes
Model Attributes
Each node with TCP as one of its contained protocols, provides an attribute,
called “TCP Parameters”, to specify TCP configuration parameters. There are
several preset values available for this attribute to allow you to choose from
different TCP “flavors”:
Values for most of these settings have been referenced from the following URL:
http://www.psc.edu/networking/perf_tune.html
The “TCP Parameters” attribute itself consists of many sub-attributes (these can
be inspected by using the “Edit...” option for its value). Some of the important
TCP model attributes are:
• Maximum Segment Size: Defines the largest amount of data that will be
transmitted as one TCP segment. Choosing a good MSS value is important
because if MSS is small, network utilization may be low; on the contrary, if
MSS is large, it degrades performance as it results in creation of many IP
datagrams, which cannot be acknowledged or retransmitted independently.
Typically, this value should be set equal to the maximum size that the “MAC”
layer can handle, minus the size of TCP and IP headers. Setting this attribute
to “Auto-Assigned” automatically guarantees that it is configured optimally for
the data link layer over which TCP is operating.
• Maximum ACK Delay: Defines the longest time that a TCP connection
process waits to send an acknowledgment (ACK) after receiving data. Note
that TCP does not send an ACK the instant that it receives data. Instead, it
delays the ACK, hoping to have data going in the same direction as the ACK,
so the ACK can be sent along with the data (called ACK piggybacking).
This attribute can significantly influence end-to-end delay when a TCP
process is primarily receiving (and not both sending and receiving) data. This
is so because the TCP connection process waits for this timer to expire
before sending an ACK. Higher values generally result in higher application
response times. However, a low value may result in too many dataless
acknowledgments, adding to network load.
To determine this value, consult your system's configuration or examine a
network analyzer trace. Typically, this value is set to 200 msec, and the
ACKing procedure works in conjunction with the “Delayed ACK Mechanism”
attribute setting.
• Delayed ACK Mechanism: This attribute setting controls how the delayed
“dataless” acknowledgments are sent by the TCP connection process. The
two most common implementations are “Clock Based” (some UNIX
systems), wherein the dataless ACKs are generated at the expiration of the
maximum acknowledgment delay timer, and “Segment/Clock Based”
(Windows systems), wherein dataless ACKs are generated upon receipt of
every other received TCP segment or at the maximum delay timer expiration,
whichever happens first.
usage threshold. For example, if the maximum receive window is 16K bytes,
and the advertised receive window routinely drops to 8K bytes before moving
back to 16K bytes, a value of 0.5 would be appropriate for the usage
threshold. While many UNIX systems implement a value of 0.5 for this
parameter, Microsoft Windows systems are more accurately modeled with a
low value, such as 0.0. However, you should analyze actual trace output to
determine the value of this important parameter.
Available Statistics
To analyze TCP protocol performance, there are several statistics that can be
collected during simulation execution. The statistics can be collected on a
per-TCP connection, per-node or a global basis.
• Node-based (and global) statistics provide grouped information for all TCP
processes running in a node (and network) collectively. These are useful to
determine the total flow of traffic traversing through the TCP layer or the
average TCP layer delayed experienced by segments submitted by the
application processes.
The “View Results” option from the project work space provides a listing of
statistics that can be plotted -- each “TCP Connection”-related statistics
contains the “socket” information (i.e., local port, remote port, and remote
address) as shown below:
Examples
An example project (called “TCP”) is shipped with the OPNET standard model
library. It highlights several features of the TCP model, including the different
algorithms modeled. The following graphs are from a simple network containing
one FTP traffic source sending 1MB file to a server. Different scenarios are
Application Traffic
Configuration Nodes
The results were obtained for the application layer response time and TCP
congestion window for three different simulations:
The results show that the congestion window recovers fastest when the
Fast-Retransmit/Fast-Recovery algorithm are enabled (i.e., using a Reno
implementation) versus when they are disabled (i.e., when segment losses is
detected only upon retransmission time-out expiration). A dramatic
improvement in the application response time performance can also be seen as
a result of enabling Fast-Retransmit/Fast-Recovery algorithms under packet
drop conditions.
If you want to further understand TCP behavior and how it adapts as more and
more options are enabled/disabled, you can use the OPNET debugger (ODB)
and perform TCP model’s activity tracing using the command “ltrace tcp”. You
could also compare various statistics (e.g., Sent Sequence Segment Number
versus Received ACK Segment Number) or breakdown the statistics (e.g., TCP
Congestion Window) to get a better understanding of the results. For example,
if you examine the TCP Congestion Window statistic in the above example, you
can inspect how the Fast-Retransmit/Fast-Recovery works:
Answer: Please note that each TCP process specifies criteria limiting the time
for which retransmission of a segment is attempted. The limit is either in terms
of a maximum number of attempts or a time interval. Once this threshold is
reached, the TCP connection is aborted. Different thresholds exist for control
(e.g., SYN) versus data segments.
The above simulation log results after a TCP process has made six
unsuccessful attempts to transmit the same segment. If you think your network
can recover from limits greater than the default values specified for this attribute,
change the default on the node models using the “Retransmission Threshold”
sub-attribute in the “TCP Parameters” attribute. Note that this threshold setting
is typically set to “Attempts Based” on Windows systems, and “Time Based” on
UNIX systems.
Question: I need to inspect the TCP packets present in the network; how can I
check the contents of each TCP packet?”
Answer: Each TCP segment contains a TCP header, options and data field.
When running the simulation under the control of ODB, you can use the “pkprint”
command to print the contents of a TCP segment. It shows detailed information
about the contents of the segment header, options, and contained payload
information:
Answer: Set the “TCP Connection Information” attribute to “Print” —this prints
a list of TCP connections running in the surrounding node. The list is printed in
the console from which OPNET was launched.
Model Architecture
The following sections have more relevance to model developers (e.g., OPNET
Modeler users). It discusses the topics necessary for understanding the internal
details and interfacing to the TCP model. The following diagram illustrates the
relevant portions of a typical node model where the TCP model resides:
Each node intended to use TCP has a “tcp” module, which contains a dispatcher
process that spawns connection processes:
TCP TCP
Virtual Connections
The socket processes are dynamically created and destroyed upon application
requests. Each socket process (tcp_conn_v3) contains the core logic for various
TCP protocol features. To illustrate the conformance to specified standards,
note that the implementation of the TCP connection process in OPNET exactly
resembles the specification in RFC-793:
RFC-793’s TCP
Connection State
Transition Diagram
OPNET’s “tcp_conn_v3”
TCP Connection
Process Model
Model Interfaces
The following sections discuss the topics necessary for interfacing with the TCP
model.
Packet Formats
The following packet format is used to represent a TCP segment:
Each TCP segment contains a TCP header, options and data field. This is
defined by the following TCP packet format (tcp_seg_v2). In the packet format
editor, it looks like this:
You can refer to the descriptions provided for each packet field to get more
details about their importance.
ICI Formats
The following table lists the interface control information (ICI) formats used in
the TCP model suite:
ip_encap_req_v4 The TCP processes use this format to specify the destination
network and node information to the Network Layer. The ICI
always accompanies (installed with) a packet transfer.
tcp_command_v3 The application layer processes use this ICI format to identify
the target TCP connection, so that the commands they issue
can be dispatched to the correct connection process. The
same ICI should be used for all interactions with a particular
connection for the duration of the connection. ICI reuse
simplifies the TCP interface, since the connection parameters
can be preserved when the connection is first opened.
tcp_status_ind_v3 The TCP connection process uses this ICI to notify the
Application Layer processes of important events. The
connection creates this ICI, but does not destroy it; the
application is responsible for destroying it.
The following table lists the various commands used in the TCP model suite:
Indications take the form of remote interrupts or stream interrupts issued from
the TCP connection process to the application. All indications are
accompanied by an ICI of type tcp_status_ind_v3, described earlier.
You can use one of two methods to create the application–to–TCP interface:
either directly, by using remote interrupts; or by using the TCP API. Unless you
are accustomed to creating this interface directly, you will probably find the API
method simpler.
• Issuing Commands Using the TCP API: The TCP API is a set of functions
that hide many of the details involved in issuing commands. To use these
functions, declare the external source file tcp_api.ex.c; then include
tcp_api.h in the header block of the application-layer process:
Each application module must first register itself with TCP using the function
tcp_app_register(); this returns a handle that the application uses as a
parameter in subsequent function calls. Dynamic processes within a single
application layer module can make copies of this handle to use in function calls
instead of re-registering.
The following table describes the mains functions available from this package:
Purpose Returns the next available port on the TCP layer for use by the
calling application
Purpose Open a TCP connection between the host and a remote host
Either TCPC_COMMAND_OPEN_PASSIVE or
TCPC_COMMAND_OPEN_ACTIVE, depending on the desired
connection type
Purpose Returns the original data handle passed as the parameter tcp_hndl.
This allows the application calling this function to copy the handle’s
data values into a new variable
Purpose Close the connection after all data has been sent
Purpose Terminate the connection early. This may be necessary due the
application layer requirements
Debugging/Simulation Tracing
The TCP model provides several simulation run-time tracing and debugging
features. These include labeled traces and diagnostic block code execution
when simulation is run under the control of OPNET simulation debugger (ODB).
The following table lists the various label traces that can be used while
understanding the behavior of the TCP models:
The following section illustrates how you can navigate through the different
debugging/tracing features available in the TCP model. It assumes that you
have enabled the “debug” option for a simulation containing TCP elements:
TCP “passive”
Connection Open
TCP “active”
Connection Open
You can track the exact state of a TCP connection by using the following steps:
• Determine the list of “tcp” modules. For the object (i.e., node) of interest,
determine the object ID of the “tcp” module
• Find a list of processes running within that module: You will notice that there
is always one “tcp_manager_v3” and one or more “tcp_conn_v3” processes
running under this module
• For the connection process of interest, print the diagnostic block contents.
Out-of-order
Received Segment List