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 ...
Other useful configuration parameters are to assign a separate flow id to traffic originating from this agent, to open a log filefor statistics, and a trace file for trace data 1 .The file tcl/mcast/srm-nam.tcl contains definitions that overload the agent’s send methods; this separates controltraffic originating from the agent by type. Each type is allocated a separate flowID. The traffic is separated into sessionmessages (flowid = 40), requests (flowid = 41), and repair messages (flowid = 42). The base flowid can be changed by settingglobal variable ctrlFid to one less than the desired flowid before sourcing srm-nam.tcl. To do this, the simulation scriptmust source srm-nam.tcl before creating any SRM agents. This is useful for analysis of traffic traces, or for visualizationin nam.Application Data Handling The agent does not generate any application data on its own; instead, the simulation user canconnect any traffic generation module to any SRM agent to generate data. The following code demonstrates how a trafficgeneration agent can be attached to an SRM agent:set packetSize 210set exp0 [new Application/Traffic/Exponential]$exp0 set packetSize_ $packetSize$exp0 set burst_time_ 500ms$exp0 set idle_time_ 500ms$exp0 set rate_ 100k;# configure traffic generator$exp0 attach-agent $srm0$srm0 set packetSize_ $packetSize$srm0 set tg_ $exp0$srm0 set app_fid_ 0;# attach application to SRM agent;# to generate repair packets of appropriate size;# pointer to traffic generator object;# fid value for packets generated by traffic generatorThe user can attach any traffic generator to an SRM agent. The SRM agent will add the SRM headers, set the destinationaddress to the multicast group, and deliver the packet to its target. The SRM header contains the type of the message, theidentity of the sender, the sequence number of the message, and (for control messages), the round for which this message isbeing sent. Each data unit in SRM is identified as 〈sender’s id, message sequence number〉.The SRM agent does not generate its own data; it does not also keep track of the data sent, except to record the sequencenumbers of messages received in the event that it has to do error recovery. Since the agent has no actual record of past data,it needs to know what packet size to use for each repair message. Hence, the instance variable packetSize_ specifies thesize of repair messages generated by the agent.Starting the Agent and Traffic GeneratorThe agent and the traffic generator must be started separately.$srm start$exp0 startAlternatively, the traffic generator can be started from the SRM Agent:$srm0 start-sourceAt start, the agent joins the multicast group, and starts generating session messages. The start-source triggers thetraffic generator to start sending data.1 Note that the trace data can also be used to gather certain kinds of trace data. We will illustrate this later.309
36.1.2 Other Configuration ParametersIn addition to the above parameters, the SRM agent supports additional configuration variables. Each of the variables describedin this section is both an OTcl class variable and an OTcl object’s instance variable. Changing the class variablechanges the default value for all agents that are created subsequently. Changing the instance variable of a particular agentonly affects the values used by that agent. For example,Agent/SRM set D1_ 2.0$srm set D1_ 2.0;# Changes the class variable;# Changes D1_ for the particular $srm object onlyThe default request and repair timer parameters [11] for each SRM agent are:Agent/SRM set C1_ 2.0 ;# request parametersAgent/SRM set C2_ 2.0Agent/SRM set D1_ 1.0 ;# repair parametersAgent/SRM set D2_ 1.0It is thus possible to trivially obtain two flavors of SRM agents based on whether the agents use probabilistic or deterministicsuppression by using the following definitions:Class Agent/SRM/Deterministic -superclass Agent/SRMAgent/SRM/Deterministic set C2_ 0.0Agent/SRM/Deterministic set D2_ 0.0Class Agent/SRM/Probabilistic -superclass Agent/SRMAgent/SRM/Probabilistic set C1_ 0.0Agent/SRM/Probabilistic set D1_ 0.0In a later section (Section 36.7), we will discuss other ways of extending the SRM agent.Timer related functions are handled by separate objects belonging to the class SRM. Timers are required for loss recovery andsending periodic session messages. There are loss recovery objects to send request and repair messages. The agent creates aseparate request or repair object to handle each loss. In contrast, the agent only creates one session object to send periodicsession messages. The default classes the express each of these functions are:Agent/SRM set requestFunction_Agent/SRM set repairFunction_Agent/SRM set sessionFunction_"SRM/request""SRM/repair""SRM/session"Agent/SRM set requestBackoffLimit_ 5 ;# parameter to requestFunction_Agent/SRM set sessionDelay_ 1.0 ;# parameter to sessionFunction_The instance procedures requestFunction{}, repairFunction{}, and sessionFunction{} can be used tochange the default function for individual agents. The last two lines are specific parameters used by the request and sessionobjects. The following section (Section 36.2) describes the implementation of theses objects in greater detail.310
- Page 259 and 260: Global Actions Once the detailed ac
- Page 261 and 262: This dumps next hop information in
- Page 263 and 264: $ns mrtproto ST;# specify shared tr
- Page 265 and 266: Dense Mode The Dense Mode protocol
- Page 267 and 268: and unique label (id). Thus, “inc
- Page 269 and 270: add-iif{ifid link},add-oif{link if}
- Page 271 and 272: CtrMcastComp is the centralised mul
- Page 273 and 274: $ns_ mrtproto This command specifi
- Page 275 and 276: Chapter 31Network DynamicsThis chap
- Page 277 and 278: v 0.8123 link-up 3 5v 0.8123 link-u
- Page 279 and 280: The first argument is the time at w
- Page 281 and 282: $ns_ rtmodel This command defines
- Page 283 and 284: $ns set-address-format hierarchical
- Page 285 and 286: 32.4 Hierarchical Routing with Sess
- Page 287 and 288: Chapter 33UDP Agents33.1 UDP Agents
- Page 289 and 290: Chapter 34TCP AgentsThis section de
- Page 291 and 292: set ns [new Simulator]set node1 [$n
- Page 293 and 294: 34.2.1 The Base TCP SinkThe base TC
- Page 295 and 296: Agent/TCP/FullTcp set dupseg_fix_ t
- Page 297 and 298: 34.5 Tracing TCP DynamicsThe behavi
- Page 299 and 300: Chapter 35SCTP AgentsThis chapter d
- Page 301 and 302: Figure 35.1: Example of a Multihome
- Page 303 and 304: Note: the actual value of these tra
- Page 305 and 306: 1.526624 1 4 sctp 1500 -------D 0 1
- Page 307 and 308: $ns at 5.0 "finish"$ns run35.5.2 Mu
- Page 309: Chapter 36Agent/SRMThis chapter des
- Page 313 and 314: 3.6274 n 0 m r 1 type repair servi
- Page 315 and 316: 3.6029 n 3 m r 2 Q NTIMER at 3.730
- Page 317 and 318: 36.4 Loss Detection—The Class SRM
- Page 319 and 320: same packet. The repair objet does
- Page 321 and 322: }hdr_asrm* seh = (hdr_asrm*) p->acc
- Page 323 and 324: set grp [Node allocaddr]$srm set ds
- Page 325 and 326: #set up the multicast routingDM set
- Page 327 and 328: 37.3 Architecture of the PLM Protoc
- Page 329 and 330: We add in void PLMLossMonitor::recv
- Page 331 and 332: Part VIApplication330
- Page 333 and 334: Traffic generatorsApplication/Traff
- Page 335 and 336: • recv(int nbytes)—Announces th
- Page 337 and 338: 1. EXPOO_Traffic—generates traffi
- Page 339 and 340: set src [new Agent/UDP]set sink [ne
- Page 341 and 342: Application FTP FTP objects produce
- Page 343 and 344: send_data(ADU)Application(HttpApp,
- Page 345 and 346: 39.1.4 Transmitting user data over
- Page 347 and 348: and teardown of connections. Only O
- Page 349 and 350: TclObjectPagePoolPagePool/CompMathP
- Page 351 and 352: PagePool/ProxyTrace takes these two
- Page 353 and 354: }int id_; // object IDWebTrafSessio
- Page 355 and 356: An Http/Server object waits for inc
- Page 357 and 358: set tmp [new RandomVariable/Exponen
- Page 359 and 360: Object Type Event Type Explaination
Other useful configur<strong>at</strong>ion parameters are to assign a separ<strong>at</strong>e flow id to traffic origin<strong>at</strong>ing from this agent, to open a log filefor st<strong>at</strong>istics, <strong>and</strong> a trace file for trace d<strong>at</strong>a 1 .<strong>The</strong> file tcl/mcast/srm-nam.tcl contai<strong>ns</strong> definitio<strong>ns</strong> th<strong>at</strong> overload the agent’s send methods; this separ<strong>at</strong>es controltraffic origin<strong>at</strong>ing from the agent by type. Each type is alloc<strong>at</strong>ed a separ<strong>at</strong>e flowID. <strong>The</strong> traffic is separ<strong>at</strong>ed into sessionmessages (flowid = 40), requests (flowid = 41), <strong>and</strong> repair messages (flowid = 42). <strong>The</strong> base flowid can be changed by settingglobal variable ctrlFid to one less than the desired flowid before sourcing srm-nam.tcl. To do this, the simul<strong>at</strong>ion scriptmust source srm-nam.tcl before cre<strong>at</strong>ing any SRM agents. This is useful for analysis of traffic traces, or for visualiz<strong>at</strong>ionin nam.Applic<strong>at</strong>ion D<strong>at</strong>a H<strong>and</strong>ling <strong>The</strong> agent does not gener<strong>at</strong>e any applic<strong>at</strong>ion d<strong>at</strong>a on its own; i<strong>ns</strong>tead, the simul<strong>at</strong>ion user canconnect any traffic gener<strong>at</strong>ion module to any SRM agent to gener<strong>at</strong>e d<strong>at</strong>a. <strong>The</strong> following code demo<strong>ns</strong>tr<strong>at</strong>es how a trafficgener<strong>at</strong>ion agent can be <strong>at</strong>tached to an SRM agent:set packetSize 210set exp0 [new Applic<strong>at</strong>ion/Traffic/Exponential]$exp0 set packetSize_ $packetSize$exp0 set burst_time_ 500ms$exp0 set idle_time_ 500ms$exp0 set r<strong>at</strong>e_ 100k;# configure traffic gener<strong>at</strong>or$exp0 <strong>at</strong>tach-agent $srm0$srm0 set packetSize_ $packetSize$srm0 set tg_ $exp0$srm0 set app_fid_ 0;# <strong>at</strong>tach applic<strong>at</strong>ion to SRM agent;# to gener<strong>at</strong>e repair packets of appropri<strong>at</strong>e size;# pointer to traffic gener<strong>at</strong>or object;# fid value for packets gener<strong>at</strong>ed by traffic gener<strong>at</strong>or<strong>The</strong> user can <strong>at</strong>tach any traffic gener<strong>at</strong>or to an SRM agent. <strong>The</strong> SRM agent will add the SRM headers, set the destin<strong>at</strong>ionaddress to the multicast group, <strong>and</strong> deliver the packet to its target. <strong>The</strong> SRM header contai<strong>ns</strong> the type of the message, theidentity of the sender, the sequence number of the message, <strong>and</strong> (for control messages), the round for which this message isbeing sent. Each d<strong>at</strong>a unit in SRM is identified as 〈sender’s id, message sequence number〉.<strong>The</strong> SRM agent does not gener<strong>at</strong>e its own d<strong>at</strong>a; it does not also keep track of the d<strong>at</strong>a sent, except to record the sequencenumbers of messages received in the event th<strong>at</strong> it has to do error recovery. Since the agent has no actual record of past d<strong>at</strong>a,it needs to know wh<strong>at</strong> packet size to use for each repair message. Hence, the i<strong>ns</strong>tance variable packetSize_ specifies thesize of repair messages gener<strong>at</strong>ed by the agent.Starting the Agent <strong>and</strong> Traffic Gener<strong>at</strong>or<strong>The</strong> agent <strong>and</strong> the traffic gener<strong>at</strong>or must be started separ<strong>at</strong>ely.$srm start$exp0 startAltern<strong>at</strong>ively, the traffic gener<strong>at</strong>or can be started from the SRM Agent:$srm0 start-sourceAt start, the agent joi<strong>ns</strong> the multicast group, <strong>and</strong> starts gener<strong>at</strong>ing session messages. <strong>The</strong> start-source triggers thetraffic gener<strong>at</strong>or to start sending d<strong>at</strong>a.1 Note th<strong>at</strong> the trace d<strong>at</strong>a can also be used to g<strong>at</strong>her certain kinds of trace d<strong>at</strong>a. We will illustr<strong>at</strong>e this l<strong>at</strong>er.309