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

正文內(nèi)容

ns的網(wǎng)絡(luò)功能實體結(jié)構(gòu)及類結(jié)構(gòu)-wenkub

2022-10-23 15:19:10 本頁面
 

【正文】 s [new Simulator] set tracefd [ open w] set namfd [open w] $ns traceall $tracefd $ns namtraceall $namfd set n0 [$ns node] set n1 [$ns node] $ns duplexlink $n0 $n1 1Mb 10ms DropTail set tcp [new Agent/TCP] set snk [new Agent/TCPSink] $ns attachagent $n0 $tcp $ns attachagent $n1 $snk set ftp [new Application/FTP] $ftp attachagent $tcp $ns connect $tcp $snk $ns at $ftp start $ns at ―exit 0 $ns run 例子的仿真結(jié)果 + 0 1 tcp 1040 0 7 14 0 1 tcp 1040 0 7 14 + 0 1 tcp 1040 0 8 15 r 1 0 ack 40 0 4 11 + 0 1 tcp 1040 0 9 16 V t * v a 0 A t * n 1 p 0 o 0xffffffff c 31 a 1 A t * h 1 m 2147483647 s 0 n t * a 0 s 0 S UP v circle c black i black n t * a 1 s 1 S UP v circle c black i black l t * s 0 d 1 S UP r 1000000 D c black + t s 0 d 1 p tcp e 40 c 0 i 0 a 0 x { 0 null} t s 0 d 1 p tcp e 40 c 0 i 0 a 0 x { 0 null} h t s 0 d 1 p tcp e 40 c 0 i 0 a 0 x { 1 null} r t s 0 d 1 p tcp e 40 c 0 i 0 a 0 x { 0 null} + t s 1 d 0 p ack e 40 c 0 i 1 a 0 x { 0 null} 2一個最簡單的 ns腳本的啟動過程 set ns [new Simulator] set n0 [$ns node] set n1 [$ns node] $ns duplexlink $n0 $n1 1Mb 10ms DropTail set tcp [new Agent/TCP] set snk [new Agent/TCPSink] $ns attachagent $n0 $tcp $ns attachagent $n1 $snk set ftp [new Application/FTP] $ftp attachagent $tcp $ns connect $tcp $snk proc finish {} { exit 0 } $ns at $ftp start $ns at finish $ns run 啟動過程 0 ? 當(dāng)命令行運行 ns,會創(chuàng)建 3個對象 _o1, _o2, _o3 ? _o1和 _o2是 RNG, _o3是 Import (tclcl/tcl) simulator:~/ins/$ ns % set a [new Application/FTP] _o4 % _o1 info class RNG % _o2 info class RNG % _o3 info class Import % _o4 info class Application/FTP 啟動過程 1 ? set ns [new Simulator] tclcl/ proc new { className args } { set o [SplitObject getid] if [catch $className create $o $args msg] { if [string match __FAILED_SHADOW_OBJECT_ $msg] { The shadow object failed to be allocated. delete $o return } global errorInfo error class $className: constructor failed: $msg $errorInfo } return $o } ―Simulator create 4‖ 該操作創(chuàng)建一個Simulator對象,并調(diào)用它的 init函數(shù)進行初始化 啟動過程 1 ? Simulator instproc init args {…} tcl/lib/ Simulator instproc init args { …… $self create_packetformat $self usescheduler Calendar $self set nullAgent_ [new Agent/Null] $self setaddressformat def if {[lindex $args 0] == multicast} { $self multicast $args } eval $self next $args } 這個還未找到代碼位置 (找到了 ),可以猜想是創(chuàng)建數(shù)據(jù)包的頭標(biāo)對應(yīng)的數(shù)據(jù)結(jié)構(gòu),創(chuàng)建對象 _o5,類型為 PacketHeaderManager 創(chuàng)建對象 _o6,類型為Scheduler/Calender,一個非常重要的類,單線程的 ns能模擬多節(jié)點的網(wǎng)絡(luò),就是通過它來調(diào)度。 這一步的所有對象都由這個命令創(chuàng)建 (找到了,其實就是 new Node) 在 c++的Simulator對象中加入該 node對象 new Node之后,會調(diào)用 Node類的 init函數(shù) tcl/lib/ if {[llength $args] != 0} { set ad
點擊復(fù)制文檔內(nèi)容
教學(xué)課件相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1