The 3rd NS (v2) Sim ulator W orkshop br ought to you by - - PDF document

the 3rd ns v2 sim ulator w orkshop br ought to you by
SMART_READER_LITE
LIVE PREVIEW

The 3rd NS (v2) Sim ulator W orkshop br ought to you by - - PDF document

The 3rd NS (v2) Sim ulator W orkshop br ought to you by Kevin F all La wrence Berk eley National Lab oratory kfal l@e e.lbl.gov http://www-nr g.e e.lbl.gov/kfal l AND Kannan V aradhan (formerly at USC/ISI)


slide-1
SLIDE 1 The 3rd NS (v2) Sim ulator W
  • rkshop
br
  • ught
to you by Kevin F all La wrence Berk eley National Lab
  • ratory
kfal l@e e.lbl.gov http://www-nr g.e e.lbl.gov/kfal l AND Kannan V aradhan (formerly at USC/ISI) kannan@c atarina.usc.e du http://www.isi.e du/~kannan August 7, 1998
slide-2
SLIDE 2 Audience and Outline
  • Audience
{ net w
  • rk
researc hers { educators { dev elop ers
  • T
  • pics
for to da y { VINT pro ject goals and status (Kevin) { arc hitecture plus some history (Kevin/Kannan) {
  • v
erview
  • f
ma jor comp
  • nen
ts (Kevin) { pro ject/co de status (Kevin) { details
  • f
ma jor comp
  • nen
ts (Kevin) { em ulation facilit y (Kevin) { C++/OTcl link age and sim ulation debugging (Kannan) { scenario generation and session-lev el supp
  • rt
(Kannan) { m ulticast and reliable m ulticast (Kannan) { a complex link: CBQ (Kevin) { p erformance issues (Kannan) { discussion and futures (Ev ery
  • ne)
3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 2
slide-3
SLIDE 3 NSv2 Arc hitecture
  • Ob
ject-orien ted structure { ev
  • lution
from NSv1 (C++ with regular Tcl) {
  • b
jects implemen ted in C++ and \OTcl" { OTcl:
  • b
ject-orien ted extension to Tcl (from Da vid W etherall at MIT/LCS for V uSystem) (no w supp
  • rted
b y UCB Mash group)
  • Con
trol/\Data" separation { con trol
  • p
erations in OTcl { data pass through C++
  • b
jects (for sp eed)
  • Mo
dular approac h { ne-grain
  • b
ject decomp
  • sition
{ p
  • sitives:
comp
  • sible,
re-usable { negatives: m ust \plum b" in OTcl, dev elop er m ust b e comfortable with b
  • th
en vironmen ts, to
  • ls
(fairly steep learning curv e) 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 3
slide-4
SLIDE 4 Dev elopmen t Status
  • sim
ulator co de basis for VINT Pro ject
  • 5ish
p eople activ ely con tributing to the co de base
  • con
tributions from: Xero x P AR C, USC/ISI, UCB, LBNL
  • Some
appro ximate n um b ers: { 44K lines
  • f
C++ co de { 14K lines
  • f
OTcl supp
  • rt
co de { 40K lines
  • f
test suites, examples { 10K lines
  • f
do cumen tation!
  • Users
w e kno w ab
  • ut:
{ 82 univ ersities, 39 companies, 4 US go v ernmen t sites
  • See
main VINT and NS-2 w eb pages at: http://netweb.usc.edu/vint http://www-mash.cs.berkeley.edu/ns/ ns.htm l
  • Op
en mailing lists: { ns-users@mash.cs.b erk eley .edu { ns-announce@mash.cs.b erk eley .edu
  • T
  • subscrib
e: { ma jordomo@mash.cs.b erk eley .edu 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 4
slide-5
SLIDE 5 Directory Structure
  • common
directory shared b et w een MASH (UCB) and VINT pro jects

Tcl

conf ... WORK common vint doc ns-2 nam lib test ex

bin

tcl www

3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 5
slide-6
SLIDE 6 Class Hierarc h y
  • T
  • p-lev
el classes implemen t simple abstractions:

NewReno Replicator

AddrClassifier

Agent/Message/Prober

McastClassifier

Queue Classifier

Agent/Message

Delay Agent/TCP TclObject Connector

Shared with MASH Project:

NsObject Trace/Drop Trace/Hop Trace RED Agent Trace/Enq ... ... Trace/Deq Reno DropTail

3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 6
slide-7
SLIDE 7 Example: a no de
  • No
de: a collection
  • f
agents and classiers
  • Agen
ts: usually proto col endp
  • in
ts and related
  • b
jects
  • Classiers:
pac k et dem ultiplexers

Agent

Port Classifier Local Addr

Link Link

Classifier Addr

Node

Node.entry

Agent Agent

  • Note
that the no de \routes" to itself
  • r
to do wnstream links 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 7
slide-8
SLIDE 8 Example: a link
  • k
eeps trac k
  • f
\from" and \to" No de
  • b
jects
  • generally
encapsulates a queue, dela y and p
  • ssibly
ttl c hec k er

Queue split classes (OTcl class) Link Delay

  • Man
y more complex
  • b
jects built from this base 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 8
slide-9
SLIDE 9 Example: routers
  • routers
(unicast and m ulticast) b y \plum bing"

Node ... ... Node

Node.entry

Link Link Link

  • m
ulticast router adds additional classiers and replicators
  • Replicators:
dem uxers with m ultiple fanout

Addr Replicator Replicator Addr Classifier Classifier unicast? Mcast Classifier

MulticastNode

multicast?

... ...

(S1, G1) (S2, G2) (S3, G3)

Link Link

Node.entry

Link

3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 9
slide-10
SLIDE 10 OTcl Basics
  • See
the page at ftp://ftp.tns.lcs.mit.edu/pub/otcl/
  • b
ject
  • rien
ted extension to tcl
  • classes
are
  • b
jects with supp
  • rt
for inheritance
  • Analogs
to C++: { C++ has single class decl ) OTcl attac hes metho ds to
  • b
ject
  • r
class { C++ constructor/destructor ) OTcl init/destro y metho ds { this ) $self { OTcl metho ds alw a ys \virtual" { C++ shado w ed metho ds called explicitly with scop e
  • p
erator ) OTcl metho ds com bined implicitly with $self next { C++ static v ariables ) OTcl class v ariables { (m ultiple inheritance is supp
  • rted)
  • F
  • r
use with tcl8.0, see http://www-mash.cs.berkeley.edu/dist 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 10
slide-11
SLIDE 11 OTcl Basics (con td)
  • use
instvar and instpr
  • c
to dene/access mem b er functions and v ariables
  • Example:
Class Counter Counter instproc init fg f $self instvar cnt set cnt g Counter instproc bump fg f $self instvar cnt incr cnt g Counter instproc val fg f $self instvar cnt return $cnt g Counter c c val ! c bump c val ! 1 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 11
slide-12
SLIDE 12 C++/OTcl Split Ob jects
  • Split
  • b
jects: implemen t metho ds in either language
  • new
and delete set c [new Counter] $c val
  • >
$c bump $c val
  • >
1 delete $c
  • Dene
instance v ariables in either C++
  • r
OTcl: Counter::Counter() f bind("cnt ", &value ); value = 10; ... g vs. $self set cnt 10 bind() simply uses Tcl T r ac eV ar 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 12
slide-13
SLIDE 13 Example: a simple sim ulation
  • A
small but complete sim ulation script: { set up 4-no de top
  • logy
and
  • ne
bulk-data transfer TCP { arrange to trace the queue
  • n
the r1-k1 link { place trace
  • utput
in the le simp.out.tr
  • #
Create a simple four node topology: # s1 # \ # 8Mb,5ms \ 0.8Mb,50ms # r1
  • k1
# 8Mb,5ms / # / # s2 set stoptime 10.0 set ns [new Simulator] set node_(s1) [$ns node] set node_(s2) [$ns node] set node_(r1) [$ns node] set node_(k1) [$ns node] $ns duplex-link $node_(s1) $node_(r1) 8Mb 5ms DropTail $ns duplex-link $node_(s2) $node_(r1) 8Mb 5ms DropTail $ns duplex-link $node_(r1) $node_(k1) 800Kb 50ms DropTail $ns queue-limit $node_(r1) $node_(k1) 6 $ns queue-limit $node_(k1) $node_(r1) 6 set tcp1 [$ns create-connection TCP $node_(s1) TCPSink $node_(k1) 0] $tcp1 set window_ 50 $tcp1 set packetSize_ 1500 # Set up FTP source set ftp1 [$tcp1 attach-source FTP] set tf [open simp.out.tr w] $ns trace-queue $node_(r1) $node_(k1) $tf $ns at 0.0 "$ftp1 start" $ns at $stoptime "close $tf; puts \"simulation complete\"; $ns halt" $ns run 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 13
slide-14
SLIDE 14 Example: a simple sim ulation (con t)
  • The
trace le pro duced lo
  • ks
lik e this: + 0.0065 2 3 tcp 1500
  • 0.0
3.0
  • 0.0065
2 3 tcp 1500
  • 0.0
3.0 + 0.23344 2 3 tcp 1500
  • 0.0
3.0 1 2
  • 0.23344
2 3 tcp 1500
  • 0.0
3.0 1 2 + 0.23494 2 3 tcp 1500
  • 0.0
3.0 2 3
  • 0.24844
2 3 tcp 1500
  • 0.0
3.0 2 3 + 0.46038 2 3 tcp 1500
  • 0.0
3.0 3 6
  • 0.46038
2 3 tcp 1500
  • 0.0
3.0 3 6 + 0.46188 2 3 tcp 1500
  • 0.0
3.0 4 7 + 0.47538 2 3 tcp 1500
  • 0.0
3.0 5 8 ... + 0.98926 2 3 tcp 1500
  • 0.0
3.0 25 40 + 0.99076 2 3 tcp 1500
  • 0.0
3.0 26 41 d 0.99076 2 3 tcp 1500
  • 0.0
3.0 26 41
  • 1.00426
2 3 tcp 1500
  • 0.0
3.0 21 36 + 1.00426 2 3 tcp 1500
  • 0.0
3.0 27 42 + 1.00576 2 3 tcp 1500
  • 0.0
3.0 28 43 d 1.00576 2 3 tcp 1500
  • 0.0
3.0 28 43
  • 1.01926
2 3 tcp 1500
  • 0.0
3.0 22 37 + 1.01926 2 3 tcp 1500
  • 0.0
3.0 29 44 + 1.02076 2 3 tcp 1500
  • 0.0
3.0 30 45 d 1.02076 2 3 tcp 1500
  • 0.0
3.0 30 45
  • 1.03426
2 3 tcp 1500
  • 0.0
3.0 23 38
  • 1.04926
2 3 tcp 1500
  • 0.0
3.0 24 39
  • 1.06426
2 3 tcp 1500
  • 0.0
3.0 25 40 ... 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 14
slide-15
SLIDE 15 The Sim ulator
  • Sim
ulator API is a set
  • f
metho ds b elonging to a simulator
  • b
ject:
  • Create
a sim ulator with: set ns [new Simulator]
  • What
this do es: { initialize the pac k et format (calls create packetformat) { create a sc heduler (defaults to using a calendar queue)
  • Sc
heduler: { handles time, timers and ev en ts (pac k ets), deferred executions (\A Ts") { Scheduler/List
  • link
ed-list sc heduler { Scheduler/Heap
  • heap-based
sc heduler { Scheduler/Calendar
  • calendar-queue
sc heduler { Scheduler/RealTime
  • real-time
(for em ulation) { see Reev es, "Complexit y Analyses
  • f
Ev en t Set Algorithms", The Computer Journal, 27(1), 1984 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 15
slide-16
SLIDE 16 Using the sc heduler
  • Sc
heduler API is through Sim ulator
  • b
ject: Simulator instproc now ;# r eturn sche duler's notion
  • f
curr ent time Simulator instproc at args ;# sche dule exe cution
  • f
c
  • de
at sp e ci- e d time Simulator instproc run args ;# start sche duler Simulator instproc halt ;# stop (p ause) the sche duler Simulator instproc create-trace type files src dst ;# cr e- ate tr ac e
  • bje
ct Simulator instproc create_packet fo rm at ;# set up the simula- tor's p acket format
  • Example:
MySim instproc begin {} { ... set ns_ [new Simulator] $ns_ use-scheduler Heap $ns_ at 300.5 "$self complete_sim" ... } MySim instproc complete_sim {} { ... } 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 16
slide-17
SLIDE 17 Sim ulator Timing
  • eac
h top
  • logy
  • b
ject has a generic receiv e metho d NsObject::recv(Packet*, Handler* h = 0)
  • most
  • b
jects ha v e single neigh b
  • r
Connector::target
  • cut-thr
  • ugh
transfers: send pac k et directly to neigh b
  • r
without in v
  • lving
sc heduler Connector::send(Packet* p) f target
  • >recv(p);
g
  • sche
duling b arriers: { an y p
  • in
t that adv ances time in to future (i.e., dela y elemen t) { need in ter-ob ject \proto col" to decouple timing { barrier tak es non-n ull Handler { sc hedule dela y and in v
  • k
e handler
  • n
completion { example: queue/dela y
  • b
jects (later) 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 17
slide-18
SLIDE 18 Mathematical Supp
  • rt
  • Random
n um b er generation { RNG implemen ted in sim ulator (should pro duce same results
  • n
v arious platforms) { based
  • n
S. P ark and K Miller, CA CM 31:10, Oct. 1988 { supp
  • rt
for m ultiple streams { dieren t seeding
  • ptions
  • Random
v ariables { distributions applied to RNG streams { distributions: uniform, exp
  • nen
tial, pareto, constan t, h yp er- exp
  • nen
tial
  • In
tegrals { appro ximation
  • f
in tegral b y discrete sums { used for a v erage queue size computations
  • Samples
{ collect samples { pro vides mean, v ariance, sum, and coun t 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 18
slide-19
SLIDE 19 P ac k ets
  • pac
k ets are events (ma y b e sc heduled to \arriv e")
  • con
tain header section and (sometimes) data
  • header
section is a cascade
  • f
all in-use headers
  • all
pac k ets con tain a c
  • mmon
he ader: { pac k et size
  • used
to compute transmission time { timestamp, t yp e, uid, in terface lab el (for debugging, and m ulticast routing)
  • new
proto col agen ts ma y need to dene new headers 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 19
slide-20
SLIDE 20 P ac k et Header F
  • rmat

hdrlen_ ip header body tcp header body rtp header body trace header body next_

Packet

at compile time at compile time size determined at compile time size determined at compile time size determined size determined points to next packet in either free list or in a PacketQueue bits() accessdata() packet data Size determined at simulator config time, stored in hdrlen_

Figure 1: A P ac k et Ob ject
  • header
con ten ts are constructed at sim ulator initialization time
  • p
erformed b y create packetformat 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 20
slide-21
SLIDE 21 Applications

timeout

Application Agent

idle (resume), recv data send, sendmsg, sendto, connect, close, listen, attachApp

  • Applic
ation: a mo del
  • f
an application, usually a trac source
  • has
an asso ciated agent, whic h usually corresp
  • nds
to a trans- p
  • rt
en tit y
  • in
terface is somewhat lik e so ckets 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 21
slide-22
SLIDE 22 Sources and T rac Generation
  • Applications
are
  • f
t w
  • t
yp es: sour c es and tr ac gener ators
  • Sources
are used to driv e stream transp
  • rts
(e.g. TCP)
  • T
rac generators are used to driv e connectionless transp
  • rts
(e.g. UDP)
  • Sources
{ T elnet
  • sim
ulates c haracters t yp ed b y a user { FTP
  • bulk
data transfer
  • T
rac Generators { EXPOO
  • exp
  • nen
tial
  • n/o
times, sen t at xed rate { POO
  • pareto
  • n/o
times, sen t at xed rate { CBR
  • deterministic
rate { T racT race
  • use
trace le con taining time/len pairs 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 22
slide-23
SLIDE 23 Sources
  • class
Application/Telnet { ma y sp ecify interval parameter { if zero, pic ks randomly among 10000 measured in terarriv als (TCPLIB) { if nonzero, uses scaled exp
  • nen
tial for in terarriv als { pac k et size constan t (but a v ailable via bind call) { Metho ds:
  • start
  • con
tin uous send
  • stop
  • stop
sending
  • send
n
  • send
n b ytes
  • class
Application/FTP { bulk data sender used to driv e TCP { implemen ted en tirely in OTcl { Metho ds:
  • start
  • con
tin uous send
  • stop
  • stop
sending
  • send
n
  • send
n b ytes
  • produce
n
  • send
n pac k ets
  • producemore
n
  • send
n more pac k ets 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 23
slide-24
SLIDE 24 T rac Generation
  • generate
trac according to distributions
  • r
traces
  • generally
used to driv e CBR
  • r
UDP transp
  • rt
agen ts
  • Exp
  • nen
tial (class Application/Traffic/Exponential) { exp
  • nen
tially distributed
  • n/o
times { parameters:
  • n
time,
  • time,
rate, pac k et size { what these mean:
  • burst
for exp
  • time
with mean
  • n
time
  • b
e silen t for exp
  • time
with mean
  • time
  • while
bursting, send at rate rate
  • use
appropriate in ter-departure time giv en rate/size
  • P
areto (class Application/Traffic/Pareto) { pareto distributed
  • n/o
times { (man y aggregated together can b e LRD) { parameters:
  • n
time,
  • time,
rate, shap e, pac k et size { what these mean:
  • lik
e exp
  • ,
except pareto using shap e parameter 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 24
slide-25
SLIDE 25 T race-Based T rac Generator
  • generate
trac according to trace le
  • t
w
  • classes:
Tracefile and Application/Traffic/Trace
  • trace
le uses small binary format: { rst 32-bit eld: in ter-pac k et time (microsecs) { second 32-bit eld: pac k et size (b ytes) 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 25
slide-26
SLIDE 26 Agen ts
  • A
gents: usually a transp
  • rt
proto col endp
  • in
t/en tit y (but ma y also b e used for implemen ting routing proto cols)
  • Where
they t in:

Agent

Port Classifier Local Addr

Link Link

Classifier Addr

Node

Node.entry

Agent Agent

  • What
they pro vide: { a lo cal and destination p
  • rt
address { functions for helping to generate/ll-in in pac k et elds { a base class supp
  • rting
the application in terface 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 26
slide-27
SLIDE 27 Creating a new Agen t
  • The
Agent class: class Agent : public Connector { public: Agent(int pktType); virtual ~Agent(); virtual void timeout(int tno); virtual void sendmsg(int nbytes, const char *flags = 0); virtual void send(int nbytes) { sendmsg(nbytes); } virtual void sendto(int nbytes, const char* flags, nsaddr_t dst); virtual void connect(nsaddr_t dst); virtual void close(); virtual void listen(); virtual void attachApp(Application* app); virtual int& size() { return size_; } inline nsaddr_t& addr() { return addr_; } protected: int command(int argc, const char*const* argv); void recv(Packet*, Handler*); ...
  • basic
tasks to create a new agen t: 1. decide its inheritance structure 2. create the class and ll in the API virtual functions 3. dene OTcl link age functions (later) 4. write the necessary OTcl co de to access y
  • ur
agen t
  • hardest
part ma y b e understanding the OTcl/C++ in teraction (fortunately , m uc h
  • f
this is shielded from y
  • u
if y
  • u
so c ho
  • se)
3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 27
slide-28
SLIDE 28 Example: the Message Agen t
  • pro
vides a v ery simple place to store a message
  • P
ac k et header (from message.h): struct hdr_msg { char msg_[64]; /* per-field member functions */ char* msg() { return (msg_); } int maxmsg() { return (sizeof(msg_)); } };
  • OTcl
link age (for class creation, from message.cc): static class MessageHeaderC la ss : public PacketHeaderC la ss { public: MessageHeaderCl as s( ) : PacketHeaderCl as s( "P ac ke tH ead er /M es sa ge ", sizeof(hdr_msg )) {} } class_msghdr; 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 28
slide-29
SLIDE 29 Example: the Message Agen t (con t)
  • The
class denition, constructor and v ariable link age: static class MessageClass : public TclClass { public: MessageClass() : TclClass("Agent /M es sa ge ") {} TclObject* create(int, const char*const*) { return (new MessageAgent() ); } } class_message; class MessageAgent : public Agent { public: MessageAgent(); int command(int argc, const char*const* argv); void recv(Packet*, Handler*); protected: int
  • ff_msg_;
}; MessageAgent::M es sa ge Ag en t( ) : Agent(PT_MESSAG E) { bind("packetSiz e_ ", &size_); bind("off_msg_" , &off_msg_); } 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 29
slide-30
SLIDE 30 Example: the Message Agen t (con t)
  • Main
functions: void MessageAgent::r ec v( Pa ck et * pkt, Handler*) { hdr_msg* mh = (hdr_msg*)pkt
  • >
ac ce ss (of f_ ms g_ ); ... process packet ... } int MessageAgent:: co mm an d( in t argc, const char*const* argv) { Tcl& tcl = Tcl::instance( ); // call into interp if (argc == 3) { // $obj send msgtext if (strcmp(argv[1] , "send") == 0) { Packet* pkt = allocpkt(); hdr_msg* mh = (hdr_msg*)pkt- >a cc es s(
  • f
f_ ms g_ ); const char* s = argv[2]; int n = strlen(s); if (n >= mh->maxmsg()) { tcl.result("m es sa ge too big"); Packet::free( pk t) ; return (TCL_ERROR); } strcpy(mh->msg( ), s); send(pkt, 0); return (TCL_OK); } } return (Agent::comman d( ar gc , argv)); // for inheritance } 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 30
slide-31
SLIDE 31 CBR and UDP Agen t
  • CBR
Agen t: { stands for \constan t bit rate" (not really used
  • nly
this w a y) { non-connection-orien ted sending agen t { sends pac k ets at p erio dic in terv al
  • r
quasi-p erio dically { constan t-size pac k ets
  • UDP
Agen t: { deriv ed from CBR agen t { v ery similar to CBR agen ts { uses TrafficGenerator class for pac k et sizes/times 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 31
slide-32
SLIDE 32 TCP Agen ts
  • Tw
  • categories:
  • ne-w
a y and t w
  • -w
a y (\full TCP")
  • One-w
a y v arian ts
  • f
TCP a v ailable: { Agen t/TCP
  • a
\taho e" TCP sender { Agen t/TCP/Reno
  • a
\Reno" TCP sender { Agen t/TCP/NewReno
  • Reno
with a mo dication { Agen t/TCP/Sac k1
  • TCP
with selectiv e rep eat (follo ws RF C2018) { Agen t/TCP/V egas
  • TCP
V egas { Agen t/TCP/F ac k
  • Reno
TCP with \forw ard ac kno wledge- men t" { Agen t/TCP/Session
  • shared
congestion state w/m ultiple connections { Agen t/TCP/In t
  • p
er-connection reliabilit y for use w/Session { Agen t/TCP/*/RBP
  • Reno,
V egas with Rate Based P acing { Agen t/TCP/Asym
  • TCP
mo ds for asymmetric c hannels
  • One-w
a y TCP receiving agen ts curren tly supp
  • rted
are: { Agen t/TCPSink
  • ne
A CK p er pac k et { Agen t/TCPSink/DelAc k
  • congurable
dela y p er A CK { Agen t/TCPSink/Sac k1
  • selectiv
e A CK sink (follo ws RF C2018) { Agen t/TCPSink/Sac k1/DelAc k
  • Sac
k1 with DelAc k { Agen t/TCPSink/Asym
  • sink
for Asym senders 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 32
slide-33
SLIDE 33 Tw
  • -W
a y TCP Agen ts
  • Tw
  • -w
a y TCP agen ts (b eta test): { Agen t/TCP/F ullTcp
  • pro
vides Reno functionalit y { Agen t/TCP/F ullTcp/T aho e (new) { Agen t/TCP/F ullTcp/Sac k (new)
  • One-w
a y and t w
  • -w
a y TCPs are not in terop erable 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 33
slide-34
SLIDE 34 Base TCP Agen ts
  • TCP
(T aho e), TCP/Reno, and TCP/NewReno
  • Common
features: { computations all in pac k et units w/congurable pac k et size { fast retransmit { slo w-start and congestion a v
  • idance
{ dynamic R TT estimation and R TX timeout assignmen t { sim ulated (constan t) receiv er's adv ertised windo w
  • T
aho e TCP: { p erform slo w-start
  • n
an y loss (R TO
  • r
fast retransmit) { no fast reco v ery
  • Reno
TCP: { fast r e c
  • very:
inate cw nd b y dup ac k coun t un til new A CK { slo w-start
  • n
R TO {
  • n
fast retransmit: cw nd cur w in=2 , ssthr esh cw nd
  • \Newreno"
TCP: { mo dest mo dication to Reno TCP {
  • nly
exit fast reco v ery after A CK for highest segmen t arriv es { helps reduce \stalling" due to m ultiple pac k et drops in a windo w 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 34
slide-35
SLIDE 35 Other TCP Agen ts
  • TCP/Sack,
TCP/Fack, and TCP/Vegas
  • Selectiv
e A CK TCP: { SA CK sim ulation based
  • n
RF C2018 { A CKs carry extra information indicating receiv ed segmen ts { requires SA CK-a w are sink { sender a v
  • ids
sending redundan t info { default to 3 \SA CK blo c ks" (for using timestamps, see RF C2018)
  • blo
c k con tains start/end sequence n um b ers
  • blo
c k con taining most recen tly receiv ed segmen t alw a ys presen t { regular A CK n um b er still giv es nal sa y
  • F
ac k TCP: { \forw ard A CK" TCP (exp erimen tal, see SIGCOMM '96) { use SA CK info for estimate
  • f
pac k ets in the net w
  • rk
{
  • v
erdamping algorithm (to limit slo w-start
  • v
ersho
  • t)
{ ramp do wn algorithm (for transmission smo
  • thing)
  • V
egas TCP: { con tributed co de from T ed Kuo (NC State Univ) 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 35
slide-36
SLIDE 36 TCP Agen t P arameters
  • Common
conguration parameters and defaults for TCP agen ts: Agent/TCP set maxburst_ ;# max pkts emitte d due to 1 r e cvd Agent/TCP set maxcwnd_ ;# max b
  • und
  • n
c
  • ngestion
window Agent/TCP set syn_ false ;# do SYN exchange prior to data xfer Agent/TCP set tcpip_base_hdr_size_ 40 ;# size
  • f
TCP/IP hdr, no
  • pts
Agent/TCP set timestamps_ false ;# due RF C1323-style time stamps Agent/TCP set window_ 20 ;# max b
  • und
  • n
window size Agent/TCP set windowInit_ 1 ;# initial/r eset value
  • f
cwnd Agent/TCP set windowOption_ 1 ;# c
  • ng
avoid algorithm (1: standar d) Agent/TCP set windowConstant_ 4 ;# use d
  • nly
when windowOption != 1 Agent/TCP set windowThresh_ 0.002 ;# use d in c
  • mputing
aver age d window Agent/TCP set
  • verhead_
;# !=0 adds r andom time b etwe en sends Agent/TCP set ecn_ ;# TCP should r e act to e cn bit Agent/TCP set packetSize_ 1000 ;# p acket size use d by sender (bytes) Agent/TCP set bugFix_ true ;# se e do cumentation Agent/TCP set slow_start_restart_ true ;# do slow-start after id le p erio d Agent/TCP set tcpTick_ 0.1 ;# timer gr anularity in se c (.1 is NONST AND ARD) Agent/TCP set maxrto_ 100000 ;# b
  • und
  • n
R TO (se c
  • nds)
Agent/TCP set srtt_init_ ;# initial value for smo
  • the
d rtt est Agent/TCP set rttvar_init_ 12 ;# initial value for rtt var est Agent/TCP set rtxcur_init 6.0 ;# initial value for curr ent rtx timer Agent/TCP set T_SRTT_BITS 3 ;# # bits after binary p
  • int
for SR TT Agent/TCP set T_RTTVAR_BITS 2 ;# # bits after binary p
  • int
for R TTV AR Agent/TCP set rttvar_exp_ 2 ;# exp
  • nent
  • f
2 which multiples rttvar
  • Dynamic
v alues
  • f
in terest: Agent/TCP set dupacks_ ;# duplic ate A CK c
  • unter
Agent/TCP set ack_ ;# highest A CK r e c eive d Agent/TCP set cwnd_ ;# c
  • ngestion
window (p ackets) Agent/TCP set awnd_ ;# aver age d cwnd (exp erimental) Agent/TCP set ssthresh_ ;# slow-stat thr eshold (p ackets) Agent/TCP set rtt_ ;# rtt sample Agent/TCP set srtt_ ;# smo
  • the
d (aver age d) rtt Agent/TCP set rttvar_ ;# me an deviation
  • f
rtt samples Agent/TCP set backoff_ ;# curr ent R TO b acko factor Agent/TCP set maxseq_ ;# max (p acket) se q numb er sent 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 36
slide-37
SLIDE 37 TCP Sink Agen ts
  • Sinks
for
  • ne-w
a y TCP senders
  • T
yp es { standard sinks, dela y ed-A CK sinks, SA CK sinks
  • Standard
sinks: { generate
  • ne
A CK p er pac k et receiv ed { A CK n um b er
  • v
erloaded in \sequence n um b er" pac k et eld
  • Dela
y ed-A CK sinks: { same as standard, but with v ariable dela y added b et w een A CKs { time to dela y A CKs sp ecied in seconds
  • SA
CK sinks: { generates additional information for SA CK capable sender { congurable maxSackBlocks parameter
  • Asym
sinks: { A CK pacing 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 37
slide-38
SLIDE 38 Tw
  • -W
a y TCP (\F ullTCP")
  • most
TCP
  • b
jects are
  • ne-w
a y (and require a source/sink pair)
  • real
TCP can b e bi-directional
  • sim
ultaneous t w
  • -w
a y data transfer alters TCP dynamics con- siderably
  • (considered
\b eta" at this p
  • in
t{ requesting feedbac k)
  • the
TCP/FullTcp agen t: { follo ws closely to \Reno" TCP implemen tation in 4.4 BSD { b yte-orien ted transfers { t w
  • -w
a y data supp
  • rted
{ most
  • f
the connection establishmen t/teardo wn { symmetric:
  • nly
  • ne
agen t t yp e used for b
  • th
sides
  • Dierences
from the \real thing": { no receiv er's adv ertised windo w/p ersist mo de { no urgen t p
  • in
ter { no 2MSL w ait { no RST segmen ts
  • No
w supp
  • rts
T aho e, NewReno, and Sac k v arian ts 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 38
slide-39
SLIDE 39 F ullTCP P arameters
  • P
arameters and defaults: Agent/TCP/FullTcp set segsperack_ 1 ;# se gs r e c eive d b efor e gener ating A CK Agent/TCP/FullTcp set segsize_ 536 ;# se gment size (MSS size for bulk xfers) Agent/TCP/FullTcp set tcprexmtthresh_ 3 ;# dupA CKs thr esh to trigger fast r exmt Agent/TCP/FullTcp set iss_ ;# initial send se quenc e numb er Agent/TCP/FullTcp set nodelay_ false ;# disable sender-side Nagle algorithm Agent/TCP/FullTcp set data_on_syn_ false ;# send data
  • n
initial SYN? Agent/TCP/FullTcp set dupseg_fix_ true ;# avoid fast rxt due to dup se gs+acks Agent/TCP/FullTcp set dupack_reset_ false ;# r eset dupA CK ctr
  • n
!0 len data se g s c
  • ntaining
dup A CKs Agent/TCP/FullTcp set interval_ 0.1 ;# delaye d A CK interval Agent/TCP/FullTcp set close_on_empty_ false ;# close c
  • nn
after send al l data Agent/TCP/FullTcp set ts_option_size_ 10 ;# size
  • f
rfc1323 ts
  • ption
(bytes) Agent/TCP/FullTcp set reno_fastrecov_ true ;# c
  • ngestion
window ination Agent/TCP/FullTcp set pipectrl_ false ;# use "pip e" mo del c
  • ngestion
ctrl Agent/TCP/FullTcp set
  • pen_cwnd_on_pack_
true ;# incr e ase cwnd
  • n
p artial acks Agent/TCP/FullTcp/Newre no set recov_maxburst_ 2 ;# maxburst during r e c
  • very
Agent/TCP/FullTcp/Sack set sack_block_size_ 8 ;# # bytes in a SA CK blo ck Agent/TCP/FullTcp/Sack set sack_option_size_ 2 ;# # bytes in
  • pt
hdr Agent/TCP/FullTcp/Sack set max_sack_blocks_ 3 ;# # max #
  • f
sack blks 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 39
slide-40
SLIDE 40 R TP and R TCP Agen ts
  • R
TP
  • \Real-time"
(transp
  • rt)
proto col (RF C 1889) { implemen ted as Agent/CBR/RTP
  • b
ject { sp ecial \R TP" header (con tains seq n um b er and srcID) { sends data p erio dically similar to CBR sources { resets faster when mo ving from high to lo w rate
  • R
TCP
  • con
trol proto col for R TP { implemen ted as Session/RTP
  • b
ject { sends at rate based
  • n
n um b er
  • f
  • ther
senders { rep
  • rts
kno wn sources and stats 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 40
slide-41
SLIDE 41 Other Simple Agen ts
  • the
LossMonitor agen t: { monitors arriv als
  • f
pac k ets { lo
  • ks
for sequence n um b er holes { pro vides coun ters for:
  • nlost
  • n
um b er
  • f
holes in n um b er space
  • npkts
  • pac
k et arriv als
  • bytes
  • b
yte arriv als
  • lastPktTime
  • time
  • f
last arriv al
  • expected
  • next
seq n um b er exp ected
  • the
Message agen t: { v ery simple agen t { allo ws for including text \messages" in pac k ets { curren tly limited to at most 64 b yte (short) messages 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 41
slide-42
SLIDE 42 Connectors
  • Conne
ctor: simple in/out top
  • logy
  • b
ject with \drop target" /* * An NsObject with
  • nly
a single neighbor. */ class Connector : public NsObject { public: Connector(); inline NsObject* target() { return target_; } virtual void drop(Packet* p); protected: int command(int argc, const char*const* argv); void recv(Packet*, Handler* callback = 0); inline void send(Packet* p, Handler* h) { target_->recv (p , h); } NsObject* target_; NsObject* drop_; // dest for drops };
  • if
drop target undened, dropp ed pac k ets are freed 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 42
slide-43
SLIDE 43 In tro ducing Errors
  • P
ac k et errors ma y b e in tro duced in to the top
  • logy
{ Err
  • r
Mo dule
  • collection
  • f
error mo dels { Err
  • r
Mo del
  • determines
t yp es
  • f
errors
  • Error
Module capabilities: { insert classier for p er-o w error con trol { insert m ultiple error mo dels { collects dropp ed pac k ets from eac h error mo del { default en try indicates where non-matc hing trac go es
  • Example:
set lossylink_ [$ns link $node_(r1) $node_(k1)] set em [new ErrorModule Fid] set errmodel [new ErrorModel/Per io di c] $errmodel unit pkt $errmodel set
  • ffset_
1.0 $errmodel set period_ 25.0 $lossylink_ errormodule $em $em insert $errmodel $em bind $errmodel 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 43
slide-44
SLIDE 44 Error Mo dels
  • Err
  • r
Mo del: a parameterized lossy connector (can b e used as a base class for
  • ther
loss mo dels)
  • drops
pac k et, sets \error" bit,
  • r
ECN indication
  • error
units: pac k ets, bits, time
  • base
v ersion is asso ciated with random v ariable
  • r
p erio dic pa- rameters: set errmodel [new ErrorModel] $errmodel unit pkt $errmodel set rate_ 0.01 $errmodel ranvar [new RandomVariable /U nif
  • r
m]
  • if
drop target undened, sen t to mo dule drop target
  • Sp
ecialized Mo dels: { TwoState { error and error-free Mark
  • v
mo del { MultiState { arbitrary state transitions in Tcl { Periodic { sin usoidal (p erio d, phase, burst length) { List { sp ecies individual pac k ets/b ytes { Select { lik e P erio dic, but uses pac k et uid's { SRM { lik e Select, but for SRM data
  • nly
{ Trace { lik e List, but uses a le { Mroute { aects certain t yp es
  • f
mcast prune messages 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 44
slide-45
SLIDE 45 Queue Managemen t and P ac k et Sc heduling
  • buer
management: ho w to hold and toss (mark) pac k ets
  • p
acket sche duling: what pac k ets get to depart when
  • Buer
managemen t: { Drop-tail (FIF O) { Random Early Detection (RED)
  • P
ac k et sc heduling: { FIF O { CBQ (includes priorit y + round-robin) { Round-robin (DRR) { V arian ts
  • f
F Q (WF Q, SF Q) 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 45
slide-46
SLIDE 46 Queue Handlers
  • Dequeued
pac k ets are
  • ften
sen t do wnstream to delays
  • dela
ys (usually) cause t w
  • actions:
1. the pac k et is sc heduled to arriv e do wnstream at time t + d 2. the queue b ecomes un blo c k ed at time t 3. t is transmit time, d is prop dela y time
  • so,
dela ys represen t a commonly-o ccurring sche duling b arrier
  • Queue
parameters: Queue set limit_ 50 ;# max p acket c
  • unt
in queue Queue set blocked_ false ;# queue starts
  • blo
cke d Queue set unblock_on_res um e_ true ;# queue is unblo cke d af- ter r esume
  • con
trol
  • f
blo c king can b e useful for queue banks (e.g. CBQ) 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 46
slide-47
SLIDE 47 Drop T ail and RED Queues
  • Drop-T
ail Queues (Queue/DropTail class) { simple FIF O, drop-tail queues { drop from tail when
  • ccupancy
reac hes qlim
  • RED
(Random Early Detection) Queues (Queue/RED class) { active buer managemen t tec hnique { t w
  • thresholds:
minth and maxth { also a maxim um probabilit y maxpr
  • b
{ compute aver age queue
  • ccupancy
  • v
er time { if a v erage exceeds maxth (or qlim ) drop a pac k et { if a v erage is under min th, allo w pac k et to en ter queue { b et w een, scale drop probabilit y linearly
  • n
[0; maxpr
  • b]
3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 47
slide-48
SLIDE 48 RED Queue P arameters
  • bytes
do computations in b ytes instead
  • f
pac k ets (requires assignmen t
  • f
a mean pac k et size estimate)
  • thresh
  • min
thresh
  • maxthresh
  • max
thresh
  • mean
pktsize
  • used
for computing estimated link utilizations during idle p erio ds
  • q
weight
  • w
eigh t giv en to instan taneous queue
  • ccupancy
for EWMA
  • wait
  • RED
should force a w ait b et w een drops
  • linterm
  • recipro
cal
  • f
maxprob
  • setbit
  • mark
instead
  • f
drop
  • drop-tail
  • drop
new pkt instead
  • f
random
  • ne
3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 48
slide-49
SLIDE 49 T race and Monitoring Supp
  • rt
  • Tw
  • main
items: tr ac es and monitors
  • T
races
  • write
an en try for some ev en t (often pac k et arriv als/departures/drops) { Trace/Enque
  • a
pac k et arriv al (usually at a queue) { Trace/Deque
  • a
pac k et departure (usually at a queue) { Trace/Drop
  • pac
k et drop (pac k et deliv ered to drop-target)
  • Monitors
  • k
eep statistics ab
  • ut
arriv als/departures/drops (and
  • ws)
{ SnoopQueue/Out
  • n
  • utput,
collect a time/size sample (pass pac k et
  • n)
{ SnoopQueue/Drop
  • n
drop, collect a time/size sample (pass pac k et
  • n)
{ SnoopQueue/EDrop
  • n
an "early" drop, collect a time/size sampl e (pass pac k et
  • n)
{ QueueMonitor
  • receiv
e and aggregate collected samples from sno
  • p
ers { QueueMonitor/ED
  • queue-monitor
capable
  • f
distinguish- ing b et w een \early" and standard pac k et drops { QueueMonitor/ED/Flowmon
  • p
er-o w statistics monitor (manager) { QueueMonitor/ED/Flow
  • p
er-o w statistics con tainer 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 49
slide-50
SLIDE 50 T race File F
  • rmat
  • File
format for traces generally
  • f
this form: + 1.45176 2 3 tcp 1000
  • 1
256 769 27 48 + 1.45276 2 3 tcp 1000
  • 1
256 769 28 49
  • 1.46176
2 3 tcp 1000
  • 1
256 769 22 43 + 1.46176 2 3 tcp 1000
  • 1
256 769 29 50 + 1.46276 2 3 tcp 1000
  • 1
256 769 30 51 d 1.46276 2 3 tcp 1000
  • 1
256 769 30 51
  • 1.47176
2 3 tcp 1000
  • 1
256 769 23 44 + 1.47176 2 3 tcp 1000
  • 768
3 52 + 1.47276 2 3 tcp 1000
  • 768
4 53 d 1.47276 2 3 tcp 1000
  • 768
4 53
  • Fields:
arriv al/departure/drop, time, trace link endp
  • in
ts, pac k et t yp e, size, ags,
  • w
ID, src addr, dst addr, sequence n um b er, uid
  • Man
y
  • f
these elds are from the common pac k et header: struct hdr_cmn { int ptype_; // packet type (see above) int size_; // simulated packet size int uid_; // unique id int error_; // error flag double ts_; // timestamp: for q-delay measurement int iface_; // receiving interface (label) int ref_count_; // free the pkt until count to static int
  • ffset_;
//
  • ffset
for this header inline static int&
  • ffset()
{ return
  • ffset_;
} inline static hdr_cmn* access(Packet* p, int
  • ff=-1)
{ return (hdr_cmn*) p->access(off < ?
  • ffset_
:
  • ff);
} /* per-field member functions */ ... }; 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 50
slide-51
SLIDE 51 T race Callbac ks
  • ma
y
  • pt
to in v
  • k
e a Tcl function in lieu
  • f
writing to le
  • see
the le tcl/ex/callback demo.tcl MyTest instproc begin {} { ... $link12_ trace-callback $ns_ "$self dofunc" ... } MyTest instproc dofunc args { ... process args ... }
  • Args
passed to the callbac k are a string con taining a trace
  • utput
line (e.g.):
  • 0.80612
1 tcp 1000
  • 0.0
1.0 9 13 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 51
slide-52
SLIDE 52 Monitors
  • Queue
monitors: aggregation p
  • in
ts for arriv al/depart/drop stats
  • Flo
w monitors: similar, but
  • n
a p er-o w basis
  • Sno
  • p
queues: part
  • f
the top
  • logy
, \taps" pac k et
  • w,
deliv ers samples to asso ciated monitor

Queue Delay Agent/Null Link Link::entry SnoopQueue/In SnoopQueue/Out SnoopQueue/Drop QueueMonitor

Figure 2: A QueueMonitor and supp
  • rting
  • b
jects 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 52
slide-53
SLIDE 53 Monitor Stats
  • Simple
stats k ept b y monitors: { arriv als (b ytes and pac k ets) { departures (b ytes and pac k ets) { drops (b ytes and pac k ets)
  • Aggregate
stats (optional): { queue
  • ccupancy
in tegral { (b ytes
  • r
pac k ets)
  • QueueMonitor/ED
  • b
jects { \early" drops (b ytes and pac k ets) { some drops ha v e this distinction (e.g. RED)
  • Flo
w monitors: { t yp es QueueMonitor/ED/Flow and QueueMonitor/ED/Flowmon { same as queue monitors, but also
  • n
p er-o w basis {
  • w
dened as com b
  • s
  • f
(src/dst/o wid) {
  • w
mon aggregates and creates new
  • w
  • b
jects 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 53
slide-54
SLIDE 54 Em ulation
  • allo
ws the sim ulator to in teract with a real net w
  • rk
(curren tly exp erimen tal and under dev elopmen t)
  • Uses:
{ sub ject real-w
  • rld
implemen tations to sim ulated top
  • logies
{ sub ject sim ulated algorithms to real-w
  • rld
trac
  • T
rac transducers: { real pac k ets mapp ed to/from sim ulated pac k ets via tap agent { real from either liv e wire
  • r
tcp dump-formatted le via libp- cap
  • Real-time
sc heduler { sp ecial v ersion
  • f
(curren tly List-based) sc heduler { ties sim ulated time to real-time { for no w, pun ts if sim ulation gets far b ehind { (can still do in teresting things!)
  • Other
helpful agen ts { icmp generation { ping resp
  • nder
{ arp resp
  • nder
{ NA T function 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 54
slide-55
SLIDE 55 T ap Agen ts
  • Maps
sim ulated pac k ets to/from real-w
  • rld
pac k ets
  • Asso
ciated Network
  • b
ject pro vides pac k et source/sink
  • P
ac k ets are assumed to b e net w
  • rk
la y er, generally IP
  • Real
trac is stored in sim ulated pac k et's data area: void TapAgent::recvp kt () // net->simulator { ... // allocate packet and a data payload Packet* p = allocpkt(maxpk t_ ); // fill up payload sockaddr addr; // not really used (yet) double tstamp; int cc = net_->recv(p->a cc es sd at a( ), maxpkt_, addr, tstamp); // inject into simulator hdr_cmn* ch = (hdr_cmn*)p->a cc es s(
  • ff
_c mn _) ; ch->size() = cc; ... double when = tstamp
  • now();
... if (when > 0.0) { ch->timestamp( ) = when; Scheduler::ins ta nc e( ). sc he dul e( ta rg et _, p, when); } else { ch->timestamp( ) = now(); target_->recv( p) ; } } 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 55
slide-56
SLIDE 56 Net w
  • rk
Ob ject
  • abstraction
  • f
a real-w
  • rld
trac source/sink
  • p
ened read, write,
  • r
read/write b y caller
  • base
class for sp ecic net w
  • rk
t yp es (e.g. IP net w
  • rk)
  • Net
w
  • rk
class: { requires so c k et system API (UNIX
  • r
WinSo c k) { supp
  • rts
a basic send/recv in terface { separate send/recv \c hannels" (i.e. so c k ets) { non-blo c king
  • ptional
{ framew
  • rk
supp
  • rts
m ulticast, addr/iface selection, etc
  • IP
Net w
  • rk
(Network/IP class) { RA W IP in terface (requires privs for ra w read/write) { m ulticast group join/lea v e { lo
  • pbac
k
  • n/o
{ m ulticast ttl
  • UDP/IP
Net w
  • rk
(Network/IP/UDP class) { access to IP/UDP through underlying so c k et la y er { do es not require privs for use
  • F
rame Lev el P ac k et Filtering and Generation 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 56
slide-57
SLIDE 57 P ac k et Capture Net w
  • rk
Ob ject
  • Use
LBNL's libpcap facilit y to access pac k et traces
  • Pro
vides access to trace les and liv e net w
  • rk
pac k ets
  • common
capabilities: { stats (pac k ets captured and dropp ed) { pac k et lter function (using p cap bpf
  • ptimizer)
  • Liv
e P ac k et Capture/Generation (class Network/Pcap/Live) { promiscuous
  • r
  • rdinary
pac k et capture { frame-lev el pac k et generation { sp ecication
  • f
net w
  • rk
in terface name
  • File
P ac k et Capture (class Network/Pcap/File) { pac k et capture and ltering
  • nly
3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 57
slide-58
SLIDE 58 ARP Mo dule
  • not
really an agent (not deriv ed from Agent class)
  • uses
attac hed Network
  • b
ject for I/O
  • pro
vides ARP query/resp
  • nse
pro cessing
  • also
pro vides pro xy ARP
  • nly
w
  • rks
for ethernet no w
  • (resp
  • nder
is curren tly under dev elopmen t)
  • useful
for generating link-la y er headers
  • ARP
cac he size congurable b y user
  • Metho
ds: { network { set
  • r
gets asso ciated Net w
  • rk
  • b
ject { myether { sets lo cal ethernet address { myip { sets lo cal IP address { lookup { lo
  • ks
up mapping for IP address { resolve { sends ARP request for IP address { insert { insert an en try in to the ARP cac he 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 58
slide-59
SLIDE 59 ICMP Agen t
  • generates
real-w
  • rld
ICMP messages
  • class
Agent/IcmpAgent
  • curren
tly supp
  • rts
  • nly
ICMP redirect generation
  • In
terface: set become <who should have sent the redirect> set target <who to send redirect to> set dest <redirect for what destination> set gw <new gateway to use> $ia send redirect $become $target $dest $gw
  • pro
vides abilit y to masquerade as curren t default gatew a y (some systems c hec k and require this to pro cess a redirect)
  • generates
dumm y pac k et (uses defunct GGP proto col) (insp ected b y victim host to determine whic h destination mo d- ify) 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 59
slide-60
SLIDE 60 NA T Agen t
  • supp
  • rts
Net w
  • rk
Address T ranslation (NA T) for use w/em ulation
  • Curren
tly supp
  • rts
  • nly
TCP (UDP is an easy extension)
  • Supp
  • rted
mo des: { source address rewrite { destination address rewrite { source and destination address rewrite
  • do
es not rewrite p
  • rt
n um b ers
  • r
A CK/sequence n um b ers 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 60
slide-61
SLIDE 61 Break. . . 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 61
slide-62
SLIDE 62 Lo cal Area Net w
  • rks
  • The
lan-link (sub class
  • f
Link)
  • b
ject con tains: { list
  • f
no des { c hannel
  • b
ject { in terface queue(s) { MA C
  • b
ject(s)
  • Channel
  • b
ject { abstraction
  • f
ph ysical la y er (PHY) { supp
  • rts
con ten tion, collisions and hold/jam { simplex
  • r
duplex { ho
  • k
for a dem ux classier based
  • n
MA C id
  • Interfac
e Queues { lo cated b et w een the LL and MA C
  • b
jects { same as Queue
  • b
jects discussed elsewhere 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 62
slide-63
SLIDE 63 MA C (Media Access Con trol) Proto cols
  • MA
C supp
  • rt:
{ MA C addresses { CSMA/CA { CSMA/CD { IEEE 802.11 { Multihop (e.g. Metricom wireless net w
  • rk)
  • Addresses
{ simple in teger iden ties xmit/recv station { m ulticast supp
  • rt
via c hannel/classier mo ds 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 63
slide-64
SLIDE 64 CSMA-based MA C supp
  • rt
  • Common
items in CSMA/CA and CSMA/CD: { xed dela y/o v erhead timing { in ter frame spacing { slot time { min/max con ten tion windo w (dela y range) { retransmission coun ter and limit { carrier sense
  • n/o
{ end-of-con ten tion ev en t handler { bac k
  • function
  • Dierences
{ CSMA/CA
  • bac
k
  • n
activit y sense { CSMA/CD
  • bac
k
  • n
collision 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 64
slide-65
SLIDE 65 IEEE 802.11 Supp
  • rt
  • Mo
des supp
  • rted:
{ DCF
  • basic
CSMA/CA con ten tion access { R TS/CTS
  • w
con trol { PCF
  • p
  • in
t co
  • rdination
  • P
arameters: { DIFS
  • Distributed
Co
  • rdination
IFS { SIFS
  • \Short"
IFS { PIFS
  • PCF-IFS
{ CSMA/CD
  • bac
k
  • n
collision
  • See
802.11 standard for more details 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 65
slide-66
SLIDE 66 Hash classier
  • Map
pac k ets to asso ciated
  • ws
  • r
classes
  • Curren
tly: src/dst, src/dst/d, d plus default

Hash Classifier

htab_ slot_ Hash Function Packet hnodes

Hash Functions: Source/Dest, Source/Dest/FID, FID Hnodes: active, slot, src, dst, fid

default

3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 66
slide-67
SLIDE 67 CBQ: Class Based Queueing
  • Flo
yd and Jacobson, "Link-sharing and Resource Managemen t Mo dels for P ac k e t Net w
  • rks",
T
  • N,
Aug 1995
  • rewrite
from CBQ co de in ns-1
  • pac
k ets are mem b ers
  • f
classes
  • classes
ma y con tain a priority and a b andwidth al lo c ation
  • classes
ma y b
  • rr
  • w
un used bandwidth from
  • ther
classes
  • pac
k ets are sc heduled using a round-robin sc heduler according to the classes they b elong to: { pac k et-b y-pac k et RR { w eigh ted RR { high-to-lo w priorit y 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 67
slide-68
SLIDE 68 CBQ Implemen tation

Queue (arbitrary) Queue (arbitrary) SD SD Connector CBQClass CBQClass Classifier (e.g. hash) SI SI SO SO CBQ (scheduler) QMon QMon

CBQLink

head_ drophead_ classifier_ queue_

  • Ma
jor comp
  • nen
ts: { classier (maps pac k ets to classes) { classes (holds class state) { sc heduler (sc hedules pac k et departures)
  • Implemen
ted as a sub class
  • f
link: CBQ link 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 68
slide-69
SLIDE 69 In tegrated Services Supp
  • rt
  • Dev
elop ed b y Breslau and
  • thers
at Xero x P AR C
  • Mo
del: 1. applications request QoS 2. net w
  • rk
returns y es/no decision 3. trac
  • btains
sp ecialized QoS pac k et sc heduling
  • Purp
  • se:
{ comparison
  • f
admission con trol sc hemes { (eect
  • n
trac) {
  • ne
mo del
  • f
IETF In tServ Con trolled Load (CL)
  • Comp
  • nen
ts { signalling proto col { admission con trol algorithms { QoS-sensitiv e pac k et sc heduling 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 69
slide-70
SLIDE 70 In tServ Signalling
  • v
ery simple signalling proto col
  • (not
robust against signalling proto col pac k et loss)
  • p
erations supp
  • rted:
{ request, accept, reject, conrm, tear-do wn { extensible to
  • ther
proto cols (e.g. RSVP) {
  • ne
mo del
  • f
IETF In tServ Con trolled Load (CL)
  • Request
includes tok en buc k et params (rate plus depth)
  • Conrm
is lik e request, but for existing
  • w
  • decisions
are based
  • n
admission con trol algorithms 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 70
slide-71
SLIDE 71 In tServ Admission Con trol
  • Measuremen
t Based Admission Con trol (MBA C) { accept/reject decision algorithms { Measured Sum (Jamin) { Ho eding Bounds (Flo yd) { Acceptance Region at Origin (Kelly) { Acceptance Region T angen t at P eak (Kelly) { more coming
  • Estimation
Algorithms { used as input to decision algorithms { Time Windo w { Exp
  • nen
tial Av erage { P
  • in
t Sample 3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 71
slide-72
SLIDE 72 Router Mec hanisms
  • Flo
yd and F all, "Router Mec hanisms to Supp
  • rt
End-to-End Congestion Con trol", LBNL TR, F eb 1997
  • p
  • rt
from ns-1 v ersion based
  • n
new Flo wMon and CBQ

Connector RED Queue RED Queue SD CBQClass CBQClass Classifier SI SI SO SO CBQ (scheduler) FlowMon head_ drophead_ classifier_ queue_

CBQLink with Router Mechanisms

FlowMon w/default SD ESD ESD

  • kboxfm_

pboxfm_

3rd NSv2 W
  • rkshop
kfal l@e e.lbl.gov Slide 72