2008年6月20日 星期五

lab 13 Performance of anomaly in multi-rate wireless

Objective
  • What is performance anomaly?
  • How to deal with performance anomaly and enhance throughput
background

in 802.11b, node A and node B both want to send data to the server. Node A start to move away form the the server. The transfer rate of node A adjust from 11M to 1M. Node B will change the rate that affected by node A. It called " performance anomaly".


simulation steps

we observe the data collect from node C

generate 11m_sd and 1m_sd and 11m_rd and 1m_rd for node A and node B

11m_rd and 1m_rd are the record from node C, received form node B, A .




observe the throughput. 0~15 sec. node C recv. 2Mbps form node A and node C
when A's data rate decreased to 1Mbps, node B's throughput also deceased to 750kbps-->
performance anomaly. After 30 secs, node B's data rate is recovered.



  • Method 1
    change frame size. if rate is 11Mbps, CBR packets size 1000bytes
    rate is 1Mbps, CBR packets size change into 256 bytes.


This method slow down the rapid decrease of node B.

  • Method 2
    change the contention window
    data rate 11Mbps contention window set to 32
    data rate 1Mbps contention window set to 352
    all node packet size are the same which is 1000 bytes




The rapid decreasing of node A (red line)will not bother node B(blue line)

The performance anomaly can be solved.

lab 12 Thoughput limit of IEEE 802.11b

Objectives
  • Thoughput limit of IEEE 802.11b
  • understand the issue may affect Thoughput
Background
  • Physical Layer-physical layer converage protocol(PLCP) and physical medium dependent(PMD)
    MAC
    |
    PLCP
    |
    PMD
  • 802.11b MAC layer
    MAC header|DATA|CRC
    30bytes 4 bytes
  • in basic mode, some proof is shown on the text book
ns2 simulation

using long preamble with packet size 2000bytes


calculate value 6.8Mbps

using short preamble with packet size 2000 bytes


calculate value 7.4Mbps


The simulation is very close to the calculate value, according to the text book.

作業(5/5):NS2技能自我檢視

問題:在做lab11的實驗,我要怎麼模擬兩個不同傳輸協定互傳?
描述:在lab11的實驗測試802.11b 傳給802.11b和 802.11e傳給802.11e,但是在實際的環境中,環境通常是有不同的兩個不同的協定方式互傳,如:實驗室所使用的ap是802.11a/b/g/n,而筆電的傳輸協定是802.11a/b/g,中間的傳輸如何用ns2模擬呢?







A:原來在下個實驗13就有。

lab 11 The comparison of 802.11b DCF and 802.11e EDCA

understand the mechanism of 802.11b DCF and 802.11e EDCA

  • CSMA/CA
    802.3 use the carrier sense multiple access/collision detectionthe packets need to detect the channel is idle or busy.If the collision occurs, the jan signal will send.It not easy to the detect
    the collision in wireless networks. The signal gets weak and the hidden terminal problem.
  • Distribution coordination function(DCF)
    Definition in the IEEE 802.11b protocol
    point coordination function (PCF)
    -contention free period : special node to control the time use in the channel.
    -contention period : each node in contention.
  • DIFS: Distributed Inter-Frame Space, the time need to wait if the channel is idle.
  • RTS/CTS is not regulated in the IEEE standard.

  • Enhanced Distribution Channel Access(EDCA)
  • To get better QoS. The priority of the data is defined, such as audio, video, best effort...etc.
ns2 simulation

three wireless node n0-->video---> n1, n1--->FTP flow--->n2, n2--->exponential traffic--->n0
priority1-video
priority2-ftp flow
priority3-exponetial traffic

802.11b results










802.11e results









Observation of two results.

average psnr 32.8(802.11b)<34.8(802.11e)
average delay 1.04(802.11b)>0.08(802.11e)

2008年6月19日 星期四

作業(4/5):NS2技能自我檢視

問題: awk程式是做什麼用的?
描述:在課本的練習當中,會用awk指令去分析trace file,以得到Throughput、Delay、Jitter等,但是為什麼要用這個指令去分析?這個指令特別的地方是在哪裡?他似乎是以一種程式語言,可寫成.awk的檔,再利用$awk file.awk out.fr。

在老師提供的資訊,看到了awk這個指令介紹了。

2008年6月13日 星期五

作業(3/5):NS2技能自我檢視

問題:想要改增加修改自己的MAC?
描述:在課本有提到,自己增加802.11e的檔案,參閱自己所安裝的檔案,我在C:\cygwin\home\Sky\ns-allinone-2.32\ns-2.32\mac找到許多類似可以修改的檔案,如tdma可以看到3個相關的檔案,mac-tdma.o,mac-timers.cc,mac-timers.h,原本以為mac-tdma.o應該是某檔案的原始檔,但是用記事本打不開。那我又看到兩個副檔名為.cc,.h,這就是C++的code和標頭檔,除了mac-timers.cc,mac-timers.h ,.o如何新增修改。

作業(2/5):NS2技能自我檢視

問題: DropTail queue?
描述:在ns by sample裡,我看到了DropTail 這個term,maximum size 10,在計算機網路有點忘記有沒有提過,在基本的OTcl對於node的描述如下
NAM display

$ns duplex-link $n(0) $n(1) 5Mb 2ms DropTail
$ns duplex-link $n(1) $n(2) 5Mb 2ms DropTail

bandwidth / 20 ms of delay/droptail

還有RED queue...有點忘記 還要繼續補起來

2008年6月12日 星期四

M/M/1 programing project

Some review of M/M/1

= arrival process/service process/number of servers
= exponential distribution for the interarrival times of customers /exponential distribution for the service time of customers/1 server

Kendal's notation.

The M/M/1 system is made of a Poisson arrival, one exponential (Poisson) server, FIFO (or not specified) queue of unlimited capacity and unlimited customer population.

update
今天口試完了,可以繼續想code。
現在卡在error410(TimeStamp > Q.Scheduled_Time)這部份是錯的
應該錯誤是出在dynamic queue的部份,還在debug

已經把輸入方式改成console.現在先將老師上課給的參數先填進去模擬。不用每次都重新輸入。

Dynamic Queue複習一下

仍在修改版本



改了第二個版本

模擬如下






REF:


The M/M/1 Queuing System

M/M/1 Solver & Simulator

2008年6月5日 星期四

作業(1/5):NS2技能自我檢視

ns是一個以c++和 otcl 程式所構成的。

Q: why Otcl? Can you tell why do we use the language of OTcl?
Description: 一開始會接觸的根本問題,為什麼我們要使用OTcl這個語言,而不是使用單純的C or C++程式去描寫,有點跳脫出我們使用習慣,我想一定是這OTcl有某方面較強的功能。是不是有點像為什麼有些模擬要用matlab,因為內建許多函數比起c++方便使用?


A:在搜尋之後,也得到一些解釋。

C++ is fast to run but slower to change
OTcl runs much slower but can be changed very quickly

2008年5月22日 星期四

lab 10 analysis of Adhoc routing protocol

Creating and analyzing the Ad Hoc model network by ns2.

point to point network access


Ad Hoc routing protocol
  • Proactive routing protocol
  • Reactive routing protocol
DSDV vs AODV vs DSR



tool of cbrgen and setdest

cbrgen
  • cbrgen can create TCP flow or CBR flow
  • follow the instruction in the book, we can get the output in cbr_n5_m2_r10
setdest

is developed for the node to move.





$ns_ at 0.000000000000 "$node_(0) setdest 156.840080144521 30.349526929832 0.011129687148"
moving to x=156.84 y=30.34

$ns_ at 0.000000000000 "$node_(1) setdest 132.171021306788 67.100889388701 3.213954821346"

example 1

assume we have 100 nodes simulation time 100s pause time 100s
no mobility, use CBR flow, max connection 10, 10 packets per sec.



read the example code lab10_1.tcl and evaluation program parse.awk

ns simulate the DSDV, AODV and DSR
DSDV


AODV


DSR



When the pause time set to 0.
the node is moving

DSDV



AODV



DSR


if the node is moving rapidly, AODV or DSR can make the first node receive earlier.
DSDV path is not always available. When it has to update routing table, the time will be delay in the first pakets.




2008年5月15日 星期四

Learn how to extend NS2

The ref

start from my own computer
Let's see what we got!
The directory structure of ns-allinone-2.29


All the

2008年4月10日 星期四

lab8 the analysis and evaluation of video transmission

the transmission quality will depend on GOP pattern, Quantization value, packet size and packet error rate.

we will use MyEvalvid to simulate the connection of those parameters.

1.
use the ffmpeg to transform YUV to m4v
qscale is added.


2.
And than use the Mp4Box to make it into mp4


3.
use mp4trace to trace the information of every frame which will save in foreman_qcif.st file.


4.

use ns to simulate sd rd files.


5.
the etmp4 file can create a loss frame mp4 video.



7.

ffmpeg: recover the mp4 to yuv files.


8.
calculate the psnr of yuv video.



9.
compare the packet loss abd GOP patten.
find the relationship.

find the GOP of length 9



10.

The GOP of length 15


The more MTU increases, the higher average PSNR.

lab7 MyEalvid-NT

understanding the improved version of MyEalvid.

1. we are going to find the decodable frame rate, packet loss rate, packet delay and packet jitter.

internet - wireless AP - video recv.
/------------packets lost---------/

2. ns2 simualtion


3.
use et.exe to evaluate sd rd .st


total_frame=89998
decodable_frame=82217
and I-frame, P-frame, B-frame

4.
find average and maximum delay



5. plot the time delay of packet sequence



6. plot the frame delay



7 plot the packet jitter



8. plot the frame jitter

lab 6 MyEvalVid

understanding MyEvalVid and combine with NS2

example 1

1.use ffmepg to make YUV file to m3v file(using foreman film example)


2. after .m4v file is OK, use MP4BOX to make mp4 file



3.use mp4trace to trace information of every frame.
and we can get .st file

start ns2 simulation




4. sd record and rd record are created.

and then we can use etmp4 to re-generate the frame loss film


5.
source yuv and reconstruction ynv PSNR calculate.



6 finally, the yuv viewer help us to see the difference the file.



example 2.

we will find how to simulate two video flow.

1. sd1 rd1 found!


2.




using the same technique, the PSNR= 34.034 for video flow 1

3. comparison.