Thanks to visit codestin.com
Credit goes to www.scribd.com

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

Addressing

The document provides an overview of the IPv4 addressing scheme, explaining the structure and uniqueness of IP addresses, which are 32 bits long and represented in dotted-decimal notation. It discusses classful addressing, including the classification of addresses into classes A, B, C, D, and E, and the concepts of network ID, host ID, subnetting, and supernetting. Additionally, it contrasts IP addresses with MAC addresses, highlighting their differences in terms of logical vs. physical addressing, dynamic vs. static nature, and representation.

Uploaded by

sarfaraztabish
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 views13 pages

Addressing

The document provides an overview of the IPv4 addressing scheme, explaining the structure and uniqueness of IP addresses, which are 32 bits long and represented in dotted-decimal notation. It discusses classful addressing, including the classification of addresses into classes A, B, C, D, and E, and the concepts of network ID, host ID, subnetting, and supernetting. Additionally, it contrasts IP addresses with MAC addresses, highlighting their differences in terms of logical vs. physical addressing, dynamic vs. static nature, and representation.

Uploaded by

sarfaraztabish
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
You are on page 1/ 13

1

ADDRESSING
Logical Address/
Has a LAN Card IP Address
Address

Physical Address/
MAC Address

Overview of IPv4 Addressing Scheme


i) The identifier used in the network layer in the Internet model to identify each device connected
to the Internet is called the Internet address or IP Address.
ii) IP address is 32 bits (IPv4) or 128 bits (IPv6).
iii) It is represented by dotted decimal notation.
iv) IP Address is unique.
They are unique in the sense that each address defines one and only one connection to the
Internet. Two devices in the Internet can never have the same address at the same time.
v) The IP Addresses are universal in the sense that the addressing system must be accepted by
any host that wants to be connected to the Internet.

Notations
We use notations to show an IPv4 address: binary notation and dotted-decimal notation.

Binary Notation

In binary notation, the IPv4 address is displayed as 32 bits. Each octet is often referred to as a
byte. So it is common to hear an IPv4 address referred to as a 32-bit address or a 4-byte
address.
The following is an example of an IPv4 address in binary notation:
01110101 10010101 00011101 00000010

Dotted-Decimal Notation

To make the IPv4 address more compact and easier to read, Internet addresses are usually
written in decimal form with a decimal point (dot) separating the bytes. The following is the
dotted-decimal notation of the above address: 117.149.29.2
10000000 . 00001011 . 00000011 . 00011111

128 . 11 . 3 . 31

Complied by: Anupam Mukherjee contact: [email protected]


2

Question1.
Change the following IPv4 addresses from binary notation to dotted-decimal notation.
a. 10000001 00001011 00001011 11101111
b. 11000001 10000011 00011011 11111111

Solution
We replace each group of 8 bits with its equivalent decimal number (see Appendix B) and add
dots for separation.
a. 129.11.11.239
b. 193.131.27.255

Question2.
Change the following IPv4 addresses from dotted-decimal notation to binary notation.
a. 111.56.45.78
b. 221.34.7.82

Solution
We replace each decimal number with its binary equivalent (see Appendix B).
a..01101111 00111000 00101101 01001110
b. 11011101 00100010 00000111 01010010

Question3.
Find the error, if any, in the following IPv4 addresses.
a. 111.56.045.78
b. 221.34.7.8.20
c. 75.45.301.14
d. 11100010.23.14.67

Solution
a. There must be no leading zero (045).
b. There can be no more than four numbers in an IPv4 address.
c. Each number needs to be less than or equal to 255 (301 is outside this range).
d. A mixture of binary notation and dotted-decimal notation is not allowed.

Complied by: Anupam Mukherjee contact: [email protected]


3

Classful Addressing
IPv4 addressing when started a few decades ago, used the concept of classes. This architecture
is called classful addressing.
In classful addressing, the address space is divided into five classes: A, B, C, D, and E. Each
class occupies some part of the address space.
In mid 1990s, a new architecture, called classless addressing was introduced, which will
eventually supersede the original architecture.

Finding the classes in binary and dotted decimal notation.

Start

1 1 1 1
st nd rd th
1 Bit 2 Bit 3 Bit 4 Bit

0 0 0 0

Class A Class B Class C Class D Class E


Question4.
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 (between 0 and 127); the class is A.
d. The first byte is 252 (between 240 and 255); the class is E.

Complied by: Anupam Mukherjee contact: [email protected]


4

There are two parts of an IP address:


Network ID
Host ID

The various classes of networks specify additional or fewer octets to designate the network ID versus the host ID.

Class 1st Octet 2nd Octet 3rd Octet 4th Octet


Net ID Host ID
A
Net ID Host ID
B
Net ID Host ID
C

D Multicast Address

E Reserve for Future use

Question5. Find the Network ID and Broadcast ID of different classes?


Answer.

For Class A Network

Network Id  X.0.0.0
Broadcast Id  X.255.255.255

For Class B Network

Network Id  X.X.0.0
Broadcast Id  X.X.255.255

For Class C Network

Network Id  X.X.X.0
Broadcast Id  X.X.X.255

Note : where X is variable ; X belongs to 0 to 127 for class A

Complied by: Anupam Mukherjee contact: [email protected]


5

Note:
Class A

1st address  0.0.0.0


Last Address  127.255.255.255

So, Maximum number of network  128


Valid number of n/w  126
Because, we can not assign first and last address in any host machine.
First address is used for identifying a n/w (known as network address)
And last address is used for broadcasting purpose.

Class B Class C Class D

1st address  0.0.0.0 1st address  192.0.0.0 1st address  224.0.0.0


Last Address  127.255.255.255 Last Address  223.255.255.255 Last Address  239.255.255.255

Maximum no. of n/w216 Maximum no. of n/w224


Maximum no. of Host216 Maximum no. of Host28

Class E

1st address  239.0.0.0


Last Address  255.255.255.255

Network Address :
i) The network address is an address that defines the network itself.
ii) It can not be assign to a host
iii) Network address plays a very important role in classful addressing. A network address has several
properties –
a) All host bits are 0’s
b) Router can route a packet based on network address.
iv) In classful addressing, the network address is one that is assigned to the organization.
v) For network address 
Net id Host id

Specific All 0’s

Note : Network Address = Binary AND operation of ( IP Address + Subnet Mask)


Eg. 192.168.10.0 = 192.168.10.45 + 255.255.255.0
11000000.10101000.00001010.00101101 192.168.10.45
11111111.11111111.11111111.00000000 255.255.255.0

11000000.10101000.00001010.00000000 192.168.10.0

Complied by: Anupam Mukherjee contact: [email protected]


6

Question 6.
Find out the network address of 132.6.17.85?
Answer:
132.6.17.85 is a class B IP address. The first 2 bytes defines the netid. We can find the n/w address by replacing
the hosted bytes (17.85) with 0’s. Therefore, the network address is 132.6.0.0.

MASK

 When a router receives a packet with a destination address, it needs to route the packet. The routing is based on
the network address and sub-network address.

 the router outside the organization route the packet based on the network address; and the router inside the
organization routes the packet based on sub-network address.
Eg. When a parcel reaches in a post office, they are routed according to zip code. When they reach the post office
serving that zip code, the parcel are routed according to the street address.

 Now the question is how can a router find the network address or subnetwork address?
A network administrator knows the network and sub-network address, but a router does not. A 32 bit number,
called mask is the key to solve this problem.

 the router outside the organization use a default mask,; the router inside the organization use a subnet mask.
When a router receives a 32 bit binary IP and mask values, it performs a binary AND operation on it, and the
result will be the desire network address.

Eg. 

192.168.10.2/24 11000000.10101000.00001010.00101101
11111111.11111111.11111111.00000000
11000000.10101000.00001010.00000000

Router
192.168.10.0  network address

Default Mask:
Although the length of the netid and hostid (in bits) is predetermined in classful addressing, we can also use a
mask (also called the default mask), a 32-bit number made of contiguous 1s followed by contiguous 0s. The
masks for classes A, B, and C are shown in Table. The concept does not apply to classes D and E.

The mask can help us to find the netid and the hostid. For example, the mask for a class A address has eight 1s,
which means the first 8 bits of any address in class A define the netid; the next 24 bits define the hostid. The last
column of Table shows the mask in the form /n where n can be 8, 16, or 24 in classful addressing. This notation is

Complied by: Anupam Mukherjee contact: [email protected]


7

also called slash notation or Classless Interdomain Routing (CIDR) notation. The notation is used in classless
addressing, which we will discuss later. We introduce it here because it can also be applied to classful addressing.

Subnet Mask:
The number of 1’s in a subnetmask is more than the number of 1s in the corresponding default mask.
Eg.  for class B, default mask is /16

Default mask of class B  255.255.0.0


 11111111.11111111.00000000.00000000
Subnet mask  255.255.224.0
 11111111.11111111.11100000.00000000
The number of subnets is determined by the number of extra 1’s.
If the number of extra 1 is n. then the number of subnet is 2n
If the number of subnet is N, then the number of extra 1’s is log2N.

Subnetting:
In subnetting, a network is divided into several smaller groups with each subnetwork (or subnet)
having its own subnetwork address.
Often an organization needs to assemble the host into groups; the network needs to be divided into
several subnetworks.
E.g.  A university may want to group its host according to departments. In this case the university
has one n/w address, but needs several subnetwork addresses. The outside world knows the
organization by its n/w address. Inside the organization of each subnetwork is recognized by its
subnetwork address.

141.14.0.1 141.14.14.2 ----------- 141.14.14.254 141.14.64.1 141.14.64.2 ----------- 141.14.64.254


-- --

-------- --------
-----
CSE Dept 
EE Dept

Subnet 141.14.0.12 141.14.64.9


Subnet
141.14.0.0 141.14.64.0

R2 R3

141.14.192.1 ---- --- 141.14.192.254 141.14.128.1 -----------


--
--- 141.14.128.254
141.14.192.4 ---- --- ---
---- --- ---
- --- ---
- -
IT Dept  ECE Dept

Subnet Subnet
141.14.192.0 141.14.192.4 141.14.128.0 141.14.128.0
R1

University  141.14.0.0 (Network address)

Rest of the Internet

Complied by: Anupam Mukherjee contact: [email protected]


8

Supernetting
The time came when most of the class A and class B addresses were depleted; however, there was still a huge
demand for midsize blocks. The size of a class C block with a maximum number of 256 addresses did not satisfy
the needs of most organizations. Even a midsize organization needed more addresses. One solution was
supernetting. In supernetting, an organization can combine several class C blocks to create a larger range of
addresses. In other words, several networks are combined to create a super- network or a supernet. An
organization can apply for a set of class C blocks instead of just one. For example, an organization that needs
1000 addresses can be granted four contiguous class C blocks. The organization can then use these addresses to
create one supernetwork. Supernetting decreases the number of 1 s in the mask. For example, if an organization is
given four class C addresses, the mask changes from/24 to/22. We will see that classless addressing eliminated
the need for supernetting.

Question7: What is the difference between IP address and MAC address?


Answer.

IP Address MAC Address


1. It is logical address. 1. It is physical address.

2. IP address is dynamic. 2. MAC address is Static.

3. IPv4 is 32 bits, and IPv6 is 128 bits. 3. MAC address is 48 bits.

4. IP address is represented by dotted decimal 4. MAC address is represented by dotted


notation. hexadecimal notation.

5. It is user define address. 5. It is manufacturing address.

6. It is classify into 5 classes. 6. No such type of classification.


i.e. class A, class B, class C, class D, class E

7. Each IP address has two parts. Netid and hosted. 7. No such type of division present in MAC address.

Note:
Formula to determine number of hosts on a given network
• Given that there are N host bits in an address, the number of hosts for that network is 2N - 2. Two addresses are
subtracted for the network address and the broadcast address.
• 8 host bits: 28 - 2 = 254 hosts
• 16 host bits: 216 - 2 = 65534 hosts
• 24 host bits: 224 - 2 = 16777214 hosts

Complied by: Anupam Mukherjee contact: [email protected]


9

 Public IP and Private IP addresses


Public IP Address:
• Most IP addresses are public addresses. Public addresses are registered as belonging to a specific organization.

• Internet Service Providers (ISP) and extremely large organizations obtain blocks of public addresses from the
IANA (Internet Assigned Numbers Authority). Other organizations obtain public addresses from their ISPs.

• Public IP addresses are routed across the Internet, so that hosts with public addresses may freely communicate
with one another globally.

• No organization is permitted use public addresses that are not registered with that organization!

Private IP Address:
• The following are private addresses.
– Class A range: 10.0.0.0 through 10.255.255.255.
– Class B range: 172.16.0.0 through 172.31.255.255.
– Class C range: 192.168.0.0 through 192.168.255.255.

• Private addresses may be used by any organization, without any requirement for registration.

• Because private addresses are ambiguous - can’t tell where they’re coming from or going to because anyone can
use them - private addresses are not permitted to be routed across the Internet.

