0% found this document useful (0 votes)
2 views48 pages

Network layer

The document provides an overview of the Network Layer in the OSI model, detailing its primary functions such as routing, logical addressing, and fragmentation of data packets. It also discusses various routing techniques including static, default, and dynamic routing, along with their advantages and disadvantages. Additionally, the document explains routing metrics, the optimality principle, and algorithms like Dijkstra's for finding the shortest path in networks.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views48 pages

Network layer

The document provides an overview of the Network Layer in the OSI model, detailing its primary functions such as routing, logical addressing, and fragmentation of data packets. It also discusses various routing techniques including static, default, and dynamic routing, along with their advantages and disadvantages. Additionally, the document explains routing metrics, the optimality principle, and algorithms like Dijkstra's for finding the shortest path in networks.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

UNIT-3Next →Pre

Network Layer
Network layer is the third layer in the OSI model of computer networks. It’s main function is
to transfer network packets from the source to the destination. It is involved both at the source
host and the destination host. At the source, it accepts a packet from the transport layer,
encapsulates it in a datagram and then deliver the packet to the data link layer so that it can
further be sent to the receiver. At the destination, the datagram is decapsulated, the packet is
extracted and delivered to the corresponding transport layer.

Features :

1. Main responsibility of Network layer is to carry the data packets from the source to the
destination without changing or using it.
2. If the packets are too large for delivery, they are fragmented i.e., broken down into smaller
packets.
3. It decides the root to be taken by the packets to travel from the source to the destination
among the multiple roots available in a network (also called as routing).
4. The source and destination addresses are added to the data packets inside the network
layer.

The main functions performed by the network layer are:


o Routing: When a packet reaches the router's input link, the router will move the packets
to the router's output link. For example, a packet from S1 to R1 must be forwarded to the
next router on the path to S2.
o Logical Addressing: The data link layer implements the physical addressing and
network layer implements the logical addressing. Logical addressing is also used to
distinguish between source and destination system. The network layer adds a header to
the packet which includes the logical addresses of both the sender and the receiver.
o Internetworking: This is the main role of the network layer that it provides the logical
connection between different types of networks.
o Fragmentation: The fragmentation is a process of breaking the packets into the smallest
individual data units that travel through different networks.

The services which are offered by the network layer protocol are as follows:
1. Packetizing –
The process of encapsulating the data received from upper layers of the network(also called
as payload) in a network layer packet at the source and decapsulating the payload from the
network layer packet at the destination is known as packetizing.

1
The source host adds a header that contains the source and destination address and some
other relevant information required by the network layer protocol to the payload received
from the upper layer protocol, and delivers the packet to the data link layer.

The destination host receives the network layer packet from its data link layer, decapsulates
the packet, and delivers the payload to the corresponding upper layer protocol. The routers
in the path are not allowed to change either the source or the destination address. The
routers in the path are not allowed to decapsulate the packets they receive unless they need
to be fragmented.

2. Routing and Forwarding –


These are two other services offered by the network layer. In a network, there are a number
of routes available from the source to the destination. The network layer specifies has some
strategies which find out the best possible route. This process is referred to as routing.
There are a number of routing protocols which are used in this process and they should be
run to help the routers coordinate with each other and help in establishing communication
throughout the network.
Forwarding is simply defined as the action applied by each router when a packet arrives at
one of its interfaces. When a router receives a packet from one of its attached networks, it
needs to forward the packet to another attached network (unicast routing) or to some
attached networks(in case of multicast routing).

[Link] Control –
Although it can be implemented in the network layer, but it is usually not preferred because
the data packet in a network layer maybe fragmented at each router, which makes error
checking inefficient in the network layer.

[Link] Control –
It regulates the amount of data a source can send without overloading the receiver. If the
source produces a data at a very faster rate than the receiver can consume it, the receiver
will be overloaded with data. To control the flow of data, the receiver should send a
feedback to the sender to inform the latter that it is overloaded with data. There is a lack of
flow control in the design of the network layer. It does not directly provide any flow
control. The datagrams are sent by the sender when they are ready, without any attention to
the readiness of the receiver.

[Link] Control –
Congestion occurs when the number of datagrams sent by source is beyond the capacity of
network or routers. This is another issue in the network layer protocol. If congestion
continues, sometimes a situation may arrive where the system collapses and no datagrams
are delivered. Although congestion control is indirectly implemented in network layer, but
still there is a lack of congestion control in the network layer.

2
Routing

o A Router is a process of selecting path along which the data can be transferred from
source to the destination. Routing is performed by a special device known as a router.
o A Router works at the network layer in the OSI model and internet layer in TCP/IP model
o A router is a networking device that forwards the packet based on the information
available in the packet header and forwarding table.
o The routing algorithms are used for routing the packets. The routing algorithm is nothing
but a software responsible for deciding the optimal path through which packet can be
transmitted.
o The routing protocols use the metric to determine the best path for the packet delivery.
The metric is the standard of measurement such as hop count, bandwidth, delay, current
load on the path, etc. used by the routing algorithm to determine the optimal path to the
destination.
o The routing algorithm initializes and maintains the routing table for the process of path
determination.

Routing Metrics and Costs

Routing metrics and costs are used for determining the best route to the destination. The factors
used by the protocols to determine the shortest path, these factors are known as a [Link]
are the network variables used to determine the best route to the destination. For some protocols
use the static metrics means that their value cannot be changed and for some other routing
protocols use the dynamic metrics means that their value can be assigned by the system
administrator.

The most common metric values are given below:

o Hop count: Hop count is defined as a metric that specifies the number of passes through
internetworking devices such as a router, a packet must travel in a route to move from
source to the destination. If the routing protocol considers the hop as a primary metric
value, then the path with the least hop count will be considered as the best path to move
from source to the destination.
o Delay: It is a time taken by the router to process, queue and transmit a datagram to an
interface. The protocols use this metric to determine the delay values for all the links
along the path end-to-end. The path having the lowest delay value will be considered as
the best path.
3
o Bandwidth: The capacity of the link is known as a bandwidth of the link. The bandwidth
is measured in terms of bits per second. The link that has a higher transfer rate like
gigabit is preferred over the link that has the lower capacity like 56 kb. The protocol will
determine the bandwidth capacity for all the links along the path, and the overall higher
bandwidth will be considered as the best route.
o Load: Load refers to the degree to which the network resource such as a router or
network link is busy. A Load can be calculated in a variety of ways such as CPU
utilization, packets processed per second. If the traffic increases, then the load value will
also be increased. The load value changes with respect to the change in the traffic.
o Reliability: Reliability is a metric factor may be composed of a fixed value. It depends
on the network links, and its value is measured dynamically. Some networks go down
more often than others. After network failure, some network links repaired more easily
than other network links. Any reliability factor can be considered for the assignment of
reliability ratings, which are generally numeric values assigned by the system
administrator.

Types of Routing

Routing can be classified into three categories:

o Static Routing
o Default Routing
o Dynamic Routing

Static Routing
o Static Routing is also known as Nonadaptive Routing.
o It is a technique in which the administrator manually adds the routes in a routing table.

4
o A Router can send the packets for the destination along the route defined by the
administrator.
o In this technique, routing decisions are not made based on the condition or topology of
the networks

Advantages Of Static Routing

Following are the advantages of Static Routing:

o No Overhead: It has ho overhead on the CPU usage of the router. Therefore, the cheaper
router can be used to obtain static routing.
o Bandwidth: It has not bandwidth usage between the routers.
o Security: It provides security as the system administrator is allowed only to have control
over the routing to a particular network.

Disadvantages of Static Routing:

Following are the disadvantages of Static Routing:

o For a large network, it becomes a very difficult task to add each route manually to the
routing table.
o The system administrator should have a good knowledge of a topology as he has to add
each route manually.

Default Routing
o Default Routing is a technique in which a router is configured to send all the packets to
the same hop device, and it doesn't matter whether it belongs to a particular network or
not. A Packet is transmitted to the device for which it is configured in default routing.
o Default Routing is used when networks deal with the single exit point.
o It is also useful when the bulk of transmission networks have to transmit the data to the
same hp device.
o When a specific route is mentioned in the routing table, the router will choose the specific
route rather than the default route. The default route is chosen only when a specific route
is not mentioned in the routing table.

5
Dynamic Routing
o It is also known as Adaptive Routing.
o It is a technique in which a router adds a new route in the routing table for each packet in
response to the changes in the condition or topology of the network.
o Dynamic protocols are used to discover the new routes to reach the destination.
o In Dynamic Routing, RIP and OSPF are the protocols used to discover the new routes.
o If any route goes down, then the automatic adjustment will be made to reach the
destination.

The Dynamic protocol should have the following features:

o All the routers must have the same dynamic routing protocol in order to exchange the
routes.
o If the router discovers any change in the condition or topology, then router broadcast this
information to all other routers.

Advantages of Dynamic Routing:


o It is easier to configure.
o It is more effective in selecting the best route in response to the changes in the condition
or topology.

Disadvantages of Dynamic Routing:


o It is more expensive in terms of CPU and bandwidth usage.
o It is less secure as compared to default and static routing.

The Optimality Principle


The optimality principle in computer networks is stated as follows −

6
The purpose of a routing algorithm at a router is to decide which output line an incoming packet
should go. The optimal path from a particular router to another may be the least cost path, the
least distance path, the least time path, the least hops path or a combination of any of the above.
The optimality principle can be logically proved as follows −
 If a better route could be found between router J and router K, the path from router I to
router K via J would be updated via this route. Thus, the optimal path from J to K will
again lie on the optimal path from I to K.
Example
Consider a network of routers, {G, H, I, J, K, L, M, N} as shown in the figure. Let the optimal
route from I to K be as shown via the green path, i.e. via the route I-G-J-L-K. According to the
optimality principle, the optimal path from J to K with be along the same route, i.e. J-L-K.

Now, suppose we find a better route from J to K is found, say along J-M-N-K. Consequently, we
will also need to update the optimal route from I to K as I-GJ- M-N-K, since the previous route
ceases to be optimal in this situation. This new optimal path is shown line orange lines in the
following figure −

Shortest Path Routing algorithm


One algorithm for finding the shortest path from a starting node to a target node in a weighted
graph is Dijkstra’s algorithm. The algorithm creates a tree of shortest paths from the starting
vertex, the source, to all other points in the graph.

7
Dijkstra’s algorithm, published in 1959 and named after its creator Dutch computer scientist
Edsger Dijkstra, can be applied on a weighted graph. The graph can either be directed or
undirected.

Suppose a student wants to go from home to school in the shortest possible way. She knows
some roads are heavily congested and difficult to use. In Dijkstra's algorithm, this means the
edge has a large weight--the shortest path tree found by the algorithm will try to avoid edges
with larger weights. If the student looks up directions using a map service, it is likely they may
use Dijkstra's algorithm, as well as others.

Find the shortest path from home to school in the following graph:

The shortest path, which could be found using Dijkstra's algorithm, is

Home→B→D→F→School

Dijktstra's Algorithm:

At the end each node will be labeled with its distance from 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. 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.

Look at the weighted undirected graph of Figure.1(a), where the weights represent, for example,
distance. We want to find shortest path from A to D. We start by making node A as permanent,
indicated by a filled in circle. Then we examine each of the nodes adjacent to A (the working
node), relabeling each one with the distance to A. Whenever a node is relabeled, we also label it

8
with the node from which the probe was made so that we can construct the final path later.
Having examined each of the nodes adjacent to A, we examine all the tentatively labeled nodes
in the whole graph and make the one with the smallest label permanent, as shown
in Figure.1(b). This one becomes new working node.

We 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 the node, we have a shorter
path, so the node is relabeled. 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. The Figure. 1 shows the first five steps of the algorithm.

Note: Dijkstra's Algorithm is applicable only when cost of all the nodes is non-negative.

9
Flooding

Flooding is the static routing algorithm. In this algorithm, every incoming packet is sent on all
outgoing lines except the line on which it has [Link] major problem of this algorithm is
that it generates a large number of duplicate packets on the network.
Several measures are takes to stop the duplication of packets. These are:
1. One solution is to include a hop counter in the header of each packet. This counter is decremented at
each hop along the path. When this counter reaches zero the packet is discarded. Ideally, the hop
counter should become zero at the destination hop, indicating that there are no more intermediate
hops and destination is reached. This requires the knowledge of exact number of hops from a source to
destination.

2. Another technique is to keep the track of the packed that have been flooded, to avoid sending
them a second time. For this, 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.
3. Another solution is to use selective flooding. In selective flooding the routers do not send
every incoming packet out on every output line. Instead packet is sent only on those lines which
are approximately going in the right direction.
Hierarchical Routing

When the network size grows, the number of routers in the network increases. Consequently, the
size of routing tables increases, as well, and routers can't handle network traffic as efficiently.
We use hierarchical routing to overcome this problem.

Let's examine this subject with an example-We use Distance Vector algorithms to find best
routes between nodes. In the situation depicted below, every node of the network has to save a
routing table with 17 records. Here is a typical graph and routing table for A:

Network graph and A's routing table

10
In hierarchical routing, routers are classified in groups known as regions. Each router has only
the information about the routers in its own region and has no information about routers in other
regions. So routers just save one record in their table for every other region. In this example, we
have classified our network into five regions (see below).

If A wants to send packets to any router in region 2 (D, E, F or G), it sends them to B, and so on.
As you can see, in this type of routing, the tables can be summarized, so network efficiency
improves. The above example shows two-level hierarchical routing. We can also use three- or
four-level hierarchical routing.

In three-level hierarchical routing, the network is classified into a number of clusters. Each
cluster is made up of a number of regions, and each region contains a number or routers.
Hierarchical routing is widely used in Internet routing and makes use of several routing
protocols.

Unicast routing
Most of the traffic on the internet and intranets known as unicast data or unicast traffic is sent
with specified destination. Routing unicast data over the internet is called unicast routing. It is
the simplest form of routing because the destination is already known. Hence the router just has
to look up the routing table and forward the packet to next hop.

11
Broadcast routing
By default, the broadcast packets are not routed and forwarded by the routers on any network.
Routers create broadcast domains. But it can be configured to forward broadcasts in some
special cases. A broadcast message is destined to all network devices.
Broadcast routing can be done in two ways (algorithm):
 A router creates a data packet and then sends it to each host one by one. In this case, the
router creates multiple copies of single data packet with different destination addresses.
All packets are sent as unicast but because they are sent to all, it simulates as if router is
broadcasting.
This method consumes lots of bandwidth and router must destination address of each
node.
 Secondly, when router receives a packet that is to be broadcasted, it simply floods those
packets out of all interfaces. All routers are configured in the same way.

This method is easy on router's CPU but may cause the problem of duplicate packets
received from peer routers.
Reverse path forwarding is a technique, in which router knows in advance about its
predecessor from where it should receive broadcast. This technique is used to detect and
discard duplicates.

Multicast Routing
Multicast routing is special case of broadcast routing with significance difference and
challenges. In broadcast routing, packets are sent to all nodes even if they do not want it. But in
Multicast routing, the data is sent to only nodes which wants to receive the packets.

12
The router must know that there are nodes, which wish to receive multicast packets (or stream)
then only it should forward. Multicast routing works spanning tree protocol to avoid looping.
Multicast routing also uses reverse path Forwarding technique, to detect and discard duplicates
and loops.

Distance Vector Routing Algorithm-


Distance vector routing algorithms require that each node exchanges information between
neighbors, that is to say between nodes directly connected. Therefore, each node can keep
updated a table by adding information on all its neighbors. This table shows the distance is each
node and each network to be [Link] Vector Routing is a dynamic routing algorithm.

It works in the following steps-

Step-1:Each router prepares its routing table. By their local knowledge. each router knows
about-
i)All the routers present in the network

ii)Distance to its neighboring routers

Step-2:

Each router exchanges its distance vector with its neighboring routers.

Each router prepares a new routing table using the distance vectors it has obtained from its
neighbors.

This step is repeated for (n-2) times if there are n routers in the network.

After this, routing tables converge / become stable.

13
Example-

Consider-

There is a network consisting of 4 [Link] weights are mentioned on the [Link]


could be distances or costs or delays.

Step-01:

Each router prepares its routing table using its local knowledge.

Routing table prepared by each router is shown below-

At Router A-

Destination Distance Next Hop

A 0 A

B 2 B

C ∞ –

D 1 D
At Router B-

Destinatio
Distance Next Hop
n

A 2 A

B 0 B

C 3 C

14
D 7 D
At Router C-

Destinatio
Distance Next Hop
n

A ∞ –

B 3 B

C 0 C

D 11 D

At Router D-

Destinatio
Distance Next Hop
n

A 1 A

B 7 B

C 11 C

D 0 D

Step-02:

Each router exchanges its distance vector obtained in Step-01 with its [Link] exchanging the
distance vectors, each router prepares a new routing table.

This is shown below-

At Router A-

Router A receives distance vectors from its neighbors B and D.

Router A prepares a new routing table as-

15
Cost of reaching destination B from router A = min { 2+0 , 1+7 } = 2 via B.

Cost of reaching destination C from router A = min { 2+3 , 1+11 } = 5 via B.

Cost of reaching destination D from router A = min { 2+7 , 1+0 } = 1 via D.

Explanation For Destination B

Router A can reach the destination router B via its neighbor B or neighbor D.
It chooses the path which gives the minimum cost.
Cost of reaching router B from router A via neighbor B = Cost (A→B) + Cost (B→B)= 2 + 0 = 2
Cost of reaching router B from router A via neighbor D = Cost (A→D) + Cost (D→B) = 1 + 7 = 8
Since the cost is minimum via neighbor B, so router A chooses the path via B.
It creates an entry (2, B) for destination B in its new routing table.
Similarly, we calculate the shortest path distance to each destination router at every router.

Thus, the new routing table at router A is-

Distanc
Destination Next Hop
e

A 0 A

B 2 B

C 5 B

D 1 D

At Router B-

Router B receives distance vectors from its neighbors A, C and D.

Router B prepares a new routing table as-

16
Cost of reaching destination A from router B = min { 2+0 , 3+∞ , 7+1 } = 2 via A.

Cost of reaching destination C from router B = min { 2+∞ , 3+0 , 7+11 } = 3 via C.

Cost of reaching destination D from router B = min { 2+1 , 3+11 , 7+0 } = 3 via A.

Thus, the new routing table at router B is-

Destinatio
Distance Next Hop
n

A 2 A

B 0 B

C 3 C

D 3 A

At Router C-

Router C receives distance vectors from its neighbors B and D.

Router C prepares a new routing table as-

Cost of reaching destination A from router C = min { 3+2 , 11+1 } = 5 via B.

Cost of reaching destination B from router C = min { 3+0 , 11+7 } = 3 via B.

17
Cost of reaching destination D from router C = min { 3+7 , 11+0 } = 10 via B.

Thus, the new routing table at router C is-

Destinatio
Distance Next Hop
n

A 5 B

B 3 B

C 0 C

D 10 B

At Router D-

Router D receives distance vectors from its neighbors A, B and C.

Router D prepares a new routing table as-

Cost of reaching destination A from router D = min { 1+0 , 7+2 , 11+∞ } = 1 via A.

Cost of reaching destination B from router D = min { 1+2 , 7+0 , 11+3 } = 3 via A.

Cost of reaching destination C from router D = min { 1+∞ , 7+3 , 11+0 } = 10 via B.

Thus, the new routing table at router D is-

Destinatio
Distance Next Hop
n

18
A 1 A

B 3 A

C 10 B

D 0 D
Step-03:

Each router exchanges its distance vector obtained in Step-02 with its neighboring [Link]
exchanging the distance vectors, each router prepares a new routing table.

This is shown below-

At Router A-

Router A receives distance vectors from its neighbors B and D.

Router A prepares a new routing table as-

Cost of reaching destination B from router A = min { 2+0 , 1+3 } = 2 via B.

Cost of reaching destination C from router A = min { 2+3 , 1+10 } = 5 via B.

Cost of reaching destination D from router A = min { 2+3 , 1+0 } = 1 via D.

Thus, the new routing table at router A is-

Destinatio
Distance Next Hop
n

A 0 A

19
B 2 B

C 5 B

D 1 D

At Router B-

Router B receives distance vectors from its neighbors A, C and D.

Router B prepares a new routing table as-

Cost of reaching destination A from router B = min { 2+0 , 3+5 , 3+1 } = 2 via A.

