SlideShare a Scribd company logo
1 of 98
Download to read offline
Maharashtra State Board of Technical Education, Mumbai
Subject Name : Advanced Computer Network Subject Code : 22520
Prepared By
A.K. Rathod, (M.E. C.N.E.)
Lecturer in Computer Engineering
Government Polytechnic Jintur District Parbhani
1
Course Name : Diploma in Computer Engineering
Semester : Fifth (I Scheme)
Unit – I Network Layer & Protocols (08 Marks)
Unit – I Network Layer & Protocols
Unit Outcomes (in Cognitive Domain)
1 a. Explain Significance of the given field in the packet format of the
internet protocol.
1 b. Implement IP addressing for the given network.
1 c. Explain Significance of the given field in the packet format of ICMPv4.
1 d. Explain the given inefficiency in mobile IP.
2
Unit – I Network Layer & Protocols
Network
Layer
Functions
3
Unit – I Network Layer & Protocols
Network Layer :
 The Network Layer is the third layer of the OSI model.
 It handles the service requests from the transport layer and further
forwards the service request to the data link layer.
 The network layer translates the logical addresses into physical
addresses
 It determines the route from the source to the destination and also
manages the traffic problems such as switching, routing and
controls the congestion of data packets.
 The main responsibility of the network layer is to deliver the
individual packets from sending host (source) to the receiving host
(destination).
4
Unit – I Network Layer & Protocols
Network Layer :
5
Fig-S Source to Destination Delivery
Unit – I Network Layer & Protocols
Network Layer :
The main functions performed by the network layer are:
 Routing: When independent networks or links are connected to
creates internetworks or large network, the connecting devices
(routers or switches) route or switch packets to their final
destination.
 Logical Addressing: The data link layer implements the physical
addressing and network layer implements the logical addressing.
Logical addressing is also used to distinguish between source and
destination system. The network layer adds a header to the packet
which includes the logical addresses of both the sender and the
receiver.
 Internetworking: This is the main role of the network layer that it
provides the logical connection between different types of networks.
 Fragmentation: The fragmentation is a process of breaking the
packets into the smallest individual data units that travel through
different networks.
6
Unit – I Network Layer & Protocols
IP
Addressing
7
Unit – I Network Layer & Protocols
IPAddressing:
 IP Address is a logical address in the network layer of TCP / IP
Protocol Suite.
 An IP address, or simply an "IP," is a unique address that identifies a
device on the internet or a local network. It allows a system to be
recognized by other systems connected via the internet protocol.
 Two devices in the internet can never have same address at the same
time.
 There are two primary types of IP address formats used today IPv4 &
IPv6.
 Length of IPv4 address is 32 bit and length of IPv6 address is 128 bit.
 The IPv4 address is 32 bit long that means it consists 4 octets each
octet consist of 8 bits.
 Value of each octet ranges from 0 to 255 (minimum 0 and maximum
255)
8
Unit – I Network Layer & Protocols
Address Space
 An address space is total number of addresses used by the protocol.
 If protocol uses N bits to define an address, the address space is 2N
 IPv4 uses 32 bit addresses, which means that the address space is 232
or 4,294,967,296 (more than 4 billions). That means more than 4
billion or 232 devices could be connected to the internet using IPv4
address.
 IPv6 uses 128 bit addresses, which means that the address space is
2128 or 340,282,366,920,938,463,463,374,607,431,768,211,456
addresses (approximately 3.4×1038). That means 2128 devices could
be connected to the internet using IPv6 address.
9
Unit – I Network Layer & Protocols
Notations
There are three notations to show an IPv4 address
A) Binary Notation B) Dotted Decimal Notation
C) Hexadecimal Notation
A) Binary Notation : In binary notations, IPv4 address is displayed as
32 bits. Each bit is shown either in the form of 0 or 1. These 32 bits
are divided in to 4 octets. That means each octet has eight bits or
1byte. So we can say that IPv4 is a 32 bit address or a 4 byte
address.
Example of IPv4 address in Binary Notation :
01110101 10010101 00011101 00000010
10
Unit – I Network Layer & Protocols
Notations :
B) Dotted Decimal Notation : To make the IPv4 address more compact
and easier to read, these are usually written in decimal form with a
decimal point (dot) –(.) separating each bytes.
Example of IPv4 address in Dotted Decimal Notation :
C) Hexadecimal Notation : Each hexadecimal digit is equivalent to four
bits. This means that 32 bit address has 8 hexadecimal digits
for example of IPv4 address in dotted decimal notation 192.168.10.10
can be written in Hexadecimal Notation as shown below.
c0.a8.0a.0a
11
Unit – I Network Layer & Protocols
Classful Addressing :
• Classful addressing is a concept that divides the available address space of
IPv4 into five classes namely A, B, C, D & E.
• Nowadays, this concept has become obsolete and has been replaced
with classless addressing.
• IP addresses, before 1993 use the classful addressing where classes have
a fixed number of blocks and each block has a fixed number of hosts.
• Each of these classes has a valid range of IP addresses. Classes D and E are
reserved for multicast and experimental purposes respectively.
• The order of bits in the first octet determine the classes of IP address.
12
Unit – I Network Layer & Protocols
Classful Addressing :
IPv4 address is divided into two parts: Network ID and Host ID
• The class of IP address is used to determine the bits used for network ID
and host ID and the number of total networks and hosts possible in that
particular class.
• Each ISP or network administrator assigns IP address to each device that
is connected to its network.
• IP addresses are globally managed by Internet Assigned Numbers
Authority(IANA) and regional Internet registries(RIR).
• While finding the total number of host IP addresses, 2 IP addresses are
not counted and are therefore, decreased from the total count because the
first IP address of any network is the network number and whereas the
last IP address is reserved for broadcast IP.
13
Unit – I Network Layer & Protocols
Classful Addressing :
 In Class A, the net-id is defined by the first byte of the address. And the rest 3
bytes defines the host-id.
 In Class B, the first two bytes of the address defines the network address and
the rest two bytes defines the host-id.
 In Class C the first three bytes defines the network address and the last
byte defines the host-id. These concepts are not applicable to Class D & E.
14
Unit – I Network Layer & Protocols
Classful Addressing :
Mask : Although the length of netid and hostid (in bits) is predetermined in
classful addressing, we can use a mask (also called default mask), which is a 32 bit
number made of contiguous 1’s followed by contiguous 0’s. The default Masks for
Class A, B, C are shown in Table below. This Default Masking Concept is not
applicable to class D & Class E.
15
Unit – I Network Layer & Protocols
Classful Addressing :
Rules for assigning Host ID:
Host ID’s are used to identify a host within a network. The host ID are assigned
based on the following rules:
 Within any network, the host ID must be unique to that network.
 Host ID in which all bits are set to 0 cannot be assigned because this host ID
is used to represent the network ID of the IP address.
 Host ID in which all bits are set to 1 cannot be assigned because this host ID
is reserved as a broadcast address to send packets to all the hosts present on
that particular network.
16
Unit – I Network Layer & Protocols
Classful Addressing :
Rules for assigning Network ID:
Hosts that are located on the same physical network are identified by the network
ID, as all host on the same physical network is assigned the same network ID.
The network ID is assigned based on the following rules:
 The network ID cannot start with 127 because 127 belongs to class A address
and is reserved for internal loop-back functions.
 All bits of network ID set to 1 are reserved for use as an IP broadcast address
and therefore, cannot be used.
 All bits of network ID set to 0 are used to denote a specific host on the local
network and are not routed and therefore, aren’t used.
17
Unit – I Network Layer & Protocols
Classful Addressing :
Class A :
 IP address belonging to class A are assigned to the networks that contain
a large number of hosts.
 The network ID is 8 bits long.
 The host ID is 24 bits long.
 The higher order bit of the first octet in class A is always set to 0. The
remaining 7 bits in first octet are used to determine network ID.
 The 24 bits of host ID are used to determine the host in any network.
 The default subnet mask for class A is 255.x.x.x. Therefore, class A has a
total of: 27-2= 126 network ID (Here 2 address is subtracted because
0.0.0.0 and 127.x.y.z are special address. ) 224 – 2 = 16,777,214 host ID
 IP addresses belonging to class A ranges from 1.x.x.x – 126.x.x.x
18
Unit – I Network Layer & Protocols
Classful Addressing :
Class B :
 IP address belonging to class B are assigned to the networks that ranges
from medium-sized to large-sized networks.
 The network ID is 16 bits long.
 The host ID is 16 bits long.
 The higher order bits of the first octet of IP addresses of class B are
always set to 10. The remaining 14 bits are used to determine network ID.
The 16 bits of host ID is used to determine the host in any network.
 The default sub-net mask for class B is 255.255.x.x. Class B has a total
of: 214 = 16384 network address 216– 2 = 65534 host address
 IP addresses belonging to class B ranges from 128.0.x.x – 191.255.x.x.
19
Unit – I Network Layer & Protocols
Classful Addressing :
Class C :
 IP address belonging to class C are assigned to small-sized networks.
 The network ID is 24 bits long.
 The host ID is 8 bits long.
 The higher order bits of the first octet of IP addresses of class C are
always set to 110. The remaining 21 bits are used to determine network
ID. The 8 bits of host ID is used to determine the host in any network.
 The default sub-net mask for class C is 255.255.255.x. Class C has a total
of: 221 = 2097152 network address 28 – 2 = 254 host address
 IP addresses belonging to class C ranges from 192.0.0.x – 223.255.255.x.
20
Unit – I Network Layer & Protocols
Classful Addressing :
Class D :
 IP address belonging to class D are reserved for multi-casting. The higher
order bits of the first octet of IP addresses belonging to class D are always
set to 1110. The remaining bits are for the address that interested hosts
recognize.
 Class D does not posses any sub-net mask. IP addresses belonging to
class D ranges from 224.0.0.0 – 239.255.255.255.
21
Unit – I Network Layer & Protocols
Classful Addressing :
Class E :
 IP addresses belonging to class E are reserved for experimental and
research purposes. IP addresses of class E ranges from 240.0.0.0 –
255.255.255.254.
 This class doesn’t have any sub-net mask. The higher order bits of first
octet of class E are always set to 1111.
Range of special IP addresses:
 169.254.0.0 – 169.254.0.16 : Link local addresses
 127.0.0.0 – 127.0.0.8 : Loop-back addresses
 0.0.0.0 – 0.0.0.8 : used to communicate within the current network.
22
Unit – I Network Layer & Protocols
Classful Addressing : Subnetting :
 During the era of classful addressing, subnetting was introduced. If an organization was
granted a large blocks in Class A or B, it could divide the addresses in to several
contiguous groups and assign each group to smaller networks called subnets.
 Subnetting increases the number of 1s in the mask. Thus we can say that Subnetting is
the procedure to divide the network into sub-networks or small networks.
 In subnetting, The mask bits are moved towards right.
 Subnetting is implemented via Variable-length subnet masking.
 In subnetting, Address depletion is reduced or removed.
Subnetting :
23
Unit – I Network Layer & Protocols
Classful Addressing : Subnetting :
 Many time most of the mid sized organizations requires the large number of address as
size of Class C addresses does not satisfy their needs. For this the solution is
supernetting.
 Supernetting is the procedure of combine the small networks into larger space.
 Supernetting decreases the number of 1s in the mask
 In Supernetting, Host addresses' bits are increased.
 supernetting is implemented via Classless interdomain routing.
 It is used for simplify routing process.
Supernetting :
24
Unit – I Network Layer & Protocols
Classful Addressing :
Disadvantages of Classful Addressing
 If we consider class A, the number of addresses in each block is more than
enough for almost any organization. So, it results in wastage of addresses.
 Same is the case with class B, probably an organization receiving block from
class B would not require that much of addresses. So, it also results in wastage
of addresses.
 A block in class C may be too small to fulfil the addresses requirement of an
organization.
 Each address in class D defines a group of hosts. Hosts need to multicast the
address. So, the addresses are wasted here too.
 Addresses of class E are reserved for the future purpose which is also wastage
of addresses.
 The main issue here is; we are not assigning addresses according to user
requirements. We directly assign a block of a fixed size which has a fixed
number of addresses which leads to wastage of address.
25
Unit – I Network Layer & Protocols
Classless Addressing :
 Classless addressing is a concept of addressing the IPv4 addresses. It was
adopted after the failure of classful addressing. The classful addressing leads
to wastage of addresses as it assigns a fixed-size block of addresses to the
customer. But, the classless addressing assigns a block of addresses to the
customer according to its requirement which prevents the wastage of
addresses.
 The classless IPv4 addressing does not divide the address space into classes
like classful addressing. It provides a variable-length of blocks, which have a
range of addresses according to the need of users.
 In classless addressing, when an entity, small or large, needs to be connected
