0% found this document useful (0 votes)
4 views14 pages

IP Addressing

Uploaded by

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

IP Addressing

Uploaded by

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

IP Addressing (IPv4)

An IP Address (Internet Protocol Address) is a unique numerical label assigned to each device
connected to a computer network that uses the Internet Protocol for communication. It serves two
main purposes:

1. Identifying a device on the network.


2. Locating the device to enable communication with other devices over a network like the
Internet.
How Does IP Addresses are Controlled?
IP addresses are controlled and distributed by IANA (Internet Assigned Numbers Authority).
IANA allocates IP address blocks to the Regional Internet Registries (RIRs) and they distribute
IP addresses within the regions or continents for which they are responsible.

There are 5 different Regional Internet Registries (RIRs) in the world. These RIRs are:

▪ RIPE NCC (Réseaux IP Européens Network Coordination Centre)

▪ APNIC (Asia-Pacific Network Information Centre)

▪ AFRINIC (African Network Information Centre)

▪ ARIN (American Registry for Internet Numbers)


▪ LACNIC (Latin American and Caribbean Internet Addresses Registry)

There are currently two versions of IP Addresses. These are:

▪ IPv4

▪ IPv6
IPv4 Addresses
IPv4 Address Format

An IPv4 address consists of 32 bits (binary digits), divided into four sections known as octets or
bytes. Each octet contains 8 bits, and each bit can have only two possible values: 0 or 1. When
these 8 bits are grouped together, they form a binary number.
Since each octet has 8 bits, it can represent 2⁸ = 256 possible values, ranging from 0 to 255. The
four octets are usually written as decimal numbers separated by periods (dots), a format known as
dotted-decimal notation.

For example, the IPv4 address [Link] consists of four octets:


IPv4 addresses are 32 bits long (4 bytes). Because a 32-bit number can produce 2³² unique
combinations, the total number of possible IPv4 addresses is:
2^32=4,294,967,296
So, the maximum number of IPv4 addresses is approximately 4.3 billion.

IPv4 addresses consist of two parts:

• Network Part: The network part indicates the distinctive variety that's appointed to the
network. The network part conjointly identifies the category of the network that's assigned.

• Host Part: The host part uniquely identifies the machine on your network. This part of the
IPv4 address is assigned to every host.
For each host on the network, the network part is the same, however, the host part must
vary.

• This is determined according to Subnet Mask.


A Subnet Mask is a numerical value, similar to an IP address, that identifies which portion of an
IP address represents the network and which portion represents the host. Subnet masks are always
used together with IP addresses.
A subnet mask can look like this:
[Link]
In binary form, it is written as:
11111111.11111111.11111111.00000000
In a subnet mask:
• The bits set to 1 represent the network portion.
• The bits set to 0 represent the host portion.
Without a subnet mask, it is impossible to determine which network an IP address belongs to.
For example, consider the IP address:
[Link]
Suppose we use the subnet mask:
[Link]
Its binary representation is:
11111111.11111111.11111111.00000000
This indicates that the first three octets (the first 24 bits) represent the network portion because
they are filled with 1s. The last octet contains all 0s, which means it represents the host portion.
Therefore:
• Network portion: 192.168.2
• Host portion: 1
This means the device with IP address [Link] belongs to the network [Link]/24, where
multiple host devices can exist within the same network.

So, in the last case, we can say that all the devices in this network will use the same network part
(192.168.2).

The host portion can range from 0 to 255, but in a /24 network the first address (.0) is reserved as
the network address and the last address (.255) is reserved as the broadcast address. Therefore,
usable host addresses range from [Link] to [Link]

[Link](Network Address)
[Link]
[Link]
[Link]
….
[Link] (Broadcast Address)
Here;

▪ The first address [Link] is the network address.

▪ The last address [Link] is the broadcast address.

▪ The other addresses from [Link] to [Link] can be used for a device in the
same network.

Some of the examples of IPv4 are:

Site Dot-decimal Binary

[Link] [Link] 01101000.11110100.00101010.10000001

[Link] [Link] 10010111.01100101.01000001.10001100

[Link] [Link] 01101100.10101110.0000101.00001010

Binary Representation

IPv4 is basically converted into binary form by computer although these are usually seen in
decimal form for human readability. Each octet is converted into 8 bit binary number . For
instance [Link] in binary looks like:
• 185: 10111001

• 107: 01101011

• 80: 01010000

• 231: 11100111

So [Link] in binary is: 10111001.01101011.01010000.11100111

IPv4 Address Format


The binary representation of IP address: [Link]

From the above picture, it is clear that

IPv4 addresses always are in a decimal format that humans can read and remember, and IP
addresses that are in binary format computers can understand.

Now let’s understand how 255 = 11111111?


• MSB stands for the most significant bit, while LSB is the least significant bit.

• The positional value of bits is determined by 2 raised to a power (position-1)

• For example, the value of a bit 1 at position 6 is 2^(6–1) that is 2⁵ that is 32.

IP Address Classes
IP Addresses are divided into different Classes at the beginning. For different sized networks,
different IP Address Class is used. These IP Address Classes has strict borders. This is
called Classful IP Addressing. With subnetting, this is not important anymore.

What are these IP Address Classes and IP Address ranges? These are:

▪ Class A ([Link] to [Link])

▪ Class B ([Link] to [Link])

▪ Class C ([Link] to [Link])

▪ Class D ([Link] to [Link])

▪ Class E ([Link] to [Link])


The network and host parts of these networks are:

▪ Class A has 126 networks (The first octet). The rest are used for hosts.

▪ Class B has 16 384 networks (First and second octets). The rest are used for hosts.

▪ Class C has 2 097 152 networks (First, Second and Third octets). The rest are used for
hosts.

▪ Class D is used for Multicast operations.


▪ Class E is reserved Class.

Here, [Link], [Link] and [Link] addresses are reserved for various roles. These
reserved address roles are:
▪ [Link] – Used for Default Routes
▪ [Link] – Used for Loopback
▪ [Link] – Used for Broadcast
Class A Network:
• IP range is (1–126) [Link] to [Link]
• An example of a Class A address is [Link].
• Here, “102” helps you identify the network, and 168.212.226 identifies the host.
• Used for a large number of hosts.

Class B Network:
• IP range is (128 to 191) [Link] to [Link]
• An example of a Class B IP address is [Link].
• Here “168.212” identifies the network and “226.204” helps you identify the network host.
• Used for medium-size networks.

Class C Network:
• IP range is (192 to 223) [Link] to [Link]
• An example of a Class C IP address is [Link]
• Here “192.168.178” identifies the network and “67” helps you identify the network host.
• Used for local area network.

Class D Network:
• IP range is (224 to 239) [Link] to [Link]
• An example of a Class D IP address is [Link]
Reserved for multicast communication.
Class E Network:
• IP range is (240 to 254) [Link] to [Link]
• An example of a Class E IP address is [Link]
• Reserved for future use, or research and development purposes
These IP address types are:
▪ Private IP Addresses

▪ Public IP Addresses

Private IP Addresses are the IP addresses that are used in local networks. They are assigned by
LAN administrator or automatically by DHCP. Any private block IP is unique in its Local area
network. These IP addresses are not routable on internet. So, different companies, home networks
etc. can use these Private Block IP Addresses in their local network. These Private Block IP
Addresses are given below:

▪ [Link] to [Link]
▪ [Link] to [Link]

▪ [Link] to [Link]
The local devices in a network uses this Private Block IP addresses and with NAT, they are
translated to a routable addresses at the Gateway. Then, the local devices can use Internet.

Public IP Addresses are globally unique IP addresses routable on Internet. They are assigned
by IANA to Regional Internet Registries (RIRs). And then RIRs distribute these IPs to service
providers and companies that need IP addresses. Then service providers distributes these IP
addresses to users. Public IP addresses are costly. The other IP blocks except Private Blocks,
Multicast Blocks and Reserved Blocks are all in Public IP Address Blocks. They are given
below:

▪ [Link] to [Link] & [Link] to [Link]

▪ [Link] to [Link] & [Link] to [Link]


▪ [Link] to [Link] & [Link] to [Link]

By the way, there is also another reserved block. This is the IP addresses from [Link] to
[Link]. This reserved IP addresses are used for Automatic Private Addressing. This is
used in your PC if it did not get an IP address from the Home Router or DHCP Server.
IP Address Types According to Delivery Type

Now, let’s talk about the IP addresses according to delivery type. We can divide IP addresses into
four according to delivery type. These are:

▪ Unicast Address

▪ Broadcast Address

▪ Multicast Address

▪ Anycast Address

Now, let’s see what are these IP addresses.

▪ Unicast Address is the address that represents one host.

▪ Broadcast Address is the address that represents all the hosts in the network.

▪ Multicast Address is the address that represents member of a specific group in a network.
▪ Anycast Address is not represents a specific device IP. But, it is used with other devices
and provide the delivery to the nearest one by help of Routing Protocols.
IPv4 Datagram Header:
These fields together ensure the proper delivery, routing, fragmentation, and reassembly of IP
packets across the network.

IPV4 Header

• VERSION: Version of the IP protocol (4 bits), which is 4 for IPv4

• HLEN (Header Length): Indicates the length of the IPv4 header in 32-bit words.

• Type of service: Low Delay, High Throughput, Reliability (8 bits)

• Total Length: Length of header + Data (16 bits), which has a minimum value 20 bytes and
the maximum is 65,535 bytes.

• Identification: Unique Packet Id for identifying the group of fragments of a single IP


datagram (16 bits)

• Flags: 3 flags of 1 bit each : reserved bit (must be zero), do not fragment flag, more
fragments flag (same order)

• Fragment Offset: Indicates the position of a fragment relative to the beginning of the
original datagram. It is measured in 8-byte units.

• Time To Live (TTL): Limits the lifetime of a packet by reducing its value by one at each
router hop. When TTL reaches zero, the packet is discarded.

• Protocol: Identifies the upper-layer protocol carried in the data portion, such as TCP, UDP,
or ICMP Header
• Checksum: 16 bits header checksum for checking errors in the datagram header

• Source IP address: 32 bits IP address of the sender

• Destination IP address: 32 bits IP address of the receiver

• Option: Optional information such as source route, record route. Used by the Network
administrator to check whether a path is working or not.

You might also like