Wednesday 28 November 2012

Routing Algorithms in COMPUTER NETWORK CS2320 Anna Univeristy Question

Router :
           It is a device that forwards data packets between computer networks
Routing:
            Routing is the process of selecting paths in a network.
Routing Protocol:
            The protocol which are used in routing algorithms is called as routing protocol.
Routing Algorithm:
               The algorithm used for routing is called by the name Routing algorithms.
Types of Routing Algorithms
              There are 2 types of routing algorithms.
                                    1)Adaptive
                                    2)Non Adaptive
 Adaptive:
            Change routes dynamically
            Gather information at runtime


Nonadaptive:
            Static routes are downloaded at boot time

Link State Rotuing
·         Also called shortest path first (SPF) forwarding
·         All routers have tables which contain a representation of the entire network topology
·         Each router creates a link state packet (LSP) which contains names (e.g. network addresses) and cost to each of its neighbours
·         The algorithm requires the following information:
·         Link state database:  List of all the latest LSPs from each router on the network
·         Path: Tree structure storing previously computed best paths
·         Data type for nodes:  (ID, path cost, port)
·         Tent:  Tree structure storing paths currently being tested and compared (tentative)
·         Forwarding database:  Table storing all IDs that can be reached, and the port to which messages should be sent
·         This is simply a reduced version of the ‘Path’, which contains (destination,port) pairs
Dijkstra’s LSR Algorithm:
 
n     Initially, PATH is just a root containing (this router’s ID, 0, 0)
n  For every node placed into path, N:
n  For all neighbours M of node N:
n  If M is not in TENT, add a node to TENT for M (use the LSP for N to determine link cost)
n  If M is in TENT already, and its cost is lower than an existing entry for M, replace that entry with information from N’s LSP
n  If M is in TENT already, but its cost is higher, ignore N’s link to M
n  Calculate the shortest route in TENT
n  If the shortest route has lower cost than the route in PATH, overwrite the route in PATH with the route in TENT

Example


Solution

Open Shortest Path First (OSPF)

Open Shortest Path First (OSPF) is a link state routing protocol (LSRP) that uses the Shortest Path First (SPF) network communication algorithm (Dijkstra's algorithm) to calculate the shortest connection path between known devices.

OSPF detects changes in the topology, such as link failures, very quickly and converges on a new loop-free routing structure within seconds. It computes the shortest path tree for each route using a method based on Dijkstra's algorithm, a shortest path first algorithm.

The link-state information is maintained on each router as a link-state database (LSDB) which is a tree-image of the entire network topology. Identical copies of the LSDB are periodically updated through flooding on all OSPF routers.

Packet Format

1              1             2               4                 4       2             2             8             var

Version number

Type

Packet Length

Router ID

Area ID

Checksum

Authentication Type

Authentication

Data

• Version Number—Identifies the OSPF version used.

• Type—Identifies the OSPF packet type as one of the following:

Hello: Establishes and maintains neighbor relationships.

Database Description: Describes the contents of the topological database. These messages are exchanged when an adjacency is initialized.

Link-state Request: Requests pieces of the topological database from neighbor routers.

Link-state Update: Responds to a link-state request packet.

Link-state Acknowledgment: Acknowledges link-state update packets.

• Packet Length—Specifies the packet length, including the OSPF header, in bytes.

• Router ID—Identifies the source of the packet.

• Area ID—Identifies the area to which the packet belongs. All OSPF packets are associated with a single area.

• Checksum—Checks the entire packet contents for any damage suffered in transit.

• Authentication Type—Contains the authentication type. All OSPF protocol exchanges are

authenticated. The Authentication Type is configurable on a per-area basis.

• Authentication—Contains authentication information.

• Data—Contains encapsulated upper-layer information

Example

A person in city A wants to travel to city M and is given two options:

Travel via cities B and C. The route would be ABCM. And the distance (or bandwidth cost in the networking case) for A-B is 10 miles, B-C is 5 miles and C-M is 10 miles.

Travel via city F. The route would be AFM. And the distance for A-F is 20 miles and F-M is 10 miles.

The shortest route is always the one with least amount of distance covered in total. Thus, the ABCM route is the better option (10+5+10=25), even though the person has to travel to two cities as the associated total cost to travel to the destination is less than the second option with a single city (20+10=30). OSPF performs a similar algorithm by first calculating the shortest path between the source and destination based on link bandwidth cost and then allows the network to send and receive IP packets via the shortest route.

Distance Vector Routing Algorithm

   Distance

Distance is the cost of reaching a destination, usually based on the number of hosts the path passes through.

Vector

 vector is the interface traffic will be forwarded out in order to reach an given destination network along a route or path selected by the routing protocol as the best path to the destination network.

Distance vector protocols use a distance calculation plus an outgoing network interface (a vector) to choose the best path to a destination network. The network protocol (IPX, SPX, IP, Appletalk, DECnet etc.) will forward data using the best paths selected.

Examples of Distance Vector routing protocols:

Routing Information Protocol (RIP)

Interior Gateway Routing Protocol (IGRP)

Enhanced Interior Gateway Routing Protocol (EIGRP)

Characteristics of Distance Vector routing protocols:

Periodic updates

Neighbors                                 

Broadcast updates

Entire routing table is included with routing update

 

Don't You Think this Awesome Post should be shared ??
| Routing Algorithms in COMPUTER NETWORK CS2320 Anna Univeristy Question |
Back To Top Related Posts Plugin for WordPress, Blogger...