Cost of reaching destination C from router B = min { 2+5 , 3+0 , 3+10 } = 3 via C.

Cost of reaching destination D from router B = min { 2+1 , 3+10 , 3+0 } = 3 via A.

Thus, the new routing table at router B is-

Destinatio
Distance Next Hop
n

A 2 A

B 0 B

C 3 C

20
D 3 A

At Router C-

Router C receives distance vectors from its neighbors B and D.

Router C prepares a new routing table as-

Cost of reaching destination A from router C = min { 3+2 , 10+1 } = 5 via B.

Cost of reaching destination B from router C = min { 3+0 , 10+3 } = 3 via B.

Cost of reaching destination D from router C = min { 3+3 , 10+0 } = 6 via B.

Thus, the new routing table at router C is-

Destinatio
Distance Next Hop
n

A 5 B

B 3 B

C 0 C

D 6 B

At Router D-

Router D receives distance vectors from its neighbors A, B and C.

21
Router D prepares a new routing table as-

Cost of reaching destination A from router D = min { 1+0 , 3+2 , 10+5 } = 1 via A.

Cost of reaching destination B from router D = min { 1+2 , 3+0 , 10+3 } = 3 via A.

Cost of reaching destination C from router D = min { 1+5 , 3+3 , 10+0 } = 6 via A.

Thus, the new routing table at router D is-

Destinatio
Distance Next Hop
n

A 1 A

B 3 A

C 6 A

D 0 D

These will be the final routing tables at each router.

Identifying Unused Links-

After routing tables converge (becomes stable),

Some of the links connecting the routers may never be used.

In the above example, we can identify the unused links as-

We have-

The value of next hop in the final routing table of router A suggests that only edges AB and AD are used.

The value of next hop in the final routing table of router B suggests that only edges BA and BC are used.

22
The value of next hop in the final routing table of router C suggests that only edge CB is used.

The value of next hop in the final routing table of router D suggests that only edge DA is used.

Thus, edges BD and CD are never used.

Count To Infinity Problem


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:

Now 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.

CONGESTION CONTROL ALGORITHMS


congestion is an important issue that can arise in packet switched network. Congestion is a
situation in Communication Networks in which too many packets are present in a part of the
subnet, performance degrades. Congestion in a network may occur when the load on the
network (i.e. the number of packets sent to the network) is greater than the capacity of the
23
network (i.e. the number of packets a network can handle.). Network congestion occurs in case
of traffic overloading.

In other words when too much traffic is offered, congestion sets in and performance degrades
sharply

Causing of Congestion:

The various causes of congestion in a subnet are:


• The input traffic rate exceeds the capacity of the output lines. If suddenly, a stream of packet start
arriving on three or four input lines and all need the same output line. In this case, a queue will be built
up. If there is insufficient memory to hold all the packets, the packet will be lost. Increasing
the memory to unlimited size does not solve the problem. This is because, by the time packets reach
front of the queue, they have already timed out (as they waited the queue). When timer goes off source
transmits duplicate packet that are also added to the queue. Thus same packets are added again and
again, increasing the load all the way to the destination.

• The routers are too slow to perform bookkeeping tasks (queuing buffers, updating tables, etc.).
• The routers’ buffer is too limited.
• Congestion in a subnet can occur if the processors are slow. Slow speed CPU at routers will
perform the routine tasks such as queuing buffers, updating table etc slowly. As a result of this,
queues are built up even though there is excess line capacity.
• Congestion is also caused by slow links. This problem will be solved when high speed links are
used. But it is not always the case. Sometimes increase in link bandwidth can further deteriorate
the congestion problem as higher speed links may make the network more
[Link] can make itself worse. If a route!” does not have free buffers, it start

24
ignoring/discarding the newly arriving packets. When these packets are discarded, the sender
may retransmit them after the timer goes off. Such packets are transmitted by the sender again
and again until the source gets the acknowledgement of these packets. Therefore multiple
transmissions of packets will force the congestion to take place at the sending end.

How to correct the Congestion Problem:


Congestion Control refers to techniques and mechanisms that can either prevent congestion, before it
happens, or remove congestion, after it has happened. Congestion control mechanisms are divided into
two categories, one category prevents the congestion from happening and the other category removes
congestion after it has taken place.

These two categories are:


1. Open loop
2. Closed loop

Open Loop Congestion Control

• In this method, policies are used to prevent the congestion before it happens.
• Congestion control is handled either by the source or by the destination.
• The various methods used for open loop congestion control are:
Retransmission Policy

• The sender retransmits a packet, if it feels that the packet it has sent is lost or corrupted.
• However retransmission in general may increase the congestion in the network. But we need
to implement good retransmission policy to prevent congestion.
• The retransmission policy and the retransmission timers need to be designed to optimize
efficiency and at the same time prevent the congestion.
Window Policy

• To implement window policy, selective reject window method is used for congestion control.

25
• Selective Reject method is preferred over Go-back-n window as in Go-back-n method, when
timer for a packet times out, several packets are resent, although some may have arrived safely
at the receiver. Thus, this duplication may make congestion worse.
• Selective reject method sends only the specific lost or damaged packets

Acknowledgement Policy

• The acknowledgement policy imposed by the receiver may also affect congestion.
• If the receiver does not acknowledge every packet it receives it may slow down the sender and
help prevent congestion.
• Acknowledgments also add to the traffic load on the network. Thus, by sending fewer
acknowledgements we can reduce load on the network.
• To implement it, several approaches can be used:
1. A receiver may send an acknowledgement only if it has a packet to be sent.
2. A receiver may send an acknowledgement when a timer expires.
3. A receiver may also decide to acknowledge only N packets at a time.
Discarding Policy

• A router may discard less sensitive packets when congestion is likely to happen.
• Such a discarding policy may prevent congestion and at the same time may not harm the
integrity of the transmission.
Admission Policy

• An admission policy, which is a quality-of-service mechanism, can also prevent congestion in


virtual circuit networks.
• Switches in a flow first check the resource requirement of a flow before admitting it to the
network.
• A router can deny establishing a virtual circuit connection if there is congestion in the
“network or if there is a possibility of future congestion.
Closed Loop Congestion Control

• Closed loop congestion control mechanisms try to remove the congestion after it happens.
• The various methods used for closed loop congestion control are:
Backpressure

• Back pressure is a node-to-node congestion control that starts with a node and propagates, in
the opposite direction of data flow.

