12.07.2015 Views

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 ...

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

7.5.2 Configur<strong>at</strong>ionRunning a JoBS simul<strong>at</strong>ion requires to cre<strong>at</strong>e <strong>and</strong> configure the JoBS “link(s)”, to cre<strong>at</strong>e <strong>and</strong> configure the Markers <strong>and</strong>Demarkers in charge of marking/demarking the traffic, to <strong>at</strong>tach an applic<strong>at</strong>ion-level d<strong>at</strong>a source (traffic gener<strong>at</strong>or), <strong>and</strong> tostart the traffic gener<strong>at</strong>or.Initial Setupset <strong>ns</strong> [new Simul<strong>at</strong>or]Queue/JoBS set drop_front_ falseQueue/JoBS set trace_hop_ trueQueue/JoBS set adc_resolution_type_ 0Queue/JoBS set shared_buffer_ 1Queue/JoBS set mean_pkt_size_ 4000Queue/Demarker set demarker_arrvs1_ 0Queue/Demarker set demarker_arrvs2_ 0Queue/Demarker set demarker_arrvs3_ 0Queue/Demarker set demarker_arrvs4_ 0Queue/Marker set marker_arrvs1_ 0Queue/Marker set marker_arrvs2_ 0Queue/Marker set marker_arrvs3_ 0Queue/Marker set marker_arrvs4_ 0set router(1) [$<strong>ns</strong> node]set router(2) [$<strong>ns</strong> node]set source [$<strong>ns</strong> node]set sink [$<strong>ns</strong> node]set bw 10000000set delay 0.001set buff 500;# preamble initializ<strong>at</strong>ion;# use drop-tail;# enable st<strong>at</strong>istic traces;# see ‘‘comm<strong>and</strong>s <strong>at</strong> a glance’’;# all classes share a common buffer;# we expect to receive 500-Byte pkts;# reset arrivals everywhere;# set first router;# set second router;# set source;# set traffic sink;# 10 Mbps;# 1 ms;# 500 packetsCre<strong>at</strong>ing the JoBS links$<strong>ns</strong> duplex-link $router(1) $router(2) $bw $delay JoBS;# Cre<strong>at</strong>es the JoBS link$<strong>ns</strong>_ queue-limit $router(1) $router(2) $buffset l [$<strong>ns</strong>_ get-link $router(1) $router(2)]set q [$l queue]$q init-rdcs -1 2 2 2 ;# Classes 2, 3 <strong>and</strong> 4 are bound by proportional delay differenti<strong>at</strong>ion with a factor of 2$q init-rlcs -1 2 2 2 ;# Classes 2, 3 <strong>and</strong> 4 are bound by proportional loss differenti<strong>at</strong>ion with a factor of 2$q init-alcs 0.01 -1 -1 -1 ;# Class 1 is provided with a loss r<strong>at</strong>e bound of 1%$q init-adcs 0.005 -1 -1 -1 ;# Class 1 is provided with a delay bound of 5 ms$q init-arcs -1 -1 -1 500000 ;# Class 4 is provided with a minimumthroughput of 500 Kbps$q link [$l link] ;# <strong>The</strong> link is <strong>at</strong>tached to the queue (required)$q trace-file jobstrace ;# Trace per-hop, per-class metrics to the file jobstrace$q sampling-period 1 ;# Reevalu<strong>at</strong>e r<strong>at</strong>e alloc<strong>at</strong>ion upon each arrival$q id 1 ;# Assig<strong>ns</strong> an ID of 1 to the JoBS queue$q initialize ;# Proceed with the initializ<strong>at</strong>ion80

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

Saved successfully!

Ooh no, something went wrong!