0% found this document useful (0 votes)
17 views30 pages

CN MODULE 2 Network Layer

The document outlines the main features and design issues of the network layer, focusing on routing packets from source to destination through various methods such as store-and-forward packet switching and connection-oriented vs. connectionless services. It discusses routing algorithms, including shortest path routing, flooding, and distance vector routing, highlighting their characteristics and the importance of optimal routing paths. Additionally, it addresses desirable properties of routing algorithms and the conflict between fairness and optimality in network traffic management.

Uploaded by

nandansyam2001
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views30 pages

CN MODULE 2 Network Layer

The document outlines the main features and design issues of the network layer, focusing on routing packets from source to destination through various methods such as store-and-forward packet switching and connection-oriented vs. connectionless services. It discusses routing algorithms, including shortest path routing, flooding, and distance vector routing, highlighting their characteristics and the importance of optimal routing paths. Additionally, it addresses desirable properties of routing algorithms and the conflict between fairness and optimality in network traffic management.

Uploaded by

nandansyam2001
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

MODULE 2

NETWORK LAYER
Main features include:

 Concerned with getting packets from the source all the way to the destination. Getting to
the destination require many hops at intermediate routers along the way.
 Routing
 Metric used is hop
o Represents number of routers used
 Choose best path to route packet from source to destination.
 Choose alternate route to avoid overloading.

NETWORK LAYER DESIGN ISSUES

1. Store-and-Forward Packet Switching

A host with a packet to send transmits it to the nearest router, either on its own LAN or over a
point-to-point link to the carrier. The packet is stored there until it has fully arrived so the
checksum can be verified. Then it is forwarded to the next router along the path until it reaches
the destination host, where it is delivered.
2. Services Provided to the Transport Layer
 The network layer provides services to the transport layer at the network layer/transport
layer interface.
 The network layer services have been designed with the following goals:

1. The services should be independent of the router technology.

2. The transport layer should be shielded from the number, type, and topology of the

routers present.

3. The network addresses made available to the transport layer should use a uniform
numbering plan, even across LANs and WANs.

Connections should have the following properties

1. Before sending data, a n/w layer process on the sending side must set up a connection to
its peer on the receiving side .This connection which is given a special identifier is then
used until all the data have been sent at which time it is explicitly released.
2. When a connection is set up, the two processes can enter into a negotiation about the
parameters: quality and cost of the service to be provided.
3. Communication is in both directions and packets are delivered in sequence.
4. Flow control is provided automatically to prevent a fast sender from dumping packets
into the pipe at a higher rate than the receiver can take them out, thus leading to overflow.

3. Implementation of Connection-Oriented Service

 If connection-oriented service is used, a path from the source router to the destination
router must be established before any data packets can be sent. This connection is called a
VC (virtual circuit) and the subnet is called VC subnet.

 when a connection is established, a route from the source machine to the destination
machine is chosen as part of the connection setup and stored in tables inside the routers.
 The route is used for all traffic flowing over the connection, exactly the same way that
the telephone system works.
 When the connection is released, the virtual circuit is also terminated.
 Every router must maintains a table with one entry per open virtual circuit passing
through it.
 Each packet travelling through the subnet must contain a virtual circuit number field in
its header, in addition to sequence numbers, checksums.
 When a packet arrives at router, the router knows on which line it arrived and what the
virtual circuit number is.
 Based on the information, the packet must be forwarded on the correct o/p line.

Example

H1 has established connection 1 with host H2. It is remembered as the first entry in each of
the routing tables. The first line of A's table says that if a packet bearing connection identifier
1 comes in from H1, it is to be sent to router C and given connection identifier 1. Similarly,
the first entry at C routes the packet to E, also with connection identifier 1. if H3 also wants
to establish a connection to H2. It chooses connection identifier 1 (because it is initiating the
connection and this is its only connection) and tells the subnet to establish the virtual circuit.
This leads to the second row in the tables.
4. Implementation of Connectionless Service
 If connectionless service is offered, packets are injected into the subnet individually
and routed independently of each other. No advance setup is needed.
 In connectionless service, the packets are called datagrams and the subnet is called a
datagram subnet.
 Each packet sent is routed independently of its predecessor.Successive packets may
follow different routes.
 They are generally more robust and adapt to failures and congestion more easily than
virtual circuit subnets.
 Here routers do not have a table with one entry for each open virtual circuit
o Instead they have a table telling which outgoing line to use for each possible
destination router.
o When a packet comes in, the router look up the outgoing line to use and sends the
packet on its way.
 Each datagram must contain the full destination address.
Example
Suppose that the process P1 has a long message for P2. It hands the message to the transport
layer with instructions to deliver it to process P2 on host H2. The transport layer code runs on
H1, typically within the operating system. It prepends a transport header to the front of the
message and hands the result to the network layer.
COMPARISON OF VIRTUAL-CIRCUIT AND DATAGRAM SUBNETS
[Previously asked university essay question]
ROUTING ALGORITHMS [Previously asked University Question]

 The main function of the network layer is routing packets from the source machine to the
destination machine.
 The routing algorithm is a part of the network layer software responsible for deciding
which output line an incoming packet should be transmitted on.
o If the subnet uses datagrams internally, this decision must be made anew for every
arriving data packet since the best route may have changed since last time.
o If the subnet uses virtual circuits internally, routing decisions are made only when
a new virtual circuit is being set up. Thereafter, data packets just follow the
previously-established route. This is called session routing because a route
remains in force for an entire user session (e.g., a login session at a terminal or a
file transfer).
 Routing, which is making the decision which routes to use, and forwarding, which is
what happens when a packet arrives.

DESIRABLE PROPERTIES OF A ROUTING ALGORITHM:


[Previously asked university question (4Marks)]
o Correctness- to ensure that the packet has been delivered to the correct destination.
o Simplicity- algorithm should be simple and easy to understand.
o Robustness-ability to deliver the packet to the correct destination in case of node
failures.
o Stability- ability to converge to equilibrium fast in case of changes in the network.
o Fairness- to give equal priority for all stations
o Optimality- ability to give priority to anyone to choose the route. Fairness and
optimality are contradictory goals.

Conflict between Fairness and optimality

Suppose that there is enough traffic between A and A', between B and B', and between C and
C' to saturate the horizontal links. To maximize the total flow, the X to X' traffic should be
shut off altogether.
Many networks attempt to minimize the number of hops a packet must make, because
reducing the number of hops tends to improve the delay and also reduce the amount of
bandwidth consumed, which tends to improve the throughput as well.

CLASSIFICATION OF ROUTING ALGORITHMS

[Difference b/w adaptive and non adaptive Previously asked University Question -4 Marks]

 Routing algorithms can be grouped into two major classes:


o Nonadaptive and
o Adaptive.
 Nonadaptive algorithms(Static algorithm)
o routing decisions are not based on measurements or estimates of the current
traffic and topology.
o The route to get from I to J (for all I and J) is computed in advance, off-line, and
downloaded to the routers when the network is booted.
o This procedure is called static routing.
Eg: RIP
 Adaptive algorithms(Dynamic algorithm)
o These algorithms change their routing decisions to reflect changes in the
topology, and usually the traffic as well.
o Adaptive algorithms get their information:
 locally, from adjacent routers, or from all routers,
 when they change the routes (e.g., every ΔT sec,
 when the load changes or when the topology changes), and
 what metric is used for optimization (e.g., distance, number of hops, or
estimated transit time).
 Eg: OSPF

THE OPTIMALITY PRINCIPLE [Previously asked University Question -4 Marks]


It states that if router J is on the optimal path from router I to router K, then the optimal path
from J to K also falls along the same route. To see this, call the part of the route from I to Jr1 and
the rest of the route r2. If a route better than r2 existed from J to K, it could be concatenated with
r1 to improve the route from I to K, contradicting our statement that r1r2 is optimal.

The set of optimal routes from all sources to a given destination form a tree rooted at the
destination. Such a tree is called a sink tree, where the distance metric is the number of hops.The
goal of all routing algorithms is to discover and use the sink trees for all routers.

Different routing algorithms are:

 Shortest path routing


 Flooding
 Distance vector routing

SHORTEST PATH ROUTING [Previously asked University Question -Essay]


 It is a Static algorithm
 The idea is to build a graph of the subnet, with each node of the graph representing a
router and each arc of the graph representing a communication line (often called a link).
 To choose a route between a given pair of routers, the algorithm just finds the shortest
path between them on the graph.
 Method for measuring path length(Metric) is
o the number of hops.
o geographic distance in kilometers

The algorithm used for computing the shortest path between two nodes of a graph is known as
Dijkstra’s Algorithm.

Dijkstra’s Algorithm

 Each node is labeled (in parentheses) with its distance from the source node along the
best known path.
 Initially, no paths are known, so all nodes are labeled with infinity.
 As the algorithm proceeds and paths are found, the labels may change, reflecting better
paths.
 A label may be either tentative or permanent.
 Initially, all labels are tentative.
 When it is discovered that a label represents the shortest possible path from the source to
that node, it is made permanent and never changed thereafter.

Example
To find the shortest path from A to D and the Metric used is distance

Step 1: Start by marking node A as permanent, indicated by a filled-in circle.

Step 2: Examine each of the nodes adjacent to A (the working node), relabeling each one with the
distance to A.

 Whenever a node is relabeled, also label it with the node from which the probe
was made.
 After examining each of the nodes adjacent to A, Examine all the tentatively
labeled nodes in the whole graph and make the one with the smallest label
permanent. This one becomes the new working node.

Step 3: Now start at B and examine all nodes adjacent to it.

 If the sum of the label on B and the distance from B to the node being considered is
less than the label on that node, we have a shorter path, so the node is relabeled.

Step 4: After all the nodes adjacent to the working node have been inspected and the tentative
labels changed if possible, the entire graph is searched for the tentatively-labeled node
with the smallest value. This node is made permanent and becomes the working node for
the next round.
B C D E F G H
A 2 6
AB AG
(shortest)
B 9 4 6
ABC ABE AG
(shortest)
E 9 6 6
ABC ABEF AG
(Removed)
5
ABEG
(shortest)
G 9 6 9
ABC ABEF ABEGH
(shortest)
F 9 9
ABC ABEGH
(Removed)
9 8
ABEFC ABEFH
(Removed) (shortest)
H 9 10
ABC ABEFHD
(shortest)
C 10
ABEFHD
(shortest)
12
ABCD

D 10
ABEFHD
(shortest)
Final
Destination

Step1: At A

 AB= 2
 AG= 6
 Shortest path AB= 2
Step 2: At B

 ABC = 2 +7= 9
 ABE = 2 +2= 4
 AG= 6
 Shortest path ABE = 4

Step 3: At E

 ABEG = 5
 ABEF=6
 ABC=9
 AG=6 //CANCELLED(To G shortest is obtained)
 Shortest Path ABEG =5

Step 4: At G
 ABEGH = 9
 ABEF = 6
 ABC = 9
 Shortest Path ABEF = 6

Step 5: At F

 ABEFC = 9 //CANCELLED [same distance]


 ABEFH= 8
 ABEGH= 9 //CANCELLED [To H shortest Path is obtained]
 ABC= 9
 Shortest Path ABEFH = 8

Step 6: At H
 ABEFHD =10
 ABC= 9

Step 7: At C

 ABEFHD=10
 ABCD=12

Hence the shortest path will be through ABEFHD with distance 10 via H.

FLOODING [Previously asked University Question -4 Marks]

 static algorithm
 every incoming packet is sent out on every outgoing line except the one it arrived on
 creates duplicate packets
 in order to avoid duplication two methods are available:
o hop counter contained in the header of each packet, which is decremented at each
hop, with the packet being discarded when the counter reaches zero.
 The hop counter should be initialized to the length of the path from source
to destination.
o keep track of which packets have been flooded, to avoid sending them out a
second time.
 To achieve this goal is to have the source router put a sequence number in
each packet it receives from its hosts.
 Each router then needs a list per source router telling which sequence
numbers originating at that source have already been seen.
 If an incoming packet is on the list, it is not flooded.
 Selective Flooding
o In this algorithm the routers do not send every incoming packet out on every line,
only on those lines that are going approximately in the right direction.
 Applications
o distributed database applications,
 to update all the databases concurrently
o wireless networks,
 all messages transmitted by a station can be received by all other stations
within its radio range
o metric against which other routing algorithms can be compared.

DISTANCE VECTOR ROUTING [Previously asked University Question -Essay]


 dynamic routing algorithms.
 Also known as RIP(Routing Information Protocol)
 each router maintain a table (i.e, a vector) giving the best known distance to each
destination and which line to use to get there. These tables are updated by exchanging
information with the neighbors.
 Also called Bellman-Ford routing algorithm and the Ford-Fulkerson algorithm
 In distance vector routing, each router maintains a routing table indexed by, and
containing one entry for, each router in the subnet.
 This entry contains two parts:
o the preferred outgoing line to use for that destination and
o an estimate of the time or distance to that destination.
 If the metric is hops, the distance is just one hop.
 If the metric is queue length, the router simply examines each queue.
 If the metric is delay, the router can measure it directly with special ECHO packets that
the receiver just timestamps and sends back as fast as it can.

Routing Table Updation Algorithm/Rules

 Router must first add one hop to the hop count field for each advertised route.The router
should then apply the following rules to each advertised route:
1. If the advertised destination is not in the routing table,the router should add the
advertised information to the table
2. If the advertised destination is in the routing table
a. If the next hop field is same ,the router should replace the entry in the
table with the advertised one. Note that even If the advertised hop count is
larger,advertised entry should replace the entry in the table the new
information invalidates old.
b. If the next hop field is not same
i. If the advertised hop count is smaller than the one in the routing
table,the router should replace the entry in the table with the new
one.
ii. If the advertised hop count is not smaller(same or larger)the router
should do nothing.

Example

Assume that delay is used as a metric and that the router knows the delay to each of its
neighbors. Once every T msec each router sends to each neighbor a list of its estimated delays to
each destination.

Figure: represents the subnet


 A claims to have 12msec delay to B
 A claims to have 25msec delay to C
 A claims to have 40msec delay to D
Suppose J has estimated its delay to is neighbours A, I, H, K as 8, 10, 12, 6 msec respectively.
The following are the routing tables for A, I, H and K.

Problem: How J computes its new route to router G.

 Computing Routing Table for J(updating route J-G)


 JA=8 AG=18
From A’s routing table, it is clear A to G delay is 18 msec
JG via A= JA+AG= 8+18=26msec
 JH=12 HG=6
From H’s routing table, it is clear H to G delay is 6 msec
JG via H=JH+HG=12+6= 18msec
 JK=6 KG =31
From K’s routing table, it is clear K to G delay is 31 msec
JG via H=JK+KG=6+31= 37msec
 JI=10 IG=31
From I’s routing table, it is clear I to G delay is 31 msec
JG via I=JI+IG=10+31= 41msec
JG via H is the shortest and is selected and updates the table of router J with new route

THE COUNT-TO-INFINITY PROBLEM


[Previously asked University Question -Essay]
 reacts rapidly to good news, but leisurely to bad news.
Case 1:How fast good news propagates.
Consider the five-node (linear) subnet, where the delay metric is the number of hops. Suppose A
is down initially and all the other routers know this. They have all recorded the delay to A as
infinity.
 When A comes up, the other routers learn about it via the vector exchanges.
 At the time of the first exchange, B learns that its left neighbor has zero delay to A. B now
