Instalasi ns-allinone-2.33 pada ubuntu 8.04 hardy + gcc version 4.2.4

1.     SEKILAS TENTANG NETWORK SIMULATOR NS-2

  

Topologi wireless yang disimulasikan menggunakan routing protokol wireless pada ns -2.33

Network simulator (NS) pertama kali dibangun sebagai varian dari real network simulator pada tahun 1989 di UCB (University of California Berkeley) pada tahun 1995,  sekelompok tim gabungan membangaun sebuah perangkat lunak simulasi jaringan internet untuk kepentingan riset interaksi antar protokol dalam kontespengembangan protokol internet pada saat itu maupun masa yang akan datang.

Network Simulator bersifat open source dibawah GPL (Gnu Public lisence) anda dapat mengdownload melalui website NS : http://sourceforge.net/projects/nsnam/files/allinone

Sifat open source ini mengakibatkan pengembangan Ns menjadi lebih dinamis,pemodelan media, protokol network component dan perilaku traffic yang lebih lengkap biladibandingkan dengan software simulator lainya,ini disebabkan Ns digunakan oleh banyak periset dunia bahkan mungkin anda sendiri, akan tetapi karena sifatnya yang open source , pendokumentasian tentang pengembangan berbasis network simulator ini amat jarang , dan kalaupun ada , kebanyakan pengembangnya berasal dari luar negeri sono. Network simulator Ns2 mengsimulasikan jaringan berbasis TCP/IP dengan berbagai macam media anda dapat mengsimulasikan protokol jaringan (TCP/UDP/RTP) traffik beheavior (FTP, telnet CBR,dll.)Queue management (RED),FIFO,CBQ) algoritma routing unicast (DSDV, Link State,) applikasi multimedia berupa layyer video,quality of Service,audio-video dan transcoding, Ns juga mengimplementasikan berberapa MAC (Medium Access Controler) seperti IEEE 802.11 WiFi, 802.16 WiMax diberbagai kondisi jaringan misalnya Point to Point,point to Molti Point dan celleluler, bahkan untuk media Satelite.

wimax yang disimulasikan pada ns-2.33

Simalator ini menggunakan bahasa pemrograman tcl sebagai cara untuk menyusun skenario simulasinya, output dari simulasi ini akan menghasilkan dua files , dot nam dan dot tr . dot tr berisi data data QOS (Quality of service nya) , sedangkan dot nam berupa files untuk animasinya .Nah , karena yang namanya penelitian , semisal pada skripsi saya , biasanya ada parameter uji ,nah jika saya ada menshare file dengan format .AWK dibawah , itu adalah contoh dari parameter uji.Parameter uji sebenarnya sederhana kok , asalkan anda tahu defenisi dan rumus dari parameter uji tersebut, sehingga anda bisa tahu kolom mana sajah yang akan dipanggil dan dihitung dengan menggunakan sedikit kodingan pada file dot awk nya. Penelitian ini tentang Membandingkan 2 routing protokol pada jaringan hybrid ad hoc dengan memakai 5 parameter uji yaitu : PDR , PLR , convergence time , routing overhead dan end to end delay. Nanti jika ada waktu , saya akan share lebih banyak lagi tentang skripsi dan simulasi saya , atau mungkin anda bisa add saya di ronaldhutabarat@yahoo.com -> sebagai id ym saya

nb : pada riset ini , ada 2 jenis parameter uji yang digunakan , yaitu

  1. parameter uji untuk menilai kwalitas algoritma routing protokolnya
  2. parameter uji untuk menilai kwaliats jaringannya

——————————————————————————————————————————————————————————————————————

2.     TAHAP INSTALASI

# sebelumnya yang harus anda perhatikan , anda jangan mengcopy bulat bulat isi blog ini , karena sesuaikan dengan root anda yah

# tahapan patching beberapa routing protokol tambahan seperti , ZRP , OLSR , TORA akan saya posting di thread berikutnya

nah , pertama kita masuk keterminal dech . ketik perintah2x dibawah ini

ronald@riset:~$ sudo apt-get install gcc g++ make automake libxmu-dev

ato kalo mo lengkap skalian aja install build essentialnya

ronald@riset:~$ apt-get install build essential

kopiin file ns-allinone-2.33.tar.gz ke direktori suka2 lw. kalo gw, gw save di /home/ronald/

