12.07.2015 Views

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

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

entry_addrdemuxIP addressportdemuxdefaulttarget_255Src/SinkRTagentclass S<strong>at</strong>Node : public NodeS<strong>at</strong>PositionLinkH<strong>and</strong>offMgrS<strong>at</strong>TraceList of pointers:node_head nodehead_linklist_head linklisthead_Channel* uplink_Channel* downlink_S<strong>at</strong>LinkHeadOther linkobjects...S<strong>at</strong>LinkHeadOther linkobjectsFigure 17.5: Structure of class S<strong>at</strong>Node.to popul<strong>at</strong>e this table correctly. <strong>The</strong> S<strong>at</strong>RouteAgent popul<strong>at</strong>es certain fields in the header <strong>and</strong> then sends the packet down tothe appropr<strong>at</strong>e link. To implement a distributed routing protocol, a new S<strong>at</strong>RouteAgent could be defined– this would learnabout topology by noting the interface index marked in each packet as it came up the stack– a helper function in the nodeintf_to_target() allows it to resolve an index value to a particular LinkHead.<strong>The</strong>re are pointers to three additional objects in a S<strong>at</strong>Node. First, each S<strong>at</strong>Node contai<strong>ns</strong> a position object, discussed in theprevious section. Second, each S<strong>at</strong>Node contai<strong>ns</strong> a LinkH<strong>and</strong>offMgr th<strong>at</strong> monitors for opportunities to h<strong>and</strong> links off <strong>and</strong>coordin<strong>at</strong>es the h<strong>and</strong>offs. S<strong>at</strong>ellite nodes <strong>and</strong> terminal nodes each have their specialized version of a LinkH<strong>and</strong>offMgr.Finally, a number of pointers to objects are contained in a S<strong>at</strong>Node. We discussed linklisthead_ <strong>and</strong> nodehead_ inthe previous subsection. <strong>The</strong> uplink_ <strong>and</strong> downlink_ pointers are used for convenience under the assumption th<strong>at</strong>, inmost simul<strong>at</strong>io<strong>ns</strong>, a s<strong>at</strong>ellite or a terminal has only one uplink <strong>and</strong> downlink channel.17.3.3 Detailed look <strong>at</strong> s<strong>at</strong>ellite linksFigure 17.6 provides a more detailed look <strong>at</strong> how s<strong>at</strong>ellite links are composed. In this section, we describe how packetsmove up <strong>and</strong> down the stack, <strong>and</strong> the key things to note <strong>at</strong> each layer. <strong>The</strong> file ~<strong>ns</strong>/tcl/lib/<strong>ns</strong>-s<strong>at</strong>.tcl contai<strong>ns</strong> the various OTcli<strong>ns</strong>tprocs th<strong>at</strong> assemble links according to Figure 17.6. We describe the composite structure herein as a “network stack.” Mostof the code for the various link components is in ~<strong>ns</strong>/s<strong>at</strong>link.{cc,h}.<strong>The</strong> entry point to a network stack is the S<strong>at</strong>LinkHead object. <strong>The</strong> S<strong>at</strong>LinkHead object derives from Class LinkHead;the aim of link head objects is to provide a uniform API for all network stacks. 4 <strong>The</strong> S<strong>at</strong>LinkHead object contai<strong>ns</strong> pointersto the LL, Queue, MAC, Error model, <strong>and</strong> both Phy objects. <strong>The</strong> S<strong>at</strong>LinkHead object can also be queried as to wh<strong>at</strong> type ofnetwork stack it is– e.g., GSL, interplane ISL, crossseam ISL, etc.. Valid codes for the type_ field are currently found in~<strong>ns</strong>/s<strong>at</strong>.h. Finally, the S<strong>at</strong>LinkHead stores a boolean variable linkup_ th<strong>at</strong> indic<strong>at</strong>es whether the link to <strong>at</strong> least one othernode on the channel is up. <strong>The</strong> C++ implement<strong>at</strong>ion of S<strong>at</strong>LinkHead is found in ~<strong>ns</strong>/s<strong>at</strong>link.{cc,h}.Packets leaving a node pass through the S<strong>at</strong>LinkHead tra<strong>ns</strong>parently to the class S<strong>at</strong>LL object. <strong>The</strong> S<strong>at</strong>LL class derivesfrom LL (link layer). Link layer protocols (like ARQ protocols) can be defined here. <strong>The</strong> current S<strong>at</strong>LL assig<strong>ns</strong> a MAC4 In the author’s opinion, all network stacks in <strong>ns</strong> should eventually have a LinkHead object <strong>at</strong> the front– the class S<strong>at</strong>LinkHead would then disappear.183

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!