SlideShare a Scribd company logo
1 of 3
Download to read offline
EX.No 8. Simulation of Distance Vector/Link State Routing.
.
a) Distance Vector routing protocol ROUTING
Aim:
To simulate and study the link state routing algorithm using simulation using NS2.
Distance Vector routing protocol
Routing is the process of selecting best paths in a network. In the past, the term
routing was also used to mean forwarding network traffic among networks. However this
latter function is muchbetter described as simply forwarding. Routing is performed for
many kinds of networks, including the telephone network (circuit switching), electronic
data networks (such as the Internet), and transportation networks. This article is concerned
primarily with routing in electronic data networks using packet switching technology
.In packet switching networks, routing directs packet forwarding (the transit of logically
addressed network packets from their source toward their ultimate destination) through
intermediate nodes. Intermediate nodes are typically network hardware devices such as
routers, bridges, gateways, firewalls, or switches. General-purpose computers can also
forward packets and perform routing, though they are not specialized hardware and may
suffer from limited performance. The routing process usually directs forwarding on the
basis of routing tables which maintain a record of the routes to various network destinations.
Thus, constructing routing tables, which are held in the router's memory, is very important
for efficient routing. Most routing algorithms use only one network path at a time.
Multipath routing techniques enable the use of multiple alternative paths. In case of
overlapping/equal routes, the following elements are considered in order to decide
which routes get installed into the routing table (sorted by priority):
1. Prefix-Length: where longer subnet masks are preferred (independent of whether it is
within a routing
protocol or over different routing protocol)
2. Metric: where a lower metric/cost is preferred (only valid within one and the same
routing protocol)
3. Administrative distance: where a lower distance is preferred (only valid between
different routing protocols) Routing, in a more narrow sense of the term, is often
contrasted with bridging in its assumption that network addresses are structured and that
similar addresses imply proximity within the network. Structured addresses allow a single
routing table entry to represent the route to a group of devices. In large networks,
structured addressing (routing, in the narrow sense) outperforms unstructured
addressing (bridging). Routing has become the dominant form of addressing on the
Internet. Bridging is still widely used within localized environments.
Algorithm
There are several variants of flooding algorithm. Most work roughly
as follows:
1. Each node acts as both a transmitter and a receiver.
2. Each node tries to forward every message to every one of its neighbours except the
source node. This results in every message eventually being delivered to all reachable
parts of the network. Algorithms may need to be more complex than this, since, in
some case, precautions have to be taken to avoid wasted duplicate deliveries and
infinite loops, and to allow messages to eventually expire from the system. A variant
of flooding called selective flooding partially addresses these issues by only sending
packets to routers in the same direction. In selective flooding the routers don't send
every incoming packet on every line but only on those lines which are going
approximately in the right direction.
Program:
set ns [new Simulator]
set nf [open out.nam w]
$ns namtrace-all $nf
set tr [open out.tr w]
$ns trace-all $tr
proc finish {} {
global nf ns tr
$ns flush-trace
close $tr
exec nam out.nam &
exit 0
}
set n0 [$ns node]
set n1 [$ns node]
set n2 [$ns node]
set n3 [$ns node]
$ns duplex-link $n0 $n1 10Mb 10ms DropTail
$ns duplex-link $n1 $n3 10Mb 10ms DropTail
$ns duplex-link $n2 $n1 10Mb 10ms DropTail
$ns duplex-link-op $n0 $n1 orient right-down
$ns duplex-link-op $n1 $n3 orient right
$ns duplex-link-op $n2 $n1 orient right-up
set tcp [new Agent/TCP]
$ns attach-agent $n0 $tcp
set ftp [new Application/FTP]
$ftp attach-agent $tcp
set sink [new Agent/TCPSink]
$ns attach-agent $n3 $sink
set udp [new Agent/UDP]
$ns attach-agent $n2 $udp
set cbr [new Application/Traffic/CBR]
$cbr attach-agent $udp
set null [new Agent/Null]
$ns attach-agent $n3 $null
$ns connect $tcp $sink
$ns connect $udp $null
$ns rtmodel-at 1.0 down $n1 $n3
$ns rtmodel-at 2.0 up $n1 $n3
$ns rtproto DV
$ns at 0.0 "$ftp start"
$ns at 0.0 "$cbr start"
$ns at 5.0 "finish"
$ns run
Result:
Thus the Distance Vector Routing Algorithm was Simulated and studied

More Related Content

Similar to distance-vector-routing-3.pdf

Designing an opportunistic routing scheme for adaptive clustering in mobile a...
Designing an opportunistic routing scheme for adaptive clustering in mobile a...Designing an opportunistic routing scheme for adaptive clustering in mobile a...
Designing an opportunistic routing scheme for adaptive clustering in mobile a...eSAT Publishing House
 
Study of Attacks and Routing Protocol in Wireless Network
Study of Attacks and Routing Protocol in Wireless NetworkStudy of Attacks and Routing Protocol in Wireless Network
Study of Attacks and Routing Protocol in Wireless Networkijsrd.com
 
A review of current routing protocols for ad hoc mobile wireless networks
A review of current routing protocols for ad hoc mobile wireless networksA review of current routing protocols for ad hoc mobile wireless networks
A review of current routing protocols for ad hoc mobile wireless networksPriyanka Gurnani
 
IJCER (www.ijceronline.com) International Journal of computational Engineerin...
IJCER (www.ijceronline.com) International Journal of computational Engineerin...IJCER (www.ijceronline.com) International Journal of computational Engineerin...
IJCER (www.ijceronline.com) International Journal of computational Engineerin...ijceronline
 
Experimental Analysis Of On Demand Routing Protocol
Experimental Analysis Of On Demand Routing ProtocolExperimental Analysis Of On Demand Routing Protocol
Experimental Analysis Of On Demand Routing Protocolsmita gupta
 
Performance Evaluation of a Layered WSN Using AODV and MCF Protocols in NS-2
Performance Evaluation of a Layered WSN Using AODV and MCF Protocols in NS-2Performance Evaluation of a Layered WSN Using AODV and MCF Protocols in NS-2
Performance Evaluation of a Layered WSN Using AODV and MCF Protocols in NS-2csandit
 
BETTER SCALABLE ROUTING PROTOCOL FOR HYBRID WIRELESS MESH NETWORK
BETTER SCALABLE ROUTING PROTOCOL FOR HYBRID WIRELESS MESH NETWORKBETTER SCALABLE ROUTING PROTOCOL FOR HYBRID WIRELESS MESH NETWORK
BETTER SCALABLE ROUTING PROTOCOL FOR HYBRID WIRELESS MESH NETWORKcscpconf
 
An Enhanced DSR Protocol for Improving QoS in MANET
An Enhanced DSR Protocol for Improving QoS in MANETAn Enhanced DSR Protocol for Improving QoS in MANET
An Enhanced DSR Protocol for Improving QoS in MANETKhushbooGupta145
 
PERFORMANCE ANALYSIS OF BROADCASTING IN MOBILE AD HOC NETWORKS USING CLUSTER ...
PERFORMANCE ANALYSIS OF BROADCASTING IN MOBILE AD HOC NETWORKS USING CLUSTER ...PERFORMANCE ANALYSIS OF BROADCASTING IN MOBILE AD HOC NETWORKS USING CLUSTER ...
PERFORMANCE ANALYSIS OF BROADCASTING IN MOBILE AD HOC NETWORKS USING CLUSTER ...ijasuc
 
Understanding Network Routing Problem and Study of Routing Algorithms and Heu...
Understanding Network Routing Problem and Study of Routing Algorithms and Heu...Understanding Network Routing Problem and Study of Routing Algorithms and Heu...
Understanding Network Routing Problem and Study of Routing Algorithms and Heu...IRJET Journal
 
Essay: Mobile Ad Hoc Networks - Overview Of Routing Protocols.
Essay: Mobile Ad Hoc Networks - Overview Of Routing Protocols.Essay: Mobile Ad Hoc Networks - Overview Of Routing Protocols.
Essay: Mobile Ad Hoc Networks - Overview Of Routing Protocols.JohnWilson47710
 
Destination Aware APU Strategy for Geographic Routing in MANET
Destination Aware APU Strategy for Geographic Routing in MANETDestination Aware APU Strategy for Geographic Routing in MANET
Destination Aware APU Strategy for Geographic Routing in MANETEditor IJCATR
 
Influence of Clustering on the Performance of MobileAd Hoc Networks (MANETs)
Influence of Clustering on the Performance of MobileAd Hoc Networks (MANETs)Influence of Clustering on the Performance of MobileAd Hoc Networks (MANETs)
Influence of Clustering on the Performance of MobileAd Hoc Networks (MANETs)Narendra Singh Yadav
 
Tree Based Proactive Source Routing Protocol for MANETs
Tree Based Proactive Source Routing Protocol for MANETsTree Based Proactive Source Routing Protocol for MANETs
Tree Based Proactive Source Routing Protocol for MANETspaperpublications3
 

Similar to distance-vector-routing-3.pdf (20)

Designing an opportunistic routing scheme for adaptive clustering in mobile a...
Designing an opportunistic routing scheme for adaptive clustering in mobile a...Designing an opportunistic routing scheme for adaptive clustering in mobile a...
Designing an opportunistic routing scheme for adaptive clustering in mobile a...
 
Network Layer
Network LayerNetwork Layer
Network Layer
 
Study of Attacks and Routing Protocol in Wireless Network
Study of Attacks and Routing Protocol in Wireless NetworkStudy of Attacks and Routing Protocol in Wireless Network
Study of Attacks and Routing Protocol in Wireless Network
 
A review of current routing protocols for ad hoc mobile wireless networks
A review of current routing protocols for ad hoc mobile wireless networksA review of current routing protocols for ad hoc mobile wireless networks
A review of current routing protocols for ad hoc mobile wireless networks
 
IJCER (www.ijceronline.com) International Journal of computational Engineerin...
IJCER (www.ijceronline.com) International Journal of computational Engineerin...IJCER (www.ijceronline.com) International Journal of computational Engineerin...
IJCER (www.ijceronline.com) International Journal of computational Engineerin...
 
Experimental Analysis Of On Demand Routing Protocol
Experimental Analysis Of On Demand Routing ProtocolExperimental Analysis Of On Demand Routing Protocol
Experimental Analysis Of On Demand Routing Protocol
 
Performance Evaluation of a Layered WSN Using AODV and MCF Protocols in NS-2
Performance Evaluation of a Layered WSN Using AODV and MCF Protocols in NS-2Performance Evaluation of a Layered WSN Using AODV and MCF Protocols in NS-2
Performance Evaluation of a Layered WSN Using AODV and MCF Protocols in NS-2
 
BETTER SCALABLE ROUTING PROTOCOL FOR HYBRID WIRELESS MESH NETWORK
BETTER SCALABLE ROUTING PROTOCOL FOR HYBRID WIRELESS MESH NETWORKBETTER SCALABLE ROUTING PROTOCOL FOR HYBRID WIRELESS MESH NETWORK
BETTER SCALABLE ROUTING PROTOCOL FOR HYBRID WIRELESS MESH NETWORK
 
An Enhanced DSR Protocol for Improving QoS in MANET
An Enhanced DSR Protocol for Improving QoS in MANETAn Enhanced DSR Protocol for Improving QoS in MANET
An Enhanced DSR Protocol for Improving QoS in MANET
 
PERFORMANCE ANALYSIS OF BROADCASTING IN MOBILE AD HOC NETWORKS USING CLUSTER ...
PERFORMANCE ANALYSIS OF BROADCASTING IN MOBILE AD HOC NETWORKS USING CLUSTER ...PERFORMANCE ANALYSIS OF BROADCASTING IN MOBILE AD HOC NETWORKS USING CLUSTER ...
PERFORMANCE ANALYSIS OF BROADCASTING IN MOBILE AD HOC NETWORKS USING CLUSTER ...
 
UNIT-3 Adhoc.pptx
UNIT-3 Adhoc.pptxUNIT-3 Adhoc.pptx
UNIT-3 Adhoc.pptx
 
ICICCE0367
ICICCE0367ICICCE0367
ICICCE0367
 
Understanding Network Routing Problem and Study of Routing Algorithms and Heu...
Understanding Network Routing Problem and Study of Routing Algorithms and Heu...Understanding Network Routing Problem and Study of Routing Algorithms and Heu...
Understanding Network Routing Problem and Study of Routing Algorithms and Heu...
 
Be31390392
Be31390392Be31390392
Be31390392
 
Essay: Mobile Ad Hoc Networks - Overview Of Routing Protocols.
Essay: Mobile Ad Hoc Networks - Overview Of Routing Protocols.Essay: Mobile Ad Hoc Networks - Overview Of Routing Protocols.
Essay: Mobile Ad Hoc Networks - Overview Of Routing Protocols.
 
Destination Aware APU Strategy for Geographic Routing in MANET
Destination Aware APU Strategy for Geographic Routing in MANETDestination Aware APU Strategy for Geographic Routing in MANET
Destination Aware APU Strategy for Geographic Routing in MANET
 
Influence of Clustering on the Performance of MobileAd Hoc Networks (MANETs)
Influence of Clustering on the Performance of MobileAd Hoc Networks (MANETs)Influence of Clustering on the Performance of MobileAd Hoc Networks (MANETs)
Influence of Clustering on the Performance of MobileAd Hoc Networks (MANETs)
 
Ijtra130510
Ijtra130510Ijtra130510
Ijtra130510
 
Tree Based Proactive Source Routing Protocol for MANETs
Tree Based Proactive Source Routing Protocol for MANETsTree Based Proactive Source Routing Protocol for MANETs
Tree Based Proactive Source Routing Protocol for MANETs
 
Md3421762181
Md3421762181Md3421762181
Md3421762181
 

More from Jayaprasanna4

Human computer Interaction ch1-the human.pdf
Human computer Interaction ch1-the human.pdfHuman computer Interaction ch1-the human.pdf
Human computer Interaction ch1-the human.pdfJayaprasanna4
 
computer Networks Error Detection and Correction.ppt
computer Networks Error Detection and Correction.pptcomputer Networks Error Detection and Correction.ppt
computer Networks Error Detection and Correction.pptJayaprasanna4
 
HUman computer Interaction Socio-organizational Issues.ppt
HUman computer Interaction Socio-organizational Issues.pptHUman computer Interaction Socio-organizational Issues.ppt
HUman computer Interaction Socio-organizational Issues.pptJayaprasanna4
 
human computer Interaction cognitive models.ppt
human computer Interaction cognitive models.ppthuman computer Interaction cognitive models.ppt
human computer Interaction cognitive models.pptJayaprasanna4
 
World wide web and Hyper Text Markup Language
World wide web and Hyper Text Markup LanguageWorld wide web and Hyper Text Markup Language
World wide web and Hyper Text Markup LanguageJayaprasanna4
 
Activity planning.ppt
Activity planning.pptActivity planning.ppt
Activity planning.pptJayaprasanna4
 
Activity planning.ppt
Activity planning.pptActivity planning.ppt
Activity planning.pptJayaprasanna4
 
Lecture 19- Multicasting.ppt
Lecture 19- Multicasting.pptLecture 19- Multicasting.ppt
Lecture 19- Multicasting.pptJayaprasanna4
 
connecting LANs.pptx
connecting LANs.pptxconnecting LANs.pptx
connecting LANs.pptxJayaprasanna4
 
session and cookies.ppt
session and cookies.pptsession and cookies.ppt
session and cookies.pptJayaprasanna4
 
connecting devices.ppt
connecting devices.pptconnecting devices.ppt
connecting devices.pptJayaprasanna4
 

More from Jayaprasanna4 (20)

Human computer Interaction ch1-the human.pdf
Human computer Interaction ch1-the human.pdfHuman computer Interaction ch1-the human.pdf
Human computer Interaction ch1-the human.pdf
 
computer Networks Error Detection and Correction.ppt
computer Networks Error Detection and Correction.pptcomputer Networks Error Detection and Correction.ppt
computer Networks Error Detection and Correction.ppt
 
HUman computer Interaction Socio-organizational Issues.ppt
HUman computer Interaction Socio-organizational Issues.pptHUman computer Interaction Socio-organizational Issues.ppt
HUman computer Interaction Socio-organizational Issues.ppt
 
human computer Interaction cognitive models.ppt
human computer Interaction cognitive models.ppthuman computer Interaction cognitive models.ppt
human computer Interaction cognitive models.ppt
 
World wide web and Hyper Text Markup Language
World wide web and Hyper Text Markup LanguageWorld wide web and Hyper Text Markup Language
World wide web and Hyper Text Markup Language
 
CI-Monte-Carlo.ppt
CI-Monte-Carlo.pptCI-Monte-Carlo.ppt
CI-Monte-Carlo.ppt
 
Activity planning.ppt
Activity planning.pptActivity planning.ppt
Activity planning.ppt
 
Cost effort.ppt
Cost effort.pptCost effort.ppt
Cost effort.ppt
 
Activity planning.ppt
Activity planning.pptActivity planning.ppt
Activity planning.ppt
 
unit-1.ppt
unit-1.pptunit-1.ppt
unit-1.ppt
 
BGP.ppt
BGP.pptBGP.ppt
BGP.ppt
 
Lecture 19- Multicasting.ppt
Lecture 19- Multicasting.pptLecture 19- Multicasting.ppt
Lecture 19- Multicasting.ppt
 
line coding.ppt
line coding.pptline coding.ppt
line coding.ppt
 
error detection.ppt
error detection.ppterror detection.ppt
error detection.ppt
 
connecting LANs.pptx
connecting LANs.pptxconnecting LANs.pptx
connecting LANs.pptx
 
CS1302 06NOV.pdf
CS1302 06NOV.pdfCS1302 06NOV.pdf
CS1302 06NOV.pdf
 
session and cookies.ppt
session and cookies.pptsession and cookies.ppt
session and cookies.ppt
 
JDBC.ppt
JDBC.pptJDBC.ppt
JDBC.ppt
 
connecting devices.ppt
connecting devices.pptconnecting devices.ppt
connecting devices.ppt
 
ARP.ppt
ARP.pptARP.ppt
ARP.ppt
 

Recently uploaded

APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...Call girls in Ahmedabad High profile
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxhumanexperienceaaa
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...RajaP95
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 

Recently uploaded (20)

APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 

distance-vector-routing-3.pdf

  • 1. EX.No 8. Simulation of Distance Vector/Link State Routing. . a) Distance Vector routing protocol ROUTING Aim: To simulate and study the link state routing algorithm using simulation using NS2. Distance Vector routing protocol Routing is the process of selecting best paths in a network. In the past, the term routing was also used to mean forwarding network traffic among networks. However this latter function is muchbetter described as simply forwarding. Routing is performed for many kinds of networks, including the telephone network (circuit switching), electronic data networks (such as the Internet), and transportation networks. This article is concerned primarily with routing in electronic data networks using packet switching technology .In packet switching networks, routing directs packet forwarding (the transit of logically addressed network packets from their source toward their ultimate destination) through intermediate nodes. Intermediate nodes are typically network hardware devices such as routers, bridges, gateways, firewalls, or switches. General-purpose computers can also forward packets and perform routing, though they are not specialized hardware and may suffer from limited performance. The routing process usually directs forwarding on the basis of routing tables which maintain a record of the routes to various network destinations. Thus, constructing routing tables, which are held in the router's memory, is very important for efficient routing. Most routing algorithms use only one network path at a time. Multipath routing techniques enable the use of multiple alternative paths. In case of overlapping/equal routes, the following elements are considered in order to decide which routes get installed into the routing table (sorted by priority): 1. Prefix-Length: where longer subnet masks are preferred (independent of whether it is within a routing protocol or over different routing protocol) 2. Metric: where a lower metric/cost is preferred (only valid within one and the same routing protocol) 3. Administrative distance: where a lower distance is preferred (only valid between different routing protocols) Routing, in a more narrow sense of the term, is often contrasted with bridging in its assumption that network addresses are structured and that similar addresses imply proximity within the network. Structured addresses allow a single routing table entry to represent the route to a group of devices. In large networks,
  • 2. structured addressing (routing, in the narrow sense) outperforms unstructured addressing (bridging). Routing has become the dominant form of addressing on the Internet. Bridging is still widely used within localized environments. Algorithm There are several variants of flooding algorithm. Most work roughly as follows: 1. Each node acts as both a transmitter and a receiver. 2. Each node tries to forward every message to every one of its neighbours except the source node. This results in every message eventually being delivered to all reachable parts of the network. Algorithms may need to be more complex than this, since, in some case, precautions have to be taken to avoid wasted duplicate deliveries and infinite loops, and to allow messages to eventually expire from the system. A variant of flooding called selective flooding partially addresses these issues by only sending packets to routers in the same direction. In selective flooding the routers don't send every incoming packet on every line but only on those lines which are going approximately in the right direction. Program: set ns [new Simulator] set nf [open out.nam w] $ns namtrace-all $nf set tr [open out.tr w] $ns trace-all $tr proc finish {} { global nf ns tr $ns flush-trace close $tr exec nam out.nam & exit 0 } set n0 [$ns node] set n1 [$ns node] set n2 [$ns node] set n3 [$ns node] $ns duplex-link $n0 $n1 10Mb 10ms DropTail $ns duplex-link $n1 $n3 10Mb 10ms DropTail $ns duplex-link $n2 $n1 10Mb 10ms DropTail $ns duplex-link-op $n0 $n1 orient right-down
  • 3. $ns duplex-link-op $n1 $n3 orient right $ns duplex-link-op $n2 $n1 orient right-up set tcp [new Agent/TCP] $ns attach-agent $n0 $tcp set ftp [new Application/FTP] $ftp attach-agent $tcp set sink [new Agent/TCPSink] $ns attach-agent $n3 $sink set udp [new Agent/UDP] $ns attach-agent $n2 $udp set cbr [new Application/Traffic/CBR] $cbr attach-agent $udp set null [new Agent/Null] $ns attach-agent $n3 $null $ns connect $tcp $sink $ns connect $udp $null $ns rtmodel-at 1.0 down $n1 $n3 $ns rtmodel-at 2.0 up $n1 $n3 $ns rtproto DV $ns at 0.0 "$ftp start" $ns at 0.0 "$cbr start" $ns at 5.0 "finish" $ns run Result: Thus the Distance Vector Routing Algorithm was Simulated and studied