ronald@riset:~$ tar xvzf ns-allinone-2.33.tar.gz
ronald@riset:~$ cd ns-allinone-2.33
ronald@riset:~/ns-allinone-2.33$ ./install

sekarang lanjut ke direktory /home/ronald/ns-allinone-2.33/ns-2.33/

ronald@riset:~/ns-allinone-2.33$ cd ns-2.33/

ini buat install nam ke system

ronald@riset:~/ns-allinone-2.33/ns-2.33$ sudo make install

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

nah , terus kalo udah lw install , setting dah path nya gans…
klo udah masukin path2 library untuk mengeksekusi ns ama nam. tambahkan pada file .bashrc

ketikan command  :   ronald@riset:~gedit ~/.bashrc


# LD_LIBRARY_PATH
OTCL_LIB=/home/ronald/ns-allinone-2.33/otcl-1.13
NS2_LIB=/home/ronald/ns-allinone-2.33/lib
X11_LIB=/usr/X11R6/lib
USR_LOCAL_LIB=/usr/local/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$X11_LIB:$USR_LOCAL_LIB

# TCL_LIBRARY
TCL_LIB=/home/ronald/ns-allinone-2.33/tcl8.4.18/library
USR_LIB=/usr/lib
export TCL_LIBRARY=$TCL_LIB:$USR_LIB

# PATH
XGRAPH=/home/ronald/ns-allinone-2.33/bin:/home/ronald/ns-allinone-2.33/tcl8.4.18/unix:/home/ronald/ns-allinone-2.33/tk8.4.18/unix
NS=/home/ronald/ns-allinone-2.33/ns-2.33/
NAM=/home/ronald/ns-allinone-2.33/nam-1.13/
PATH=$PATH:$XGRAPH:$NS:$NAM

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

masih di direktori yang sama , ketikan perintah ini pada terminal

ronald@riset:~/ns-allinone-2.33/ns-2.33$ ./validate

dah selese lw bisa memvalidasi NS dengan cara berikut, makan waktu lama…bisa makan waktu ampe 2x dari waktu instalasi loh

XOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXXOXOXO

NB : SETTING PATH DULU BARU VALIDASI , JANGAN KEBALIK , INGA – INGA ,TUNG TUNG TUNG TUNG

XOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOOXOXOXOXOXOXOXOXOXOOXOXOXOX

validasi yang bener berjalan dengan benar kalo ada tulisan nya begini nih :

validate overall report: all tests passed

nah , untuk ngecek instalasi ns udah benar lw bisa ketikan di command begini :

ronald@riset:~/ns-allinone-2.33/ns-2.33$ ns
atau
ronald@riset:~/ns-allinone-2.33/ns-2.33$ ./ns

nah , kalo muncul tanda % , artinya instalsi sukses , ns udah berjalan

————————————————————————————————————————————————————————————————————

3.     INSTALASI TRACEGRAPH

TRACEGRAPH

nah…skarang tinggal nginstal tracegraphnya, katanya biar ngeditnya rada enakan jadi pake tracegraph..okeh… file yang dibutuhin itu mglinstaller.gz  ama  tracegraph202linux.tar.gz.

paketnya bisa lw dapetin di : http://www-public.int-evry.fr/~gauthier/ns2/

atau jika link diatas tidak valid lagi , kamu bisa googling dan cari di 4shared dech , banyak kok di share di internet

kopi kan file mglinstaller.gz ama tracegraph202linux.tar.gz ke direktory sesuka lw klo gw di kopi ke directory /home/ronald/tracegraph/ trus extract deh…

ronald@riset:~$ cd tracegraph
ronald@riset:/home/ronald/tracegraph~$ tar –xvzf tracegraph202linux.tar.gz
ronald@riset:/home/ronald/tracegraph~$ gunzip mglinstaller.gz

ganti permission semua file dlam directory ke 777 , maksud nya adalah folder tracegraphnya bisa dibaca , ditulis bahkan di execute baik untuk admin maupun user yang lain

