NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

set ns [new Simulator]
set f [open 3.tr w]

set nf [open 3.nam w]
$ns trace-all $f
$ns namtrace-all $nf
#===================================
# Nodes Definition
#===================================
#Create 6 nodes
set n0 [$ns node]
set n1 [$ns node]
set n2 [$ns node]
set n3 [$ns node]
set n4 [$ns node]
set n5 [$ns node]

$n0 label "Ping 0"
$n1 label "Ping 1"
$n2 label "R1"
$n3 label "R2"
$n4 label "Ping 4"
$n5 label "Ping 5"

$ns color 1 "red"
$ns color 2 "blue"
$ns color 3 "green"
$ns color 4 "orange"

set Ping0 [new Agent/Ping]
$ns attach-agent $n0 $Ping0

set Ping1 [new Agent/Ping]
$ns attach-agent $n1 $Ping1

set Ping4 [new Agent/Ping]
$ns attach-agent $n4 $Ping4

set Ping5 [new Agent/Ping]
$ns attach-agent $n5 $Ping5

$ns connect $Ping0 $Ping4
$ns connect $Ping1 $Ping5

$ns duplex-link $n0 $n2 2.0Mb 10ms DropTail
$ns duplex-link $n1 $n2 2.0Mb 10ms DropTail
$ns duplex-link $n2 $n3 1.0Mb 10ms DropTail
$ns duplex-link $n4 $n3 10.0Mb 10ms DropTail
$ns duplex-link $n3 $n5 10.0Mb 10ms DropTail

#Give node position (for NAM)
$ns duplex-link-op $n0 $n2 orient right-down
$ns duplex-link-op $n1 $n2 orient right-up
$ns duplex-link-op $n2 $n3 orient right
$ns duplex-link-op $n4 $n3 orient left-down
$ns duplex-link-op $n3 $n5 orient right-down

#===================================
# Agents Definition
#===================================

#===================================
# Applications Definition
#===================================

#===================================
# Termination
#===================================
#Define a 'finish' procedure
proc finish {} {
global ns f nf
$ns flush-trace
close $f
close $nf
exec nam 3.nam &
exit 0
}
proc sendPingPacket {} {
global ns Ping0 Ping1
set intervalTime 0.001
set now [$ns now]
$ns at [expr $now + $intervalTime] "$Ping0 send"
$ns at [expr $now + $intervalTime] "$Ping1 send"
$ns at [expr $now + $intervalTime] "sendPingPacket"
}

Agent/Ping instproc recv {from rtt} {
global seq
$self instvar node_
puts "the node [$node_ id] received an ACK from the node $from with RTT $rtt ms"
}


$ns at 0.01 "sendPingPacket"
$ns at 10.0 "finish"
$ns run
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.