26
The backpressure technique can be applied only to virtual circuit networks. In such virtual circuit each
node knows the upstream node from which a data flow is coming.
In this method of congestion control, the congested node stops receiving data from the
immediate upstream node or nodes.
• This may cause the upstream node on nodes to become congested, and they, in turn, reject data
from their upstream node or nodes.
• As shown in fig node 3 is congested and it stops receiving packets and informs its upstream
node 2 to slow down. Node 2 in turns may be congested and informs node 1 to slow down. Now
node 1 may create congestion and informs the source node to slow down. In this way the
congestion is alleviated. Thus, the pressure on node 3 is moved backward to the source to
remove the congestion.
Choke Packet
• In this method of congestion control, congested router or node sends a special type of packet called
choke packet to the source to inform it about the congestion.
• Here, congested node does not inform its upstream node about the congestion as in
backpressure method.
• In choke packet method, congested node sends a warning directly to the source station i.e. the
intermediate nodes through which the packet has traveled are not warned.

Implicit Signaling

• In implicit signaling, there is no communication between the congested node or nodes and the
source.
• The source guesses that there is congestion somewhere in the network when it does not
receive any acknowledgment. Therefore the delay in receiving an acknowledgment is
interpreted as congestion in the network.
• On sensing this congestion, the source slows down.
• This type of congestion control policy is used by TCP.

27
Explicit Signaling

• In this method, the congested nodes explicitly send a signal to the source or destination to
inform about the congestion.
• Explicit signaling is different from the choke packet method. In choke packed method, a
separate packet is used for this purpose whereas in explicit signaling method, the signal is
included in the packets that carry data .
• Explicit signaling can occur in either the forward direction or the backward direction .
• In backward signaling, a bit is set in a packet moving in the direction opposite to the
congestion. This bit warns the source about the congestion and informs the source to slow
down.
• In forward signaling, a bit is set in a packet moving in the direction of congestion. This bit
warns the destination about the congestion. The receiver in this case uses policies such as
slowing down the acknowledgements to remove the congestion.
Congestion control algorithms

Leaky Bucket Algorithm


• It is a traffic shaping mechanism that controls the amount and the rate of the traffic sent to the
network.
• A leaky bucket algorithm shapes bursty traffic into fixed rate traffic by averaging the data rate.
• Imagine a bucket with a small hole at the bottom.
• The rate at which the water is poured into the bucket is not fixed and can vary but it leaks from
the bucket at a constant rate. Thus (as long as water is present in bucket), the rate at which the
water leaks does not depend on the rate at which the water is input to the bucket.


Also, when the bucket is full, any additional water that enters into the bucket spills over the sides and is
lost.

28
• The same concept can be applied to packets in the network. Consider that data is coming from
the source at variable speeds. Suppose that a source sends data at 12 Mbps for 4 seconds. Then
there is no data for 3 seconds. The source again transmits data at a rate of 10 Mbps for 2
seconds. Thus, in a time span of 9 seconds, 68 Mb data has been transmitted.

If a leaky bucket algorithm is used, the data flow will be 8 Mbps for 9 seconds. Thus constant
flow is maintained.

Token bucket Algorithm

• The leaky bucket algorithm allows only an average (constant) rate of data flow. Its major
problem is that it cannot deal with bursty data.
• A leaky bucket algorithm does not consider the idle time of the host. For example, if the host
was idle for 10 seconds and now it is willing to sent data at a very high speed for another 10
seconds, the total data transmission will be divided into 20 seconds and average data rate will be
maintained. The host is having no advantage of sitting idle for 10 seconds.
• To overcome this problem, a token bucket algorithm is used. A token bucket algorithm allows
bursty data transfers.
• A token bucket algorithm is a modification of leaky bucket in which leaky bucket contains
tokens.
• In this algorithm, a token(s) are generated at every clock tick. For a packet to be transmitted,
system must remove token(s) from the bucket.
• Thus, a token bucket algorithm allows idle hosts to accumulate credit for the future in form of
tokens.

29
For example, if a system generates 100 tokens in one clock tick and the host is idle for 100
ticks. The bucket will contain 10,000 tokens.
Now, if the host wants to send bursty data, it can consume all 10,000 tokens at once for sending
10,000 cells or bytes.
Thus a host can send bursty data as long as bucket is not empty.

Quality of Service (QoS) -


In one word, Quality of Service (QoS) can be referred as efficiency. We define Quality of
Service as "How well or efficiently data transmissions are taking place".
So the question arises "How can we improve our network's efficiency?" or "How can we
improve our Quality of Service?". It can be achieved by managing data traffic which results
in reduced packet loss, latency, and jitter on the respective network. This is all done by setting
up priorities for specific types of data that traverse through the network.
The enterprise networks or commercial networks (networks which connects all the users and the
system connected through a local area network, to the applications in the data center) they
provide services in the form of applications, for example, WhatsApp, from which we can send
and receive various kinds of data, like audio, video, text, etc. Organizations like this use Quality
of Service to meet the traffic requirements which results in the prevention of the degradation
of the quality, which can be caused by packet loss, delay, and jitter.
How to achieve Quality of Service?
Let's get into some details and say, your organization wants to achieve Quality of Service, which
can be done by using some tools and techniques, like jitter buffer and traffic shaping.

30
Jitter buffer

This is a temporary storage buffer which is used to store the incoming data packets, it is used
in packet-based networks to ensure that the continuity of the data streams doesn't get
disturbed, it does that by smoothing out the packet arrival times during periods of network
congestion.

Traffic shaping

This technique which is also known as packet shaping, is a congestion control or management
technique that helps to regulate network data transfer by delaying the flow of least important or
least necessary data packets.
QoS is included in the service-level agreement when an organization signs it with its network service
provider which guarantees the selected performance level.

There are 2 types of Quality of Service Solutions:

1. Stateless solution: Here, the server is not required to keep or store the server information
or session details to itself. The routers maintain no fine-grained state about traffic, one
positive factor of this is, that it's scalable and robust. But also, it has weak services as
there is no guarantee about the kind of performance delay in a particular application
which we encounter. In the stateless solution, the server and client are loosely
coupled and can act.
2. Stateful solution: Here, the server is required to maintain the current state and session
information, the routers maintain per-flow state as the flow is very important in
providing the Quality-of-Service which is providing powerful services such as guaranteed
services and high resource utilization, provides protection, and is much less scalable and
robust. Here, the server and client are tightly bounded.
Quality of Service Parameters:

QoS can be measured quantitatively by using several parameters


 Packet loss: it happens when the network links become congested and the routers and
switches start dropping the packets. When these packets are dropped during real-time
communication, such as audio or video, these sessions can experience jitter and gaps in
speech.
 Jitter: occurs as the result of network congestion, timing drift, and route changes. And
also, too much jitter can degrade the quality of audio communication.
 Latency: is the time delay, which is taken by a packet to travel from its source to its
destination. For a great system, latency should be as low as possible, ideally, it should be
close to zero.
 Bandwidth: is the capacity of a network channel to transmit maximum possible data
through the channel in a certain amount of time. QoS optimizes a network by managing
its bandwidth and setting the priorities for those applications which require more
resources as compared to other applications.

31
 Mean opinion score: it is a metric for rating the audio quality which uses a five-point
scale, with a five indicating the highest or best quality.

Implementing Quality of Service:

