0% found this document useful (0 votes)
63 views53 pages

CN - Unit3.2

The document provides information about Internet Protocol (IP) including: - IP is responsible for addressing interfaces, encapsulating data into datagrams, and routing datagrams across networks. It defines packet format and an addressing system. - The IPv4 header contains fields like version, header length, total length, identification, flags, checksum, source/destination addresses, and more. These provide routing and delivery information. - IP addresses uniquely identify devices on the internet or network. IPv4 uses 32-bit addresses while IPv6 was developed to expand the addressing capacity. Common address classes include A, B, C, and reserved ranges like 10.0.0.0/8 and 172.16.0.

Uploaded by

Nishant BHARDWAJ
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views53 pages

CN - Unit3.2

The document provides information about Internet Protocol (IP) including: - IP is responsible for addressing interfaces, encapsulating data into datagrams, and routing datagrams across networks. It defines packet format and an addressing system. - The IPv4 header contains fields like version, header length, total length, identification, flags, checksum, source/destination addresses, and more. These provide routing and delivery information. - IP addresses uniquely identify devices on the internet or network. IPv4 uses 32-bit addresses while IPv6 was developed to expand the addressing capacity. Common address classes include A, B, C, and reserved ranges like 10.0.0.0/8 and 172.16.0.

Uploaded by

Nishant BHARDWAJ
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd

Computer Network

(KCS-603)
Session 2022-23

Faculty: Tanvi Shree


Course: B.Tech 6th Semester
Department of Information Technology
LECTURE-11

Internet Protocol
Internet Protocol
The Internet Protocol (IP) is a protocol, or set of rules, for
routing and addressing packets of data so that they can travel
across networks and arrive at the correct destination. Data
traversing the Internet is divided into smaller pieces, called
packets. IP information is attached to each packet, and this
information helps routers to send packets to the right place.
The Internet Protocol is responsible for addressing host
interfaces, encapsulating data into datagrams
(including fragmentation and reassembly) and routing
datagrams from a source host interface to a destination host
interface across one or more IP networks. For these purposes,
the Internet Protocol defines the format of packets and
provides an addressing system.
IPv4 Header
IPV4 header format is 20 to 60 bytes in length. It contains
information need for routing and delivery. It consists of 13
fields such as Version, Header length, total distance,
identification, flags, checksum, source IP address,
destination IP address. It provides essential data need to
transmit the data.

Following are various components/fields of IP packet header

Version: The first IP header field is a 4-bit version indicator.


In IPv4, the value of its four bits is set to 0100, which
indicates 4 in binary. However, if the router does not support
the specified version, this packet will be dropped
IPv4 Header
Internet Header Length: Internet header length, shortly
known as IHL, is 4 bits in size. It is also called HELEN
(Header Length). This IP component is used to show how
many 32-bit words are present in the header.
Type of Service: Type of Service is also called Differentiated
Services Code Point or DSCP. This field is provided features
related to the quality of service for data streaming or VoIP
calls. The first 3 bits are the priority bits. It is also used for
specifying how you can handle Datagram.
Total Length: The total length is measured in bytes. The
minimum size of an IP datagram is 20 bytes and the
maximum, it can be 65535 bytes . HELEN and Total length
can be used to calculate the dimension of the payload.
The hosts are required to be able to read 576-byte
datagrams. However, if a datagram is too large for the hosts
in the network, the fragmentation method is widely used.
Identification: Identification is a packet that is used to
identify fragments of an IP datagram uniquely. Some have
recommended using this field for other things like adding
information for packet tracing, etc.
IP Flags: Flag is a three-bit field that helps you to control and
identify fragments.The following can be their possible
configuration:
Bit 0: is reserved and has to be set to zero
Bit 1: means do not fragment
Bit 2: means more fragments.
Fragment Offset: Fragment Offset represents the number of
Data Bytes ahead of the particular fragment in the specific
Datagram. It is specified in terms of the number of 8 bytes,
which has a maximum value of 65,528 bytes.
Time to live: It is an 8-bit field that indicates the maximum
time the Datagram will be live in the internet system. The
time duration is measured in seconds, and when the value of
TTL is zero, the Datagram will be erased.
Protocol: This IPv4 header is reserved to denote that internet
protocol is used in the latter portion of the Datagram.
Header Checksum: The next component is a 16 bits header
checksum field, which is used to check the header for any
errors. The IP header is compared to the value of its
checksum. When the header checksum is not matching, then
the packet will be discarded.
Source Address: The source address is a 32-bit address of the
source used for the IPv4 packet.
Destination address: The destination address is also 32 bit in
size stores the address of the receiver
IP Options: It is an optional field of IPv4 header used when
the value of IHL (Internet Header Length) is set to greater
than 5. It contains values and settings related with security,
record route and time stamp, etc. You can see that list of
options component ends with an End of Options or EOL in
most cases.
Data: This field stores the data from the protocol layer, which
has handed over the data to the IP layer.
IP ADDRESSES
• An IP address is a unique address that identifies a device on the
internet or a local network. IP stands for "Internet Protocol,"
which is the set of rules governing the format of data sent via
the internet or local network.
• Two versions of the Internet Protocol are in common use on the
Internet today. The original version of the Internet Protocol that
was first deployed in 1983 in the ARPANET, the predecessor of
the Internet, is Internet Protocol version 4 (IPv4).
• The rapid exhaustion of IPv4 address space available for
assignment to Internet service providers and end-user
organizations by the early and explore new technologies to
expand the addressing capability on the Internet.
IPv4 ADDRESSES
• The result was a redesign of the Internet Protocol which
became eventually known as Internet Protocol Version
6 (IPv6) in 1995. Today, these two versions of the Internet
Protocol are in simultaneous use.
• An IPv4 address is a 32-bit address that uniquely and
universally defines the connection of a device (for example, a
computer or a router) to the Internet.
• The IPv4 addresses are unique and universal.
• The address space of IPv4 is 232 or 4,294,967,296.

