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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

from routing agentto Node->entryS<strong>at</strong>LinkHeadNetworkInterfaceLLS<strong>at</strong>/EnqueQueueS<strong>at</strong>/RecvErrormodelS<strong>at</strong>/DropS<strong>at</strong>/DequeMacS<strong>at</strong>/ErrorPhy_txPhy_rxto S<strong>at</strong>Channelfrom S<strong>at</strong>ChannelFigure 17.6: Detailed look <strong>at</strong> network interface stack.address to the packet. Note th<strong>at</strong> in the s<strong>at</strong>ellite case, we do not use an Address Resolution Protocol (ARP); i<strong>ns</strong>tead, we simplyuse the MAC index_ variable as its address, <strong>and</strong> we use a helper function to find the MAC address of the correspondinginterface of the next-hop node. Since class LL derives from class LinkDelay, the delay_ parameter of LinkDelaycan be used to model any processing delay in the link layer; by default this delay is zero.<strong>The</strong> next object an outgoing packet encounters is the interface queue. However, if tracing is enabled, tracing elements maysurround the queue, as shown in Figure 17.6. This part of a s<strong>at</strong>ellite link functio<strong>ns</strong> like a conventional <strong>ns</strong> link.<strong>The</strong> next layer down is the MAC layer. <strong>The</strong> MAC layer draws packets from the queue (or deque trace) object– a h<strong>and</strong>shakingbetween the MAC <strong>and</strong> the queue allows the MAC to draw packets out of the queue as it needs them. <strong>The</strong> tra<strong>ns</strong>mission timeof a packet is modelled in the MAC also– the MAC computes the tra<strong>ns</strong>mission delay of the packet (based on the sum of theLINK_HDRSIZE field defined in s<strong>at</strong>link.h <strong>and</strong> the size field in the common packet header), <strong>and</strong> does not call up foranother packet until the current one has been “sent” to the next layer down. <strong>The</strong>refore, it is important to set the b<strong>and</strong>width ofthe link correctly <strong>at</strong> this layer. For convenience, the tra<strong>ns</strong>mit time is encoded in the mac header; this inform<strong>at</strong>ion can be used<strong>at</strong> the receiving MAC to calcul<strong>at</strong>e how long it must wait to detect a collision on a packet, for example.Next, the packet is sent to a tra<strong>ns</strong>mitting interface (Phy_tx) of class S<strong>at</strong>Phy. This object just sends the packet to the <strong>at</strong>tachedchannel. We noted earlier in this chapter th<strong>at</strong> all interfaces <strong>at</strong>tached to a channel are part of the linked list for th<strong>at</strong> channel.This is not true for tra<strong>ns</strong>mit interfaces, however. Only receive interfaces <strong>at</strong>tached to a channel comprise this linked list, sinceonly receive interfaces should get a copy of tra<strong>ns</strong>mitted packets. <strong>The</strong> use of separ<strong>at</strong>e tra<strong>ns</strong>mit <strong>and</strong> receive interfaces mirrorsthe real world where full-duplex s<strong>at</strong>ellite links are made up of RF channels <strong>at</strong> different frequencies.<strong>The</strong> outgoing packet is next sent to a S<strong>at</strong>Channel, which copies the packet to every receiving interface (of class S<strong>at</strong>Phy)on the channel. <strong>The</strong> Phy_rx sends the packet to the MAC layer. At the MAC layer, the packet is held for the dur<strong>at</strong>ion of itstra<strong>ns</strong>mission time (<strong>and</strong> any appropri<strong>at</strong>e collision detection is performed if the MAC, such as the Aloha MAC, supports it).If the packet is determined to have arrived safely <strong>at</strong> the MAC, it next passes to an ErrorModel object, if it exists. If not,the packet moves through any receive tracing objects to the S<strong>at</strong>LL object. <strong>The</strong> S<strong>at</strong>LL object passes the packet up after aprocessing delay (again, by default, the value for delay_ is zero).184

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

Saved successfully!

Ooh no, something went wrong!