0% found this document useful (0 votes)
10 views

Lecture_5 IP Addressing

The document provides an overview of IP addressing, detailing its significance in identifying devices on a network and the differences between IPv4 and IPv6. It explains various types of IP addresses, their classifications, and the concept of subnetting. Additionally, it discusses the structure of IP address classes and the role of subnet masks in network identification.

Uploaded by

juliussavi789
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)
10 views

Lecture_5 IP Addressing

The document provides an overview of IP addressing, detailing its significance in identifying devices on a network and the differences between IPv4 and IPv6. It explains various types of IP addresses, their classifications, and the concept of subnetting. Additionally, it discusses the structure of IP address classes and the role of subnet masks in network identification.

Uploaded by

juliussavi789
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/ 34

Computer Networks and Data Communication

IP Addressing

Twaha Kateete
[email protected]
+256 778 313 421
IP ADDRESSING
IP Addressing
• It is a unique Number that uniquely identifies a device on a given Network.
• Every host or router on the Internet/network is identified by a unique IP address.
• The role of an IP address can be defined as "A name that indicates what we seek. An
address indicates where it is. Then a route indicates how to get there.”
• A Computer can have more than one IP address.
• There are two common versions IPv4(version 4) and IPv6(version 6)
Types / ways of IPs
• An IP address can be a single recipient or a group of recipients
• Three ways:

– Uniticast → Message is delivered to one single IP from one sender IP

– Multicast → One IP delivers message to only intended recipient IPs (target group of IPs) on the
Network.

– Broadcast →IP delivers message to all connected IPs on the Network.

– Anycast →IP delivers a message to any IP out of a group of IPs, typically the one nearest
to the message source.
Classification of IPs
• IP addresses are classified as:
• Static addresses – Never change but can be changed due to network
administration. Details of the country, continent and region where machine is
located.

• Dynamic address – Assigned to computers when they get connected to the


internet each time. ISPs usually reserve portion of their assigned addresses for
subscribers. Done by DHCP Protocol.

• Static are less secure than Dynamic.


IPv4(version 4)
• IPv4 is the old version of IP addresses but still in use.
• Each IPv4 address is 32 bits in length and normally written in dotted decimal format that
means each byte (8 bits) are separated by a dot(.).

• Each decimal number is in the range of 0 to 255.


– For example: 192.168.0.111000000 10101000 00000000 00000001.

• You can represent 232 = 4 294 967 296 different addresses

• Each IPv4 Address is separated by a net mask into a network and a host (computers)
part.
Octets
• The 32-bit IP address is broken up into 4 octets, which are
arranged into a dotted-decimal notation scheme.
• An octet is a set of 8 bits.

• Example of an IP version 4: 172.64.126.52


• Octet 1 : 172
• Octet 2 : 64
• Octet 3 : 126
• Octet 4 : 52
IPv6(version 6)
• IPv6 was standardized in 1998 and deployed starting in mid 2000.
• Each IPv6 address is 128 bits in length.
• This means you can represent 2128 ≈ 3.4 * 10 38 different addresses
• IPv6 addresses are represent in hexadecimal.
• You combine two octets and separate the group by a colon (:)
– For example 1001:0dab:79b4:0000:0001:9c3d:0268:8877
• You can replace one sequence of blocks by :: if they only contain zeros
– For example 1001:0dab:79b4::0001:9c3d:0268:8877
• Each IPv6 address is separated by a prefix length into a network and host part
IPv6 Vs IPv4
• IPv6 provides better end to end connectivity than IPv4.
• IPv6 has comparatively faster routing
• IPv6 offers ease of administration than IPv4
• IPv6 has more security for apps and networks than IPv4
• IPv6 provides better muticast and anycast abilities.
• IPv6 has better mobility features than IPv4
Addressing Table
• This contains the Name, IP addresses and Physical Addresses of
devices available on the Network.
• Sometimes used to assign static IPs to devices on the Network.
Thinking in Binary
• The binary system uses only 2 values “0 & 1” to represent
numbers in positions representing increasing powers of 2.

• We are all accustomed to thinking & working in the


decimal system, which is based on the number 10(base
ten).
Thinking in Binary (Cont.)
• To most humans, the number 124 represents 100 + 20 + 4.
• To the computer, this number is 1111100, which is 64 (26)
+ 32 (25) + 16 (24) + 8 (23) + 4 (22) + 0 + 0
• Each position in a binary number represents, right to left,
a power of two beginning with 20 & increasing by one
power as it moves left: 20, 21, 22, 24, etc.
Converting to Decimal
• You’ll need to convert binary to decimal & vice versa to compute
subnets & hosts.
• So, it’s time for a quick review lesson in binary-to-decimal
conversion.
• There are 8 bits in an octet & each bit can only be a 1 or a 0.
• What then do you suppose is the largest decimal number that can
be expressed in an octet?

Eight 1’s (1111 1111)


Converting to Decimal (Cont.)
• What is its equivalent decimal value?
27 26 25 24 23 22 21 20
1 1 1 1 1 1 1 1
128 64 32 16 8 4 2 1

The binary number 1111 1111 converts


into the decimal number:
128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255

• Therefore, the largest decimal number that can be stored in an IP


address octet is 255.
• The significance of this should become evident later in the
subsequent slides.
IP Address Classes
• IP addresses are divided into 5 classes, each of which is
designated with the alphabetical letters A to E.

• Class D addresses are used for multicasting.

• Class E addresses are reserved for testing & some mysterious


future use.
IP Address Classes (Cont.)
• The 5 IP classes are split up based on the value in the 1st octet:
IP Address Classes (Cont.)
• Using the ranges, you can determine the class of an address
from its 1st octet value.
• An address beginning with 120 is a Class A address, 155 is a
Class B address & 220 is a Class C address.
• So, IP address class can be determined on its first site.
Are You the Host or the Network?
• The 32 bits of the IP address are divided into Network & Host portions,
with the octets assigned as a part of one or the other.

Network & Host Representation


By IP Address Class
Class Octet1 Octet2 Octet3 Octet4

Class A Network Host Host Host

Class B Network Network Host Host

Class C Network Network Network Host


Are You the Host or the Network? (Cont.)
• Each Network is assigned a network address & every device or
interface (such as a router port) on the network is assigned a
host address.
• There are only 2 specific rules that govern the value of the
address.
– A host address cannot be designated by all zeros or all ones.
– These are special addresses that are reserved for special purposes.
IP Addressing Classes
Class A - 0nnnnnnn.hhhhhhhh.hhhhhhhh.hhhhhhhh
Initial byte = 0 - 127 (7 bits)
1.0.0.0 – 127.255.255.255

Class B - 10nnnnnn.nnnnnnnn.hhhhhhhh.hhhhhhhh
Initial byte = 128 - 191 (14 bits)
128.0.0.0 – 191.255.255.255

Class C - 100nnnnn.nnnnnnnn.nnnnnnnn.hhhhhhhh
Initial byte = 192 - 223 (21 bits)
192.0.0.0 – 223.255.255.255
Class D – Used in multicasting.
Class E – Reserved for Future Use.

n = network address h = host address


Class A Addresses
• Class A IP addresses use the 1st 8 bits (1st Octet) to designate the
Network address.
• The 1st bit which is always a 0, is used to indicate the address as a Class A
address & the remaining 7 bits are used to designate the Network.
• The other 3 octets contain the Host address.
• There are 128 Class A Network Addresses, but because addresses with all
zeros aren’t used & address 127 is a special purpose address, 126 Class A
Networks are available.
Class A Addresses (Cont.)
• There are 16,777,214 Host addresses available in a Class A address.
• Rather than remembering this number exactly, you can use the following
formula to compute the number of hosts available in any of the class
addresses, where “n” represents the number of bits in the host portion:

(2n – 2) = Number of available hosts


Class A Addresses (Cont.)
• For a Class A network, there are:
224 – 2 or 16,777,214 hosts.
• Half of all IP addresses are Class A addresses.
• You can also determine the number of Networks in an address class.

• Eg., a Class A address uses 7 bits to designate the network, so (27 ) = 128
or there can be 128 Class A Networks.
Class B IP Addresses
• Class B addresses use the 1st 16 bits (two octets) for the Network
address.
• The last 2 octets are used for the Host address.
• The 1st 2 bit, which are always 10, designate the address as a Class B
address & 14 bits are used to designate the Network. This leaves 16 bits
(two octets) to designate the Hosts.
• So how many Class B Networks can there be?
• Using our formula, (214 ), there can be 16,384 Class B Networks & each
Network can have (216 – 2) Hosts, or 65,534 Hosts.
Class C IP Addresses
• Class C addresses use the 1st 24 bits (three octets) for the
Network address & only the last octet for Host addresses.

• The 1st 3 bits of all class C addresses are set to 110, leaving
21 bits for the Network address, which means there can be
2,097,152 (221) Class C Networks, but only 254 (28 – 2) Hosts
per Network.
X-tics of IP Address Classes
Special Addresses
• A few addresses are set aside for specific purposes.
• Network addresses that are all binary zeros, all binary ones &
Network addresses beginning with 127 are special Network
addresses.
Special Addresses (Cont.)
• Within each address class is a set of addresses that are set
aside for use in local networks sitting behind a firewall or NAT
(Network Address Translation) device or Networks not
connected to the Internet.
• A list of these addresses for each IP address class:
Subnet Mask
• An IP address has 2 parts:
– The Network identification.
– The Host identification.
• 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.
• With the rapid growth of the internet & the ever-increasing demand for new
addresses, the standard address class structure has been expanded by
borrowing bits from the Host portion to allow for more Networks.
• Under this addressing scheme, called Subneting, separating the Network &
Host requires a special process called Subnet Masking.
Subnet Mask (Cont.)
• The subnet masking process was developed to identify & extract the
Network part of the address.
• A subnet mask, which contains a binary bit pattern of ones & zeros, is
applied to an address to determine whether the address is on the local
Network.
• If it is not, the process of routing it to an outside network begins.
• The function of a subnet mask is to determine whether an IP address
exists on the local network or whether it must be routed outside the
local network.
Subnet Mask (Cont.)
• It is applied to a message’s destination address to extract the network
address.
• If the extracted network address matches the local network ID, the
destination is located on the local network.
• However, if they don’t match, the message must be routed outside the local
network.
• The process used to apply the subnet mask involves Boolean Algebra to filter
out non-matching bits to identify the network address.
Subnet Mask
Determines the way an IP address is split into network and hosts
portions

Class A - 0nnnnnnn.hhhhhhhh.hhhhhhhh.hhhhhhhh
Subnet Mask = 255.0.0.0 IP Address /8

Class B - 10nnnnnn.nnnnnnnn.hhhhhhhh.hhhhhhhh
Subnet Mask = 255.255.0.0 IP Address /16

Class C - 100nnnnn.nnnnnnnn.nnnnnnnn.hhhhhhhh
Subnet Mask = 255.255.255.0 IP Address /24
SUBNETTING
(Next Lecture)
Questions

You might also like