The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ...
The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ... The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ...
LLIFqMACPhy_txPhy_rxRadioPropagationModelChannelChannelFigure 17.3: Main components of a satellite network interfaceThe add-interface instproc returns an index value that can be used to access the network interface stack later in thesimulation. By convention, the first interface created on a node is attached to the uplink and downlink channels of a satelliteor terminal. The following parameters must be provided:• type: The following link types can be indicated: geo or polar for links from a terminal to a geo or polar satellite,respectively, gsl and gsl-repeater for links from a satellite to a terminal, and intraplane, interplane,and crossseam ISLs. The type field is used internally in the simulator to identify the different types of links, butstructurally they are all very similar.• ll: The link layer type (class LL/Sat is currently the only one defined).• qtype: The queue type (e.g., class Queue/DropTail). Any queue type may be used– however, if additionalparameters beyond the length of the queue are needed, then this instproc may need to be modified to include morearguments.• qlim: The length of the interface queue, in packets.• mac: The MAC type. Currently, two types are defined: class Mac/Sat– a basic MAC for links with only onereceiver (i.e., it does not do collision detection), and Class Mac/Sat/UnslottedAloha– an implementation ofunslotted Aloha.• mac_bw: The bandwidth of the link is set by this parameter, which controls the transmission time how fast the MACsends. The packet size used to calculate the transmission time is the sum of the values size() in the common packetheader and LINK_HDRSIZE, which is the size of any link layer headers. The default value for LINK_HDRSIZE is 16bytes (settable in satlink.h). The transmission time is encoded in the packet header for use at the receive MAC (tosimulate waiting for a whole packet to arrive).• phy: The physical layer– currently two Phys (Class Phy/Sat and Class Phy/Repeater) are defined. Theclass Phy/Sat just pass the information up and down the stack– as in the wireless code described in Chapter 16, aradio propagation model could be attached at this point. The class Phy/Repeater pipes any packets received on areceive interface straight through to a transmit interface.An ISL can be added between two nodes using the following instproc:175
$ns add-isl $ltype $node1 $node2 $bw $qtype $qlimThis creates two channels (of type Channel/Sat), and appropriate network interfaces on both nodes, and attaches thechannels to the network interfaces. The bandwidth of the link is set to bw. The linktype (ltype) must be specified as eitherintraplane, interplane, or crossseam.A GSL involves adding network interfaces and a channel on board the satellite (this is typically done using the wrappermethods described in the next paragraph), and then defining the correct interfaces on the terrestrial node and attaching themto the satellite link, as follows:$node add-gsl $type $ll $qtype $qlim $mac $bw_up $phy \[$node_satellite set downlink_] [$node_satellite set uplink_]Here, the type must be either geo or polar, and we make use of the downlink_ and uplink_ instvars of the satellite;therefore, the satellite’s uplink and downlink must be created before this instproc is called.By default, the node generator for satellite nodes (described in Section 5.3) will create nodes of a given type, give them anuplink and downlink interface, and create and attach an (initial) uplink and downlink channel, based on the interface optionsspecified.17.2.3 HandoffsSatellite handoff modelling is a key component of LEO satellite network simulations. It is difficult to predict exactly howhandoffs will occur in future LEO systems because the subject is not well treated in the literature. In these satellite extensions,we establish certain criteria for handoffs, and allow nodes to independently monitor for situations that require a handoff. Analternative would be to have all handoff events synchronized across the entire simulation– it would not be difficult to changethe simulator to work in such a manner.There are no link handoffs involving geostationary satellites, but there are two types of links to polar orbiting satellites thatmust be handed off: GSLs to polar satellites, and crossseam ISLs. A third type of link, interplane ISLs, are not handed off butare deactivated at high latitudes as we describe below.Each terminal connected to a polar orbiting satellite runs a timer that, upon expiry, causes the HandoffManager to checkwhether the current satellite has fallen below the elevation mask of the terminal. If so, the handoff manager detaches theterminal from that satellite’s up and down links, and searches through the linked list of satellite nodes for another possiblesatellite. First, the “next” satellite in the current orbital plane is checked– a pointer to this satellite is stored in the Positionobject of each polar satellite node and is set during simulation configuration using the Node/SatNode instproc “$nodeset_next $next_node.” If the next satellite is not suitable, the handoff manager searches through the remaining satellites.If it finds a suitable polar satelite, it connects its network interfaces to that satellite’s uplink and downlink channels, andrestarts the handoff timer. If it does not find a suitable satellite, it restarts the timer and tries again later. If any link changesoccur, the routing agent is notified.The elevation mask and handoff timer interval are settable via OTcl:HandoffManager/Term set elevation_mask_ 10; # degreesHandoffManager/Term set term_handoff_int_ 10; # secondsIn addition, handoffs may be randomized to avoid phase effects by setting the following variable:HandoffManager set handoff_randomization_ 0; # 0 is false, 1 is true176
- Page 125 and 126: }incr hdrlen_ $incrreturn $baseFrom
- Page 127 and 128: Chapter 13Error ModelThis chapter d
- Page 129 and 130: SimpleLink::errormodule argsSimulat
- Page 131 and 132: This is a simple example of how to
- Page 133 and 134: Higher LayersNode 1Node 2. . .Node
- Page 135 and 136: };void recv(Packet* p, Handler*);vi
- Page 137 and 138: and the frame type. It then passes
- Page 139 and 140: $ll_ set delay_ $delay$ll_ set band
- Page 141 and 142: 14.10 Commands at a glanceThe follo
- Page 143 and 144: 15.2.1 Default Hierarchical Setting
- Page 145 and 146: Chapter 16Mobile Networking in nsTh
- Page 147 and 148: entry_addrdemuxIP addressdefaulttar
- Page 149 and 150: 16.1.2 Creating Node movementsThe m
- Page 151 and 152: set netif $netif_($t)set mac $mac_(
- Page 153 and 154: the hardware address of a packet’
- Page 155 and 156: destined to itself to the port dmux
- Page 157 and 158: switch(ch->ptype()) {case PT_MAC:br
- Page 159 and 160: 16.1.7 Revised format for wireless
- Page 161 and 162: Packet info at "Application level"
- Page 163 and 164: The main problem facing the wired-c
- Page 165 and 166: target_target_encapsulatorreg_agent
- Page 167 and 168: why: This avoids header clashes bet
- Page 169 and 170: This command is used to create a Go
- Page 171 and 172: Chapter 17Satellite Networking in n
- Page 173 and 174: in counter-rotating planes (where t
- Page 175: • Position/Sat/Geo A geostationar
- Page 179 and 180: $satrouteobject_ compute_routeswher
- Page 181 and 182: This will add an error model to the
- Page 183 and 184: lh_firstnameobj‘‘name’’ is
- Page 185 and 186: from routing agentto Node->entrySat
- Page 187 and 188: $satnode add-isl This method c
- Page 189 and 190: set prop [new Propagation/FreeSpace
- Page 191 and 192: 18.3.2 Using shadowing modelBefore
- Page 193 and 194: Chapter 19Energy Model in nsEnergy
- Page 195 and 196: Chapter 20Directed DiffusionThe dir
- Page 197 and 198: However if we have a large and dens
- Page 199 and 200: yr application in the ns context. T
- Page 201 and 202: value of opt(pre-stop) is usually t
- Page 203 and 204: 21.2 Implementation of XCP in NSIn
- Page 205 and 206: the persistent queue length in the
- Page 207 and 208: Thruput2 0.054024 60000residue_pos_
- Page 209 and 210: Chapter 22DelayBox: Per-Flow Delay
- Page 211 and 212: $ns attach-agent $n_sink $sink# mak
- Page 213 and 214: Chapter 23Changes made to the IEEE
- Page 215 and 216: Part IIISupport214
- Page 217 and 218: endenddocument pargvcPrint out argc
- Page 219 and 220: 24.4.2 Memory Conservation TipsSome
- Page 221 and 222: Chapter 25Mathematical SupportThe s
- Page 223 and 224: set run [lindex $argv 0]}if {$run <
- Page 225 and 226: }$sizeRNG next-substream# print the
LLIFqMACPhy_txPhy_rxRadioPropag<strong>at</strong>ionModelChannelChannelFigure 17.3: Main components of a s<strong>at</strong>ellite network interface<strong>The</strong> add-interface i<strong>ns</strong>tproc retur<strong>ns</strong> an index value th<strong>at</strong> can be used to access the network interface stack l<strong>at</strong>er in thesimul<strong>at</strong>ion. By convention, the first interface cre<strong>at</strong>ed on a node is <strong>at</strong>tached to the uplink <strong>and</strong> downlink channels of a s<strong>at</strong>elliteor terminal. <strong>The</strong> following parameters must be provided:• type: <strong>The</strong> following link types can be indic<strong>at</strong>ed: geo or polar for links from a terminal to a geo or polar s<strong>at</strong>ellite,respectively, gsl <strong>and</strong> gsl-repe<strong>at</strong>er for links from a s<strong>at</strong>ellite to a terminal, <strong>and</strong> intraplane, interplane,<strong>and</strong> crossseam ISLs. <strong>The</strong> type field is used internally in the simul<strong>at</strong>or to identify the different types of links, butstructurally they are all very similar.• ll: <strong>The</strong> link layer type (class LL/S<strong>at</strong> is currently the only one defined).• qtype: <strong>The</strong> queue type (e.g., class Queue/DropTail). Any queue type may be used– however, if additionalparameters beyond the length of the queue are needed, then this i<strong>ns</strong>tproc may need to be modified to include morearguments.• qlim: <strong>The</strong> length of the interface queue, in packets.• mac: <strong>The</strong> MAC type. Currently, two types are defined: class Mac/S<strong>at</strong>– a basic MAC for links with only onereceiver (i.e., it does not do collision detection), <strong>and</strong> Class Mac/S<strong>at</strong>/U<strong>ns</strong>lottedAloha– an implement<strong>at</strong>ion ofu<strong>ns</strong>lotted Aloha.• mac_bw: <strong>The</strong> b<strong>and</strong>width of the link is set by this parameter, which controls the tra<strong>ns</strong>mission time how fast the MACsends. <strong>The</strong> packet size used to calcul<strong>at</strong>e the tra<strong>ns</strong>mission time is the sum of the values size() in the common packetheader <strong>and</strong> LINK_HDRSIZE, which is the size of any link layer headers. <strong>The</strong> default value for LINK_HDRSIZE is 16bytes (settable in s<strong>at</strong>link.h). <strong>The</strong> tra<strong>ns</strong>mission time is encoded in the packet header for use <strong>at</strong> the receive MAC (tosimul<strong>at</strong>e waiting for a whole packet to arrive).• phy: <strong>The</strong> physical layer– currently two Phys (Class Phy/S<strong>at</strong> <strong>and</strong> Class Phy/Repe<strong>at</strong>er) are defined. <strong>The</strong>class Phy/S<strong>at</strong> just pass the inform<strong>at</strong>ion up <strong>and</strong> down the stack– as in the wireless code described in Chapter 16, aradio propag<strong>at</strong>ion model could be <strong>at</strong>tached <strong>at</strong> this point. <strong>The</strong> class Phy/Repe<strong>at</strong>er pipes any packets received on areceive interface straight through to a tra<strong>ns</strong>mit interface.An ISL can be added between two nodes using the following i<strong>ns</strong>tproc:175