University of Texas at Arlington CSE 5346/4346 High Performance Networks 1 NS-2 Tutorial NS-2 Tutorial Choe, Hyun Jung (Stella) Choe, Hyun Jung (Stella) Spring 2008 Spring 2008 High Performance Networks High Performance Networks Department of Computer Science and Engineering Department of Computer Science and Engineering The University of Texas at Arlington The University of Texas at Arlington
50
Embed
University of Texas at Arlington CSE 5346/4346 High Performance Networks 1 NS-2 Tutorial Choe, Hyun Jung (Stella) Spring 2008 Spring 2008 High Performance.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
University of Texas at Arlington
CSE 5346/4346 High Performance Networks
1
NS-2 TutorialNS-2 Tutorial
Choe, Hyun Jung (Stella)Choe, Hyun Jung (Stella) Spring 2008Spring 2008
High Performance NetworksHigh Performance NetworksDepartment of Computer Science and EngineeringDepartment of Computer Science and Engineering
The University of Texas at ArlingtonThe University of Texas at Arlington
University of Texas at Arlington
CSE 5346/4346 High Performance Networks
2
OutlineOutline
• NS-2 Overview
• How to Run NS-2
• How to Program
• Simulation Examples
• Project Overview
• Q & A
University of Texas at Arlington
NS-2 OverviewNS-2 Overview
University of Texas at Arlington
CSE 5346/4346 High Performance Networks
4
What is NS-2?What is NS-2?
• VINT Project
- UC Berkeley, LBL, USC/ISI, and Xerox PARC
• Goals
- Support networking research and education
- Freely distributed, open source Share code, protocols, models, etc
• for Temporary Usage only- Do Not save your scripts under /tmp
• Use Your Own directory- mkdir /tmp/your_dir/
• Exampleset nf [open /tmp/your_dir/out.nam w]
University of Texas at Arlington
CSE 5346/4346 High Performance Networks
13
How to Install NS-2 (Under How to Install NS-2 (Under Windows)Windows)• http://nsnam.isi.edu/nsnam/index.php/Running_Ns_a
nd_Nam_Under_Windows_9x/2000/XP_Using_Cygwin
• Cygwin-1.3.12 or later required Select “UNIX” text type to check current mode, type “mount | grep textmode” C:\Cygwin (not C:\Program Files\Cygwin) “Install” <X11> and <Devel> Categories (next page)
and others (e.g., vim) in <Editor> Download NS-2 under Cygwin (E.g., under /usr/local/)• tar zxvf ns-allinone-2.2x.x.tar.gz• cd ns-allinone-2.2x• ./install
University of Texas at Arlington
CSE 5346/4346 High Performance Networks
14
University of Texas at Arlington
CSE 5346/4346 High Performance Networks
15
Error?Error?
• error near unexpected token `)'./configure: line 7624: ` OSF*)'tcl8.3.2 configuration failed! Exiting ...Tcl is not part of the ns project. Please see
www.Scriptics.comto see if they have a fix for your platform.
- Remove ‘ only if there are two ‘ at the end of relid
Creating Traffic: On Top of TCPCreating Traffic: On Top of TCP
• FTP- set ftp [new Application/FTP]- $ftp attach-agent $tcp
• Telnet- set telnet [new Application/Telnet]- $telnet attach-agent $tcp
n0 n1TCP sink
FTP
University of Texas at Arlington
CSE 5346/4346 High Performance Networks
32
A simulation exampleA simulation example
n0
n1
n2 n3
n4
n5
tcp
tcp
sink
sink
ftp
ftp
5Mb, 15ms10Mb,2ms 10Mb,2ms
W=32
W=32
University of Texas at Arlington
CSE 5346/4346 High Performance Networks
33
TCP AgentsTCP Agents
• ns has several variants of TCP available: - -- Agent/TCP/Tahoe a ``tahoe'' TCP sender - -- Agent/TCP/Reno a ``Reno'' TCP sender - -- Agent/TCP/NewReno Reno with a modification - -- Agent/TCP/Sack1 TCP with selective repeat (follows RFC2018) - -- Agent/TCP/Vegas TCP Vegas - -- Agent/TCP/Fack Reno TCP with ``forward acknowledge ment''
• The oneway TCP receiving agents currently supported are: - -- Agent/TCPSink TCP sink with one ACK per packet - -- Agent/TCPSink/DelAck TCP sink with configurable delay per ACK - -- Agent/TCPSink/Sack1 selective ACK sink (follows RFC2018) - -- Agent/TCPSink/Sack1/DelAck Sack1 with DelAck
• The twoway experimental sender currently supports only a Reno form of TCP: - -- Agent/TCP/FullTcp
University of Texas at Arlington
CSE 5346/4346 High Performance Networks
34
TCP Agent ParametersTCP Agent Parameters
• Agent/TCP set tcpTick— 0.1 ;# timer granularity in sec (.1 is NONST ANDARD)
• Agent/TCP set maxrto— 64 ;# bound on RTO (seconds) • Agent/TCP set dupacks— 0 ;# duplicate ACK counter
• Agent/TCP set ack— 0 ;# highest ACK received
• Agent/TCP set cwnd— 0 ;# congestion window (packets)
• Agent/TCP set awnd— 0 ;# averaged cwnd (experimental) • Agent/TCP set ssthresh— 0 ;# slowstat threshold (packets) • Agent/TCP set rtt— 0 ;# rtt sample
• Agent/TCP set srtt— 0 ;# smoothed (averaged) rtt • Agent/TCP set rttvar— 0 ;# mean deviation of rtt samples • Agent/TCP set backoff— 0 ;# current RTO backoff factor • Agent/TCP set maxseq— 0 ;# max (packet) seq number sent
University of Texas at Arlington
CSE 5346/4346 High Performance Networks
35
Tracing and Monitoring ITracing and Monitoring I
• Trace packets on all links • #Open the NAM trace file #Open the Trace file
- set nf [open out.nam w] set tf [open out.tr w]
- $ns namtrace-all $nf $ns trace-all $tf
• Must appear immediately after creating scheduler• Turn on tracing on specific links