to the internet, it is granted a block (range) of IP addresses. The size of block
varies based on the size of entity.
26
Unit – I Network Layer & Protocols
Classless Addressing :
Restriction : To simplify the handling of address, the internet authorities impose
three restrictions on classless address blocks.
1. The address in the block must be contiguous, one after another.
2. The number of address in the block must be in the power of 2 (1,2,4,8…)
3. The first address must be evenly divisible by the number of addresses.
Mask : A better way to define a block of addresses is to select any address in the
block and the mask. As we know that a mask is a 32 bit number in which n
leftmost bits are 1s and the 32-n rightmost bits are 0s. However in classless
addressing the mask for a block can take any value from 0 to 32. it is very
convenient to give just the value of n preceded by a slash (CIDR notation). in
IPv4 addressing, a block of addresses can be defined as x.y.x.t/n in which x.y.z.t
defines one of the addresses and /n defines the mask.
27
Unit – I Network Layer & Protocols
Classless Addressing :
CIDR Notations : Classless Interdomain Routing (CIDR) notation is also called
slash notation. This is used in classless addressing. In this IPV4 address is
followed by a slash (/) and after slash value of n is provided where n is the
number of bits to be masked
Eg. 192.168.10.10/16, in this 192.168.10.10 is an address and /16 means in the
address 16 bits are to be masked.
28
Unit – I Network Layer & Protocols
Classless Addressing :
In classful addressing, if an address is provided then we can detect its class as its first few
bits help us in recognizing the class of address. Knowing the class of address, we can find
the length of net-id as it would be 8, 16 or 24.
Like in classful addressing, the address was divided into two parts net-id and host-id.
Where net-id would define the address of the network and host-id would define the host
address in the corresponding network. And the net-id part and host-id part would vary with
the classes.
The same way the classless addressing also divides the IPv4 address into two parts
referred to as ‘prefix‘ and ‘suffix‘. Prefix defines the network id whereas suffix defines
the host address in the corresponding network.
29
Unit – I Network Layer & Protocols
Classless Addressing :
Addresses belonging to the same block persist the same prefix whereas each host in a
block has a different suffix. As in classful addressing the length of net-id depend on the
class to which the address belongs and it can only be 8, 16 and 24. On the other hand, the
length of a prefix (n) can be 0, 1, 2, 3, . . . . ., 32. So, the value of suffix would
automatically be (32- length of the prefix).
In classless addressing, for a given address prefix length, could not be calculated as it can
belong to a block of any prefix length. So, here the length of the prefix is included with
each address to ease the extraction of block information.
For example:
IPv4 address 167.199.170.82/27 have an added value ’27 ‘ which is separated by a slash,
is a CIDR notation of classless IPv4 address. The value ‘27‘ denotes the length of the
prefix. So, the length of the suffix would be ‘32-27= 5‘.
30
Unit – I Network Layer & Protocols
Classless Addressing :
First Address : The First address in the block can be found by setting the 32-n right
most bits in the binary notation of address to 0s
Eg. For a block of classless IP address 205.16.37.39/28 the first address is calculated
as below.
Given block of IP Address : 205.16.37.39
Binary Notation : 11001101 00010000 00100101 00100111
First address can be calculated by setting 32-n i.e. 32-28 = 4 rightmost bits to 0, we get
First Address in Binary Notation : 11001101 00010000 00100101 00100000
First Address in Dotted Decimal notation is 205.16.37.32.
31
Unit – I Network Layer & Protocols
Classless Addressing :
Last Address : The Last address in the block can be found by setting the 32-n right
most bits in the binary notation of address to 1s
Eg. For a block of classless IP address 205.16.37.39/28 the Last address is calculated
as below.
Given block of IP Address : 205.16.37.39
Binary Notation : 11001101 00010000 00100101 00100111
Last address can be calculated by setting 32-n i.e. 32-28 = 4 rightmost bits to 1, we get
Last Address in Binary Notation : 11001101 00010000 00100101 00101111
Last Address in Dotted Decimal notation is 205.16.37.47.
32
Unit – I Network Layer & Protocols
Classless Addressing :
Number of Addresses : The Number of addresses in the block is the difference
between last and the first address. or it can be calculated using the formula 232-n
Eg. For a block of classless IP address 205.16.37.39/28 the Last address is calculated
as below.
Given block of IP Address : 205.16.37.39/28
Total Number of Addresses = 232-n
n = 28
232-28 = 24 = 16
Total Number of Addresses in a given Block are 16
33
Unit – I Network Layer & Protocols
Classless Addressing :
Another way to find the First Address, Last Address and Number of addresses is
given below.
Eg. For a block of classless IP address 205.16.37.39/28 the First address is calculated
by ANDing the given address with the mask. ANDing is done bit by bit. The result of
ANDing 2 bits is 1 if both bits are 1s, otherwise result is 0.
Given block of IP Address : 205.16.37.39/28
Address In Binary Notation : 11001101 00010000 00100101 00100111
Mask of Given Address is : 11111111 11111111 11111111 11110000
First Address : 11001101 00010000 00100101 00100000
First Address In Dotted Decimal Notation 205.16.37.32
(Mask of Given Address can be calculated by converting leftmost n bits to 1s (in this
case first 28 bits are converted in to 1) and 32-n rightmost bits in to 0s (in this case
32-28 = 4 rightmost bits are converted in to 0)
34
Unit – I Network Layer & Protocols
Classless Addressing :
Another way to find the First Address, Last Address and Number of addresses is
given below.
Eg. For a block of classless IP address 205.16.37.39/28 the Last address is calculated
by ORing the given address with the complement of mask. ORing is done bit by bit.
The result of ORing 2 bits is 0 if both bits are 0s, otherwise result is 1. and complement
can be done by replacing 0 with 1 and vice versa
Given block of IP Address : 205.16.37.39/28
Address In Binary Notation : 11001101 00010000 00100101 00100111
Mask of Given Address is : 00000000 00000000 00000000 00001111
Last Address : 11001101 00010000 00100101 00101111
Last Address In Dotted Decimal Notation 205.16.37.47
(Mask of Given Address can be calculated by converting leftmost n bits to 1s (in this
case first 28 bits are converted in to 1) and 32-n rightmost bits in to 0s (in this case
32-28 = 4 rightmost bits are converted in to 0)
35
Unit – I Network Layer & Protocols
Classless Addressing :
Another way to find the First Address, Last Address and Number of addresses is
given below.
Eg. For a block of classless IP address 205.16.37.39/28 the Total Number of
Addresses calculated by complementing the mask, interpreting it as a decimal number,
and adding 1 to it
Given block of IP Address : 205.16.37.39/28
Address In Binary Notation : 11001101 00010000 00100101 00100111
Mask of Given Address is : 11111111 11111111 11111111 11110000
Complementing of Mask : 00000000 00000000 00000000 00001111
Interpretation of Mask in Decimal = 15
Number of Address In Decimal = 15 +1 = 16
36
Unit – I Network Layer & Protocols
Classless Addressing :
Network Address :
It very important concept of IP address.
When an organization is given a block of addresses, the organization is free to allocate
the addresses to the devices that needs to be connected to internet.
The first address in the class is normally treated as special address
This First address is called network address and defines the organization network.
It defines the organization itself to the rest of the world.
This first address or network address is used by routers to direct the message sent to the
organization from the outside.
The first address in a block is normally not assigned to any device.
37
Unit – I Network Layer & Protocols
Network
Address
Translation
(NAT)
38
Unit – I Network Layer & Protocols
Network Address Translation
Introduction : The Internet Service Provider (ISP) provides a variable block of IPv4
addresses to the midsize organization or home users. Now, what if the organization
grows and requires a large block of addresses or the number of devices accessing the
internet increased at home? It would be impossible for the ISP to fulfill the increased
demand for addresses. This is because the range of addresses before the allocated range
and the range of addresses after the allocated range may be assigned to other small
organizations.
Now, the question arises how to fulfill this increased demand for addresses?
Here, the role of Network Address Translation (NAT) is introduced. In the situation
discussed above, such midsize organization or home users can have several private IP
addresses for a large set of devices/computer to allows internal communication whereas,
few devices/computer are provided with the public addresses for global communication.
39
Unit – I Network Layer & Protocols
Network Address Translation
Private IP addresses need to be unique inside the organization. No matter if they are not
unique globally as everyone is aware that there are three blocks of addresses which are
reserved for private networks. The users can use private IP addresses without the
permission of Internet authorities. The private IP addresses are not routable means any
router will not forward the packet having private addresses in its destination address
field.
Address Translation :- If the computer or a device with private IP address wants to
communicate with the outside world, it would connect to the NAT capable router with
the public IP address and here, the address translation takes place. In the address
translation, a private IP address is mapped to the public IP address and the request is
forwarded to the (destination) outside world.
40
Unit – I Network Layer & Protocols
Network Address Translation
Private IP addresses need to be unique inside the organization. No matter if they are not
unique globally as everyone is aware that there are three blocks of addresses which are
reserved for private networks. The users can use private IP addresses without the
permission of Internet authorities. The private IP addresses are not routable means any
router will not forward the packet having private addresses in its destination address
field.
Address Translation :- If the computer or a device with private IP address wants to
communicate with the outside world, it would connect to the NAT capable router with
the public IP address and here, the address translation takes place. In the address
translation, a private IP address is mapped to the public IP address and the request is
forwarded to the (destination) outside world.
41
Unit – I Network Layer & Protocols
Network Address Translation
NAT Definition : - Network Address Translation is the address translation technique
which translates the internal private IP address to external public IP address and vice
versa. So, the computers with private IP address inside a private network can
communicate with the devices with the public IP address.
How Does NAT Work?
Consider a small private network of a home having four devices i.e. 1 laptop, 1 desktop,
1 tablet and one Smartphone, in its network. As all these devices are the local host they
are provided private IP addresses and all these devices are connected to a NAT router
with a public IP address.
42
Unit – I Network Layer & Protocols
Network Address Translation
Now suppose, if the tablet user at home network wants the information regarding
today’s news. As you can see in the image below, it would send this request to the
server in the outside world with a public IP address, which would have this
information. The server would create a reply packet with the information of today’s
new. The reply packet will have source as server IP address and destination as tablets
private IP address and as we know the private IP address is not routable. The Tablet
would never receive the reply as no router will forward this packet to the table.
43
Unit – I Network Layer & Protocols
Network Address Translation
Solution : NAT router analyzes the request packet sent from a tablet which has tablets
private IP address in its source field and servers public IP address in destination fields.
NAT router put the source private IP address in private IP address column of
translation table the destination (server) address in public IP address column. NAT
router replaces the source private address with the NAT public IP address as you can
see in the image below.
44
Unit – I Network Layer & Protocols
Network Address Translation
The destination server receives the request packet now, with the NAT routers
public IP address as the source address. So, when the server prepares the reply it puts
the NAT routers public IP address in the destination address field and its own global
IP address in the source address field of the reply packet.
Now, as the reply packet has the public IP address in its destination address
field so, it would route the packet to the destination NAT router. The NAT router
analyzes the reply packet which has source address as server’s address. The NAT
router then remaps the servers public IP address to the tablet’s private IP address
with the help of translation table using the source address field of the received packet
and send the reply packet to the corresponding private IP address.
This is how a local host in the private network, communicates with the
devices with global addresses.
Types of NAT : 1) Using one IPAddress, 2) Using a Pool of IPAddress.
3) Using Both IPAddress and Port Numbers
45
Unit – I Network Layer & Protocols
Internet
Protocol
(IP)
46
Unit – I Network Layer & Protocols
1.2 Internet Protocol (IP) :
47
Internet Protocol is one of the major protocols in the TCP/IP protocols suite.
This protocol works at the network layer (layer 3) of the OSI model and at the Internet
layer of the TCP/IP model. Thus this protocol has the responsibility of identifying hosts
based upon their logical addresses and to route data among them over the underlying
network.
IP provides a mechanism to uniquely identify hosts by an IP addressing
scheme. IP uses best effort delivery, i.e. it does not guarantee that packets would be
delivered to the destined host, but it will do its best to reach the destination. Internet
Protocol is a connectionless protocol. Internet Protocol version 4 uses 32-bit logical
address.
Every device or domain that connects to the Internet is assigned an IP
address, and as packets are directed to the IP address attached to them, data arrives
where it is needed.
Unit – I Network Layer & Protocols
1.2 Internet Protocol (IP) :
48
Once the packets arrive at their destination, they are handled differently
depending on which transport protocol is used in combination with IP. The most
common transport protocols are TCP and UDP. 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. The encapsulated data is referred to as IP Payload.
While transmitting data over internet IP manages the addressing of data from
one point to another, and fragments large amount of data in to smaller pieces, called
packets. IP information is attached to each packet, and this information helps routers to
send packets to the right place.
Unit – I Network Layer & Protocols
1.2 Internet Protocol (IP) :
49
IP Datagram Format : Packet in the IPv4 layer are called datagram. Given
figure shows IPv4 Datagram format. A datagram is a variable length packet
consisting of two parts : header and data. The header is 20to 60 bytes in length
and contains information essential to routing and delivery
Figure : Header Format
Unit – I Network Layer & Protocols
1.2 Internet Protocol (IP) :
50
IP Datagram Format : A brief description of each field is given below
Version − Version no. of Internet Protocol used (e.g. IPv4).
IHL − Internet Header Length; Length of entire IP header.
DSCP − Differentiated Services Code Point; this is Type of Service.
ECN − Explicit Congestion Notification; It carries information about the congestion
seen in the route.
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’.
Unit – I Network Layer & Protocols
1.2 Internet Protocol (IP) :
51
IP Datagram Format : A brief description of each field is given below
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.
Unit – I Network Layer & Protocols
1.2 Internet Protocol (IP) :
52
IP Datagram Format : A brief description of each field is given below
Destination Address − 32-bit address of the Receiver (or destination) of the packet.
Options − This is optional field, which is used if the value of IHL is greater than 5.
These options may contain values for options such as Security, Record
Route, Time Stamp, etc.
Unit – I Network Layer & Protocols
1.2 Internet Protocol (IP) :
53
Fragmentation :-
A datagram can travel through different networks. Each router decapsulates the
IPv4 datagram from the frame it receives, processes it, and then encapsulates it in
another frame. The format and size of the received frame depends on the protocol used
by the physical network through which the frame has just travelled. The format and size
of the sent frame depends on the protocol used by the physical network through which
the frame is going to travel. For example, if a router connects a LAN to WAN, it receives
a frame in the LAN format and sends a frame in WAN format.
Maximum Transfer Unit (MTU)
The IP implementation of all devices on an IP internet needs to be aware of the
capacity of the technology used by that implementation for its immediate data link layer
connection to other devices. This limit is called the maximum transmission unit (MTU)
of the network. This term is also sometimes seen as the maximum transfer unit.
Unit – I Network Layer & Protocols
1.2 Internet Protocol (IP) :
54
Fragmentation :-
Why IPv4 Datagram Fragmentation required?
Different Networks may have different maximum transmission unit (MTU), for example
due to differences in LAN technology. When one network wants to transmit datagrams to
a network with a smaller MTU, the routers on path may fragment and reassemble
datagrams.
How is Fragmentation done?
When a packet is received at the router, destination address is examined and MTU is
determined. If size of the packet is bigger than the MTU, and the ‘Do not Fragment
(DF)’ bit is set to 0 in header, then the packet is fragmented into parts and sent one by
one. The maximum size of each fragment is the MTU minus the IP header size
(Minimum 20 bytes and Maximum 60 bytes).
Unit – I Network Layer & Protocols
1.2 Internet Protocol (IP) :
55
Fragmentation :-
Each fragment is converted to a packet and the following changes happen in the
datagram header:
The total length field is changed to the size of the fragment.
The More Fragment bit (MF bit) is set for all the fragment packets except the last one.
The fragment offset field is set, based on the number of fragment that is being set and the
MTU. Header Checksum is re-calculated.
Unit – I Network Layer & Protocols
1.2 Internet Protocol (IP) :
56
Fragmentation :-
Example: For a data packet of 4000 bytes and MTU of 1500 bytes, we have actual data
of 3980 bytes that is to be transmitted and 1480 bytes is the maximum data size that is
permissible to be sent. So, there would be 3 fragments:
For the first fragment, data size = 1480 bytes, offset = 0 and MF flag = 1
For the second fragment, data size = 1480 bytes, offset = 1480 and MF flag = 1
For the third fragment, data size = 1020 bytes, offset = 2960 and MF flag = 0
An important point to be noted here is that all fragments would be having same
identification number, thus indicating that all the fragments belong to the same parent
data packet.
Unit – I Network Layer & Protocols
1.2 Internet Protocol (IP) :
57
Fragmentation :-
Delays –
Processing delay: Time taken by the routers to process the data packet header.
Queuing delay: Time taken by the data packet in routing queues.
Transmission delay: Time taken to load a data packet onto the transmission channel
Dt = N/R,
N: Number of bits to be transmitted
R: Rate or transmission speed of the channel
Propagation delay – Time taken by the data packet to reach from source to destination
Dp = D/S,
D: Distance between the source and the destination
S: is the speed of propagation
Unit – I Network Layer & Protocols
1.2 Internet Protocol (IP) :
58
Fragmentation :-
Delays –
Processing delay: Time taken by the routers to process the data packet header.
Queuing delay: Time taken by the data packet in routing queues.
Transmission delay: Time taken to load a data packet onto the transmission channel
Dt = N/R,
N: Number of bits to be transmitted
R: Rate or transmission speed of the channel
Propagation delay – Time taken by the data packet to reach from source to destination
Dp = D/S,
D: Distance between the source and the destination
S: is the speed of propagation
Unit – I Network Layer & Protocols
1.2 Internet Protocol (IP) :
59
Fragmentation :-
Fragmentation is done by the network layer when the maximum size of datagram is
greater than maximum size of data that can be held a frame i.e., its Maximum
Transmission Unit (MTU). The network layer divides the datagram received from
transport layer into fragments so that data flow is not disrupted. Since there are 16 bits
for total length in IP header so, maximum size of IP datagram = 216 – 1 = 65, 535 bytes.
Unit – I Network Layer & Protocols
1.2 Internet Protocol (IP) :
60
Fragmentation :-
It is done by network layer at the destination side and is usually done at routers. Source
side does not require fragmentation due to wise (good) segmentation by transport layer
i.e. instead of doing segmentation at transport layer and fragmentation at network layer,
the transport layer looks at datagram data limit and frame data limit and does
segmentation in such a way that resulting data can easily fit in a frame without the need
of fragmentation.
Unit – I Network Layer & Protocols
1.2 Internet Protocol (IP) :
61
Fragmentation :-
Receiver identifies the frame with the identification (16 bits) field in IP header. Each
fragment of a frame has same identification number. Receiver identifies sequence of
frames using the fragment offset(13 bits) field in IP header An overhead at network
layer is present due to extra header introduced due to fragmentation.
Fields in IP header for fragmentation –
Identification (16 bits) – use to identify fragments of same frame.
Fragment offset (13 bits) – use to identify sequence of fragments in the frame. It
generally indicates number of data bytes preceding or ahead of the fragment.
Maximum fragment offset possible = (65535 – 20) – 1 = 65514
{where 65535 is maximum size of datagram and 20 is minimum size of IP header}
Unit – I Network Layer & Protocols
1.2 Internet Protocol (IP) :
62
Fragmentation :-
So, we need ceil(log265514) = 16 bits for fragment offset but fragment offset field has only
13 bits. So, to represent efficiently we need to scale down fragment offset field by 216/213 =
8 which acts as a scaling factor. Hence, all fragments except the last fragment should have
data in multiples of 8 so that fragment offset ∈ N.
More fragments (MF = 1 bit) – tells if more fragments ahead of this fragment i.e. if MF =
1, more fragments are ahead of this fragment and if MF = 0, it is the last fragment.
Don’t fragment (DF = 1 bit) – if we don’t want the packet to be fragmented then DF is set
i.e. DF = 1
Reassembly of Fragments –
It takes place only at destination and not at routers since packets take independent path
(datagram packet switching), so all may not meet at a router and hence a need of
fragmentation may arise again. The fragments may arrive out of order also.
Unit – I Network Layer & Protocols
1.2 Internet Protocol (IP) :
63
Options :-
The header of the IPv4 datagram is made up of two parts: a fixed part and a variable part.
The fixed part is fixed 20 bytes long and the variable part comprises the options that can be
a maximum of 40 bytes.
As the name implies options are not required for a datagram. They can be used for network
testing and debugging. If options are present in the datagram then it must be handled by
IPv4 software.
Unit – I Network Layer & Protocols
1.2 Internet Protocol (IP) :
64
Options :-
No Operation :- A no operation is a 1 byte option used as a filler between options.
End of Option :- An end of option is a 1 byte option used for padding at the end of the
option field. It, however, can only be used as the last option.
Record Rote :- A record route option is used to record the internet routers that handle the
datagram. It can list up to nine router addresses. It can be used for debugging and
management purposes.
Strict Source Route :- A strict source route option is used by the source to predetermine a
route for the datagram as it travels through the internet. Dictation of a route by the source
can be useful for several purposes. The sender can choose a route with a specific type of
service, such as minimum delay or maximum throughput. Alternatively, it may choose a
route that is safer or more reliable for the senders purpose. For example a sender can
choose a route so that its datagram does not travel through competitors network.
Unit – I Network Layer & Protocols
1.2 Internet Protocol (IP) :
65
Options :- If a datagram specifies a strict source route, all the routers defined in the
option must be visited by the datagram. A router must not be visited if its IPv4 address is
not listed in the datagram if a datagram visits a router that is not on the list, the datagram is
discarded and an error message is issued. If datagram is arrived at destination and some of
entries were not visited then also it can be discarded and an error message is issued
Loose Source Route :- A loose source route option is similar to the strict source route, but
it is less rigid. Each router in the list must be visited, but the datagram can visit other
routers as well.
Timestamp :- A timestamp option is used to record the time of the datagram processing by
a router. The time is expressed in millisecond's from midnight, universal time or GMT. By
knowing the time a datagram processed, this can help the users and network managers
track the behavior of the routers in the internet. Using this we can estimate the time that a
datagram takes to reach from one router to another.
Unit – I Network Layer & Protocols
Internet Control
Message Protocol
(ICMPv4)
66
Unit – I Network Layer & Protocols
1.3 Internet Control Message Protocol (ICMPv4) :
67
Introduction - As we are aware that IPv4 protocol doesn’t have any mechanism to
report error or correct error. So, IP functions in assistance with ICMP for reporting
errors; ICMP never gets involved in correcting the errors, this task is taken care of by
higher-level protocols. Every time, ICMPv4 deliver error report to the original source
of the datagram. ICMPv4 Internet Control Message Protocol version 4 is definitely a
Network layer protocol and its job is to report the error to the source if any problem
arises while delivering the datagram from the source host to the destination host. The
ICMPv4 is a message-oriented protocol. It’s a protocol of version of 4 of TCP/IP
protocol suite.
Unit – I Network Layer & Protocols
1.3 Internet Control Message Protocol (ICMPv4) :
68
There can be several reasons behind reporting the error like:
A router with a datagram for a host in another network, may not find the next hop
(router) to the final destination host.
Datagram’s time-to-live field has become zero.
There may be ambiguity in the header of IP datagram.
It may happen that all the fragments of datagram if do not arrive within a time limit to
the destination host. And there can be several reasons to report the error.
Though ICMP is a Network layer protocol, it’s messages are not directly passed to the
lower layer (i.e. data link layer). ICMP messages are encapsulated in the IP datagram
and then they are passed to the lower layer.
Unit – I Network Layer & Protocols
1.3 Internet Control Message Protocol (ICMPv4) :
69
ICMPv4 Message Format
The message format for ICMPv4 message is given below. It has an 8-byte
header and apart from this, it has a variable size data section. Though the header
format gets changed for each type of message, still the first 4 bytes of each message
remains the same.
Unit – I Network Layer & Protocols
1.3 Internet Control Message Protocol (ICMPv4) :
70
ICMPv4 Message Format
Among these first 4 bytes, the first byte describes the ‘type‘ of the message
the second byte clarifies the reason behind the ‘type’ of the message. The next two bytes
define the checksum field of the message.
The rest 4 bytes defines the rest of the header which is specific for each
message type. The data section varies according to the type of message. The data
section of the error reporting message holds the information to identify the original
datagram that has an error. The data section of the query message holds more
information regarding the type of query.
Types of ICMPv4 Messages
The ICMPv4 messages are classified as: 1) Error Reporting Messages 2) Query Messages
Unit – I Network Layer & Protocols
1.3 Internet Control Message Protocol (ICMPv4) :
71
ICMPv4 Message Format
Error Reporting Messages - The most important function of ICMPv4 is to report the
error. Although it is not responsible to correct the errors, this task is given to higher-level
protocols. ICMPv4 always send the error report to the original source of the datagram as
the datagram has only two addresses in its header, source address and destination address.
So, ICMPv4 uses the source address for reporting the error
There are some important characteristics of ICMPv4 message:
ICMPv4 error message will not be generated in response to ICMP error messages as this
can create infinite repetition.
ICMPv4 error message will not be generated for the fragmented datagram if the fragment
is not the first fragment.
Unit – I Network Layer & Protocols
1.3 Internet Control Message Protocol (ICMPv4) :
72
ICMPv4 Message Format
There are some important characteristics of ICMPv4 message:
ICMPv4 error message is not generated for the datagram having the special address,
127.0.0.0 or 0.0.0.0.
ICMPv4 messages are not generated for the datagrams with the broadcast address or a
multicast address in its destination field.
ICMPv4 Error Reporting Messages are further classified as:
Destination Unreachable
Source Quench
Time Exceeded
Parameter Problems
Redirection
Unit – I Network Layer & Protocols
1.3 Internet Control Message Protocol (ICMPv4) :
73
ICMPv4 Debugging Tools
There are several tools that can be used in the internet for debugging. By using these tools
we can determine the viability of a host or router. We can trace the route of the packet.
ICMPv4 uses two debugging tools : Ping and Traceroute
Ping : ping tool is used to find if a host is alive and responding. In ICMPv4 the source
host sends ICMP echo request messages, the destination, if alive, responds with ICMP
echo reply messages. The ping program sets the identifier field in the echo request and
echo reply message and starts the sequence number from 0. this number is incremented by
1 each time a new message is sent. Ping can calculate the round trip time. It inserts the
sending time in the data section of the message. When the packet arrives, it subtracts the
arrival time from the departure time to get round trip time (RTT)
Unit – I Network Layer & Protocols
1.3 Internet Control Message Protocol (ICMPv4) :
74
ICMPv4 Debugging Tools
Example of Ping debugging tool
We use the ping program to test the server fhda.edu. The result is shown below:
Example 2 of Ping debugging tool
For the second example, we want to know if the adelphia.net mail server is alive and
running. The result is shown below: Note that in this case, we sent 14 packets, but only 13
have been returned. We may have interrupted the program before the last packet, with
sequence number 13, was returned.
Unit – I Network Layer & Protocols
1.3 Internet Control Message Protocol (ICMPv4) :
75
ICMPv4 Debugging Tools
Traceroute Debugging Tool :- Traceroute or Tracert tool in UNIX or in windows can be
used to trace the route of a packet from the source to the destination. Tracert uses two
ICMP messages, time exceeded and destination unreachable to find the route of the
packet. This is a program at application level uses services of UDP.
Unit – I Network Layer & Protocols
1.3 Internet Control Message Protocol (ICMPv4) :
76
ICMPv4 Debugging Tools
Fig.- The Traceroute Program Operation
Traceroute Debugging Tool :-
Example 1 - We use the traceroute program to find the route from the computer
voyager.deanza.edu to the server fhda.edu. The following shows the result.
Unit – I Network Layer & Protocols
1.3 Internet Control Message Protocol (ICMPv4) :
77
ICMPv4 Debugging Tools
Traceroute Debugging Tool :-
Example 2 - In this example, we trace a longer route, the route to xerox.com. The
following is a partial listing.
Unit – I Network Layer & Protocols
1.3 Internet Control Message Protocol (ICMPv4) :
78
ICMPv4 Debugging Tools
Traceroute Debugging Tool :-
Example 3 - An interesting point is that a host can send a traceroute packet to itself. This
can be done by specifying the host as the destination. The packet goes to the loopback
address as we expect.
Unit – I Network Layer & Protocols
1.3 Internet Control Message Protocol (ICMPv4) :
79
ICMPv4 Debugging Tools
Checksum is an error detection method. The concept of checksum is based on redundancy.
In ICMPv4 checksum is calculated over the entire message (header and data).
Unit – I Network Layer & Protocols
1.3 Internet Control Message Protocol (ICMPv4) :
80
ICMPv4 Checksum
above figure shows an example of checksum calculation for a simple echo-request
message. We randomly chose the identifier to be 1 and the sequence number to be 9. The
message is divided into 16-bit (2-byte) words. The words are added together and the sum
is complemented. Now the sender can put this value in the checksum field.
Unit – I Network Layer & Protocols
Mobile IP
81
Mobile IP is a communication protocol which is introduced as an improved version of the
IP protocol. With mobile IP the host can move to a different network and still be
connected to its home network and can communicate with the remote hosts.
Unit – I Network Layer & Protocols
1.4 Mobile IP
82
Introduction -
Why is Mobile IP needed?
While implementing the IP addressing system it was considered that the host would be a
stationary host and would stick to the ‘specific network’ only. This is because the prefix
of the IP address is used to identify the network and suffix of the IP address identifies the
host in the corresponding network. What if the host moved to another network? Its IP
address would no longer be valid. So, how it can communicate with the remote hosts?
IP Addressing system needs to be improved. Below we will discuss two solutions that
have been proposed to modify the IP addressing system.
Unit – I Network Layer & Protocols
1.4 Mobile IP
83
Introduction -
Changing the IP address each time the host enters a new network. This attempt was not as
successful as it has several drawbacks. Every time the computer enters a new network it
as to be rebooted. The DNS table needs to be revised to let every host on the internet have
knowledge about changes. Configuration files need to change each time. If the host
moves to another network in-between the transmission of data, the data exchange would
be interrupted.
This solution is more feasible. Here, a host will have two addresses, an original
address which would identify the host in the home network and a temporary address
(care-of address) which would identify the host in the foreign network. The care-of
address will keep on changing whenever the host will move to a new network.
So, the Mobile IP protocol allows a host to move to another network by maintaining its
original IP address and still communicate with the other hosts over the internet.
Unit – I Network Layer & Protocols
1.4 Mobile IP
84
Introduction -
Changing the IP address each time the host enters a new network. This attempt was not as
successful as it has several drawbacks. Every time the computer enters a new network it
as to be rebooted. The DNS table needs to be revised to let every host on the internet have
knowledge about changes. Configuration files need to change each time. If the host
moves to another network in-between the transmission of data, the data exchange would
be interrupted.
This solution is more feasible. Here, a host will have two addresses, an original
address which would identify the host in the home network and a temporary address
(care-of address) which would identify the host in the foreign network. The care-of
address will keep on changing whenever the host will move to a new network.
So, the Mobile IP protocol allows a host to move to another network by maintaining its
original IP address and still communicate with the other hosts over the internet.
Unit – I Network Layer & Protocols
1.4 Mobile IP
85
Entities of Mobile IP
The functional entities in the Mobile IP protocol are discussed below:
Home Network – It is a network to which the mobile host actually belongs. It is a
permanent network of the mobile host.
Foreign Network – It is a new network into which mobile host has moved.
Remote Network – It is the network which is neither the home network nor the foreign
network.
Mobile Host – It is a host of the home network which has moved to the foreign network.
Remote Host – It is a host in a remote network.
Home Agent – It is a router attached to the home network which allows the mobile host
to send and receive data from the remote host over the internet.
Unit – I Network Layer & Protocols
1.4 Mobile IP
86
Entities of Mobile IP :-
Foreign Agent – It is a router attached to the foreign network which allows a mobile
host to send and receive data from a remote host over the internet.
Care-of address – It is a temporary IP address provided by the foreign agent to mobile
host till it is in the foreign network.
Home Address – It is the address of the mobile host in its home network.
Unit – I Network Layer & Protocols
1.4 Mobile IP
87
Working of Mobile IP :-
Unit – I Network Layer & Protocols
1.4 Mobile IP
88
Working of Mobile IP :-
Above figure shows the demonstration of working of mobile IP
Correspondent node sends the data to the mobile node. Data packets contains
correspondent node’s address (Source) and home address (Destination). Packets
reaches to the home agent. But now mobile node is not in the home network, it has
moved into the foreign network. Foreign agent sends the care-of-address to the home
agent to which all the packets should be sent. Now, a tunnel will be established
between the home agent and the foreign agent by the process of tunneling.
Tunneling - establishes a virtual pipe for the packets available between a tunnel entry
and an endpoint. It is the process of sending a packet via a tunnel and it is achieved by
a mechanism called encapsulation.
Unit – I Network Layer & Protocols
1.4 Mobile IP
89
Working of Mobile IP :-
Now, home agent encapsulates the data packets into new packets in which
the source address is the home address and destination is the care-of-address and sends
it through the tunnel to the foreign agent. Foreign agent, on other side of the tunnel
receives the data packets, decapsulates them and sends them to the mobile node.
Mobile node in response to the data packets received, sends a reply in response to
foreign agent. Foreign agent directly sends the reply to the correspondent node.
Key Mechanisms in Mobile IP:
Agent Discovery: Agents advertise their presence by periodically broadcasting their
agent advertisement messages. The mobile node receiving the agent advertisement
messages observes whether the message is from its own home agent and determines
whether it is in the home network or foreign network.
Unit – I Network Layer & Protocols
1.4 Mobile IP
90
Key Mechanisms in Mobile IP:
Agent Registration: Mobile node after discovering the foreign agent, sends
registration request (RREQ) to the foreign agent. Foreign agent in turn, sends the
registration request to the home agent with the care-of-address. Home agent sends
registration reply (RREP) to the foreign agent. Then it forwards the registration reply
to the mobile node and completes the process of registration.
Tunneling: It establishes a virtual pipe for the packets available between a tunnel
entry and an endpoint. It is the process of sending a packet via a tunnel and it is
achieved by a mechanism called encapsulation. It takes place to forward an IP
datagram from the home agent to the care-of-address. Whenever home agent
receives a packet from correspondent node, it encapsulates the packet with source
address as home address and destination as care-of-address.
Unit – I Network Layer & Protocols
1.4 Mobile IP
91
Advantages and Disadvantages of Mobile IP
Advantages
• A user with its network devices can move to any other network without losing its
connection with home address.
• Mobile IP provides transparency while the data transfer process. It hides the fact
that the mobile host is not in its home network and is communicating from the
foreign network.
Unit – I Network Layer & Protocols
1.4 Mobile IP
92
Advantages and Disadvantages of Mobile IP
Disadvantages
• When the ‘remote host’ and ‘mobile host’ both are in a foreign network and still the
data transfer is occurring through the ‘home agent’ then the data packet has to
travel more distance though both the host are in the same network.
• As we have seen above, if the mobile host in the foreign network wants to send the
data packet to remote host it sends it directly from the foreign network with its
home address as the source and remote host address in the destination.
But, if a remote host wants to send a packet to a mobile host in the foreign network,
the data packet has to travel to the mobile host via its home agent. So, here it has to
travel the extra distance.
Unit – I Network Layer & Protocols
Virtual Private
Network (VPN)
93
Unit – I Network Layer & Protocols
1.5 Virtual Private Network
94
Introduction :
VPN stands for virtual private network. A virtual private network (VPN) is a
technology that creates a safe and encrypted connection over a less secure network,
such as the internet. Virtual Private network is a way to extend a private network using
a public network such as internet. The name only suggests that it is Virtual “private
network” i.e. user can be the part of local network sitting at a remote location. It
makes use of tunneling protocols to establish a secure connection.
Image – Virtual Private Network, Source - Wikipedia
Unit – I Network Layer & Protocols
1.5 Virtual Private Network
95
Features of VPN
 VPN also ensures security by providing an encrypted tunnel between client and
VPN server.
 VPN is used to bypass many blocked sites.
 VPN facilitates Anonymous browsing by hiding your IP address.
 Search engine optimization(SEO) is done by analyzing the data from VPN
providers which provide country wise stats of browsing a particular product . This
method of SEO is used widely my many internet marketing managers to form new
strategies.
Unit – I Network Layer & Protocols
1.5 Virtual Private Network
96
How a VPN works
At its most basic level, VPN tunneling creates a point-to-point connection
that cannot be accessed by unauthorized users. To actually create the tunnel, the
endpoint device needs to be running a VPN client (software application) locally or in
the cloud. The client runs in the background. It is not noticeable to the end user,
unless there are performance issues.
The performance can be affected by many factors, like speed of users'
internet connections, the protocol types an internet provider may use, and the type of
encryption it uses. In the enterprise, performance can also be affected by poor quality
of service (QoS) outside the control of an organization's information technology (IT)
department.
Unit – I Network Layer & Protocols
1.5 Virtual Private Network
97
VPN protocols
VPN protocols ensure an appropriate level of security to connected systems,
when the underlying network infrastructure alone cannot provide it. There are several
different protocols used to secure and encrypt users and corporate data. They include:
 IP security (IPsec)
 Secure Sockets Layer (SSL) and Transport Layer Security (TLS)
 Point-To-Point Tunneling Protocol (PPTP)
 Layer 2 Tunneling Protocol (L2TP)
 OpenVPN
Types of VPNs :-
Remote Access VPN, Site to site VPN, Mobile VPN, Hardware VPN, VPN
Appliance, Dynamic Multipoint Virtual Private Network.
Unit – I Network Layer & Protocols
98

More Related Content

Similar to https://diplomasolutionstudents.blogspot.com/

IP Address - IPv4 & IPv6
IP Address - IPv4 & IPv6IP Address - IPv4 & IPv6
IP Address - IPv4 & IPv6Adeel Rasheed
 
IP Addressing & subnetting strategy
IP Addressing & subnetting strategyIP Addressing & subnetting strategy
IP Addressing & subnetting strategyMustafa Salam
 
ip addressing & routing
 ip addressing & routing ip addressing & routing
ip addressing & routingVikas Jagtap
 
IPv4 addressing and subnetting
IPv4 addressing and subnettingIPv4 addressing and subnetting
IPv4 addressing and subnettingShashank Asthana
 
Basics of IP Addressing
Basics of IP AddressingBasics of IP Addressing
Basics of IP AddressingKushal Sheth
 
Unit 1- Network Layer and Protocols-4.pptx
Unit 1- Network Layer and Protocols-4.pptxUnit 1- Network Layer and Protocols-4.pptx
Unit 1- Network Layer and Protocols-4.pptxDESTROYER39
 
5 configuring TCP/IP
5 configuring TCP/IP5 configuring TCP/IP
5 configuring TCP/IPHameda Hurmat
 
Computer Networking: Internet Protcol (IP) and IP Addressing
Computer Networking: Internet Protcol (IP) and IP AddressingComputer Networking: Internet Protcol (IP) and IP Addressing
Computer Networking: Internet Protcol (IP) and IP AddressingBisrat Girma
 
6 ccna (fundamentals of i pv4 addressing and routing)
6  ccna (fundamentals of i pv4 addressing and routing)6  ccna (fundamentals of i pv4 addressing and routing)
6 ccna (fundamentals of i pv4 addressing and routing)Ulaş Ural
 
183492595 md.jiarul islam(CSE 318)
183492595 md.jiarul islam(CSE 318)183492595 md.jiarul islam(CSE 318)
183492595 md.jiarul islam(CSE 318)MdJiarulIslam
 

Similar to https://diplomasolutionstudents.blogspot.com/ (20)

IP and MAC addressing
IP and MAC addressingIP and MAC addressing
IP and MAC addressing
 
chapter 6.pptx
chapter 6.pptxchapter 6.pptx
chapter 6.pptx
 
IP Address - IPv4 & IPv6
IP Address - IPv4 & IPv6IP Address - IPv4 & IPv6
IP Address - IPv4 & IPv6
 
Ip address
Ip addressIp address
Ip address
 
Ipv4 presentation
Ipv4 presentationIpv4 presentation
Ipv4 presentation
 
IP Addressing & subnetting strategy
IP Addressing & subnetting strategyIP Addressing & subnetting strategy
IP Addressing & subnetting strategy
 
ip addressing & routing
 ip addressing & routing ip addressing & routing
ip addressing & routing
 
IPv4 addressing and subnetting
IPv4 addressing and subnettingIPv4 addressing and subnetting
IPv4 addressing and subnetting
 
Basics of IP Addressing
Basics of IP AddressingBasics of IP Addressing
Basics of IP Addressing
 
Unit 1- Network Layer and Protocols-4.pptx
Unit 1- Network Layer and Protocols-4.pptxUnit 1- Network Layer and Protocols-4.pptx
Unit 1- Network Layer and Protocols-4.pptx
 
IP Addressing
IP AddressingIP Addressing
IP Addressing
 
ipv4 (internet protocol version 4)
  ipv4 (internet protocol version 4)     ipv4 (internet protocol version 4)
ipv4 (internet protocol version 4)
 
IP and MAC Address
IP and MAC AddressIP and MAC Address
IP and MAC Address
 
Internet Protocol
Internet ProtocolInternet Protocol
Internet Protocol
 
Ip and mac addressing
Ip and mac addressingIp and mac addressing
Ip and mac addressing
 
5 configuring TCP/IP
5 configuring TCP/IP5 configuring TCP/IP
5 configuring TCP/IP
 
Computer Networking: Internet Protcol (IP) and IP Addressing
Computer Networking: Internet Protcol (IP) and IP AddressingComputer Networking: Internet Protcol (IP) and IP Addressing
Computer Networking: Internet Protcol (IP) and IP Addressing
 
6 ccna (fundamentals of i pv4 addressing and routing)
6  ccna (fundamentals of i pv4 addressing and routing)6  ccna (fundamentals of i pv4 addressing and routing)
6 ccna (fundamentals of i pv4 addressing and routing)
 
183492595 md.jiarul islam(CSE 318)
183492595 md.jiarul islam(CSE 318)183492595 md.jiarul islam(CSE 318)
183492595 md.jiarul islam(CSE 318)
 
Ipv4 and Ipv6
Ipv4 and Ipv6Ipv4 and Ipv6
Ipv4 and Ipv6
 

Recently uploaded

EDUROOT SME_ Performance upto March-2024.pptx
EDUROOT SME_ Performance upto March-2024.pptxEDUROOT SME_ Performance upto March-2024.pptx
EDUROOT SME_ Performance upto March-2024.pptxaaryamanorathofficia
 
13875446-Ballistic Missile Trajectories.ppt
13875446-Ballistic Missile Trajectories.ppt13875446-Ballistic Missile Trajectories.ppt
13875446-Ballistic Missile Trajectories.pptsilvialandin2
 
Action Toolkit - Earth Day 2024 - April 22nd.
Action Toolkit - Earth Day 2024 - April 22nd.Action Toolkit - Earth Day 2024 - April 22nd.
Action Toolkit - Earth Day 2024 - April 22nd.Christina Parmionova
 
High Class Call Girls Bangalore Komal 7001305949 Independent Escort Service B...
High Class Call Girls Bangalore Komal 7001305949 Independent Escort Service B...High Class Call Girls Bangalore Komal 7001305949 Independent Escort Service B...
High Class Call Girls Bangalore Komal 7001305949 Independent Escort Service B...narwatsonia7
 
No.1 Call Girls in Basavanagudi ! 7001305949 ₹2999 Only and Free Hotel Delive...
No.1 Call Girls in Basavanagudi ! 7001305949 ₹2999 Only and Free Hotel Delive...No.1 Call Girls in Basavanagudi ! 7001305949 ₹2999 Only and Free Hotel Delive...
No.1 Call Girls in Basavanagudi ! 7001305949 ₹2999 Only and Free Hotel Delive...narwatsonia7
 
Jewish Efforts to Influence American Immigration Policy in the Years Before t...
Jewish Efforts to Influence American Immigration Policy in the Years Before t...Jewish Efforts to Influence American Immigration Policy in the Years Before t...
Jewish Efforts to Influence American Immigration Policy in the Years Before t...yalehistoricalreview
 
Cunningham Road Call Girls Bangalore WhatsApp 8250192130 High Profile Service
Cunningham Road Call Girls Bangalore WhatsApp 8250192130 High Profile ServiceCunningham Road Call Girls Bangalore WhatsApp 8250192130 High Profile Service
Cunningham Road Call Girls Bangalore WhatsApp 8250192130 High Profile ServiceHigh Profile Call Girls
 
Panet vs.Plastics - Earth Day 2024 - 22 APRIL
Panet vs.Plastics - Earth Day 2024 - 22 APRILPanet vs.Plastics - Earth Day 2024 - 22 APRIL
Panet vs.Plastics - Earth Day 2024 - 22 APRILChristina Parmionova
 
(SUHANI) Call Girls Pimple Saudagar ( 7001035870 ) HI-Fi Pune Escorts Service
(SUHANI) Call Girls Pimple Saudagar ( 7001035870 ) HI-Fi Pune Escorts Service(SUHANI) Call Girls Pimple Saudagar ( 7001035870 ) HI-Fi Pune Escorts Service
(SUHANI) Call Girls Pimple Saudagar ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
VIP Kolkata Call Girl Jatin Das Park 👉 8250192130 Available With Room
VIP Kolkata Call Girl Jatin Das Park 👉 8250192130  Available With RoomVIP Kolkata Call Girl Jatin Das Park 👉 8250192130  Available With Room
VIP Kolkata Call Girl Jatin Das Park 👉 8250192130 Available With Roomishabajaj13
 
Greater Noida Call Girls 9711199012 WhatsApp No 24x7 Vip Escorts in Greater N...
Greater Noida Call Girls 9711199012 WhatsApp No 24x7 Vip Escorts in Greater N...Greater Noida Call Girls 9711199012 WhatsApp No 24x7 Vip Escorts in Greater N...
Greater Noida Call Girls 9711199012 WhatsApp No 24x7 Vip Escorts in Greater N...ankitnayak356677
 
