+ All Categories
Home > Documents > Case Study of Various Routing Algorithm

Case Study of Various Routing Algorithm

Date post: 23-Nov-2015
Category:
Upload: vijendra-solanki
View: 13 times
Download: 1 times
Share this document with a friend
Popular Tags:
30
Case study of various routing algorithm a router is used to manage network traffic and find the best route for sending packets. But have you ever thought about how routers do this? Routers need to have some information about network status in order to make decisions regarding how and where to send packets. But how do they gather this information? Routers use routing algorithms to find the best route to a destination. When we say "best route," we consider parameters like the number of hops (the trip a packet takes from one router or intermediate point to another in the network), time delay and communication cost of packet transmission. Based on how routers gather information about the structure of a network and their analysis of information to specify the best route, we have two major routing algorithms: global routing algorithms and decentralized routing algorithms. In decentralized routing algorithms, each router has information about the routers it is directly connected to -- it doesn't know about every router in the network. These algorithms are also known as DV (distance vector) algorithms Dijkstra's algorithm
Transcript

Case study of various routing algorithm

a router is used to manage network traffic and find the best route for sending packets. But have you ever thought about how routers do this? Routers need to have some information about network status in order to make decisions regarding how and where to send packets. But how do they gather this information?Routers use routing algorithms to find the best route to a destination. When we say "best route," we consider parameters like the number of hops (the trip a packet takes from one router or intermediate point to another in the network), time delay and communication cost of packet transmission.

Based on how routers gather information about the structure of a network and their analysis of information to specify the best route, we have two major routing algorithms: global routing algorithms and decentralized routing algorithms. In decentralized routing algorithms, each router has information about the routers it is directly connected to -- it doesn't know about every router in the network. These algorithms are also known as DV (distance vector) algorithms

Dijkstra's algorithm

Dijkstra's algorithm runtime

Dijkstra's algorithm, conceived by Dutch computer scientist Edsger Dijkstra in 1959,[1] is a graph search algorithm that solves the single-source shortest path problem for a graph with nonnegative edge path costs, producing a shortest path tree. This algorithm is often used in routing. An equivalent algorithm was developed by Edward F. Moore in 1957.[2]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. As a result, the shortest path first is widely used in network routing protocols, most notably IS-IS and OSPF (Open Shortest Path First).

AlgorithmLet the node we are starting be called an initial node. Let a distance of a node Y be the distance from the initial node to it. Dijkstra's algorithm will assign some initial distance values and will try to improve them step-by-step.1. Assign to every node a distance value. Set it to zero for our initial node and to infinity for all other nodes.2. Mark all nodes as unvisited. Set initial node as current.3. For current node, consider all its unvisited neighbours and calculate their distance (from the initial node). For example, if current node (A) has distance of 6, and an edge connecting it with another node (B) is 2, the distance to B through A will be 6+2=8. If this distance is less than the previously recorded distance (infinity in the beginning, zero for the initial node), overwrite the distance.4. When we are done considering all neighbours of the current node, mark it as visited. A visited node will not be checked ever again; its distance recorded now is final and minimal.5. Set the unvisited node with the smallest distance (from the initial node) as the next "current node" and continue from step 3.Description of the algorithmSuppose you're marking over the streets on a street map (tracing the street with a marker) in a certain order, until you have a route marked in from the starting point to the destination. The order is conceptually simple: from all the street intersections of the already marked routes, find the closest unmarked intersection - closest to the starting point (the "greedy" part). It's the whole marked route to the intersection, plus the street to the new, unmarked intersection. Mark that street to that intersection, draw an arrow with the direction, then repeat. Never mark any two intersections twice. When you get to the destination, follow the arrows backwards. There will be only one path back against the arrows, the shortest one.

BELLman ford AlgorithmsDV algorithms are also known as Bellman-Ford routing algorithms and Ford-Fulkerson

routing algorithms. In these algorithms, every router has a routing table that shows it the best route for any destination. A typical graph and routing table for router J is shown below.

DestinationWeightLine

A8A

B20A

C28I

D20H

E17I

F30I

G18H

H12H

I10I

J0---

K6K

L15K

A typical network graph and routing table for router JAs the table shows, if router J wants to get packets to router D, it should send them to router H. When packets arrive at router H, it checks its own table and decides how to send the packets to D. In DV algorithms, each router has to follow these steps: 1. It counts the weight of the links directly connected to it and saves the information to its table. 2. In a specific period of time, it send its table to its neighbor routers (not to all routers) and receive the routing table of each of its neighbors. 3. Based on the information in its neighbors' routing tables, it updates its own. One of the most important problems with DV algorithms is called "count to infinity." Let's examine this problem with an example: Imagine a network with a graph as shown below. As you see in this graph, there is only one link between A and the other parts of the network. Here you can see the graph and routing table of all nodes:

ABCD

A0,-1,A2,B3,C

B1,B0,-2,C3,D

C2,B1,C0,-1,C

D3,B2,C1,D0,-

Network graph and routing tablesNow imagine that the link between A and B is cut. At this time, B corrects its table. After a specific amount of time, routers exchange their tables, and so B receives C's routing table. Since C doesn't know what has happened to the link between A and B, it says that it has a link to A with the weight of 2 (1 for C to B, and 1 for B to A -- it doesn't know B has no link to A). B receives this table and thinks there is a separate link between C and A, so it corrects its table and changes infinity to 3 (1 for B to C, and 2 for C to A, as C said). Once again, routers exchange their tables. When C receives B's routing table, it sees that B has changed the weight of its link to A from 1 to 3, so C updates its table and changes the weight of the link to A to 4 (1 for C to B, and 3 for B to A, as B said). This process loops until all nodes find out that the weight of link to A is infinity. This situation is shown in the table below. In this way, experts say DV algorithms have a slow convergence rate.

BCD

Sum of weight to A after link cut,A2,B3,C

Sum of weight to B after 1st updating3,C2,B3,C

Sum of weight to A after 2nd updating3,C4,B3,C

Sum of weight to A after 3rd updating5,C4,B5,C

Sum of weight to A after 4th updating5,C6,B5,C

Sum of weight to A after 5th updating7,C6,B7,C

Sum of weight to A after nth updating.........

The "count to infinity" problemOne way to solve this problem is for routers to send information only to the neighbors that are not exclusive links to the destination. For example, in this case, C shouldn't send any information to B about A, because B is the only way to A.

Q2. To study different type of LAN equipment?Ans: LAN equipments For making LAN we may require some or the entire following hardware category. Along with these are shown the OSI level of these equipments:

1. Transmission media(Physical level)2. Hub(Physical level)3. Switches(Data link level)4. Routers(Network level)5. Gateways(Application level)1.Transmission media:

Atransmission medium(pluraltransmission media) is a material substance (solid,liquid,gas, orplasma) that canpropagateenergywaves. For example, the transmission medium forsoundreceived by the ears is usually air, but solids and liquids may also act as transmission media for sound. The termtransmission mediumcan also refer to a technical device that employs the material substance to transmit or guide waves. Thus, an optical fiber or a copper cable is referred to as a transmission medium.Guided Transmission Media uses a "cabling" system that guides the data signals along a specific path. The data signals are bound by the "cabling" system. Guided Media is also known as Bound Media. Cabling is meant in a generic sense in the previous sentences and is not meant to be interpreted as copper wire cabling only.Unguided Transmission Media consists of a means for the data signals to travel but nothing to guide them along a specific path. The data signals are not bound to a cabling media and as such are often called Unbound Media.2.Hub:A common connection point fordevicesin anetwork. Hubs are commonly used to connectsegmentsof aLAN. A hub contains multipleports. When apacketarrives at one port, it is copied to the other ports so that all segments of the LAN can see all packets.Apassive hubserves simply as a conduit for the data, enabling it to go from one device (or segment) to another. So-calledintelligent hubsinclude additional features that enables an administrator to monitor the traffic passing through the hub and to configure each port in the hub. Intelligent hubs are also calledmanageable hubs.

3.Switch: Anetwork switchorswitching hubis acomputer networking devicethat connectsnetwork segments.The term commonly refers to a multi-portnetwork bridgethat processes and routes data at thedata link layer(layer 2) of theOSI model. Switches that additionally process data at thenetwork layer(Layer 3) and above are often referred to as Layer 3 switches ormultilayer switches.The termnetwork switchdoes not generally encompass unintelligent or passive network devices such ashubsandrepeaters.The network switch plays an integral part in most modernEthernetlocal area networks(LANs). Mid-to-large sized LANs contain a number of linkedmanagedswitches.Small office/home office(SOHO) applications typically use a single switch, or an all-purposeconverged devicesuch as agatewayto access small office/homebroadbandservices such asDSLorcable internet. In most of these cases, the end-user device contains arouterand components that interface to the particular physical broadband technology. User devices may also include a telephone interface forVoIP.

4. Routers:Arouteris a device that forwardsdata packetsacrosscomputer networks. Routers perform the data "traffic directing" functions on theInternet. A router is amicroprocessor-controlled device that is connected to two or more data lines from different networks. When a data packet comes in on one of the lines, the router reads the address information in the packet to determine its ultimate destination. Then, using information in itsrouting table, it directs the packet to the next network on its journey. A data packet is typically passed from router to router through the networks of the Internet until it gets to its destination computer. Routers also perform other tasks such as translating the data transmission protocol of the packet to the appropriate protocol of the next network, and preventing unauthorized access to a network by the use of afirewall.[1]

5.Gateways:A gateway may contain devices such asprotocoltranslators,impedance matchingdevices, rate converters,faultisolators, orsignaltranslators as necessary to providesysteminteroperability. It also requires the establishment of mutually acceptable administrative procedures between both networks. A protocol translation/mapping gateway interconnects networks with different network protocol technologies by performing the required protocol conversions. Gateways, also calledprotocol converters, can operate at network layer and above. The job of a gateway is much more complex than that of arouterorswitch

Q6. To study and configure various type of routers and bridge?Ans: Arouteris a device that forwardsdata packetsacrosscomputer networks. Routers perform the data "traffic directing" functions on theInternet. A router is amicroprocessor-controlled device that is connected to two or more data lines from different networks. When a data packet comes in on one of the lines, the router reads the address information in the packet to determine its ultimate destination. Then, using information in itsrouting table, it directs the packet to the next network on its journey. A data packet is typically passed from router to router through the networks of the Internet until it gets to its destination computer. Routers also perform other tasks such as translating the data transmission protocol of the packet to the appropriate protocol of the next network, and preventing unauthorized access to a network by the use of afirewall.[1]Types of RoutersThere are several types of routers that you will want to understand. You need to know the difference so that you can set up your network or at least so that you can understand what the local computer guy tells you to do.1.Broadband RoutersBroadband routers can be used to do several different types of things. They can be used to connect two different computers or to connect two computers to the Internet. They can also be used to create a phone connection.If you are using Voice over IP (VoIP) technology, then you will need a broadband router to connect your Internet to your phone. These are often a special type of modem that will have both Ethernet and phone jacks. Although this may seem a little confusing, simply follow the instructions that your VoIP provider sends with your broadband router - usually you must purchase the router from the company in order to obtain the service.2.Wireless RoutersWireless routers connect to your modem and create a wireless signal in your home or office. So, any computer within range can connect to your wireless router and use your broadband Internet for free. The only way to keep anyone from connecting to your system is to secure your router.A word of warning about wireless routers: Be sure your secure them, or you will be susceptible to hackers and identity thieves. In order to secure your router, you simply need to come to WhatIsMyIPAddress.com, and get your IP address. Then, you'll type that into your web browser and log into your router (the user ID and password will come with your router).

Types of bridgesThere are six main types of bridges:beam bridges,cantilever bridges,arch bridges,suspension bridges,cable-stayed bridges.1.Beam bridgesBeam bridgesare horizontal beams supported at each end by abutments, hence their structural name ofsimply supported. When there is more than one span the intermediate supports are known aspiers. The earliest beam bridges were simple logs that sat across streams and similar simple structures. In modern times, beam bridges are large box steel girder bridges. Weight on top of the beam pushes straight down on the abutments at either end of the bridge.[11]They are made up mostly of wood or metal. Beam bridges typically do not exceed 250feet (76m) long. The longer the bridge, the weaker. The world's longest beam bridge isLake Pontchartrain Causewayin southernLouisianain the United States, at 23.83miles (38.35km), with individual spans of 56feet (17m).[12]2.Cantilever bridgesCantilever bridgesare built using cantilevershorizontal beams that are supported on only one end. Most cantilever bridges use a pair ofcontinuous spansextending from opposite sides of the supporting piers, meeting at the center of the obstacle to be crossed. Cantilever bridges are constructed using much the same materials & techniques as beam bridges. The difference comes in the action of the forces through the bridge. The largest cantilever bridge is the 549-metre (1,801ft)Quebec Bridgein Quebec, Canada.

3.Arch bridgesArch bridgeshaveabutmentsat each end. The earliest known arch bridges were built by the Greeks and include theArkadiko Bridge. The weight of the bridge is thrust into theabutmentsat either side.Dubaiin theUnited Arab Emiratesis currently building theSheikh Rashid bin Saeed Crossingwhich is scheduled for completion in 2012. When completed, it will be the largest arch bridge in the world.[13]

4.Suspension bridgesSuspension bridgesare suspended from cables. The earliest suspension bridges were made of ropes or vines covered with pieces of bamboo. In modern bridges, the cables hang from towers that are attached to caissons or cofferdams. The caissons or cofferdams are implanted deep into the floor of a lake or river. The longest suspension bridge in the world is the 12,826feet (3,909m)Akashi Kaikyo Bridgein Japan.[14]Seesimple suspension bridge,stressed ribbon bridge,underspanned suspension bridge,suspended-deck suspension bridge, andself-anchored suspension bridge.

5.Cable-stayed bridgesCable-stayed bridges, like suspension bridges, are held up by cables. However, in a cable-stayed bridge, less cable is required and the towers holding the cables are proportionately shorter.[15]The first known cable-stayed bridge was designed in 1784 by C.T. Loescher.[16]The longest cable-stayed bridge is theSutong Bridgeover the Yangtze River in China.

Q7:implement various routing protocol algorithms?Distance vector routing algo:#include#includeint graph[12][12];int e[12][12];int ad[12];int no,id,adc,small,chosen;char nodes[12]={a b c d e f g h i j k l};int main(){int i,j,k,ch1,ch2=0;adc=0;printf("enter the no nodes");scanf("%d",&no);printf("enter the value for adjacency matrix");for(i=0;i


Recommended