Read Microsoft PowerPoint - 802.11_in_ns2-65598M-J_Hautakorpi-v007.ppt text version

IEEE 802.11 and wireless simulations in ns2

Jani Hautakorpi

Contents

· Mobile nodes in ns2 · IEEE 802.11 in ns2 · Wireless simulations in ns2:

­ Mobile IP ­ Hierarchical routing

· Tracing wireless simulations · Summary

802.11 in ns2 2 / 24

Split nature of mobile nodes in ns2

· Features in C++:

­ Ability to move (periodic position updates)

­ Ability to receive and transmit signals to/from wireless channel

· Features in Otcl:

­ ­ ­ ­ LL MAC Channel ...

802.11 in ns2

Node

MobileNode

3 / 24

Mobile node implementation in ns2

· C++ files:

­ ~/ns-2.28/common/mobilenode.cc [605 loc] ­ ~/ns-2.28/common/mobilenode.h [254 loc]

· Otcl file:

­ ~/ns-2.28/tcl/lib/ns-mobilenode.tcl [858 loc]

# I don't care about address classifier; it's not my business # All I do is to setup port classifier so we can do broadcast, # and to set up interface stuff. // XXX Must supply the first parameter in the macro otherwise // msvc is unhappy.

802.11 in ns2

4 / 24

Schematic of a mobile node

Upper layers (routing protocols etc.) LL IFq MAC RPM NetIF Channel

802.11 in ns2 5 / 24

ARP

Creating a mobile node

set opt(ahr) set opt(ll) set opt(mac) set opt(ifq) set opt(phy) set opt(ant) set opt(cha) # ... $ns node-config DSDV LL Mac/802_11 Queue/Droptail/PriQueue Phy/WirelessPhy Antenna/OmniAntenna Channel/WirelessChannel ;# ;# ;# ;# ;# ;# ;# Routing protocol Link layer type MAC type Interface queue type Network interface type Antenna model Channel type

­adhocRouting -llType -macType -ifqType -antType -phyType -channel # ...

$opt(ahr) $opt(ll) $opt(mac) $opt(ifq) $opt(ant) $opt(phy) $opt(cha)

\ \ \ \ \ \ \

set foonode [$ns node]

;# Hierarchy info can also be added 802.11 in ns2 6 / 24

Contents, revisited

· Mobile nodes in ns2 · IEEE 802.11 in ns2 · Wireless simulations in ns2:

­ Mobile IP ­ Hierarchical routing

· Tracing wireless simulations · Summary

802.11 in ns2 7 / 24

802.11 in ns2

· 802.11 is a MAC layer protocol in ns2 · It's implemented in:

­ ~/ns-2.28/mac/mac-802_11.cc [1596 loc] ­ ~/ns-2.28/mac/mac-802_11.h [410 loc]

· Only the DCF is implemented · No extensions (e.g. 802.1x and 802.11i) implemented · 802.11 implementation in ns2 is poorly documented · There is also an alternative, which is TDMA

802.11 in ns2 8 / 24

Class hierarchy of 802.11

tclcl-1.16/tclcl.h

TclObject

Handler

ns-2.28/common/ scheduler.h

NsObject

ns-2.28/common/object.h

BiConnector

ns-2.28/common/bi-connector.h

Mac

ns-2.28/mac/mac.h

Mac802_11

802.11 in ns2

ns-2.28/mac/mac-802_11.h

9 / 24

Overview of Mac802_11 class

Mac802_11

# phymib_ : class PHY_MIB # macmib_ : class MAC_MIB - rx_state : MacState - tx_state : MacState ... + recv(p : Packet*, h : Handler*) - backoffHandler() - recvHandler() - sendRTS(dst : int) - sendDATA(p : Packet*) - recvRTS(p : Packet*) ...

802.11 in ns2

10 / 24

Functions in Mac802_11 class

IFq LL LL

recv(p, h) Mac802_11 send(p, h) pktTx_ pktRx_

recvDATA(p)

sendDATA(p)

NetIF

802.11 in ns2

recv(p, h)

NetIF

11 / 24

Contents, revisited

· Mobile nodes in ns2 · IEEE 802.11 in ns2 · Wireless simulations in ns2:

