'Network/Ns2_source'에 해당되는 글 59건

  1. 2009.02.08 DSSS & FHSS
  2. 2009.01.18 NS2_Reno, cwnd, ip packet size의 11Mbps 무선랜, 100Mbps유선랜 ns2_upstream10/downstream10
  3. 2009.01.18 NS2_스크립트 up_down_stream2.sh_upstream10/downstream10
  4. 2009.01.18 NS2_awk-ack_rec_wire_upstream10/downstream10
  5. 2009.01.18 NS2_awk-ack_rec_wireless_upstream10/downstream10
  6. 2009.01.18 NS2_awk-ack_send_wire_upstream10/downstream10
  7. 2009.01.18 NS2_awk-ack_send_wireless_upstream10/downstream10
  8. 2009.01.18 NS2_awk-throughput_upstream10/downstream10
  9. 2009.01.18 NS2_awk-throughput1_upstream10/downstream10
  10. 2009.01.18 NS2_ awk-UDP_upstream10/downstream10

DSSS & FHSS

|

⑴FHSS (Frequency Hopping Spread Spectrum) - 주파수 도약 확산 스펙트럼 방식

 

-무선 통신에서 주파수를 고정하지 않고 시간에 따라 변화시켜 송신하는 스펙트럼 확산 방식

 

즉 송신측과 수신측에서 주파수 위치를 변화시켜 통신하는 방식

 

이방식을 표준화한 IEEE802.11에 의하면 송신하는 데이터는 주파수를 편이 변조시켜 도약

 

패턴으로 주파수를 도약, 외관상 주파수 대역폭을 넓혀 송신하고 반대로 수신한 신호는 복조과정을

 

거쳐 데이터를 검출한다. 저농과정에 어떤 간섭파가 존재하는 경우 간섭파에 반사된 송신파는

 

폐기되어 재전송되고, 반사되지 않으면 영향을 받지 않는다.

 

 

 

 

⑵DSSS (Direct Sequence Spread Spectrum) - 직접 시퀀스 확산 스펙트럼 방식

 

- 하나의 신호 심볼을 일정한 시퀀스로 확산시켜 통신하는 방식

 

의사 잡음 시퀀스 (pseudo-random noise sequence)에 원래의 신호를 입력시키면, 주파수당

 

전력 밀도가 낮아진 확산 대역 스펙트럼 신호를 얻을 수 있다. 수신 측에서도 동일한 시퀀스의

 

의사 잡음 시퀀스를 이용하면 원신호를 재생할 수 있으며, 다수의 사용자가 사용할 수도 있다.

 

변조의 효율성이 좋고, 신호의 동기가 빠르며, 낮아진 전력 밀도로 대역 내 간섭이 적은 장접이

 

있어 부호 분할 다중 저속 (CDMA)에 사용되고 있다. 지그비도 이방식을 쓴다.

 

 

DSSS

IEEE 802.15.4 물리계층은 DSSS(Digital Sequence Spread Spectrum) 이용하여 무선으로 데이터를 보낸다. DSSS 양쪽 모두가 알고 있는 슈도랜덤(pseudo random) 값인 +1이나 -1 데이터에 곱해서 보낸다. 시퀀스는 실제 반복되는 비트 보다 훨씬 길이가 길어진다(높은 주파수가 된다). 수신측에서 신호를 얻기 위해서는 단순하게 슈도랜덤 노이즈를 다시 곱하기만 하면 된다. (1 x 1 = 1, -1x-1=1). 이와 같이 길게 늘인 신호는 전송실패 확률을 줄여주어 더욱 안정적이다. IEEE 802.15.4 실제적으로 4비트 데이터를 32비트로 구성 16  슈도 랜덤 번호로 만든 심볼 중에 하나를 선택한다. 심볼은 각각이 서로다른 슈도랜덤 번호  32의비트를 나열된 하나뿐인 시퀀스이다. DSSS Bluetooth IEEE 802.11에서 사용하는 주파수 호핑(Frequency Hopping) 비교되는 방법이다. 주파수 호핑은 캐리어 주파수를 이용하여 슈도 랜덤하게 모듈레이션과 디모듈레이션을 한다.  

[출처] DSSS & FHSS|작성자 달새


And

NS2_Reno, cwnd, ip packet size의 11Mbps 무선랜, 100Mbps유선랜 ns2_upstream10/downstream10

|

Phy/WirelessPhy set CPThresh_ 10.0
Phy/WirelessPhy set CSThresh_ 3.1622777e-14
Phy/WirelessPhy set RXThresh_ 3.1622777e-13
Phy/WirelessPhy set bandwidth_ 11Mb
Phy/WirelessPhy set Pt_ 0.031622777
Phy/WirelessPhy set freq_ 2.472e9
Phy/WirelessPhy set L_ 1.0
#######################################

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(ifq)  CMUPriQueue
set opt(ll)             LL                         ;# link layer type
set opt(ant)            Antenna/OmniAntenna        ;# antenna model
set opt(ifqlen)         [lindex $argv 1]                         ;# max packet in ifq
set opt(data)             [lindex $argv 0]                         ;# number of mobilenodes
set opt(nm)             [expr $opt(data)]                         ;# number of mobilenodes
set opt(adhocRouting)   DSDV                       ;# routing protocol
#set opt(adhocRouting)   DumbAgent   ;#KDH

set opt(cp)             ""                         ;# connection pattern file
#set opt(sc)     "../mobility/scene/scen-3-test"    ;# node movement file.
set opt(sc)             ""          ;#KDH

set opt(x)      670                            ;# x coordinate of topology
set opt(y)      670                            ;# y coordinate of topology
set opt(seed)   0.0                            ;# seed for random number gen.
set opt(stop)   500                            ;# time to stop simulation
set packetSize_ 1500                           ;#packet size
set cwnd_ 64
set opt(ftp0-start)      90.0         ;
Mac/802_11 set dataRate_ 11.0e6
#set num_wired_nodes      5
set opt(nw)      [expr $opt(nm) + 1]   ;
set num_bs_nodes         1                     ;

# ============================================================================
# check for boundary parameters and random seed
if { $opt(x) == 0 || $opt(y) == 0 } {
 puts "No X-Y boundary values given for wireless topology\n"
}
if {$opt(seed) > 0} {
 puts "Seeding Random number generator with $opt(seed)\n"
 ns-random $opt(seed)
}

# create simulator instance
set ns_   [new Simulator]

# set up for hierarchical routing
$ns_ node-config -addressType hierarchical
AddrParams set domain_num_ 2           ;# number of domains
lappend cluster_num 1 1                ;# number of clusters in each domain
AddrParams set cluster_num_ $cluster_num
lappend eilastlevel $opt(nw) $opt(nw)               ;# number of nodes in each cluster
AddrParams set nodes_num_ $eilastlevel ;# of each domain

set tracefd  [open up_down_stream_$opt(nm)-$opt(nm).tr w]
$ns_ trace-all $tracefd

# Create topography object
set topo   [new Topography]

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

# create God
create-god [expr $opt(nm) + $num_bs_nodes]

#create wired nodes
set temp {0.0.0 0.0.1 0.0.2 0.0.3 0.0.4 0.0.5 0.0.6 0.0.7 0.0.8 0.0.9 0.0.10 0.0.11 0.0.12 0.0.13 0.0.14 0.0.15 0.0.16 0.0.17 0.0.18 0.0.19 0.0.20  0.0.21 0.0.22 0.0.23 0.0.24 0.0.25 0.0.26 0.0.27 0.0.28}        ;# hierarchical addresses for wired domain
for {set i 0} {$i < $opt(nw)} {incr i} {
    set W($i) [$ns_ node [lindex $temp $i]]
}

# configure for base-station node
$ns_ node-config -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 OFF \
                 -macTrace OFF


#create base-station node
set temp {1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.20 1.0.21 1.0.22 1.0.23 1.0.24 1.0.25 1.0.26 1.0.27 1.0.28} ;# hier address to be used for wireless
                                     ;# domain
set BS(0) [$ns_ node [lindex $temp 0]]
$BS(0) random-motion 0               ;# disable random motion

# create mobilenodes in the same domain as BS(0) 
# note the position and movement of mobilenodes is as defined
# in $opt(sc)

#configure for mobilenodes
$ns_ node-config -wiredRouting OFF

  for {set j 0} {$j < $opt(nm)} {incr j} {
    set node_($j) [ $ns_ node [lindex $temp \
     [expr $j+1]] ]
    $node_($j) base-station [AddrParams addr2id \
     [$BS(0) node-addr]]
}

#create links between wired and BS nodes

for {set t 0} {$t < $opt(nm) } {incr t} {
$ns_ duplex-link $W($opt(nm)) $W($t) 100Mb 20ms DropTail
}
$ns_ duplex-link $W($opt(nm)) $BS(0) 100Mb 50ms DropTail
# setup TCP connections

#Agent/UDP set packetSize_ 1048
for {set ttt 0} {$ttt < $opt(nm) } {incr ttt} {
 set tcp_($ttt) [new Agent/TCP/Reno]
 $tcp_($ttt) set fid_ 2
 set sink_($ttt) [new Agent/TCPSink]
 $ns_ attach-agent $W($ttt) $tcp_($ttt)
 $ns_ attach-agent $node_($ttt) $sink_($ttt)
 $ns_ connect $tcp_($ttt) $sink_($ttt)
 set ftp_($ttt) [new Application/FTP]
 $ftp_($ttt) attach-agent $tcp_($ttt)
 $ns_ at $opt(ftp0-start) "$ftp_($ttt) start"

}

for {set tttt 0} {$tttt < $opt(nm)} {incr tttt} {
 set tcp_($tttt) [new Agent/TCP/Reno]
 $tcp_($tttt) set fid_ 2
 set sink_($tttt) [new Agent/TCPSink]
 $ns_ attach-agent $node_($tttt) $tcp_($tttt)
 $ns_ attach-agent $W($tttt) $sink_($tttt)
 $ns_ connect $tcp_($tttt) $sink_($tttt)
 set ftp_($tttt) [new Application/FTP]
 $ftp_($tttt) attach-agent $tcp_($tttt)
 $ns_ at $opt(ftp0-start) "$ftp_($tttt) start"

}

# Tell all nodes when the simulation ends
for {set i } {$i < $opt(nm) } {incr i} {
    $ns_ at $opt(stop).0 "$node_($i) reset";
}
$ns_ at $opt(stop).0 "$BS(0) reset";

$ns_ at $opt(stop).0002 "puts \"NS EXITING...\" ; $ns_ halt"
$ns_ at $opt(stop).0001 "stop"
proc stop {} {
    global ns_ tracefd
    close $tracefd
}

# informative headers for CMUTracefile
puts $tracefd "M 0.0 nn $opt(nm) 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


And

NS2_스크립트 up_down_stream2.sh_upstream10/downstream10

|

#!/bin/sh
echo "Awk ShellScript"
num=1
num1=1
rm -rf up_down.send_wireless up_down.rec_wireless up_down.send_wire up_down.rec_wire
rm -rf up_down.ACK_wireless up_down.ACK_wire
rm -rf up_down.UDP_th
    
for Tcl_file in  "1 10" "2 10" "3 10" "4 10" "5 10" "6 10" "7 10" "8 10" "9 10" "10 10"
do
 set $Tcl_file
 echo "###################### TCL" $num
  nsp up_down_stream.tcl $1 $2
 num=`expr $num + 1`
done
for PacketSize in  1 2 3 4 5 6 7 8 9 10
do
 echo "###################### TCL_Mobile_change" $num1
 echo "awk -f awk-ack_rec_wire  up_down_stream_$PacketSize-$PacketSize.tr >> testbook"
 sed 's/_/ /' up_down_stream_$PacketSize-$PacketSize.tr > testbook
 echo "awk -f awk-ack_rec_wire  testbook >> up_down_stream_$PacketSize-$PacketSize.tr "
 sed 's/_/ /' testbook > up_down_stream_$PacketSize-$PacketSize.tr
 rm -rf testbook
done

for PacketSize in  1 2 3 4 5 6 7 8 9 10
do
  echo "###################### ACK" $num1
  echo "awk -f awk-ack_rec_wire  up_down_stream_$PacketSize-$PacketSize.tr >> up_down.rec_wire"
  awk -f awk-ack_rec_wire -v data=$PacketSize up_down_stream_$PacketSize-$PacketSize.tr >> up_down.rec_wire
  echo "awk -f awk-ack_send_wire  up_down_stream_$PacketSize-$PacketSize.tr >> up_down.send_wire"
  awk -f awk-ack_send_wire -v data=$PacketSize up_down_stream_$PacketSize-$PacketSize.tr >> up_down.send_wire
  echo "awk -f awk-ack_rec_wireless up_down_stream_$PacketSize-$PacketSize.tr >> up_down.rec_wireless"
  awk -f awk-ack_rec_wireless -v data=$PacketSize up_down_stream_$PacketSize-$PacketSize.tr >> up_down.rec_wireless
  echo "awk -f awk-ack_send_wireless  up_down_stream_$PacketSize-$PacketSize.tr >> up_down.send_wireless"
  awk -f awk-ack_send_wireless -v data=$PacketSize up_down_stream_$PacketSize-$PacketSize.tr >> up_down.send_wireless
 
  echo "###################### Throughput" $num1
  echo "awk -f awk-throughput  up_down_stream_$PacketSize-$PacketSize.tr >> up_down.ACK_wireless"
  awk -f awk-throughput  -v nn=$PacketSize up_down_stream_$PacketSize-$PacketSize.tr >> up_down.ACK_wireless
  echo "awk -f awk-throughput1  up_down_stream_$PacketSize-$PacketSize.tr >> up_down.ACK_wire"
  awk -f awk-throughput1 -v nn=$PacketSize up_down_stream_$PacketSize-$PacketSize.tr >> up_down.ACK_wire
 
  echo "###################### UDP Throughput" $num1
  echo "awk -f awk-UDP -v rt=$PacketSize up_down_stream_$PacketSize-$PacketSize.tr >> up_down.UDP_th"
  awk -f awk-UDP -v rt=$PacketSize up_down_stream_$PacketSize-$PacketSize.tr >> up_down.UDP_th
  num1=`expr $num1 + 1`
 
done



And

NS2_awk-ack_rec_wire_upstream10/downstream10

|

BEGIN {
 n=0;
 total1 = 0;
 total2 = 0;
 total3 = 0;
 total4 = 0;
 total5 = 0;
 total6 = 0;
 total7 = 0;
 total8 = 0;
 total9 = 0;
 total10 = 0;
 throughput=0;
 
 SIMUL_TIME=500;
 AWK_INTERVAL=400;
 
}

{
 
  if ( ($1 =="r") && ($5 =="ack") &&  ($4 =="0") ) {
   if (n == 0) start = $2;
   total1 ++;
   end = $2;
  }if (1<data)
  {
  if ( ($1 =="r") && ($5 =="ack") &&  ($4 =="1") ) {
   if (n == 0) start = $2;
   total2 ++;
   end = $2;
  }if (2<data)
  {
  if ( ($1 =="r") && ($5 =="ack") &&  ($4 =="2") ) {
   if (n == 0) start = $2;
   total3 ++;
   end = $2;
  }if (3<data)
  {
  if ( ($1 =="r") && ($5 =="ack") &&  ($4 =="3") ) {
   if (n == 0) start = $2;
   total4 ++;
   end = $2;
  }if (4<data)
  {
  if ( ($1 =="r") && ($5 =="ack") &&  ($4 =="4") ) {
   if (n == 0) start = $2;
   total5 ++;
   end = $2;
  }if (5<data)
  {
  if ( ($1 =="r") && ($5 =="ack") &&  ($4 =="5") ) {
   if (n == 0) start = $2;
   total6 ++;
   end = $2;
  }if (6<data)
  {
  if ( ($1 =="r") && ($5 =="ack") &&  ($4 =="6") ) {
   if (n == 0) start = $2;
   total7 ++;
   end = $2;
  }if (7<data)
  {
  if ( ($1 =="r") && ($5 =="ack") &&  ($4 =="7") ) {
   if (n == 0) start = $2;
   total8 ++;
   end = $2;
  }if (8<data)
  {
  if ( ($1 =="r") && ($5 =="ack") &&  ($4 =="8") ) {
   if (n == 0) start = $2;
   total9 ++;
   end = $2;
  }if (9<data)
  {
  if ( ($1 =="r") && ($5 =="ack") &&  ($4 =="9") ) {
   if (n == 0) start = $2;
   total10 ++;
   end = $2;
  }
  }
  }
  }
  }
  }
  }
  }
  }
  }
 
}

END { 
 print total1;
 print total2;
 print total3;
 print total4;
 print total5;
 print total6;
 print total7;
 print total8;
 print total9;
 print total10;
        print "============================================================";
}

And

NS2_awk-ack_rec_wireless_upstream10/downstream10

|

BEGIN {
 
 total0 = 0;
 total1 = 0;
 total2 = 0;
 total3 = 0;
 total4 = 0;
 total5 = 0;
 total6 = 0;
 total7 = 0;
 total8 = 0;
 total9 = 0;
 
 nm0=(data+2);
 nm1=(data+3);
 nm2=(data+4);
 nm3=(data+5);
 nm4=(data+6);
 nm5=(data+7);
 nm6=(data+8);
 nm7=(data+9);
 nm8=(data+10);
 nm9=(data+11);
 
 SIMUL_TIME=500;
 AWK_INTERVAL=400;
}

{
   if ( ($1 =="r") && ($4 =="AGT") && ($7 =="ack") && ($3 == nm0)) {
   if (n0 == 0) start0 = $2;
  
   total0 ++;
   end0 = $2;
  }
   if (1<data)
  {
  if ( ($1 =="r") && ($4 =="AGT") && ($7 =="ack") && ($3 == nm1 )) {
   if (n1 == 0) start1 = $2;
  
   total1 ++;
   end1 = $2;
  }
  if (2<data)
  {
  if ( ($1 =="r") && ($4 =="AGT") && ($7 =="ack") && ($3 == nm2  )) {
   if (n2 == 0) start2 = $2;
  
   total2 ++;
   end2 = $2;
  }
  if (3<data)
  {
  if ( ($1 =="r") && ($4 =="AGT") && ($7 =="ack") && ($3 == nm3)) {
   if (n3 == 0) start3 = $2;
  
   total3 ++;
   end3 = $2;
  }
  if (4<data)
  {
  if ( ($1 =="r") && ($4 =="AGT") && ($7 =="ack") && ($3 == nm4) ) {
   if (n4 == 0) start4 = $2;
  
   total4 ++;
   end4 = $2;
  }
  if (5<data)
  {
  if ( ($1 =="r") && ($4 =="AGT") && ($7 =="ack") && ($3 == nm5) ) {
   if (n5 == 0) start5 = $2;
  
   total5 ++;
   end5 = $2;
  }
  if (6<data)
  {
  if ( ($1 =="r") && ($4 =="AGT") && ($7 =="ack") && ($3 == nm6) ) {
   if (n6 == 0) start6 = $2;
  
   total6 ++;
   end6 = $2;
  }
  if (7<data)
  {
  if ( ($1 =="r") && ($4 =="AGT") && ($7 =="ack") && ($3 == nm7) ) {
   if (n7 == 0) start7 = $2;
  
   total7 ++;
   end7 = $2;
  }
  if (8<data)
  {
  if ( ($1 =="r") && ($4 =="AGT") && ($7 =="ack") && ($3 == nm8) ) {
   if (n8 == 0) start8 = $2;
  
   total8 ++;
   end8 = $2;
  }
  if (9<data)
  {
  if ( ($1 =="r") && ($4 =="AGT") && ($7 =="ack") && ($3 == nm9) ) {
   if (n9 == 0) start9 = $2;
  
   total9 ++;
   end9 = $2;
  }
  }
  }
  }
  }
  }
  }
  }
  }
  }
}

END {
 
 print total0;
 print total1;
 print total2;
 print total3;
 print total4;
 print total5;
 print total6;
 print total7;
 print total8;
 print total9;
print "============================================================";
}


And

NS2_awk-ack_send_wire_upstream10/downstream10

|

BEGIN {
 n=0;
 total0 = 0;
 total1 = 0;
 total2 = 0;
 total3 = 0;
 total4 = 0;
 total5 = 0;
 total6 = 0;
 total7 = 0;
 total8 = 0;
 total9 = 0;
 throughput=0;
 
 SIMUL_TIME=500;
 AWK_INTERVAL=400;
 
}

{
 if ( ($1 =="r") && ($5 =="ack") &&  ($3 =="0") ) {
   if (n == 0) start = $2;
   total0 ++;
   n +=1;
   #print n,"\t",$0;
   end = $2;
  }
  if (1<data)
  {
  if ( ($1 =="r") && ($5 =="ack") &&  ($3 =="1") ) {
   if (n == 0) start = $2;
   total1 ++;
   n +=1;
   #print n,"\t",$0;
   end = $2;
  }
  if (2<data)
  {
  if ( ($1 =="r") && ($5 =="ack") &&  ($3 =="2") ) {
   if (n == 0) start = $2;
   total2 ++;
   n +=1;
   #print n,"\t",$0;
   end = $2;
  }
  if (3<data)
  {
  if ( ($1 =="r") && ($5 =="ack") &&  ($3 =="3") ) {
   if (n == 0) start = $2;
   total3 ++;
   n +=1;
   #print n,"\t",$0;
   end = $2;
  }
  if (4<data)
  {
  if ( ($1 =="r") && ($5 =="ack") &&  ($3 =="4") ) {
   if (n == 0) start = $2;
   total4 ++;
   n +=1;
   #print n,"\t",$0;
   end = $2;
  }
  if (5<data)
  {
  if ( ($1 =="r") && ($5 =="ack") &&  ($3 =="5") ) {
   if (n == 0) start = $2;
   total5 ++;
   n +=1;
   #print n,"\t",$0;
   end = $2;
  }
  if (6<data)
  {
  if ( ($1 =="r") && ($5 =="ack") &&  ($3 =="6") ) {
   if (n == 0) start = $2;
   total6 ++;
   n +=1;
   #print n,"\t",$0;
   end = $2;
  }
  if (7<data)
  {
  if ( ($1 =="r") && ($5 =="ack") &&  ($3 =="7") ) {
   if (n == 0) start = $2;
   total7 ++;
   n +=1;
   #print n,"\t",$0;
   end = $2;
  }
  if (8<data)
  {
  if ( ($1 =="r") && ($5 =="ack") &&  ($3 =="8") ) {
   if (n == 0) start = $2;
   total8 ++;
   n +=1;
   #print n,"\t",$0;
   end = $2;
  }
  if (9<data)
  {
  if ( ($1 =="r") && ($5 =="ack") &&  ($3 =="9") ) {
   if (n == 0) start = $2;
   total9 ++;
   n +=1;
   #print n,"\t",$0;
   end = $2;
  }
  }
  }
  }
  }
  }
  }
  }
  }
  }
}

END {
 
 print total0;
 print total1;
 print total2;
 print total3;
 print total4;
 print total5;
 print total6;
 print total7;
 print total8;
 print total9;
print "============================================================";
 

}


And

NS2_awk-ack_send_wireless_upstream10/downstream10

|

BEGIN {
 n=0;
 total0 = 0;
 total1 = 0;
 total2 = 0;
 total3 = 0;
 total4 = 0;
 total5 = 0;
 total6 = 0;
 total7 = 0;
 total8 = 0;
 total9 = 0;
 throughput=0;
 nm=data;
 SIMUL_TIME=500;
 AWK_INTERVAL=400;
}

{
 if ( ($1 =="s") && ($4 =="AGT") && ($7 =="ack") && ($3 == nm+2)) {
   if (n == 0) start = $2;
   total0 ++;
   n +=1;
   #print n,"\t",$0;
   end = $2;
  }
  if (1<nm)
  {
  if ( ($1 =="s") && ($4 =="AGT") && ($7 =="ack") && ($3 == (nm + 3))) {
   if (n == 0) start = $2;
   total1 ++;
   n +=1;
   #print n,"\t",$0;
   end = $2;
  }
  if (2<nm)
  {
  if ( ($1 =="s") && ($4 =="AGT") && ($7 =="ack") && ($3 == (nm + 4))) {
   if (n == 0) start = $2;
   total2 ++;
   n +=1;
   #print n,"\t",$0;
   end = $2;
  }
  if (3<nm)
  {
  if ( ($1 =="s") && ($4 =="AGT") && ($7 =="ack") && ($3 == (nm + 5))) {
   if (n == 0) start = $2;
   total3 ++;
   n +=1;
   #print n,"\t",$0;
   end = $2;
  }
  if (4<nm)
  {
  if ( ($1 =="s") && ($4 =="AGT") && ($7 =="ack") && ($3 == (nm + 6)) ) {
   if (n == 0) start = $2;
   total4 ++;
   n +=1;
   #print n,"\t",$0;
   end = $2;
  }
  if (5<nm)
  {
  if ( ($1 =="s") && ($4 =="AGT") && ($7 =="ack") && ($3 == (nm + 7)) ) {
   if (n == 0) start = $2;
   total5 ++;
   n +=1;
   #print n,"\t",$0;
   end = $2;
  }
  if (6<nm)
  {
  if ( ($1 =="s") && ($4 =="AGT") && ($7 =="ack") && ($3 == (nm + 8)) ) {
   if (n == 0) start = $2;
   total6 ++;
   n +=1;
   #print n,"\t",$0;
   end = $2;
  }
  if (7<nm)
  {
  if ( ($1 =="s") && ($4 =="AGT") && ($7 =="ack") && ($3 == (nm + 9)) ) {
   if (n == 0) start = $2;
   total7 ++;
   n +=1;
   #print n,"\t",$0;
   end = $2;
  }
  if (8<nm)
  {
  if ( ($1 =="s") && ($4 =="AGT") && ($7 =="ack") && ($3 == (nm + 10)) ) {
   if (n == 0) start = $2;
   total8 ++;
   n +=1;
   #print n,"\t",$0;
   end = $2;
  }
  if (9<nm)
  {
  if ( ($1 =="s") && ($4 =="AGT") && ($7 =="ack") && ($3 == (nm + 11)) ) {
   if (n == 0) start = $2;
   total9 ++;
   n +=1;
   #print n,"\t",$0;
   end = $2;
  }
  }
  }
  }
  }
  }
  }
  }
  }
  }
}

END {
 print total0;
 print total1;
 print total2;
 print total3;
 print total4;
 print total5;
 print total6;
 print total7;
 print total8;
 print total9;
print "============================================================";
}


And

NS2_awk-throughput_upstream10/downstream10

|

BEGIN {
 n=0;
 total0 = 0;
 total1 = 0;
 total2 = 0;
 total3 = 0;
 total4 = 0;
 throughput0=0;
 throughput1=0;
 throughput2=0;
 throughput3=0;
 throughput4=0;
 nm0=(nn+2);
 nm1=(nn+3);
 nm2=(nn+4);
 nm3=(nn+5);
 nm4=(nn+6);
 nm5=(nn+7);
 nm6=(nn+8);
 nm7=(nn+9);
 nm8=(nn+10);
 nm9=(nn+11);
 SIMUL_TIME=500;
 AWK_INTERVAL=400;
}

{
  if ( ($1 =="r") && ($4 =="AGT") && ($7 =="tcp") && ($3 ==nm0)) {
   if (n == 0) start0 = $2;
   total0 += $8 * 8;
   end0 = $2;
  }
  if (1<nn)
  {
  if ( ($1 =="r") && ($4 =="AGT") && ($7 =="tcp") && ($3 == (nm1))) {
   if (n == 0) start1 = $2;
   total1 += $8 * 8;
   end1 = $2;
  }
  if (2<nn)
  {
  if ( ($1 =="r") && ($4 =="AGT") && ($7 =="tcp") && ($3 == (nm2))) {
   if (n == 0) start2 = $2;
   total2 += $8 * 8;
   end2 = $2;
  }if (3<nn)
  {
  if ( ($1 =="r") && ($4 =="AGT") && ($7 =="tcp") && ($3 == (nm3))) {
   if (n == 0) start3 = $2;
   total3 += $8 * 8;
   end3 = $2;
  }if (4<nn)
  {
  if ( ($1 =="r") && ($4 =="AGT") && ($7 =="tcp") && ($3 == (nm4))) {
   if (n == 0) start4 = $2;
   total4 += $8 * 8;
   end4 = $2;
  }if (5<nn)
  {
  if ( ($1 =="r") && ($4 =="AGT") && ($7 =="tcp") && ($3 == (nm5))) {
   if (n == 0) start5 = $2;
   total5 += $8 * 8;
   end5 = $2;
  }if (6<nn)
  {
  if ( ($1 =="r") && ($4 =="AGT") && ($7 =="tcp") && ($3 == (nm6))) {
   if (n == 0) start6 = $2;
   total6 += $8 * 8;
   end6 = $2;
  }if (7<nn)
  {
  if ( ($1 =="r") && ($4 =="AGT") && ($7 =="tcp") && ($3 == (nm7))) {
   if (n == 0) start7 = $2;
   total7 += $8 * 8;
   end7 = $2;
  }if (8<nn)
  {
  if ( ($1 =="r") && ($4 =="AGT") && ($7 =="tcp") && ($3 == (nm8))) {
   if (n == 0) start8 = $2;
   total8 += $8 * 8;
   end8 = $2;
  }if (9<nn)
  {
  if ( ($1 =="r") && ($4 =="AGT") && ($7 =="tcp") && ($3 == (nm9))) {
   if (n == 0) start9 = $2;
   total9 += $8 * 8;
   end9 = $2;
  }
  }
  }
  }
  }
  }
  }
  }
  }
  }
}

END {
  throughput0 = (total0)/ ( (1000) * 500 );
  throughput1 = (total1)/ ( (1000) * 500 );
         throughput2 = (total2)/ ( (1000) * 500 );
         throughput3 = (total3)/ ( (1000) * 500 );
         throughput4 = (total4)/ ( (1000) * 500 );
         throughput5 = (total5)/ ( (1000) * 500 );
  throughput6 = (total6)/ ( (1000) * 500 );
  throughput7 = (total7)/ ( (1000) * 500 );
  throughput8 = (total8)/ ( (1000) * 500 );
  throughput9 = (total9)/ ( (1000) * 500 );        
 #Bandwidth 1Mbps = 1000Kbps
        
 print throughput0,"\t",total0;
 print throughput1,"\t",total1;
 print throughput2,"\t",total2;
 print throughput3,"\t",total3;
 print throughput4,"\t",total4;
 print throughput5,"\t",total5;
 print throughput6,"\t",total6;
 print throughput7,"\t",total7;
 print throughput8,"\t",total8;
 print throughput9,"\t",total9;
 print "========================================================="
}


And

NS2_awk-throughput1_upstream10/downstream10

|