We can implement Quality of service through three of the following existing models:
1. Best Effort: if we are applying this model then, it means that we are prioritizing all the
data packets equally. But since we all setting the priority order like this, then there is no
guarantee that all the data packets will be delivered, but it will put up the best effort to
deliver all of them. Point to remember is, that the best-effort model is applied when
networks haven’t configured with the QoS policies or incase their network infrastructure
does not support QoS.
2. Integrated Services: or IntServ, this QoS model reserves the bandwidth along a specific
path on the network. The applications ask the network's resource reservation for
themselves and parallelly the network devices monitor the flow of packets to make sure
network resources can accept packets. Point to remember: while implementing Integrated
Services Model, the IntServ-capable routers and resource reservation protocol is
necessary. This model has limited scalability and high consumption of the network
resources.
3. Differentiated Services: in this QoS model, the network elements such as routers and
switches are configured to serve multiple categories of traffic with different priority
orders. A company can categorize the network traffic based on its requirements. Eg.
Assigning higher priority to audio traffic etc.

Internetworking
Internetworking started as a way to connect disparate types of computer networking
technology. Computer network term is used to describe two or more computers that are linked
to each other. When two or more computer LANs or WANs or computer network segments are
connected using devices such as a router and configure by logical addressing scheme with
a protocol such as IP, then it is called as computer internetworking.
Internetworking is a term used by Cisco. Any interconnection among or between public, private,
commercial, industrial, or governmental computer networks may also be defined as an
internetwork or “Internetworking“.In modern practice, the interconnected computer networks
or Internetworking use the Internet Protocol. Two architectural models are commonly used to describe
the protocols and methods used in internetworking. The standard reference model
for internetworking is Open Systems Interconnection (OSI).

32
Type of Internetworking

Internetworking is implemented in Layer 3 (Network Layer) of this model The most notable
example of internetworking is the Internet (capitalized). There are three variants of internetwork
or Internetworking, depending on who administers and who participates in them :
• Extranet
• Intranet
• Internet
Intranets and extranets may or may not have connections to the Internet. If connected to the
Internet, the intranet or extranet is normally protected from being accessed from the Internet
without proper authorization. The Internet is not considered to be a part of the intranet or
extranet, although it may serve as a portal for access to portions of an extranet.
Extranet

An extranet is a network of internetwork or Internetworking that is limited in scope to a single


organisation or entity but which also has limited connections to the networks of one or more
other usually, but not necessarily, trusted organizations or entities .Technically, an extranet may
also be categorized as a MAN, WAN, or other type of network, although, by definition, an
extranet cannot consist of a single LAN; it must have at least one connection with an external
network.
Intranet

An intranet is a set of interconnected networks or Internetworking, using the Internet


Protocol and uses IP-based tools such as web browsers and ftp tools, that is under the control
of a single administrative entity. That administrative entity closes the intranet to the rest of the
world, and allows only specific users. Most commonly, an intranet is the internal network of a
company or other enterprise. A large intranet will typically have its own web server to provide
users with browseable information.

Internet

A specific Internetworking, consisting of a worldwide interconnection of governmental,


academic, public, and private networks based upon the Advanced Research Projects Agency

33
Network (ARPANET) developed by ARPA of the U.S. Department of Defense also home to
the World Wide Web (WWW) and referred to as the ‘Internet‘ with a capital ‘I’ to
distinguish it from other generic internetworks. Participants in the Internet, or their service
providers, use IP Addresses obtained from address registries that control assignments.

IP address

An IP (Internet Protocol) address is a numerical label assigned to the devices connected to a


computer network that uses the IP for [Link] address act as an identifier for a specific
machine on a particular network. It also helps you to develop a virtual connection between a
destination and a source. The IP address is also called IP number or internet address. It helps you
to specify the technical format of the addressing and packets scheme. Most networks combine
TCP with IP.

A computer network consists of various devices such as desktops, laptops, servers, routers,
and, switches to share data and resources. These devices are connected together using wired or
wireless medium. Each device in the network has an address to recognize it. Hence, this address
is called the IP address, which stands for Internet Protocol Address. The IP address helps the
devices in the network to communicate with each other. Furthermore, there are two types of IP
address. Namely, they are static IP address and dynamic IP address. A static IP address is a
permanent address assigned to a device while a dynamic address is a temporary address that
changes frequently.

Static IP Address
Static IP address is a fixed IP address assigned to the device manually. It was the original method
to assign IP addresses to the devices in the network. Here, for each computer, the network
administrator has to open the network configuration page and manually type the IP address.
Additionally, the administrator should also include details such as subnet mask and default
gateway. Moreover, this process had to be followed on all the devices in the network. Thus, it is
difficult to assign static IP addresses when there are a large number of devices in the network.

34
However, the static IP address is not changed until it is manually changed by the network
administrator or the Internet Service Provider (ISP). Also, this address does not change each time
when the user connects to the network. In other words, the device always uses the same IP
address to connect to the internet. Therefore, the static IP addressing provides multiple
advantages. It gives minimum downtime while providing remote access. Also, the user can
access the device from any location.

Dynamic IP Address
A dynamic IP address is an address obtained from a Dynamic Host Configuration Protocol
(DHCP) server. It assigns a device with dynamic IP address, subnet mask, default gateway, and
a DNS server. In a Microsoft computer, selecting the option “obtain an IP address automatically”
in the network property window will set the device to obtain an IP address dynamically.
The dynamic IP address changes frequently. Each time the device connects to the network, the
dynamic IP address changes. When the device tries to connect to the network, the DHCP server
provides a dynamic address. When the user types a URL on the web browser, the DNS server
maps the domain name to the IP address. Overall, Dynamic IP addressing is automatic and it
makes managing a network easier.

35
There are two types of IP addresses:

o IPv4
o IPv6

IPV4

IPv4 is a version 4 of IP. It is a current version and the most commonly used IP address. It is a
32-bit address written in four numbers separated by 'dot', i.e., periods. This address is unique for
each device.

For example, [Link]

The above example represents the IP address in which each group of numbers separated by
periods is called an Octet. Each number in an octet is in the range from 0-255. This address can
produce 4,294,967,296 possible unique addresses.

In today's computer network world, computers do not understand the IP addresses in the standard
numeric format as the computers understand the numbers in binary form only. The binary
number can be either 1 or 0. The IPv4 consists of four sets, and these sets represent the octet. The
bits in each octet represent a number.

IPV4 Header Format


The following diagram represents the IPv4 header-

36
Let us discuss each field of IPv4 header one by one.
1. Version- Version is a 4 bit field that indicates the IP version used.
 The most popularly used IP versions are version-4 (IPv4) and version-6 (IPv6).
 Only IPv4 uses the above header.
2. Header Length-Header length is a 4 bit field that contains the length of the IP header.
 It helps in knowing from where the actual data begins.
