0% found this document useful (0 votes)
11 views125 pages

ITT420 - Chapter 3

Uploaded by

nurul najwa
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)
11 views125 pages

ITT420 - Chapter 3

Uploaded by

nurul najwa
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/ 125

Chapter 3

IP Addresses: Classful and Classless


Addressing
THE ISO OSI MODEL
Count ‘em! 7 Layers!
SEGMENTATION REASSEMBLY
& &
ENCAPSULATION DECAPSULATION
Physical
Interfaces Transmission
and media mode

Bit
Data rate Topology
representation
Data Link
Physical
Framing
Addressing

Flow control Error Control Access Control


Hop-to-hop Delivery
Network
Logical
Routing
Addressing
Source-to-Destination Delivery
Transport
Segmentation & Service-point
Reassembly Addressing

Connection
Flow control Error Control
Control
Process-to-Process Delivery
Session
Dialog control Synchronization
Presentation

Translation Encryption Compression


Application
Network Virtual
Mail services
Terminal

Directory
File transfers
services
In a nutshell
The TCP/IP Protocol Suite
IP Addressing
Addressing

Physical Logical Process

MAC IP Port
Address Address Number
IP Addressing

Logical Addressing

IPv4 IPv6
IP Addressing
• An IPv4 address is a 32-bit address that uniquely and
universally defines the connection of a device (for example, a
computer or a router) to the Internet.
• Address space
• Address range
• The total number of addresses used by the protocol
• If a protocol used N bits, so address space is 2N
• Theoretically, need restriction in manage IP address range

The address space of IPv4 is


232 or 4,294,967,296.
IPv4

IPv4 Notation

Dotted-Decimal
Binary Notation
Notation
IPv4
Example
Change the following IP addresses from binary notation to
dotted-decimal notation.
a. 10000001 00001011 00001011 11101111
b. 11000001 10000011 00011011 11111111
c. 11100111 11011011 10001011 01101111
d. 11111001 10011011 11111011 00001111
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
c. 231.219.139.111 d. 249.155.251.15
Example
Change the following IP addresses from dotted-decimal notation
to binary notation.
a. 111.56.45.78 b. 221.34.7.82
c. 241.8.56.12 d. 75.45.34.78

Solution
We replace each decimal number with its binary equivalent:
a. 01101111 00111000 00101101 01001110
b. 11011101 00100010 00000111 01010010
c. 11110001 00001000 00111000 00001100
d. 01001011 00101101 00100010 01001110
Example
Change the following IP addresses from binary notation to
hexadecimal notation.
a. 10000001 00001011 00001011 11101111
b. 11000001 10000011 00011011 11111111
Solution
We replace each group of 4 bits with its hexadecimal equivalent.
Note that hexadecimal notation normally has no added spaces
or dots; however, 0X (or 0x) is added at the beginning or the
subscript 16 at the end to show that the number is in
hexadecimal.
a. 0X810B0BEF or 810B0BEF16
b. 0XC1831BFF or C1831BFF16
Example
• Find the error, if any, in the following IPv4 addresses.

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

In classful addressing, the address space is divided into five


classes:
A, B, C, D, and E.
Address Class
Classful Addressing
Default Mask
Example

Given the address 23.56.7.91, find the beginning address


(network address).

Solution
The default mask is 255.0.0.0, which means that only the first
byte is preserved and the other 3 bytes are set to 0s. The
network address is 23.0.0.0.
Example

Given the address 132.6.17.85, find the beginning address


(network address).

Solution
The default mask is 255.255.0.0, which means that the first 2
bytes are preserved and the other 2 bytes are set to 0s. The
network address is 132.6.0.0.
Example

Given the address 201.180.56.5, find the beginning address


(network address).

Solution
The default mask is 255.255.255.0, which means that the first 3
bytes are preserved and the last byte is set to 0. The network
address is 201.180.56.0.
Special Addresses
Special Addresses
Direct Broadcast Address
Limited Broadcast Address
This Host on This Network
Specific Host on This Network
Loopback Address
Private Addresses
Classful Addressing

In classful addressing, a large part of the available addresses


were wasted.

Classful addressing, which is almost obsolete, is replaced with


classless addressing.
Classless Addressing
• The Internet Authorities impose restrictions
on classless address blocks:
• The addresses in a block must be contiguous
• The number of addresses in a block must be a
power of 2
• The first address must be evenly divisible by the
number of addresses
Classless Addressing
• The next figure shows a block of addresses, in
both binary and dotted-decimal notation,
granted to a small business that needs 16
addresses.
• We can see that the restrictions are applied to
this block. The addresses are contiguous. The
number of addresses is a power of 2 (16 = 24),
and the first address is divisible by 16. The first
address, when converted to a decimal
number, is 3,440,387,360, which when divided
by 16 results in 215,024,210.
Classless Addressing
Finding the First Address
In IPv4 addressing, a block of
addresses can be defined as
x.y.z.t /n
in which x.y.z.t defines one of the addresses and the /n defines
the mask.

The first address in the block can be found by setting the


rightmost
32 − n bits to 0s.
Example
A block of addresses is granted to a small organization. We know
that one of the addresses is 205.16.37.39/28. What is the first
address in the block?

Solution
The binary representation of the given address is
11001101 00010000 00100101 00100111
If we set 32−28 rightmost bits to 0, we get
11001101 00010000 00100101 0010000
or
205.16.37.32.
Finding the Last Address

The last address in the block can be found by setting the


rightmost
32 − n bits to 1s.
Example
A block of addresses is granted to a small organization. We know
that one of the addresses is 205.16.37.39/28. Find the last
address for the block.

Solution
The binary representation of the given address is
11001101 00010000 00100101 00100111
If we set 32−28 rightmost bits to 1, we get
11001101 00010000 00100101 00101111
or
205.16.37.47.
Finding the No of Addresses

The last address in the block can be found by setting the


rightmost
32 − n bits to 1s.
Example
Find the number of addresses in the previous example.

Solution
The value of n is 28, which means that number
of addresses is 2 32−28 or 16.
Example
Another way to find the first address, the last address, and the
number of addresses is to represent the mask as a 32-bit binary
(or 8-digit hexadecimal) number. This is particularly useful when
we are writing a program to find these pieces of information. In
the previous example, /28 can be represented as
11111111 11111111 11111111 11110000
(twenty-eight 1s and four 0s)

Find
• The first address
• The last address
• The number of addresses
Solution
a. The first address can be found by ANDing the given
addresses with the mask. ANDing here is done bit by bit. The
result of ANDing 2 bits is 1 if both bits are 1s; the result is 0
otherwise
Solution
b. The last address can be found by ORing the given
addresses with the complement of the mask. ORing here is
done bit by bit. The result of ORing 2 bits is 0 if both bits are
0s; the result is 1 otherwise. The complement of a number is
found by changing each 1 to 0 and each 0 to 1
Solution
c. The number of addresses can be found by complementing
the mask, interpreting it as a decimal number, and adding 1
to it
Network Address

The first address in a block is


normally not assigned to any device;
it is used as the network address that represents the
organization
to the rest of the world.
Network Address Translation (NAT)
• A solution to overcome shortage of addresses
• Enables a user to have a large set of addresses
internally and one address, or a small set of
addresses, externally
• For this purpose the Internet authorities have
reserved three sets of private addresses
Network Address Translation (NAT)
Address Translation
• All the outgoing packets go through the NAT router,
which replaces the source address in the packet with
the global NAT address
• All incoming packets also pass through the NAT
router, which replaces the destination address in the
packet with the appropriate private address
Address Translation
Two-Level Hierarchy
• An IP address can define only two levels of
hierarchy when not subnetted
• The n left-mots bits of the address x.y.z.t/n
define the network – prefix
• The 32-n rightmost bits define the particular
host to the network – suffix
Two-Level Hierarchy

Each address in the block can be considered as a two-level


hierarchical structure:
the leftmost n bits (prefix) define
the network;
the rightmost 32 − n bits define
the host.
Three-Level Hierarchy: Subnetting
• An organization that is granted a large block of
addresses may want to create clusters of
networks (subnets) and divide the address
between the different subnets
Three-Level Hierarchy: Subnetting
Example
• What is the subnetwork address if the destination address is
200.45.34.56 and the subnet mask is 255.255.240.0?
• The number of subnetworks can be found by counting the
extra 1’s that are added to the default mask
• E.g. with n 1’s, we have 2n subnets
• The number of addresses per subnet can be found by
counting the number of 0’s in the subnet mask
CIDR
Fixed Length Subnets
• Finding the subnet mask
• If no of subnets is s, the extra 1’s in prefix length is log2
s
• E.g. an org needs 4 subnets
• Block granted 130.34.12.64/26
• Subnet prefix length log2 4 = 2
• Subnet prefix is then /28
Fixed Length Subnets
Variable Length Subnets
• Subnets of different sizes
• E.g. an organization is granted address block
14.24.74.0/24 and needs to have 11 subnets
• 2 subnets each with 64 addresses
• 2 subnets each with 32 addresses
• 3 subnets each with 16 addresses
• 4 subnets each with 4 addresses
Variable Length Subnets
Example
An ISP is granted a block of addresses starting with
190.100.0.0/16 (65,536 addresses). The ISP needs to distribute
these addresses to three groups of customers as follows:
a. The first group has 64 customers; each needs 256
addresses.
b. The second group has 128 customers; each needs 128
addresses.
c. The third group has 128 customers; each needs 64
addresses.
Design the subblocks and find out how many addresses are still
available after these allocations.
Solution
• Group 1
For this group, each customer needs 256 addresses. This
means that 8 (log2 256) bits are needed to define each host.
The prefix length is then 32 − 8 = 24. The addresses are
Solution
• Group 2
For this group, each customer needs 128 addresses. This
means that 7 (log2 128) bits are needed to define each host.
The prefix length is then 32 − 7 = 25. The addresses are
Solution
• Group 3
For this group, each customer needs 64 addresses. This means
that 6 (log264) bits are needed to each host. The prefix length
is then 32 − 6 = 26. The addresses are

Number of granted addresses to the ISP: 65,536


Number of allocated addresses by the ISP: 40,960
Number of available addresses: 24,576
Solution
Example
Solution
The company will have three subnets, one at Central, one at
East, and one at West. The following lists the subblocks
allocated for each network:

a. The Central office uses the network address


70.12.100.128/27. This is the first address, and the mask
/27 shows that there are 32 addresses in this network.
Note that three of these addresses are used for the
routers and the company has reserved the last address
in the sub-block. The addresses in this subnet are
70.12.100.128/27 to 70.12.100.159/27. Note that the
interface of the router that connects the Central subnet
to the WAN needs no address because it is a point-to-
point connection.
Solution

b. The West office uses the network address


70.12.100.160/28. The mask /28 shows that there are
only 16 addresses in this network. Note that one of
these addresses is used for the router and the company
has reserved the last address in the sub-block. The
addresses in this subnet are 70.12.100.160/28 to
70.12.100.175/28. Note also that the interface of the
router that connects the West subnet to the WAN needs
no address because it is a point-to- point connection.
Solution

c. The East office uses the network address


70.12.100.176/28. The mask /28 shows that there are
only 16 addresses in this network. Note that one of
these addresses is used for the router and the company
has reserved the last address in the sub-block. The
addresses in. this subnet are 70.12.100.176/28 to
70.12.100.191/28. Note also that the interface of the
router that connects the East subnet to the WAN needs
no address because it is a point-to-point connection.
Exercise
• Given the network address 192.168.0.0 find:
• The class
• The block
• The range of addresses
Exercise
• In fixed-length subnetting, find the number of
1’s that must be added to the mask if the
number of desired subnets is
• 2
• 64
• 8
• 128
Exercise
• An organization is granted an address block
211.7.180.0/24. The administrator wants to
create 32 subnets. What is the subnet prefix
length?
Exercise
• A company is granted the site address
201.70.64.0. The company needs six subnets.
Design the subnets.
Exercise
• A company is granted the site address
201.70.64.0/25. The company needs 8
subnets. Design the subnets.
Exercise
• A small company is granted a block of addresses
with the beginning address 10.14.5.0/25. The
administrator wants to use the classless
addressing scheme to design the company’s
network having 7 subnets as the following:
• Two subnets, Subnet 1 and Subnet 2, each with 32
addresses
• Three subnets, Subnet 3 to Subnet 5, each with 16
addresses
• Two subnets, Subnet 6 and Subnet 7, each with 8
addresses
Exercise
• XYZ Co. is granted the site address
202.10.10.0/24. The company has two
departments that consist of 32 employees, the
third department has 63 employees while the
rest of the employees belong to the fourth
department. Design the company’s network.
Subnet Mask Table
Supernetting
Example
A company that operates 150 accounting services in each of 50 districts has a router in
each office connected with a frame relay link to its corporate headquarters. Without
supernetting, the routing table on any given router might have to account for 150
routers in each of the 50 districts, or 7500 different networks. However, if a
hierarchical addressing system is implemented with supernetting, then each district
has a centralized site as interconnection point. Each route is summarized before being
advertised to other districts. Each router now only recognizes its own subnet and the
other 49 summarized routes.
The determination of the summary route on a router involves the recognition of the
number of highest-order bits that match all addresses. The summary route is
calculated as follows. A router has the following networks in its routing table:

192.168.98.0
192.168.99.0
192.168.100.0
192.168.101.0
192.168.102.0
192.168.105.0
Example
Address First Octet Second Octet Third Octet Fourth Octet
192.168.98.0 11000000 10101000 01100010 00000000
192.168.99.0 11000000 10101000 01100011 00000000
192.168.100.0 11000000 10101000 01100100 00000000
192.168.101.0 11000000 10101000 01100101 00000000
192.168.102.0 11000000 10101000 01100110 00000000
192.168.105.0 11000000 10101000 01101001 00000000

The summarized route is 192.168.96.0/20. The subnet mask is 255.255.240.0.


Supernetting
IPv6
• Despite all short-term solutions, address
depletion is still a long-term problem for the
Internet. This and other problems in the IP
protocol itself have been the motivation for
IPv6
An IPv6 address is 128 bits long.
IPv6 Notation
Expand the address 0:15::1:12:1213 to its original
format

Solution
We first need to align the left side of the double colon
to the left of the original pattern and the right side of
the double colon to the right of the original pattern to
find how many 0s we need to replace the double colon.

This means that the original address is


CIDR
Address Structure
Address Space
The address space of IPv6 is 2128

• IPv6 is divided into several categories


• A few leftmost bits, called the type prefix, in
each address define its category
Address Space
Global Unicast Address
• This block in the address space that is used for
one-to-one communication
• The CIDR notation for the block is 2000::/3 
three leftmost bits are the same for all
addresses in this block (001)
• The size of this block is 2125
• An address in this block is divided into three
parts: global routing prefix, subnet identifier
and interface identifier
Global Unicast Address
n bits 128 – n – m bits m bits
Global routing prefix Subnet identifier Interface identifier

Block Assignment Length


Global routing prefix (n) 48
Subnet identifier (128 – n – m) 16
Interface identifier (m) 64
Global Unicast Address
8 bits 56 bits
0
EUI-64
8 bits 56 bits
1
Interface Identifier

8 bits 40 bits
0
Ethernet MAC address
8 bits 56 bits
1 11111111 11111110

Interface Identifier
Find the interface identifier if the Ethernet physical
address is (F5-A9023-14-7A-D2)16

Solution
We only need to change the seventh bit of the first
octet from 0 to 1, insert two octet FFFE16 and change
the format to colon hex notation. The result is
F7A9:23FF:FE14:7AD2
Multicast Address

• Multicast addresses are used to define a


group of hosts
• A packet sent to a multicast address must be
delivered to each member of the group
Anycast Address

• Anycast address defines a group of nodes


• A packet destined for an anycast address is
delivered to only one of the members of the
anycast group, the nearest one
Reserved Address

• Start with eight 0s


Reserved Address
• Unspecified address is used when a host does not
know its own address and sends an inquiry to find its
address
• Loopback address is used by host to test itself when
going into the network
• Compatible address is used when a computer using
IPv6 wants to send a message to another computer
using IPv6 but the message needs to pass through a
part of the network that still operates in IPv4
• Mapped address is used during transition when a
computer has migrated to IPv6 and wants to send a
packet to a computer still using IPv4
Local Address
• Local addresses are used when an
organization wants to use IPv6 protocol
without being connected to the global
Internet
• Link local address – used in an isolated subnet
• Site local address – used in an isolated site with
several subnets
IPv6 Datagram
IPv6 Datagram
IPv6 Datagram
• PRI/traffic class – 8-bit field used to
distinguish different payloads with different
delivery requirements
• Flow label – 20-bit field designed to provide
special handling for a particular flow of data
• Payload length – 2-byte field defines the
length of the IP datagram excluding the base
header
• Next header – 8-bit field defining the header
that follows the base header
IPv6 Datagram
IPv6 Datagram
• Hop limit – 8-bit field serves the same
purpose as TTL in IPv4
IPv6 Advantages
• Among its advantages
• Larger address space – 128 bits long
• Better header format – options are separated
from the base header and inserted when needed
• New options – allows for additional functionalities
• Allowance for extension – as required for new
technologies
• Support for resource allocation – for real time
applications
• Support for more security – encryption and
authentication options
IPv6 vs IPv4
IPv6 Datagram
Transition Strategies

Strategies

Header
Dual Stack Tunneling
Translation
Dual Stack
• Dual-Stack devices – ones that maintain both
IPv4 and IPv6 protocols.
• Enables networks to support both IPv4 and
IPv6 services and applications during the
transition period
• An IPv4 address must be assigned for every
dual-stack machine
Dual Stack
Dual Stack
Tunneling
• Tunneling mechanisms allow interconnection of
separate IPv6 networks over IPv4 based services.
• As amount of IPv6 networks increase, tunneling
IPv4 over IPv6 will be needed.
• Example tunneling mechanism:
• IPv6 Manually Configured Tunnel
• IPv6 over IPv4 GRE Tunnel
• Automatic IPv4-Compatible Tunnel
• Automatic 6to4 Tunnel
• ISATAP Tunnel
• Teredo Tunnel
Header Translation
Header Translation
Header Translation
• If there is no common protocol between peers, i.e.
one device is IPv4-only and other is IPv6-only device,
header translation is used to provide connection
between these peers.
FIN

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy