Вы находитесь на странице: 1из 6

International Journal on Recent and Innovation Trends in Computing and Communication

ISSN 2321 8169

Volume: 1 Issue: 5

479 484

Optimization of Dijkstra’s Algorithm

Charika Jain,

charikajain17@gmail.com

Amity School of Engg & Tech, Amity University Rajasthan

Dr. Jitendra Kumawat

Sokil_jitu@yahoo.com Amity School of Engg & Tech, Amity University Rajasthan

Abstract: - Computer networks have progressed to a complex communication infrastructure from a simple store and forward medium. In the network, routers need to implement a variety of functions ranging from simple packet classification for forwarding and firewalling to complex payload modifications for encryption and content adaptation. As these functions increase in number and complexity, more processing time is required, and packets experience a significant processing delay. In most routing algorithms, this delay has not been addressed because it was considered negligible. However, this network processing delay has reached the magnitude of long-distance propagation delay and thus becomes a significant contributor to the overall packet delay. Thus this paper optimize the dijkstra’s algorithm and calculate the shortest path considering the processing delay, and have less number of hops in the shortest path. The contributions of this work can be used to increase the accuracy of network simulation and improve network performance estimations.

Index Terms: Communication network, Processing delay, Routing and Hop count

1.INTRODUCTION

*****

The internet has progressed to a more composite communication infrastructure from a simple store-and- forward network. To meet demands on performance, security, and flexibility, network traffic not only needs to be forwarded, but also processed inside the network. This packet processing is done on routers (mainly edge devices) and not on the end systems. Examples of protocols and applications that require such additional processing are network address translation (NAT)[1], firewalling[2], and virtual private network (VPN) tunnelling. The processing required for VPN termination is considerable as it requires the use of cryptographic algorithms (e.g., Advanced Encryption Standard (AES) [3]). There is also a drift towards more complex services, which demand even more intense processing, like virus scanning, content adaptation for wireless clients, or ad insertion in web page requests. In particular, the need for security in today’s Internet is leading towards additional processing on edge and access routers where traffic can be filtered and blocked if needed. This trend in the direction of increasing computation will continue as more security features and services will have to be implemented in the future. In this paper we will add this delay of processing with the propagation cost for calculating the cost to route packet from one router to another router.

Routers require more time to forward packets, due to the increasing complexity of processing. The required performance is achieved by processing many packets in parallel on the set of processor cores. This improves the overall router throughput and supports increasing link speeds. Individual packets, however, observe increasing delays because they are processed on a single processing core. Together with the increasing complexity of packet handling, this causes the processing

IJRITCC | May 2013, Available @ http://www.ijritcc.org

on

important.

delay

networks

nodes

to

become

increasingly

Hop count [4] correctly captures network cost as it measures the number of links over which network resources are expended. For example, a path that has been guaranteed a minimum available bandwidth on each one of the link it traverses. Hence, the longer the path, the more expensive in terms of the total amount of network resources that are consumed. As a result, minimizing path length, or hop count, is a natural criterion for computing proficient paths for traffic with definite service requirements.

This paper optimizes dijkstra’s algorithm and find the shortest path based on processing delay criteria. To demonstrate the impact of processing delay, we briefly discuss the various network delays that contribute to the overall packet delay. When sending a packet from one node to another, the various delays occur are: (1) transmission delay (the time it takes to send the packet onto the wire), (2) propagation delay (the time it takes to transmit the packet via the wire), (3) processing delay (the time it takes to handle the packet on the network system), and (4) queuing delay (the time the packet is buffered before it can be sent). Table I shows a simple back-of-the- envelope calculation for these delay components for a 1Gbps link, a 1250 byte packet and a 200 km link. In most cases, the key contributors of delay are (2) and (4) and are therefore considered in simulation and measurements. The transmission delay (1) is usually small for fast links and small packets and is therefore not considered. Traditionally, the processing delay (3) has been neglected (as shown in column “Simple Packet

479

International Journal on Recent and Innovation Trends in Computing and Communication

ISSN 2321 8169

Volume: 1 Issue: 5

479 484

Forwarding”). We show, however, that this is not the case anymore as packet processing on routers becomes more complex. The measurements and simulations indicate that packet processing can take considerable time when payload modifications are involved. Encryption of a single packet, for example, can take in the order of milliseconds, which contributes as much as 50% of the overall packet delay (as shown in column “Complex Payload Modifications” in Table I).

in column “Complex Payload Modifications” in Table I). T ABLE 1[5] NETWORKING DELAY COMPONENTS. A 1GB/S

TABLE 1[5]

NETWORKING DELAY COMPONENTS. A 1GB/S LINK, 1250 BYTE PACKET, 100MIPS PROCESSOR, AND LINK DISTANCE OF 200KM ARE ASSUMED.

2. EARLIER WORK

Dijkstra’s Algorithm was created in 1959 by Dutch computer scientist Edsger Dijkstra. While employed at the Mathematical Centre in Amsterdam, Dijkstra was asked to demonstrate the powers of ARMAC, a sophisticated computer system developed by the Mathematical Centre. Part of his presentation involved illustrating the best way to travel between two points and in doing so, the shortest path algorithm was created. It was later renamed Dijkstra’s Algorithm in recognition of its creator.

Dijkstra’s Algorithm is a graph search algorithm that solves the single-source shortest path problems for a graph with non negative edge path costs, producing a shortest path tree. This algorithm is often used in routing and other network related protocols.

For a given source vertex (node) in the graph, the algorithm finds the path with lowest cost (i.e. the shortest path) between that vertex and every other vertex. It can also be used for finding costs of shortest paths from a single vertex to a single destination vertex by stopping the algorithm once the shortest path to the destination vertex has been determined. For example, if the vertices of the graph represent cities and edge path costs represent driving distances between pairs of cities connected by a direct road, Dijkstra’s algorithm can be used to find the shortest route between one city and all other cities.

IJRITCC | May 2013, Available @ http://www.ijritcc.org

Algorithm:

| May 2013, Available @ http://www.ijritcc.org Algorithm: We want to find the shortest path from node

We want to find the shortest path from node A to F using Dijkstra’s algorithm.

shortest path from node A to F using Dijkstra’s algorithm. Node A is designated as current

Node A is designated as current node. We set distance(A) = 0 which indicates that we have found a path from s to s of total weight 0 (the path with no edges). For any other vertex v we set distance (v) = ∞ since we haven’t even verified that an A − v path exists.

480

International Journal on Recent and Innovation Trends in Computing and Communication

ISSN 2321 8169

Volume: 1 Issue: 5

479 484

2321 – 8169 Volume: 1 Issue: 5 479 – 4 84 The smallest distance is distance(A)

The smallest distance is distance(A) = 0, we remove A from Q, indicating that distance(A) = 0 represents the smallest possible total weight of a path from A to A :

We examine the edges that leave A. The edge AB gives

us a path of cost 12 from A to B so we change distance(B)

= 12. Likewise, we change distance(C) and distance(D)

from ∞ to the smaller value 30 and 11 respectively; The smallest value of distance is 11, which happens at D so we follow A to D path. Thus darkening the AD edge.

at D so we follow A to D path. Thus darkening the AD edge. The edge

The edge DB has weight 12, tells us we can get from A to

B for a cost of

Distance(D) + distance_between(DB) = 11 + 12 = 23,

which is more than 12. We leave distance(B) at 12. The edge DE has weight 11, tells us we can get from A to E for a cost of

distance(D) + distance_between(DE) = 11 + 11 = 22,

which is less than ∞, so we change distance on E so that distance(E) = 22. The edge DC has weight 23, tells us we can get from A to C for a cost of

distance(D) + distance_between (DC) = 11 + 23 = 34,

which is more than 30, We leave distance(C) at 30.

IJRITCC | May 2013, Available @ http://www.ijritcc.org

The smallest distance = 12, so we darken edge AB:

The smallest distance = 12, so we darken edge AB: Now we reexamine the distance of

Now we reexamine the distance of neighbours of B:

Recalculate BC and BD. The minimum occur at DE

of B: Recalculate BC and BD. The minimum occur at DE Recalculate EC and EF. The

Recalculate EC and EF. The minimum occur at BC.

BC and BD. The minimum occur at DE Recalculate EC and EF. The minimum occur at

Recalculate CF. The minimum is CF.

481

International Journal on Recent and Innovation Trends in Computing and Communication

ISSN 2321 8169

Volume: 1 Issue: 5

479 484

2321 – 8169 Volume: 1 Issue: 5 479 – 4 84 Thus we get the shortest

Thus we get the shortest path from A to F with the cost of 40. The path is A -> B -> C -> F.

3. PROPOSED WORK

Let us now consider what can happen to a packet as it travels from its source to its destination. A packet starts in a host (the source), passes through a series of routers, and ends its journey in another host (the destination). As a packet travels from one node (host or router) to the subsequent node (host or router) along this path, the packet suffers from several different types of delays at each node along the path. The most important of these delays are the nodal processing delay, queuing delay, transmission delay and propagation delay; together, these delays accumulate to give a total nodal delay. This paper proposed an algorithm in which the processing delay, which was neglected by dijkstra’s algorithm, is also added for calculating the cost at each router. Thus, this algorithm chooses the path with less number of hops.

