Amazing technological breakthrough possible @S-Logix pro@slogix.in

Office Address

  • #5, First Floor, 4th Street Dr. Subbarayan Nagar Kodambakkam, Chennai-600 024 Landmark : Samiyar Madam
  • pro@slogix.in
  • +91- 81240 01111

Social List

How to use Link State Routing (LS) protocol in NS2?

Description

The Link State (LS) routing protocol has two components such as routing agent and route logic. The routing agent exchanges routing packet with neighbors in the link state manner while the route logic does Dijkstra on exploiting the information gathered by the routing agents to perform the actual route computation. The test6.tcl shows the sample tcl code that runs the application with LS routing protocol.

Sample Code

# Filename: test6.tcl
# —————-Routing Protocol————-#

$ns rtproto LS
# —————-ESTABLISHING COMMUNICATION ————-#

#————–TCP CONNECTION BETWEEN NODES—————#
$ns at 0.0 "Tranmission"
proc Tranmission {} {
global C ROU R ns

set now [$ns now]
set time 10.0
set x 3
set y 4

set tcp1 [$ns create-connection TCP $C($x) TCPSink $R($y) 1]
$ns at $now "$ns trace-annotate \"Time: $now Pkt Transfer between Client($x) Receiver($y)..\""
$tcp1 set class_ 1
$tcp1 set maxcwnd_ 16
$tcp1 set packetsize_ 4000
$tcp1 set fid_ 1
set ftp1 [$tcp1 attach-app FTP]
$ftp1 set interval_ .005
$ns at $now "$ftp1 start"

}

Screenshots

Routing process

Data Transmission


Link State Routing (LS) protocol in NS2
How to use Link State Routing (LS) protocol in NS2