⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 satellite.tex

📁 对IEEE 802.11e里的分布式信道接入算法EDCA进行改进
💻 TEX
📖 第 1 页 / 共 4 页
字号:
\label{sec:satellite/implementation/list}\begin{figure}    \centerline{\includegraphics{linked-list}}    \caption{Linked list implementation in \ns.}    \label{fig:linked-list}\end{figure}There are a number of linked lists used heavily in the implementation:\begin{itemize}\item \code{class Node} maintains a (static) list of all objects of class\code{Node} in the simulator.  The variable \code{Node::nodehead_} storesthe head of the list.  The linked list of nodes is used for centralizedrouting, for finding satellites to hand off to, and for tracing.\item \code{class Node} maintains a list of all (satellite) links on thenode.  Specifically, the list is a list of objects of class \code{LinkHead}. The variable \code{linklisthead_} stores the head of the list.  Thelinked list of LinkHeads is used for checking whether or not to handofflinks, and to discover topology adjacencies.\item \code{class Channel} maintains a list of all objects of class\code{Phy} on the channel.  The head of the list is stored in the variable\code{if_head_}.  This list is used to determine the set of interfaces on achannel that should receive a copy of a packet.\end{itemize}Figure \ref{fig:linked-list} provides a schematic of how the linked listis organized.  Each object in the list is linked through a ``LINK\_ENTRY''that is a protected member of the class.  This entry contains a pointerto the next item in the list and also a pointer to the address of theprevious ``next'' pointer in the preceding object.   Various macrosfound in \nsf{list.h} can be used to manipulate the list; the implementation of linked-lists in \ns~is similar to the \code{queue} implementation found in some variants of BSD UNIX.\subsection{Node structure}\begin{figure}    \centerline{\includegraphics{sat-node}}    \caption{Structure of \code{class SatNode}.}    \label{fig:sat-node}\end{figure}Figure \ref{fig:sat-node} is a schematic of the main components of a\code{SatNode}.  The structure bears resemblance to the \code{MobileNode}in the wireless extensions, but there are several differences.  Like all\ns~nodes, the SatNode has an ``entry'' point to a series of classifiers.The address classifier contains a slot table for forwarding packets to foreign nodes, but since OTcl routing is not used, all packets not destinedfor this node (and hence forwarded to the port classifier), are sent tothe default target, which points to a routing agent.  Packets destinedon the node for port 255 are classified as routing packets and are alsoforwarded to the routing agent.Each node contains one or more ``network stacks'' that include a generic\code{SatLinkHead} at the entry point of the link.  The \code{SatLinkHead}is intended to serve as an API to get at other objects in the link structure,so it contains a number of pointers (although the API here has not beenfinalized).  Packets leaving the network stack are sent to the node'sentry.  An important feature is that each packet leaving a network stackhas its \code{iface_} field in the common packet header coded with theunique \code{NetworkInterface} index corresponding to the link.  This valuecan be used to support distributed routing as described below.The base class routing agent is \code{class SatRouteAgent}; it can be used in conjunction with centralized routing.  SatRouteAgents containa forwarding table that resolves a packet's address to a particular LinkHead target-- it is the job of the \code{SatRouteObject} to populate thistable correctly.  The SatRouteAgent populates certain fields in the headerand then sends the packet down to the approprate link.  To implementa distributed routing protocol, a new SatRouteAgent could be defined-- thiswould learn about topology by noting the interface index marked in each packet as it came up the stack-- a helper function in the node \code{intf_to_target()} allows it to resolve an index value toa particular LinkHead. There are pointers to three additional objects in a SatNode.  First,each SatNode contains a position object, discussed in the previous section.Second, each SatNode contains a \code{LinkHandoffMgr} that monitorsfor opportunities to hand links off and coordinates the handoffs.  Satellitenodes and terminal nodes each have their specialized version of a LinkHandoffMgr.Finally, a number of pointers to objects are contained in a SatNode.  Wediscussed \code{linklisthead_} and \code{nodehead_} in the previous subsection.  The \code{uplink_} and \code{downlink_} pointers areused for convenience under the assumption that, in most simulations,a satellite or a terminal has only one uplink and downlink channel.\subsection{Detailed look at satellite links}\begin{figure}    \centerline{\includegraphics{sat-stack}}    \caption{Detailed look at network interface stack.}    \label{fig:sat-stack}\end{figure}Figure \ref{fig:sat-stack} provides a more detailed look at how satellite linksare composed.  In this section, we describe how packets move up and downthe stack, and the key things to note at each layer.  The file \nsf{tcl/lib/ns-sat.tcl} contains the various OTcl instprocs that assemblelinks according to Figure \ref{fig:sat-stack}.  We describe the compositestructure herein as a ``network stack.''  Most of the code for thevarious link components is in \nsf{satlink.\{cc,h\}}.The entry point to a network stack is the \code{SatLinkHead} object.  TheSatLinkHead object derives from \code{Class LinkHead}; the aim of linkhead objects is to provide a uniform API for all network stacks.\footnote{In the author's opinion, all network stacks in \ns~ should eventually have a LinkHead object at the front-- the class SatLinkHead would then disappear.}  The SatLinkHead object contains pointers tothe LL, Queue, MAC, Error model, and both Phy objects.  The SatLinkHeadobject can also be queried as to what type of network stack it is-- e.g.,GSL, interplane ISL, crossseam ISL, etc..  Valid codes for the \code{type_} field are currently found in \nsf{sat.h}.  Finally, the SatLinkHeadstores a boolean variable \code{linkup_} that indicates whetherthe link to at least one other node on the channel is up.  The C++implementation of SatLinkHead is found in \nsf{satlink.\{cc,h\}}.Packets leaving a node pass through the SatLinkHead transparently to the \code{class SatLL} object.  The SatLL class derives from LL (link layer).Link layer protocols (like ARQ protocols) can be defined here.  The currentSatLL assigns a MAC address to the packet.  Note that in the satellite case,we do not use an Address Resolution Protocol (ARP); instead, we simply usethe MAC \code{index_} variable as its address, and we use a helper functionto find the MAC address of the corresponding interface of the next-hop node.  Since \code{class LL} derives from \code{class LinkDelay}, the \code{delay_}parameter of LinkDelay can be used to model any processing delay in thelink layer; by default this delay is zero.The next object an outgoing packet encounters is the interface queue.  However, if tracing is enabled, tracing elements may surround thequeue, as shown in Figure \ref{fig:sat-stack}.  This part of a satellitelink functions like a conventional \ns~ link.The next layer down is the MAC layer.  The MAC layer draws packets fromthe queue (or deque trace) object-- a handshaking between the MAC and the queue allows the MAC to draw packets out of the queue as it needs them.  Thetransmission time of a packet is modelled in the MAC also-- the MAC computesthe transmission delay of the packet (based on the sum of the LINK\_HDRSIZE field defined in \code{satlink.h} and the \code{size} field in the common packet header), and does not call up for another packet untilthe current one has been ``sent'' to the next layer down.  Therefore, itis important to set the bandwidth of the link correctly at this layer.For convenience, the transmit time is encoded in the \code{mac} header; thisinformation can be used at the receiving MAC to calculate how long it mustwait to detect a collision on a packet, for example.Next, the packet is sent to a transmitting interface (Phy\_tx) of class \code{SatPhy}.  Thisobject just sends the packet to the attached channel.  We noted earlierin this chapter that all interfaces attached to a channel are part of thelinked list for that channel.  This is not true for transmit interfaces,however.  Only receive interfaces attached to a channel comprise this linkedlist, since only receive interfaces should get a copy of transmitted packets.The use of separate transmit and receive interfaces mirrors the real worldwhere full-duplex satellite links are made up of RF channels at differentfrequencies.The outgoing packet is next sent to a \code{SatChannel}, which copies thepacket to every receiving interface (of class \code{SatPhy}) on the channel. The Phy\_rx sends the packet to the MAC layer.  At the MAC layer, the packetis held for the duration of its transmission time (and any appropriatecollision detection is performed if the MAC, such as the Aloha MAC,supports it).  If the packet is determined to have arrived safely at the MAC,it next passes to an \code{ErrorModel} object, if it exists.  If not, thepacket moves through any receive tracing objects to the \code{SatLL}object.  The SatLL object passes the packet up after a processing delay(again, by default, the value for \code{delay_} is zero).The final object that a received packet passes through is an object of\code{class NetworkInterface}.  This object stamps the \code{iface_} fieldin the common header with the network stack's unique index value.  Thisis used to keep track of which network stack a packet arrived on.  Thepacket then goes to the \code{entry} of the SatNode (usually, an addressclassifier).  Finally, ``geo-repeater'' satellites exist, as described earlier in thischapter.  Geo-repeater network stacks are very simple-- they only containa Phy\_tx and a Phy\_rx of \code{class RepeaterPhy}, and a SatLinkHead.  Packets received by a Phy\_rx are sent to the Phy\_tx without delay.  Thegeo-repeater satellite is a degenerate satellite node, in that it does notcontain things like tracing elements, handoff managers, routing agents, or any other link interfaces other than repeater interfaces.\section{Commands at a glance}\label{sec:satcommands}Following is a list of commands related to satellite networking:\begin{flushleft}\code{$ns_ satnode-polar <alt> <inc> <lon> <alpha> <plane> <linkargs> <chan>}\\This a simulator wrapper method for creating a polar satellite node. Twolinks, uplink and downlink, are created along with two channels, uplinkchannel and downlink channel. <alt> is the polar satellite altitude,<inc> is orbit inclination w.r.t equator, <lon> is the longitude of ascending node, <alpha>gives the initial position of the satellite along this orbit, <plane> defines the plane ofthe polar satellite. <linkargs> is a list of link argument options thatdefines the network interface (like LL, Qtype, Qlim, PHY, MAC etc).\code{$ns_ satnode-geo <lon> <linkargs> <chan>}\\This is a wrapper method for creating a geo satellite node that firstcreates a satnode plus two link interfaces (uplink and downlink) plus two satellite channels (uplink and downlink). <chan> defines the type ofchannel.\code{$ns_ satnode-geo-repeater <lon> <chan>}\\This is a wrapper method for making a geo satellite repeater node that first creates a satnode plus two link interfaces (uplink and downlink)plus two satellite channels (uplink and downlink). \code{$ns_ satnode-terminal <lat> <lon>}\\This is a wrapper method that simply creates a terminal node. The <lat>and <lon> defines the latitude and longitude respectively of the terminal.\code{$ns_ satnode <type> <args>}\\This is a more primitive method for creating satnodes of type <type>which can be polar, geo or terminal. \code{$satnode add-interface <type> <ll> <qtype> <qlim> <mac_bw> <phy>}\\This is an internal method of Node/SatNode that sets up link layer, maclayer, interface queue and physical layer structures for the satellitenodes.\code{$satnode add-isl <ltype> <node1> <node2> <bw> <qtype> <qlim>}\\This method creates an ISL (inter-satellite link) between the two nodes.The link type (inter, intra or cross-seam), BW of the link, the queue-typeand queue-limit are all specified.\code{$satnode add-gsl <ltype> <opt_ll> <opt_ifq> <opt_qlim> <opt_mac> <opt_bw> <opt_phy> <opt_inlink> <opt_outlink>}\\This method creates a GSL (ground to satellite link). First a networkstack is created that is defined by LL, IfQ, Qlim, MAC, BW and PHY layers.Next the node is attached to the channel inlink and outlink.\end{flushleft}\endinput

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -