4th Unit
4th Unit
4th Unit
Network layer comes up with certain design issues and they can be described as below:
store-and-
forward packet switching
H1 has a direct connection with carrier router ‘A’, while H2 is connected to carrier
router ‘F’ on a LAN connection.
One of the carrier router ‘F’, is pointed outside the carrier’s equipment as it does not
come under the carrier, whereas considered as protocols, software, and construction.
This switching network performs as Transmission of data happens when the host
(H1) with a packet transfers it to the nearby router through LAN (or) point-to-point
connection to the carrier. The carrier stores the packet until it completely arrives thus
confirms the checksum.
Then after, the packet is transmitted over the path until H2 is reached.
2). Services Provided to the Transport Layer
Through the network/transport layer interface, the network layer delivers its services to
the transport layer. One might come across the question of what type of services does
the network layer provides?
So, we shall move with the same query and find out the services offered.
Services offered by the network layer are outlined considering few objectives. Those
are:
At the time when the connection is released, the virtual subnet also gets dismissed. In
this service, every packet carries its own identifier that states the exact address of the
virtual circuit. The below diagram shows the routing algorithm in the virtual subnet.
Routing Algorithms in Computer Networs -
Data is converted into packets in computer networks before being transferred from
source to destination. The network layer chooses the best path for data packet
transmission. The network layers provide a routing protocol, which is a routing algorithm
that determines the best and shortest path for transmitting data from source to
destination.
A routing algorithm is a routing protocol determined by the network layer for transmitting
data packets from source to destination. This algorithm determines the best or least-
cost path for data transmission from sender/source to receiver/destination.
The network layer performs operations that effectively and efficiently regulate internet
traffic. In computer networks, this is known as a routing algorithm. It is used to
determine the best path or route mathematically.
Types of Routing Algorithms
Algorithms may be dynamic, where the routers make decisions based on information
they gather, and the routes change over time adaptively. Routing Algorithms can be
classified based on the following types.
Non-adaptive Routing
Once the pathway to the destination has been selected, the router sends all packets for
that destination along that one route. The routing decisions are not made based on the
condition or topology of the network.
Adaptive Routing
A router may select a new route for each packet (even packets belonging to the same
transmission) in response to changes in the condition and topology of the networks.
Links between routers have a cost associated with them. It could be a function of
distance, bandwidth, average traffic, communication cost, mean queue length,
measured delay, router processing speed, etc.
The shortest path algorithm finds the least expensive path through the network
based on the cost function.
Examples: Dijkstra's algorithm
Each router periodically shares knowledge about the entire network with its neighbours
in this routing scheme. Each router has a table with information about the network.
These tables are updated by exchanging information with the immediate neighbours. It
is also known as Belman-Ford or Ford-Fulkerson Algorithm. It is used in the original
ARPANET and the Internet as RIP.
The following sequence of steps can be executed in the Link State Routing. This
advertising is a short pack called a Link State Packet (LSP). OSPF (Open shortest path
first) and IS-IS are examples of Link state routing. Link State Packet(LSP) contains the
following information:
When a router floods the network with information about its neighbourhood, it is said to
be advertising.
In link-state routing, each router shares its knowledge of its neighbourhood with all
routers in the network. Link-state protocols implement an algorithm called the shortest
path first (SPF, also known as Dijkstra's Algorithm) to determine the path to a remote
destination. There is no hop-count limit. (For an IP datagram, the maximum time to live
ensures that loops are avoided.).Only when changes occur, It sends all summary
information every 30 minutes by default. Only devices running routing algorithms listen
to these updates. Updates are sent to a multicast address. As a result, updates are
faster, and convergence times are reduced. Higher CPU and memory requirements to
maintain link-state databases. Link-state protocols maintain three separate tables.
1. Neighbour table: It contains a list of all neighbours and the interface to which
each neighbour is connected. Neighbours are formed by sending Hello packets.
2. Topology table (Link- State table): It contains a map of all links within an area,
including each link’s status.
3. Routing table: It contains the best routes to each particular destination
Flooding Algorithm
The Optimality Principle simply states that if router J is on the optimal path from the
router I to router k, then the optimal path from J to K also falls along this same path.
Candidates can also practice 110+ Mock tests for exams like GATE and NIELIT with
BYJU'S Exam Prep Test Series; check the following link
In other words when too much traffic is offered, congestion sets in and performance
degrades sharply
Causing of Congestion:
• 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 unbalanced.Congestion can make itself worse. If a route!” does not have
free buffers, it start 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.Closedloop
• 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.
• 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.
ClosedLoopCongestionControl
• 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.
• 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.
ChokePacket
• 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.
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
• 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.
• 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.
• 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.
IPv4 addresses are expressed as a set of four numbers in decimal format, and each set
is separated by a dot. Thus, the term ‘dotted decimal format.’ Each set is called an
‘octet’ because a set is composed of 8 bits. The figure below shows the binary format of
each octet in the 192.168.10.100 IP address:
A number in an octet can range from 0 to 255. Therefore, the full IPv4 address space
goes from 0.0.0.0 to 255.255.255.255. The IPv4 address has two parts, the network
part and the host part. A subnet mask is used to identify these parts.
Network Part
The network part of the IPv4 address is on the left-hand side of the IP address. It
specifies the particular network to where the IPv4 address belongs. The network portion
of the address also identifies the IP address class of the IPv4 address.
For example, we have the IPv4 address 192.168.10.100 and a /24 subnet mask. /24
simply means that the first 24 bits, starting from the left side, is the network portion of
the IPv4 address. The 8 remaining bits of the 32 bits will be the host portion.
Host Part
The host portion of the IPv4 address uniquely identifies the device or the interface on
your network. Hosts that have the same network portion can communicate with one
another directly, without the need for the traffic to be routed.
The Internet Protocol address can be allocated to hosts or interfaces either manually or
dynamically.
Static – static IP address is set manually on the device. It is best practice to set static IP
addresses on network devices, such as routers and switches, and on servers as well.
Dynamic – dynamic IP address can be automatically allocated to a device via Dynamic
Host Configuration Protocol (DHCP). Dynamic IP addresses are best to be used on end
devices, such as PCs.
Types of IPv4 Addresses
Public IP address – used to route Internet traffic. This is used on the Internet and is
given out by Internet Service Providers (ISPs) to their customers.
Private IP address – used in private networks for internal traffics within the LAN.
Private addresses are not routable out the Internet.
Internet Protocol hierarchy contains several classes of IP Addresses to be used
efficiently in various situations as per the requirement of hosts per network.
Broadly, the IPv4 Addressing system is divided into five classes of IP Addresses.
All the five classes are identified by the first octet of IP Address.
Internet Corporation for Assigned Names and Numbers is responsible for
assigning IP addresses.
The first octet referred here is the left most of all. The octets numbered as follows
depicting dotted decimal notation of IP Address −
The number of networks and the number of hosts per class can be derived by
this formula −
Class A addresses only include IP starting from 1.x.x.x to 126.x.x.x only. The IP
range 127.x.x.x is reserved for loopback IP addresses.
The default subnet mask for Class A IP address is 255.0.0.0 which implies that
Class A addressing can have 126 networks (27-2) and 16777214 hosts (224-2).
Class A IP address format is
thus: 0NNNNNNN.HHHHHHHH.HHHHHHHH.HHHHHHHH
Class B Address
An IP address which belongs to class B has the first two bits in the first octet set
to 10, i.e.
Example-
Following diagram shows the subnetting of a big single network into 4 smaller subnets-
Advantages-
Subnet ID-
Each subnet has its unique network address known as its Subnet ID.
The subnet ID is created by borrowing some bits from the Host ID part of the IP
Address.
The number of bits borrowed depends on the number of subnets created.
Types of Subnetting-
Fixed length subnetting also called as classful subnetting divides the network into
subnets where-
All the subnets are of same size.
All the subnets have equal number of hosts.
All the subnets have same subnet mask.
Variable length subnetting also called as classless subnetting divides the network into
subnets where-
All the subnets are not of same size.
All the subnets do not have equal number of hosts.
All the subnets do not have same subnet mask.
Subnetting Examples-
Example-01:
Consider-
We have a big single network having IP Address 200.1.2.0.
We want to do subnetting and divide this network into 2 subnets.
For creating two subnets and to represent their subnet IDs, we require 1 bit.
So,
We borrow one bit from the Host ID part.
After borrowing one bit, Host ID part remains with only 7 bits.
If borrowed bit = 0, then it represents the first subnet.
If borrowed bit = 1, then it represents the second subnet.
Example-02:
Consider-
We have a big single network having IP Address 200.1.2.0.
We want to do subnetting and divide this network into 4 subnets.
For creating four subnets and to represent their subnet IDs, we require 2 bits.
So,
We borrow two bits from the Host ID part.
After borrowing two bits, Host ID part remains with only 6 bits.
If borrowed bits = 00, then it represents the 1st subnet.
If borrowed bits = 01, then it represents the 2nd subnet.
If borrowed bits = 10, then it represents the 3rd subnet.
If borrowed bits = 11, then it represents the 4th subnet.
Consider-
We have a big single network having IP Address 200.1.2.0.
We want to do subnetting and divide this network into 3 subnets.
The subnetting will be performed exactly in the same way as performed in Example-01.
After subnetting, we have-
For creating two subnets and to represent their subnet IDs, we require 1 bit.
So,
We borrow one more bit from the Host ID part.
After borrowing one bit, Host ID part remains with only 6 bits.
Finally, the given single network is divided into 3 subnets having IP Address-
200.1.2.0
200.1.2.128
200.1.2.192
For 1st Subnet-
Disadvantages of Subnetting-
Point-01:
Point-02:
After subnetting, the communication process becomes complex involving the following 4
steps-
1. Identifying the network
2. Identifying the sub network
3. Identifying the host
4. Identifying the process
Problem-01:
Suppose a network with IP Address 192.16.0.0. is divided into 2 subnets, find number of
hosts per subnet.
Also for the first subnet, find-
1. Subnet Address
2. First Host ID
3. Last Host ID
4. Broadcast Address
Solution-
Problem-02:
Solution-
Problem-03:
In a class B, network on the internet has a subnet mask of 255.255.240.0. What is the
maximum number of hosts per subnet?
1. 4096
2. 4094
3. 4092
4. 4090
Solution-
Number of bits reserved for network ID in the given subnet mask = 20.
So, Number of bits reserved for Host ID = 32 – 20 = 12 bits.
Thus, Number of hosts per subnet = 212 – 2 = 4094.
In class B, 16 bits are reserved for the network.
So, Number of bits reserved for subnet ID = 20 – 16 = 4 bits.
Number of subnets possible = 24 = 16.
Thus, Option (B) is correct.
Classless Addressing-
CIDR Block-
Rule-01:
Rule-02:
First IP Address of the block must be divisible by the size of the block.
REMEMBER
So, any binary pattern is divisible by 2n, if and only if its least significant n
bits are 0.
Examples-
CIDR Notation-
Example-
An example of CIDR IP Address is-
182.0.1.2 / 28
It suggests-
28 bits are used for the identification of network.
Remaining 4 bits are used for the identification of hosts in the network.
Problem-01:
Given the CIDR representation 20.10.30.35 / 27. Find the range of IP Addresses in the
CIDR block.
Solution-
It suggests-
27 bits are used for the identification of network.
Remaining 5 bits are used for the identification of hosts in the network.
So,
First IP Address = 00010100.00001010.00011110.00100000 = 20.10.30.32
Last IP Address = 00010100.00001010.00011110.00111111 = 20.10.30.63
Problem-02:
Given the CIDR representation 100.1.2.35 / 20. Find the range of IP Addresses in the
CIDR block.
Solution-
It suggests-
20 bits are used for the identification of network.
Remaining 12 bits are used for the identification of hosts in the network.
So,
First IP Address = 01100100.00000001.00000000.00000000 = 100.1.0.0
Last IP Address = 01100100.00000001.00001111.11111111 = 100.1.15.255
Problem-03:
Solution-
Rule-01:
Rule-02:
Rule-03:
Since all the rules are satisfied, therefore given block is a CIDR block.
CIDR Representation-
We have-
Size of the block = Total number of IP Addresses = 24.
To have 24 total number of IP Addresses, total 4 bits are required in the Host ID part.
So, Number of bits present in the Network ID part = 32 – 4 = 28.
Thus,
NOTE-
Problem-04:
Solution-
Rule-01:
Rule-02:
Rule-03:
Since all the rules are satisfied, therefore given block is a CIDR block.
CIDR Representation-
We have-
Size of the block = Total number of IP Addresses = 26.
To have 26 total number of IP Addresses, 6 bits are required in the Host ID part.
So, Number of bits in the Network ID part = 32 – 6 = 26.
Thus,
Problem-05:
Solution-
Rule-01:
Rule-02:
According to Rule-02, size of the block must be presentable as 2n.
Total number of IP Addresses = 28 + 28 + 28 + 28 = 22 x 28 = 210.
So, Rule-02 is satisfied.
Rule-03:
CIDR Representation-
We have-
Size of the block = Total number of IP Addresses = 210.
To have 210 total number of IP Addresses, 10 bits are required in the Host ID part.
So, Number of bits in the Network ID part = 32 – 10 = 22.
Thus,
Problem-06:
Rule-01:
Rule-02:
Rule-03:
Since all the 3 rules are not satisfied, so they can not be aggregated.
IPv4 short for Internet Protocol Version 4 is the fourth version of the Internet
Protocol (IP).
IP is responsible to deliver data packets from the source host to the destination host.
This delivery is solely based on the IP Addresses in the packet headers.
IPv4 is the first major version of IP.
IPv4 is a connectionless protocol for use on packet-switched networks.
IPv4 Header-
1. Version-
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.
In general,
3. Type Of Service-
Type of service is a 8 bit field that is used for Quality of Service (QoS).
The datagram is marked for giving a certain treatment using this field.
4. Total Length-
Total length is a 16 bit field that contains the total length of the datagram (in bytes).
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-
7. MF Bit-
8. Fragment Offset-
9. Time To Live-
If the value of TTL becomes zero before reaching the destination, then datagram is
discarded.
10. Protocol-
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.
14. Options-
1. Record Route-
A record route option is used to record the IP Address of the routers through which the
datagram passes on its way.
When record route option is set in the options field, IP Address of the
router gets recorded in the Options field.
2. Source Routing-
A source routing option is used to specify the route that the datagram must take to
reach the destination.
This option is generally used to check whether a certain path is working fine or not.
Source routing may be loose or strict.
3. Padding-
Addition of dummy data to fill up unused space in the transmission unit and make it
conform to the standard size is called as padding.
Options field is used for padding.
Example-
When header length is not a multiple of 4, extra zeroes are padded in the Options
field.
By doing so, header length becomes a multiple of 4.
If header length = 30 bytes, 2 bytes of dummy data is added to the header.
This makes header length = 32 bytes.
Then, the value 32 / 4 = 8 is put in the header length field.
In worst case, 3 bytes of dummy data might have to be padded to make the header
length a multiple of 4.
IPv6 - Headers
The wonder of IPv6 lies in its header. An IPv6 address is 4 times larger than IPv4, but
surprisingly, the header of an IPv6 address is only 2 times larger than that of IPv4. IPv6
headers have one Fixed Header and zero or more Optional (Extension) Headers. All the
necessary information that is essential for a router is kept in the Fixed Header. The
Extension Header contains optional information that helps routers to understand how to
handle a packet/flow.
Fixed Header
[Image:
IPv6 Fixed Header]
IPv6 fixed header is 40 bytes long and contains the following information.
2 Traffic Class (8-bits): These 8 bits are divided into two parts. The most
significant 6 bits are used for Type of Service to let the Router Known
what services should be provided to this packet. The least significant 2
bits are used for Explicit Congestion Notification (ECN).
3 Flow Label (20-bits): This label is used to maintain the sequential flow of
the packets belonging to a communication. The source labels the
sequence to help the router identify that a particular packet belongs to a
specific flow of information. This field helps avoid re-ordering of data
packets. It is designed for streaming/real-time media.
4 Payload Length (16-bits): This field is used to tell the routers how much
information a particular packet contains in its payload. Payload is
composed of Extension Headers and Upper Layer data. With 16 bits, up
to 65535 bytes can be indicated; but if the Extension Headers contain
Hop-by-Hop Extension Header, then the payload may exceed 65535
bytes and this field is set to 0.
5 Next Header (8-bits): This field is used to indicate either the type of
Extension Header, or if the Extension Header is not present then it
indicates the Upper Layer PDU. The values for the type of Upper Layer
PDU are same as IPv4’s.
6 Hop Limit (8-bits): This field is used to stop packet to loop in the network
infinitely. This is same as TTL in IPv4. The value of Hop Limit field is
decremented by 1 as it passes a link (router/hop). When the field reaches
0 the packet is discarded.
Extension Headers
In IPv6, the Fixed Header contains only that much information which is necessary,
avoiding those information which is either not required or is rarely used. All such
information is put between the Fixed Header and the Upper layer header in the form of
Extension Headers. Each Extension Header is identified by a distinct value.
When Extension Headers are used, IPv6 Fixed Header’s Next Header field points to the
first Extension Header. If there is one more Extension Header, then the first Extension
Header’s ‘Next-Header’ field points to the second one, and so on. The last Extension
Header’s ‘Next-Header’ field points to the Upper Layer Header. Thus, all the headers
points to the next one in a linked list manner.
If the Next Header field contains the value 59, it indicates that there are no headers
after this header, not even Upper Layer Header.
The following Extension Headers must be supported as per RFC 2460:
The sequence of Extension Headers should be:
These headers:
1. should be processed by First and subsequent destinations.
2. should be processed by Final Destination.
Extension Headers are arranged one after another in a linked list manner, as depicted
in the following diagram:
[Image: Dual
Stack Router]
In the above diagram, a server having IPv4 as well as IPv6 address configured for it can
now speak with all the hosts on both the IPv4 as well as the IPv6 networks with the help
of a Dual Stack Router. The Dual Stack Router, can communicate with both the
networks. It provides a medium for the hosts to access a server without changing their
respective IP versions.
Tunneling
In a scenario where different IP versions exist on intermediate path or transit networks,
tunneling provides a better solution where user’s data can pass through a non-
supported IP version.
[Image:
Tunneling]
The above diagram depicts how two remote IPv4 networks can communicate via a
Tunnel, where the transit network was on IPv6. Vice versa is also possible where the
transit network is on IPv6 and the remote sites that intend to communicate are on IPv4.
NAT Protocol Translation
This is another important method of transition to IPv6 by means of a NAT-PT (Network
Address Translation – Protocol Translation) enabled device. With the help of a NAT-PT
device, actual can take place happens between IPv4 and IPv6 packets and vice versa.
See the diagram below:
A host with IPv4 address sends a request to an IPv6 enabled server on Internet that
does not understand IPv4 address. In this scenario, the NAT-PT device can help them
communicate. When the IPv4 host sends a request packet to the IPv6 server, the NAT-
PT device/router strips down the IPv4 packet, removes IPv4 header, and adds IPv6
header and passes it through the Internet. When a response from the IPv6 server
comes for the IPv4 host, the router does vice versa.
Ipv4 Ipv6
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.
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.
Packet flow It does not provide any mechanism It uses flow label field in the
identification for packet flow identification. header for the packet flow
identification.
Checksum field The checksum field is available in The checksum field is not
IPv4. available in IPv6.
Encryption and It does not provide encryption and It provides encryption and
Authentication authentication. authentication.
ARP stands for Address Resolution Protocol, which is used to find the MAC address of
the device from its known IP address. This means, the source device already knows the
IP address but not the MAC address of the destination device. The MAC address of the
device is required because you cannot communicate with a device in a local area
network (Ethernet) without knowing its MAC address. So, the Address Resolution
Protocol helps to obtain the MAC address of the destination device.
The purpose of ARP is to convert the 32-bit logical address (IPv4 address) to the 48-bit
physical address (MAC address). This protocol works between layer 2 and layer 3 of the
OSI model. The MAC address resides at layer 2, which is also known as the data link
layer and IP address resides at layer 3, this layer is also known as the network layer.
Note: The ARP request is generated only when both the devices (source and
destination) are in the same network.
Example: Suppose two devices (device A and device B) want to communicate with each
other. The device A already knows the IP address of the Device B. But in order to
communicate with the device B, device A still needs the MAC address of the device B.
The IP address is used to locate a device on a local area network and the MAC
address is used to identify the actual device. The device A first look at its internal list
known as ARP cache (table) to check if the IP address of the device B already consists of
its MAC address or not. If the ARP table consists of the MAC address of the device B,
then device A simply use that MAC address and start communication.
If the table does not consist of the MAC address of device B, then device A sends an
ARP broadcast message on the network to know which device has that specific IP
address and ask for the MAC address of that particular device. Then the device that has
matching IP address to the source address sends an ARP response message that
consists of the MAC address of the device B. When device A obtains the MAC address of
the device B, it will store the information in the ARP cache (table). The ARP cache is used
to make the network more efficient. It stores the IP address of the device along with its
MAC address. The stored information is used when device A wants to communicate with
device B on a network, and it does not need to broadcast a message on the network
again. It will simply check the ARP cache for the entries and then use it for
communication.
Types of Mapping in ARP
There are two different ways to map the IP address into the MAC address, which
are given below:
o Static Mapping
o Dynamic Mapping
Static Mapping - In the static mapping, a table consists of a logical address and
corresponding physical address of the destination device. In this, the IP and MAC
address of the device is entered manually in an ARP table. The source device has to
access the table first if a source wants to communicate with the destination device.
Dynamic Mapping - In the dynamic mapping, if a device knows the logical address of
the other device, then by using the Address Resolution protocol, this device will also
find the physical address of the device. The dynamic entries are created automatically
when the source device sends an ARP broadcast request. These entries are not
permanent and cleared periodically.
DHCP can be implemented on local networks as well as large enterprise networks. DHCP is the default protocol
used by the most routers and networking equipment. DHCP is also called RFC (Request for comments) 2131.
o DHCP manages the provision of all the nodes or devices added or dropped from the network.
o DHCP maintains the unique IP address of the host using a DHCP server.
o It sends a request to the DHCP server whenever a client/node/device, which is configured to work with
DHCP, connects to a network. The server acknowledges by providing an IP address to the
client/node/device.
DHCP is also used to configure the proper subnet mask, default gateway and DNS server information on the
node or device.
There are many versions of DCHP are available for use in IPV4 (Internet Protocol Version 4) and IPV6 (Internet
Protocol Version 6).
How DHCP works
DHCP runs at the application layer of the TCP/IP protocol stack to dynamically assign IP addresses to DHCP
clients/nodes and to allocate TCP/IP configuration information to the DHCP clients. Information includes subnet
mask information, default gateway, IP addresses and domain name system addresses.
DHCP is based on client-server protocol in which servers manage a pool of unique IP addresses, as well as
information about client configuration parameters, and assign addresses out of those address pools.
Components of DHCP
When working with DHCP, it is important to understand all of the components. Following are the list of
components:
o DHCP Server: DHCP server is a networked device running the DCHP service that holds IP addresses
and related configuration information. This is typically a server or a router but could be anything that
acts as a host, such as an SD-WAN appliance.
o DHCP client: DHCP client is the endpoint that receives configuration information from a DHCP server.
This can be any device like computer, laptop, IoT endpoint or anything else that requires connectivity
to the network. Most of the devices are configured to receive DHCP information by default.
o IP address pool: IP address pool is the range of addresses that are available to DHCP clients. IP
addresses are typically handed out sequentially from lowest to the highest.
o Subnet: Subnet is the partitioned segments of the IP networks. Subnet is used to keep networks
manageable.
o Lease: Lease is the length of time for which a DHCP client holds the IP address information. When a
lease expires, the client has to renew it.
o DHCP relay: A host or router that listens for client messages being broadcast on that network and
then forwards them to a configured server. The server then sends responses back to the relay agent
that passes them along to the client. DHCP relay can be used to centralize DHCP servers instead of
having a server on each subnet.
Internet Control Message Protocol (ICMP)
Since IP does not have an inbuilt mechanism for sending error and control messages. It depends
on Internet Control Message Protocol(ICMP) to provide an error control. It is used for reporting
errors and management queries. It is a supporting protocol and is used by networks devices like
routers for sending error messages and operations information., e.g. the requested service is not
available or that a host or router could not be reached.
ICMP will take the source IP from the discarded packet and informs the source by sending a
source quench message.
Then source will reduce the speed of transmission so that router will be free from congestion.
When the congestion router is far away from the source the ICMP will send hop by hop source
quench message so that every router will reduce the speed of transmission.
Parameter problem :
Whenever packets come to the router then the calculated header checksum should be equal to the
received header checksum then the only the packet is accepted by the router.
There is no necessary condition that the only the router gives the ICMP error message some time
the destination host sends an ICMP error message when any type of failure (link failure,
hardware failure, port failure, etc) happens in the network.
Redirection message :
Redirect requests data packets are sent on an alternate route. The message informs a host to
update its routing information (to send packets on an alternate route).
Ex. If the host tries to send data through a router R1 and R1 sends data on a router R2 and there
is a direct way from the host to R2. Then R1 will send a redirect message to inform the host that
there is the best way to the destination directly through R2 available. The host then sends data
packets for the destination directly to R2.
The router R2 will send the original datagram to the intended destination.
But if the datagram contains routing information then this message will not be sent even if a
better route is available as redirects should only be sent by gateways and should not be sent by
Internet hosts.