Routing Simulator
Routing Simulator
Introduction
Routing
A simple definition of routing is "learning how to get from here to
there." In some cases, the term routing is used in a very strict sense to refer
only to the process of obtaining and distributing information, but not to the
process of using that information to actually get from one place to. Since it is
difficult to grasp the usefulness of information that is acquired but never used, we
employ the term routing to refer in general to all the things that are done to
discover and advertise paths from here to there and to actually move packets
from here to there when necessary. The distinction between routing and
OSI end systems and intermediate systems, in which context the distinction is
meaningful.
from a source to a destination. Along the way, at least one intermediate node
to every destination in the network. It allows users in the remote part of the
they both must make decisions as to how to send the packet. To do this, the
router and the host consult a database for information known as the routing table.
This database is stored in RAM so that the lookup process is optimized. As the
packet is forwarded through various routers towards its destination, each router
destination point or destination Network , and the second is the address of the
next element that is the next hop in the "best" path to its destination. When a
packet arrives at a router the router or the switch controller consults the routing
table to decide the next hop for the packet. Not only the local information but
the global information is also consulted for routing. But global information is hard
ways. The first method is to manually configure the routing table with routes for
each destination network. This is known as static routing. The second method for
A dynamic routing protocol consists of routing tables that are built and maintained
Routing Table
or on demand, messages are exchanged between routers for the purpose of
Router
The Network forwards IP packets from a source to a destination using
destination address field in the packet header. A router is defined as a host that
Every router along the path has routing table with at least two fields:
introducing routers with interfaces on more than one cluster, we can connect
clusters into larger ones. By induction we can compose arbitrarily large networks
in this fashion, as long as there are routers with interfaces on each subcomponent
of the Network.
2.3 1.3
2.1
1.2
Router
3.3
Network 3
3.1
A router which has interface on more than one Network
Packet
addresses, data length, sequence number and data type. The introduction of
cannot determine where samples originate, or where they are going without
allowing the network to interpret the data without additional context information.
matter where in the network the packet is, the Network knows where it came
from and where it wants to go. The Network can store a packet, for hours if
necessary, then "freeze" it and still know what has to be done to deliver the data.
Packets are efficient for data transfer, but are not so attractive for real-time
Link
Link is the connection between two routers. If there are two routers
the messages are sent from one to other using the link. So link acts as a bridge
between two routers. If a link goes down then information will not be transferred
to the routers. We have to search for the other alternative links to reach from
source to destination. Hence link plays a major role in the transmission of data as
each node. The heart of routing algorithm does all the chores.
Choices in Routing
design goals
Routing algorithms often have one or more of the following :
Optimality
the best route, which depends on the metrics and metric weightings used to make
the calculation. One routing algorithm, for example, may use a number of hops
and delays, but may weight delay more heavily in the calculation. Naturally,
algorithm must offer its functionality efficiently, with a minimum of software and
implementing the routing algorithm must run on a computer with limited physical
resources.
routers are located at network junction points, they can cause considerable
problems when they fail. The best routing algorithms are often those that have
withstood the test of time and have proven stable under a variety of network
conditions.
Rapid convergence
routes and eventually causing all routers to agree on these routes. Routing
algorithms that converge slowly can cause routing loops or network outages.
Flexibility
bandwidth, router queue size, and network delay, among other variables.
Factors that decide the best path
the best route. Sophisticated routing algorithms can base route selection on
multiple metrics, combining them in a single (hybrid) metric. All the following
Path Length
link. In this case, path length is the sum of the costs associated with each link
traversed. Other routing protocols define hop count, a metric that specifies the
number of passes through internetworking products, such as routers, that a
Reliability
link. Some network links might go down more often than others. After a network
fails, certain network links might be repaired more easily or more quickly than
other links. Any reliability factors can be taken into account in the assignment of
the reliability ratings, which are arbitrary numeric values usually assigned to
Delay
factors, including the bandwidth of intermediate network links, the port queues at
each router along the way, network congestion on all intermediate network links,
Bandwidth
necessarily provide better routes than routes through slower links. If, for
example, a faster link is busier, the actual time required to send a packet to the
Load
Communication Cost
some companies may not care about performance as much as they care about
operating expenditures. Even though line delay may be longer, they will send
packets over their own lines rather than through the public lines that cost money
route is computed in advance, offline and downloaded to the routers when the
algorithms are obvious: They can provide substantially better throughput and
reliability.
routing hierarchies. In a flat routing system, the routers are peers of all others.
where they are sent through the backbone until they reach the general area of
the destination. At this point, they travel from the last backbone router through
determine the entire route. This is usually referred to as source routing. In source-
sending the packet to the next stop. Other algorithms assume that hosts know
nothing about routes. In these algorithms, routers determine the path through
the internetwork based on their own calculations. In the first system, the hosts
have the routing intelligence. In the latter system, routers have the routing
intelligence.
within and between domains. The nature of these two algorithm types is
the status of each link and processes this information to compute a routing table
for every node. It then distributes these tables to all the routers. In
Flooding
Hot-Potato
Source Routing
Linkstate
Flooding
Every incoming packet is sent out on every other link by every
Interesting to note that all routes are discovered, including the optimal one, so
this is robust and high performance (best path is found without being known
Could try to ensure that each router only floods any given packet once. Could try
to be a little more selective about what is forwarded and where. The station
initiating a packet stores the distance of the destination in the submitted packet
(or the largest distance in the network). Each node reduces the counter by one,
and resubmits the packet to all the adjacent nodes (but not to the node from
where it received the packet). Packets with counter 0 are discarded. The
HOP1
HOP2
HOP3
Stages in Flooding
Advantages:
Highly robust
Suitable for setting virtual circuits
Useful for broadcasting
Disadvantage:
network have no buffer to store packets in before they are moved on to their final
predetermined destination. In normal routing situations, when multiple packets
contend for a single outgoing channel, packets that are not buffered are dropped
to avoid congestion. But in hot potato routing, each packet that is routed is
constantly transferred until it reaches its final destination because the individual
communication links can not support more than one packet at a time.
moving further away from its destination because it has to keep moving through
the network. This technique allows multiple packets to reach their destinations
without being dropped. This is in contrast to "store and forward" routing where
transit, thus causing the messages to move from node to node each time. In
Real Networks
Immediate applications
Optical Networks
Non-optical networks
specify the route that a packet should take through the network. As a packet
travels through the network, each router will examine the "destination IP address"
and choose the next hop to forward the packet to. In source routing, the "source"
In strict source routing, the sender specifies the exact route the
which the sender gives one or more hops that the packet must go through. In
To : A
From : D
Via : T
Used with trace route in order to find all the routes between points on the
network.
Troubleshooting
Trying to figure out from point "A" why machines "F" and "L" cannot talk with
each other.
Performance
Hacking
Sometimes machines will be on the Internet, but will not be reachable. (It may
be using a private address like 10.0.0.1). However, there may be some other
machine that is reachable to both sides that forwards packets. Someone can then
reach that private machine from the Internet by source routing through that
intermediate machine.
Distance Vector
(Also known as Bellman-Ford or Ford-Fulkerson)
The heart of this algorithm is the routing table maintained by each
router. The table has an entry for every other router in the subnet, with two
pieces of information: the link to take to get to the router, and the estimated
distance from the router. For a router A with two outgoing links L1, L2, and a
total of four routers in the network, the routing table might look like this:
B 5 L1
C 7 L1
D 2 L2
update each other on the state of the subnet (which makes this a dynamic
your path, you start using that neighbor as the route to that node. Notice that
you don't actually know the route the neighbor thinks is shorter - you trust his
that uses hop count as its metric. RIP is widely used for routing traffic in the
global Internet and is an interior gateway protocol (IGP), which means that it
distance vectors every 30 sec, and a router is declared dead if a peer does not
hear from it from 180 sec. The protocol uses split horizon with poisonous reverse
the network topology changes. When a router receives a routing update that
includes changes to an entry, it updates its routing table to reflect the new route.
The metric value for the path is increased by one, and the sender is indicated as
the next hop. RIP routers maintain only the best route (the route with the lowest
metric value) to a destination. After updating its routing table, the router
of the change. These updates are sent independently of the regularly scheduled
of stability features that are common to many routing protocols. RIP, for
Applications
having everybody share their idea of the state of the net with everybody else
constructed).
Neighbor discovery
Measure delay
arises: do you include time spent waiting in the router (i.e. load factor of the
Put information for all your neighbors together, along with your own
simultaneously. This can't happen, so in effect you have different parts of the
subnet with different ideas of the topology of the net at the same time. Changes
ripple through the system, but routers that are widely spread can be using very
different routing tables at the same time. This could result in loops, unreachable
information packets from other routers, every router can locally compute a
Advantages
problem of misconfigured, "crazy" routers suddenly trying to tell the world that
they are the center of the universe and are directly connected to a wormhole time
travel machine. It also helps prevent malicious attacks on networks via their
routing tables.
a subnet efficiently, one has to select a better routing technique among the
outright choice for all possible cases. So an attempt is made to provide such
Where
η i is Efficiency of Router i
1. The topology of the subnet should be displayed with routers designated with
links.
3. Various Statistics for the router like efficiency, average packet size are to be
4. Statistics for the link like propagation delay, buffers filled are to be displayed
5. A provision for router crash is required which should show an outline when a
router is crashed.
6. When a link is down, it should be highlighted. This gives an idea of how the
7. The statistics for the router and the link are to be calculated for every 500 m
sec.
In the design phase we identify the different objects that are required
Router
consults the routing algorithm and places the appropriate packets on the link
buffer from which packets are placed on the link and transmitted. The router at
the other end of the link picks up the packets from the link buffer and places them
in its buffer. From the router's buffer packets are processed. Processing includes
checking if the packet is destined to that router or not. If yes the router reads the
message and sends acknowledgement else it sends it to the router buffer from
Id of router
Size of Network
Simcore object
Buffer object
Routing Algorithm
Router Status
Checking Probability
Threshold
Start Delay
Sleep Time
Router
Route
Generate Crash Receive Consult
Next
Packet Router Packet RouteAlgo
Packet
at both ends of a link in which packets are placed while routing. The link transmits
the packets based on the propagation delay specified. According to the delay the
packets are sent immediately to the next router or delayed in the link buffer.
When the state of a link is up transmission occurs. If the link goes down packets
Head Packet
Tail Packet
Queue Size
Propagation Time
Bit Rate
Status of Link
Link
Remove
Add Transfer
Packet
Packet Packet
Routing Algorithm
Processing of Packet
If the packet is for that router, we can use this method to send some kind of hello
messages or replies.
Route
Select Process
Packet
Packet Packet
the router. The router generates packets that are transmitted through a link. The
packets are dummy entities and are just required to know that the path given by
the routing algorithm is followed or not. The rate of transfer of packets depends
Packet Source
Packet destination
Fragment Offset
Total Size
Creation Time
Next Router
Hop count
Fragment Flag
Fragmented Flag
Fragment
If the size of the packet is large as compared with the size of the
buffers, the packet is divided into number of fragments. These fragments are
numbered and are placed on links for transmission. At the other end of the buffer,
Sequence number
Fragment Number
Fragment Size
Fragment
This acts as the project manager and is the heart of the Simulator. It
takes the input from the input file and initializes the routers and links based on
packets are generated and lost. It consults the routing algorithm and decides the
path and gives instructions to the packets in the buffers about the paths. Based
back to normal state. It checks each and every condition of every other object in
the system and takes decisions accordingly. It is responsible for drawing the
Header Size
Head of linked list containing packets which are on their path on a link
Tail of linked list containing packets which are on their path on a link
Lost History
Gross Lost - lost but duplicate of packet may have reached destination
Throughput
Network
Configuration
Process
Manage
ROUTE r ROUTE
R R
Level 0
NETWORK
CONFIGURATION
Input
Manager
Input Input
ROUTE ROUTE
R R
Process
Generat
ePackets
Packets
Generat
Send
Packets e Ack.
Ack. Pkts
Pkts
BUFFERS OF ROUTERS
AND LINKS
Level 1
CONFIGURATION
Input
Manager
LINK
ROUTER
Level 1
Set
Size of
Subnet
Set
Prob.
of router
down
ROUTER
Set Size
of Buffer
Set
Topolog
y
INPUT
CONFIGURATION
Set
Bit Rate
Set
Propaga
-tion
delay
Set Prob
LINK
of
Packet
loss on
Link
Set
Prob. of
Link
down Level 2
BUFFER FOR
INCOMING LINK
L1
Generate Add
Packets Packets to
buffers
from ICL
Consult
R.A and
Process
Packets
BUFFERS OF OUT
GOING LINK L2
Level 2
Request from
Router i Buffer for incoming link
Generat Add
e Packets
Packets to
Router
Request from
Router i
Consult
Routing
Algo
Information Select a
from Links Packet
to be
routed
Route Process
the Packets
Packets
Place on
out
Generat
going
e Ack’s
Links
Level 3
Implementation
Software Used
applications that confirm to the Java core API. Its compiler and other tools are
Java Tools :
codes.
Similar to Java interpreter, but intended for end users who do not
tool.
Java source files and produces a set of HTML pages describing the
Combine many Java class files and other resources into a single jar
file
User Documentation
Requirements :
File "Inp" which contains the name of the file where we can find the data
required for the Network. An Example File is provided with comments, which
How to Run
Just open the file "init.java" and change the string "RoutingAlgo" to name of
Now you are ready with all the files to be run. Just type in "appletviewer
Simcore.html". You will now see a Frame opened with the Topology of the
Network and a table showing the size of buffers filled in the link (i, j).
Operating
Once the simulator has started you can see the Topology of the Network that
is provided in the Input file, with the routers designated with computer
images.
You can look at the statistics of the Router just by Left Clicking on the router.
The statistics are shown on a different frame whose values are updated after
every 500ms. Similarly clicking on the corresponding entry in the table you
For the process of evaluating the Routing Algorithm one can even crash the
There are Two modes of operating the Simulator one is interactive and the
between (y/n). In the interactive mode the user can get the information about
the packets generated and the current process going on in the simulator, from
the console, i.e., This information is outputted on the console. And in the non-
interactive mode nothing is printed on the console only the statistics of the
system are correct the goal will be successfully achieved. System Testing is
related to one another and interact in a total system. Each portion of the system
portion of the entire system is tested against the entire module with both test and
1. Online - Response
When the mouse is clicked on the router the statistics of the router
are to be displayed on the screen. Likewise the statistics of the link are to be
displayed when congestion table is clicked. The router must crash immediately
when it is right clicked with the mouse. The congestion table must be redrawn
2. Stress Testing
The purpose of stress testing is to prove that the system does not
malfunction under peak loads. In the simulator we test for the working of all
threads, that are associated with different objects. The different threads are
router threads, link threads, table filling threads, threads for warning messages
are tested simultaneously. All the routers are purposely crashed to generate a
peak load
condition and the working is tested. The number of routers is also increased for
testing.
The usability test verifies the user friendly nature of the system. The
And
Future Scope
Conclusion
gives the different statistics of the routers and links. By changing the routing
algorithms and the different network configurations and recording the results we
obtain the optimal algorithm. The optimal algorithm for a particular network is
Simulator has provision for the crashing of routers, it gives an idea of which path
the performance of routers and links. As it not feasible in real networks to test
algorithms and then implement a best one, Routing Simulator can be helpful.
Hence it is useful for people who provide networking services and those who
design networks.
Future Scope
Our Routing Simulator model can be made a more realistic one by considering the
Even though the mathematical model established for efficiency of Subnet yields
This has the potential to be used as one of the tools for experimentation on