Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 15 The Addressing Structure in NS. The Default Address Format 32 lower bits for port-id, 1 higher bit for mcast and the rest 32 higher bits for.

Similar presentations


Presentation on theme: "Chapter 15 The Addressing Structure in NS. The Default Address Format 32 lower bits for port-id, 1 higher bit for mcast and the rest 32 higher bits for."— Presentation transcript:

1 Chapter 15 The Addressing Structure in NS

2 The Default Address Format 32 lower bits for port-id, 1 higher bit for mcast and the rest 32 higher bits for node-id. $ns set-address-format def

3 The Hierarchical Address Format Default Hierarchical Setting  $ns set-address-format hierarchical  3 levels of hierarchy Specific Hierarchical Setting  $ns set-address-format hierarchical 2 8 15

4 The Expanded Node-Address Format address space to 30 bits, allocating 22 higher bits to node-id and lower 8 bits to port-id. this command is now obsolete given that node address and port address spaces are 32 bits wide.

5 Errors in setting address format if number of bits specified is less than 0. if bit positions clash (contiguous number of requested free bits not found). if total number of bits exceed MAXADDRSIZE_. if expand-port-field-bits is attempted with portbits less than or equal to the existing portsize. if number of hierarchy levels do not match with number of bits specified (for each level).

6 Hierarchical Address Format-ex -  set ns [new Simulator]  $ns set-address-format hierarchical -  AddParams set domain_num_ 區域數  AddParams set cluster_num_ 群組數  AddParams set nodes_num_ 節點數 design topology

7 Chapter 16 Mobile Networking in ns

8 Mobile Networking Mobile node Routing mechanisms Network components  Channel  Network interface  Radio propagation model  MAC protocols  Interface Queue  Link Layer  ARP

9 The basic wireless model in ns MobileNode object is a split object. The C++ class MobileNode is derived from parent class Node. (ref ch5) Difference added functionalities of a wireless mobile node like ability to move within a given topology not connected by means of Links to other nodes or mobilenodes. Routing mechanisms

10 Mobilenode Object Implemented in C++ The mobility features  node movement  periodic position updates  maintaining topology boundary  etc implemented in Otcl MobileNode itself  Classifiers  Dmux  LL  Mac  Channel  etc

11

12

13 Creating Node movements Start position:  $node set X_  $node set Y_  $node set Z_ Future destinations:  $ns at $time $node setdest  Ex: ns at 3.0 "$node (0) setdest 48.0 38.0 5.0 the third dimension (Z) is not used.

14 Creating Node movements random movement  $mobilenode start Set topology  set topo [new Topography]  $topo load_flatgrid $opt(x) $opt(y) opt(x) and opt(y) are the boundaries used in simulation

15 Network Components in a mobilenode MobileNode method add-interface() in ~ns/tcl/lib/ns-mobilenode.tcl

16 MN components Link Layer-(ref.14)  ARP module connected to it which resolves all IP to hardware (Mac) address conversions ARP  O-writes it into the mac header of the packet  X-broadcasts an ARP query Interface Queue  priority to routing rotocol packets Mac Layer  carrier sense

17 MN components-cont. Tap Agents  defined in mac.h  register themselves with the mac object using method installTap() Network Interfaces  mobilenode to access the channel.  implemented Phy/WirelessPhy Radio Propagation Model  Friss-space attenuation (1/r2)  Two ray Ground (1/r4) Antenna

18 MAC layer protocols 802.11MAC protocol  See ~ns/mac-802_11.{cc,h} for implementation details. Preamble based TDMA protocol  ns supports a single hop, preamble-based TDMA MAC protocol  multi-hop environment are not considered  TDMA frame contains preamble data transmission slots  avoid unnecessary power consumption set_node_sleep().

19 Routing Agents DSDV  messages are exchanged between neighbouring mobilenodes  ~ns/dsdv directory and ~ns/tcl/mobility/dsdv.tc DSR  checks every data packet for source-route information. X-Routing queries  ~ns/tcl/mobility/dsr.tcl TORA  ns/tora directory and ns/tcl/mobility/tora.tcl AODV  ns/aodv and ns/tcl/lib/ns-lib.tcl

20 Trace Support cmu-trace objects are of three types  CMUTrace/Drop  CMUTrace/Recv  CMUTrace/Send ~ns/trace.{cc,h} and ~ns/tcl/lib/ns- cmutrace.tcl. tracing all packets that are sent out in a router  set sndT [cmu-trace Send "RTR" $self]

21 Example for wireless Default Script Options Main Program produce some simple node movements simulation ends

22 Trace Support-cont. The cmu-trace object CMUTrace is derived from the base class Trace.  See Chapter 26 for details on class Trace tracing packets  dropped, received and sent by agents, routers, mac layers or interface queues in ns. All traces are written to the buffer wrk_.

23 Trace Support-cont. An example of a trace for a tcp packet is as follows: r 160.093884945 _6_ RTR --- 5 tcp 1492 [a2 4 6 800] ------- [65536:0 16777984:0 31 16777984] [1 0] 2 0

24 Revised format for wireless traces cmu-trace objects This command should be called before the universal trace command  $ns trace-all Currently this new trace support is available for wireless

25 new trace format

26 Event type In the traces above, the first field (as in the older trace format) describes the type of event taking place at the node and can be one of the four types:  s send  r receive  d drop  f forward

27 new trace format General tag The second field starting with "-t" may stand for time or global setting  -t time  -t * (global setting)

28 抽考 - Hierarchical Address

29 抽考 -moblie node move


Download ppt "Chapter 15 The Addressing Structure in NS. The Default Address Format 32 lower bits for port-id, 1 higher bit for mcast and the rest 32 higher bits for."

Similar presentations


Ads by Google