An Object Oriented Approach to Data Routing in a Network Priyam

advertisement
Int. J. of Industrial and Systems Engineering , Vol. x, No. x, xxxx
An Object Oriented Approach to Data Routing
in a Network
Priyam Chatterjee
Department of Electrical Engineering,
University of California, Santa Cruz,
1156 High Street, Santa Cruz, CA 95064, USA.
E-mail: priyam@soe.ucsc.edu
Suman Chakraborty*
Department of Mechanical Engineering,
Indian Institute of Technology,
Kharagpur-721302, India.
Phone: +9103222-282990, FAX: 03222-282278,
E-mail: suman@mech.iitkgp.ernet.in
∗
Corresponding author
Abstract:
In this paper, a suitable generalized object-oriented formu-
lation is devised, which can be used to find the shortest paths between
machines for all types of networks. Use of object-oriented programming
paradigm allows the analyzer to add greater flexibilities to the programs
by modeling them as entities (called Objects) that have certain common properties (which are defined by the Class that they belong to).
Non-object oriented implementations make use of certain data structures which represent the parameters of a network (and thus its state at
any point of time). But in object oriented implementation, the classes
are modeled taking into account the physical parameters of a network.
Hence, it is not difficult to grasp the data structures used. Moreover,
c 200x Inderscience Enterprises Ltd.
Copyright 1
2
P. Chatterjee and S. Chakraborty
due to the use of object oriented methodologies, it is easier to visualize the operations in the algorithm. The same algorithm can be run
without any modification, even if network characteristics and topology
change. Addition or subtraction of routers and links can be achieved
by simple addition and subtraction of Nodes and Edges. Additionally,
for this algorithm the weighting function just needs to be changed to
incorporate the requisite changes for different types of subnets. Finally,
the algorithm is aptly illustrated by means of two representative case
studies.
Keywords:
Object Oriented methodology, routing, data network.
Biographical Notes:
Priyam Chatterjee obtained his B.Tech degree
in Information Technology from University of Kalyani and the M.Tech
degree in Electrical Engineering from the Indian Institute of Technology, Bombay in 2003 and 2006 respectively. Currently he is enrolled
as a PhD candidate in the Department of Electrical Engineering of the
University of Californa, Santa Cruz where his research interests lie in
inverse problems in image processing like image denoising, deblurring,
interpolation and super-resolution.
Dr. Suman Chakraborty is presently an associate Professor in the Department of Mechanical Engineering, IIT Kharagpur, India. His main
areas of interests encompass computational and experimental investigations on complex engineering problems. Prof. Chakraborty has authored 125+ international journal papers, and 3 text/reference books.
He has been the principal investigator of many research projects handled nationally and internationally, and has been a visting professor in
several universities in Germany and USA.
1
Introduction
In a network, data is sent from source machine to destination machine in the
form of packets that are segments of the data. In most networks the packets will
require multiple hops to make the journey. Finding a path from the source machine
An Object Oriented Approach to Data Routing in a Network
3
to the destination for the data to travel is called ‘Data Routing’. The algorithms
that choose the routes and the data structures that they use comprise the major
areas of network design. The ‘Routing Algorithm’ is that part of the network
layer software that is responsible for deciding which output line an incoming packet
should be transmitted on. If the subnet uses datagrams then the decision has
to be made anew for each incoming packet. If the subnet uses virtual circuits
internally, routing decisions are made only when a new virtual circuit is to be set
up. Thereafter, the data packets just follow the previously established route.
When a data packet is sent from a machine to another, it is expected that
the data packet will reach the destination in a finite amount of time. Often there
are other requirements that need to be fulfilled in sending the data. For example,
it may be necessary for the data to reach the destination in a certain amount of
time after which the received data does not come to use. In other cases it may be
that the user requires the data to be sent such that a minimum cost is incurred
in the transaction or that the data travels the minimum path or the most reliable
path in order to ensure correct delivery or even the path with least traffic. The
data routing algorithm has to take decisions and choose the path that fulfills these
needs. Sometimes there are hosts and routers that go down and come up repeatedly
causing changes to the topography of the network. The Data Routing algorithm
has to take these changes into account and ensure delivery of the data.
There are certain properties that are desirable in a routing algorithm, namely,
correctness, simplicity, robustness, stability, fairness and optimality (Tanenbaum,
2003). Accordingly, there are several routing algorithms that are used for data
routing in a network. These algorithms can be grouped into two major classes:
‘non-adaptive’ and ‘adaptive algorithms’. Non-adaptive algorithms do not base
their routing decisions on measurements or estimates of the current traffic and
topology. Instead, the choice of the route to use to get from any one machine to
any other machine on the network is computed in advance, offline, and downloaded
to the routers when the network is booted. This procedure is sometimes called static
4
P. Chatterjee and S. Chakraborty
routing. Adaptive algorithms, in contrast, change their routing decisions to reflect
changes in the topology, and usually the traffic as well. Adaptive algorithms differ
in where they get their information (e.g. locally, from adjacent routers or from all
routers), when they change their routes and what metric is used for optimization.
Based on the above fundamental considerations, a number of shortest path
routing algorithms have been devised. For instance, Dijkstra’s algorithm (Dijkstra,
1959) can be used to find the shortest path from a specified vertex s to another
specified vertex t. Dijkstra’s algorithm essentially labels the vertices of the given
graph (Deo, 1974). At each stage in the algorithm some vertices have permanent
labels and others temporary labels. The algorithm begins by assigning a permanent
label 0 to the starting vertex s, and temporary label to the remaining n−1 vertices.
From then on, in each iteration another vertex gets a permanent label. However, a
major disadvantage of Dijkstra’s algorithm is that the algorithm is non-adaptive.
The algorithm dos not take into account the traffic in a certain edge or link. This
requires the algorithm to be run at regular intervals of times. Another ‘simple’
algorithm, known as the flooding algorithm (Forouzan, 2003), has also been frequently used for shortest path routing. The above algorithm requires the incoming
data packet to be sent to every outgoing line (other than the line through which
the data came). This ensures that data will reach the destination using the fastest
path possible as all the possible paths are traversed. This algorithm is also sturdy
because even if some routers fail, the data packets still manage to reach the destination through other routers. To ensure that data packets do not remain in the
network infinitely age timers or data packet numbers are used. However, a major
disadvantage of this algorithm lies in the fact that an excessive amount of traffic is
generated due to multiple copies of the same data packets remaining in the network
at the same time, which is undesirable. To minimize these effects, some variations
such as selective flooding and similar other methods are used (Tanenbaum, 2003),
though such problems still exist. Out of the dynamic routing algorithms, the distance vector routing algorithm is one of the most commonly used algorithms. In this
An Object Oriented Approach to Data Routing in a Network
5
algorithm each router periodically shares its knowledge about the entire network
with its neighbours. While this algorithm is adaptive, i.e., dynamic in nature, it
suffers from a problem known as the count-to-infinity problem (Tanenbaum, 2003).
This algorithm may result in incorrect information about the network for some time
if a link goes down. Also errors may result if one or some router sends erroneous report of the network i.e. if it reports a link it does not have or does not report a link
that it has, then the topology of the network available to every router is incorrect.
Also line bandwidth has not been taken into account in taking routing decisions.
The link state algorithm (Tanenbaum, 2003) is another dynamic routing algorithm.
In link state routing, each router shares its knowledge of its neighbourhood with
every other router in the internetwork.
2
Prior Art
Data routing in a network has been the subject of research for a long time and
has gained sufficient attention due to the omni-presence of large networks carrying
huge amounts of data on a daily basis. With the ever increasing dependence on
transfer of data through networks, wired as well as wireless, efficient management of
bandwidth plays an important role in network maintenance. Efficient data routing
thus becomes an interesting and extremely important field of research in today’s
networking age. As a result, there exists a plethora of literature available that deals
with routing algorithms. Among them, the use of object oriented techniques for
simulation of broadband networks has been done by Rhee and Park (1997) . A
similar object oriented approach for large communication networks has also been
taken by Mikler, Wong and Honavar (1998). A different approach to modeling
a computer network was taken by Shi and Chen (2007). The authors propose a
discrete model for a computer network and perform network analysis using that
model. Weighted networks have also been used as a model and put to good use
for network analysis by Newman (2004). Another modeling technique for network
6
P. Chatterjee and S. Chakraborty
analysis has been applied by Capocci, Caldarelli and Paolo (2003) to networks
carrying different kinds of data flows.
In cases where certain guarantees need to be made by the underlying network it
sometimes becomes useful to calculate the optimal routing path before sending the
data. Such schemes are generally used to guarantee quality of service (QoS) to the
user because the performance of the optimal routing can be evaluated before the
connection is established. Such policies of using precalcuated routes for network
traffic management has been illustrated by Boudec and Przygienda (1995) and Orda
and Sprintson (2003). Most precomputing techniques assume that the network
remains unchanged at least for the duration of the data transfer. Once the network
changes, recacluation of the routes becomes necessary. Such an assumption can
be made in many other real world cases as well. For example, efficient routing of
vehicular traffic through a network of roads can be thought of as a data routing
problem where the data is now of the form of a vehicle. Such a case has been studied
by Jagadeesh and Srikanthan (2008) where the authors proposed a vehicular traffic
routing technique in a hierarchical manner as a combination of efficient routing
solutions in smaller subnets to form the most efficient routes. They show that their
routing algorithm is able to compare well with optimal least-cost paths. A similar
use of network topology for efficient route calculation exploiting prior knowledge
about the road (network) has been suggested by Liu and Tay (1995).
3
Network Analysis and its Present Perspectives in Engineering Education
It can be well appreciated from the preceding discussions that the key to producing a successful network model lies in understanding the relationship between
the characteristics of physical network systems and the representation of those characteristics by the elements of the network model. The efficacy and validity of the
network depends on how precisely the network can be modeled to match the real
An Object Oriented Approach to Data Routing in a Network
7
world network it represents. Shortest path analysis is used to find a route of minimum cost from one point to another along the network. If the cost is distance, then
a path of shortest distance will be calculated. This kind of analysis is particularly
useful for dispatching emergency vehicles such as fire engines. Other than distance,
one can assign other measurements such as length of travel time as a cost.
It is well known that computing shortest paths over a network is an important
task in many network and transportation related analyses. The way in which an
input network is represented and implemented in a shortest path algorithm is vital
to the performance of the algorithm. The performance of a particular shortest
path algorithm partly depends on how the basic operations in the labelling method
are implemented. Two aspects are particularly important to the performance of
a shortest path algorithm: 1) the strategies used to select the next temporarily
labelled node to be scanned, and 2) the data structures utilized to maintain the
set of labelled nodes. This source should be particularly useful for researchers and
practitioners whose research and practice are related to the use of shortest path
algorithms.
Network optimization methodologies that are commonly adopted in undergraduate engineering texts usually operate on a stand-alone basis, mainly using nonrecyclable procedural algorithms. However, while dealing with a complex openended problem such as traffic management, it is not always possible to work with
one fixed scenario or prescribe one set of decisions that can be used to optimally
solve a particular transportation engineering problem. For example, the variation of
user-behavior and time-dynamic variation in state variables should always be taken
into consideration. The decision maker must have a means by which he/she can (by
a process of trial and error, analytic or heuristic methods) converge to the optimal
set of decisions that he/she must take to generate (predict) a favourable outcome.
In most cases, the decision maker may not be interested in the internal mechanisms
of the tool and will be guided mostly by a commonsense approach, (whether the
optimization problem solution makes sense or not, for example). Hence, he or she
8
P. Chatterjee and S. Chakraborty
should not be burdened with having to know the inner details of the programs
being used. (The decision maker should work at a higher level of abstraction of the
problem.) The decision maker should understand how the algorithm works, not by
having to look at the source code, but by seeing how it works in reality and how it
can be beneficial in dynamic traffic routing. In many cases, the results of the algorithm should be used simply to corroborate intuitive (or semianalytic) findings that
were obtained by looking at various possible scenarios. Keeping the ideas described
above in mind, this paper outlines the framework of an integrated network analysis
platform that has the seamless capability of combining a wide range of analysis
and optimization methods. This approach is suggested as an alternative to the
existing procedural methodologies employed for introducing pertinent concepts to
Information Technology and engineering students and/or practising engineers.
It needs to be mentioned here that the choice of when to use an object-oriented
is still open to debate. A structured or functional approach emphasizes functionality, and does not stress the nature or structure of the data. The object oriented
approach includes both functionality as well as data. If the data is likely to change,
then using an object oriented approach is natural, such as the situations often employed in the Network Analysis problems. The key elements of any object-oriented
software design is the use of structured, efficient data structures, referred to as
objects. These objects are implemented in practice using class definitions. One
advantage of using objects to model the problem domain is that they mirror the
physical reality. The three main features of an object are listed below.
• Abstraction - the ability to protect (encapsulate) data from tampering.
• Inheritance - the ability to partly or fully emulate other classes.
• Polymorphism - The ability to perform different tasks while retaining the
same object structure (via virtual functions).
Keeping the above concepts in view, one needs to perform all calculations necessary and monitor the network performance. Simulation models can also be built
An Object Oriented Approach to Data Routing in a Network
9
using suitable control laws. Also, one must be able to perform calculations for
various scenarios to help decide on optimal Network management decisions. The
subsequent discussion is devoted to illustrate this paradigm in a simplistic and educative manner. In particular, a suitable generalized object oriented formulation is
devised that can be used to find the shortest paths between machines for all types
of networks. The algorithm may be modified slightly to suit special requirements of
each type of network. The use of object oriented programming paradigm allows the
programmer to add greater flexibility to the programs by modeling them as entities
(called Objects) that have certain common properties (which are defined by the
Class that they belong to). In the present investigation, this programming technique has been used to implement an algorithm to find the shortest path between
two nodes in a simply connected network. Due to use of this technique, the same
algorithm can be run without any modification, even if network characteristics and
topology changes. Addition or subtraction of routers and links can be achieved
by simple addition and subtraction of Nodes and Edges. Also, it is important to
note here that for different types of subnets the metric of distance calculation may
be different. For other network algorithms the change in the metric function may
require a drastic change in the algorithm or a different algorithm altogether. For
example, with the advent of higher bandwidth lines the Distance Vector Routing
algorithm had to make way for Link State Routing. However, for the present algorithm, the weighting function just needs to be changed to incorporate the required
changes. A simple graph is considered for illustration, merely because a selfloop
has no significance in a computer network. A parallel edge, however, can be tackled
using this algorithm. It can be noted that the present work attempts to generate
a flexible algorithm that will remain unchanged irrespective of the changes to the
network.
10
4
P. Chatterjee and S. Chakraborty
Development of a Generalized Methodology
In the subsequent discussion, an outline of the object-oriented approach used
for the present formulation is described. The algorithm uses a sort of heuristic
approach in determining the shortest path with some modification that attempts
to narrow down the number of possible paths to be probed. The algorithm first
determines any one path between the ‘source’ and ‘destination’. From this path, it
aims to build other paths from which the critical path is obtained.
The approach of the algorithm is to find a single path by the method that
we would use to find a path between two nodes in a graph from common logical
methods of elimination. This path can be taken as a reference from which we
converge to the critical path or the path with the least distance (taking hops as
the metric for distance calculation). From this path we aim to find other path
by proceeding backwards. Since we can always find out the adjacent routers for a
router, from every router we check if one of the adjacent routers is the destination.
If that is true, the path is formed. Otherwise, we send it to any adjacent router
that has not yet received that data. This is found by probing if the node is blocked
with respect to the data. In this way we proceed till we reach the destination. If
from any router there are no such adjacent routers that have not received the data
then we can go back to its predecessor, and retransmit the data from that router to
other adjacent routers. In this way by going backwards when we reach a dead end
we will eventually reach the source and the whole process begins afresh from the
source, by sending the data now to a different adjacent node, if any. The number
of time this process of restarting from the node is done is equal to the degree of
the source. Also if a path has a hop count of 2 (i.e. only three nodes in the path)
or less we can conclude that the critical path has been obtained. This can be done
since from the destination we first see if the destination is adjacent. If not, then the
shortest possible path cannot have a hop length less than two. Proceeding in this
way, we cover many but not all paths in seeking the critical path. Of all the paths
An Object Oriented Approach to Data Routing in a Network
Algorithm 1
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
11
Routing Protocol
if Path is not the first path then
if Previous path has distance less than 3 then
Critical path found; terminate
end if
Copy previous successful path and probe from third last node of the path
Free all nodes blocked from the node succeeding the present node
if Present node is the source then
Free all nodes
Remove the node succeeding the source from further consideration
Increment the value of pass
end if
Send data to any arbitrary adjoining free node
end if
Set present node in path and block it
if Destination is adjacent to present node then
Send data to destination; return.
end if
while Current node is not source do
Send data to arbitrary free adjacent node
if No free adjacent present then
Go to preceding node in path
Free all nodes blocked from the present node
end if
end while
Repeat from step 14 till destination is reached
probed, the shortest path i.e. the path with the smallest hop length or distance is
chosen as the critical path. The algorithm is summerized in Algorithm 1.
These steps are repeated till the value of the variable pass equals the degree of
the source. The critical path is determined as the path with the smallest distance.
In case of multiple such paths the first one is chosen. To implement the above, we
have made the use of four classes, one each for Nodes, Edges, Data and Path. The
underlying algorithm has been implemented in the function ‘get path’, which is a
member function of the class ‘Path’. The following class diagrams aptly illustrate
the architecture of the program.
• class ‘NODE’ : The members of the class ‘node’ is shown in Figure 1. The
actions of various functions, as mentioned in the above class diagram, are as
follows:
12
P. Chatterjee and S. Chakraborty
Figure 1
Members of class node
– get id() : This function returns the identification number (the value of
the private variable id for the node.
– get degree() : This function returns the degree of the node.
– set node(number, number) : This function sets the identification number
(id) and the degree of the node.
– block() : This function blocks the node. It sets the blocked variable to
TRUE.
– block(node pointer) : This function apart from setting the blocked variable to TRUE also sets the value of the blk from variable to the id of
the node from which the node has been blocked.
– unblock() : This function changes the value of the variable blocked to
FALSE.
An Object Oriented Approach to Data Routing in a Network
Figure 2
13
Members of class edge
– unblock(node pointer) : This function sets the value of the variable
blocked to FALSE only if the variable blk from contains the id of the
node from which the current node is being unblocked.
– isBlocked() : this function returns the value of the variable blocked.
– isBlocked(node pointer) : this function returns true only if the current
node has been blocked from the node sent as argument.
– get free adjacent() : this function returns any one free adjacent node.
• class ‘EDGE’ : The members of the class ‘edge’ is shown in Figure 2. The
actions of various functions, as mentioned in the above class diagram, are as
follows:
– set edge(node, node) : This function sets the end nodes of the edge.
– isLink(node, node) : this function returns TRUE if it is a link between
the two nodes sent as parameter.
– get other node(node) : This function returns a pointer to the end node
other than the one sent as a parameter.
– isEdge(node) : This function returns TRUE if one of its end nodes is
the node sent as a parameter.
14
P. Chatterjee and S. Chakraborty
Figure 3
Members of class data
Figure 4
Members of class data
• Class ‘DATA’ : The members of the class ‘data’ is shown in Figure 3. The
actions of various functions, as mentioned in the above class diagram, are as
follows:
– get src() : This function returns the source node of the data.
– get dest() : This function returns the destination of the data.
• class ‘PATH’ : he members of the class ‘path’ is shown in Figure 4. The
actions of various functions, as mentioned in the above class diagram, are as
follows:
An Object Oriented Approach to Data Routing in a Network
15
– get path(data) : This function finds path from the data source to the
data destination for the data sent as a parameter.
– show stat() : This function returns the status of the path.
– set stat(Boolean) : This function sets the Boolean value in the parameter
as the status of the path.
– set node(number, node) : This function sets the node in the parameter
in the index sent as parameter in the current path.
– get node(number) : This function returns the node at the index position
sent as parameter.
– show path() : This function shows the path.
– get dist() : This function returns the distance of the current path.
It can be noted that the above algorithm has been implemented in C++. This
algorithm can be suited to any network with only some cosmetic modifications.
The weighting function can be easily changed and the distance of the path can
be increased by the weight of the edge traversed instead of 1 per hop. This can
be done by taking as input the value of the private member ‘weight’ for the class
‘edge’. In such a situation one need not check for adjacency of the destination from
every node as a direct path may have a greater weight than a path through an
intermediate node.
5
Results
In this section we apply our object oriented algorithm to two simple networks.
We have chosen to keep the network simple enough for the reader to be easily able
to follow the data flow. In these examples, we have used unit weights for the edges.
However, this need not necessarily be the case. The weights of the edges can be
indicative of the amount of penalty (or cost) that the data incurs when traversing
through the link. It can be effectively used to manipulate the optimal route to suite
16
P. Chatterjee and S. Chakraborty
a particular user need. The weights can be a single number or even multivariate
to take into the various cost effects like time, distance, economic considerations of
sending data through a particular link, delay due to congestion etc. While the user
needs to specify how each effect is handled, our algorithm is general enough to be
able to take into account such weighted network models by inclusion of a cost factor
for the edge class. Lastly, such models readily extend to the case of vehicular traffic
routing as well.
5.1
Example 1
Let G be the network with 8 nodes and edges, as shown in Figure 5. Let the
Source and the Destination of the Data d’ be 1 and 8 respectively. Node 1 (Source)
is made the first node of the path. The algorithm first probes the destination to
check if it is adjacent to the present node (i.e. node 1). Since it is not, the data is
sent to any arbitrary adjacent (which is not blocked). For the first path, there will
always be a free adjacent of the source, since there is at least one path (we have
considered a simple connected graph). Of the two possible nodes 2 and 3, let one
suppose the data is sent to node 2. Node 2 is now blocked from node 1, and entered
into the path. From node 2, again a similar probe is made to check for adjacency
of the destination. If not, as in this case, the data are sent to node 4. From node 4,
one can send the data to any one of nodes 3, 5 or 7. Let the data be sent to node
3. Now, node 3 is blocked and set in the path from node 4. Since node 3 has no
free adjacent node, one may trace back a node to node 4, keeping node 3 blocked
and freeing any nodes blocked from node 3 (here none). From node 4, one can now
send the data to either of nodes 5 and 7. Let the data be sent to node 5. Node 5
is set in the path in place of node 3. From node 5, data are sent to node 6. Since
node 8 (destination) is adjacent to node 6, the data are sent to node 8. The path
formed is thus 1 − 2 − 4 − 5 − 6 − 8. The status of the path is now TRUE.
From this successful (status TRUE) path, one can start constructing the next
path. One may start probing the network from the third-last node of the previous
An Object Oriented Approach to Data Routing in a Network
Figure 5
17
Graph G for Example 1.
path (here node 5). All nodes blocked from the node next to the present node are
freed. Accordingly, node 8, having being blocked from node 6, is now freed. Since
node 5 has no free adjacent nodes, one may again backtrack to node 4. Node 6 is
subsequently freed. From node 4, one can now send the data to node 7 only. Node
7 is inserted in the new path. This way, one gets the path 1 − 2 − 4 − 7 − 8.
Status of the second path is now TRUE.
Again, from this second successful path, construction of the third path is begun.
As one arrives at the source, all nodes are freed and the second node of the path
is removed from consideration henceforth (i.e., node 2 here). The reason for this is
that any network having this node in any other place can never be shorter than at
least one path with the node in the second position. The rest of the algorithm goes
on as before, considering all the nodes other than node 2. Eventually, one obtains
two other paths 1 − 3 − 4 − 5 − 6 − 8 and 1 − 3 − 4 − 7 − 8. The path
1 − 2 − 4 − 7 − 8 (the first smallest path) is chosen as the Critical path.
5.2
Example 2
Another graph G is considered, with 9 nodes and edges as shown in Figure 6.
The problem is to find the shortest path between nodes 1 and 8. The source node
is numbered as 1, and probing begins from there. It is checked if the destination
is adjacent to node 1, and the data aresent to any adjacent node, i.e., any one of
nodes 2, 4 or 5. Let the data be sent to node 2. Node 2 is blocked and set as
the next node in the path, and probing begins from there. Since node 2 is not the
destination, the data are forwarded to either of the nodes 3 or 5, but not to the
18
P. Chatterjee and S. Chakraborty
Figure 6
Graph G for Example 2.
node 1, since it is blocked. Subsequently, node 3 is set in the path and blocked
from node 2. From 3, one may send the data to either 4 or 5. If the data is sent
to node 5, from node 5 one would have sent the same to node 4. However, node
5 has no other free adjacent nodes, and therefore, one may again probe from node
4. One can now send the data to any one of nodes 6, 7 or 9, for example, to
node 6 (say). From node 6, one finds that the destination node 8 is the adjacent,
and accordingly the status of the path is set to TRUE. The path thus formed is
1 − 2 − 3 − 4 − 6 − 8.
Now, from this path one starts the next path. One may start probing from the
third node to the end, i.e., from node 4. All nodes blocked from node 6 are freed.
Hence, node 8 is freed. From node 4, one can send the data to either node 7 or 9.
Choosing node 7, it is observed that node 7 is adjacent to node 8. Setting node 8
after node 7, the path is completed and the status is changed to TRUE. The second
path formed is 1 − 2 − 3 − 4 − 7 − 8. Starting from node 4 and freeing all
nodes blocked from node 7 (node 8 is freed), one may now send the data to node 9
and then to 8, thus obtaining the successful path 1 − 2 − 3 − 4 − 9 − 8.
Again, starting from node 4 and freeing node 8 (blocked from node 9), one
may begin the probing. No free adjacent nodes are present, and hence, one may
backtrack to node 3, freeing all nodes blocked from node 4 (nodes 5, 6, 7 and 9
are freed). From node 3, the data are sent to node 5. Again node 5 has no free
adjacent nodes, and therefore, probing is continued from node 3. Since node 3 also
An Object Oriented Approach to Data Routing in a Network
19
has no free adjacent nodes, one may go back to node 2, freeing nodes blocked from
node 3 (node 4 and 5 are freed). From node 2, the data are sent to node 5. Node 5
can now send the data to node 4. Following the method explained earlier, following
three paths are identified:
1 − 2 − 5 − 4 − 6 − 8
1 − 2 − 5 − 4 − 7 − 8
1 − 2 − 5 − 4 − 9 − 8
Again, starting from node 4, no free adjacent node is seen. Backtracking, one
gets a similar result from node 5 and node 2, and ultimately the source node 1 is
reached. From node 1, the value of pass is incremented from 1 to 2. Node 2 (the
second node of the paths formed so far) is not considered henceforth. From node
1, one now can send the data to either node 5 or node 4. Say, it is sent to node 4.
From node 4, one may send the data to any one of nodes 3, 5, 6, 7 or 9. Say, it is
sent to node 3. From node 3, the data are sent to node 5, from which there are no
free adjacent nodes available. Hence, one may backtrack to node 3 and to node 4,
freeing all nodes blocked from 3 (i.e., node 5). Sending the data to node 5 again,
one would still get no free adjacent node. Hence, from node 4 one may send the
data to node 6, 7 or 9. Accordingly, one obtains the following paths:
1 − 4 − 6 − 8
1 − 4 − 7 − 8
1 − 4 − 9 − 8
Backtracking from node 4, one finds no free adjacent nodes, and reaches node
1. The variable pass’ is incremented again (thus equaling the value of the degree
of node 1). Node 4 is now removed from further consideration. From node 1, the
data are sent to node 5. The algorithm terminates as one backtracks from node 5
20
P. Chatterjee and S. Chakraborty
to node 3 and then to node 1. The first shortest path 1 − 4 − 6 − 8 is chosen as
the critical path. Had the data been sent from node 1 to node 5, instead of node 4
(after removing node 2 from consideration), one would have had got different paths
to choose from. However, the end result would have been the same critical path.
The critical path is: 1 − 2 − 4 − 7 − 8.
6
Conclusions
In this paper, a methodology is devised that will enable routing decisions in
a network to be more flexible, using an object-oriented’ approach. The algorithm
can be modified for specific cases very easily. It is also adaptive in nature and can
suite itself to a wide change in the network topography without any or few changes
to the underlying algorithm. This is very conveniently achieved by changing the
weight of the edge according to the variations in the network. Since every edge has
a distance of 1, value of the distance of the path has been simply increased by one
for every node set in the path. This can be further modified to add the weight of
the edge joining the two adjacent nodes in the path. For varying weights, the data
may then, instead of being sent to an arbitrary free adjacent node, be sent to the
free adjacent node with the least weight in their connecting edge. Although these
minor variations may result in a improvement of speed, but they are perhaps only
required when the number of hops is not the only metric for the weight of the edges.
The protocol outlined as above can be easily followed and does not require too
much knowledge of the underlying data structures used. The classes are simply
models of the real components of the network and the changes done to the members of the classes reflect the changes that are done in the various components
themselves. Hence, there is a minimum difference between what happens in real
life situation in a network and what is done in the algorithm to reflect that. For
example, there are many ways of representing a network. One of the ways is by
a matrix where the value in the cell (i, j) is essentially the distance between the
An Object Oriented Approach to Data Routing in a Network
21
ith and the jth node of the network. But, there is no resemblance with the matrix
structure to that of the network. This makes using such Object methodologies a
much suitable candidate for teaching of routing protocols at undergraduate levels, and it is expected that these would emerge as promising educational tools for
Network analysis problems in the years to come.
Acknowledgements
The authors would like to acknowledge the many helpful suggestions of the
reviewer that have helped us in improving this paper.
References and Notes
Boudec, J.-Y. L. and Przygienda, T. (1995). A Route Pre-Computation Algorithm
for Integrated Services Networks, Journal of Network and Systems Management
3(4): 427–449.
Capocci, A., Caldarelli, G. and Paolo (2003). Quantitative description and modeling of real networks, Physical Review E (Statistical, Nonlinear, and Soft Matter
Physics) 68(4).
Deo, N. (1974). Graph Theory with Applications to Engineering and Computer Science, Prentice Hall Series in Automatic Computation, Prentice-Hall, Inc., Upper
Saddle River, NJ, USA.
Dijkstra, E. W. (1959). A Note on Two Problems in Connexion with Graphs,
Numerische Mathematik 1: 269–271.
Forouzan, B. A. (2003). Data Communications and Networking, 3 edn, McGrawHill, Inc., New York, NY, USA.
22
P. Chatterjee and S. Chakraborty
Jagadeesh, G. and Srikanthan, T. (2008). Route Computation in Large Road Networks: A Hierarchical Approach, IET Intelligent Transport Systems 2(3): 219–
227.
Liu, B. and Tay, J. (1995). Using Knowledhe about the Road Network for Route
Finding, Proceedings of the 11th Conference on Artificial Intelligence for Applications, Washington, D.C., USA, pp. 306–312.
Mikler, A. R., Wong, J. S. K. and Honavar, V. (1998). An Object-Oriented Apparoach to Similating Large Communication Networks, Journal of Systems and
Software 40(2): 151–164.
Newman, M. E. J. (2004). Analysis of Weighted Networks, Physical Review E
70(5): 056131.
Orda, A. and Sprintson, A. (2003). Precomputation Schemes for QoS Routing,
IEEE/ACM Transactions on Networking 11(4): 578–591.
Rhee, Y. and Park, S. J. (1997). Object Oriented Modelling and Sumlation for
Broadband Network Design, Simulation Practice and Theory 5(5): 405–424.
Shi, Y. and Chen, G. (2007). A discrete computer network model with expanding
dimensions, ArXiv e-prints 705.
Tanenbaum, A. S. (2003). Computer Networks, 4 edn, Prentice Hall, Upper Saddle
River, NJ.
Download