0% found this document useful (0 votes)
61 views39 pages

CN Unit 3 Print R23

The document provides an overview of the Network Layer, detailing its functions such as end-to-end communication, packet forwarding, and routing. It discusses packet switching methods, including Store and Forward techniques, and outlines services provided to the transport layer, including connection-oriented and connectionless services. Additionally, it covers routing algorithms, including adaptive and non-adaptive algorithms, optimality principles, and various routing strategies like flooding, hierarchical routing, and multicast routing.

Uploaded by

sankarayaswitha
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)
61 views39 pages

CN Unit 3 Print R23

The document provides an overview of the Network Layer, detailing its functions such as end-to-end communication, packet forwarding, and routing. It discusses packet switching methods, including Store and Forward techniques, and outlines services provided to the transport layer, including connection-oriented and connectionless services. Additionally, it covers routing algorithms, including adaptive and non-adaptive algorithms, optimality principles, and various routing strategies like flooding, hierarchical routing, and multicast routing.

Uploaded by

sankarayaswitha
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

UNIT – 3

Network Layer
What is Network Layer?
• The basic function of Network layer is to provide an end to end communication capability to the transport layer
which lies above it at sender level similarly receiver level.

• The network layer holds the responsibility of managing subnet performance.

• This layer is more focused to control the operations of data transmission, routing and switching technologies,
packet forwarding and sequencing.

• To achieve the goal the network layer must know the Topology of the communication Subnet i.e set of all routers
and choose appropriate path through it.

• The Network layer protocols are concern exchange of packets of information between transport layer entities.

• A packet is a group of bits ( i.e collection of frames ).

• The services provided by the network layer to transport layer is called Network services.

• It makes routing of data through network from source to destination.

Store and Forward Packet switching:


• Packet switching is a method of transferring the data to a network in form of packets.

• In order to transfer the file fast and efficient manner over the network and minimize the transmission
latency(delay), the data is broken into small pieces of variable length, called Packet.

• At the destination, all these small-parts (packets) has to be reassembled, belonging to the same file.

• Packet Switching uses Store and Forward technique while switching the packets; while forwarding the packet each
hop first store that packet then forward.

• This technique is very beneficial because packets may get discarded at any hop due to some reason.

• Each router verifies possible number of links which link is better.

• More than one path is possible between a pair of source and destination.

• Each packet contains Source and destination address using which they independently travel through the network.

• In other words, packets belonging to the same file may or may not travel through the same path.
• Host H1 is directly connected to one of the carrier's routers, A, by a leased line.

• In contrast, H2 is on a LAN with a router, F, owned and operated by the customer.

• This router also has a leased line to the carrier's equipment. We have shown F as being outside the oval because it
does not belong to the carrier, but in terms of construction, software, and protocols, it is probably no different from
the carrier's routers.

• Whether it belongs to the subnet is arguable, routers on customer premises are considered part of the subnet
because they run the same algorithms as the carrier's routers (and our main concern here is algorithms).

Services Provided to the Transport Layer:


• The network layer provides services to the transport layer at the network layer/transport layer interface.

• An important question is what kind of services the network layer provides to the transport layer.

• The network layer services have been designed with the following goals in mind.

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.

• Given these goals, the designers of the network layer have a lot of freedom in writing detailed specifications of the
services to be offered to the transport layer.

• whether the network layer should provide connection-oriented service or connectionless service.
Implementation of Connection oriented Service:
• connection-oriented service, we need a virtual-circuit subnet.

• The virtual circuits is to avoid having to choose a new route for every packet sent .

• All the packets are transmitted depends on same path.

• Instead, 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.

• That 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.

• With connection-oriented service, each packet carries an identifier telling which virtual circuit it belongs to.

Example:
consider the situation of Fig. Here, host 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.

Now let us consider what happens 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. Note that we have a conflict here because although A can
easily distinguish connection 1 packets from H1 from connection 1 packets from H3, C cannot do this. For this
reason, A assigns a different connection identifier to the outgoing traffic for the second connection. Avoiding
conflicts of this kind is why routers need the ability to replace connection identifiers in outgoing packets. In some
contexts, this is called label switching.
Implementation of Connectionless Service:
• Connection less services is also called as Datagrams.

• Datagram is a self contained message unit which contains sufficient information to allow it to be routed from
source to destination.

• Each packet is treated as independently.

• The network layer simply accepts messages from the transport layer and sends out to the destination.

• Datagram system is to postal system.

• Each packet contains the full source and destination addresses .

• Each packet follows different routes from source to destination and they do not necessarily arrive in the same
order. As they transmitted i.e No sequence and flow control is done at receiver.
Comparison of Datagram (connection less)and Virtual-circuit (connection oriented) subnets:

Routing Algorithms :
• Routing is process of establishing the routes that data packets must follow to reach the destination.

• In this process, a routing table is created which contains information regarding routes which data packets follow.

• Various routing algorithm are used for the purpose of deciding which route an incoming data packet needs to be
transmitted on to reach destination efficiently.

Classification of Routing Algorithms: The routing algorithms can be classified as follows:

1. Adaptive Algorithms .

2. Non Adaptive Algorithms .


1. Adaptive Algorithms :
• These are the algorithms which change their routing decisions whenever network topology or traffic load changes.

• The changes in routing decisions are reflected in the topology as well as traffic of the network.

• Also known as dynamic routing, these make use of dynamic information such as current topology, load, delay, etc.
to select routes.

• Optimization parameters are distance, number of hops and estimated transit time.

2. Non-Adaptive Algorithms :
• These are the algorithms which do not change their routing decisions once they have been selected.

• This is also known as static routing as route to be taken is computed in advance and downloaded to routers when
router is booted.

Optimality Principle:
• Choosing the best path from the source to the destination by using optimality principle.
• The set of optimal routes (best routes) from all sources to the destination from a tree is called sink tree.
• Sink tree is a tree but not having loops.
• Sink trees are not unique may be different sink trees to construct in each tree.
• Sink tree can cover all the routers (sources) in the subnet but not covering all the paths to reach the destination is
called sink tree.
• 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.

As a direct consequence of the optimality principle, we can see that 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 and
is illustrated in Fig., where the distance metric is the number of hops. Note that a sink tree is not
necessarily unique; other trees with the same path lengths may exist. The goal of all routing algorithms is
to discover and use the sink trees for all routers
Shortest Path Algorithm (Least cost Algorithm) : ( Dijkstras Algorithm )

Several algorithms for computing the shortest path between two nodes of a graph are
known. This one is due to Dijkstras (1959).

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

Routing algorithms with a simple technique for computing optimal paths which gives a complete picture of
the network and are able to form distributed routing algorithm to find, even though not all routers may know all of
the details of the network.

The idea is to build a graph of the network, with each node of the graph representing a
router and each edge of the graph representing a communication line, or link. To choose a route between a given
pair of routers, the algorithm just finds the shortest path between them on the graph.

• In shortest path routing algorithm the path length between each node is measured either in Distance , Bandwidth
, Average Traffic , Communication Cost or Delay etc…

• This Algorithm computes shortest path according to any one of a number of criteria or a combination of criteria.

• For this a Graph of subnet is drawn . With each node of a graph is representing a router , and each Arc of a graph
is representing a communication link. Each link Associated with cost.
• To choose route b/w a given pair of routers , this algorithm's just find shortest path b/w them on the graph.

Figure 5-7.

The first five steps used in computing the shortest path from A to D. The arrows indicate the working node.

FLOODING:
A simple local technique in which every incoming packet is sent out on every outgoing line except
the one it arrived on is called flooding.

• Flooding generates large number of duplicate packets. One way to present this is for each node to renumber the
identity of the packets it has already sent.

• One such measure is to have a hop counter contained in the header of each packet, which is decremented at each
hop. When the count reaches zero, the packet is discarded. The counter is set to maximum value i.e diameter of
subnet.

• No routing table maintained.

• Always gives shortest path.

• It is more reliable.

• Traffic is high.

• Duplicate packets are present.


Characteristics –
• All possible routes between Source and Destination is tried.

• A packet will always get through if path exists

• As all routes are tried, there will be at least one route which is the shortest

• All nodes directly or indirectly connected are visited.

Limitations –

• Flooding generates vast number of duplicate packets.

• Suitable damping mechanism must be used.

Hop-Count –

• A hop counter may be contained in the packet header which is decremented at each hop.
with the packet being discarded when the counter becomes zero.

• The sender initializes the hop counter. If no estimate is known, it is set to the full diameter of the subnet.

• Keep track of the packets which are responsible for flooding using a sequence number. Avoid sending them out a
second time.
Hierarchical Routing:

* When the network size grows the number of routers in the network increases.

* Consequently the size of routing tables as well and routers cannot handle network traffic as efficiently.

* We use hierarchical routing to overcome this problem.

* Hierarchical Routing is essentially Divide and Conquer strategy,

* The network is divided into different regions and a router for a particular region knows only about its
own domain and other neighbor routers.

* In hierarchical routing routers are classified in to groups known as regions.

* Each router has only the information about the routers in its own region and has no information
about routers in the other regions .

* So routers just save one record in their table for every other region.

• Router just save one record in their table for every other region.
• Router only contains the record of their immediate neighbors in the table.
• In three level hierarchical routing the network is called into a number of clusters.
• Each cluster is made of a number of regions and each region contains a number or routers.
• In this method it will route first to the region then to the IP Prefix within the region- hide details within a
region from outside of the region.
Broadcast Routing:
Sending a packet to all destinations simultaneously is called broadcasting.
Ex: a service distributing weather reports, stock market updates, or live radio programs might work best by
sending to all machines and letting those that are interested read the data.
• Various methods are proposed but some are not in practice. for example sending the data to each
destination in a network which is widely applicable but wasteful of bandwidth and source must have the
complete list of all destinations.
• Multi destination routing: In multi-destination routing, each packet contains either a list of destinations.
When a packet arrives at a router, the router checks all the destinations to determine the set of output
lines that will be needed. This is also not made in practice because of bandwidth and destination list
problems.
➢ The idea for reverse path forwarding is elegant and remarkably simple once it has been pointed out.
When a broadcast packet arrives at a router, the router checks to see if the packet arrived on the link that
is normally used for sending packets toward the source of the broadcast. If, however, the broadcast packet
arrived on a link other than the preferred one for reaching the source, the packet is discarded as a likely
duplicate otherwise it is accepted.
Multicast Routing:
➢ Sending a message to well-defined groups that are numerically large in size but small compared to the
network as a whole is called multicasting, and the routing algorithm used is called multicast routing.
➢ All multicasting schemes require some way to create and destroy groups and to identify which routers
are members of a group. How these tasks are accomplished is not of concern to the routing algorithm.

Example:
Consider the two groups, 1 and 2, in the network shown in Fig. 5-16(a). Some routers are attached to hosts that
belong to one or both of these groups, as indicated in the figure.
A spanning tree for the leftmost router is shown in Fig. 5-16(b). This tree can be used for broadcast but is overkill
for multicast, as can be seen from the two pruned versions that are shown next.
In Fig. 5-16(c), all the links that do not lead to hosts that are members of group 1 have been removed. The result is
the multicast spanning tree for the leftmost router to send to group 1. Packets are forwarded only along this
spanning tree, which is more efficient than the broadcast tree because there are 7 links instead of 10. Fig. 5-16(d)
shows the multicast spanning tree after pruning for group 2. It is efficient too, with only five links this time. It also
shows that different multicast groups have different spanning trees.
Distance-vector routing protocol :(Bell man ford algorithm)
Distance-vector routing protocol in data networks determines the best route for data packets
based on distance.
• Distance-vector routing protocols measure the distance by the number of routers a packet has to pass,
one router counts as one hop.
• Some distance-vector protocols also take into account network latency (Best amount of time to
transmission of data ) and other factors that influence traffic on a given route.
• To determine the best route across a network, routers, on which a distance-vector protocol is
implemented, exchange information with one another, usually routing tables plus hop counts for
destination networks and possibly other traffic information.
• Distance-vector routing protocols also require that a router informs its neighbors of network
topology changes periodically.
Distance-vector routing protocols use the Bellman–Ford algorithm and Ford–Fulkerson algorithm to
calculate the best route.
Another way of calculating the best route across a network is based on link cost, and is implemented
through link-state routing protocols.

➢ In distance vector routing, each router maintains a routing table indexed by, and containing one entry for
each router in the network. This entry has two parts: the preferred outgoing line to use for that
destination and an estimate of the distance to that destination.
Link State Routing Algorithm:
Link state routing is the second family of routing protocols.
While distance vector routers use a distributed algorithm to compute their routing tables,
link-state routing uses link-state routers to exchange messages that allow each router to learn the entire
network topology.
Based on this learned topology, each router is then able to compute its routing table by using a shortest
path computation.
The idea behind link state routing is simple and can be stated as five parts.
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.
Features of link state routing protocols –
• Link state packet – A small packet that contains routing information.
• Link state database – A collection information gathered from link state packet.
• Shortest path first algorithm (Dijkstra algorithm) – A calculation performed on the database results into
shortest path
• Routing table – A list of known paths and interfaces.
Calculation of shortest path –

To find shortest path, each node need to run the famous Dijkstra algorithm. This famous algorithm uses
the following steps:
Step-1: The node is taken and chosen as a root node of the tree, this creates the tree with a single node,
and now set the total cost of each node to some value based on the information in Link State Database
Step-2: Now the node selects one node, among all the nodes not in the tree like structure, which is nearest
to the root, and adds this to the [Link] shape of the tree gets changed .
Step-3: After this node is added to the tree, the cost of all the nodes not in the tree needs to be updated
because the paths may have been changed.
Step-4: The node repeats the Step 2. and Step 3. until all the nodes are added in the tree

Congestion Control in Computer Networks:


What is congestion?
A state occurring in network layer when the message traffic is so heavy that it slows down
network response time.
(or)
When too many packets are present in (a part of) the subnet, performance degrades. This situation is
called congestion
• Congestion control refers to the techniques used to control or prevent congestion.
• Congestion control is the process of maintaining the number of packets in the network below a certain
level at which performance falls off.
Effects of Congestion
• As delay increases, performance decreases.
• If delay increases, retransmission occurs, making situation worse.
• When the number of packets dumped into the subnet by the hosts is within its carrying capacity, they are
all delivered (except for a few that are afflicted with transmission errors) and the number delivered is
proportional to the number sent.
• However, as traffic increases too far, the routers are no longer able to cope and they begin
losing packets. This tends to make matters worse. At very high trafffic, performance collapses completely
and almost no packets are delivered.

Causes Of Congestion : (Congestion can be brought on by several factors)


• If all of a sudden, streams of packets begin arriving on three or four input lines and all need the same
output line, a queue will build up.
• If there is insufficient memory to hold all of them, packets will be lost.
• Slow processors can also cause congestion. If the routers' CPUs are slow at performing the bookkeeping
tasks required of them (queueing buffers, updating tables, etc.), queues can build up, even though there is
excess line capacity.
• Similarly, low-bandwidth lines can also cause congestion. Upgrading the lines but not changing the
processors, or vice versa.
• The band width of the links are also important in congestion . The links to be used must be high bandwidth
to avoid the congestion.
• When the arrival of the packets are not uniform i.e when the traffic is bursty.
General Principles of Congestion Control :
This approach leads to dividing all solutions into two groups:

• Open loop Congestion Control.


• Closed loop Congestion Control.
Open Loop Congestion Control :
Open loop congestion control policies are applied to prevent congestion before it happens. The
congestion control is handled either by the source or the destination.
Closed Loop Congestion Control:
Closed loop congestion control technique is used to treat or alleviate congestion after it happens.
Several techniques are used by different protocols.
This approach has three parts when applied to congestion control:
1. Monitor the system to detect when and where congestion occurs.
2. Pass this information to places where action can be taken.
3. Adjust system operation to correct the problem.
Congestion Prevention Policies :
Congestion Control in Virtual-Circuit Subnets:
The congestion control methods described above are basically open loop:
They try to prevent congestion from occurring in the first place, rather than dealing with it
after the fact. In this section we will describe some approaches to dynamically controlling congestion in
virtual circuit subnets. In the next two, we will look at techniques that can be used in any subnet.
One technique that is widely used to keep congestion that has already started from getting worse is
admission control. The idea is simple: once congestion has been signaled, no more virtual circuits are set
up until the problem has gone away. Thus, attempts to set up new transport layer connections fail.
Figure 5-27. (a) A congested subnet. (b) A redrawn subnet that eliminates the congestion. A virtual circuit
from A to B is also shown.

Congestion Control in Datagram Subnets:


some approaches that can be used in datagram subnets (and also in virtual circuit subnets). Each router
can easily monitor the utilization of its output lines and other resources.
Warning Bit :

• It is Special bit in the packet header is set by the router to warn the source when congestion is detected.
• The bit is copied and Ack is send to the sender.
• The sender monitors the number of Ack packets it receives with the warning bit set and adjust its
transmission rate accordingly.
Choke Packets :
A choke packet is a packet sent by a node to the source to inform it of congestion. Each router
monitor its resources and the utilization at each of its output lines. ... The intermediate nodes through
which the packets has traveled are not warned about congestion.

Hop-by-Hop Choke Packets :


At high speeds or over long distances, sending a choke packet to the source hosts does not work
well because the reaction is so slow.
Hop-by-Hop Choke Packets :
At high speeds or over long distances, sending a choke packet to the source hosts does not work
well because the reaction is so slow.
Consider, for example, a host in San Francisco (router A in Fig. 5-28) that is sending traffic to a host in New
York (router D in Fig. 5-28) at 155 Mbps. If the New York host begins to run out of buffers, it will take about
30 msec for a choke packet to get back to San Francisco to tell it to slow down. The choke packet
propagation is shown as the second, third, and fourth steps in Fig. 5-28(a). In those 30 msec, another 4.6
megabits will have been sent. Even if the host in San Francisco completely shuts down immediately, the
4.6 megabits in the pipe will continue to pour in and have to be dealt with. Only in the seventh diagram in
Fig. 5-28(a) will the New York router notice a slower flow.
Figure 5-28. (a) A choke packet that affects only the source. (b) A choke packet that affects each hop it
passes through.

Quality of service:
➢ We have to provide good quality of service basing on the demand of applications (and customers), even
though we have provided algorithms that reduced congestion and improved network performance.
➢ Multimedia applications in particular, often need a minimum throughput and maximum latency to work.
➢ An easy solution to provide good quality of service is to build a network with enough capacity for whatever
traffic will be thrown at it and we call it as overprovisioning. The resulting network will carry application
traffic without significant loss and, assuming a decent routing scheme, will deliver packets with low latency
➢ Overprovisioning is expensive to handle. It is based on expected traffic. All bets (expectations) are off if the
traffic changes too much.
➢ Quality of service let a network with less capacity meet application requirements just as well at a lower
cost. With quality of service, the network can honor the performance guarantees that it makes even when
traffic spikes, at the cost of turning down some requests.

➢ Four issues must be addressed to ensure quality of service:


1. What applications need from the network?
2. How to regulate the traffic that enters the network.
3. How to reserve resources at routers to guarantee performance.
4. Whether the network can safely accept more traffic.
Several common applications and the stringency of their network requirements are listed below:
Application Bandwidth Delay Jitter Loss

Email Low Low Low Medium

File sharing High Low Low Medium

Web access Medium Medium Low Medium

Remote login Low Medium Medium Medium

Audio on demand Low Low High Low

Video on demand High Low High Low

Telephony Low High High Low

Videoconferencing High High High Low

Network Layer in the Internet:


IP Protocol :

IPV4:
• IP stands for Internet Protocol and v4 stands for Version Four (IPv4).
• IPv4 was the primary version brought into action for production within the ARPANET in 1983.

IP version four addresses are 32-bit integers which will be expressed in hexadecimal notation.
• Internet Protocol being a layer-3 protocol (OSI) takes data Segments from layer-4 (Transport) and divides it
into packets. IP packet encapsulates data unit received from above layer and add to its own header
information.

Example- [Link] could be an IPv4 address.


• Version − Version no. of Internet Protocol used (e.g. IPv4).
• IHL − Internet Header Length; Length of entire IP header. IP header length (4 bits), which is the number of
32 bit words in the header. The minimum value for this field is 5 and the maximum is 15.
• DSCP − Differentiated Services Code Point; this is Type of Service.
• Total Length − Length of entire IP Packet (including IP header and IP Payload).
• Identification − If IP packet is fragmented during the transmission, all the fragments contain same
identification number. to identify original IP packet they belong to.
• Flags − As required by the network resources, if IP Packet is too large to handle, these ‘flags’ tells if they
can be fragmented or not. In this 3-bit flag, the MSB is always set to ‘0’.
• Fragment Offset − This offset tells the exact position of the fragment in the original IP Packet.
• Time to Live − To avoid looping in the network, every packet is sent with some TTL value set, which tells
the network how many routers (hops) this packet can cross. At each hop, its value is decremented by one
and when the value reaches zero, the packet is discarded.
• Protocol − Tells the Network layer at the destination host, to which Protocol this packet belongs to, i.e. the
next level Protocol. For example protocol number of ICMP is 1, TCP is 6 and UDP is 17.
• Header Checksum − This field is used to keep checksum value of entire header which is then used to check
if the packet is received error-free.
• Source Address − 32-bit address of the Sender (or source) of the packet.
• Destination Address − 32-bit address of the Receiver (or destination) of the packet.

Hierarchical Addressing Scheme:


• IPv4 uses hierarchical addressing scheme. An IP address, which is 32-bits in length, is divided into two or
three parts as depicted −



• A single IP address can contain information about the network and its sub-network and ultimately the
host. This scheme enables the IP Address to be hierarchical where a network can have many sub-networks
which in turn can have many hosts.
IPv6 – Header:

The IPv6 header is the first part of an IPv6 packet, containing essential information for routing and
delivering the packet across networks. The IPv6 header representation is a structured layout of fields in
an IPv6 packet, including source and destination addresses, traffic class, flow label, payload length, next
header, and hop limit. It ensures proper routing and delivery of data across networks.

IPv6 Fixed Header


