1 / 29

Chapter 15 The Addressing Structure in NS

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 node-id. $ns set-address-format def. The Hierarchical Address Format. Default Hierarchical Setting $ns set-address-format hierarchical

min
Download Presentation

Chapter 15 The Addressing Structure in NS

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 15The 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 16Mobile 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. 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 Mobilenode Object

  11. Creating Node movements • Start position: • $node set X_ <x1> • $node set Y_ <y1> • $node set Z_ <z1> • Future destinations: • $ns at $time $node setdest <x2> <y2> <speed> • Ex: • ns at 3.0 "$node (0) setdest 48.0 38.0 5.0 • the third dimension (Z) is not used.

  12. 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

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

  14. 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

  15. 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

  16. 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().

  17. 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

  18. 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]

  19. Example for wireless • Default Script Options • Main Program • produce some simple node movements • simulation ends

  20. 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_.

  21. 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

  22. Revised format for wireless traces • cmu-trace objects • This command should be called before the universal trace command • $ns trace-all <trace-fd> • Currently this new trace support is available for wireless

  23. new trace format

  24. new trace format • 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

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

  26. 抽考- Hierarchical Address

  27. 抽考-moblie node move

More Related