The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ...

The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ... The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ...

nmlab.korea.ac.kr
from nmlab.korea.ac.kr More from this publisher
12.07.2015 Views

TCPSINK Objects TCPSink objects are a subclass of agent objects that implement a receiver for TCP packets. The simulatoronly implements "one-way" TCP connections, where the TCP source sends data packets and the TCP sink sendsACK packets. TCPSink objects inherit all of the generic agent functionality. There are no methods or state variablesspecific to the TCPSink object. Configuration Parameters arepacketSize_ The size in bytes to use for all acknowledgment packets.maxSackBlocks_ The maximum number of blocks of data that can be acknowledged in a SACK option. For a receiverthat is also using the time stamp option [RFC 1323], the SACK option specified in RFC 2018 has room to includethree SACK blocks. This is only used by the TCPSink/Sack1 subclass. This value may not be increased withinany particular TCPSink object after that object has been allocated. (Once a TCPSink object has been allocated,the value of this parameter may be decreased but not increased).TCPSINK/DELACK Objects DelAck objects are a subclass of TCPSink that implement a delayed-ACK receiver for TCPpackets. They inherit all of the TCPSink object functionality. There are no methods or state variables specific to theDelAck object. Configuration Parameters are:interval_ The amount of time to delay before generating an acknowledgment for a single packet. If another packetarrives before this time expires, generate an acknowledgment immediately.TCPSINK/SACK1 Objects TCPSink/Sack1 objects are a subclass of TCPSink that implement a SACK receiver for TCPpackets. They inherit all of the TCPSink object functionality. There are no methods, configuration parameters or statevariables specific to this object.TCPSINK/SACK1/DELACK Objects TCPSink/Sack1/DelAck objects are a subclass of TCPSink/Sack1 that implement adelayed-SACK receiver for TCP packets. They inherit all of the TCPSink/Sack1 object functionality. There are nomethods or state variables specific to this object. Configuration Parameters are:interval_ The amount of time to delay before generating an acknowledgment for a single packet. If another packetarrives before this time expires, generate an acknowledgment immediately.10.9 Commands at a glanceFollowing are the agent related commands used in simulation scripts:ns_ attach-agent This command attaches the to the . We assume here that the has already been created. An agent istypically created by set agent [new Agent/AgentType] where Agent/AgentType defines the class definiton of thespecified agent type.$agent portThis returns the port number to which the agent is attached.$agent dst-portThis returns the port number of the destination. When any connection is setup between 2 nodes, each agent stores thedestination port in its instance variable called dst_port_.$agent attach-app This commands attaches an application of type to the agent. A handle to the application object is returned. Alsonote that the application type must be defined as a packet type in packet.h.$agent attach-source This used to be the procedure to attach source of type to the agent. But this is obsolete now. Use attach-app(described above) instead.109

$agent attach-tbf Attaches a token bucket filter (tbf) to the agent.$ns_ connect Sets up a connection between the src and dst agents.$ns_ create-connection This sets up a complete connection between two agents. First creates a source of type and binds it to . Thencreates a destination of type and binds it to . Finally connects the src and dst agents and returns a handle tothe source agent.$ns_ create-connection-list This command is exactly similar to create-connection described above. But instead of returning only the source-agent, thisreturns a list of source and destination agents.Internal procedures:$ns_ simplex-connect This is an internal method that actually sets up an unidirectional connection between the agent and agent. Itsimply sets the destination address and destination port of the as ’s agent-address and agent-port. The "connect"described above calls this method twice to set up a bi-directional connection between the src and dst.$agent set This is an internal procedure used to inform users of the backward compatibility issues resulting from the upgrade to 32-bitaddressing space currently used in ns.$agent attach-trace This attaches the to the agent to allow nam-tracing of the agent events.In addition to the agent related procedures described here, there are additional methods that support different type of agentslike Agent/Null, Agent/TCP, Agent/CBR, Agent/TORA, Agent/mcast etc. These additional methods along with theprocedures described here can be found in ns/tcl/lib/(ns-agent.tcl, ns-lib.tcl, ns-mip.tcl, ns-mobilenode.tcl, ns-namsupp.tcl,ns-queue.tcl, ns-route.tcl, ns-sat.tcl, ns-source.tcl). They are also described in the previous section.110

TCPSINK Objects TCPSink objects are a subclass of agent objects th<strong>at</strong> implement a receiver for TCP packets. <strong>The</strong> simul<strong>at</strong>oronly implements "one-way" TCP connectio<strong>ns</strong>, where the TCP source sends d<strong>at</strong>a packets <strong>and</strong> the TCP sink sendsACK packets. TCPSink objects inherit all of the generic agent functionality. <strong>The</strong>re are no methods or st<strong>at</strong>e variablesspecific to the TCPSink object. Configur<strong>at</strong>ion Parameters arepacketSize_ <strong>The</strong> size in bytes to use for all acknowledgment packets.maxSackBlocks_ <strong>The</strong> maximum number of blocks of d<strong>at</strong>a th<strong>at</strong> can be acknowledged in a SACK option. For a receiverth<strong>at</strong> is also using the time stamp option [RFC 1323], the SACK option specified in RFC 2018 has room to includethree SACK blocks. This is only used by the TCPSink/Sack1 subclass. This value may not be increased withinany particular TCPSink object after th<strong>at</strong> object has been alloc<strong>at</strong>ed. (Once a TCPSink object has been alloc<strong>at</strong>ed,the value of this parameter may be decreased but not increased).TCPSINK/DELACK Objects DelAck objects are a subclass of TCPSink th<strong>at</strong> implement a delayed-ACK receiver for TCPpackets. <strong>The</strong>y inherit all of the TCPSink object functionality. <strong>The</strong>re are no methods or st<strong>at</strong>e variables specific to theDelAck object. Configur<strong>at</strong>ion Parameters are:interval_ <strong>The</strong> amount of time to delay before gener<strong>at</strong>ing an acknowledgment for a single packet. If another packetarrives before this time expires, gener<strong>at</strong>e an acknowledgment immedi<strong>at</strong>ely.TCPSINK/SACK1 Objects TCPSink/Sack1 objects are a subclass of TCPSink th<strong>at</strong> implement a SACK receiver for TCPpackets. <strong>The</strong>y inherit all of the TCPSink object functionality. <strong>The</strong>re are no methods, configur<strong>at</strong>ion parameters or st<strong>at</strong>evariables specific to this object.TCPSINK/SACK1/DELACK Objects TCPSink/Sack1/DelAck objects are a subclass of TCPSink/Sack1 th<strong>at</strong> implement adelayed-SACK receiver for TCP packets. <strong>The</strong>y inherit all of the TCPSink/Sack1 object functionality. <strong>The</strong>re are nomethods or st<strong>at</strong>e variables specific to this object. Configur<strong>at</strong>ion Parameters are:interval_ <strong>The</strong> amount of time to delay before gener<strong>at</strong>ing an acknowledgment for a single packet. If another packetarrives before this time expires, gener<strong>at</strong>e an acknowledgment immedi<strong>at</strong>ely.10.9 Comm<strong>and</strong>s <strong>at</strong> a glanceFollowing are the agent rel<strong>at</strong>ed comm<strong>and</strong>s used in simul<strong>at</strong>ion scripts:<strong>ns</strong>_ <strong>at</strong>tach-agent This comm<strong>and</strong> <strong>at</strong>taches the to the . We assume here th<strong>at</strong> the has already been cre<strong>at</strong>ed. An agent istypically cre<strong>at</strong>ed by set agent [new Agent/AgentType] where Agent/AgentType defines the class definiton of thespecified agent type.$agent portThis retur<strong>ns</strong> the port number to which the agent is <strong>at</strong>tached.$agent dst-portThis retur<strong>ns</strong> the port number of the destin<strong>at</strong>ion. When any connection is setup between 2 nodes, each agent stores thedestin<strong>at</strong>ion port in its i<strong>ns</strong>tance variable called dst_port_.$agent <strong>at</strong>tach-app This comm<strong>and</strong>s <strong>at</strong>taches an applic<strong>at</strong>ion of type to the agent. A h<strong>and</strong>le to the applic<strong>at</strong>ion object is returned. Alsonote th<strong>at</strong> the applic<strong>at</strong>ion type must be defined as a packet type in packet.h.$agent <strong>at</strong>tach-source This used to be the procedure to <strong>at</strong>tach source of type to the agent. But this is obsolete now. Use <strong>at</strong>tach-app(described above) i<strong>ns</strong>tead.109

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!