SHARE
TWEET

Untitled

a guest Sep 17th, 2019 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. set ns [new Simulator]
  2. $ns color 1 Red
  3. $ns color 2 Blue
  4. set nf [open l1.nam w]
  5. $ns namtrace-all $nf
  6. set nt [open l1.tr w]
  7. $ns trace-all $nt
  8. proc finish {} {
  9. global ns nf nt
  10. $ns flush-trace
  11. close $nf
  12. close $nt
  13. exec nam l1.nam &
  14. exec cat l1.tr | awk -f l1.awk &
  15. exit 0
  16. }
  17. set n0 [$ns node]
  18. set n1 [$ns node]
  19. set n2 [$ns node]
  20. $n0 label "source1"
  21. $n1 label "source2"
  22. $ns duplex-link $n0 $n2 1Mb 15ms DropTail
  23. $ns duplex-link $n1 $n2 1Mb 15ms DropTail
  24. $ns duplex-link-op $n0 $n2 orient right-down
  25. $ns duplex-link-op $n1 $n2 orient right-up
  26. set udp0 [new Agent/UDP]
  27. $ns attach-agent $n0 $udp0
  28. set udp1 [new Agent/UDP]
  29. $ns attach-agent $n1 $udp1
  30. set null0 [new Agent/Null]
  31. $ns attach-agent $n2 $null0
  32. $ns set queue-limit $n0 $n2 10
  33. $ns set queue-limit $n1 $n2 5
  34. set cbr0 [new Application/Traffic/CBR]
  35. $cbr0 set packet-size_ 600
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top