• ISPs block private addresses from being routed across their infrastructure.

• Note: The use of private addresses, network address translation (NAT), and proxy servers solved the IP address
shortage problem for the short and medium terms.

Reserved addresses
 0.0.0.0 is the default IP address, and it is used to specify a default route.
The default route will be discussed later (routing section).

 Addresses beginning with 127 are reserved for internal loopback addresses.
It is common to see 127.0.0.1 used as the internal loopback address on many devices.
Try pinging this address on a PC or Unix station.

Complied by: Anupam Mukherjee contact: [email protected]


10

IP Datagram

What is Datagram?
• Packets in the network layer are called Datagram.
• A datagram is a variable length packet consisting of two parts-----
I) Header
II) Data

*** the header is 20 – 60 bytes in length and contains information essential to routing and delivery.

IP datagram frame format

• VER (version) : - This 4bits field defines, which version of IP address we used (IPv4 or IPv6)

• HLEN (Header Length):- This field defines the header length, which is variable (20 – 60 bytes)

• DS (Differentiate Services):- This field defines the different service type.

In this interpretation, the first 3 bits are called precedence bits. The next 4 bits are called type of service
(TOS) bits, and the last bit is not used.

a. Precedence is a 3-bit subfield ranging from 0 (000 in binary) to 7 (111 in binary). The precedence
defines the priority of the datagram in issues such as congestion. If a router is congested and needs
to discard some datagram’s, those datagram’s with lowest precedence are discarded first. Some
datagram’s in the Internet are more important than others. For example, a datagram used for

Complied by: Anupam Mukherjee contact: [email protected]


11

network management is much more urgent and important than a datagram containing optional
information for a group.
b. TOS bits is a 4-bit subfield with each bit having a special meaning. Although a bit can be either 0
or 1, one and only one of the bits can have the value of 1 in each datagram. The bit patterns and
their interpretations are given in diagram bellow. With only 1 bit set at a time, we can have five
different types of services.

• Total Length :- This field defines the total length (header + Data) of the IP Datagram in bytes.
Length of the IP datagram is limited to 65535 (216-1) bytes.

• Identification:- This field is required to set an identification number to each Datagram.

• Flags:- This is a 3-bit field. The first bit is reserved. The second bit is called the do not fragment bit. If its
value is 1, the machine must not fragment the datagram. If its value is 0, the datagram can be fragmented
if necessary. The third bit is called the more fragment bit. If its value is 1, it means the datagram is not the
last fragment; there are more fragments after this one. If its value is 0, it means this is the last or only
fragment.

• Fragmentation offset: This 13-bit field shows the relative position of this fragment with respect to the
whole datagram. It is the offset of the data in the original datagram measured in units of 8 bytes. Figure
(bellow) shows a datagram with a data size of 4000 bytes fragmented into three fragments.
The bytes in the original datagram are numbered 0 to 3999. The first fragment carries bytes 0 to 1399. The
offset for this datagram is 0/8 = 0. The second fragment carries bytes 1400 to 2799; the offset value for
this fragment is 1400/8 = 175. Finally, the third fragment carries bytes 2800 to 3999. The offset value for
this fragment is 2800/8 = 350.

Complied by: Anupam Mukherjee contact: [email protected]


12

• Time to live:- Time to live is a limit on the period of time or number of iterations or transmission in
computer and n/w technology that a unit of data (Eg. Packet) can experience before it should discarded.
Or this field is used to control the maximum number of hops (routers) visited by the datagram.

• Protocol:- This field defines the higher-level protocol that uses the service of the IP layer. An IP datagram
can encapsulate data from several higher level protocols. Such as TCP, UDP, ICMP. This field defines the
final destination protocol to which the IP datagram should be delivered.

• The IP multiplexed and demultiplexed data from different higher level protocols.

Value protocol
1 ICMP
2 IGMP
6 TCP
17 UDP
89 OSPF

Complied by: Anupam Mukherjee contact: [email protected]


13

• Checksum:- Checksum field is used for error detection purpose in IP datagram. The header of IP packets
changes with each visited router, but data do not. So, the checksum include only the part that has changed.

• Source Address:- This field defines the source IP address, and this field remain unchanged during the
time the IP datagram travels from source host to destination host.

• Destination address:- This field defines the IP address of the destination

• Options:- As name implies, are not required for every datagram. They are used for network testing and
debugging.

Complied by: Anupam Mukherjee contact: [email protected]

You might also like