1

私は NS2 で作業しており、MD1 キュー タイプを使用して tcp パケットと udp パケットを混在させようとしています。各 udp パケットと tcp パケットの間で到着率を分割したいと考えています。udp をポアソン トラフィックとして設定し、パケットの生成を制御する方法を見つけましたが、tcp ではパケットの生成を制御する方法がわかりませんでした。つまり、tcp ソース トラフィックで到着率を設定する方法です。 (ftp および cbr トラフィックを使用します)。私は多くの方法を試しましたが、解決できませんでした。これを行うには、tcp の .tcl ファイルのどのパラメーターを使用すればよいですか?

私の .tcl ファイル:

    set ns [new Simulator]

    set tf [open output.tr w]
    set nf [open nam.nam w]

    $ns trace-all $tf
    $ns namtrace-all $nf

    proc finish {} {
            global ns nf tf
            $ns flush-trace
            close $tf
        close $nf
        exec nam nam.nam &
            exit 0
    }

        set n0 [$ns node]
        set n1 [$ns node]
        set n2 [$ns node]
        set n3 [$ns node]

        $ns duplex-link $n0 $n2 1Mb 10ms DropTail
        $ns simplex-link $n1 $n2 1Mb 10ms DropTail
        $ns duplex-link $n2 $n3 0.04Mb 10ms DropTail

        $ns queue-limit $n0 $n2 100
        $ns queue-limit $n1 $n2 100
        $ns queue-limit $n2 $n3 100

    $ns duplex-link-op $n0 $n2 orient right-down
    $ns simplex-link-op $n1 $n2 orient right-up
    $ns duplex-link-op $n2 $n3 orient right

    $ns duplex-link-op $n0 $n2 queuePos 0.5
    $ns simplex-link-op $n1 $n2 queuePos 0.5
    $ns duplex-link-op $n2 $n3 queuePos 0.5

    set udp [new Agent/UDP]
    $ns attach-agent $n1 $udp
    set null [new Agent/Null]
    $ns attach-agent $n3 $null
    $ns connect $udp $null

    set exp  [new Application/Traffic/Exponential]
    $exp  attach-agent $udp
    $exp  set burst_time_ 0
    $exp  set idle_time_ 400ms
    $exp  set rate_ 1mb
    $exp  set packetSize_ 1000

    set tcp [new Agent/TCP]
    $tcp set class_ 2
    $ns attach-agent $n0 $tcp

    set sink [new Agent/TCPSink]
    $ns attach-agent $n3 $sink
    $ns connect $tcp $sink
    $tcp set window_ 20
    $tcp set packetSize_ 555

    set ftp [new Application/FTP]
    $ftp attach-agent $tcp
    $ftp set type_ FTP

    $ns at 0.2 "$exp start"
    $ns at 0.3 "$ftp start"
    $ns at 30000 "$exp stop"
    $ns at 30000 "$ftp stop"
    $ns at 30000 "finish"
        $ns run
4

0 に答える 0