­ Mobile IP ­ Hierarchical routing

· Tracing wireless simulations · Summary

802.11 in ns2 12 / 24

Wireless simulations in ns2

· Original CMU wireless model:

­ Basic WLAN simulations ­ Only wireless nodes

· Extensions to the previous:

­ Wireless/wired simulations ­ Integration of Sun's Mobile IP

802.11 in ns2

13 / 24

Mobile IP for wireless (1/3)

· Three entities: HA, FA and MH · HA and FA:

­ These are base-station nodes ­ Send beacons, and ads to mobile nodes ­ Includes encapsulator and decapsulator

· MH:

­ These are mobile nodes ­ Sends solicitations and reg_requests

802.11 in ns2 14 / 24

Mobile IP for wireless (2/3)

MH

Moves towards FA's hearing range beacon solicitation Use FA's address as a COA ad [FA's address] reg_request Am I the HA of MH? If not, setup decapsulator towards HA.

FA

HA

If I'm HA, but the COA doesn't match, setup encapsulator forwarded reg_request

802.11 in ns2

15 / 24

Mobile IP for wireless (3/3)

Triangular routing

CH

Encap.

Decap. COA

HA

FA

MH

802.11 in ns2

16 / 24

Hierarchical routing in ns2 (1/3)

· No hier. routing: Every node in the simulation knows all the other nodes · Hier. routing: Nodes in the simulation know only nodes that are in the same level

­ A lot smaller routing tables ­ Max. 3 hierarchy levels (domain.cluster.node) ­ Less memory and computational power required during simulations

802.11 in ns2 17 / 24

Hierarchical routing in ns2 (2/3)

# Take the hierarchical routing in use $ns node-config ­addressType hierarchical # Create a hierarchical framework AddrParams set domain_num_ 2 ;# number of domains lappend cluster_num 2 1 ;# number of clusters domains AddrParams set cluster_num_ $cluster_num lappend nodes_num 1 3 2 ;# number of nodes in clusters AddrParams set nodes_num_ $nodes_num # Create a node set some_node [$ns node 1.0.1]

802.11 in ns2

18 / 24

Nodes that route hierarchically (3/3)

Upper layers encapsulator reg_agent dmux Ln L2 L1 routing agent decapsulator

LL

802.11 in ns2 19 / 24

Contents, revisited

· Mobile nodes in ns2 · IEEE 802.11 in ns2 · Wireless simulations in ns2:

­ Mobile IP ­ Hierarchical routing

· Tracing wireless simulations · Summary

802.11 in ns2 20 / 24

Tracing wireless simulations

· Traditional trace file format:

r 160.093884945 _6_ RTR --- 5 tcp 1492 [a2 4 6 800] ------- [655 36:0 16777984:0 31 16777984] [1 0] 2 0

· There is a new trace file format for wireless traces:

s -t 10.000000000 -Hs 0 -Hd -2 -Ni 0 -Nx 5.00 -Ny 2.00 -Nz 0.00 -Ne -1.000000 -Nl AGT -Nw --- -Ma 0 -Md 0 -Ms 0 -Mt 0 -Is 0.0 -Id 1.0 -It tcp -Il 1000 -If

· New trace file format can't be used with wired nodes

802.11 in ns2 21 / 24

Contents, revisited

· Mobile nodes in ns2 · IEEE 802.11 in ns2 · Wireless simulations in ns2:

­ Mobile IP ­ Hierarchical routing

· Tracing wireless simulations · Summary

802.11 in ns2 22 / 24

Summary

· Basic IEEE 802.11 is implemented to ns2 without extensions · There are extensions to wireless model:

­ Mixed wireless/wired simulations are possible ­ Integrated Mobile IP(v4)

· There are two (old & new) trace file formats

802.11 in ns2

23 / 24

Questions, comments?

Information

Microsoft PowerPoint - 802.11_in_ns2-65598M-J_Hautakorpi-v007.ppt

24 pages

Report File (DMCA)

Our content is added by our users. We aim to remove reported files within 1 working day. Please use this link to notify us:

Report this file as copyright or inappropriate

461573


Notice: fwrite(): send of 197 bytes failed with errno=104 Connection reset by peer in /home/readbag.com/web/sphinxapi.php on line 531