Minimum And Maximum Header Length-
The length of IP header always lies in the range-[20 bytes , 60 bytes]
 The initial 5 rows of the IP header are always used.
 So, minimum length of IP header = 5 x 4 bytes = 20 bytes.
 The size of the 6th row representing the Options field vary.
 The size of Options field can go up to 40 bytes.
 So, maximum length of IP header = 20 bytes + 40 bytes = 60 bytes.

3. Type Of Service- Type of service is a 8 bit field that is used for Quality of Service (QoS).
4. Total Length-Total length is a 16 bit field that contains the total length of the datagram (in
bytes).

37
Total length = Header length + Payload length

Minimum total length of datagram = 20 bytes (20 bytes header + 0 bytes data)
Maximum total length of datagram = Maximum value of 16 bit word = 65535 bytes

5. Identification- Identification is a 16 bit [Link] is used for the identification of the fragments
of an original IP datagram.
When an IP datagram is fragmented,
 Each fragmented datagram is assigned the same identification number.
 This number is useful during the re assembly of fragmented datagrams.
 It helps to identify to which IP datagram, the fragmented datagram belongs to.
6. DF Bit- DF bit stands for Do Not Fragment [Link] value may be 0 or 1.
When DF bit is set to 0,
 It grants the permission to the intermediate devices to fragment the datagram if required.

When DF bit is set to 1,


 It indicates the intermediate devices not to fragment the IP datagram at any cost.
 If network requires the datagram to be fragmented to travel further but settings does not allow
its fragmentation, then it is discarded.
 An error message is sent to the sender saying that the datagram has been discarded due to its
settings.

7. MF Bit- MF bit stands for More Fragments [Link] value may be 0 or 1.


When MF bit is set to 0,
 It indicates to the receiver that the current datagram is either the last fragment in the set or that
it is the only fragment.
When MF bit is set to 1,
 It indicates to the receiver that the current datagram is a fragment of some larger datagram.
 More fragments are following.
 MF bit is set to 1 on all the fragments except the last one.

8. Fragment Offset- Fragment Offset is a 13 bit field.


 It indicates the position of a fragmented datagram in the original unfragmented IP datagram.
 The first fragmented datagram has a fragment offset of zero.

38
Fragment offset for a given fragmented datagram= Number of data bytes ahead of it in the original
unfragmented datagram

9. Time To Live- Time to live (TTL) is a 8 bit field.


 It indicates the maximum number of hops a datagram can take to reach the destination.
 The main purpose of TTL is to prevent the IP datagrams from looping around forever in a
routing loop.
The value of TTL is decremented by 1 when-
 Datagram takes a hop to any intermediate device having network layer.
 Datagram takes a hop to the destination.
If the value of TTL becomes zero before reaching the destination, then datagram is discarded.
10. Protocol- Protocol is a 8 bit field.
 It tells the network layer at the destination host to which protocol the IP datagram belongs to.
 In other words, it tells the next level protocol to the network layer at the destination side.
 Protocol number of ICMP is 1, IGMP is 2, TCP is 6 and UDP is 17.
11. Header Checksum- Header checksum is a 16 bit field.
 It contains the checksum value of the entire header.
 The checksum value is used for error checking of the header.
At each hop,
 The header checksum is compared with the value contained in this field.
 If header checksum is found to be mismatched, then the datagram is discarded.
 Router updates the checksum field whenever it modifies the datagram header.

12. Source IP Address- Source IP Address is a 32 bit field.


It contains the logical address of the sender of the datagram.

13. Destination IP Address- Destination IP Address is a 32 bit field.


 It contains the logical address of the receiver of the datagram.

14. Options- Options is a field whose size vary from 0 bytes to 40 bytes.

Drawback of IPv4

Currently, the population of the world is 7.6 billion. Every user is having more than one device
connected with the internet, and private companies also rely on the internet. As we know that
IPv4 produces 4 billion addresses, which are not enough for each device connected to the

39
internet on a planet. Although the various techniques were invented, such as variable- length
mask, network address translation, port address translation, classes, inter-domain translation, to
conserve the bandwidth of IP address and slow down the depletion of an IP address. In these
techniques, public IP is converted into a private IP due to which the user having public IP can
also use the internet. But still, this was not so efficient, so it gave rise to the development of the
next generation of IP addresses, i.e., IPv6.

IP Addressing-

There are two systems in which IP Addresses are classified-

Classful Addressing- An IP address is a 32 bit unique address having an address space of 2 32.
Generally, there are two notations in which IP address is written, dotted decimal notation and
hexadecimal notation.

Dotted Decimal Notation:

Some points to be noted about dotted decimal notation:

1. The value of any segment (byte) is between 0 and 255 (both included).
2. There are no zeroes preceding the value in any segment (054 is wrong, 54 is correct).

40
Hexadecimal Notation:

In Classful Addressing System, IP Addresses are organized into following 5 classes-

Each of these classes has a valid range of IP addresses. Classes D and E are reserved for
multicast and experimental purposes respectively. The order of bits in the first octet determine
the classes of IP address.
IPv4 address is divided into two parts:
 Network ID

41
 Host ID
The class of IP address is used to determine the bits used for network ID and host ID and the
number of total networks and hosts possible in that particular class. Each ISP or network
administrator assigns IP address to each device that is connected to its network.
Note: IP addresses are globally managed by Internet Assigned Numbers Authority(IANA) and
regional Internet registries(RIR).

Class A:

IP address belonging to class A are assigned to the networks that contain a large number of
hosts.

 The network ID is 8 bits long.


 The host ID is 24 bits long.
Class B:

 The network ID is 16 bits long.


 The host ID is 16 bits long.

Class C:

IP address belonging to class C are assigned to small-sized networks.


 The network ID is 24 bits long.
 The host ID is 8 bits long.
Class D:

IP address belonging to class D are reserved for multi-casting.

Class E:

IP addresses belonging to class E are reserved for experimental and research purposes. IP
addresses of class E ranges from [Link] – [Link].

42
Classless Addressing-

 Classless Addressing is an improved IP Addressing system.


 It makes the allocation of IP Addresses more efficient.
 It replaces the older classful addressing system based on classes.
 It is also known as Classless Inter Domain Routing (CIDR).

CIDR Block-
When a user asks for specific number of IP Addresses,
 CIDR dynamically assigns a block of IP Addresses based on certain rules.
 This block contains the required number of IP Addresses as demanded by the user.
 This block of IP Addresses is called as a CIDR block.

Rules For Creating CIDR Block-


A CIDR block is created based on the following 3 rules-

Rule-01:

 All the IP Addresses in the CIDR block must be contiguous.

Rule-02:

 The size of the block must be presentable as power of 2.


 Size of the block is the total number of IP Addresses contained in the block.
 Size of any CIDR block will always be in the form 21, 22, 23, 24, 25 and so on.

Rule-03:

 First IP Address of the block must be divisible by the size of the block.

CIDR Notation-
CIDR IP Addresses look like-