ronald@riset:/home/ronald~$ chmod 777 ns-allinone-2.33/*
ronald@riset:/home/ronald~$ chmod 777 tracegraph/*

trus install dulu mglinstaller ini library buat ngejalanin TRACEGRAPH.

ronald@riset:~$ ./mglinstaller

masukin path library ke file .bashrc, caranya :

ronald@riset:~$ nano ~/.bashrc
# Matlab 6.1 runtime libraries export
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/ronald/tracegraph/bin/glnx86

ama ini buat path trgraph nya

PATH=$PATH:$XGRAPH:/home/ronald/ns-allinone-2.33/ns-2.33/:/home/ronald/tracegraph/tracegraph202/

trus masuk direktori ronald@riset:~/tracegraph/tracegraph202$

Tes running TRACEGRAPH

ronald@riset:~/tracegraph/tracegraph202$ ./trgraph

——————————————————————————————————————————————————————————————————————-4.        4.     CONTOH SCRIPT WIRELESS DENGAN 4 NODE + 2 UNIT ACCSES POINT + 1 SERVER FTP + dengan beberapa parameter uji

# Source                 : laboratorium teknik switching it telkom

# parameter uji        : delay , throughput , jitterr dan packet loss

# routing protokol    : dsdv


—————————————————————————————————————————————————–

wireless.tcl

set opt(chan)   	Channel/WirelessChannel        		;# channel type
set opt(prop)   	Propagation/TwoRayGround       		;# radio-propagation model
set opt(netif)  	Phy/WirelessPhy                		;# network interface type
set opt(mac)    	Mac/802_11                     		;# MAC type
set opt(ifq)    	Queue/DropTail/PriQueue        		;# interface queue type
set opt(ll)     	LL                             		;# link layer type
set opt(ant)    	Antenna/OmniAntenna            		;# antenna model
set opt(ifqlen)         50                     	        	;# max packet in ifq
set opt(nn)             4                              	        ;# number of mobilenodes
set opt(adhocRouting)   DSDV                            	;# routing protocol

set opt(cp)     	""                             		;# cp file not used
set opt(sc)     	""                             		;# node movement file. 

set opt(x)      	1000                           		;# x coordinate of topology
set opt(y)      	1000                           		;# y coordinate of topology
set opt(seed)   	0.0                            		;# random seed
set opt(stop)   	250                            		;# time to stop simulation

set opt(ftp1-start)     100.0

set num_wired_nodes     2
set num_bs_nodes        2  			       				;# number of base nodes

# ======================================================================

# create simulator instance
set ns_   [new Simulator]

# set up for hierarchical routing
$ns_ node-config -addressType hierarchical

AddrParams set domain_num_ 3           		;# number of domains
lappend cluster_num 1 1 1              		;# number of clusters in each domain
AddrParams set cluster_num_ $cluster_num
lappend eilastlevel 2 3 3            		;# number of nodes in each cluster
AddrParams set nodes_num_ $eilastlevel 		;# of each domain

set tracefd  [open wireless.tr w]
set namtrace [open wireless.nam w]
$ns_ trace-all $tracefd
$ns_ namtrace-all-wireless $namtrace $opt(x) $opt(y)

# Create topography object
set topo   [new Topography]

# define topology
$topo load_flatgrid $opt(x) $opt(y)

# create God
#   2 for AP1 dan AP2
create-god [expr $opt(nn) + $num_bs_nodes]

#create wired nodes
set temp {0.0.0 0.0.1}           				;# hierarchical addresses
for {set i 0} {$i < $num_wired_nodes} {incr i} {
    set W($i) [$ns_ node [lindex $temp $i]]
}

# Configure for AP1 &AP2
$ns_ node-config 	-mobileIP OFF \
                 		-adhocRouting $opt(adhocRouting) \
                 		-llType $opt(ll) \
                		 -macType $opt(mac) \
                 		-ifqType $opt(ifq) \
                 		-ifqLen $opt(ifqlen) \
                 		-antType $opt(ant) \
                 		-propType $opt(prop) \
                 		-phyType $opt(netif) \
                 		-channelType $opt(chan) \
						-topoInstance $topo \
                 		-wiredRouting ON \
						-agentTrace ON \
                 		-routerTrace ON \
                 		-macTrace OFF 

# Create AP1 and AP2
set AP1 [$ns_ node 1.0.0]
set AP2 [$ns_ node 2.0.0]
$AP1 random-motion 0
$AP2 random-motion 0
$AP1 color blue
$AP2 color red
$AP1 label "AP arsya1"
$AP2 label "AP arsya2"

# Position (fixed) for base-station nodes (AP1 & AP2).
$AP1 set X_ 600.000000000000
$AP1 set Y_ 600.000000000000
$AP1 set Z_ 0.000000000000

$AP2 set X_ 650.000000000000
$AP2 set Y_ 600.000000000000
$AP2 set Z_ 0.000000000000

# create a mobilenode that would be moving between AP1 and AP2.
# note address of fahman indicates its in the same domain as AP1.
$ns_ node-config -wiredRouting OFF

set fahman [$ns_ node 1.0.1]
set node_(0) $fahman
$node_(0) base-station [AddrParams addr2id [$AP1 node-addr]]
$fahman label "fahman"

#baru imam
set imam [$ns_ node 1.0.2]
set node_(1) $imam
$node_(1) base-station [AddrParams addr2id [$AP1 node-addr]]
$imam label "imam"

#baru bagus
set bagus [$ns_ node 2.0.1]
set node_(2) $bagus
$node_(2) base-station [AddrParams addr2id [$AP2 node-addr]]
$bagus label "bagus"

#baru abdul
set abdul [$ns_ node 2.0.2]
set node_(3) $abdul
$node_(3) base-station [AddrParams addr2id [$AP2 node-addr]]
$abdul label "abdul"

#letak imam
$imam set Z_ 0.000000000000
$imam set Y_ 500.000000000000
$imam set X_ 400.000000000000

# letak fahman
$fahman set Z_ 0.000000000000
$fahman set Y_ 600.000000000000
$fahman set X_ 400.000000000000

#letak bagus
$bagus set Z_ 0.000000000000
$bagus set Y_ 700.000000000000
$bagus set X_ 400.000000000000

#letak abdul
$abdul set Z_ 0.000000000000
$abdul set Y_ 800.000000000000
$abdul set X_ 400.000000000000

# goes back to HA
$ns_ at 50.000000000000 "$fahman setdest 600.000000000000 700.000000000000 20.000000000000"
$ns_ at 50.000000000000 "$imam setdest 500.000000000000 700.000000000000 20.000000000000"
$ns_ at 50.000000000000 "$bagus setdest 700.000000000000 700.000000000000 20.000000000000"
$ns_ at 50.000000000000 "$abdul setdest 800.000000000000 700.000000000000 20.000000000000"

$ns_ at 100.000000000000 "$imam setdest 990.000000000000 500.000000000000 20.000000000000"
$ns_ at 100.000000000000 "$fahman setdest 990.000000000000 600.000000000000 20.000000000000"
$ns_ at 100.000000000000 "$bagus setdest 990.000000000000 700.000000000000 20.000000000000"
$ns_ at 100.000000000000 "$abdul setdest 990.000000000000 800.000000000000 20.000000000000"

$ns_ at 150.000000000000 "$imam setdest 500.000000000000 500.000000000000 20.000000000000"
$ns_ at 150.000000000000 "$fahman setdest 600.000000000000 500.000000000000 20.000000000000"
$ns_ at 150.000000000000 "$bagus setdest 700.000000000000 500.000000000000 20.000000000000"
$ns_ at 150.000000000000 "$abdul setdest 800.000000000000 500.000000000000 20.000000000000"

$ns_ at 200.000000000000 "$imam setdest 400.000000000000 500.000000000000 20.000000000000"
$ns_ at 200.000000000000 "$fahman setdest 400.000000000000 600.000000000000 20.000000000000"
$ns_ at 200.000000000000 "$bagus setdest 400.000000000000 700.000000000000 20.000000000000"
$ns_ at 200.000000000000 "$abdul setdest 400.000000000000 800.000000000000 20.000000000000"

# create links between wired and BaseStation nodes
$ns_ duplex-link $W(0) $W(1) 5Mb 2ms DropTail
$ns_ duplex-link $W(1) $AP1 5Mb 2ms DropTail
$ns_ duplex-link $W(1) $AP2 5Mb 2ms DropTail

$ns_ duplex-link-op $W(0) $W(1) orient down
$ns_ duplex-link-op $W(1) $AP1 orient left-down
$ns_ duplex-link-op $W(1) $AP2 orient right-down

# setup TCP connections between a wired node and the MobileHost
#warna-warna
$ns_ color 0 blue
$ns_ color 1 red
$ns_ color 2 green
$ns_ color 3 magenta

$W(0) label "Server FTP"
$W(1) label "Router"

set tcp1 [new Agent/TCP]
$tcp1 set class_ 0
set sink1 [new Agent/TCPSink]
$ns_ attach-agent $W(0) $tcp1
$ns_ attach-agent $fahman $sink1
$ns_ connect $tcp1 $sink1
set ftp1 [new Application/FTP]
$ftp1 attach-agent $tcp1
$ns_ at 3.0 "$ftp1 start"

set tcp2 [new Agent/TCP]
$tcp2 set class_ 1
set sink2 [new Agent/TCPSink]
$ns_ attach-agent $W(0) $tcp2
$ns_ attach-agent $imam $sink2
$ns_ connect $tcp2 $sink2
set ftp2 [new Application/FTP]
$ftp2 attach-agent $tcp2
$ns_ at 3.0 "$ftp2 start"

set tcp3 [new Agent/TCP]
$tcp3 set class_ 2
set sink3 [new Agent/TCPSink]
$ns_ attach-agent $W(0) $tcp3
$ns_ attach-agent $abdul $sink3
$ns_ connect $tcp3 $sink3
set ftp3 [new Application/FTP]
$ftp3 attach-agent $tcp3
$ns_ at 3.0 "$ftp3 start"

set tcp4 [new Agent/TCP]
$tcp4 set class_ 3
set sink4 [new Agent/TCPSink]
$ns_ attach-agent $W(0) $tcp4
$ns_ attach-agent $bagus $sink4
$ns_ connect $tcp4 $sink4
set ftp4 [new Application/FTP]
$ftp4 attach-agent $tcp4
#$ns_ at  $opt(ftp2-start) "$ftp2 start"
$ns_ at 3.0 "$ftp4 start"

# Define initial node position in nam

for {set i 0} {$i < $opt(nn)} {incr i} {

    # 20 defines the node size in nam, must adjust it according to your
    # scenario
    # The function must be called after mobility model is defined

    $ns_ initial_node_pos $node_($i) 30
}     

# Tell all nodes when the siulation ends
for {set i 0} {$i < $opt(nn) } {incr i} {
    $ns_ at $opt(stop).0 "$node_($i) reset";
}
$ns_ at $opt(stop).0 "$AP1 reset";
$ns_ at $opt(stop).0 "$AP2 reset";

$ns_ at $opt(stop).0002 "puts \"NS EXITING...\" ; $ns_ halt"
$ns_ at $opt(stop).0001 "stop"
proc stop {} {
    global ns_ tracefd namtrace
    close $tracefd
    close $namtrace
    exec nam wireless.nam &
    exec awk -f delay.awk wireless.tr &
    exec awk -f packetloss.awk wireless.tr &
    exec awk -f throughput.awk wireless.tr &
    exec awk -f jitter.awk wireless.tr &
    exec xgraph delay.tr -geometry 400x800 &
exit 0
}

# some useful headers for tracefile
puts $tracefd "M 0.0 nn $opt(nn) x $opt(x) y $opt(y) rp \
	$opt(adhocRouting)"
puts $tracefd "M 0.0 sc $opt(sc) cp $opt(cp) seed $opt(seed)"
puts $tracefd "M 0.0 prop $opt(prop) ant $opt(ant)"

puts "Starting Simulation..."
$ns_ run

------------------------------------------------------------------------------------------------------------------------
delay.awk
BEGIN {
         for (i in send) {
                 send[i] = 0
		 sendt[i] = 0
         }
         for (i in recv) {
                 recv[i] = 0
		 recvt[i] = 0
         }
         delay = 0
         num = 0
         avg_delay = 0
}

{
         # Trace line format: normal
         if ($2 != "-t") {
                event = $1
                time = $2
                node_id_s = $3
		node_id_d = $4
		pkt_type = $5
		pkt_size = $6
		pkt_attrib = $7
                pkt_id = $12
         }
         # Trace line format: new
         if ($4 == "AGT" || $4 == "RTR") {
                 event = $1
                 time = $2
                 node_id_d = $3
                 pkt_type = $7
                 pkt_size = $8
                 flow_id = $5
                 pkt_id = $6
         }

         # Store packets sent
         if (event == "+" && node_id_s == "0" && pkt_type == "tcp") {
                 send[pkt_id] = time
		 sendt[pkt_id] = 1
         #        print("send[",pkt_id,"] = ",time)
         }
         # Store packets arrival time
         if (event == "r" && node_id_d == "_4_" && pkt_type == "tcp") {
                 recv[pkt_id] = time
		 recvt[pkt_id] = 1
         #        print("recv[",pkt_id,"] = ",time)
         #       print(" --> delay[",pkt_id,"]= ",recv[pkt_id]-send[pkt_id])
        if (recvt[pkt_id] == 1 && sendt[pkt_id] == 1) {
		print (time," ",(recv[pkt_id]-send[pkt_id])) > "delay.tr" }
        }
}

END {
        # Compute average delay
        for (i in recv) {
                if (sendt[i] == 1 && recvt[i] == 1) {
                     delay += recv[i] - send[i]
                     num ++

                }
	}

        if (num != 0) {
                avg_delay = delay / num
        } else {
                avg_delay = 0
        }
        print("")
        print("")
        print("==> Average delay = ",avg_delay,"s")
        print("                  = ",avg_delay*1000,"ms")

}

------------------------------------------------------------------------------------------------------------------------
jitter.awk
BEGIN {
       num_recv=0
       for (i in sendTime) {
                 sendTime[i] = 0
         }
       for (i in recvTIme) {
                 recvTime[i] = 0
         }

}

{
    # Trace line format: normal
 	if ($2 != "-t") {
 	event     = $1
  	time      = $2
  	node_id_s = $3
 	node_id_d = $4
  	flow_id   = $8
  	pkt_id    = $12
  	pkt_size  = $6
  	pkt_type  = $5

 	}

    # Trace line format: new
 	if ($4 == "AGT" || $4 == "RTR") {
#  	         flow_t   = $45
#  	         level    = $19
                 event    = $1
                 time     = $2
                 node_id_d = $3
                 pkt_type = $7
                 pkt_size = $8
                 flow_id  = $5
                 pkt_id   = $6
 	}

    # Store packets send time
 	if (event == "+" && pkt_type == "tcp" && node_id_s == "0") {
  	sendTime[pkt_id] = time
 	}

    # Store packets arrival time
 	if (event == "r" && pkt_type == "tcp" && node_id_d == "_4_") {
  	recvTime[pkt_id] = time
  	num_recv++
 	}
}

END {
    # Compute average jitter
	jitter1 = jitter2 = tmp_recv = 0
 	prev_time = delay = prev_delay = processed = 0
 	prev_delay = -1

 	for (i=0; processed<num_recv; i++) {
  	if(recvTime[i] != 0) {
          			tmp_recv++
   				if(prev_time != 0) {
    							delay = recvTime[i] - prev_time
    							e2eDelay = recvTime[i] - sendTime[i]
    							if(delay < 0) delay = 0
    							if(prev_delay != -1) {
     										jitter1 += abs(e2eDelay - prev_e2eDelay)
     										jitter2 += abs(delay - prev_delay)
    									     }
    							prev_delay = delay
    							prev_e2eDelay = e2eDelay
   			  			   }
   				prev_time = recvTime[i]
				processed++
 			      }

 	 }
}

END {

       print("One way jitter       = ",jitter1*1000/tmp_recv," ms");
       print("Inter arrival jitter = ",jitter2*1000/tmp_recv," ms");
}

function abs(value) {
			if (value < 0) value = 0-value
			return value
		    }
-------------------------------------------------------------------------------------------------------------------------
packetloss.awk

BEGIN {
         for (i in send) {
                 send[i] = 0
         }
         for (i in recv) {
                 recv[i] = 0
         }
         tx = 0
         drop = 0
         pkt_loss = 0
}

{
         # Trace line format: normal
         if ($2 != "-t") {
                event = $1
                time = $2
                node_id_s = $3
		node_id_d = $4
		pkt_type = $5
		pkt_size = $6
		pkt_attrib = $7
                pkt_id = $12
         }
         # Trace line format: new
         if ($4 == "AGT" || $4 == "RTR") {
                 event = $1
                 time = $2
                 node_id_d = $3
                 pkt_type = $7
                 pkt_size = $8
                 flow_id = $5
                 pkt_id = $6
         }

         # Store packets sent
         if (event == "+" && node_id_s == "0" && pkt_type == "tcp") {
                 send[pkt_id] = 1
                 #printf("send[%g] = 1\n",pkt_id)
         }
         # Store packets arrival time
         if (event == "r" && node_id_d == "_4_" && pkt_type == "tcp") {
                 recv[pkt_id] = 1
                 #printf("\t\trecv[%g] = 1\n",pkt_id)
         }

}

END {
         #printf("%10g ",flow)
         for (i in send) {
                 if (send[i] == 1) {
                         tx ++
                         if (recv[i] == 0) {
                                 drop ++
                                 #printf("pkt %g not recvd\n",i)
                         }
                  }
         }
         if (tx != 0) {
                 pkt_loss = drop / tx
         } else {
                 pkt_loss = 0
         }
	 print("")
         print("Packet sent        = ",tx)
	 print("Packet dropped 	   = ",drop)
	 print("==> Packet loss    = ",pkt_loss*100,"%")
	 print("")
}

------------------------------------------------------------------------------------------------------------------------
Throughput.awk

BEGIN {
         for (i in send) {
                 send[i] = 0
         }
         for (i in recv) {
                 recv[i] = 0
         }
         tx = 0
         drop = 0
         pkt_loss = 0
	 pkt_rcvd = 0
	 time_obsrv = 200
}

{
         # Trace line format: normal
         if ($2 != "-t") {
                event = $1
                time = $2
                node_id_s = $3
		node_id_d = $4
		pkt_type = $5
		pkt_size = $6
		pkt_attrib = $7
                pkt_id = $12
         }
         # Trace line format: new
         if ($4 == "AGT" || $4 == "RTR") {
                 event = $1
                 time = $2
                 node_id_d = $3
                 pkt_type = $7
                 pkt_size = $8
                 flow_id = $5
                 pkt_id = $6
         }

         # Store packets sent
         if (event == "+" && node_id_s == "0" && pkt_type == "tcp") {
                 send[pkt_id] = 1
                 #printf("send[%g] = 1\n",pkt_id)
         }
         # Store packets arrival time
         if (event == "r" && node_id_d == "_4_" && pkt_type == "tcp") {
                 recv[pkt_id] = 1
                 #printf("\t\trecv[%g] = 1\n",pkt_id)
         }
}

END {
         #printf("%10g ",flow)
         for (i in send) {
                 if (send[i] == 1) {
                         tx ++
                         if (recv[i] == 0) {
                                 drop ++
                                 #printf("pkt %g not recvd\n",i)
                         }
                  }
         }
         if (tx != 0) {
                 pkt_loss = drop / tx
		 pkt_rcvd = tx - drop
         } else {
                 pkt_loss = 0
         }
	 print("")
         print("Packet sent             = ",tx)
	 print("Packet success received = ",pkt_rcvd)
	 print("==> Throughput		= ",pkt_rcvd/time_obsrv,"packets/s" )
	 print("			= ",(pkt_rcvd/time_obsrv)*(8/1000000),"Mbps" )
}

------------------------------------------------------------------------------------------------------------------------
Source : Laboraturium Switching IT Telkom
 

patching Routing Protokol OLSR ->
 tersedia untuk ns-allinone-2.33-rc4 dan ns-allinone-2.29 

patching untuk TORA ->
 tersedia untuk NS-allinone-2.30 (pada lingkungan Red Hat 8)

 Patching untuk AODV-UU ->
 tersedia untuk ns-allinone-2.34 

19 Comments

  1. apa bisa Instalasi ns-allinone-2.33 di windows 7?
    kalo bisa tolong kirimkan file SCRIPT WIRELESS DENGAN 4 NODE + 2 UNIT ACCSES POINT + 1 SERVER FTP + dengan beberapa parameter uji.
    ada tugas saya yg mirip dgn ini tapi untuk WiMAX dgn protokol AODV dan DSDV.
    saya berharap admin bisa mmbantu saya,trimakasih atas bantuanya.

  2. Instalasi ns-allinone-2.33 bisa di windows 7? kalo bisa tolong kirimkan file SCRIPT WIRELESS DENGAN 4 NODE + 2 UNIT ACCSES POINT + 1 SERVER FTP + dengan beberapa parameter uji.
    mas admin ada tugas saya yang mirip dgn ini hanya saja untuk wimax dgn AODV dan DSDV.
    saya sangat berharap mas admin bisa menolong saya, trima kasihn atas bantuan n pengertiannya.
    uchy1805@gmail.com

  3. om admin bisa minta tolong untuk kasus wimax gmn ya?saya menggunakan NS2.31 ko saya gak bisa menjalankan wimax.tcl ya?malah error invalid command name “Phy/WirelessPhy/OFDM”
    while executing
    “Phy/WirelessPhy/OFDM set g_ 0”
    (file “ns-wimax.tcl” line 3)

    mohon bantuannya..

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s