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 ...
will try to classify packet (lookup MFC) for the second time. If the return value is “0”, no further lookups will be done, andthe packet will be thus dropped.add-rep{} creates a slot in the classifier and adds a replicator for 〈source, group, iif〉 to that slot.Class Replicator When a replicator receives a packet, it copies the packet to all of its slots. Each slot points to an outgoinginterface for a particular 〈source, group〉.If no slot is found, the C++ replicator invokes the class instance procedure drop{} to trigger protocol specific actions. Wewill describe the protocol specific actions in the next section, when we describe the internal procedures of each of the multicastrouting protocols.There are instance procedures to control the elements in each slot:insert{oif}disable{oif}enable{oif}is-active{}exists{oif}change-iface{source, group, oldiif, newiif}inserting a new outgoing interface to the next available slot.disable the slot pointing to the specified oif.enable the slot pointing to the specified oif.returns true if the replicator has at least one active slot.returns true if the slot pointing to the specified oif is active.modified the iif entry for the particular replicator.30.2.3 Protocol InternalsWe now describe the implementation of the different multicast routing protocol agents.Centralized MulticastCtrMcast is inherits from McastProtocol. One CtrMcast agent needs to be created for each node. There is a centralCtrMcastComp agent to compute and install multicast routes for the entire topology. Each CtrMcast agent processesmembership dynamic commands, and redirects the CtrMcastComp agent to recompute the appropriate routes.join-group{}leave-group{}handle-cache-miss{}registers the new member with the CtrMCastComp agent, and invokes that agent to recomputeroutes for that member.is the inverse of join-group{}.called when no proper forwarding entry is found for a particular packet source. In case ofcentralized multicast, it means a new source has started sending data packets. Thus, theCtrMcast agent registers this new source with the CtrMcastComp agent. If there are anymembers in that group, compute the new multicast tree. If the group is in RPT (shared tree)mode, then1. create an encapsulation agent at the source;2. a corresponding decapsulation agent is created at the RP;3. the two agents are connected by unicast; and4. the 〈S,G〉 entry points its outgoing interface to the encapsulation agent.269
CtrMcastComp is the centralised multicast route computation agent.reset-mroutes{}compute-mroutes{}compute-tree{source, group}compute-branch{source, group, member}prune-branch{source, group, member}resets all multicast forwarding entries.(re)computes all multicast forwarding entries.computes a multicast tree for one source to reach all the receivers in aspecific group.is executed when a receiver joins a multicast group. It could also beinvoked by compute-tree{} when it itself is recomputing the multicasttree, and has to reparent all receivers. The algorithm starts at thereceiver, recursively finding successive next hops, until it either reachesthe source or RP, or it reaches a node that is already a part of the relevantmulticast tree. During the process, several new replicators and anoutgoing interface will be installed.is similar to compute-branch{} except the outgoing interface is disabled;if the outgoing interface list is empty at that node, it will walkup the multicast tree, pruning at each of the intermediate nodes, until itreaches a node that has a non-empty outgoing interface list for the particularmulticast tree.Dense Modejoin-group{group} sends graft messages upstream if 〈S,G〉 does not contain any activeoutgoing slots (i.e., no downstream receivers). If the nexthop towards the source is a LAN, icrements a counter of receiversfor a particular group for the LANleave-group{group} decrements LAN counters.handle-cache-miss{srcID group iface} depending on the value of CacheMissModecalls either handle-cache-miss-pimdm orhandle-cache-miss-dvmrp.handle-cache-miss-pimdm{srcID group iface} if the packet was received on the correct iif (from the node thatis the next hop towards the source), fan out the packet on all oifsexcept the oif that leads back to the next–hop–neighbor and oifsthat are LANs for which this node is not a forwarder. Otherwise,if the interface was incorrect, send a prune back.handle-cache-miss-dvmrp{srcID group iface} fans out the packet only to nodes for which this node is a nexthop towards the source (parent).drop{replicator source group iface} sends a prune message back to the previous hop.recv-prune{from source group iface} resets the prune timer if the interface had been pruned previously;otherwise, it starts the prune timer and disables the interface; furthermore,if the outgoing interface list becomes empty, it propagatesthe prune message upstream.recv-graft{from source group iface} cancels any existing prune timer, andre-enables the pruned interface.If the outgoing interface list was previously empty, itforwards the graft upstream.handle-wrong-iif{srcID group iface} This is invoked when the multicast classifier drops apacket because it arrived on the wrong interface, andinvoked new-group{}. This routine is invoked bymrtObject instproc new-group{}. When invoked, itsends a prune message back to the source.270
- 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
- Page 227 and 228: protected:RNG* rng_;};Classes deriv
- Page 229 and 230: ns-random is implemented in ~ns/mis
- Page 231 and 232: Chapter 26Trace and Monitoring Supp
- Page 233 and 234: The monitor-queue function is const
- Page 235 and 236: also used to accumulate packet drop
- Page 237 and 238: }name,th->size(),flags,iph->flowid(
- Page 239 and 240: PT_TORA,PT_DSR,PT_AODV,// insert ne
- Page 241 and 242: The QueueMonitor class is not deriv
- Page 243 and 244: $ns_ trace-all This is the command
- Page 245 and 246: Chapter 27Test Suite SupportThe ns
- Page 247 and 248: ... ...}$ns_ at $opt(stop).1 "$self
- Page 249 and 250: Example: To enable debugging in Que
- Page 251 and 252: Chapter 29Unicast RoutingThis secti
- Page 253 and 254: Asymmetric Routing Asymmetric routi
- Page 255 and 256: class RouteLogic This class defines
- Page 257 and 258: — The procedure init-all{} is a g
- Page 259 and 260: Global Actions Once the detailed ac
- Page 261 and 262: This dumps next hop information in
- Page 263 and 264: $ns mrtproto ST;# specify shared tr
- Page 265 and 266: Dense Mode The Dense Mode protocol
- Page 267 and 268: and unique label (id). Thus, “inc
- Page 269: add-iif{ifid link},add-oif{link if}
- Page 273 and 274: $ns_ mrtproto This command specifi
- Page 275 and 276: Chapter 31Network DynamicsThis chap
- Page 277 and 278: v 0.8123 link-up 3 5v 0.8123 link-u
- Page 279 and 280: The first argument is the time at w
- Page 281 and 282: $ns_ rtmodel This command defines
- Page 283 and 284: $ns set-address-format hierarchical
- Page 285 and 286: 32.4 Hierarchical Routing with Sess
- Page 287 and 288: Chapter 33UDP Agents33.1 UDP Agents
- Page 289 and 290: Chapter 34TCP AgentsThis section de
- Page 291 and 292: set ns [new Simulator]set node1 [$n
- Page 293 and 294: 34.2.1 The Base TCP SinkThe base TC
- Page 295 and 296: Agent/TCP/FullTcp set dupseg_fix_ t
- Page 297 and 298: 34.5 Tracing TCP DynamicsThe behavi
- Page 299 and 300: Chapter 35SCTP AgentsThis chapter d
- Page 301 and 302: Figure 35.1: Example of a Multihome
- Page 303 and 304: Note: the actual value of these tra
- Page 305 and 306: 1.526624 1 4 sctp 1500 -------D 0 1
- Page 307 and 308: $ns at 5.0 "finish"$ns run35.5.2 Mu
- Page 309 and 310: Chapter 36Agent/SRMThis chapter des
- Page 311 and 312: 36.1.2 Other Configuration Paramete
- Page 313 and 314: 3.6274 n 0 m r 1 type repair servi
- Page 315 and 316: 3.6029 n 3 m r 2 Q NTIMER at 3.730
- Page 317 and 318: 36.4 Loss Detection—The Class SRM
- Page 319 and 320: same packet. The repair objet does
will try to classify packet (lookup MFC) for the second time. If the return value is “0”, no further lookups will be done, <strong>and</strong>the packet will be thus dropped.add-rep{} cre<strong>at</strong>es a slot in the classifier <strong>and</strong> adds a replic<strong>at</strong>or for 〈source, group, iif〉 to th<strong>at</strong> slot.Class Replic<strong>at</strong>or When a replic<strong>at</strong>or receives a packet, it copies the packet to all of its slots. Each slot points to an outgoinginterface for a particular 〈source, group〉.If no slot is found, the C++ replic<strong>at</strong>or invokes the class i<strong>ns</strong>tance procedure drop{} to trigger protocol specific actio<strong>ns</strong>. Wewill describe the protocol specific actio<strong>ns</strong> in the next section, when we describe the internal procedures of each of the multicastrouting protocols.<strong>The</strong>re are i<strong>ns</strong>tance procedures to control the elements in each slot:i<strong>ns</strong>ert{oif}disable{oif}enable{oif}is-active{}exists{oif}change-iface{source, group, oldiif, newiif}i<strong>ns</strong>erting a new outgoing interface to the next available slot.disable the slot pointing to the specified oif.enable the slot pointing to the specified oif.retur<strong>ns</strong> true if the replic<strong>at</strong>or has <strong>at</strong> least one active slot.retur<strong>ns</strong> true if the slot pointing to the specified oif is active.modified the iif entry for the particular replic<strong>at</strong>or.30.2.3 Protocol InternalsWe now describe the implement<strong>at</strong>ion of the different multicast routing protocol agents.Centralized MulticastCtrMcast is inherits from McastProtocol. One CtrMcast agent needs to be cre<strong>at</strong>ed for each node. <strong>The</strong>re is a centralCtrMcastComp agent to compute <strong>and</strong> i<strong>ns</strong>tall multicast routes for the entire topology. Each CtrMcast agent processesmembership dynamic comm<strong>and</strong>s, <strong>and</strong> redirects the CtrMcastComp agent to recompute the appropri<strong>at</strong>e routes.join-group{}leave-group{}h<strong>and</strong>le-cache-miss{}registers the new member with the CtrMCastComp agent, <strong>and</strong> invokes th<strong>at</strong> agent to recomputeroutes for th<strong>at</strong> member.is the inverse of join-group{}.called when no proper forwarding entry is found for a particular packet source. In case ofcentralized multicast, it mea<strong>ns</strong> a new source has started sending d<strong>at</strong>a packets. Thus, theCtrMcast agent registers this new source with the CtrMcastComp agent. If there are anymembers in th<strong>at</strong> group, compute the new multicast tree. If the group is in RPT (shared tree)mode, then1. cre<strong>at</strong>e an encapsul<strong>at</strong>ion agent <strong>at</strong> the source;2. a corresponding decapsul<strong>at</strong>ion agent is cre<strong>at</strong>ed <strong>at</strong> the RP;3. the two agents are connected by unicast; <strong>and</strong>4. the 〈S,G〉 entry points its outgoing interface to the encapsul<strong>at</strong>ion agent.269