43
a.b.c.d / n

 They end with a slash followed by a number called as IP network prefix.


 IP network prefix tells the number of bits used for the identification of network.
 Remaining bits are used for the identification of hosts in the network.

IPV6

IPv4 produces 4 billion addresses, and the developers think that these addresses are enough, but
they were wrong. IPv6 is the next generation of IP addresses. The main difference between IPv4
and IPv6 is the address size of IP addresses. The IPv4 is a 32-bit address, whereas IPv6 is a 128-
bit hexadecimal address. IPv6 provides a large address space, and it contains a simple header as
compared to IPv4.

It provides transition strategies that convert IPv4 into IPv6, and these strategies are as follows:

o Dual stacking: It allows us to have both the versions, i.e., IPv4 and IPv6, on the same
device.
o Tunneling: In this approach, all the users have IPv6 communicates with an IPv4 network
to reach IPv6.
o Network Address Translation: The translation allows the communication between the
hosts having a different version of IP.

This hexadecimal address contains both numbers and alphabets. Due to the usage of both the
numbers and alphabets, IPv6 is capable of producing over 340 undecillion (3.4*1038) addresses.

IPv6 is a 128-bit hexadecimal address made up of 8 sets of 16 bits each, and these 8 sets are
separated by a colon. In IPv6, each hexadecimal character represents 4 bits. So, we need to
convert 4 bits to a hexadecimal number at a time

Address format

The address format of IPv4:

The address format of IPv6:

44
The above diagram shows the address format of IPv4 and IPv6. An IPv4 is a 32-bit decimal
address. It contains 4 octets or fields separated by 'dot', and each field is 8-bit in size. The
number that each field contains should be in the range of 0-255. Whereas an IPv6 is a 128-bit
hexadecimal address. It contains 8 fields separated by a colon, and each field is 16-bit in size.

IP version 6 is the new version of Internet Protocol, which is way better than IP version 4 in
terms of complexity and efficiency. Let’s look at the header of IP version 6 and understand
how it is different from IPv4 header.
IP version 6 Header Format :

Version (4-bits) : Indicates version of Internet Protocol which contains bit sequence 0110.

Traffic Class (8-bits) : The Traffic Class field indicates class or priority of IPv6 packet which
is similar to Service Field in IPv4 packet. It helps routers to handle the traffic based on priority
of the packet. If congestion occurs on router then packets with least priority will be discarded.
As of now only 4-bits are being used (and remaining bits are under research), in which 0 to 7
are assigned to Congestion controlled traffic and 8 to 15 are assigned to Uncontrolled traffic.
Priority assignment of Congestion controlled traffic :

45
Uncontrolled data traffic is mainly used for Audio/Video data. So we give higher priority to
Uncontrolled data traffic.
Source node is allowed to set the priorities but on the way routers can change it. Therefore,
destination should not expect same priority which was set by source node.
Flow Label (20-bits) : Flow Label field is used by source to label the packets belonging to the
same flow in order to request special handling by intermediate IPv6 routers, such as non-
default quality of service or real time service. In order to distinguish the flow, intermediate
router can use source address, destination address and flow label of the packets. Between a
source and destination multiple flows may exist because many processes might be running at
the same time. Routers or Host that do not support the functionality of flow label field and for
default router handling, flow label field is set to 0. While setting up the flow label, source is
also supposed to specify the lifetime of flow.
Payload Length (16-bits) : It is a 16-bit (unsigned integer) field, indicates total size of the
payload which tells routers about amount of information a particular packet contains in its
payload. Payload Length field includes extension headers(if any) and upper layer packet. In
case length of payload is greater than 65,535 bytes (payload up to 65,535 bytes can be
indicated with 16-bits), then the payload length field will be set to 0 and jumbo payload option
is used in the Hop-by-Hop options extension header.
Next Header (8-bits) : Next Header indicates type of extension header(if present) immediately
following the IPv6 header. Whereas In some cases it indicates the protocols contained within
upper-layer packet, such as TCP, UDP.
Hop Limit (8-bits) : Hop Limit field is same as TTL in IPv4 packets. It indicates the
maximum number of intermediate nodes IPv6 packet is allowed to travel. Its value gets
decremented by one, by each node that forwards the packet and packet is discarded if value
decrements to 0. This is used to discard the packets that are stuck in infinite loop because of
some routing error.
Source Address (128-bits) : Source Address is 128-bit IPv6 address of the original source of
the packet.
Destination Address (128-bits) : Destination Address field indicates the IPv6 address of the
final destination(in most cases). All the intermediate nodes can use this information in order to
correctly route the packet.
Extension Headers : In order to rectify the limitations of IPv4 Option Field, Extension
Headers are introduced in IPversion 6. The extension header mechanism is very important part
of the IPv6 architecture. Next Header field of IPv6 fixed header points to the first Extension
Header and this first extension header points to the second extension header and so on.

IPv6 packet may contain zero, one or more extension headers but these should be present in
their recommended order:

46
Differences between IPv4 and IPv6

IPV4 IPV6

Address length IPv4 is a 32-bit address. IPv6 is a 128-bit address.

Fields IPv4 is a numeric address that consists IPv6 is an alphanumeric address


of 4 fields which are separated by dot that consists of 8 fields, which are
(.). separated by colon.

Classes IPv4 has 5 different classes of IP IPv6 does not contain classes of
address that includes Class A, Class B, IP addresses.
Class C, Class D, and Class E.

Number of IP IPv4 has a limited number of IP IPv6 has a large number of IP


address addresses. addresses.

VLSM It supports VLSM (Virtual Length It does not support VLSM.


Subnet Mask). Here, VLSM means that
Ipv4 converts IP addresses into a subnet
of different sizes.

Address It supports manual and DHCP It supports manual, DHCP, auto-


configuration configuration. configuration, and renumbering.

Address space It generates 4 billion unique addresses It generates 340 undecillion


unique addresses.

End-to-end In IPv4, end-to-end connection integrity In the case of IPv6, end-to-end


connection is unachievable. connection integrity is achievable.
integrity

47
Security features In IPv4, security depends on the In IPv6, IPSEC is developed for
application. This IP address is not security purposes.
developed in keeping the security
feature in mind.

Address In IPv4, the IP address is represented in In IPv6, the representation of the


representation decimal. IP address in hexadecimal.

Fragmentation Fragmentation is done by the senders Fragmentation is done by the


and the forwarding routers. senders only.

Packet flow It does not provide any mechanism for It uses flow label field in the
identification packet flow identification. header for the packet flow
identification.

Checksum field The checksum field is available in IPv4. The checksum field is not
available in IPv6.

Transmission IPv4 is broadcasting. On the other hand, IPv6 is


scheme multicasting, which provides
efficient network operations.

Encryption and It does not provide encryption and It provides encryption and
Authentication authentication. authentication.

Number of octets It consists of 4 octets. It consists of 8 fields, and each


field contains 2 octets. Therefore,
the total number of octets in IPv6
is 16.

48

You might also like