Network Simulator with Mobile IP 2003 Huang – Yu Liu.

Slides:



Advertisements
Similar presentations
Brief Intro to ns2: The most widely used Network Simulator COMP5416 Advanced Network Technologies Based on: Marc Greis's
Advertisements

Ns-2 Tutorial Exercise (1) Multimedia Networking Group, The Department of Computer Science, UVA Jianping Wang Adopted from Nicolas’s slides Jianping Wang,
Network Simulator (NS) Prof. Nelson L. S. da Fonseca State University of Campinas, Brazil.
Introduction to Wireless simulations Shao-Cheng Wang.
Simulation of GPRS MS-BS Interface Using ns-Network Simulator Dual Degree Presentation by Richa Jain (96D07007) Department of Electrical Engineering, Indian.
報告者:黃亮維 NS2 Chapter 26 Trace Support. Outline  Trace Support ‧ OTcl Helper Functions  Library support and examples  The C++ Trace Class  Trace File.
FCU, Department of ECE, IC Design Research Lab. TEL: # 4945 Pre-SIm , Post-Sim.
Chapter 10 馬可夫鏈 緒言 如果讀者仔細觀察日常生活中所發生的 諸多事件,必然會發現有些事件的未來 發展或演變與該事件現階段的狀況全然 無關,這種事件稱為獨立試行過程 (process of independent trials) ;而另一些 事件則會受到該事件現階段的狀況影響。
布林代數的應用--- 全及項(最小項)和全或項(最大項)展開式
:Word Morphing ★★☆☆☆ 題組: Problem Set Archive with Online Judge 題號: 10508:word morphing 解題者:楊家豪 解題日期: 2006 年 5 月 21 日 題意: 第一行給你兩個正整數, 第一個代表下面會出現幾個字串,
3Com Switch 4500 切VLAN教學.
Network Simulator 2 Tejas Vasavada.
1 第一章 Word 的基本觀念 內容概要: Word 的特色 啟動與離開 Word 的方法 滑鼠游標與外型的介紹 基本操作 Word 視窗法則 使用 Word 遭遇問題時, 應如何利用軟體特 性而獲得輔助解說.
1 Web of Science 利用指引 單元二 瀏覽與處理查詢結果. 2 瀏覽檢索結果 查出的結果,預設以時間排列, 使用者可改變結果的排列方式: 還可以依被引用次數、相關度、 第一作者、刊名、出版年等排序 回到前先查的結果畫面 點選想看資料的完整書目 本館訂購範圍的期刊 全文,便可直接連結.
1 Network Simulator (NS-2). 2 講義 Network Simulator (NS2) Part 1: 下載 Part 2: 安裝與測試 Part 3: 劇本 Part 4: 數據.
3-3 使用幾何繪圖工具 Flash 的幾何繪圖工具包括線段工具 (Line Tool) 、橢圓形工具 (Oval Tool) 、多邊星形 工具 (Rectangle Tool) 3 種。這些工具畫出 來的幾何圖形包括了筆畫線條和填色區域, 將它們適當地組合加上有技巧地變形與配 色, 不但比鉛筆工具簡單,
Chapter 20 塑模動態觀點:狀態圖 Statechart Diagram. 學習目標  說明狀態圖的目的  定義狀態圖的基本記號  展示狀態圖的建構  定義活動、內部事件及遞延事件的狀態 圖記號.
圖層的操作與管理 圖層的作用就如同一張張透明的賽璐璐片, 你可以將動畫中的每項物件, 放置在不同圖 層中, 圖層交疊就形成完整的畫面。在各圖 層中的物件, 做任何的移動或變化, 都不會 相互干擾, 所以當你編輯一個物件時, 只要 在物件所在的圖層進行操作, 將可大幅降低 製作過程的複雜度與難度。
Network Simulator (NS-2)
McGraw-Hill/Irwin © 2003 The McGraw-Hill Companies, Inc.,All Rights Reserved. 參 資料蒐集的方法.
國立聯合大學 資訊管理學系 陳士杰老師 SQL*Plus 與 iSQL*Plus 簡介. 國立聯合大學 資訊管理學系 資料庫系統課程 ( 陳士杰 ) 2 啟動 SQL*Plus 與 iSQL*Plus 方式 Windows 平台.
1-6 動畫的文件屬性 舞台是動畫實際播放的畫面, 所以舞台的大 小與長寬比例對將來動畫的呈現有很大的 影響。 Flash 預設的舞台尺寸是 550 Pixels × 400 Pixels, 背景為白色, 如果要更改舞台大小與 背景色, 請執行『修改 / 文件』命令, 開啟文 件屬性 (Document.
:Nuts for nuts..Nuts for nuts.. ★★★★☆ 題組: Problem Set Archive with Online Judge 題號: 10944:Nuts for nuts.. 解題者:楊家豪 解題日期: 2006 年 2 月 題意: 給定兩個正整數 x,y.
6-2 認識元件庫與內建元件庫 Flash 的元件庫分兩種, 一種是每個動畫專 屬的元件庫 (Library) ;另一種則是內建元 件庫 (Common Libraries), 兩者皆可透過 『視窗』功能表來開啟, 以下即為您說明。
Day 3 Outline Multicast example (from Day 2) Wireless Misc. utilities
Management Abstracts Retrieval System; MARS 檢索操作.
Image Interpolation Use SSE 指導教授 : 楊士萱 學 生 : 楊宗峰 日 期 :
Network Simulator Tutorial. The Network Simulator - ns-2 NS2 is a discrete event simulator targeted at networking research.
Chapter 10 m-way 搜尋樹與B-Tree
Yinfei Pan SUNY Binghamton Computer Science
網路介紹及其運用 講師陳炯勳. 5-2 IP 協定 ( 一 ) IP 協定運作 (1) – 網路成員:主機 (Host) 與路由器 (Router) – 路由表 – 電報傳輸運作.
NS2 - Overview Ming-Feng Yang. 2 2 Outline Introduction OTcl Trace File NAM Xgraph.
第 6 章 迴圈結構 6-1 計數迴圈 6-1 計數迴圈 6-2 條件迴圈 6-2 條件迴圈 6-3 巢狀迴圈 6-3 巢狀迴圈 6-4 While/End While 迴圈 6-4 While/End While 迴圈 6-5 跳出迴圈 6-5 跳出迴圈 6-6 VB.NET 的錯誤處理 6-6 VB.NET.
RTP Real-Time Transport Protocol Speaker: Hsiao-Ting Wang Advisor: Quincy Wu Date: July 2 nd 2009.
Jump to first page NS Tutorial: mobile and wireless network simulation Ya Xu USC/ISI September 10th, 1999.
指導教授 : 林啟芳 教授 組員 : 邱秉良 林育賢. 何謂 GPS  GPS 即全球定位系統,是一個中距離圓 型軌道衛星導航系統。它可以為地球表面 絕大部分地區( 98% )提供準確的定位、 測速和高精度的時間標準。
Visual C++重點複習.
著作權所有 © 旗標出版股份有限公司 第 14 章 製作信封、標籤. 本章提要 製作單一信封 製作單一郵寄標籤.
EECS122 - UCB1 Measurements and Modeling Table of Contents 1. Measurements Measurements 2. Modeling and its Shortcomings Modeling and its Shortcomings.
Ns Simulation of IEEE SC546 Project (Fall 2002) SOO IL KIM JISUN YOON
Introduction to Network Simulator NS-2 Part II
Network Simulator 2(NS2) Yingyue Xu 8/25/2015. Overview: The Network simulator (NS): discrete event simulator for networks. supports wired, wireless,
Wireless Networking and Systems CSE 590 ns2 tutorial.
Introduction to ns-2 Noun Choi Oct. 11, Outline Background ns-2 Internals Short demo Troubleshooting Reference links Q & A.
1 Introduction to Ns-2 Zhibin WU WINLAB, ECE Dept. Rutgers U.
1 / 10 Mobile Networking in ns Speaker : Mark Yang
Introduction to Mobility & Network Simulator 2 (NS-2)
NS2 - Wireless Network Ming-Feng Yang. 2 2 Outline Basic wireless model Extensions wireless model Example - Ad hoc network Example – WLAN Example – Mobile.
Define options(1/2) #channel type set val(chan) Channel/WirelessChannel # radio-propagation model set val(prop) Propagation/TwoRayGround # network interface.
MOBILE IP SOMULATION IN NS2 Presenter: 吳寶緣. Outlines  Overview  Hierarchical Address Format  Hierarchical Address Format-ex  MoblieIP Demo  Additional.
Date : 2010/11/23 Speaker : Chia-Wen Lu 1.  Network Simulation  Introduction to NS2  Simple Simulation Example 2.
Network Simulator-2 Sandeep singla 1998A2A7540. NS-2 A discrete event simulator Focused on modeling network protocols –Wired, wireless –TCP,UDP,unicast,multicast.
NetFlow Very useful for traffic analysis Very useful for traffic analysis Standard sampler: Standard sampler: –Cisco Netflow –Juniper Traffic Sampling.
1 Network Simulator Tutorial. 2 Network Simulation * Motivation: Learn fundamentals of evaluating network performance via simulation Overview: fundamentals.
Internet Computing KUT Youn-Hee Han
Quality evaluation of MPEG4 video transmission over GPRS networks.. Presented by: Abdullah M. Rana Multimedia Communication.
1 NS Fundamentals. USC INFORMATION SCIENCES INSTITUTE 2 OTcl and C++: The Duality C++ OTcl Pure C++ objects Pure OTcl objects C++/OTcl split objects ns.
Network Simulator Tutorial Wireless Networks. Acknowledgements Material is taken from the presentations by Jim Kurose, University of Massachusetts, Amherst.
CDA6530: Performance Models of Computers and Networks Chapter 10: Introduction to Network Simulator (NS2) TexPoint fonts used in EMF. Read the TexPoint.
The Creation of NS2 Simulated Environment ( 1 ) LI Chengbo
TNK092: Network Simulation - Nätverkssimulering Lecture #1: Course basics and a first taste of NS2 Vangelis Angelakis Ph.D.
Use of Mobility models in ns-2 Karthik Dantu Shyam Kapadia.
NS-2 Shahin Shayandeh December 2004 Session 1. Ns-2, the Network Simulator  A discrete event simulator Simple model  Focused on modeling network protocols.
DMET 602: Networks and Media Lab Amr El Mougy Yasmeen EssamAlaa Tarek.
Ch7: Link and Buffer Management. 2 Portrait of A Mobile Node Node ARP Propagation and antenna models MobileNode LL MAC PHY LL CHANNEL LL MAC PHY Classifier:
NS-2 Simulator 최 종 훈 Contents  About NS  Installation  Based on Linux  Based on Windows  Architecture  Using NS-2  Example  References.
1 Network Simulator 2 Install Chao-Ying Chiu
Basics of NS-2 Training in TCL script
Introduction to ns-2 Noun Choi Oct. 11, 2007.
TexPoint fonts used in EMF.
Presentation transcript:

Network Simulator with Mobile IP 2003 Huang – Yu Liu

Overview Introduction Install Simulation Simulation for Mobile IP

安裝 Linux 深入 Linux 建構與管理 第三版 楊文誌 著, 旗標出版社 at.php at.php

Network Simulator A Collaboration between researchers at UC Berkeley, USC/ISI, and Xerox PARC 全錄帕洛奧圖研究中心. The simulator is written in C++; it uses OTcl as a command and configuration interface.

Network Simulator Tcl - Tool Command Language OTcl – Object Tcl /cmtdoc/otcl/ /cmtdoc/otcl/tutorial.html

Network Simulator ns-2.1b10[OLD VERSION NO] / ns-2.26[NEW VERSION NO] Released on Wed Feb 26 11:40:51 PST 2003 ns-2.1b8[OLD] / ns-2.24[NEW] ns-2.1b8[OLD] / ns-2.24[NEW] released on Wed June 06 11:05:52 PDT 2001

Network Simulator Install ns : Get file ns-allinone-2.26.tar.gz 輸入 tar zxvf ns-allinone-2.26.tar.gz p.s 假設在根目錄下輸入此指令

Network Simulator 進入 ns-allinone-2.26 資料夾 執行./install

Network Simulator 安裝完成後, 設定環境變數. 把 /ns-allinone-2.26/bin:/root/ns-allinone- 2.26/tcl8.3.2/unix:/ns-allinone- 2.26/tk8.3.2/unix 放到你的 PATH 環境變數. 把 /ns-allinone-2.26/otcl-1.0a8, /ns-allinone- 2.26/lib, 放到你的 LD_LIBRARY_PATH 環境 變數. 把 /ns-allinone-2.26/tcl8.3.2/library 放到你的 TCL_LIBRARY 環境變數.

Network Simulator export PATH=$PATH: /ns-allinone- 2.26/bin:/root/ns-allinone-2.26/tcl8.3.2/unix:/ns- allinone-2.26/tk8.3.2/unix export TCL_LIBRARY= /ns-allinone- 2.26/tcl8.3.2/library

Network Simulator - Template #Create a simulator object set ns [new Simulator] #Open the nam trace file set nf [open out.nam w] $ns namtrace-all $nf #Define a 'finish' procedure proc finish {} { global ns nf $ns flush-trace #Close the trace file close $nf #Execute nam on the trace file exec nam out.nam & exit 0 } # Insert your own code for topology creation # and agent definitions, etc. here #Call the finish procedure after 5 seconds simulation time $ns at 5.0 "finish" #Run the simulation $ns run

Network Simulator Two nodes, one link set n0 [$ns node] set n1 [$ns node] $ns duplex-link $n0 $n1 1Mb 10ms DropTail

Network Simulator #Create a UDP agent and attach it to node n0 set udp0 [new Agent/UDP] $ns attach-agent $n0 $udp0 # Create a CBR traffic source and attach it to udp0 set cbr0 [new Application/Traffic/CBR] $cbr0 set packetSize_ 500 $cbr0 set interval_ $cbr0 attach-agent $udp0

Network Simulator #Create a Null agent (a traffic sink) and attach it to node n1 set null0 [new Agent/Null] $ns attach-agent $n1 $null0 #Connect the traffic source with the traffic sink $ns connect $udp0 $null0 #Schedule events for the CBR agent $ns at 0.5 "$cbr0 start" $ns at 4.5 "$cbr0 stop"

Network Simulator #Create links between the nodes $ns duplex-link $n0 $n2 1Mb 10ms DropTail $ns duplex-link $n1 $n2 1Mb 10ms DropTail $ns duplex-link $n3 $n2 1Mb 10ms SFQ SFQ (stochastic fair queueing) $ns duplex-link-op $n0 $n2 orient right-down $ns duplex-link-op $n1 $n2 orient right-up $ns duplex-link-op $n2 $n3 orient right

Network Simulator #Define different colors for data flows $ns color 1 Blue $ns color 2 Red $udp0 set class_ 1 $udp1 set class_ 2 #Monitor the queue for the link between node 2 and node 3 $ns duplex-link-op $n2 $n3 queuePos 0.5

Network Simulator #Connect the traffic sources with the traffic sink $ns connect $udp0 $null0 $ns connect $udp1 $null0 #Schedule events for the CBR agents $ns at 0.5 "$cbr0 start" $ns at 1.0 "$cbr1 start" $ns at 4.0 "$cbr1 stop" $ns at 4.5 "$cbr0 stop"

NS2 - Wireless set val(chan) Channel/WirelessChannel set val(prop) Propagation/TwoRayGround set val(netif) Phy/WirelessPhy set val(mac) Mac/802_11 set val(ifq) Queue/DropTail/PriQueue set val(ll) LL set val(ant) Antenna/OmniAntenna set val(x) 670 ;# X dimension of the topography set val(y) 670 ;# Y dimension of the topography set val(ifqlen) 50 ;# max packet in ifq set val(seed) 0.0 set val(adhocRouting) DSR set val(nn) 3 ;# how many nodes are simulated set val(cp) "cbr-3-test" set val(sc) "scen-3-test" set val(stop) ;# simulation time

NS2 - Wireless # setup topography object set topo[new Topography] # define topology $topo load_flatgrid $val(x) $val(y) # # Create God # set god_ [create-god $val(nn)] #global node setting $ns_ node-config -adhocRouting $val(adhocRouting) \ -llType $val(ll) \ -macType $val(mac) \ -ifqType $val(ifq) \ -ifqLen $val(ifqlen) \ -antType $val(ant) \ -propType $val(prop) \ -phyType $val(netif) \ -channelType $val(chan) \ -topoInstance $topo \ -agentTrace ON \ -routerTrace OFF \ -macTrace OFF

NS2 - MobileIP 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) 1 ;# 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) 670 ;# x coordinate of topology set opt(y) 670 ;# y coordinate of topology set opt(seed) 0.0 ;# random seed set opt(stop) 250 ;# time to stop simulation set opt(ftp1-start) set num_wired_nodes 2

NS2 - MobileIP AddrParams set domain_num_ 3 ;# number of domains lappend cluster_num ;# number of clusters in each domain AddrParams set cluster_num_ $cluster_num lappend eilastlevel ;# number of nodes in each cluster AddrParams set nodes_num_ $eilastlevel ;# of each domain # Create HA and FA set HA [$ns_ node 1.0.0] set FA [$ns_ node 2.0.0]

NS2 - MobileIP # Configure for ForeignAgent and HomeAgent nodes $ns_ node-config -mobileIP ON \ -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

NS2 - MobileIP # create a mobilenode that would be moving between HA and FA. # note address of MH indicates its in the same domain as HA. $ns_ node-config -wiredRouting OFF set MH [$ns_ node 1.0.1] set node_(0) $MH set HAaddress [AddrParams addr2id [$HA node-addr]] [$MH set regagent_] set home_agent_ $HAaddress

NS2 - MobileIP # MH starts to move towards FA $ns_ at "$MH setdest " # goes back to HA $ns_ at "$MH setdest “ # create links between wired and BaseStation nodes $ns_ duplex-link $W(0) $W(1) 5Mb 2ms DropTail $ns_ duplex-link $W(1) $HA 5Mb 2ms DropTail $ns_ duplex-link $W(1) $FA 5Mb 2ms DropTail

