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 ...
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
- Page 59 and 60: 5.5 Routing Module and Classifier O
- Page 61 and 62: Module NameRtModule/BaseRtModule/Mc
- Page 63 and 64: $node neighborsThis returns the lis
- Page 65 and 66: Linkhead_enqT_queue_ deqT_ link_ tt
- Page 67 and 68: 6.2 ConnectorsConnectors, unlink cl
- Page 69 and 70: $ns_ link-lossmodel This function
- Page 71 and 72: Chapter 7Queue Management and Packe
- Page 73 and 74: }}}void Queue::resume(){Packet* p =
- Page 75 and 76: 7.3 Different types of Queue object
- Page 77 and 78: maxidle_ is the maximum amount of t
- Page 79 and 80: dst_ The destination address of pac
- Page 81 and 82: 7.5.2 ConfigurationRunning a JoBS s
- Page 83 and 84: mean_pkt_size_ Used to set the expe
- Page 85 and 86: Demarker objects$q trace-file This
- Page 87 and 88: The recv() method overrides the bas
- Page 89 and 90: 9.2 ImplementationThe procedures an
- Page 91 and 92: Average sending rateTSW window leng
- Page 93 and 94: The following command adds an entry
- Page 95 and 96: $qCE configQ 0 1 10 20 0.10Note tha
- Page 97 and 98: Chapter 10AgentsAgents represent en
- Page 99 and 100: CtrMcast/EncapCtrMcast/DecapMessage
- Page 101 and 102: }bind("windowOption_", &wnd_option_
- Page 103 and 104: hdr_flags* nf = (hdr_flags*)npkt->a
- Page 105 and 106: public:ECHO_Timer(ECHO_Agent *a) :
- Page 107 and 108: 10.6.4 Using the agent through OTcl
- Page 109: State Variables are:dupacks_ Number
- Page 113 and 114: (void)Scheduler::instance().schedul
- Page 115 and 116: * outstanding, cancel it.*/void Tcp
- Page 117 and 118: Chapter 12Packet Headers and Format
- Page 119 and 120: method is now obsolete; its usage i
- Page 121 and 122: Packethdrsize_next_bits()points to
- Page 123 and 124: the system’s memory allocator. In
- Page 125 and 126: }incr hdrlen_ $incrreturn $baseFrom
- Page 127 and 128: Chapter 13Error ModelThis chapter d
- Page 129 and 130: SimpleLink::errormodule argsSimulat
- Page 131 and 132: This is a simple example of how to
- Page 133 and 134: Higher LayersNode 1Node 2. . .Node
- Page 135 and 136: };void recv(Packet* p, Handler*);vi
- Page 137 and 138: and the frame type. It then passes
- Page 139 and 140: $ll_ set delay_ $delay$ll_ set band
- Page 141 and 142: 14.10 Commands at a glanceThe follo
- Page 143 and 144: 15.2.1 Default Hierarchical Setting
- Page 145 and 146: Chapter 16Mobile Networking in nsTh
- Page 147 and 148: entry_addrdemuxIP addressdefaulttar
- Page 149 and 150: 16.1.2 Creating Node movementsThe m
- Page 151 and 152: set netif $netif_($t)set mac $mac_(
- Page 153 and 154: the hardware address of a packet’
- Page 155 and 156: destined to itself to the port dmux
- Page 157 and 158: switch(ch->ptype()) {case PT_MAC:br
- Page 159 and 160: 16.1.7 Revised format for wireless
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