Advertisement
hgr24

Untitled

Mar 29th, 2022
1,386
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
TCL 1.75 KB | None | 0 0
  1.  
  2. Best of PUBG MOBILE
  3. 11:08 PM (0 minutes ago)
  4. to me
  5.  
  6. set ns [new Simulator]
  7. set tf [open lab4.tr w]
  8. $ns trace-all $tf
  9. set topo [new Topography]
  10. $topo load_flatgrid 1000 1000
  11. set nf [open lab4.nam w]
  12. $ns namtrace-all-wireless $nf 1000 1000
  13. $ns node-config -adhocRouting DSDV \
  14.                 -llType LL \
  15.                 -macType Mac/802_11 \
  16.                 -ifqType Queue/DropTail \
  17.                 -ifqLen 50 \
  18.                 -phyType Phy/WirelessPhy \
  19.                 -channelType Channel/WirelessChannel \
  20.                 -propType Propagation/TwoRayGround \
  21.                 -antType Antenna/OmniAntenna \
  22.                 -topoInstance $topo \
  23.                 -agentTrace ON \
  24.                 -routerTrace ON
  25. create-god 3
  26. set n0 [$ns node]
  27. set n1 [$ns node]
  28. set n2 [$ns node]
  29. $n0 label "tcp0"
  30. $n1 label "sink1/tcp1"
  31. $n2 label "sink2"
  32. $n0 set X_ 50
  33. $n0 set Y_ 50
  34. $n0 set Z_ 0
  35. $n1 set X_ 100
  36. $n1 set Y_ 100
  37. $n1 set Z_ 0
  38. $n2 set X_ 600
  39. $n2 set Y_ 600
  40. $n2 set Z_ 0
  41. $ns at 0.1 "$n0 setdest 50 50 15"
  42. $ns at 0.1 "$n1 setdest 100 100 25"
  43. $ns at 0.1 "$n2 setdest 600 600 25"
  44. set tcp0 [new Agent/TCP]
  45. $ns attach-agent $n0 $tcp0
  46. set ftp0 [new Application/FTP]
  47. $ftp0 attach-agent $tcp0
  48. set sink1 [new Agent/TCPSink]
  49. $ns attach-agent $n1 $sink1
  50. $ns connect $tcp0 $sink1
  51. set tcp1 [new Agent/TCP]
  52. $ns attach-agent $n1 $tcp1
  53. set ftp1 [new Application/FTP]
  54. $ftp1 attach-agent $tcp1
  55. set sink2 [new Agent/TCPSink]
  56. $ns attach-agent $n2 $sink2
  57. $ns connect $tcp1 $sink2
  58. $ns at 5 "$ftp0 start"
  59. $ns at 5 "$ftp1 start"
  60. $ns at 100 "$n1 setdest 550 550 15"
  61. $ns at 190 "$n1 setdest 70 70 15"
  62. proc finish { } {
  63.         global ns nf tf
  64.         $ns flush-trace
  65.         exec nam lab4.nam &
  66.         close $tf
  67.         exit 0
  68. }
  69. $ns at 250 "finish"
  70. $ns run
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement