TMP Study Addressing Last

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 45

IP ADDRESSING

Addressing the Network: IPv4

Addressing is a key function of network layer protocols.


Addressing enables data communication between hosts on
the same network or on different networks. Internet Protocol
version 4 (IPv4) provides hierarchical addressing for packets
that carry your data.

Designing, implementing, and managing an effective IPv4


addressing plan ensures that networks can operate effectively
and efficiently.
Anatomy of an IPv4 Address

Each device on a network must be uniquely defined by a network layer


address. At this layer, the packets of the communication are also
identified with the source and destination addresses of the two end
systems.

With IPv4, each packet uses a 32-bit source address and a 32-bit
destination address in the Layer 3 header.
These addresses are represented in the data network as binary
patterns. Inside the devices, digital logic is applied for the
interpretation of these addresses. For the human network, a string of
32 bits is difficult to interpret and even more difficult to remember. For
this reason, IPv4 addresses are represented using dotted decimal
format.
Dotted Decimal IPv4 addresses are easier to remember,
write, and verbally communicate than strings of 32 bits.
Representing IPv4 addresses as dotted decimals begins by
separating the 32 bits of the address into bytes. Each byte
of the binary pattern, called an octet, is separated with a dot.

The bytes are called an octet, because each of the decimal


numbers represents 1 byte, or 8 bits.

For example, the following address:


10101100000100000000010000010100 is expressed in
dotted decimal as: 172.16.4.20

Keep in mind that devices use binary logic. The dotted


decimal format makes it easier for people to use and
remember addresses.
Broadcast Communication is the process of sending a packet
from one host to all hosts in the network.

Unlike unicast communication, which uses the destination host


address, broadcast and multicast communication use special
addresses as the destination address.

This special address, called the broadcast address, allows all


the receiving hosts to accept the packet. When a host receives
a packet with the broadcast address as the destination, it
processes the packet as it would a packet to its unicast
address.

Using these special addresses, broadcasts are generally


restricted to the local network and not forwarded by a router. In
unicast the packets can be routed throughout the internetwork.
Figure 6-7 represents a limited broadcast from host A with the address 172.16.4.1.
In this example, the source host creates a single packet addressed to the Layer 3
broadcast address.
The lower-layer services will use a corresponding data link layer address to forward
this packet to all the hosts. When a copy of this packet arrives at each end device,
the devices recognize that it is addressed to all the devices and processes the
packet.
Figure 3-2 Byte Assignment in a Class A Address
Figure 3-3 Byte Assignment in a Class B Address
Figure 3-1 Parts of an IP Address
Figure 3-4 Byte Assignment in a Class C Address
The Network Address (NA):
This is calculated by performing a bitwise “AND” of the
Subnet Mask (SM) and the IP address of any computer on
the network that is:
Network Address (NA) = (IP) AND (SM) …….(1)
The Broadcast Address (BA):
This address is calculated by bitwise “OR”ing the one
complement of the subnet mask with any host address on
the network that is:

Broadcast Address (BA) = (IP) OR (SM) …….(2)

The subnet mask is used to determine whether IP packets


are designed for the local network or a remote (different)
network.
If we let “Z” represents the number of “0” subnet mask bits, then
the TOTAL number of IP addresses in the network’s IP block
assignment is given by:

TOTAL = 2z ……(3)

The TOTAL includes both the network and broadcast addresses.


Hence, the total number of hosts in the Network is given by:

HOSTS = 2z -2 ……..(4)
Example (1)
What are the network and broadcast addresses for the host
172.0.0.125 given the subnet mask 255.255.0.0
Answer

IP = 172.0.0.125 class B
SM = 255.255.0.0
Network Address (NA) = (IP) AND (SM)
= (172.0.0.125) AND (225.255.0.0)
= 172.0.0.0.
(SM) = 255.255.0.0

(SM) = (225.255.0.0) = 0.0.255.255


Broadcast Address (BA) = (IP) OR (SM)
= (172.0.0.125) OR (0.0.255.255)
= 172.0.255.255
Example (2)

How many possible hosts in the network 172.0.0.0.

Answer

This is a class B network, and hence:


SM = 255.255.0.0
Z = 16
HOSTS = 216 -2 = 65534 different host computers.
Example (3)

Determine the number of network, subnet, and host bits,


and the number of subnets and the number of hosts per
subnet, for each of the following five problems:

1) 8.1.4.5/16
2) 130.4.102.1/24
3) 199.1.1.100/24
4) 130.4.102.1/22
5) 199.1.1.100/27
Answers

1) 8.1.4.5/16

SM = 255.255.0.0
Number of network bits = 8 (class A)
Number of host bits = 16
Number of subnet bits = 32-(Network bits + Host bits)
= 32-(8+16) = 8
Number of Hosts per subnet = 216 - 2=65534
Number of subnets = 28 =256
2) 130.4.102.1/24

SM = 255.255.255.0
Number of network bits = 16 (class B)
Number of host bits = 8
Number of subnet bits =32-(16+8) = 8
Number of Hosts per subnet = 28 -2=254
Number of subnets = 28 =256

3) 199.1.1.100/24

SM = 255.255.255.0
Number of network bits = 24 (class C)
Number of host bits = 8
Number of subnet bits =32-(24+8) = 0
Number of Hosts per subnet = 28 -2=254
Number of subnets = 20 = 1 (no subnets)
4) 130.4.102.1/22

SM = 255.255.255.0
Number of network bits = 16 (class B)
Number of host bits = 2+8=10
Number of subnet bits =32-(16+10) = 6
Number of Hosts per subnet = 210 - 2=1022
Number of subnets = 26 =64

5) 199.1.1.100/27

SM = 255.255.255.224
Number of network bits = 24 (class C)
Number of host bits = 5
Number of subnet bits =32-(24+5) = 3
Number of Hosts per subnet = 25 -2=30
Number of subnets = 23 =8

You might also like