Algorithm:

Initialization and everything is same in this algorithm except the formula to calculate the dictance to each node.

for each neighbor v of u:

alt := dist[u] + dnodal; // where dnodal is the processing delay at node if alt < dist[v]:

dist[v] := alt ; previous[v] := u ; decrease-key v in Q; end if end for

where,

dnodal

= dproc + dqueue + dtrans + dprop

To simplify the analysis of network delay times, the packet delay is broken up into a sequence of nodal delays. Each nodal delay is the time between the arrival of a

IJRITCC | May 2013, Available @ http://www.ijritcc.org

packet at a node and its arrival at the next node. The above equation decomposes the nodal delay into components that are simpler to analyze.

the nodal delay into components that are simpler to analyze. Fig 1: Nodal Processing Delay Delay

Fig 1: Nodal Processing Delay

Delay components:

1. Processing delay: integrity checking, routing, etc.

2. Queuing delay: Waiting in output buffer prior to

transmission. Variable. 3. Transmission delay: Getting the entire packet “out the door.” Let packet contain L bits and link transmission rate be R b/s. Transmission delay is then L/R. 4. Propagation delay: Time for one bit to traverse the medium between two switches.

example:

Now the same example is taken so that a comparison can

be

Firstly the distance of A is 0, it is same as of dijkstra’s algorithm.

made.

Assume dnodal=1

We examine the edges that leave A. The edge AB gives us a path of cost 13 from A to B so we change distance(B) = 13. Likewise, we change distance(C) and distance(D) from ∞ to the smaller value 31 and 12 respectively:

The smallest value of distance is 12, which happens at D so we follow A to D path. Thus darkening the AD edge.

The smallest value of distance is 12, which happens at D so we follow A to

482

International Journal on Recent and Innovation Trends in Computing and Communication

ISSN 2321 8169

Volume: 1 Issue: 5

479 484

The edge DB has weight 12, tells us we can get from A to B for a cost of

Distance(D) + distance_between(DB) + p = 11 + 12 + 1=

24,

which is more than 13. We leave distance(B) at 13. The edge DE has weight 11, tells us we can get from A to E for a cost of

distance(D) + distance_between(DE) + p = 11 + 11 + 1 =

23,

which is less than ∞, so we change distance on E so that distance(E) = 23. The edge DC has weight 23, tells us we can get from A to C for a cost of

distance(D) + distance_between (DC) + p = 11 + 23 + 1 =

35,

which is more than 30, We leave distance(C) at 31.

The smallest distance = 13, so we darken edge AB:

at 31. The smallest distance = 13, so we darken edge AB: Now we reexamine the

Now we reexamine the distance of neighbours of B:

Recalculate BC and BD. The minimum occur at DE

of B: Recalculate BC and BD. The minimum occur at DE Recalculate EC and EF. The

Recalculate EC and EF. The minimum occur at BC.

IJRITCC | May 2013, Available @ http://www.ijritcc.org

BC. IJRITCC | May 2013, Available @ http://www.ijritcc.org Recalculate CF. The distance from CF and DF

Recalculate CF. The distance from CF and DF is same so no changes occur. The minimum is DF.

CF and DF is same so no changes occur. The minimum is DF. Thus we get

Thus we get the shortest path from A to F with the cost of 43. The path is A -> D -> F.

CONCLUSION

This paper optimizes dijkstra’s algorithm. The optimization is based on nodal processing delay. This delay is becoming increasingly significant as networks implement more and more complex protocol processing on routers. This paper adds the processing delay at each router it visits for calculating the cost from source to destination. By reducing the number of hops in path between source and destination the total amount of network resources are also reduced. Thus this optimizes dijkstra’s algorithm.

REFERENCES

[1] K. B. Egevang and P. Francis, “The IP network address translator (NAT),” Network Working Group, RFC 1631, May 1994.

[2] J. C. Mogul, “Simple and flexible datagram access controls for UNIXbased gateways,” in USENIX Conference Proceedings, Baltimore, MD, June 1989, pp. 203221.

[3] Advanced Encryption Standard (AES), National Institute of Standards and Technology, Nov. 2001, fIPS

197.

483

International Journal on Recent and Innovation Trends in Computing and Communication

ISSN 2321 8169

Volume: 1 Issue: 5

479 484

[4]Roch Guerin and Ariel Orda, “Computing shortest paths for any number of hops”.

[5]Ramaswamy Ramaswamy, Ning Weng and Tilman Wolf, “Characterizing Network Processing delay”.

 

484

IJRITCC | May 2013, Available @ http://www.ijritcc.org