- set ns [new Simulator]
- $ns rtproto LS
- set node1 [$ns node]
- set node2 [$ns node]
- set node3 [$ns node]
- set node4 [$ns node]
- set node5 [$ns node]
- set node6 [$ns node]
- set node7 [$ns node]
- set tf [open out.tr w]
- $ns trace-all $tf
- set nf [open out.nam w]
- $ns namtrace-all $nf
- $node1 label "node 1"
- $node1 label "node 2"
- $node1 label "node 3"
- $nodel label "node 4"
- $node1 label "node S"
- $nodel label "node 6"
- $nodel label "node 7"
- $nodel label-color blue
- $node2 label-color red
- $node3 label-color red
- $node4 label-color blue
- $node5 label-color blue
- $node6 label-color blue
- $node7 label-color blue
- $ns duplex-link $node1 $node2 1.5Mb 10ms DropTail
- $ns duplex-link $node2 $node3 1.5Mb 10ms DropTail
- $ns duplex-link $node3 $node4 1.5Mb 10ms DropTail
- $ns duplex-link $node4 $node5 1.5Mb 10ms DropTail
- $ns duplex-link $node5 $node6 1.5Mb 10ms DropTail
- $ns duplex-link $node6 $node7 1.5Mb 10ms DropTail
- $ns duplex-link $node7 $node1 1.5Mb 10ms DropTail
- $ns duplex-link-op $node1 $node2 orient left-down
- $ns duplex-link-op $node2 $node3 orient left-down
- $ns duplex-link-op $node3 $node4 orient right-down
- $ns duplex-link-op $node4 $node5 orient right
- $ns duplex-link-op $node5 $node6 orient right-up
- $ns duplex-link-op $node6 $node7 orient left-up
- $ns duplex-link-op $node7 $node1 orient left-up
- set tcp2 [new Agent/TCP]
- $ns attach-agent $node1 $tcp2
- set sink2 [new Agent/TCPSink]
- $ns attach-agent $node4 $sink2
- $ns connect $tcp2 $sink2
- set traffic_ftp2 [new Application/FTP]
- $traffic_ftp2 attach-agent $tcp2
- proc finish (H
[text] Small
Viewer
*** This page was generated with the meta tag "noindex, nofollow". This happened because you selected this option before saving or the system detected it as spam. This means that this page will never get into the search engines and the search bot will not crawl it. There is nothing to worry about, you can still share it with anyone.
Editor
You can edit this paste and save as new: