freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

ns2運(yùn)行機(jī)制分析-資料下載頁(yè)

2024-10-18 16:43本頁(yè)面
  

【正文】 k的一個(gè)變量 head_ Node的結(jié)構(gòu) Simulator instproc run {} { $self checksmac $self checknodenum $self rtmodelconfigure [$self getroutelogic] configure $self instvar scheduler_ Node_ link_ started_ set started_ 1 foreach nn [array names Node_] { $Node_($nn) reset if { [Simulator set nixrouting] } { $Node_($nn) populateobjects } } foreach qn [array names link_] { set q [$link_($qn) queue] $q reset } $self initnam return [$scheduler_ run] } tcl/rtglib/ Simulator instproc rtmodelconfigure {} { $self instvar rtq_ rtModel_ if [info exists rtModel_] { set rtq_ [new rtQueue $self] foreach m $rtModel_ { $m configure } } } 似乎沒(méi)有執(zhí)行 tcl/lib/ Simulator instproc getroutelogic {} { $self instvar routingTable_ if ![info exists routingTable_] { set routingTable_ [new RouteLogic] } return $routingTable_ } 執(zhí)行了,創(chuàng)建了一個(gè)對(duì)象 tcl/ RouteLogic instproc configure {} { $self instvar rtprotos_ if [info exists rtprotos_] { foreach proto [array names rtprotos_] { eval Agent/rtProto/$proto initall $rtprotos_($proto) } } else { Agent/rtProto/Static initall } } tcl/rtglib/ Agent/rtProto/Static proc initall args { The Simulator knows the entire topology. Hence, the current puteroutes method in the Simulator class is well suited. We use it as is. [Simulator instance] puteroutes } tcl/lib/ Simulator instproc puteroutes {} { if [Simulator hieraddr?] { $self putehierroutes } else { $self puteflatroutes } } Simulator instproc puteflatroutes {} { $self instvar Node_ link_ if { [ Simulator set nixrouting] } { puts Using NixVector routing, skipping route putations return } set r [$self getroutelogic] $self cmd getroutelogic $r 。 propagate rl in C++ foreach ln [array names link_] { set L [split $ln :] set srcID [lindex $L 0] set dstID [lindex $L 1] if { [$link_($ln) up?] == up } { $r insert $srcID $dstID [$link_($ln) cost?] } else { $r reset $srcID $dstID } } $r pute set n [Node set nn_] $self populateflatclassifiers $n } 重要!計(jì)算路由,因?yàn)檫@里采用默認(rèn)的靜態(tài)路由,因此初始化時(shí)就計(jì)算好。 返回 otcl的 RouteLogic對(duì)象 把 c++中的 Ro teLogic對(duì)象賦給 Simulator對(duì)象的一個(gè)成員函數(shù) rtobject_ 這一段是取出一個(gè)每個(gè) link的兩端節(jié)點(diǎn)的節(jié)點(diǎn) ID。還記得 link_變量的 內(nèi)容 嗎? 這一段是取出一個(gè)每個(gè) link的兩端節(jié)點(diǎn)的節(jié)點(diǎn) ID。還記得 link_變量的內(nèi)容嗎? //routeing/ if (strcmp(argv[1], insert) == 0) { int src = atoi(argv[2]) + 1。 int dst = atoi(argv[3]) + 1。 if (src = 0 || dst = 0) { (negative node number)。 return (TCL_ERROR)。 } double cost = (argc == 5 ? atof(argv[4]) : 1)。 insert(src, dst, cost)。 return (TCL_OK)。 } Simulator instproc run {} { $self checksmac $self checknodenum $self rtmodelconfigure [$self getroutelogic] configure $self instvar scheduler_ Node_ link_ started_ set started_ 1 foreach nn [array names Node_] { $Node_($nn) reset if { [Simulator set nixrouting] } { $Node_($nn) populateobjects } } foreach qn [array names link_] { set q [$link_($qn) queue] $q reset } $self initnam return [$scheduler_ run] } outline ? 1預(yù)修知識(shí) ? 2一個(gè)最簡(jiǎn)單的 ns仿真的啟動(dòng)過(guò)程 ? 3Ns的網(wǎng)絡(luò)實(shí)體結(jié)構(gòu)和類結(jié)構(gòu) 3從 ns的啟動(dòng)過(guò)程看 ns中網(wǎng)絡(luò)實(shí)體的架構(gòu) 對(duì)照:?jiǎn)尾ス?jié)點(diǎn)的構(gòu)造 _o1 _o3 _o2 _o4 _o5 _o6 _o7 _o8 _o9 _o10 _o11 _o14 _o12 _o13 _o15 _o16 _o17 _o18 _o19 _o20 _o21 _o22 RNG Import Simulator PacketHeaderManager Scheduler/Calender Agent/Null AllocAddrBits AllocAddr Address Node RtModule/Base Classifier/Hash/Dest Node Classifier/Hash/Dest RtModule/Base _o28 _o27 _o26 _o25 _o24 _o23 Queue/DropTail Connector SimpleLink DelayLink TTL_Checker Connector Queue/DropTail Connector SimpleLink DelayLink TTL_Checker Connector _o29 _o31 _o30 Agent/TCP Application/FTP Agent/TCPSink _o32 Classifier/Port _o33 Classifier/Port ns的類結(jié)構(gòu) ? 回顧你平時(shí)進(jìn)行 c++編程的過(guò)程: – 寫具有各種獨(dú)立功能的類 – 寫 main函數(shù),讓類實(shí)例化,即 new出對(duì)象;并讓這些對(duì)象協(xié)調(diào)工作 – 一個(gè)優(yōu)秀的 OO程序應(yīng)該只有 main這個(gè)外部函數(shù),其他全是類;而 java連main都在類中。 ? 那么 ns中: – 用 c++實(shí)現(xiàn)各種功能實(shí)體,即類 – 用 tcl語(yǔ)言 new出 c++對(duì)象,并進(jìn)行 初始化 ,讓這些對(duì)象協(xié)調(diào)工作;可以說(shuō),tcl充當(dāng)了 main函數(shù)的功能,但交互性更好 – 來(lái)看看 tcl的初始化: ? 設(shè)定一些變量的初始值 (一般通過(guò) bind機(jī)制 );注意,初始化更重要的任務(wù)是將各個(gè)對(duì)象的 downtarget_和 uptarget_賦值,以完成數(shù)據(jù)包行進(jìn)路徑的設(shè)定!??! ? 一旦運(yùn)行起來(lái),即 $ns run語(yǔ)句執(zhí)行后,基本不關(guān) tcl的事了 – 人們?cè)谟?tcl進(jìn)行初始化的時(shí)候,為了結(jié)構(gòu)清晰,對(duì)應(yīng)每個(gè) c++類,用一個(gè)OTcl類進(jìn)行初始化。而這個(gè)關(guān)聯(lián)過(guò)程就是 ns的一種獨(dú)有的機(jī)制,通過(guò) tclcl完成。 下面看 tclcl的工作過(guò)程,即動(dòng)態(tài)創(chuàng)建過(guò)程 事實(shí)上,隨著 ns規(guī)模的擴(kuò)大, otcl部分的代碼越來(lái)越復(fù)雜; ns學(xué)習(xí)的難度轉(zhuǎn)移到 otcl代碼部分。就好像社會(huì)上干實(shí)事的人反而沒(méi)有管理者多 Agent/TCP Agent SplitObject TclObject Agent TcpAgent Agent/TCP 的實(shí)例 new Agent/TCP 全局函數(shù) new{} 對(duì)應(yīng)類的 create{},分配內(nèi)存。該函數(shù)不可見(jiàn),是二進(jìn)制的 對(duì)應(yīng)類的 init{} 基類的 init{},最終調(diào)用SplitObject的 init{} $self createshadow $args,進(jìn)入 c++代碼 .。怎么進(jìn)入的,不清楚。 TclClass 虛函數(shù) TclClass::create 對(duì)應(yīng) c++對(duì)象自己的 create函數(shù) TcpAgent的實(shí)例 TclObject NsObject Agent RoutLogic ParentNode Node Connector TcpAgent LinkDelay Classifier Queue DestHashClassifier AddressClassifier PortClassifier HashClassifier RED DropTail Process Application Application/FTP 每個(gè) c++類都對(duì)應(yīng)一個(gè) OTcl類。并且 OTcl還為一些聯(lián)系緊密的c++類構(gòu)造一個(gè) OTcl類 (那些顯式出現(xiàn)了 Class xxx –superclass xxx),例如 Link 只有 OTcl類,因?yàn)樘?jiǎn)單 OTcl SimpleLink類 插敘: ns中的 IP地址 ? 分兩種類型 (共 32bits) –平坦型 flatter(default): 1, 2, 3… –結(jié)構(gòu)化型 hierarchical(分段,類似實(shí)際的 IP地址 ),兩種分法: ? 10:11:11 ? 自己定制: $ns setaddressformat hierarchical 4 2 2 2 10 ? 常用平坦型 simulator:~/ins/$ ns % set ns [new Simulator] _o4 % $ns nodeconfig addressType hierarchical % set n3 [$ns node ] _o14 % $n3 nodeaddr % set tmp1 [$n3 nodeaddr] % AddrParams addr2id $tmp1 4198403 % $n1 nodeaddr 0 $n2 nodeaddr 1 $n1 nodeaddr 0 $n2 nodeaddr 1 AddrParams addr2id [$n2 nodeaddr] 1
點(diǎn)擊復(fù)制文檔內(nèi)容
教學(xué)課件相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1