The IPv6 header is a part of the information sent over the internet. It's always 40 bytes long and includes
details like where data should go and how it should get there. This helps devices talk to each other and
share information smoothly online.
Version (4-bits)
The size of this field is 4-bit. Indicates the version of the Internet Protocol, which is always 6 for IPv6, so
the bit sequence is 0110.
Traffic Class(8-bit)
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 the priority of the packet. If congestion occurs on
the router then packets with the least priority will be discarded.
As of now, only 4-bits are being used (and the 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 :

Uncontrolled data traffic is mainly used for Audio/Video data. So we give higher priority to Uncontrolled
data traffic.
The source node is allowed to set the priorities but on the way, routers can change it. Therefore, the
destination should not expect the same priority which was set by the source node.
Flow Label (20-bits)
Flow Label field is used by a 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, an intermediate router can use the source address, a 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 does 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, the source is also supposed to specify the lifetime of the flow.
Payload Length (16-bits)
It is a 16-bit (unsigned integer) field, indicates the total size of the payload which tells routers about the
amount of information a particular packet contains in its payload. The payload Length field includes
extension headers(if any) and an upper-layer packet. In case the length of the 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 the jumbo payload option is used in the Hop-by-Hop options extension header.
Next Header (8-bits)
Next Header indicates the type of extension header(if present) immediately following the IPv6 header.
Whereas In some cases it indicates the protocols contained within upper-layer packets, such as TCP,
UDP.
Hop Limit (8-bits)
Hop Limit field is the 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 the packet is discarded if the value decrements to 0. This is used to discard the packets
that are stuck in an infinite loop because of some routing error.
Source Address (128-bits)
Source Address is the 128-bit IPv6 address of the original source of the packet.
Destination Address (128-bits)
The 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 the IPv4 Option Field, Extension Headers are introduced in IP version
6. The extension header mechanism is a very important part of the IPv6 architecture. The 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.

IP Adresses : Classful IP Addreessing: (various types of IP Address)


The first octet referred here is the left most of all. The octets numbered as follows depicting dotted
decimal notation of IP Address −
Classful IP Addreessing: (various types of IP Address)
IP Versions:
In Computer Networks (CN), IP (Internet Protocol) versions refer to different
standards of the IP used for addressing and routing packets across networks. There
are mainly two versions in widespread use:

1. IPv4 (Internet Protocol version 4)


• Address length: 32 bits
• Address format: Dotted decimal (e.g., [Link])
• Address space: ~4.3 billion addresses
• Header size: 20 bytes (minimum)
• Features:
o Supports unicast, multicast, and broadcast
o Connectionless protocol
o Uses ARP (Address Resolution Protocol) to map IP to MAC addresses
• Limitations:
o Limited address space → need for NAT (Network Address Translation)
o No built-in security (relies on IPSec)

2. IPv6 (Internet Protocol version 6)


• Address length: 128 bits
• Address format: Hexadecimal colon-separated (e.g.,
2001:0db8:85a3:0000:0000:8a2e:0370:7334)
• Address space: ~3.4×10³⁸ addresses (practically unlimited)
• Header size: 40 bytes (fixed)
• Features:
o Eliminates NAT due to large address space
o Built-in security (IPSec is mandatory)
o Supports unicast, multicast, and anycast
o Simplified header for faster routing
o Auto-configuration (stateless address autoconfiguration)
• Advantages over IPv4: Larger address space, better security, and more efficient
routing

Summary Table:

Feature IPv4 IPv6

Address length 32 bits 128 bits

Notation Dotted decimal Hexadecimal with colons

Address space ~4.3 billion ~3.4×10³⁸

Header size 20 bytes 40 bytes

Security Optional (IPSec) Mandatory (IPSec)

NAT Needed Not needed

Routing efficiency Moderate High


Internet Control Message Protocol (ICMP) in Computer
Networks
1. Introduction
• Definition: ICMP is a supporting protocol in the Internet Protocol (IP) suite used by
network devices to send error messages and operational information.
• Purpose: Helps diagnose network communication issues and ensures smooth
functioning of the network.
• Layer: Operates at the Network Layer (Layer 3) of the OSI model.
• Protocol Number: ICMP is identified by protocol number 1 in the IP header.

2. Functions of ICMP
1. Error Reporting: Notifies the sender about issues in delivery of packets.
o Example: Destination unreachable, Time exceeded.
2. Network Diagnostics: Helps in checking network status and connectivity.
o Tools using ICMP: ping, traceroute.
3. Congestion Control Support: ICMP messages can help in alerting about network
congestion.
4. Router Communication: Routers use ICMP to communicate information about
network changes.

3. ICMP Message Types


ICMP messages are broadly divided into two categories:
A. Error Messages
• Sent when a problem occurs in delivering packets.
• Common Types:
1. Destination Unreachable (Type 3): The packet cannot reach the destination.
2. Source Quench (Type 4): Request to slow down packet sending (deprecated in
modern networks).
3. Time Exceeded (Type 11): Packet’s TTL expired during transit.
4. Parameter Problem (Type 12): Header problem in the packet.
B. Informational Messages
• Sent to query network status or check connectivity.
• Common Types:
1. Echo Request (Type 8): Request to check if a host is reachable (ping).
2. Echo Reply (Type 0): Response to Echo Request.
3. Timestamp Request/Reply: Used for synchronization and measuring delay.

4. ICMP Message Format


ICMP message is encapsulated within an IP packet. Its structure includes:

Field Description

Type Identifies the ICMP message type (error or query).

Code Provides additional information about the type.

Checksum Error-checking for the ICMP header and data.

Rest of Varies depending on the message type (e.g., pointer, unused, or


Header identifier).

Data Contains part of the original IP packet that caused the message.
5. ICMP Operations
1. Ping Operation:
o Sends an ICMP Echo Request to a host.
o Receives Echo Reply to confirm host is reachable.
2. Traceroute Operation:
o Uses ICMP Time Exceeded messages to determine the path packets take to
reach the destination.
3. Error Notification:
o Routers and hosts generate ICMP error messages for unreachable destinations
or expired TTL.

6. Advantages of ICMP
• Simple and lightweight protocol.
• Helps in network troubleshooting.
• Works seamlessly with IP, does not require connection setup.
• Provides important diagnostic information.

7. Limitations of ICMP
• Can be exploited for attacks (e.g., ICMP flood or ping of death).
• Cannot correct errors; only reports them.
• Some networks may block ICMP for security, limiting diagnostic capabilities.
Internetworking – In the Network Layer
Internetworking refers to the process of connecting two or more different types of
computer networks so that they can communicate with each other as one large,
unified system. It allows data exchange among computers and devices located on
different networks, regardless of their underlying hardware, communication
protocols, or architectures.
The Network Layer (Layer 3 of the OSI model) plays a crucial role in internetworking,
as it provides the mechanisms for logical addressing, routing, and packet forwarding
between these interconnected networks.
1. Definition:
1. Internetworking is the process of connecting multiple computer networks so
that they function as a single large network.
Objectives of Internetworking
The main goals of internetworking are:
To enable communication between devices on different networks.
To extend network coverage beyond a single local area network (LAN).
To provide scalability and interconnect various network types (LAN, MAN, WAN).
To enable resource sharing and data exchange across organizational or geographical
boundaries.
Role of Network Layer:
1. The Network Layer provides logical addressing (IP addresses) and routing to
deliver packets from the source network to the destination network.
Main Functions Involved:
1. Addressing: Assigns unique logical addresses (like IP) to each device.
2. Routing: Determines the best path for data to travel between networks.
3. Packet Forwarding: Moves packets across intermediate routers to reach the
destination.
4. Fragmentation & Reassembly: Breaks large packets into smaller fragments to fit
the data link layer frame size of different networks.
5. Error Handling & Congestion Control: Ensures reliable data delivery across
diverse networks.
Devices Used:
1. Router: Main device for internetworking at the network layer.
2. Layer 3 Switches: Also perform routing functions within networks.
Role of Network Layer:
1. The Network Layer provides logical addressing (IP addresses) and routing to
deliver packets from the source network to the destination network.
Main Functions Involved:
1. Addressing: Assigns unique logical addresses (like IP) to each device.
2. Routing: Determines the best path for data to travel between networks.
3. Packet Forwarding: Moves packets across intermediate routers to reach the
destination.
4. Fragmentation & Reassembly: Breaks large packets into smaller fragments to fit
the data link layer frame size of different networks.
5. Error Handling & Congestion Control: Ensures reliable data delivery across
diverse networks.
Devices Used:
1. Router: Main device for internetworking at the network layer.
2. Layer 3 Switches: Also perform routing functions within networks.

Role of Network Layer in Internetworking


The Network Layer is responsible for delivering packets from a source device in one
network to a destination device possibly located in another network.
It acts as a bridge between different data link layers, ensuring that packets can traverse
multiple networks efficiently.
Major Functions:
1. Logical Addressing:
1. Every device in an internetwork is assigned a unique IP address.
2. IP addressing helps in identifying devices across multiple interconnected
networks.
3. Example: IPv4 and IPv6 addresses.
2. Routing:
1. The process of finding the best path for a packet to travel from the source to the
destination across multiple networks.
2. Routers use routing algorithms and tables to make forwarding decisions.
3. Common routing protocols: RIP, OSPF, BGP, EIGRP.
3. Packet Forwarding:
1. Once the path is determined, routers forward packets hop-by-hop toward the
destination.
2. Each router examines the destination IP address and forwards the packet
accordingly.
1. Fragmentation and Reassembly:
2. Different networks may have different Maximum Transmission Units (MTU).
3. If a packet is too large for the next network, it is fragmented into smaller pieces.
4. The destination host reassembles these fragments into the original packet.
2. Error Handling and Diagnostics:
1. The Network Layer uses ICMP (Internet Control Message Protocol) for error
reporting and diagnostic functions (e.g., unreachable destinations, time
exceeded, etc.).
3. Congestion Control:
1. Helps prevent network overload by managing packet flow and traffic efficiently.

Devices Used in Internetworking


1. Routers:
1. Primary devices used for internetworking.
2. Operate at the network layer.
3. Connect multiple networks and determine the optimal path for data
transmission.
2. Layer 3 Switches:
1. Combine the features of both switches and routers.
2. Used within large LANs for faster packet forwarding and routing.
3. Gateways:
1. Work at multiple OSI layers.
2. Used to connect networks that use different communication protocols.
6. Advantages of Internetworking
• Global Communication: Enables worldwide data exchange via the Internet.
• Resource Sharing: Allows users to share files, databases, and hardware resources
across networks.
• Scalability: New networks can be easily added without affecting existing ones.
• Flexibility: Supports communication between networks using different technologies.
• Reliability: Alternate paths can be used for data transfer in case of network failure.
Advantages:
1. Enables global communication (Internet).
2. Allows resource sharing between different organizations and networks.
3. Improves scalability and flexibility of network design.
Examples:
1. Connecting a university LAN to the Internet through a router.
2. Linking multiple branch office networks via WAN.

Common questions

Powered by AI

A sink tree is formed by the set of optimal routes from all sources to a given destination, rooted at the destination itself, and exemplifies the optimality principle . It highlights the concept that if a router lies on the optimal path between two points, the path remains optimal even if considered from a different starting router. Sink trees are valuable in routing as they provide a framework for discovering shortest paths in dynamic network environments .

In IPv6, extension headers provide a mechanism for including additional options that go beyond the fixed header, improving flexibility over IPv4 . Unlike the limited option fields in IPv4, IPv6's extension headers allow for a more comprehensive range of packet handling options, providing scalability and modularity by pointing from one header to the next .

Internetworking aims to enable communication between devices on different networks, extend coverage beyond single LANs, provide scalability, and facilitate resource sharing across boundaries . These objectives ensure seamless data exchange, the interconnection of diverse network types (LAN, MAN, WAN), and efficient utilization of global network resources, enhancing both reach and functionality of interconnected systems .

Dijkstra's algorithm calculates the shortest path between nodes in a network graph by incrementally finding the least-cost path from a source node to other nodes . It labels nodes with tentative and then permanent cost values, ensuring the shortest paths are established based on criteria such as distance, delay, or cost metrics. This systematic approach optimizes routing efficiency and resource usage in complex networks .

Congestion control is maintained by managing the packet flow and keeping the number of packets below a critical threshold to avoid performance degradation. This includes adjusting the transmission rate and implementing algorithms that prevent buffer overloads . Failure to manage congestion results in increased delays, packet loss, and retransmissions, worsening the network's efficiency and potentially leading to a complete performance collapse .

Flooding, although simple, generates a large number of duplicate packets, leading to congestion and inefficiency . This issue can be mitigated by implementing measures such as packets being renumbered by nodes to prevent duplication or imposing a hop count limit to reduce infinite loops and preserve network resources .

Adaptive routing algorithms adjust their decisions based on changes in network topology or traffic load, using dynamic information such as current topology, load, and delay to select routes . In contrast, non-adaptive algorithms, or static routing, do not change their routing decisions once set; routes are computed in advance and remain fixed, even if conditions change .

Connectionless services, such as datagrams, involve self-contained packets treated independently, each with full source and destination addresses, and no sequence or flow control at the receiver. They can travel along different routes and arrive out of order . Connection-oriented services, or virtual-circuit subnets, establish a fixed path and maintain order during transmission, resembling a postal system .

Open-loop congestion control relies on proactive resource management policies, such as predetermined limits on data rates, buffer management techniques, and scheduling policies, to prevent congestion from occurring . While these strategies can effectively maintain performance by avoiding resource oversubscription, they may lack flexibility to adapt to rapid traffic changes, potentially leading to underutilization or inefficiency under variable conditions .

Logical addressing assigns unique identifiers, such as IP addresses, to each device within an internetwork . These addresses facilitate the routing and delivery of packets across diverse networks by enabling universal identification, ensuring efficient data transmission, and supporting network scalability and interconnectivity .

You might also like