Dotted-decimal notation and binary notation for an IPv4 address


Classes of Address Space
• In classful addressing, the address space is divided into five classes:
• A, B, C, D, and E.
Class Sizes
Way too big
Class Prefix Network Number of Classes Hosts per Class
Bits Bits
A 1 7 27 – 2 = 126 224 – 2 = 16,777,214
(0 and 127 are reserved) (All 0 and all 1 are reserved)
B 2 14 214 = 16,398 216 – 2 = 65,534
(All 0 and all 1 are reserved)
C 3 21 221 = 2,097,512 28 – 2 = 254
(All 0 and all 1 are reserved)
Total: 2,114,036
Too small to be useful
Too many network IDs

14
Reserved IP Network Numbers
Network number Subnet mask IP address range
10.0.0.0 255.0.0.0 10.0.0.1-10.255.255.255
172.16.0.0-172.31.0.0 255.255.0.0 172.16.0.1-172.31.255.255
192.168.0.0 255.255.255.0 192.168.0.1-192.168.255.255
Example
Find the class of each address.
a. 00000001 00001011 00001011 11101111
b. 11000001 10000011 00011011 11111111
c. 14.23.120.8
d. 252.5.15.111

Solution
a. The first bit is 0. This is a class A address.
b. The first 2 bits are 1; the third bit is 0. This is a class C address
c. The first byte is 14; the class is A.
d. The first byte is 252; the class is E.
Subnet Mask
 A subnet mask is a 32-bit number created by setting host bits to all
0s and setting network bits to all 1s.
 An IP address has 2 parts:
 The Network identification/Address.
 The Host identification/Address.
 Frequently, the Network & Host portions of the address need to
be separately extracted.
 In most cases, if you know the address class, it’s easy to separate
the 2 portions.
 The “255” address is always assigned to a broadcast address, and
the “0” address is always assigned to a network address. Neither
can be assigned to hosts, as they are reserved for these special
purposesses.
When organizations need additional subnetworking,
subnetting divides the host element of the IP address further
into a subnet. The goal of subnet masks are simply to enable
the subnetting process. The phrase “mask” is applied because
the subnet mask essentially uses its own 32-bit number to
mask the IP address.
Default masks for classful addressing

Class D networks are reserved for multicasting, and Class E


networks not used on the internet because they are reserved
for research by the Internet Engineering Task Force ( IETF).
A Class A subnet mask reflects the network portion in the first
octet and leaves octets 2, 3, and 4 for the network manager to
divide into hosts and subnets as needed. Class A is for networks
with more than 16,77,216 hosts.
A Class B subnet mask claims the first two octets for the
network, leaving the remaining part of the address, the 16 bits
of octets 3 and 4, for the subnet and host part. Class B is for
networks with 256 to 65,534 hosts.
In a Class C subnet mask, the network portion is the first three
octets with the hosts and subnets in just the remaining 8 bits of
octet 4. Class C is for smaller networks with fewer than 254
hosts.
Subnetting enables an organization to conceal network
complexity and reduce network traffic by adding subnets
without a new network number. When a single network
number must be used across many segments of a local area
network (LAN), subnetting is essential.

The benefits of subnetting include:


Reducing broadcast volume and thus network traffic
Enabling work from home
Allowing organizations to surpass LAN constraints such as
maximum number of hosts
IP Subnet Rule
• An example of the process of getting the network ID and
host ID:
– IP address = 128.143.137.144
– Subnet mask = 255.255.0.0
– Network ID = (128.143.137.144 & 255.255.0.0) =>
128.143.0.0
– Host ID = 137.144 (of network 128.143.0.0)
This is just a simplified demonstration, in fact you need to convert the
decimal form to binary form, order to perform the ANDING operation
Network ID Host ID
128.143 137.144
IP address
IP Subnet Rule
• Another example to determine what the network ID is,
for any given IP address
– you have to convert both octal addresses into binary, and
do a bitwise AND operation.
• An example using an IP address of 156.154.81.56 used
with a network mask of 255.255.255.240 follows:

• This translate to a network ID of 156.54.81.48


• Sometimes, network ID is also called network address or subnet
address
Example
A block of addresses is granted to a small organization.Let one of the
addresses is 205.16.37.39/28. What is the first address in the block?

19.23
Example
A block of addresses is granted to a small organization.Let one of the
addresses is 205.16.37.39/28. What is the first address in the block?

Solution
The binary representation of the given address is
11001101 00010000 00100101 00100111
If we set 32−28 rightmost bits to 0, we get
11001101 00010000 00100101 0010000
or
205.16.37.32.

19.24
Figure A network configuration for the block 205.16.37.32/28
Example
What is the subnetwork address if the destination address is
200.45.34.56 and the subnet mask is 255.255.240.0?
Solution

19.26
Example
What is the subnetwork address if the destination address is
200.45.34.56 and the subnet mask is 255.255.240.0?
Solution

11001000 00101101 00100010 00111000


11111111 11111111 11110000 00000000
11001000 00101101 00100000 00000000

The subnetwork address is 200.45.32.0.

19.27
Subnetwork
A subnetwork or subnet is a logical subdivision of an IP
network. The practice of dividing a network into two or
more networks is called subnetting.
Subnet Host Count
The number of subnetworks available and the number of
possible hosts in a network may be readily calculated. For
instance, the 192.168.5.0/24 network may be subdivided into
the following four /26 subnets. The highlighted two address
bits become part of the network number in this process.
Network Network (binary) Broadcast address

192.168.5.0/26 11000000.10101000.00000101.00000000 192.168.5.63

192.168.5.64/26 11000000.10101000.00000101.01000000 192.168.5.127

192.168.5.128/26 11000000.10101000.00000101.10000000 192.168.5.191

192.168.5.192/26 11000000.10101000.00000101.11000000 192.168.5.255


Subnetting – Example
 Host IP Address: 138.101.114.250
 Network Mask: 255.255.0.0
 Subnet Mask: 255.255.255.192

Given the following Host IP Address, Network Mask and Subnet mask
find the following information:

 Major Network Information


 Major Network Address
 Major Network Broadcast Address
 Range of Hosts if not subnetted
 Subnet Information
 Subnet Address
 Range of Host Addresses (first host and last host)
 Broadcast Address
Subnetting – Example
 Other Subnet Information
 Total number of subnets

 Number of hosts per subnet

Major Network Information


 Host IP Address: 138.101.114.250
 Network Mask: 255.255.0.0
 Subnet Mask: 255.255.255.192

 Major Network Address: 138.101.0.0


 Major Network Broadcast Address: 138.101.255.255
 Range of Hosts if not Subnetted: 138.101.0.1 to 138.101.255.254
Step 1: Convert to Binary
128 64 32 16 8 4 2 1

138. 101. 114. 250


IP Address 10001010 01100101 01110010 11111010
Mask 11111111 11111111 11111111 11000000
255. 255. 255. 192

Step 1:
Translate Host IP Address and Subnet Mask into binary
notation
Step 2: Find the Subnet Address
138. 101. 114. 250
IP Address 10001010 01100101 01110010 11111010
Mask 11111111 11111111 11111111 11000000
Network 10001010 01100101 01110010 11000000
138 101 114 192

Step 2:
Determine the Network (or Subnet) where this Host address
lives:
1.Draw a line under the mask
2.Perform a bit-wise AND operation on the IP Address and the Subnet
Mask
Note: 1 AND 1 results in a 1, 0 AND anything results in a 0
3.Express the result in Dotted Decimal Notation
4.The result is the Subnet Address of this Subnet or “Wire” which is
138.101.114.192
Step 3: Subnet Range / Host Range
G.D. S.D.