BEGIN {
 n0=0;
 n1=0;
 n2=0;
 n3=0;
 n4=0;
 n5=0;
 n6=0;
 n7=0;
 n8=0;
 n9=0;
 
 total0 = 0;
 total1 = 0;
 total2 = 0;
 total3 = 0;
 total4 = 0;
 total5 = 0;
 total6 = 0;
 total7 = 0;
 total8 = 0;
 total9 = 0;
 throughput0=0;
 throughput1=0;
 throughput2=0;
 throughput3=0;
 throughput4=0;
 throughput5=0;
 throughput6=0;
 throughput7=0;
 throughput8=0;
 throughput9=0;
 
 SIMUL_TIME=500;
 AWK_INTERVAL=400;
}

{
 
  if ( ($1 =="r") && ($5 =="tcp") && ($4 =="0") && ($3 ==nn)) {
   if (n0 == 0) start0 = $2;
   n0++;
   total0 += $6 * 8;
   end0 = $2;
  }
  if (1<nn)
  {
  if ( ($1 =="r") && ($5 =="tcp") && ($4 =="1") && ($3 ==nn)) {
   if (n1 == 0) start1 = $2;
   n1++;
   total1 += $6 * 8;
   end1 = $2;
  }
  if (2<nn)
  {
  if ( ($1 =="r") && ($5 =="tcp") && ($4 =="2") && ($3 ==nn)) {
   if (n2 == 0) start2 = $2;
   n2++;
   total2 += $6 * 8;
   end2 = $2;
  }
  if (3<nn)
  {
  if ( ($1 =="r") && ($5 =="tcp") && ($4 =="3") && ($3 ==nn)) {
   if (n3 == 0) start3 = $2;
   n3++;
   total3 += $6 * 8;
   end3 = $2;
  }
  if (4<nn)
  {
  if ( ($1 =="r") && ($5 =="tcp") && ($4 =="4") && ($3 ==nn)) {
   if (n4 == 0) start4 = $2;
   n4++;
   total4 += $6 * 8;
   end4 = $2;
  }
  if (5<nn)
  {
  if ( ($1 =="r") && ($5 =="tcp") && ($4 =="5") && ($3 ==nn)) {
   if (n5 == 0) start5 = $2;
   n5++;
   total5 += $6 * 8;
   end5 = $2;
  }
  if (6<nn)
  {
  if ( ($1 =="r") && ($5 =="tcp") && ($4 =="6") && ($3 ==nn)) {
   if (n6 == 0) start6 = $2;
   n6++;
   total6 += $6 * 8;
   end6 = $2;
  }
  if (7<nn)
  {
  if ( ($1 =="r") && ($5 =="tcp") && ($4 =="7") && ($3 ==nn)) {
   if (n7 == 0) start7 = $2;
   n7++;
   total7 += $6 * 8;
   end7 = $2;
  }
  if (8<nn)
  {
  if ( ($1 =="r") && ($5 =="tcp") && ($4 =="8") && ($3 ==nn)) {
   if (n8 == 0) start8 = $2;
   n8++;
   total8 += $6 * 8;
   end8 = $2;
  }
  if (9<nn)
  {
   if ( ($1 =="r") && ($5 =="tcp") && ($4 =="9") && ($3 ==nn)) {
   if (n9 == 0) start9 = $2;
   n9++;
   total9 += $6 * 8;
   end9 = $2;
  }
  }
  }
  }
  }
  }
  }
  }
  }
  }
  
}

END {
  throughput0 = (total0)/ ( (1000) * 500 );
  throughput1 = (total1)/ ( (1000) * 500 );
   throughput2 = (total2)/ ( (1000) * 500 );
   throughput3 = (total3)/ ( (1000) * 500 );
   throughput4 = (total4)/ ( (1000) * 500 );
   throughput5 = (total5)/ ( (1000) * 500 );
   throughput6 = (total6)/ ( (1000) * 500 );
   throughput7 = (total7)/ ( (1000) * 500 );
   throughput8 = (total8)/ ( (1000) * 500 );
  throughput9 = (total9)/ ( (1000) * 500 );
 #Bandwidth 1Mbps = 1000Kbps

 print throughput0,"\t",total0;
 print throughput1,"\t",total1;
 print throughput2,"\t",total2;
 print throughput3,"\t",total3;
 print throughput4,"\t",total4;
 print throughput5,"\t",total5;
 print throughput6,"\t",total6;
 print throughput7,"\t",total7;
 print throughput8,"\t",total8;
 print throughput9,"\t",total9;
 print "========================================================="
}


And

NS2_ awk-UDP_upstream10/downstream10

| 2009. 1. 18. 03:10
보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.
prev | 1 | 2 | 3 | 4 | ··· | 6 | next