Báo cáo định kỳ lần 1

Preview:

Citation preview

8/8/2019 Báo cáo định kỳ lần 1

http://slidepdf.com/reader/full/bao-cao-dinh-ky-lan-1 1/18

Periodical report no.1

Lecturer: Nguyn Trung Dng

Student: Nguyn Mnh Tú (NT)

Ngô c Vinh Quang

Trn Thành

8/8/2019 Báo cáo định kỳ lần 1

http://slidepdf.com/reader/full/bao-cao-dinh-ky-lan-1 2/18

Ni Dung

1 introduction

1.1 Ns2 overview

1.2 Nam1.3 Xgraph

1.4 Format of trace file

2 Simulation

8/8/2019 Báo cáo định kỳ lần 1

http://slidepdf.com/reader/full/bao-cao-dinh-ky-lan-1 3/18

1.1 NS2 overview (1)

NS is an object oriented simulator targeted at

networking research, written in C++.

NS provide support for networking researchand education:

 ± Protocol design, traffic studies, etc

 ± Protocol comparison

 ± New architecture design are also support

8/8/2019 Báo cáo định kỳ lần 1

http://slidepdf.com/reader/full/bao-cao-dinh-ky-lan-1 4/18

1.1 NS2 overview (2)

Ns 2 use two languages: C++ and Otcl.

 ± C++ faster to run but slower to change, => suitable

for detailed protocol implementation.

 ± Otcl slower to run but faster to change => suitable

for simulation configuration.

8/8/2019 Báo cáo định kỳ lần 1

http://slidepdf.com/reader/full/bao-cao-dinh-ky-lan-1 5/18

1.1 NS2 overview (3)

protocol/models supported

 ± Wired network

Routing: unicast, multicast, hierarchical routing, etc.

Transportation: TCP, UDP, others;

Traffic sources: web, ftp, telnet, cbr, etc.

Queuing disciplines: drop-tail, RED, etc.

Qos: intServ and Diffserv wireless networking ± Adhoc routing and mobile IP

 ± Sensor network

 ± Satellite network

8/8/2019 Báo cáo định kỳ lần 1

http://slidepdf.com/reader/full/bao-cao-dinh-ky-lan-1 6/18

1.2 Nam Network animator

Nam provides a visual interpretation of the

network topology created. It can be executed

directly from a TCL script.

Nam support:

 ± Provide darg and drop interface for creating

topologies.

 ± Control button include pause, play, stop, speed

controler.

8/8/2019 Báo cáo định kỳ lần 1

http://slidepdf.com/reader/full/bao-cao-dinh-ky-lan-1 7/18

1.3 xgraph - Graph plotting tool

Xgraph analyse trace files produces from ns2

to draw graph.

We use awk script to extract the necessaryinformation from frace file (.tr)

Xgraph can be called in tcl script

8/8/2019 Báo cáo định kỳ lần 1

http://slidepdf.com/reader/full/bao-cao-dinh-ky-lan-1 8/18

1.4 Format of trace file (1)

Format of trace file generated by NS

<event> <time> <from> <to> <pkt-type> <pkt-size> <flags> <fid> <src> <dst> <seq> <uid>

Trace example

+ 1 0 2 cbr 210 ------- 0 0.0 3.1 0 0

- 1 0 2 cbr 210 ------- 0 0.0 3.1 0 0

r 1.00234 0 2 cbr 210 ------- 0 0.0 3.1 0 0

8/8/2019 Báo cáo định kỳ lần 1

http://slidepdf.com/reader/full/bao-cao-dinh-ky-lan-1 9/18

8/8/2019 Báo cáo định kỳ lần 1

http://slidepdf.com/reader/full/bao-cao-dinh-ky-lan-1 10/18

1.4 Format of trace file (new format)

(3)

Next hop info: starts with a leading -H

-Hs: id of hop source; -Hd: id of hop destination

Packet info at Mac level: start with -M Packet info at IP level: start with -I

Packet info at application level: start with -P

8/8/2019 Báo cáo định kỳ lần 1

http://slidepdf.com/reader/full/bao-cao-dinh-ky-lan-1 11/18

2 simulation

topology

TCP

UDP

8/8/2019 Báo cáo định kỳ lần 1

http://slidepdf.com/reader/full/bao-cao-dinh-ky-lan-1 12/18

screenshot

8/8/2019 Báo cáo định kỳ lần 1

http://slidepdf.com/reader/full/bao-cao-dinh-ky-lan-1 13/18

Code tcl

8/8/2019 Báo cáo định kỳ lần 1

http://slidepdf.com/reader/full/bao-cao-dinh-ky-lan-1 14/18

Drop-CBR.awk script

BEGIN {numd=0;numr=0}

{

if (($1=="d")&&($4==3)&&($8==1)) { numd++; }

if (($1=="+")&&($3==1))

{ numr++;

print $2 " " numd/numr;}

}END{}

8/8/2019 Báo cáo định kỳ lần 1

http://slidepdf.com/reader/full/bao-cao-dinh-ky-lan-1 15/18

Drop-ftp.awk script

BEGIN {numd=0;numr=0}

{

if (($1=="d")&&($4==3)&&($8==2)) { numd++; }

if (($1=="+")&&($3==0))

{ numr++;

print $2 " " numd/numr;}

}END{}

8/8/2019 Báo cáo định kỳ lần 1

http://slidepdf.com/reader/full/bao-cao-dinh-ky-lan-1 16/18

Packet loss ratio graph

8/8/2019 Báo cáo định kỳ lần 1

http://slidepdf.com/reader/full/bao-cao-dinh-ky-lan-1 17/18

Next target

Principle of adhoc network

Simulation a simple adhoc network

8/8/2019 Báo cáo định kỳ lần 1

http://slidepdf.com/reader/full/bao-cao-dinh-ky-lan-1 18/18

Thank you for listening

Recommended