IP Address 10001010 01100101 01110010 11111010


Mask 11111111 11111111 11111111 11 000000
Network 10001010 01100101 01110010 11 000000
 subnet   host 
counting range Counting
range

Step 3:
Determine which bits in the address contain Network (subnet)
information and which contain Host information:
Use the Network Mask: 255.255.0.0 and divide (Great Divide) the

from the rest of the address.


Use Subnet Mask: 255.255.255.192 and divide (Small Divide) the

subnet from the hosts between the last “1” and the first “0” in the
subnet mask.
Step 4: First Host / Last Host G.D. S.D.

IP Address 10001010 01100101 01110010 11 111010


Mask 11111111 11111111 11111111 11 000000
Network 10001010 01100101 01110010 11 000000
 subnet   host 
counting range countin g
range
First Host Last
11 000001
10001010 01100101 01110010
193
138 101 114
Host Broadcast
11 111110
10001010 01100101 01110010
254
138 101 114
11 111111
10001010 01100101 01110010 255
138 101 114

Host Portion
Subnet Address: all 0’s

First Host: all 0’s and a 1


Last Host: all 1’s and a 0
Broadcast: all 1’s
Step 5: Total Number of Subnets
G.D. S.D.

IP Address 10001010 01100101 01110010 11 111010


Mask 11111111 11111111 11111111 11 000000
01110010 11
Network 10001010 01100101 000000

 host 
subnet 
counting

Total number of subnets


counting range
 First Host 10001010 01100101 01110010 11 000001
range
138 101 114 193
 Number of subnet
Last Host 10001010bits 1001100101 01110010 11 111110
138 101 114 254
 2 = 1,024
10
Broadcast 10001010 01100101 01110010 11 111111
 1,024 total 138
subnets 101 114 255
 Subtract one “if” all-zeros subnet cannot be used
 Subtract one “if” all-ones subnet cannot be used
 1,022 total subnets
Step 6: Total Number of Hosts per subnet
G.D. S.D.

IP Address 10001010 01100101 01110010 11 111010


Mask 11111111 11111111 11111111 11 000000
01110010 11
Network 10001010 01100101 000000

 host 
subnet 
counting
counting range
First Host 10001010 01100101 01110010 11 000001
range
138 101 114 193
 Total number10001010
Last Host
of hosts 01100101
per subnet
01110010 11 111110
 Number of 138 host bits101
6 114 254

 26Broadcast
= 64 10001010 01100101 01110010 11 111111
138 101 114 255
 64 host per subnets
 Subtract one for the subnet address
 Subtract one for the broadcast address
 62 hosts per subnet
Subnet Host Count
The remaining bits after the subnet bits are used for
addressing hosts within the subnet. In the above example,
the subnet mask consists of 26 bits, making it
255.255.255.192, leaving 6 bits for the host identifier. This
allows for 62 host combinations (26−2).

Each address in the block can be considered as


a two-level hierarchical structure:
the leftmost n bits (prefix) define the network;
the rightmost 32 − n bits define the host.
Example
An ISP is granted a block of addresses starting with
190.100.0.0/16 (65,536 addresses). The ISP needs to distribute
these addresses to three groups of customers as follows:
a. The first group has 64 customers; each needs 256
addresses.
b. The second group has 128 customers; each needs 128
addresses.
c. The third group has 128 customers; each needs 64
addresses.
Design the subblocks and find out how many addresses are still
available after these allocations.

19.39
Solution
Group 1
For this group, each customer needs 256 addresses. This means that
8 (log2 256) bits are needed to define each host. The prefix length is
then 32 − 8 = 24. The addresses are
Group 2
For this group, each customer needs 128 addresses. This means
that 7 (log2 128) bits are needed to define each host. The prefix
length is then 32 − 7 = 25. The addresses are
Group 3
For this group, each customer needs 64 addresses. This means
that 6 (log264) bits are needed to each host. The prefix length is
then 32 − 6 = 26. The addresses are

Number of granted addresses to the ISP: 65,536


Number of allocated addresses by the ISP: 40,960
Number of available addresses: 24,576
An example of address allocation and distribution by an ISP
Example :
A company is granted the site address 211.80.64.0 .The company
needs eight subnets. Design the subnets?

Solution:
No. of subnet must be power of 2 therefore we design 8 subnets
No.of subnet bits=Log2(8)=3 bits

Ip address 211.80.64.0 is class c

Net Sub Host

24 Bit 3 Bit 5 Bit


Subnet NET . Subnet . Host Subnet IP
211.80.64 000 00000 211.80.64.0
Subnet 0
211.80.64 000 11111 211.80.64.31
211.80.64 001 00000 211.80.64.32
Subnet 1
211.80.64 001 11111 211.80.64. 63
211.80.64 010 00000 211.80.64.64
Subnet 2
211.80.64 010 11111 211.80.64. 95
Subnet 3 211.80.64 011 00000 211.80.64.96
211.80.64 011 11111 211.80.64. 127
Subnet 4 211.80.64 100 00000 211.80.64. 128

211.80.64 100 11111 211.80.64. 159


Subnet 5 211.80.64 101 00000 211.80.64. 160

211.80.64 101 11111 211.80.64. 191


Subnet 6 211.80.64 110 00000 211.80.64. 192

211.80.64 110 11111 211.80.64. 223


Subnet 7 211.80.64 111 00000 211.80.64. 224

211.80.64 111 11111 211.80.64. 255


IPv6 ADDRESSES
⚫ The next generation Internet Protocol (IPv6) is poised to
make a new wave in the coming decade.
⚫ There is some serious limitations of the current IP protocol,
or IPv4 to be precise.
⚫ IP version 6 or IPv6 (also known as IPng - ng for new/next
generation), provides 128-bit addressing (that's billions
upon billions of addresses).
⚫ And compatibility with IPv4 addresses, security and
authentication, quality of service (reserving bandwidth),
plug-and-play for network device configuration,
hierarchically structured routing and an ability to
seamlessly integrate with the current IP during the
transition stages.
IPv6 ADDRESSES
⚫ IPv6 is technology with a main focus on changing the
structure of current IP addresses, which will allow for
virtually unlimited IP addresses.
⚫ The current version, IPv4 is a growing concern with the
limited IP addresses, making it a fear that they will run out
in the future.
⚫ IPv6 will also have a goal to make the Internet a more
secure place for browsers, and with the rapid number of
identity theft victims, this is a key feature.
⚫ Efficient and hierarchical addressing and routing
infrastructure- based on the common occurrence of
multiple levels of Internet service providers.
IPv6 datagram header and payload
Challenges in Today’s Internet

⚫ QOS Issues
– Multiple methods available
– Non-uniformity across network boundaries
⚫ Security
– No uniformity, myriad methods
– Multitude of methods for “hackers” to attack networks
⚫ Mobility
– Increasing number of wireless/mobile devices accessing Internet
services
– Inadequate support for IP mobility in devices (moving seamlessly
from one network to another)
– 3G & 4G initiatives, 802.11x, Bluetooth, UWB moving connectivity
from wireline to wireless
Why is IPv6 Here :
⚫ IPv6 provides a platform for new Internet functionality that will
be needed in the immediate future, and provide flexibility for
further growth and expansion.

Features of IPv6 :
⚫ Addressing
⚫ Header
⚫ Security
⚫ Privacy
⚫ Auto configuration
⚫ Routing
⚫ Quality of Service
⚫ Cost savings
⚫ Expanded addressing and routing capabilities
– 128-bit addresses
– Multicast routing is now scalable with “scope” field
– Defined usage of “Any cast” addressing
⚫ Simplified header format
– Some IPv4 fields dropped or made optional
– IPv6 packet header only twice the size of v4 header, even though
address is four times a v4 address
⚫ Extension headers
– “Options” are now placed in separate headers
– “Options” are now any length
– Router doesn’t have to look at most “Options”*
⚫ Auto-configuration
– Self-configuring nodes for local links
– Auto-configuration for site links
– Stateless uses “Router Advertisement”
⚫ Centralized management
⚫ New “v6” features
⚫ Source Routing
–Support for Source Demand Routing Protocol (SDRP)
–Sender can specify packet route
–Destination can return packet via same route
⚫ Route Aggregation
–Address Hierarchy
–Deployed in “Groups”
IPv6 versus IPv4 :
⚫ No Broadcast in IPv6
– Replaced by Multicast
– Multicast scope provides flexibility
⚫ Uncontrolled fragmentation in IPv4
– Only a source node can fragment IPv6
– Limits packet size to minimum MTU in path (Maximum
Transmission Unit)
⚫ Other features inherent to IPv6
- Security encryption
- Header encryption
- Sender authentication
- Privacy

You might also like