makes an entry in its routing table that A is one hop away to the left. All the other routers
still think that A is down.
 On the next exchange, C learns that B has a path of length 1 to A, so it updates its routing
table to indicate a path of length 2.
 In general a subnet whose longest path is of length N hops, within N exchanges everyone
will know about newly-revived lines and routers.

Case 2: How bad news propagates

 Initially all the lines and routers are initially up.


 Routers B, C, D, and E have distances to A of 1, 2, 3, and 4, respectively. Suddenly A
goes down, or alternatively, the line between A and B is cut.
∞ ∞ ∞ ∞

 At the first packet exchange, B does not hear anything from A.


o C says: Do not worry; I have a path to A of length 2. B doesn’t know that C's path
runs through B itself. As a result, B thinks it can reach A via C, with a path length
of 3. D and E do not update their entries for A on the first exchange.
 On the second exchange, C notices that each of its neighbors claims to have a path to A of
length 3. It picks one of the them at random and makes its new distance to A 4
 All routers work their way up to infinity, but the number of exchanges required depends
on the numerical value used for infinity. For this reason, it is wise to set infinity to the
longest path plus 1.
 This problem is known as the count-to-infinity problem.

SPLIT HORIZON HACK


 Used to solve count-infinity problem.
 Works same way a distance vector routing, except that the distance to x is not reported on
the line that packets for X are sent on (it is reported as infinity).
 For the figure, in count to infinity problem, for eg, C tells D the truth about the distance
to A, but c tells B that its distance to A is infinite. Similarly, D tells the truth to E but lies
to C.
 Consider the situation where a goes down: On the first exchange , B discovers that the
direct line is gone and C is reporting an infinite distance to A as well. Since neither of its
neighbours can get to A, B sets its distance to infinity as well. On the next exchange, C
hears that A is unreachable from both of its neighbours so it marks A as unreachable too.
 Consider a four node subnt:initiallyboth a and B have a distance 2 to D and c has a
distance 1 there.

 Consider that CD line goes down.Using split horizon both A and B tell C that they can’t
get to D. Thus C immediately concludes that D is unreachable and reports this to both a
and B.Unfortunately A hears that B has a path of length 2 to d, so it assumes it can get to
D via B in 3 hops.Similarly, B concludes it can get to D via A in 3 hops.On the next
exchange they each set their distance to D to 4.Both of them gradually count to infinity.

LINK STATE ROUTING [Previously asked University Question -Essay]


 Two primary problems caused by distance vector routing
o First, since the delay metric was queue length, it did not take line bandwidth into
account when choosing routes
o Algorithm often took too long to converge (the count-to-infinity problem)
 Steps involved in link state routing.
o Each router must do the following:
1. Discover its neighbors and learn their network addresses.
2. Measure the delay or cost to each of its neighbors.
3. Construct a packet telling all it has just learned.
4. Send this packet to all other routers.
5. Compute the shortest path to every other router. (Use Dijkstra’s algorithm)
1. Learning about the Neighbors
 When a router is booted, its first task is to learn who its neighbors are.
 It accomplishes this goal by sending a special HELLO packet on each point-to-point line.
The router on the other end is expected to send back a reply telling who it is.

2. Measuring Line Cost


 Finds out the delay to each of its neighbors
 Delay is determined by sending over the line a special ECHO packet that the other side is
required to send back immediately.
 By measuring the round-trip time and dividing it by two, the sending router can get a
reasonable estimate of the delay.
3. Building Link State Packets
 build a packet containing all the data.
 The packet starts with the identity of the sender, followed by a sequence number and age
and a list of neighbors.
 For each neighbor, the delay to that neighbor is given.
4. Distributing the Link State Packets
 Basic distribution algorithm used: flooding
 Each packet contains a sequence number that is incremented for each new packet sent.
 When a new link state packet comes in, it is checked against the list of packets already
seen.
o If it is new, it is forwarded on all lines except the one it arrived on.
o If it is a duplicate, it is discarded. If a packet with a sequence number lower than
the highest one seen so far ever arrives, it is rejected
Drawbacks
1) If the sequence numbers wrap around, confusion arise.
 The solution here is to use a 32-bit sequence number.
2) If a router ever crashes, it will lose track of its sequence number. If it starts again at 0, the
next packet will be rejected as a duplicate.
3) If a sequence number is ever corrupted and 65,540 is received instead of 4 (a 1-bit error),
packets 5 through 65,540 will be rejected as obsolete, since the current sequence number
is thought to be 65,540.
 The solution to all these problems is to include the age of each packet after the
sequence number and decrement it once per second. When the age hits zero, the
information from that router is discarded. Normally, a new packet comes in, say,
every 10 sec, so router information only times out when a router is down.
The Age field is also decremented by each router during the initial flooding process, to make sure
no packet can get lost and live for an indefinite period of time(a packet whose age is zero is
discarded)

When a link state packet comes in to a router for flooding, it is not queued for transmission
immediately. Instead it is first put in a holding area to wait a short while. If another link state
packet from the same source comes in before the first packet is transmitted, their sequence
numbers are compared. If they are equal, the duplicate is discarded. If they are different, the
older one is thrown out. To guard against errors on the router-router lines, all link state packets
are acknowledged. When a line goes idle, the holding area is scanned in round-robin order to
select a packet or acknowledgement to send.
The data structure used by router B for the subnet.

The table records where the packet originated, its


 sequence number and
 age, and
 the data.
 send and acknowledgement flags for each of B's three lines (to A, C, and F,
respectively).
o The send flags mean that the packet must be sent on the indicated line.
o The acknowledgement flags mean that it must be acknowledged there.
 The link state packet from A arrives directly, so it must be sent to C and F and
acknowledged to A, as indicated by the flag bits. Similarly, the packet from F has to
be forwarded to A and C and acknowledged to F.
 From E, the packet arrived twice, once via EAB and once via EFB. Consequently, it
has to be sent only to C but acknowledged to both A and F, as indicated by the bits.
 If a duplicate arrives while the original is still in the buffer, bits have to be changed.
5. Computing the New Routes
 Dijkstra's algorithm can be run locally to construct the shortest path to all possible
destinations.
 For a subnet with n routers, each of which has k neighbors, the memory required to store
the input data is proportional to kn.
 Egs: OSPF,IS-IS
IS-IS (INTERMEDIATE SYSTEM-INTERMEDIATE SYSTEM)

 Distributes a picture of the router topology, from which the shortest paths are computed.
 Each router announces, in its link state information, which network layer addresses it can
reach directly.
 These addresses can be IP, IPX, AppleTalk, or any other addresses.
 IS-IS can even support multiple network layer protocols at the same time.

ROUTING FOR MOBILE HOSTS


[Previously asked University Question -Essay]
 WAN consists of routers and hosts.
 Hosts that never move are said to be stationary. They are connected to the network by
copper wires or fiber optics
 Migratory hosts are basically stationary hosts who move from one fixed site to another
from time to time but use the network only when they are physically connected to it.
 Roaming hosts actually compute on the run and want to maintain their connections as
they move around.
 Migrating and roaming hosts are referred to as mobile hosts.
 All hosts are have a permanent home location that never changes
 The routing goal in systems with mobile hosts is to make it possible to send packets to
mobile hosts using their home addresses and have the packets efficiently reach them
wherever they may be.
 The world is divided up (geographically) into small units called areas.
o Each area has one or more foreign agents,
 which are processes that keep track of all mobile hosts visiting the area.
o Each area has a home agent,
 which keeps track of hosts whose home is in the area, but who are
currently visiting another area.
Working
When a new host enters an area, either by connecting to it or just wandering into the cell, this
computer must register itself with the foreign agent there.
Two steps:
 Registration
 Routing
The registration procedure typically works like this:
1. Periodically, each foreign agent broadcasts a packet announcing its existence and address.
A newly-arrived mobile host may wait for one of these messages, but if none arrives
quickly enough, the mobile host can broadcast a packet saying: Are there any foreign
agents around?

2. The mobile host registers with the foreign agent, giving its home address, current data link
layer address, and some security information.

3. The foreign agent contacts the mobile host's home agent and says: One of your hosts is
over here. The message from the foreign agent to the home agent contains the foreign
agent's network address. It also includes the security information to convince the home
agent that the mobile host is really there.

4. The home agent examines the security information, which contains a timestamp, to prove
that it was generated within the past few seconds. If it is happy, it tells the foreign agent
to proceed.
5. When the foreign agent gets the acknowledgement from the home agent, it makes an entry
in its tables and informs the mobile host that it is now registered.

Routing procedure
Step 1:When a packet is sent to a mobile host, it is routed to the host's home LAN
Step 2:This packet is received by the home agent and looks up the mobile host's new (temporary)
location and finds the address of the foreign agent handling the mobile host

 The home agent then does two things.


o First, it encapsulates the packet in the payload field of an outer packet and sends
the latter to the foreign agent. This mechanism is called tunneling;
 After getting the encapsulated packet, the foreign agent removes the
original packet from the payload field and sends it to the mobile host as a
data link frame.
o Second, the home agent tells the sender to send packets to the mobile host by
encapsulating them in the payload of packets explicitly addressed to the foreign
agent instead of just sending them to the mobile host's home address (Step 3).
Step 4:Subsequent packets can now be routed directly to the host via the foreign, bypassing the
home location entirely.
OSPF [Previously asked University Question (ESSAY)]
 A routing algorithm within an Autonomous Systems is called an interior gateway
protocol. An algorithm for routing between ASes is called exterior gateway protocol.
 Open shortest Path First
 OSPF is a Link state routing protocol.

 OSPF supports three kinds of connections and networks:

o Point-to-point lines between exactly two routers.

o Multiaccess networks with broadcasting (e.g., most LANs).

o Multiaccess networks without broadcasting (e.g., most packet-switched WANs).

 A multiaccess network is one that can have multiple routers on it, each of which can
directly communicate with all the others.
 Requirements to be considered while designing OSPF:
o the algorithm has to be published in open literature,
o it has to support the variety of distance metrics,
o it has to be based on dynamic algorithm,
o it has to support routing based on types of services,
o it has to do load balancing, splitting the load over multiple lines,
o hierarchical routing
o security
 OSPF represents the actual network as a graph and then compute the shortest path from
every router to every other router.
 OSPF allows to divide ASes into numbered areas. Area is a network or a set of
contiguous networks.
 Areas do not overlap but need not be exhaustive, i.e., some routers may belong to no
area. An area is a generalization of a subnet.
 Every AS has a backbone area called area 0. All areas are connected to the backbone.
Each router that is connected to two or more areas is part of the backbone.
 Within an area, each router has the same link state database and runs the same shortest
path algorithm.
 OSPF handles different types of service routing in a different way.
 During the normal operation, three kinds of routes may be needed:
o intra-area - here the source router already knows the shortest path to the
destination router,
o inter-area,
o inter AS.
 Inter-area routing proceeds in three steps:
 go from the source to the backbone,
 go across the backbone to the destination area,
 go to the destination.
 OSPF distinguishes four classes of routers:
o internal routers are wholly within one area,
o area border routers connect two or more areas,
o backbone routers are on the backbone,
o AS boundary routers talk to routers in other ASes.
 When a router boots, it sends HELLO messages on all of its point-to-point lines and
multicasts them on LANs to the group consisting of all other routers. From the responses,
each router learns who its neighbors are.
 OSPF works by exchanging information between adjacent routers which is not the same
as between neighboring routers. On each LAN, one router is selected as designated
router. It is said to be adjacent to all other router and exchanges information with them. A
backup designated router is always kept up-to-date to easy transition should the primary
designated router crash.

Figure:. The five types of OSPF messages.

You might also like