Russian Call Girl Hebbagodi ! 7001305949 ₹2999 Only and Free Hotel Delivery 2...
Russian Call Girl Hebbagodi ! 7001305949 ₹2999 Only and Free Hotel Delivery 2...Russian Call Girl Hebbagodi ! 7001305949 ₹2999 Only and Free Hotel Delivery 2...
Russian Call Girl Hebbagodi ! 7001305949 ₹2999 Only and Free Hotel Delivery 2...narwatsonia7
 
Precarious profits? Why firms use insecure contracts, and what would change t...
Precarious profits? Why firms use insecure contracts, and what would change t...Precarious profits? Why firms use insecure contracts, and what would change t...
Precarious profits? Why firms use insecure contracts, and what would change t...ResolutionFoundation
 
Call Girl Benson Town - Phone No 7001305949 For Ultimate Sexual Urges
Call Girl Benson Town - Phone No 7001305949 For Ultimate Sexual UrgesCall Girl Benson Town - Phone No 7001305949 For Ultimate Sexual Urges
Call Girl Benson Town - Phone No 7001305949 For Ultimate Sexual Urgesnarwatsonia7
 
WORLD CREATIVITY AND INNOVATION DAY 2024.
WORLD CREATIVITY AND INNOVATION DAY 2024.WORLD CREATIVITY AND INNOVATION DAY 2024.
WORLD CREATIVITY AND INNOVATION DAY 2024.Christina Parmionova
 
VIP High Profile Call Girls Gorakhpur Aarushi 8250192130 Independent Escort S...
VIP High Profile Call Girls Gorakhpur Aarushi 8250192130 Independent Escort S...VIP High Profile Call Girls Gorakhpur Aarushi 8250192130 Independent Escort S...
VIP High Profile Call Girls Gorakhpur Aarushi 8250192130 Independent Escort S...Suhani Kapoor
 
Powering Britain: Can we decarbonise electricity without disadvantaging poore...
Powering Britain: Can we decarbonise electricity without disadvantaging poore...Powering Britain: Can we decarbonise electricity without disadvantaging poore...
Powering Britain: Can we decarbonise electricity without disadvantaging poore...ResolutionFoundation
 
Call Girls Service Race Course Road Just Call 7001305949 Enjoy College Girls ...
Call Girls Service Race Course Road Just Call 7001305949 Enjoy College Girls ...Call Girls Service Race Course Road Just Call 7001305949 Enjoy College Girls ...
Call Girls Service Race Course Road Just Call 7001305949 Enjoy College Girls ...narwatsonia7
 

Recently uploaded (20)

EDUROOT SME_ Performance upto March-2024.pptx
EDUROOT SME_ Performance upto March-2024.pptxEDUROOT SME_ Performance upto March-2024.pptx
EDUROOT SME_ Performance upto March-2024.pptx
 
13875446-Ballistic Missile Trajectories.ppt
13875446-Ballistic Missile Trajectories.ppt13875446-Ballistic Missile Trajectories.ppt
13875446-Ballistic Missile Trajectories.ppt
 
Action Toolkit - Earth Day 2024 - April 22nd.
Action Toolkit - Earth Day 2024 - April 22nd.Action Toolkit - Earth Day 2024 - April 22nd.
Action Toolkit - Earth Day 2024 - April 22nd.
 
High Class Call Girls Bangalore Komal 7001305949 Independent Escort Service B...
High Class Call Girls Bangalore Komal 7001305949 Independent Escort Service B...High Class Call Girls Bangalore Komal 7001305949 Independent Escort Service B...
High Class Call Girls Bangalore Komal 7001305949 Independent Escort Service B...
 
No.1 Call Girls in Basavanagudi ! 7001305949 ₹2999 Only and Free Hotel Delive...
No.1 Call Girls in Basavanagudi ! 7001305949 ₹2999 Only and Free Hotel Delive...No.1 Call Girls in Basavanagudi ! 7001305949 ₹2999 Only and Free Hotel Delive...
No.1 Call Girls in Basavanagudi ! 7001305949 ₹2999 Only and Free Hotel Delive...
 
Jewish Efforts to Influence American Immigration Policy in the Years Before t...
Jewish Efforts to Influence American Immigration Policy in the Years Before t...Jewish Efforts to Influence American Immigration Policy in the Years Before t...
Jewish Efforts to Influence American Immigration Policy in the Years Before t...
 
Cunningham Road Call Girls Bangalore WhatsApp 8250192130 High Profile Service
Cunningham Road Call Girls Bangalore WhatsApp 8250192130 High Profile ServiceCunningham Road Call Girls Bangalore WhatsApp 8250192130 High Profile Service
Cunningham Road Call Girls Bangalore WhatsApp 8250192130 High Profile Service
 
Panet vs.Plastics - Earth Day 2024 - 22 APRIL
Panet vs.Plastics - Earth Day 2024 - 22 APRILPanet vs.Plastics - Earth Day 2024 - 22 APRIL
Panet vs.Plastics - Earth Day 2024 - 22 APRIL
 
(SUHANI) Call Girls Pimple Saudagar ( 7001035870 ) HI-Fi Pune Escorts Service
(SUHANI) Call Girls Pimple Saudagar ( 7001035870 ) HI-Fi Pune Escorts Service(SUHANI) Call Girls Pimple Saudagar ( 7001035870 ) HI-Fi Pune Escorts Service
(SUHANI) Call Girls Pimple Saudagar ( 7001035870 ) HI-Fi Pune Escorts Service
 
VIP Kolkata Call Girl Jatin Das Park 👉 8250192130 Available With Room
VIP Kolkata Call Girl Jatin Das Park 👉 8250192130  Available With RoomVIP Kolkata Call Girl Jatin Das Park 👉 8250192130  Available With Room
VIP Kolkata Call Girl Jatin Das Park 👉 8250192130 Available With Room
 
Call Girls In Rohini ꧁❤ 🔝 9953056974🔝❤꧂ Escort ServiCe
Call Girls In  Rohini ꧁❤ 🔝 9953056974🔝❤꧂ Escort ServiCeCall Girls In  Rohini ꧁❤ 🔝 9953056974🔝❤꧂ Escort ServiCe
Call Girls In Rohini ꧁❤ 🔝 9953056974🔝❤꧂ Escort ServiCe
 
Greater Noida Call Girls 9711199012 WhatsApp No 24x7 Vip Escorts in Greater N...
Greater Noida Call Girls 9711199012 WhatsApp No 24x7 Vip Escorts in Greater N...Greater Noida Call Girls 9711199012 WhatsApp No 24x7 Vip Escorts in Greater N...
Greater Noida Call Girls 9711199012 WhatsApp No 24x7 Vip Escorts in Greater N...
 
Russian Call Girl Hebbagodi ! 7001305949 ₹2999 Only and Free Hotel Delivery 2...
Russian Call Girl Hebbagodi ! 7001305949 ₹2999 Only and Free Hotel Delivery 2...Russian Call Girl Hebbagodi ! 7001305949 ₹2999 Only and Free Hotel Delivery 2...
Russian Call Girl Hebbagodi ! 7001305949 ₹2999 Only and Free Hotel Delivery 2...
 
Precarious profits? Why firms use insecure contracts, and what would change t...
Precarious profits? Why firms use insecure contracts, and what would change t...Precarious profits? Why firms use insecure contracts, and what would change t...
Precarious profits? Why firms use insecure contracts, and what would change t...
 
Call Girl Benson Town - Phone No 7001305949 For Ultimate Sexual Urges
Call Girl Benson Town - Phone No 7001305949 For Ultimate Sexual UrgesCall Girl Benson Town - Phone No 7001305949 For Ultimate Sexual Urges
Call Girl Benson Town - Phone No 7001305949 For Ultimate Sexual Urges
 
WORLD CREATIVITY AND INNOVATION DAY 2024.
WORLD CREATIVITY AND INNOVATION DAY 2024.WORLD CREATIVITY AND INNOVATION DAY 2024.
WORLD CREATIVITY AND INNOVATION DAY 2024.
 
VIP High Profile Call Girls Gorakhpur Aarushi 8250192130 Independent Escort S...
VIP High Profile Call Girls Gorakhpur Aarushi 8250192130 Independent Escort S...VIP High Profile Call Girls Gorakhpur Aarushi 8250192130 Independent Escort S...
VIP High Profile Call Girls Gorakhpur Aarushi 8250192130 Independent Escort S...
 
Powering Britain: Can we decarbonise electricity without disadvantaging poore...
Powering Britain: Can we decarbonise electricity without disadvantaging poore...Powering Britain: Can we decarbonise electricity without disadvantaging poore...
Powering Britain: Can we decarbonise electricity without disadvantaging poore...
 
Call Girls Service Race Course Road Just Call 7001305949 Enjoy College Girls ...
Call Girls Service Race Course Road Just Call 7001305949 Enjoy College Girls ...Call Girls Service Race Course Road Just Call 7001305949 Enjoy College Girls ...
Call Girls Service Race Course Road Just Call 7001305949 Enjoy College Girls ...
 
Hot Sexy call girls in Palam Vihar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Palam Vihar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Palam Vihar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Palam Vihar🔝 9953056974 🔝 escort Service
 

https://diplomasolutionstudents.blogspot.com/

  • 1. Maharashtra State Board of Technical Education, Mumbai Subject Name : Advanced Computer Network Subject Code : 22520 Prepared By A.K. Rathod, (M.E. C.N.E.) Lecturer in Computer Engineering Government Polytechnic Jintur District Parbhani 1 Course Name : Diploma in Computer Engineering Semester : Fifth (I Scheme) Unit – I Network Layer & Protocols (08 Marks)
  • 2. Unit – I Network Layer & Protocols Unit Outcomes (in Cognitive Domain) 1 a. Explain Significance of the given field in the packet format of the internet protocol. 1 b. Implement IP addressing for the given network. 1 c. Explain Significance of the given field in the packet format of ICMPv4. 1 d. Explain the given inefficiency in mobile IP. 2
  • 3. Unit – I Network Layer & Protocols Network Layer Functions 3
  • 4. Unit – I Network Layer & Protocols Network Layer :  The Network Layer is the third layer of the OSI model.  It handles the service requests from the transport layer and further forwards the service request to the data link layer.  The network layer translates the logical addresses into physical addresses  It determines the route from the source to the destination and also manages the traffic problems such as switching, routing and controls the congestion of data packets.  The main responsibility of the network layer is to deliver the individual packets from sending host (source) to the receiving host (destination). 4
  • 5. Unit – I Network Layer & Protocols Network Layer : 5 Fig-S Source to Destination Delivery
  • 6. Unit – I Network Layer & Protocols Network Layer : The main functions performed by the network layer are:  Routing: When independent networks or links are connected to creates internetworks or large network, the connecting devices (routers or switches) route or switch packets to their final destination.  Logical Addressing: The data link layer implements the physical addressing and network layer implements the logical addressing. Logical addressing is also used to distinguish between source and destination system. The network layer adds a header to the packet which includes the logical addresses of both the sender and the receiver.  Internetworking: This is the main role of the network layer that it provides the logical connection between different types of networks.  Fragmentation: The fragmentation is a process of breaking the packets into the smallest individual data units that travel through different networks. 6
  • 7. Unit – I Network Layer & Protocols IP Addressing 7
  • 8. Unit – I Network Layer & Protocols IPAddressing:  IP Address is a logical address in the network layer of TCP / IP Protocol Suite.  An IP address, or simply an "IP," is a unique address that identifies a device on the internet or a local network. It allows a system to be recognized by other systems connected via the internet protocol.  Two devices in the internet can never have same address at the same time.  There are two primary types of IP address formats used today IPv4 & IPv6.  Length of IPv4 address is 32 bit and length of IPv6 address is 128 bit.  The IPv4 address is 32 bit long that means it consists 4 octets each octet consist of 8 bits.  Value of each octet ranges from 0 to 255 (minimum 0 and maximum 255) 8
  • 9. Unit – I Network Layer & Protocols Address Space  An address space is total number of addresses used by the protocol.  If protocol uses N bits to define an address, the address space is 2N  IPv4 uses 32 bit addresses, which means that the address space is 232 or 4,294,967,296 (more than 4 billions). That means more than 4 billion or 232 devices could be connected to the internet using IPv4 address.  IPv6 uses 128 bit addresses, which means that the address space is 2128 or 340,282,366,920,938,463,463,374,607,431,768,211,456 addresses (approximately 3.4×1038). That means 2128 devices could be connected to the internet using IPv6 address. 9
  • 10. Unit – I Network Layer & Protocols Notations There are three notations to show an IPv4 address A) Binary Notation B) Dotted Decimal Notation C) Hexadecimal Notation A) Binary Notation : In binary notations, IPv4 address is displayed as 32 bits. Each bit is shown either in the form of 0 or 1. These 32 bits are divided in to 4 octets. That means each octet has eight bits or 1byte. So we can say that IPv4 is a 32 bit address or a 4 byte address. Example of IPv4 address in Binary Notation : 01110101 10010101 00011101 00000010 10
  • 11. Unit – I Network Layer & Protocols Notations : B) Dotted Decimal Notation : To make the IPv4 address more compact and easier to read, these are usually written in decimal form with a decimal point (dot) –(.) separating each bytes. Example of IPv4 address in Dotted Decimal Notation : C) Hexadecimal Notation : Each hexadecimal digit is equivalent to four bits. This means that 32 bit address has 8 hexadecimal digits for example of IPv4 address in dotted decimal notation 192.168.10.10 can be written in Hexadecimal Notation as shown below. c0.a8.0a.0a 11
  • 12. Unit – I Network Layer & Protocols Classful Addressing : • Classful addressing is a concept that divides the available address space of IPv4 into five classes namely A, B, C, D & E. • Nowadays, this concept has become obsolete and has been replaced with classless addressing. • IP addresses, before 1993 use the classful addressing where classes have a fixed number of blocks and each block has a fixed number of hosts. • Each of these classes has a valid range of IP addresses. Classes D and E are reserved for multicast and experimental purposes respectively. • The order of bits in the first octet determine the classes of IP address. 12
  • 13. Unit – I Network Layer & Protocols Classful Addressing : IPv4 address is divided into two parts: Network ID and Host ID • The class of IP address is used to determine the bits used for network ID and host ID and the number of total networks and hosts possible in that particular class. • Each ISP or network administrator assigns IP address to each device that is connected to its network. • IP addresses are globally managed by Internet Assigned Numbers Authority(IANA) and regional Internet registries(RIR). • While finding the total number of host IP addresses, 2 IP addresses are not counted and are therefore, decreased from the total count because the first IP address of any network is the network number and whereas the last IP address is reserved for broadcast IP. 13
  • 14. Unit – I Network Layer & Protocols Classful Addressing :  In Class A, the net-id is defined by the first byte of the address. And the rest 3 bytes defines the host-id.  In Class B, the first two bytes of the address defines the network address and the rest two bytes defines the host-id.  In Class C the first three bytes defines the network address and the last byte defines the host-id. These concepts are not applicable to Class D & E. 14
  • 15. Unit – I Network Layer & Protocols Classful Addressing : Mask : Although the length of netid and hostid (in bits) is predetermined in classful addressing, we can use a mask (also called default mask), which is a 32 bit number made of contiguous 1’s followed by contiguous 0’s. The default Masks for Class A, B, C are shown in Table below. This Default Masking Concept is not applicable to class D & Class E. 15
  • 16. Unit – I Network Layer & Protocols Classful Addressing : Rules for assigning Host ID: Host ID’s are used to identify a host within a network. The host ID are assigned based on the following rules:  Within any network, the host ID must be unique to that network.  Host ID in which all bits are set to 0 cannot be assigned because this host ID is used to represent the network ID of the IP address.  Host ID in which all bits are set to 1 cannot be assigned because this host ID is reserved as a broadcast address to send packets to all the hosts present on that particular network. 16
  • 17. Unit – I Network Layer & Protocols Classful Addressing : Rules for assigning Network ID: Hosts that are located on the same physical network are identified by the network ID, as all host on the same physical network is assigned the same network ID. The network ID is assigned based on the following rules:  The network ID cannot start with 127 because 127 belongs to class A address and is reserved for internal loop-back functions.  All bits of network ID set to 1 are reserved for use as an IP broadcast address and therefore, cannot be used.  All bits of network ID set to 0 are used to denote a specific host on the local network and are not routed and therefore, aren’t used. 17
  • 18. Unit – I Network Layer & Protocols Classful Addressing : Class A :  IP address belonging to class A are assigned to the networks that contain a large number of hosts.  The network ID is 8 bits long.  The host ID is 24 bits long.  The higher order bit of the first octet in class A is always set to 0. The remaining 7 bits in first octet are used to determine network ID.  The 24 bits of host ID are used to determine the host in any network.  The default subnet mask for class A is 255.x.x.x. Therefore, class A has a total of: 27-2= 126 network ID (Here 2 address is subtracted because 0.0.0.0 and 127.x.y.z are special address. ) 224 – 2 = 16,777,214 host ID  IP addresses belonging to class A ranges from 1.x.x.x – 126.x.x.x 18
  • 19. Unit – I Network Layer & Protocols Classful Addressing : Class B :  IP address belonging to class B are assigned to the networks that ranges from medium-sized to large-sized networks.  The network ID is 16 bits long.  The host ID is 16 bits long.  The higher order bits of the first octet of IP addresses of class B are always set to 10. The remaining 14 bits are used to determine network ID. The 16 bits of host ID is used to determine the host in any network.  The default sub-net mask for class B is 255.255.x.x. Class B has a total of: 214 = 16384 network address 216– 2 = 65534 host address  IP addresses belonging to class B ranges from 128.0.x.x – 191.255.x.x. 19
  • 20. Unit – I Network Layer & Protocols Classful Addressing : Class C :  IP address belonging to class C are assigned to small-sized networks.  The network ID is 24 bits long.  The host ID is 8 bits long.  The higher order bits of the first octet of IP addresses of class C are always set to 110. The remaining 21 bits are used to determine network ID. The 8 bits of host ID is used to determine the host in any network.  The default sub-net mask for class C is 255.255.255.x. Class C has a total of: 221 = 2097152 network address 28 – 2 = 254 host address  IP addresses belonging to class C ranges from 192.0.0.x – 223.255.255.x. 20
  • 21. Unit – I Network Layer & Protocols Classful Addressing : Class D :  IP address belonging to class D are reserved for multi-casting. The higher order bits of the first octet of IP addresses belonging to class D are always set to 1110. The remaining bits are for the address that interested hosts recognize.  Class D does not posses any sub-net mask. IP addresses belonging to class D ranges from 224.0.0.0 – 239.255.255.255. 21
  • 22. Unit – I Network Layer & Protocols Classful Addressing : Class E :  IP addresses belonging to class E are reserved for experimental and research purposes. IP addresses of class E ranges from 240.0.0.0 – 255.255.255.254.  This class doesn’t have any sub-net mask. The higher order bits of first octet of class E are always set to 1111. Range of special IP addresses:  169.254.0.0 – 169.254.0.16 : Link local addresses  127.0.0.0 – 127.0.0.8 : Loop-back addresses  0.0.0.0 – 0.0.0.8 : used to communicate within the current network. 22
  • 23. Unit – I Network Layer & Protocols Classful Addressing : Subnetting :  During the era of classful addressing, subnetting was introduced. If an organization was granted a large blocks in Class A or B, it could divide the addresses in to several contiguous groups and assign each group to smaller networks called subnets.  Subnetting increases the number of 1s in the mask. Thus we can say that Subnetting is the procedure to divide the network into sub-networks or small networks.  In subnetting, The mask bits are moved towards right.  Subnetting is implemented via Variable-length subnet masking.  In subnetting, Address depletion is reduced or removed. Subnetting : 23
  • 24. Unit – I Network Layer & Protocols Classful Addressing : Subnetting :  Many time most of the mid sized organizations requires the large number of address as size of Class C addresses does not satisfy their needs. For this the solution is supernetting.  Supernetting is the procedure of combine the small networks into larger space.  Supernetting decreases the number of 1s in the mask  In Supernetting, Host addresses' bits are increased.  supernetting is implemented via Classless interdomain routing.  It is used for simplify routing process. Supernetting : 24
  • 25. Unit – I Network Layer & Protocols Classful Addressing : Disadvantages of Classful Addressing  If we consider class A, the number of addresses in each block is more than enough for almost any organization. So, it results in wastage of addresses.  Same is the case with class B, probably an organization receiving block from class B would not require that much of addresses. So, it also results in wastage of addresses.  A block in class C may be too small to fulfil the addresses requirement of an organization.  Each address in class D defines a group of hosts. Hosts need to multicast the address. So, the addresses are wasted here too.  Addresses of class E are reserved for the future purpose which is also wastage of addresses.  The main issue here is; we are not assigning addresses according to user requirements. We directly assign a block of a fixed size which has a fixed number of addresses which leads to wastage of address. 25
  • 26. Unit – I Network Layer & Protocols Classless Addressing :  Classless addressing is a concept of addressing the IPv4 addresses. It was adopted after the failure of classful addressing. The classful addressing leads to wastage of addresses as it assigns a fixed-size block of addresses to the customer. But, the classless addressing assigns a block of addresses to the customer according to its requirement which prevents the wastage of addresses.  The classless IPv4 addressing does not divide the address space into classes like classful addressing. It provides a variable-length of blocks, which have a range of addresses according to the need of users.  In classless addressing, when an entity, small or large, needs to be connected to the internet, it is granted a block (range) of IP addresses. The size of block varies based on the size of entity. 26
  • 27. Unit – I Network Layer & Protocols Classless Addressing : Restriction : To simplify the handling of address, the internet authorities impose three restrictions on classless address blocks. 1. The address in the block must be contiguous, one after another. 2. The number of address in the block must be in the power of 2 (1,2,4,8…) 3. The first address must be evenly divisible by the number of addresses. Mask : A better way to define a block of addresses is to select any address in the block and the mask. As we know that a mask is a 32 bit number in which n leftmost bits are 1s and the 32-n rightmost bits are 0s. However in classless addressing the mask for a block can take any value from 0 to 32. it is very convenient to give just the value of n preceded by a slash (CIDR notation). in IPv4 addressing, a block of addresses can be defined as x.y.x.t/n in which x.y.z.t defines one of the addresses and /n defines the mask. 27
  • 28. Unit – I Network Layer & Protocols Classless Addressing : CIDR Notations : Classless Interdomain Routing (CIDR) notation is also called slash notation. This is used in classless addressing. In this IPV4 address is followed by a slash (/) and after slash value of n is provided where n is the number of bits to be masked Eg. 192.168.10.10/16, in this 192.168.10.10 is an address and /16 means in the address 16 bits are to be masked. 28
  • 29. Unit – I Network Layer & Protocols Classless Addressing : In classful addressing, if an address is provided then we can detect its class as its first few bits help us in recognizing the class of address. Knowing the class of address, we can find the length of net-id as it would be 8, 16 or 24. Like in classful addressing, the address was divided into two parts net-id and host-id. Where net-id would define the address of the network and host-id would define the host address in the corresponding network. And the net-id part and host-id part would vary with the classes. The same way the classless addressing also divides the IPv4 address into two parts referred to as ‘prefix‘ and ‘suffix‘. Prefix defines the network id whereas suffix defines the host address in the corresponding network. 29
  • 30. Unit – I Network Layer & Protocols Classless Addressing : Addresses belonging to the same block persist the same prefix whereas each host in a block has a different suffix. As in classful addressing the length of net-id depend on the class to which the address belongs and it can only be 8, 16 and 24. On the other hand, the length of a prefix (n) can be 0, 1, 2, 3, . . . . ., 32. So, the value of suffix would automatically be (32- length of the prefix). In classless addressing, for a given address prefix length, could not be calculated as it can belong to a block of any prefix length. So, here the length of the prefix is included with each address to ease the extraction of block information. For example: IPv4 address 167.199.170.82/27 have an added value ’27 ‘ which is separated by a slash, is a CIDR notation of classless IPv4 address. The value ‘27‘ denotes the length of the prefix. So, the length of the suffix would be ‘32-27= 5‘. 30
  • 31. Unit – I Network Layer & Protocols Classless Addressing : First Address : The First address in the block can be found by setting the 32-n right most bits in the binary notation of address to 0s Eg. For a block of classless IP address 205.16.37.39/28 the first address is calculated as below. Given block of IP Address : 205.16.37.39 Binary Notation : 11001101 00010000 00100101 00100111 First address can be calculated by setting 32-n i.e. 32-28 = 4 rightmost bits to 0, we get First Address in Binary Notation : 11001101 00010000 00100101 00100000 First Address in Dotted Decimal notation is 205.16.37.32. 31
  • 32. Unit – I Network Layer & Protocols Classless Addressing : Last Address : The Last address in the block can be found by setting the 32-n right most bits in the binary notation of address to 1s Eg. For a block of classless IP address 205.16.37.39/28 the Last address is calculated as below. Given block of IP Address : 205.16.37.39 Binary Notation : 11001101 00010000 00100101 00100111 Last address can be calculated by setting 32-n i.e. 32-28 = 4 rightmost bits to 1, we get Last Address in Binary Notation : 11001101 00010000 00100101 00101111 Last Address in Dotted Decimal notation is 205.16.37.47. 32
  • 33. Unit – I Network Layer & Protocols Classless Addressing : Number of Addresses : The Number of addresses in the block is the difference between last and the first address. or it can be calculated using the formula 232-n Eg. For a block of classless IP address 205.16.37.39/28 the Last address is calculated as below. Given block of IP Address : 205.16.37.39/28 Total Number of Addresses = 232-n n = 28 232-28 = 24 = 16 Total Number of Addresses in a given Block are 16 33
  • 34. Unit – I Network Layer & Protocols Classless Addressing : Another way to find the First Address, Last Address and Number of addresses is given below. Eg. For a block of classless IP address 205.16.37.39/28 the First address is calculated by ANDing the given address with the mask. ANDing is done bit by bit. The result of ANDing 2 bits is 1 if both bits are 1s, otherwise result is 0. Given block of IP Address : 205.16.37.39/28 Address In Binary Notation : 11001101 00010000 00100101 00100111 Mask of Given Address is : 11111111 11111111 11111111 11110000 First Address : 11001101 00010000 00100101 00100000 First Address In Dotted Decimal Notation 205.16.37.32 (Mask of Given Address can be calculated by converting leftmost n bits to 1s (in this case first 28 bits are converted in to 1) and 32-n rightmost bits in to 0s (in this case 32-28 = 4 rightmost bits are converted in to 0) 34
  • 35. Unit – I Network Layer & Protocols Classless Addressing : Another way to find the First Address, Last Address and Number of addresses is given below. Eg. For a block of classless IP address 205.16.37.39/28 the Last address is calculated by ORing the given address with the complement of mask. ORing is done bit by bit. The result of ORing 2 bits is 0 if both bits are 0s, otherwise result is 1. and complement can be done by replacing 0 with 1 and vice versa Given block of IP Address : 205.16.37.39/28 Address In Binary Notation : 11001101 00010000 00100101 00100111 Mask of Given Address is : 00000000 00000000 00000000 00001111 Last Address : 11001101 00010000 00100101 00101111 Last Address In Dotted Decimal Notation 205.16.37.47 (Mask of Given Address can be calculated by converting leftmost n bits to 1s (in this case first 28 bits are converted in to 1) and 32-n rightmost bits in to 0s (in this case 32-28 = 4 rightmost bits are converted in to 0) 35
  • 36. Unit – I Network Layer & Protocols Classless Addressing : Another way to find the First Address, Last Address and Number of addresses is given below. Eg. For a block of classless IP address 205.16.37.39/28 the Total Number of Addresses calculated by complementing the mask, interpreting it as a decimal number, and adding 1 to it Given block of IP Address : 205.16.37.39/28 Address In Binary Notation : 11001101 00010000 00100101 00100111 Mask of Given Address is : 11111111 11111111 11111111 11110000 Complementing of Mask : 00000000 00000000 00000000 00001111 Interpretation of Mask in Decimal = 15 Number of Address In Decimal = 15 +1 = 16 36
  • 37. Unit – I Network Layer & Protocols Classless Addressing : Network Address : It very important concept of IP address. When an organization is given a block of addresses, the organization is free to allocate the addresses to the devices that needs to be connected to internet. The first address in the class is normally treated as special address This First address is called network address and defines the organization network. It defines the organization itself to the rest of the world. This first address or network address is used by routers to direct the message sent to the organization from the outside. The first address in a block is normally not assigned to any device. 37
  • 38. Unit – I Network Layer & Protocols Network Address Translation (NAT) 38
  • 39. Unit – I Network Layer & Protocols Network Address Translation Introduction : The Internet Service Provider (ISP) provides a variable block of IPv4 addresses to the midsize organization or home users. Now, what if the organization grows and requires a large block of addresses or the number of devices accessing the internet increased at home? It would be impossible for the ISP to fulfill the increased demand for addresses. This is because the range of addresses before the allocated range and the range of addresses after the allocated range may be assigned to other small organizations. Now, the question arises how to fulfill this increased demand for addresses? Here, the role of Network Address Translation (NAT) is introduced. In the situation discussed above, such midsize organization or home users can have several private IP addresses for a large set of devices/computer to allows internal communication whereas, few devices/computer are provided with the public addresses for global communication. 39
  • 40. Unit – I Network Layer & Protocols Network Address Translation Private IP addresses need to be unique inside the organization. No matter if they are not unique globally as everyone is aware that there are three blocks of addresses which are reserved for private networks. The users can use private IP addresses without the permission of Internet authorities. The private IP addresses are not routable means any router will not forward the packet having private addresses in its destination address field. Address Translation :- If the computer or a device with private IP address wants to communicate with the outside world, it would connect to the NAT capable router with the public IP address and here, the address translation takes place. In the address translation, a private IP address is mapped to the public IP address and the request is forwarded to the (destination) outside world. 40
  • 41. Unit – I Network Layer & Protocols Network Address Translation Private IP addresses need to be unique inside the organization. No matter if they are not unique globally as everyone is aware that there are three blocks of addresses which are reserved for private networks. The users can use private IP addresses without the permission of Internet authorities. The private IP addresses are not routable means any router will not forward the packet having private addresses in its destination address field. Address Translation :- If the computer or a device with private IP address wants to communicate with the outside world, it would connect to the NAT capable router with the public IP address and here, the address translation takes place. In the address translation, a private IP address is mapped to the public IP address and the request is forwarded to the (destination) outside world. 41
  • 42. Unit – I Network Layer & Protocols Network Address Translation NAT Definition : - Network Address Translation is the address translation technique which translates the internal private IP address to external public IP address and vice versa. So, the computers with private IP address inside a private network can communicate with the devices with the public IP address. How Does NAT Work? Consider a small private network of a home having four devices i.e. 1 laptop, 1 desktop, 1 tablet and one Smartphone, in its network. As all these devices are the local host they are provided private IP addresses and all these devices are connected to a NAT router with a public IP address. 42
  • 43. Unit – I Network Layer & Protocols Network Address Translation Now suppose, if the tablet user at home network wants the information regarding today’s news. As you can see in the image below, it would send this request to the server in the outside world with a public IP address, which would have this information. The server would create a reply packet with the information of today’s new. The reply packet will have source as server IP address and destination as tablets private IP address and as we know the private IP address is not routable. The Tablet would never receive the reply as no router will forward this packet to the table. 43
  • 44. Unit – I Network Layer & Protocols Network Address Translation Solution : NAT router analyzes the request packet sent from a tablet which has tablets private IP address in its source field and servers public IP address in destination fields. NAT router put the source private IP address in private IP address column of translation table the destination (server) address in public IP address column. NAT router replaces the source private address with the NAT public IP address as you can see in the image below. 44
  • 45. Unit – I Network Layer & Protocols Network Address Translation The destination server receives the request packet now, with the NAT routers public IP address as the source address. So, when the server prepares the reply it puts the NAT routers public IP address in the destination address field and its own global IP address in the source address field of the reply packet. Now, as the reply packet has the public IP address in its destination address field so, it would route the packet to the destination NAT router. The NAT router analyzes the reply packet which has source address as server’s address. The NAT router then remaps the servers public IP address to the tablet’s private IP address with the help of translation table using the source address field of the received packet and send the reply packet to the corresponding private IP address. This is how a local host in the private network, communicates with the devices with global addresses. Types of NAT : 1) Using one IPAddress, 2) Using a Pool of IPAddress. 3) Using Both IPAddress and Port Numbers 45
  • 46. Unit – I Network Layer & Protocols Internet Protocol (IP) 46
  • 47. Unit – I Network Layer & Protocols 1.2 Internet Protocol (IP) : 47 Internet Protocol is one of the major protocols in the TCP/IP protocols suite. This protocol works at the network layer (layer 3) of the OSI model and at the Internet layer of the TCP/IP model. Thus this protocol has the responsibility of identifying hosts based upon their logical addresses and to route data among them over the underlying network. IP provides a mechanism to uniquely identify hosts by an IP addressing scheme. IP uses best effort delivery, i.e. it does not guarantee that packets would be delivered to the destined host, but it will do its best to reach the destination. Internet Protocol is a connectionless protocol. Internet Protocol version 4 uses 32-bit logical address. Every device or domain that connects to the Internet is assigned an IP address, and as packets are directed to the IP address attached to them, data arrives where it is needed.
  • 48. Unit – I Network Layer & Protocols 1.2 Internet Protocol (IP) : 48 Once the packets arrive at their destination, they are handled differently depending on which transport protocol is used in combination with IP. The most common transport protocols are TCP and UDP. 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. The encapsulated data is referred to as IP Payload. While transmitting data over internet IP manages the addressing of data from one point to another, and fragments large amount of data in to smaller pieces, called packets. IP information is attached to each packet, and this information helps routers to send packets to the right place.
  • 49. Unit – I Network Layer & Protocols 1.2 Internet Protocol (IP) : 49 IP Datagram Format : Packet in the IPv4 layer are called datagram. Given figure shows IPv4 Datagram format. A datagram is a variable length packet consisting of two parts : header and data. The header is 20to 60 bytes in length and contains information essential to routing and delivery Figure : Header Format
  • 50. Unit – I Network Layer & Protocols 1.2 Internet Protocol (IP) : 50 IP Datagram Format : A brief description of each field is given below Version − Version no. of Internet Protocol used (e.g. IPv4). IHL − Internet Header Length; Length of entire IP header. DSCP − Differentiated Services Code Point; this is Type of Service. ECN − Explicit Congestion Notification; It carries information about the congestion seen in the route. 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’.
  • 51. Unit – I Network Layer & Protocols 1.2 Internet Protocol (IP) : 51 IP Datagram Format : A brief description of each field is given below 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.
  • 52. Unit – I Network Layer & Protocols 1.2 Internet Protocol (IP) : 52 IP Datagram Format : A brief description of each field is given below Destination Address − 32-bit address of the Receiver (or destination) of the packet. Options − This is optional field, which is used if the value of IHL is greater than 5. These options may contain values for options such as Security, Record Route, Time Stamp, etc.
  • 53. Unit – I Network Layer & Protocols 1.2 Internet Protocol (IP) : 53 Fragmentation :- A datagram can travel through different networks. Each router decapsulates the IPv4 datagram from the frame it receives, processes it, and then encapsulates it in another frame. The format and size of the received frame depends on the protocol used by the physical network through which the frame has just travelled. The format and size of the sent frame depends on the protocol used by the physical network through which the frame is going to travel. For example, if a router connects a LAN to WAN, it receives a frame in the LAN format and sends a frame in WAN format. Maximum Transfer Unit (MTU) The IP implementation of all devices on an IP internet needs to be aware of the capacity of the technology used by that implementation for its immediate data link layer connection to other devices. This limit is called the maximum transmission unit (MTU) of the network. This term is also sometimes seen as the maximum transfer unit.
  • 54. Unit – I Network Layer & Protocols 1.2 Internet Protocol (IP) : 54 Fragmentation :- Why IPv4 Datagram Fragmentation required? Different Networks may have different maximum transmission unit (MTU), for example due to differences in LAN technology. When one network wants to transmit datagrams to a network with a smaller MTU, the routers on path may fragment and reassemble datagrams. How is Fragmentation done? When a packet is received at the router, destination address is examined and MTU is determined. If size of the packet is bigger than the MTU, and the ‘Do not Fragment (DF)’ bit is set to 0 in header, then the packet is fragmented into parts and sent one by one. The maximum size of each fragment is the MTU minus the IP header size (Minimum 20 bytes and Maximum 60 bytes).
  • 55. Unit – I Network Layer & Protocols 1.2 Internet Protocol (IP) : 55 Fragmentation :- Each fragment is converted to a packet and the following changes happen in the datagram header: The total length field is changed to the size of the fragment. The More Fragment bit (MF bit) is set for all the fragment packets except the last one. The fragment offset field is set, based on the number of fragment that is being set and the MTU. Header Checksum is re-calculated.
  • 56. Unit – I Network Layer & Protocols 1.2 Internet Protocol (IP) : 56 Fragmentation :- Example: For a data packet of 4000 bytes and MTU of 1500 bytes, we have actual data of 3980 bytes that is to be transmitted and 1480 bytes is the maximum data size that is permissible to be sent. So, there would be 3 fragments: For the first fragment, data size = 1480 bytes, offset = 0 and MF flag = 1 For the second fragment, data size = 1480 bytes, offset = 1480 and MF flag = 1 For the third fragment, data size = 1020 bytes, offset = 2960 and MF flag = 0 An important point to be noted here is that all fragments would be having same identification number, thus indicating that all the fragments belong to the same parent data packet.
  • 57. Unit – I Network Layer & Protocols 1.2 Internet Protocol (IP) : 57 Fragmentation :- Delays – Processing delay: Time taken by the routers to process the data packet header. Queuing delay: Time taken by the data packet in routing queues. Transmission delay: Time taken to load a data packet onto the transmission channel Dt = N/R, N: Number of bits to be transmitted R: Rate or transmission speed of the channel Propagation delay – Time taken by the data packet to reach from source to destination Dp = D/S, D: Distance between the source and the destination S: is the speed of propagation
  • 58. Unit – I Network Layer & Protocols 1.2 Internet Protocol (IP) : 58 Fragmentation :- Delays – Processing delay: Time taken by the routers to process the data packet header. Queuing delay: Time taken by the data packet in routing queues. Transmission delay: Time taken to load a data packet onto the transmission channel Dt = N/R, N: Number of bits to be transmitted R: Rate or transmission speed of the channel Propagation delay – Time taken by the data packet to reach from source to destination Dp = D/S, D: Distance between the source and the destination S: is the speed of propagation
  • 59. Unit – I Network Layer & Protocols 1.2 Internet Protocol (IP) : 59 Fragmentation :- Fragmentation is done by the network layer when the maximum size of datagram is greater than maximum size of data that can be held a frame i.e., its Maximum Transmission Unit (MTU). The network layer divides the datagram received from transport layer into fragments so that data flow is not disrupted. Since there are 16 bits for total length in IP header so, maximum size of IP datagram = 216 – 1 = 65, 535 bytes.
  • 60. Unit – I Network Layer & Protocols 1.2 Internet Protocol (IP) : 60 Fragmentation :- It is done by network layer at the destination side and is usually done at routers. Source side does not require fragmentation due to wise (good) segmentation by transport layer i.e. instead of doing segmentation at transport layer and fragmentation at network layer, the transport layer looks at datagram data limit and frame data limit and does segmentation in such a way that resulting data can easily fit in a frame without the need of fragmentation.
  • 61. Unit – I Network Layer & Protocols 1.2 Internet Protocol (IP) : 61 Fragmentation :- Receiver identifies the frame with the identification (16 bits) field in IP header. Each fragment of a frame has same identification number. Receiver identifies sequence of frames using the fragment offset(13 bits) field in IP header An overhead at network layer is present due to extra header introduced due to fragmentation. Fields in IP header for fragmentation – Identification (16 bits) – use to identify fragments of same frame. Fragment offset (13 bits) – use to identify sequence of fragments in the frame. It generally indicates number of data bytes preceding or ahead of the fragment. Maximum fragment offset possible = (65535 – 20) – 1 = 65514 {where 65535 is maximum size of datagram and 20 is minimum size of IP header}
  • 62. Unit – I Network Layer & Protocols 1.2 Internet Protocol (IP) : 62 Fragmentation :- So, we need ceil(log265514) = 16 bits for fragment offset but fragment offset field has only 13 bits. So, to represent efficiently we need to scale down fragment offset field by 216/213 = 8 which acts as a scaling factor. Hence, all fragments except the last fragment should have data in multiples of 8 so that fragment offset ∈ N. More fragments (MF = 1 bit) – tells if more fragments ahead of this fragment i.e. if MF = 1, more fragments are ahead of this fragment and if MF = 0, it is the last fragment. Don’t fragment (DF = 1 bit) – if we don’t want the packet to be fragmented then DF is set i.e. DF = 1 Reassembly of Fragments – It takes place only at destination and not at routers since packets take independent path (datagram packet switching), so all may not meet at a router and hence a need of fragmentation may arise again. The fragments may arrive out of order also.
  • 63. Unit – I Network Layer & Protocols 1.2 Internet Protocol (IP) : 63 Options :- The header of the IPv4 datagram is made up of two parts: a fixed part and a variable part. The fixed part is fixed 20 bytes long and the variable part comprises the options that can be a maximum of 40 bytes. As the name implies options are not required for a datagram. They can be used for network testing and debugging. If options are present in the datagram then it must be handled by IPv4 software.
  • 64. Unit – I Network Layer & Protocols 1.2 Internet Protocol (IP) : 64 Options :- No Operation :- A no operation is a 1 byte option used as a filler between options. End of Option :- An end of option is a 1 byte option used for padding at the end of the option field. It, however, can only be used as the last option. Record Rote :- A record route option is used to record the internet routers that handle the datagram. It can list up to nine router addresses. It can be used for debugging and management purposes. Strict Source Route :- A strict source route option is used by the source to predetermine a route for the datagram as it travels through the internet. Dictation of a route by the source can be useful for several purposes. The sender can choose a route with a specific type of service, such as minimum delay or maximum throughput. Alternatively, it may choose a route that is safer or more reliable for the senders purpose. For example a sender can choose a route so that its datagram does not travel through competitors network.
  • 65. Unit – I Network Layer & Protocols 1.2 Internet Protocol (IP) : 65 Options :- If a datagram specifies a strict source route, all the routers defined in the option must be visited by the datagram. A router must not be visited if its IPv4 address is not listed in the datagram if a datagram visits a router that is not on the list, the datagram is discarded and an error message is issued. If datagram is arrived at destination and some of entries were not visited then also it can be discarded and an error message is issued Loose Source Route :- A loose source route option is similar to the strict source route, but it is less rigid. Each router in the list must be visited, but the datagram can visit other routers as well. Timestamp :- A timestamp option is used to record the time of the datagram processing by a router. The time is expressed in millisecond's from midnight, universal time or GMT. By knowing the time a datagram processed, this can help the users and network managers track the behavior of the routers in the internet. Using this we can estimate the time that a datagram takes to reach from one router to another.
  • 66. Unit – I Network Layer & Protocols Internet Control Message Protocol (ICMPv4) 66
  • 67. Unit – I Network Layer & Protocols 1.3 Internet Control Message Protocol (ICMPv4) : 67 Introduction - As we are aware that IPv4 protocol doesn’t have any mechanism to report error or correct error. So, IP functions in assistance with ICMP for reporting errors; ICMP never gets involved in correcting the errors, this task is taken care of by higher-level protocols. Every time, ICMPv4 deliver error report to the original source of the datagram. ICMPv4 Internet Control Message Protocol version 4 is definitely a Network layer protocol and its job is to report the error to the source if any problem arises while delivering the datagram from the source host to the destination host. The ICMPv4 is a message-oriented protocol. It’s a protocol of version of 4 of TCP/IP protocol suite.
  • 68. Unit – I Network Layer & Protocols 1.3 Internet Control Message Protocol (ICMPv4) : 68 There can be several reasons behind reporting the error like: A router with a datagram for a host in another network, may not find the next hop (router) to the final destination host. Datagram’s time-to-live field has become zero. There may be ambiguity in the header of IP datagram. It may happen that all the fragments of datagram if do not arrive within a time limit to the destination host. And there can be several reasons to report the error. Though ICMP is a Network layer protocol, it’s messages are not directly passed to the lower layer (i.e. data link layer). ICMP messages are encapsulated in the IP datagram and then they are passed to the lower layer.
  • 69. Unit – I Network Layer & Protocols 1.3 Internet Control Message Protocol (ICMPv4) : 69 ICMPv4 Message Format The message format for ICMPv4 message is given below. It has an 8-byte header and apart from this, it has a variable size data section. Though the header format gets changed for each type of message, still the first 4 bytes of each message remains the same.
  • 70. Unit – I Network Layer & Protocols 1.3 Internet Control Message Protocol (ICMPv4) : 70 ICMPv4 Message Format Among these first 4 bytes, the first byte describes the ‘type‘ of the message the second byte clarifies the reason behind the ‘type’ of the message. The next two bytes define the checksum field of the message. The rest 4 bytes defines the rest of the header which is specific for each message type. The data section varies according to the type of message. The data section of the error reporting message holds the information to identify the original datagram that has an error. The data section of the query message holds more information regarding the type of query. Types of ICMPv4 Messages The ICMPv4 messages are classified as: 1) Error Reporting Messages 2) Query Messages
  • 71. Unit – I Network Layer & Protocols 1.3 Internet Control Message Protocol (ICMPv4) : 71 ICMPv4 Message Format Error Reporting Messages - The most important function of ICMPv4 is to report the error. Although it is not responsible to correct the errors, this task is given to higher-level protocols. ICMPv4 always send the error report to the original source of the datagram as the datagram has only two addresses in its header, source address and destination address. So, ICMPv4 uses the source address for reporting the error There are some important characteristics of ICMPv4 message: ICMPv4 error message will not be generated in response to ICMP error messages as this can create infinite repetition. ICMPv4 error message will not be generated for the fragmented datagram if the fragment is not the first fragment.
  • 72. Unit – I Network Layer & Protocols 1.3 Internet Control Message Protocol (ICMPv4) : 72 ICMPv4 Message Format There are some important characteristics of ICMPv4 message: ICMPv4 error message is not generated for the datagram having the special address, 127.0.0.0 or 0.0.0.0. ICMPv4 messages are not generated for the datagrams with the broadcast address or a multicast address in its destination field. ICMPv4 Error Reporting Messages are further classified as: Destination Unreachable Source Quench Time Exceeded Parameter Problems Redirection
  • 73. Unit – I Network Layer & Protocols 1.3 Internet Control Message Protocol (ICMPv4) : 73 ICMPv4 Debugging Tools There are several tools that can be used in the internet for debugging. By using these tools we can determine the viability of a host or router. We can trace the route of the packet. ICMPv4 uses two debugging tools : Ping and Traceroute Ping : ping tool is used to find if a host is alive and responding. In ICMPv4 the source host sends ICMP echo request messages, the destination, if alive, responds with ICMP echo reply messages. The ping program sets the identifier field in the echo request and echo reply message and starts the sequence number from 0. this number is incremented by 1 each time a new message is sent. Ping can calculate the round trip time. It inserts the sending time in the data section of the message. When the packet arrives, it subtracts the arrival time from the departure time to get round trip time (RTT)
  • 74. Unit – I Network Layer & Protocols 1.3 Internet Control Message Protocol (ICMPv4) : 74 ICMPv4 Debugging Tools Example of Ping debugging tool We use the ping program to test the server fhda.edu. The result is shown below:
  • 75. Example 2 of Ping debugging tool For the second example, we want to know if the adelphia.net mail server is alive and running. The result is shown below: Note that in this case, we sent 14 packets, but only 13 have been returned. We may have interrupted the program before the last packet, with sequence number 13, was returned. Unit – I Network Layer & Protocols 1.3 Internet Control Message Protocol (ICMPv4) : 75 ICMPv4 Debugging Tools
  • 76. Traceroute Debugging Tool :- Traceroute or Tracert tool in UNIX or in windows can be used to trace the route of a packet from the source to the destination. Tracert uses two ICMP messages, time exceeded and destination unreachable to find the route of the packet. This is a program at application level uses services of UDP. Unit – I Network Layer & Protocols 1.3 Internet Control Message Protocol (ICMPv4) : 76 ICMPv4 Debugging Tools Fig.- The Traceroute Program Operation
  • 77. Traceroute Debugging Tool :- Example 1 - We use the traceroute program to find the route from the computer voyager.deanza.edu to the server fhda.edu. The following shows the result. Unit – I Network Layer & Protocols 1.3 Internet Control Message Protocol (ICMPv4) : 77 ICMPv4 Debugging Tools
  • 78. Traceroute Debugging Tool :- Example 2 - In this example, we trace a longer route, the route to xerox.com. The following is a partial listing. Unit – I Network Layer & Protocols 1.3 Internet Control Message Protocol (ICMPv4) : 78 ICMPv4 Debugging Tools
  • 79. Traceroute Debugging Tool :- Example 3 - An interesting point is that a host can send a traceroute packet to itself. This can be done by specifying the host as the destination. The packet goes to the loopback address as we expect. Unit – I Network Layer & Protocols 1.3 Internet Control Message Protocol (ICMPv4) : 79 ICMPv4 Debugging Tools
  • 80. Checksum is an error detection method. The concept of checksum is based on redundancy. In ICMPv4 checksum is calculated over the entire message (header and data). Unit – I Network Layer & Protocols 1.3 Internet Control Message Protocol (ICMPv4) : 80 ICMPv4 Checksum above figure shows an example of checksum calculation for a simple echo-request message. We randomly chose the identifier to be 1 and the sequence number to be 9. The message is divided into 16-bit (2-byte) words. The words are added together and the sum is complemented. Now the sender can put this value in the checksum field.
  • 81. Unit – I Network Layer & Protocols Mobile IP 81
  • 82. Mobile IP is a communication protocol which is introduced as an improved version of the IP protocol. With mobile IP the host can move to a different network and still be connected to its home network and can communicate with the remote hosts. Unit – I Network Layer & Protocols 1.4 Mobile IP 82 Introduction - Why is Mobile IP needed? While implementing the IP addressing system it was considered that the host would be a stationary host and would stick to the ‘specific network’ only. This is because the prefix of the IP address is used to identify the network and suffix of the IP address identifies the host in the corresponding network. What if the host moved to another network? Its IP address would no longer be valid. So, how it can communicate with the remote hosts? IP Addressing system needs to be improved. Below we will discuss two solutions that have been proposed to modify the IP addressing system.
  • 83. Unit – I Network Layer & Protocols 1.4 Mobile IP 83 Introduction - Changing the IP address each time the host enters a new network. This attempt was not as successful as it has several drawbacks. Every time the computer enters a new network it as to be rebooted. The DNS table needs to be revised to let every host on the internet have knowledge about changes. Configuration files need to change each time. If the host moves to another network in-between the transmission of data, the data exchange would be interrupted. This solution is more feasible. Here, a host will have two addresses, an original address which would identify the host in the home network and a temporary address (care-of address) which would identify the host in the foreign network. The care-of address will keep on changing whenever the host will move to a new network. So, the Mobile IP protocol allows a host to move to another network by maintaining its original IP address and still communicate with the other hosts over the internet.
  • 84. Unit – I Network Layer & Protocols 1.4 Mobile IP 84 Introduction - Changing the IP address each time the host enters a new network. This attempt was not as successful as it has several drawbacks. Every time the computer enters a new network it as to be rebooted. The DNS table needs to be revised to let every host on the internet have knowledge about changes. Configuration files need to change each time. If the host moves to another network in-between the transmission of data, the data exchange would be interrupted. This solution is more feasible. Here, a host will have two addresses, an original address which would identify the host in the home network and a temporary address (care-of address) which would identify the host in the foreign network. The care-of address will keep on changing whenever the host will move to a new network. So, the Mobile IP protocol allows a host to move to another network by maintaining its original IP address and still communicate with the other hosts over the internet.
  • 85. Unit – I Network Layer & Protocols 1.4 Mobile IP 85 Entities of Mobile IP The functional entities in the Mobile IP protocol are discussed below: Home Network – It is a network to which the mobile host actually belongs. It is a permanent network of the mobile host. Foreign Network – It is a new network into which mobile host has moved. Remote Network – It is the network which is neither the home network nor the foreign network. Mobile Host – It is a host of the home network which has moved to the foreign network. Remote Host – It is a host in a remote network. Home Agent – It is a router attached to the home network which allows the mobile host to send and receive data from the remote host over the internet.
  • 86. Unit – I Network Layer & Protocols 1.4 Mobile IP 86 Entities of Mobile IP :- Foreign Agent – It is a router attached to the foreign network which allows a mobile host to send and receive data from a remote host over the internet. Care-of address – It is a temporary IP address provided by the foreign agent to mobile host till it is in the foreign network. Home Address – It is the address of the mobile host in its home network.
  • 87. Unit – I Network Layer & Protocols 1.4 Mobile IP 87 Working of Mobile IP :-
  • 88. Unit – I Network Layer & Protocols 1.4 Mobile IP 88 Working of Mobile IP :- Above figure shows the demonstration of working of mobile IP Correspondent node sends the data to the mobile node. Data packets contains correspondent node’s address (Source) and home address (Destination). Packets reaches to the home agent. But now mobile node is not in the home network, it has moved into the foreign network. Foreign agent sends the care-of-address to the home agent to which all the packets should be sent. Now, a tunnel will be established between the home agent and the foreign agent by the process of tunneling. Tunneling - establishes a virtual pipe for the packets available between a tunnel entry and an endpoint. It is the process of sending a packet via a tunnel and it is achieved by a mechanism called encapsulation.
  • 89. Unit – I Network Layer & Protocols 1.4 Mobile IP 89 Working of Mobile IP :- Now, home agent encapsulates the data packets into new packets in which the source address is the home address and destination is the care-of-address and sends it through the tunnel to the foreign agent. Foreign agent, on other side of the tunnel receives the data packets, decapsulates them and sends them to the mobile node. Mobile node in response to the data packets received, sends a reply in response to foreign agent. Foreign agent directly sends the reply to the correspondent node. Key Mechanisms in Mobile IP: Agent Discovery: Agents advertise their presence by periodically broadcasting their agent advertisement messages. The mobile node receiving the agent advertisement messages observes whether the message is from its own home agent and determines whether it is in the home network or foreign network.
  • 90. Unit – I Network Layer & Protocols 1.4 Mobile IP 90 Key Mechanisms in Mobile IP: Agent Registration: Mobile node after discovering the foreign agent, sends registration request (RREQ) to the foreign agent. Foreign agent in turn, sends the registration request to the home agent with the care-of-address. Home agent sends registration reply (RREP) to the foreign agent. Then it forwards the registration reply to the mobile node and completes the process of registration. Tunneling: It establishes a virtual pipe for the packets available between a tunnel entry and an endpoint. It is the process of sending a packet via a tunnel and it is achieved by a mechanism called encapsulation. It takes place to forward an IP datagram from the home agent to the care-of-address. Whenever home agent receives a packet from correspondent node, it encapsulates the packet with source address as home address and destination as care-of-address.
  • 91. Unit – I Network Layer & Protocols 1.4 Mobile IP 91 Advantages and Disadvantages of Mobile IP Advantages • A user with its network devices can move to any other network without losing its connection with home address. • Mobile IP provides transparency while the data transfer process. It hides the fact that the mobile host is not in its home network and is communicating from the foreign network.
  • 92. Unit – I Network Layer & Protocols 1.4 Mobile IP 92 Advantages and Disadvantages of Mobile IP Disadvantages • When the ‘remote host’ and ‘mobile host’ both are in a foreign network and still the data transfer is occurring through the ‘home agent’ then the data packet has to travel more distance though both the host are in the same network. • As we have seen above, if the mobile host in the foreign network wants to send the data packet to remote host it sends it directly from the foreign network with its home address as the source and remote host address in the destination. But, if a remote host wants to send a packet to a mobile host in the foreign network, the data packet has to travel to the mobile host via its home agent. So, here it has to travel the extra distance.
  • 93. Unit – I Network Layer & Protocols Virtual Private Network (VPN) 93
  • 94. Unit – I Network Layer & Protocols 1.5 Virtual Private Network 94 Introduction : VPN stands for virtual private network. A virtual private network (VPN) is a technology that creates a safe and encrypted connection over a less secure network, such as the internet. Virtual Private network is a way to extend a private network using a public network such as internet. The name only suggests that it is Virtual “private network” i.e. user can be the part of local network sitting at a remote location. It makes use of tunneling protocols to establish a secure connection. Image – Virtual Private Network, Source - Wikipedia
  • 95. Unit – I Network Layer & Protocols 1.5 Virtual Private Network 95 Features of VPN  VPN also ensures security by providing an encrypted tunnel between client and VPN server.  VPN is used to bypass many blocked sites.  VPN facilitates Anonymous browsing by hiding your IP address.  Search engine optimization(SEO) is done by analyzing the data from VPN providers which provide country wise stats of browsing a particular product . This method of SEO is used widely my many internet marketing managers to form new strategies.
  • 96. Unit – I Network Layer & Protocols 1.5 Virtual Private Network 96 How a VPN works At its most basic level, VPN tunneling creates a point-to-point connection that cannot be accessed by unauthorized users. To actually create the tunnel, the endpoint device needs to be running a VPN client (software application) locally or in the cloud. The client runs in the background. It is not noticeable to the end user, unless there are performance issues. The performance can be affected by many factors, like speed of users' internet connections, the protocol types an internet provider may use, and the type of encryption it uses. In the enterprise, performance can also be affected by poor quality of service (QoS) outside the control of an organization's information technology (IT) department.
  • 97. Unit – I Network Layer & Protocols 1.5 Virtual Private Network 97 VPN protocols VPN protocols ensure an appropriate level of security to connected systems, when the underlying network infrastructure alone cannot provide it. There are several different protocols used to secure and encrypt users and corporate data. They include:  IP security (IPsec)  Secure Sockets Layer (SSL) and Transport Layer Security (TLS)  Point-To-Point Tunneling Protocol (PPTP)  Layer 2 Tunneling Protocol (L2TP)  OpenVPN Types of VPNs :- Remote Access VPN, Site to site VPN, Mobile VPN, Hardware VPN, VPN Appliance, Dynamic Multipoint Virtual Private Network.
  • 98. Unit – I Network Layer & Protocols 98