Unit-3 CN Notes (Continued)
Unit-3 CN Notes (Continued)
Unit-3 CN Notes (Continued)
2 Addressing
Addressing is necessary to identify each device on the Internet uniquely. This is similar to a
telephone system. The addresses used in the network layer should uniquely and universally define
the connection of a computer.
3Routing
na network, there are multiple roots available from a source to a destination and one of them is
to be chosen. The network layer decides the root to be taken. This is called as routing and it depends
on various criterions.
4. Packetizing
As discussed earlier, the network layer encapsulates the packets received from upper layer
protocol and makes new packets. This is called as packetizing. It is done by a network laver protocol
called IP (Internetworking protocol).
S. Fragmenting
The datagram can travel through different networks. Each router decapsulates the IP datagram
from the received frame. Then the datagram is processed and encapsulated in another trame.
6. Other issues
The other issues which are not directly related to the duties of network laver but need to be
discussed are as under:
(i) Address resolution.
(i) Multicasting.
(i) Routing protocols.
De ula choose appropriate
idie op
Uperation of others should chosen in such a choose
be way that appropriate paths for
5 2, 1SSUES avoided. overloading of some routers and
nd
RELATED TO NETWORK
LAYER DESIGN
The important network
the internal design of layer design issues include the
subnet. service provided to the
The network
layer has been designed with transport layer and
1) The services the
provided should be
following goals:
service need not be
aware of the independent of the
underlying technology. Users of the
their physical
messages could be transported via implementation of the network
when we consider carrier pigeon. This -for all they know,
networks in
the great design
variety of networks in operation. In thegoal great importance
has
in underdeveloped countries are
the countries like nowhere near the
area of Public
networks,
() The design of the
the U.S. or Ireland. technological prowess of those
layer must not disable
technologies. us from connecting to networks of different
it) The transport layer (that is the host
and different computer) should be shielded from the number,
topologies of the subnets
communication link, it need not know howuser uses. That is, all
that type
that link is made. transport layer wants is a
(iv) Finally, there is a need for some uniform
() With these goals in addressing scheme for network addresses.
mind, two different types of services
(a) Connection oriented Network Services emerged as follows:
(b) Connectionless Network Services.
A connection-oriented service is one in which the
user is
To communicate, the user requests a connection, then uses given a reliable end to end connection.
then closes the the connection to his hearts content, and
connection. A
telephone call is the classic
In a connectionless service, the user simply bundles his example of a connection oriented service.
and then sends it off, in the information together, puts an address on it,
hope that it will reach its destination. There
bundle will arrive. Therefore, a connectionless is no
service is one reminiscent of theguarantee
that the
letter is sent, that is,' put in the
post box. It is then in the post network where it postal system. A
gets bounced
hopefully will leave the network in the correct place, that is, in the addressee's letter box. We and
never be totally sure that the letter will can
arrive, but we know that there is a high
will, and so we place our trust in the postal network. probability that it
HHHI
N
N w Un
248 Computer Networks
Bus
Router
Router
Ring Ring
I Router
Router Ring
Bus
Important Point:
Routers work at the network layer of the OSI model. The cost of a route can be defined in several terms:
a time estimate, a distance estimate or an estimate that includes monetary terms. In distance vector
routing, each router advertises the presence periodically to other routers on the network. Link state
routers broadcast their complete routing tables only at startup and at certain intervals. Dynamic route
selection permits routers to constantly adjust o changing network conditions. With static route selection,
packets alwaysfollow apre-determined path.
5.4. ROUTING ALGORITHMS
(Expected)
One of the important functions of the network layer is to route the
to the destination machine. The major area of network layer
packets from the source machirne
choose the routes and the data structures which are used.
design includes the algorithms which
Routing algorithm
laver software. It is responsible for deciding the output line over which
is a
a packet is part
of network
to be sent. Sucn
a decision is dependent on whether the subnet is a virtual
circuit or it is datagram switching.
5.4.1. Desired Properties of a Routing Algorithm
There are certain desirable properties of a routing algorithm as under:
) Correctness. (ii) Robustness.
(ii) Stability. (iv) Fairness and
(o) Optimality.
249
Network Layer
DO YOU KNOW?
54.2. Types of Routing Algorithms
Routing algorithms can be divided into two groups as
The routing algorithm is
that part
software
under:
of the network layer
which
1. Nonadaptive algorithms responsible for deciding
2. Adaptive algorithms. output line an incoming packet
should be transmitted on.
1. Nonadaptive algorithms
measure-ment or estimation
For this type of algorithms, the routing decision is not based on the
off line and it is
of current traftic and topology. However, the choice of the route is done in advance,
downloaded to the routers. This is called as static routing.
2. Adaptive algorithms
For these algorithms, the routing decision can be changed if there are any changes in topology
discuss various staticC
or traffic etc. This is called as dynamic routing. In the following sections, let us
and dynainic algorithms.
3.Optimality principle
A general statement about optimality is called as optimality principle. It states thatif router/in
also falls along the
on the optimal path from router I to router K, then the optimal path from J to K
route as r2.
same route. This be elaborated as, call the part of the route from I to J as r1 and rest of
can
with r1 to improve the route
Ifa route better than r2 existed from J to K, it could be concatenated
from I to K, contradicting our statement that r1 r2 is optimal.
4. Sink tree
called sink tree and
A set of optimal routes from all the sources to a given destination form a tree
it is shown in figure 5.4. Note that a sink tree need not be unique. Other trees with the same path
are supposed to discover and use the sink trees
for
lengths may also exist. All the routing algorithms
all routers. In the sink tree of figure 5.4, the distance metric is the numbers of hops. In figure 5.4 (b),
a sink tree for router B has been shown. The paths from B to every router with minimum member of
hops.
G G
H
(a) A subnet (b) A sink tree for router B
Fig. 5.4.
5.5. STATIC ALGORITHMS (uP. Tech, Sem. Exam, 2005-06) (10 marks)
4 4
B
2 6
8
4
/2 2
2 6
4
5.5.3. Flooding
1. Basic Concepts
DO YOU KNOW?
This is another static algorithm.
In this algorithm, every Flooding always chooses the
incoming packet is sent out an every outgoing line except the shortest path because it chooses
line on which it has arrived. One disadvantage of floodingis every possible path in parallel.
that it generate a large number of duplicate packets. In fact, it Consequently, on other algorithm
produces infinite number of duplicate packets unless we can produce a shorter delay if we
somehow damp the process. There are various damping ignore the overhead generated by
techniques as under: the flooding process itself.
2Selective Fooding
Thae is slaghty more practical variation of flooding. in this algorithm, every incoming Packet ts
nd sent out on every output line Infact. packet is sent only on those lines which are approximately
going, in the night direction
Applicationsof Flooding
where
Flooding does have much practical applications. But, it is useful in military applications
a large number of routers are blown into pieces at anv
instant. In such applications, robustness of
9 8+24 1219
=31 ms
IA
32 ms
IH 2
Delay is Delay is
8 12 Entry corresponds
to shorter delay of
New routing the two
Vectors received table for router I
from 's two
neighbours
Fig. 5.9 Routing tables
The entries in router tables of figure 5.9 are the
boxes of figure 5.9. The entry in the first shaded box
delay vectors. For example, consider the shaded
shows that the delay from A to B is 10 m sec,
whereas the entry in the other shaded box indicates that
the delay from A to D is 38 msec. Let us
consider how router I computes its new route to router G.
between I and G. Figure 5.10 shows the two possible routes
This is due to a problem called count-to-infinity problem.
(ii) This problem can be solved by using the split horizon algorithm.
(ii) Another problem is that this algorithm does not take the line bandwidth into consideration
when choosing root.
(i) This is a serious problem which led to the replacement of this algorithm by the Link State
Routing algorithm.
5.6.2. Count to Infinity Problem* (u.P. Tech, Sem. Exam, 2006-07, 2007-08) (10 marks)
The distance vector routing works properly theoretically but practically it has a serious
problem.
Although we get a correct answer, we get it slowly. In other words it reacts quickly to good news but
does so leisurely to bad news. Let us consider a router whose best route
A
todestination Xis large. If
on the next
exchange neighbour suddenly reports a short delay X,to the router will switch over
and start using the line to A for sending the traffic to destination X. Thus, in one vector
exchange, the
good news is processed. Let us see how fast does a good news propagate. Let us consider a liner
subnet of figure 5.11 which has five nodes. The delay metric used is the number of
hops. Assume
that A is initially down and that all the other routes know this. Hence, all the routers have recorded
that the delay to A is infinity. When A becomes OK, the other routers come to know about it via the
vector exchanges. Then suddenly a vector exchange at all the routers will take
At the time of first vector
place simultaneously.
exchange, B comes to know that its left neighbour has a zero delay to A. So
as shown in
figure 5.11, B makes an entry in its routing table that A is one hop away to the left. All the
256
Computer Networks
other routers still think that Ais down. So in the second row of figure 5.11, the entries below
CDE
are , On the second vector
exchange, C comes to know that B has a path of 1 hop length to A, so C
updates its routing table and indicates a path of 2 hop length. But, D and E do not change their table
entries.
A is
down This shows that delay to A is
Initially (or A is oo hops away to left)
1 2 3 4 After 4 exchanges
Fig.5.11.
3 3 4 After 2 exchanges
5 4 After 3 exchanges
5 6 After 4 exchanges
7 6 7 6 After 5 exchanges
8 8 After 6 exchanges
Fig. 5.12.
So, after the second vector exchange the entries in the third row of figure 5.11 are:
B C D
1 2 0 After 2 exchanges
We
Similarly, D and E will update their routing tables after 3 and 4 exchanges respectively. So,
conclude that the good news of A has recovered has spread at a rate of one hop per exchange
Updated No change
entry
On the second
exchange,
C realizes that both its
neighbours
(B and D) claim to have a path ot
length 3 to A. So, picks one of them at random and
it
makes its
in row 3 of new distance to A as 4. This is shown
figure
5.12. It is repeated below:
B
2 4
3 3 After 2 exchanges
C
changes its entry
Similarly, the other routers keep updating their tables after every exchange. It is expected that
finally we should get in the router tables of B, C, D and E indicating that A is down. We do reach
o