# setup TCP connections between a wired node and the MobileHost set tcp1 [new Agent/TCP] $tcp1 set class_ 2 set sink1 [new Agent/TCPSink] $ns_ attach-agent $W(0) $tcp1 $ns_ attach-agent $MH $sink1 $ns_ connect $tcp1 $sink1 set ftp1 [new Application/FTP] $ftp1 attach-agent $tcp1 $ns_ at $opt(ftp1-start) "$ftp1 start“ # 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 "$HA reset"; $ns_ at $opt(stop).0 "$FA reset";

Trace file r _62_ MAC LEE 44 [0 ffffffff 0 800]---[0:255 -1: ] [0x ] 這個紀錄說明著是 node62 在 MAC 層收 到這個 packet , packet header type 是 ”Lee” , packet 數是 0 , packet 的大小 是 44 bytes ,目的地是 -1 表示是在 broadcasting , source port and destination port 都是 255 。

Trace file $ns use-newtrace: 目前這道指令的 new trace support 只有 在無線模擬中才可以,未來應該可以擴 展到 ns 其餘的功能上。

Trace file s -t Hs 1 -Hd -1 -Ni 1 -Nx Ny Nz 0.00 –Ne N1 RTR -Nw --- -Ma 0 -Md 0 -Ms 0 -Mt 0 - Is –Id –It message -I1 32 -If 0 -Ii 1 -Iv 32 Explanation of new trace format Event type : 第一個欄位是描述事件的形式,有以下四種形式 s send( 傳送 ) r receive item[d]drop( 接收或是捨棄 ) f forward( 轉寄 ) General tag : 第二個欄位用 "-t" 是表示時間或是全區設定 (global setting) -t time -t *(global setting)

Node property tags : 這一個欄位表示 Node 的特性 -Ni node id -Nx node's x-coordinate(x 軸 ) -Ny node's y-coordinate -Nz node's z-coordinate -Ne node energy level -Nl trace level,such as AGT(agent),RTR(router),MAC -Nw 事件的理由,捨棄 packet 的不同理由如下: "END" DROP_END_OF_SIMULATION "COL" DROP_MAC_COLLISION "DUP" DROP_MAC_DUPLICATE "ERR" DROP_MAC_PACKET_ERROR "RET" DROP_MAC_RETRY_COUNT_EXCEEDED "STA" DROP_MAC_INVALID "BSY" DROP_MAC_BUSY "NRTE" DROP_RTR_NO_ROUTE i.e 沒有有用的 route 。 "LOOP" DROP_RTR_ROUTE_LOOP i.e 有 routing 的迴圈。 "TTL"DROP_RTR_TTL i.e TTL(Time to live) i.e 封包可以存活的時間趨近於零。 "TOUT" DROP_RTR_QTIMEOUT i.e 封包存活時間到了。 "CBK" DROP_RTR_MAC_CALLBACK "IFQ" DROP_IFQ_QFULL_ i.e IFQ 沒有緩衝空間了 "ARP" DROP_IFQ_ARP_FULL i.e 被 ARP 捨棄 "OUT" DROP_OUTSIDE_SUBNET i.e 被正在在它 domain 外面的 node 接收 routing 更新的 base stations 所捨棄。

Packet information at IP level : 提供在 IP 層的資訊 -Is source address.source port number -Id destination address.destinaton port number -It packet type -Il packet size -If flow id -Ii unique id -Iv ttl value Next hop info : 提供下一個 hop 的資訊 -Hs id for this node -Hd id for next hop toward the destination Packet info at MAC level : 提供在 MAC 層的資訊 -Ma duration -Md dst's ethernet address -Ms src's ethernet address -Mt ethernet type