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

📄 patch.tcl.lib

📁 ns2网络仿真中超宽带的实现
💻 LIB
字号:
diff -Naur --ignore-matching-lines='Version Date' --ignore-matching-lines=cvsroot --ignore-matching-lines=CVSROOT /home/rmerz/NS/ns-allinone-2.26/ns-2.26/tcl/lib/ns-default.tcl tcl/lib/ns-default.tcl--- /home/rmerz/NS/ns-allinone-2.26/ns-2.26/tcl/lib/ns-default.tcl	2003-02-26 23:09:37.000000000 +0100+++ tcl/lib/ns-default.tcl	2004-01-30 17:10:07.000000000 +0100@@ -649,6 +649,15 @@ Phy/WirelessPhy set L_ 1.0   Phy/WirelessPhy set debug_ false +# this should really be called bandwidth!+Phy/WirelessPhy/InterferencePhy set frequency_range_ 7.5e+9+Phy/WirelessPhy/InterferencePhy set noise_factor_ 3+Phy/WirelessPhy/InterferencePhy set use_timehopping_ 1+Phy/WirelessPhy/InterferencePhy set erasure_coefficient_ 5+Phy/WirelessPhy/InterferencePhy set bandwidth_ 2e6+# taken from Community Wireless Project FAQ (between -80 and -96 dbm)+Phy/WirelessPhy/InterferencePhy set CSThresh_ 2.5e-13;+ Phy/WiredPhy set bandwidth_ 10e6 Phy/WiredPhy set debug_ false Phy/Repeater set debug_ false@@ -664,6 +673,22 @@ Propagation/Shadowing set dist0_ 1.0 Propagation/Shadowing set seed_ 0 +# PropTarokh propagation model+Propagation/Tarokh set average_pathlossExp_ 1.7+Propagation/Tarokh set std_db_ 4.0+Propagation/Tarokh set dist0_ 1.0+Propagation/Tarokh set seed_ 0+Propagation/Tarokh set sigma_g_ 0.3 +Propagation/Tarokh set mi_s_ 1.6+Propagation/Tarokh set sigma_s_ 0.5+Propagation/Tarokh set n1_low_ -0.75+Propagation/Tarokh set n1_high_ 0.75+Propagation/Tarokh set n2_low_ -2+Propagation/Tarokh set n2_high_ 2+Propagation/Tarokh set n3_low_ -2+Propagation/Tarokh set n3_high_ 2++ # Turning on/off sleep-wakeup cycles for SMAC Mac/SMAC set syncFlag_ 0 diff -Naur --ignore-matching-lines='Version Date' --ignore-matching-lines=cvsroot --ignore-matching-lines=CVSROOT /home/rmerz/NS/ns-allinone-2.26/ns-2.26/tcl/lib/ns-lib.tcl tcl/lib/ns-lib.tcl--- /home/rmerz/NS/ns-allinone-2.26/ns-2.26/tcl/lib/ns-lib.tcl	2003-02-26 23:09:37.000000000 +0100+++ tcl/lib/ns-lib.tcl	2004-01-30 17:13:17.000000000 +0100@@ -188,6 +188,7 @@ source ../mobility/dsdv.tcl source ../mobility/dsr.tcl source ../mobility/com.tcl+source ../mobility/noah.tcl  source ../plm/plm.tcl source ../plm/plm-ns.tcl@@ -299,10 +300,13 @@ # # Define global node configuration # $ns_ node-config -addressType flat/hierarchical-#                  -adhocRouting   DSDV/DSR/TORA+#                  -adhocRouting   DSDV/DSR/TORA/NOAH #                  -llType #                  -macType #                  -propType+#                  -propInstance+#                  -modulationType+#                  -modulationInstance #                  -ifqType #                  -ifqLen #                  -phyType@@ -329,6 +333,8 @@ Simulator instproc macType  {val} { $self set macType_  $val } Simulator instproc propType  {val} { $self set propType_  $val } Simulator instproc propInstance  {val} { $self set propInstance_  $val }+Simulator instproc modulationType  {val} { $self set modulationType_  $val }+Simulator instproc modulationInstance  {val} { $self set modulationInstance_  $val } Simulator instproc ifqType  {val} { $self set ifqType_  $val } Simulator instproc ifqLen  {val} { $self set ifqlen_  $val } Simulator instproc phyType  {val} { $self set phyType_  $val }@@ -415,9 +421,9 @@         # return value from init-vars{}.         set args [eval $self init-vars $args] -        $self instvar addressType_  routingAgent_ propType_  macTrace_ \+        $self instvar addressType_  routingAgent_ propType_ modulationType_  macTrace_ \ 		routerTrace_ agentTrace_ movementTrace_ channelType_ channel_ \-		chan topoInstance_ propInstance_ mobileIP_ rxPower_ \+		chan topoInstance_ propInstance_ modulationInstance_ mobileIP_ rxPower_ \ 		txPower_ idlePower_ satNodeType_          if [info exists macTrace_] {@@ -447,6 +453,18 @@ 		} 	} 	+	# Only create 1 instance of modulation+	if {[info exists modulationInstance_]} {+		if {[info exists modulationType_] && [Simulator set modulationInstCreated_] == 0} {+			warn "Both modulationType and modulationInstance are set. modulationType is ignored."+		}+	} else {+		if {[info exists modulationType_]} {+			set modulationInstance_ [new $modulationType_]+			Simulator set modulationInstCreated_ 1+		}+	}+	 	# Add multi-interface support:  	# User can only specify either channelType_ (single_interface as  	# before) or channel_ (multi_interface)@@ -554,7 +572,7 @@ # XXX This should be moved into the node initialization procedure instead  # of standing here in ns-lib.tcl. Simulator instproc create-wireless-node args {-        $self instvar routingAgent_ wiredRouting_ propInstance_ llType_ \+        $self instvar routingAgent_ wiredRouting_ propInstance_ modulationInstance_ llType_ \ 		macType_ ifqType_ ifqlen_ phyType_ chan antType_ energyModel_ \ 		initialEnergy_ txPower_ rxPower_ idlePower_ \ 		topoInstance_ level1_ level2_ inerrProc_ outerrProc_ FECProc_@@ -582,6 +600,9 @@ 		    Simulator set IMEPFlag_ ON 		    set ragent [$self create-tora-agent $node] 	    }+	    NOAH {+		    set ragent [$self create-noah-agent $node]+	    } 	    DIFFUSION/RATE { 		    eval $node addr $args 		    set ragent [$self create-diffusion-rate-agent $node]@@ -623,8 +644,12 @@ 		set FECProc_ "" 	} +	if ![info exists modulationInstance_] {+		set modulationInstance_ ""+	}+ 	# Add main node interface-	$node add-interface $chan $propInstance_ $llType_ $macType_ \+	$node add-interface $chan $propInstance_ $modulationInstance_ $llType_ $macType_ \ 			$ifqType_ $ifqlen_ $phyType_ $antType_ \ 			$inerrProc_ $outerrProc_ $FECProc_ 	# Attach agent@@ -740,6 +765,25 @@ 	return $ragent } +Simulator instproc create-noah-agent { node } {+    # Create a noah routing agent for this node+    set ragent [new Agent/NOAH]++    ## setup address (supports hier-addr) for noah agent+    ## and mobilenode+    set addr [$node node-addr]++    $ragent addr $addr+    $ragent node $node++    if [Simulator set mobile_ip_] {+        $ragent port-dmux [$node demux]+    }+    $node addr $addr+    $node set ragent_ $ragent+    #$self at 0.0 "$ragent start-noah"    ;# start updates+    return $ragent+}  Simulator instproc create-dumb-agent { node } { 	diff -Naur --ignore-matching-lines='Version Date' --ignore-matching-lines=cvsroot --ignore-matching-lines=CVSROOT /home/rmerz/NS/ns-allinone-2.26/ns-2.26/tcl/lib/ns-mobilenode.tcl tcl/lib/ns-mobilenode.tcl--- /home/rmerz/NS/ns-allinone-2.26/ns-2.26/tcl/lib/ns-mobilenode.tcl	2003-02-26 23:09:37.000000000 +0100+++ tcl/lib/ns-mobilenode.tcl	2004-01-30 17:10:07.000000000 +0100@@ -346,7 +346,7 @@ # The following setups up link layer, mac layer, network interface # and physical layer structures for the mobile node. #-Node/MobileNode instproc add-interface { channel pmodel lltype mactype \+Node/MobileNode instproc add-interface { channel pmodel mmodel lltype mactype \ 		qtype qlen iftype anttype inerrproc outerrproc fecproc} { 	$self instvar arptable_ nifs_ netif_ mac_ ifq_ ll_ imep_ inerr_ outerr_ fec_ 	@@ -464,7 +464,7 @@ 	}  	set god_ [God instance]-        if {$mactype == "Mac/802_11"} {+        if {$mactype == "Mac/802_11" || $mactype == "Mac/802_11_if" || $mactype == "Mac/IFControl"} { 		$mac nodes [$god_ num_nodes] 	} 	#@@ -493,6 +493,11 @@ 	}  	$netif propagation $pmodel	;# Propagation Model+	if {[info exists mmodel]} {+		if {[$netif info class] == "Phy/WirelessPhy/InterferencePhy"} {+			$netif modulation $mmodel	;# Modulation Model+		}+	} 	$netif node $self		;# Bind node <---> interface 	$netif antenna $ant_($t) 	#diff -Naur --ignore-matching-lines='Version Date' --ignore-matching-lines=cvsroot --ignore-matching-lines=CVSROOT /home/rmerz/NS/ns-allinone-2.26/ns-2.26/tcl/lib/ns-packet.tcl tcl/lib/ns-packet.tcl--- /home/rmerz/NS/ns-allinone-2.26/ns-2.26/tcl/lib/ns-packet.tcl	2003-02-26 23:09:37.000000000 +0100+++ tcl/lib/ns-packet.tcl	2004-01-30 17:10:07.000000000 +0100@@ -129,7 +129,8 @@ 	mcastCtrl 	MFTP 	MPLS-	Mac +	Mac+	MacIFControl 	Message         MIP  	Ping

⌨️ 快捷键说明

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