Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 73

Chapter-4

Addressing
• Four levels of addresses are used in an internet
employing the TCP/IP protocols:
• physical (link) addresses, logical (IP) addresses,
port addresses, and specific addresses
Each address is related to a specific layer in
the TCPIIP architecture.
Physical Addresses
• The physical address, also known as the link address, is the
address of a node as defined by its LAN or WAN.
• It is included in the frame used by the data link layer.
• It is the lowest-level address.
• The physical addresses have authority over the network
(LAN or WAN).
• The size and format of these addresses vary depending on
the network.
• For example,
• Ethernet uses a 6-byte (48-bit) physical address that is imprinted
on (NIC).
• LocalTalk (Apple), has a I-byte dynamic address that changes
each time the station comes up.
Port Addresses
• The IP address and the physical address are necessary for a
quantity of data to travel from a source to the destination host.
• However, arrival at the destination host is not the final
objective of data communications on the Internet.
• A system that sends data from one computer to another is not
complete.
• Today, computers are devices that can run multiple processes
at the same time. The end objective of Internet communication
is a process communicating with another process.
• Example:
Logical Addresses
• Logical addresses are necessary for universal communications
that are independent of underlying physical networks.
• Physical addresses are not adequate in an internetwork
environment.
• The logical addresses are designed for this purpose. A logical
address in the Internet is currently a 32-bit address that can
uniquely define a host connected to the Internet.
• For example, computer A can communicate with
computer C by using TELNET. At the same time,
computer A communicates with computer B by
using the File Transfer Protocol (FTP).
• For these processes to receive data simultaneously,
we need a method to label the different processes.
• In other words, they need addresses. In the TCP/IP
architecture, the label assigned to a process is called
a port address. A port address is 16 bits in length.
Specific Addresses
• Some applications have user-friendly addresses that
are designed for that specific address.
• Examples include the e-mail address (for example,
forouzan@fhda.edu) and the Universal Resource
Locator (URL) (for example, www.mhhe.com).
• The first defines the recipient of an e-mail; the
second is used to find a document on the World
Wide Web.
• These addresses, however, get changed to the
corresponding port and logical addresses by the
sending computer.
IP Addresses
IP Address
• An IP address is an address used in order to uniquely
identify a device on an IP network.
• IP Addresses are used to route packets from a
sending node to a receiving node.
• The address is made up of 32 binary bits.
• Divided into a network portion and host portion
with the help of a subnet mask.
• The Internet Assigned Numbers Authority (IANA)
assigns network identifiers to avoid duplications.
IP Address
• The 32 binary bits are broken into four octets
(1 octet = 8 bits).

• Each octet is converted to decimal and separated by


a period (dot).

• For this reason, an IP address is said to be expressed in


dotted decimal format (for example, 172.16.81.100).

• The value in each octet ranges from 0 to 255 decimal,


or 00000000 − 11111111 binary.
Dotted Decimal Notation
• Each byte is identified by a decimal number in
the range [0..255]:
• Example:

10000000 10001111 10001001 10010000


1st Byte 2nd Byte 3rd Byte 4th Byte
= 128 = 143 = 137 = 144

128.143.137.144
Network prefix and Host number
• The network prefix identifies a network and the host
number identifies a specific host (actually, interface on
the network).

network prefix host number


• How do we know how long the network
prefix is?
• The network prefix used to be implicitly defined
(class-based addressing, A,B,C,D…)
• The network prefix now is flexible and is indicated
by a prefix/netmask (classless).
What is an IP Address?

An IP address is a
32-bit
address.
Address space rule
…………..
addr1 …………..
The address spaceaddr15
in a protocol that
addr2 ………….. …………..
uses…………..
N-bits to define an Address is:
addr41
2 N addr226
addr31
………….. …………..
IPv4 address space

The address space of IPv4 is


232
or
4,294,967,296.
Example 1

Change the following IP address from binary


notation to dotted-decimal notation.
10000001 00001011 00001011 11101111

Solution

129.11.11.239
Example 2

Change the following IP address from


dotted-decimal notation to binary notation:
111.56.45.78

Solution

01101111 00111000 00101101 01001110


Example 3

Find the error in the following IP Address


111.56.045.78

Solution

There are no leading zeroes in


Dotted-decimal notation (045)
Example 3 (continued)

Find the error in the following IP Address


75.45.301.14

Solution

In decimal notation each number <= 255


301 is out of the range
CLASSFUL
ADDRESSING
Classful Addressing
• IPv4 addressing, at its inception, used the concept of
classes.
• This architecture is called classful addressing.
• Although this scheme is becoming obsolete.
• 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.
IP Address Classes
• The IP is divided into different classes.

• Rules for class design


ALL BITS ZERO NOT ALLOWED
ALL BITS ONE NOT ALLOWED
Finding the class in binary notation
Finding the address class
Netid and Hostid
• In classful addressing, an IP address in class A, B, or C
is divided into netid and hostid.
• These parts are of varying lengths, depending on the
class of the address.
• Note: this concept does not apply to classes D and E.
• In class A, one byte defines the netid and three bytes
define the hostid.
• In class B, two bytes define the netid and two bytes
define the hostid. In class C, three bytes define the
netid and one byte defines the hostid.
IP Address Classes
 TheIP is divided into different class with respect to
their 1st octet.

 Class A: 0XXX XXXX –


Min = 0000 0001 = 1
Max = 0111 1110 = 126
 127 is not allowed as it is loop back address used
by LAN card for its own working process.
 Class A addresses are assigned to networks with a
very large number of hosts.
Class A Addresses
• The high-order bit in a class A address is
always set to zero.
• The next seven bits complete the network ID.
• The remaining 24 bits represent the host ID.
• This allows for 126 networks and
16,777,214 hosts per network.
Class A Addresses

0 Network Host
1 7 24

In this 7bits are used for network field and 24 bits


for host field.
Class A IP address range includes
1.0.0.0 to 127.255.255.255
Millions of class A addresses
are wasted.
Class B Address
• Class B addresses are assigned to medium-sized to
large-sized networks.

• The two high-order bits in a class B address are always


set to binary 1 0.

• The next 14 bits complete the network ID.

• The remaining 16 bits represent the host ID.

• This allows for 16,384 networks and 65,534 hosts per


network.
Class B Address
• In this 14 bits are used for network field and 16 bits
for host field.
• Class B IP address range includes 128.0.0.0 to
191.255.255.255

10 Network Host
2 14 16
Many class B addresses
are wasted.
Class C Address
• Class C addresses are used for small networks.
• The three high-order bits in a class C address
are always set to binary 1 1 0.
• The next 21 bits complete the network ID.
• The remaining 8 bits (last octet) represent the
host ID.
• This allows for 20,97,152 networks and 254
hosts per network.
Class C Address

110 Network Host


3 21 8

In this 21 bits are used for network field and


8 bits for host field.
• Class C IP address range includes
192.0.0.0 to 223.255.255.255
The number of addresses in
a class C block
is smaller than
the needs of most organizations.
Class D Address
• Class D addresses are reserved for IP
multicast addresses.
• The four high-order bits in a class D address are
always set to binary 1 1 1 0.
• The remaining bits recognize hosts.
• Class D IP address range includes 224.0.0.0 to
239.255.255.255

1110 Multicast Address


4 32
Class D addresses
are used for multicasting;
there is only
one block in this class.
Class E Address
• Class E is an experimental address that is
reserved for future use.
• The high-order bits in a class E address are set
to 1111.

1111 Reserved for Future Use


4 32

• Class E IP address range includes 240.0.0.0 to


255.255.255.255
Class E addresses are reserved
for special purposes;
most of the block is wasted.
Example 6

Find the class of the following IP addresses


00000001 00001011 00001011 11101111
11000001 00001011 00001011 11101111

Solution

•00000001 00001011 00001011 11101111


1st bit is 0, hence it is Class A
•11000001 00001011 00001011 11101111
1st and 2nd bits are 1, and 3rd bit is 0 hence, Class C
Figure 4-5

Finding the class in decimal notation


Example 7

Find the class of the following addresses


158.223.1.108
227.13.14.88

Solution
•158.223.1.108
1st byte = 158 (128<158<191) class B
•227.13.14.88
1st byte = 227 (224<227<239) class D
Example 8

Given the network address 132.21.0.0, find the


class, the block, and the range of the addresses

Solution

The 1st byte is between 128 and 191.


Hence, Class B
The block has a netid of 132.21.
The addresses range from
132.21.0.0 to 132.21.255.255.
IP Classes with the range
Network Masks
• A network mask helps to know which portion of the
address identifies – the network and which portion of
the address identifies the node.
• A mask is a 32-bit binary number.
• Class A, B, and C networks have default masks, also
known as natural masks.

Class A default mask is 255.0.0.0


Class B default mask is 255.255.0.0
Class C default mask is 255.255.255.0
Classless Addressing
• To overcome address depletion and give more
organizations access to the Internet, classless
addressing was designed and implemented.
• In this scheme, there are no classes, but the
addresses are still granted in blocks.
SUBNETTING
Subnetting
• During the era of classful addressing, subnetting
was introduced.
• If an organization was granted a large block in class
A or B, it could divide the addresses into several
contiguous groups and assign each group to smaller
networks (called subnets) or, in rare cases, share
part of the addresses with neighbors.
• Subnetting increases the number of Is in the
mask.
Subnetting
• To create multiple logical networks that exist
within a single Class A, B, or C network.
• If you do not subnet, you are only able to use
one network from your Class A, B, or C network,
which is unrealistic.
• The subnet mask is 32 bit value that usually
expressed in dotted decimal notation.
Note
• The network portion of the subnet mask must
be contiguous.
• For example, a subnet mask of 255.0.0.255 is
not valid.
• Subnetting is done by borrowing bits from
the host part and add them the network part
Finding the Subnet Address

Given an IP address, we can find the


subnet address the same way we found the
network address.
We apply the mask to the address.
Straight Method
In the straight method, we use binary notation
for both the address and the mask and then
apply the AND operation to find the subnet
address.
Example 9

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 subnet address is 200.45.32.0.


Example 10

What is the subnetwork address if the


destination address is 19.30.80.5 and the
mask is 255.255.192.0?

Solution
Figure 5-6

Solution
The number of subnets must be
a power of 2.
Example 11

A company is granted the site address


201.70.64.0 (class C). The company needs
six subnets. Design the subnets.

Solution

The number of 1s in the default mask is 24


(class C).
Solution (Continued)

• The company needs six subnets.


• This number 6 is not a power of 2. The next
number that is a power of 2 is 8 (23).
• We need 3 more 1s in the subnet mask.
• The total number of 1s in the subnet mask is
27 (24 + 3).
• The total number of 0s is 5 (32 - 27).
Solution (Continued)

The mask is
11111111 11111111 11111111 11100000
or
255.255.255.224
The number of subnets is 8.
The number of addresses in each subnet is 25 (5 is the
number of 0s) or 32
Solution (Continued)
The Six Subnets are :
201.70.64.0
201.70.64.32
201.70.64.64
201.70.64.96
201.70.64.128
201.70.64.160
The remaining 2 are unused:
201.70.64.192
201.70.64.224
Subnet 1:
The bit combination is 001.
Taking last octet in binary :0 0 1 0 0 0 0 0 = 32 (10)

Hence the subnet address is, 201.70.64. 32


Subnet 2:
The bit combination is 01 0.
Taking last octet in binary :0 0 1 0 0 0 0 0 = 64 (10)

Hence the subnet address is, 201.70.64. 64


Subnet 3:
The bit combination is 011.
Taking last octet in binary :0 1 1 0 0 0 0 0 = 96 (10)

Hence the subnet address is, 201.70.64. 96


Subnet 4:
The bit combination is 100.
Taking last octet in binary :1 0 0 0 0 0 0 0 = 128 (10)

Hence the subnet address is, 201.70.64. 128


Subnet 5:
The bit combination is 101.
Taking last octet in binary :1 0 1 0 0 0 0 0 = 160 (10)

Hence the subnet address is, 201.70.64. 160


Subnet 6:
The bit combination is 110.
Taking last octet in binary :1 1 0 0 0 0 0 0 = 192 (10)

Hence the subnet address is, 201.70.64. 192


Figure 5-8

Example 3
Example 12

A company is granted the site address


181.56.0.0 (class B). The company needs
1000 subnets. Design the subnets.
Solution

The number of 1s in the default mask is 16


(class B).
Solution (Continued)

• The company needs 1000 subnets.


• This number is not a power of 2.
• The next number that is a power of 2 is 1024 (210).
• We need 10 more 1s in the subnet mask.
• The total number of 1s in the subnet mask is 26 (16
+ 10).
• The total number of 0s is 6 (32 - 26).
Solution (Continued)

The mask is

11111111 11111111 11111111 11000000


or
255.255.255.192.
The number of subnets is 1024.
The number of addresses in each subnet is 26
(6 is the number of 0s) or 64.
Figure 5-9

Example 4
SUPERNETTING
What is suppernetting?
• Supernetting is the opposite of subnetting.
• In subnetting you borrow bits from the host
part.
• Supernetting is done by borrowing bits from the
network side.
• And combine a group of networks into one
large supernetwork.
Supernetting
• This enables organizations to modify their network
size and minimize the requirement of network
routing devices.
• Helps routers to store routing information effectively.
A supernetwork

You might also like