CN Unit-3
CN Unit-3
• The network Layer is the third layer in the OSI model of computer
networks. Its main function is to transfer network packets from the source
to the destination. At the source, it accepts a packet from the transport
layer, encapsulates it in a datagram, and then delivers the packet to the
data link layer so that it can further be sent to the receiver.
• At the destination, the datagram is De capsulated, and the packet is
extracted and delivered to the corresponding transport layer.
1. Packetizing
2. Logical Addressing
3. Routing
4. Forwarding
1. Packetizing
2. Logical Addressing:
• The data link layer implements the physical addressing and network layer
implements the logical addressing. Logical addressing is also known as
Internet Address or Network Address.
• The network layer adds a header to the packet which includes the logical
addresses of both the sender and the receiver.
3. Routing:
• Routing is the process of moving data from one device to another device. In
a network, there are a number of routes available from the source to the
destination.
• The network layer specifies some strategies which find out the best possible
route. This process is referred to as routing. There are a number of routing
protocols that are used in this process
4. Forwarding
• 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 it needs to forward the packet to attached networks.
• Then the Routers are used to forward that packet from the local network
to the remote network. So, the process of routing involves packet
forwarding.
Packet Switching :
Here are some of the types of delays that can occur in packet switching:
• Format of IP packet
• IP Addressing system
Format of IP packet
Before an IP packet is sent over the network, two major components are added
in an IP packet, i.e., Header a Payload.
Version: The first IP header field is a 4-bit version indicator.
Internet Header Length: Internet header length, shortly known as IHL, is 4
bits in size.
Type of Service: Type of Service is also called Differentiated Services Code
Point or DSCP.
Total length: The total length is measured in bytes. The minimum size of an IP
datagram is 20 bytes and the maximum, it can be 65535 bytes.
Identification: Identification is a packet that is used to identify fragments of an
IP datagram uniquely.
IP Flags: Flag is a three-bit field that helps you to control and identify
fragments.
Fragment Offset: Fragment Offset represents the number of Data Bytes ahead
of the particular fragment in the specific Datagram
Time to live: It is an 8-bit field that indicates the maximum time the Datagram
will be live in the internet system. The time duration is measured in seconds,
and when the value of TTL is zero, the Datagram will be erased.
Protocol: This IPv4 header is reserved to denote that internet protocol is used in
the latter portion of the Datagram.
Header Checksum: The next component is a 16 bits header checksum field,
which is used to check the header for any errors. The IP header is compared to
the value of its checksum. When the header checksum is not matching, then the
packet will be discarded.
Source Address: The source address is a 32-bit address of the source used for
the IPv4 packet.
Destination address: The destination address is also 32 bit in size stores the
address of the receiver.
IP Options: It is It contains values and settings related with security, record
route and time stamp, etc. You can see that list of options component ends with
an End of Options or EOL in most cases.
Data: This field stores the data from the protocol layer, which has handed over
the data to the IP layer.
IP Routing
• IP routing is a process of determining the path for data to travel from the
source to the destination. As we know that the data is divided into multiple
packets, and each packet will pass through a router until it reaches the final
destination.
• The path that the data packet follows is determined by the routing algorithm.
The routing algorithm considers various factors like the size of the packet and
its header to determine the efficient route for the data from the source to the
destination.
• When the data packet reaches some router, then the source address and
destination address are used with a routing table to determine the next hop's
address.
• This process goes on until it reaches the destination. The data is divided into
multiple packets so all the packets will travel individually to reach the
destination.
IP Addressing
The IPv4 address works on the network layer which is responsible for the
transmission of data in the form of packets. It is a connectionless protocol.
• Class A
• Class B
• Class C
• Class D
• Class E
Components of IP Address
• In Class A, as you can see above, the 32-bit address, which is divided into
four sections of 8 bits each, out of those, the leading 8 bits are used to
represent the network and the trailing 24 bits are used to represent the
network host.
• For example: 125.16.32.64 is a class A address. And the range for the
network address is 0 to 127
• In Class B, the leading 16 bits are used to represent the network and
the trailing 16 bits are used to represent the network host. For example:
136.192.168.64 is a class B address. And the range for the network
address is 128 to 191.
• In Class C, the leading 24 bits are used to represent the network and
the trailing 8 bits are used to represent the network host. For example:
193.201.198.23 is a class C address, And the range for the network address is
192 to 223.
• In Class D, there are no hosts or networks. For example: 225.108.162.1 is a
class D address, and the range for the network address is 224 to 239. These
addresses are reserved for multicasting group email/broadcast.
• Class E addresses are very similar to class D addresses. The 1st four bits in
the first octet of a Class E address are always 1111. These addresses are
reserved for military purposes.
IPv6 Protocol and Addressing
IPv6 was developed by Internet Engineering Task Force (IETF) to deal with the
problem of IPv4 exhaustion. IPv6 is a 128-bits address having an address space
of 2128, which is way bigger than IPv4. IPv6 use Hexa-Decimal format
separated by colon (:) .
Components in Address format:
There are 8 groups and each group represents 2 Bytes (16-bits). Each Hex-Digit
is of 4 bits (1 nibble) separated by a Delimiter– colon (:)
Features of IPV6
The base header occupies 40 bytes, and extension headers and data from the
upper layer usually contain up to 65, 535 bytes of data.
Base Header has 8 fields which are as follows−
• Version: It is a four-bit field that defines the version number of the IP.
IP6 version is 6, IP4 version is 4.
• Priority: It is a 4-bit priority field that defines the priority of the packet
with respect to traffic congestion that a packet is to reject or not.
• Flow Label: It is three bytes or 24-bit field designed to provide special
handling for a particular flow of data to speed flow on an already flowing
packet path.
• Payload Length: It is a two-byte payload length field that defines the
total length of the IP datagram, excluding the base header.
• Next Header: It is an 8-bit field that defines the header that follows the
base header in the datagram. In IPV4, this field is called a protocol. Some
of the values in this field indicate options that are
• Source Address: This field is 16-byte which specifies the original source of
the datagram destination address. This is a 16-byte internet address that
usually identifies the final destination of the datagram.
• Priority:
• The new generation IP address, or IPv6, was created primarily to get over
IPv4's limits and exhaustion.
• The 128-bit IPv6 protocol is made up of eight numbered strings with four
(alphanumeric) characters each, separated by a colon.
• When we want to send a request from an IPv4 address to an IPv6 address, but it
isn’t possible because IPv4 and IPv6 transition is not compatible.
• Few technologies that can be used to ensure slow and smooth transition from
IPv4 to IPv6. These technologies are Dual Stack Routers, Tunneling, and
NAT Protocol Translation.
1. Dual-Stack Routers:
In dual-stack router, A router’s interface is attached with IPv4 and IPv6
addresses in order to transition from IPv4 to IPv6.
In this above diagram, A given server with both IPv4 and IPv6 addresses
configured can communicate with all hosts of IPv4 and IPv6 via dual-stack
router (DSR). The dual stack router (DSR) gives the path for all the hosts to
communicate with the server without changing their IP addresses.
2. Tunneling:
Tunneling is used as a medium to communicate the transit network with the
different IP versions.
In this above diagram, the different IP versions such as IPv4 and IPv6 are
present. The IPv4 networks can communicate with the transit or
intermediate network on IPv6 with the help of the Tunnel. It’s also possible
that the IPv6 network can also communicate with IPv4 networks with the
help of a Tunnel.
3. NAT Protocol Translation:
With the help of the NAT Protocol Translation technique, the IPv4 and IPv6
networks can also communicate with each other which do not understand
the address of different IP version.
In the above diagram, an IPv4 address communicates with the IPv6 address
via a NAT-PT device to communicate easily. In this situation, the IPv6
address understands that the request is sent by the same IP version (IPv6)
and it responds.
Mobile IP
Foreign and Home Agents. The Home Agent and Foreign Agent advertise
their services on the network using the ICMP Router Discovery Protocol
(IRDP).
Registration : The registration phase is responsible for informing the current
location of the home agent and foreign agent for the correct forwarding of
packets.
Tunneling : This phase is used to establish a virtual connection as a pipe for
moving the data packets between a tunnel entry and a tunnel endpoint.
Applications of Mobile IP
The following subgraph shows vertices and their distance values, only the
vertices with finite distance values are shown. The vertices included in SPT
are shown in green colour.
Step 2:
Step 3:
Step 4:
•
Routing protocol in such an Internet system can be broadly divided into two
types:
1. Intra-domain routing
2. Inter-domain routing
• Each of these protocols is hierarchically organized. For communication
within a domain, only the former routing is used. However, both of them
are used for communication between two or more domains.
• In the following pages, we will look at description of
Routing information Protocol (RIP), Open Shortest Path First (OSPF),
and IS-IS, that are intra-domain protocols. RIP and OSPF will be
covered later in detail.
• Two algorithms, Distance-Vector Protocol and Link-State Protocol, are
available to update contents of routing tables.
In the network shown below, there are three routers, A, B, and C, with the
following weights − AB =2, BC =3 and CA =5.
Step 1 − In this DVR network, each router shares its routing table with every
neighbor. For example, A will share its routing table with neighbors B and C
and neighbors B and C will share their routing table with A.
Congestion control: : Approaches to Congestion Control,
Congestion control refers to the techniques used to control or prevent
congestion. Congestion control techniques can be broadly classified into two
categories:
1. Retransmission Policy :
It is the policy in which retransmission of the packets are taken care of. If
the sender feels that a sent packet is lost or corrupted, the packet needs to
be retransmitted. This transmission may increase the congestion in the
network. To prevent congestion, retransmission timers must be designed to
prevent congestion and also able to optimize efficiency.
2. Window Policy :
The type of window at the sender’s side may also affect the congestion.
Several packets in the Go-back-n window are re-sent, although some
packets may be received successfully at the receiver side. This duplication
may increase the congestion in the network and make it worse.
Therefore, Selective repeat window should be adopted as it sends the
specific packet that may have been lost.
Discarding Policy :
A good discarding policy adopted by the routers is that the routers may
prevent congestion and at the same time partially discard the corrupted or
less sensitive packages and also be able to maintain the quality of a
message. In case of audio file transmission, routers can discard less
sensitive packets to prevent congestion and also maintain the quality of the
audio file.
3. Acknowledgment Policy :
Since acknowledgements are also the part of the load in the network, the
acknowledgment policy imposed by the receiver may also affect
congestion. Several approaches can be used to prevent congestion related to
acknowledgment.
The receiver should send acknowledgement for N packets rather than
sending acknowledgement for a single packet. The receiver should send an
acknowledgment only if it has to send a packet or a timer expires.
4. Admission Policy :
In admission policy a mechanism should be used to prevent congestion.
Switches in a flow should first check the resource requirement of a network
flow before transmitting it further. If there is a chance of congestion or
there is congestion in the network, router should deny establishing a virtual
network connection to prevent further congestion.
All the above policies are adopted to prevent congestion before it happens in
the network.
Closed Loop Congestion Control
Closed loop congestion control techniques are used to treat or alleviate
congestion after it happens. Several techniques are used by different protocols;
some of them are:
1. Backpressure :
Backpressure is a technique in which a congested node stops receiving packets
from upstream node. This may cause the upstream node or nodes to become
congested and reject receiving data from above nodes. Backpressure is a node-
to-node congestion control technique that propagate in the opposite direction
of data flow. The backpressure technique can be applied only to virtual circuit
where each node has information of its above upstream node.
In above diagram the 3rd node is congested and stops receiving packets
as a result 2nd node may be get congested due to slowing down of the output
data flow. Similarly 1st node may get congested and inform the source to slow
down.
3. Implicit Signaling :
In implicit signaling, there is no communication between the congested nodes
and the source. The source guesses that there is congestion in a network. For
example when sender sends several packets and there is no acknowledgment
for a while, one assumption is that there is a congestion.
4. Explicit Signaling :
In explicit signaling, if a node experiences congestion it can explicitly sends a
packet to the source or destination to inform about congestion. The difference
between choke packet and explicit signaling is that the signal is included in the
packets that carry data rather than creating a different packet as in case of
choke packet technique.
Explicit signaling can occur in either forward or backward direction.
• Forward Signaling : In forward signaling, a signal is sent in the direction
of the congestion. The destination is warned about congestion. The receiver
in this case adopt policies to prevent further congestion.
• Backward Signalling : In backward signaling, a signal is sent in the
opposite direction of the congestion. The source is warned about congestion
and it needs to slow down.
Traffic Aware Routing
Whenever there is congestion in the network, there will be one strategy for
network-wide congestion control and traffic awareness. Congestion can be
avoided by designing a network that is well-suited to the traffic it transports.
Congestion develops when more traffic is targeted but only a low-bandwidth
link is available.
Traffic-aware routing’s main objective is to choose the optimum routes by
taking the load into account. It does this by setting the link weight to be a
function of the fixed connection bandwidth and propagation delay, traffic
awareness, as well as the variable observed load or average queuing time.
The traffic aware routing is diagrammatically represented as follows
Step 1 − Consider a network which is divided into two parts, East and West
both are connected by links CF and EI.
Step 2 − Suppose most of the traffic in between East and West is using link CF,
and as a result CF link is heavily loaded with long delays. Including queueing
delay in the weight which is used for shortest path calculation will make EI
more attractive.
Step 3 − After installing the new routing tables, most of East-West traffic will
now go over the EI link. As a result in the next update CF link will appear to be
the shortest path.
Step 4 − As a result the routing tables may oscillate widely, leading to erratic
routing and many potential problems.
Step 5 − If we consider only bandwidth and propagation delay by ignoring the
load, this problem does not occur. Attempts to include load but change the
weights within routing scheme to shift traffic across routes arrow range only to
slow down routing oscillations.
Step 6 − Two techniques can contribute for successful solution, which are as
follows −
• Multipath routing
• The routing scheme to shift traffic across routes.
1. Choke packets
Choke packets are a mechanism where the router directly sends the
choked packet back to its sender or host.
After the congestion has been signaled still due to a slow signal many packets
are received from the long distances.