The words you are searching are inside this book. To get more targeted content, please make full-text search by clicking here.
Discover the best professional documents and content resources in AnyFlip Document Base.
Search
Published by zamzilah05, 2021-12-23 20:33:40

IP Addressing and Subnetting

IP Addressing and Subnetting

Keywords: networking

IP ADDRESSING &
SUBNETTING

TS. SAW BEE FONG
ROOSZANA BINTI A. RAHMAN
MOHD ASYRAF BIN MOHD ARSHAD

JABATAN TEKNOLOGI MAKLUMAT
DAN KOMUNIKASI
POLITEKNIK SEBERANG PERAI

IP ADDRESSING
AND SUBNETTING

Ts. SAW BEE FONG
ROOSZANA BINTI A. RAHMAN
MOHD ASYRAF BIN MOHD ARSHAD

2021
JABATAN TEKNOLOGI MAKLUMAT DAN KOMUNIKASI

©All rights reserved. No part of this publication may be translated or reproduced in
any retrieval system, or transmitted in any form or by any means, electronic,
mechanical, recording, or otherwise, without prior permission in writing from
Politeknik Seberang Perai.



All rights reserved

No part of this publication may be translated or reproduced in any retrieval system,
or transmitted in any form or by any means, electronic, mechanical, recording, or

otherwise, without prior permission in writing from Politeknik Seberang Perai.

eISBN 978-967-0783-76-5

Published by

Politeknik Seberang Perai
Jalan Permatang Pauh, 13500 Permatang Pauh

Pulau Pinang

Tel : 04-538 3322 Fax : 04-538 9266
Email : [email protected] Website : www.psp.edu.my
FB : politeknikseberangperai Ig : politeknikseberangperai

Perpustakaan Negara Malaysia Cataloguing-in-Publication Data

Saw, Bee Fong, Ts. 1980-
IP ADDRESSING AND SUBNETTING / Ts. SAW BEE FONG, ROOSZANA BINTI
ABDUL RAHMAN, MOHD ASYRAF BIN MOHD ARSHAD.
Mode of access: Internet
eISBN 978-967-0783-76-5
1. Computer network protocols.
2. TCP/IP (Computer network protocol).
3. Government publications--Malaysia.
4. Electronic books.
I. Rooszana Abdul Rahman. II. Mohd Asyraf Mohd Arshad.
III. Title.
004.62

Acknowledgement

Anyone who has ever had anything to do with the publishing industry knows
that it takes many, many people to create a book. It may be authors name on
the cover, but there is no way that can take credit for all that occurred to get
this book from idea to publication. Therefore, authors must thank:
The team at JTMK, PSP-once again, you amaze us with your professionalism and
ability to make us look good. To our author’s team, thank you for your
continuous support and belief in this little pocketbook.
To our technical reviewers, thank you for keeping us on track and make sure that
what authors wrote is well written and delivered.

Ts. SAW BEE FONG
ROOSZANA BINTI A. RAHMAN
MOHD ASYRAF BIN MOHD ARSHAD

Preface

This eBook was developed to assist students and lecturers in understanding IP
Addressing and subnetting for IPv4 and IPv6. The main focus of this ebook is for
students taking the Introduction to Network course and to those who want to learn IP
Addressing and subnetting. There are also some handy hints and tips along the way
to hopefully make life a bit easier for you in this endeavor. It is easy enough that you
will find it to carry around with you in any mobile devices.

Table of Content Pages

Chapter 2
5
IPv4 Addressing and Subnetting 8
9
Network and Host Portion 10
The Subnet Mask 13
The Prefix Length 15
IPv4 Unicast, Broadcast and Multicast 16
Public and Private IPv4 Addresses 18
Network Segmentation 28
Subnet an IPv4 Network
Subnet a Slash 16 and a Slash 8 Prefix 33
Subnet to Meet Requirements 35
Variable Length Subnet Mask (VLSM) 37
44
IPv6 Addressing and Subnetting 46

Introduction to IPv6
IPv6 Terminology
Abbreviating and Expanding IPv6 Addresses
Address Type Identification
Subnetting IPv6

1 eBook PSP | IP Addressing & Subnetting

MERGEF
ORMAT

2

IPv4 Addressing and Subnetting

eBook PSP | IP Addressing & Subnetting 2

IPv4 address structure

Network and Host Portion

IPv4 address consists of 32 bits of binary numbers. The 32 bits are divided into network
portion and host portion.

Table 1.1 Example of Network and Host Portion

IPv4 address: 192 168 1 10
00000001 00001010
11000000 10101000
255 0
Subnet mask 255 255 11111111 00000000
Host portion
11111111 11111111

Network portion

The IP address 192.168.1.10 in Table 1.1 is converted to binary numbers, and the orange line
separates the network and host portion. Network portion and host portion are identified
using subnet mask. The subnet mask for the example above is 255.255.255.0.

Note

Bits for network portion is the same for all devices in the same network, while bits for
host portion must be unique for each host in the same network.

Tutorial / Exercise Binary to Decimal Conversion

128 64 32 16 8 4 2 1 Answers Scratch Area
00 0 0 1 1 1 1 15
10 0 1 0 0 0 1 8
11 1 1 1 1 1 1 4
11 1 0 0 1 1 0 2
00 1 1 1 0 1 1 +1
11 0 0 0 1 0 1 15
10 1 0 1 0 1 0
00 1 0 0 0 0 1
11 0 0 0 0 0 0
01 1 0 1 1 1 1

3 eBook PSP | IP Addressing & Subnetting

MERGEF Tutorial / Exercise Decimal to Binary Conversion
ORMAT

2

128 64 32 16 8 4 2 1 = 255 Scratch Area
1 1 1 1 1 0 1 0 250
250
114 -128
119 122
200 -64
172
2 58
246 -32
120 26
50 -16
179 10
-8

2
-2
0

Tutorial / Exercise Network and Host Identification

Circle the network portion of these Circle the host portion of these
addresses: addresses:

117.88.65.47 198.125.98.187
217.31.73.9 17.87.23.45
33.0.1.67 10.87.25.67
148.34.65.78 218.188.87.90
220.201.34.87 171.87.23.64
150.20.30.40 123.78.94.34
119.90.80.12 191.222.156.74
126.23.78.43 100.66.77.88
193.222.67.34 195.78.123.144
158.98.24.56 171.2.78.123

eBook PSP | IP Addressing & Subnetting 4

Tutorial / Exercise Network Addresses

Using the IP address and subnet mask shown write out the network address:

192.145.224.178 192.145.224.0
255.255.255.0

10.20.30.40
255.0.0.0

223.77.240.245
255.255.0.0

150.220.21.45
255.255.0.0

28.45.223.90
255.255.0.0

199.30.160.45
255.255.255.0

Tutorial / Exercise Host Addresses

Using the IP address and subnet mask shown write out the host address:

222.50.60.70 0.0.0.70
255.255.255.0

117.34.76.128
255.0.0.0

48.90.24.123
255.255.0.0

200.123.113.13
255.255.255.0

188.20.28.2
255.255.0.0

10.30.50.70
255.255.255.0

5 eBook PSP | IP Addressing & Subnetting

MERGEF
ORMAT

2 The Subnet Mask

Subnet mask is used to identify network and host portion of IPv4 address. It is also used to
identify the network address of a device. Subnet mask is compared to an IPv4 address from
left to right, in order to identify the network and host portion. This process is called ANDing.

Note

Logical AND or ANDing is the comparison of bit I and 0 that will produce the following
results:

1 AND 1 = 1
0 AND 1 = 0
0 AND 0 = 0
1 AND 0 = 0

Table 1.2 ANDing process 11000000 10101000 00000001 00001010
IPv4 address: 192.168.1.10 11111111 11111111 11111111 00000000
11000000 10101000 00000001 00000000
AND Subnet mask: 255.255.255.0
Network address: 192.168.1.0

The ANDing process shown in the red rectangle compares bit 1 from IP address to bit 1 from
subnet mask. As the result of comparing 1 AND 1 is 1, hence the first bit for network address
is 1. The process is completed until all bits are compared and converted back to decimal to
get the network address.

Based on Table 1.2, the network address for 192.168.1.10 can be identified as 192.168.1.0

Tutorial / Exercise Default Subnet Masks

Write the correct default subnet mask for each of the following addresses:

119.19.46.2 255.0.0.0

223.219.200.123

77.223.209.90

128.222.212.250

220.88.223.65

126.111.222.45

192.134.167.190

2.2.234.222

189.22.44.66

96.89.78.10

eBook PSP | IP Addressing & Subnetting 6

Example Custom Subnet Masks

Number of needed subnets 6
Number of needed usable hosts 30
212.108.156.0
Network Address
Address class C
255.255.255.0
Default subnet mask 255.255.255.224
Customer subnet mask
Total number of subnets 8
Total number of host addresses 32
Number of usable addresses 30
Number of bits borrowed 3

Show your work in the space below. Example:

7 eBook PSP | IP Addressing & Subnetting

MERGEF
ORMAT

2

Tutorial / Exercise Custom Subnet Masks

a. Problem 1 126
Number of needed subnets 131,070
115.0.0.0
Number of needed usable hosts
Network Address
Address class

Default subnet mask
Customer subnet mask
Total number of subnets
Total number of host addresses
Number of usable addresses
Number of bits borrowed

b. Problem 2 60
Number of needed subnets 1,000
133.99.0.0
Number of needed usable hosts
Network Address
Address class

Default subnet mask
Customer subnet mask
Total number of subnets
Total number of host addresses
Number of usable addresses
Number of bits borrowed

eBook PSP | IP Addressing & Subnetting 8

c. Problem 3 25
Number of needed subnets 209.125.88.0
Network Address
Address class
Default subnet mask
Customer subnet mask
Total number of subnets

Total number of host addresses
Number of usable addresses
Number of bits borrowed

d. Problem 4 10
Number of needed subnets 169.21.0.0
Network Address
Address class
Default subnet mask
Customer subnet mask
Total number of subnets

Total number of host addresses
Number of usable addresses
Number of bits borrowed

The Prefix Length

Prefix length is another method used to identify subnet mask. It is written in slash notation
(/) followed by the total number of bit 1 as shown in Table 1.3.

Table 1.3 Subnet mask in Prefix length format

Subnet mask Binary format Prefix
/24
255.255.255.0 11111111 11111111 11111111 00000000

The total number of bit 1 is 24 and written in prefix as /24

9 eBook PSP | IP Addressing & Subnetting

MERGEF
ORMAT

2 IPv4 Unicast, Broadcast and Multicast

Unicast

Unicast is when one device sends a message to another one device as shown in Figure 1.1. It
involves a one to one communication, meaning only one recipient will receive the message.
Unicast address range is from 1.1.1.1 to 223.255.255.255.

Unicast Multicast

Broadcast

Figure 1.1 Unicast, Broadcast and Multicast Transmission

Broadcast

Broadcast is when a device sends a message to all devices in the same network. It involves a
one to all communication and is used in IPv4. Broadcast can be categorized into 2 types which
are:

a. Directed broadcast – when a device sends a message to all hosts in a specific
network eg. A host with address 192.168.1.10/24 sends a broadcast message to
192.168.1.255

b. Limited broadcast – when a device sends a message to 255.255.255.255

Unicast

Multicast is when one device sends a message to a group of selected hosts that subscribe to
a multicast group. Each multicast group will have its own multicast address. Hosts from this
group will receive messages send to the multicast address and messages send to its own
unique unicast address. These group of hosts is also called multicast client. Multicast address
range is from 224.0.0.0 to 239.255.255.255.

eBook PSP | IP Addressing & Subnetting 10

Types of IPv4 Addresses

Public and Private IPv4 Addresses

Public address are addresses that are globally routed within internet service provider eg, IP
address that is assigned to a router by ISP. Range for public address is any address that starts
with 1 to 191 in the first octet excluding the private address.

Private address are addresses used by organizations for internal hosts. Range for private
address is shown in Table 1.4.

Table 1.4 Private Address range Network Address Prefix
IP Address Range 10.0.0.0 /8
12.16.0.0 /12
10.0.0.0 – 10.255.255.255 /16
172.16.0.0 – 172.31.255.255 192.168.0.0
192.168.0.0 – 192.168.255.255

Hosts that reside in an internal network will have a private address. This address is used only
to send messages in the internal network. When these hosts send message or packets outside
of the network, the private address will be translated to a public address before being
forwarded to the destination.

Note

Network Address Translation (NAT) is used to translate between private and public
address. It is performed only on the router that connects the internal network to the
ISP.

Special Use IPv4 Addresses

Network address and Broadcast address are addresses that cannot be assigned to hosts.
While the following 2 types of addresses can be assigned to hosts but with certain restrictions:

a. Loopback address - is an address for a host to send traffic to itself eg to test TCP/IP
configuration. Loopback addresses include 127.0.0.0/8 or 127.0.0.1 to
127.255.255.254

b. Link local address – also known as Automatic Private IP Addressing (APIPA)
addresses. It is used by Windows DHCP client to configure itself in case there are no
DHCP server available. Link local addresses include 169.254.0.0/16 or 169.254.0.1 to
169.254.255.254.

11 eBook PSP | IP Addressing & Subnetting

MERGEF
ORMAT

2 Legacy Classful Addressing

In 1981, IPv4 addresses were allocated based on Table 1.5 as defined in the RFC790.

Table 1.5 IP Classes

Class Address range Subnet mask Total network Total
hosts/net
A 0.0.0.0 – 127.0.0.0 255.0.0.0 128 16 777 214
B 128.0.0.0 – 191.255.0.0 255.255.0.0 16 384
C 192.0.0.0 – 235.255.255.0 255.255.255.0 2 097 152 65 534

254

Classful addressing was very useful in allocating addresses until the World Wide Web was
introduced in mid 90s. The increased number of computers using internet, has caused
Classful addressing to be non-effective and led to the use of classless addressing.

Tutorial / Exercise Address Class Identification

Address Class
192.16.3.0 C
230.223.46.58
117.91.58.43
158.99.81.2
126.18.166.0
95.4.95.94
219.232.58.9
249.239.229.45
148.18.17.92
199.177.188.0

eBook PSP | IP Addressing & Subnetting 12

Assignment of IPv4 Addresses

IPv4 and IPv6 addresses are managed by Internet Assigned Numbers Authority (IANA). IANA
allocates addresses to Regional Internet Registry (RIR) that will later further allocates the
addresses to Internet Service Provider (ISP). ISP will provide IPv4 address blocks to
organization and smaller ISP.

Table 1.6 RIR based on Region Description
Logo

America Registry for Internet Numbers for North America
region

 Réseaux IP Européens Network Coordination Centre) - Europe,
the Middle East, and Central Asia

(Regional Latin-American and Caribbean IP Address Registry) -
Latin America and some Caribbean Islands

African Network Information Centre for Africa region
Asia Pacific Network Information Centre for Asia/Pacific region

13 eBook PSP | IP Addressing & Subnetting

MERGEF
ORMAT

2 Network Segmentation

Broadcast Domain and Segmentation

Switch forward broadcasts messages out to all interfaces except the interface which receives
the message. Broadcast are being forwarded within a specified broadcast domain only.
Router interface connects to a broadcast domain but it does not forward broadcast messages.

S R1
W

Broadcast PC Broadcast
domain LAN A 1 domain LAN B

Figure 1.2 Broadcast Domain

Figure 1.2, shows the broadcast domain for LAN A and B. When PC1 sends a broadcast
message, only devices in the same domain as PC1 will receive the message. Even though the
message was sent out to R1, it will not be forwarded to LAN B.

Problems with Large Broadcast Domains

Hosts in a large broadcast domain can generate excessive broadcast messages that may affect
network performance. The network size need to be reduced to create smaller broadcast
domain. This can be done by using subnetting.

R1

LAN A: 300
users
Figure 1.3 Large Broadcast Domain

eBook PSP | IP Addressing & Subnetting 14

Figure 1.3 shows a domain with 300 users, broadcast message sent to all 300 users may cause
high traffic and affect network performance. To solve this problem, the size of the network
needs to be reduced to create smaller sized domain. This can be done by performing
subnetting.

LAN C: 100
users

LAN A: 100 R1 LAN B: 100
users users

Figure 1.4 Smaller Broadcast Domain
Smaller broadcast domain in Figure 1.4 helps improves network performance, reduce
network traffic and enable administrator to implements security policies.

Note

Subnetting can be performed based on location, group or function and device type.

15 eBook PSP | IP Addressing & Subnetting

MERGEF
ORMAT

2 Subnet an IPv4 Network

Subnet on an Octet Boundary

Subnet mask may borrow bits from network portion to create subnets. When more host bits
are borrowed, more subnets will be created but less hosts will be assigned for each subnet.
It is easier to subnet a network at the octet boundary of /8, /16 and /24 because each octet
boundary will provide a fix number of hosts.

Formula

Subnetting formula:

n=network bits, h=host bits
Number of subnets = 2n
Number of hosts = 2h
Number of usable hosts = 2h- 2

Example

For a network with /8, the host portion is as follow:
11111111 00000000 00000000 00000000
h=24

Number of usable hosts = 2h - 2 = 224 - 2 = 16 777 214

Based on the example, there will be 1677214 hosts in a subnet. This will create a large
broadcast domain that affect network performance.

Table 1.7 Subnet on Octet Boundary

Prefix length Subnet mask in binary No. of hosts
16 777 214
/8 11111111 00000000 00000000 00000000
65 534
/16 11111111 11111111 00000000 00000000 254

/24 11111111 11111111 11111111 00000000

/8 network can be further subnetted on the octet boundary of /6 or /24 that will
provide less number of hosts per subnet or in other words, a smaller broadcast
domain.

eBook PSP | IP Addressing & Subnetting 16

Subnet within an Octet Boundary

Subnets can be created by borrowing bits from any host bit position. For example, Table 1.8
displays the subnetting of a /24 network by borrowing more host bits to get a longer prefix.

Table 1.8 Subnet within Octet Boundary

Prefix Subnet mask in binary No. of No. of
hosts subnets
length
2 126
/25 11111111 11111111 11111111 10000000 4 62
8 30
/26 11111111 11111111 11111111 11000000 16 14
32 6
/27 11111111 11111111 11111111 11100000 64 2

/28 11111111 11111111 11111111 11110000

/29 11111111 11111111 11111111 11111000

/30 11111111 11111111 11111111 11111100

Subnet a Slash 16 and a Slash 8 Prefix

Create Subnets with a Slash 16 Prefix

A /16 network address will provide a larger size of subnets as there are more host bits to
borrow.

Table 1.9 Subnet with /16 prefix

Prefix Subnet mask in binary No. of No. of
hosts subnets
length

/16 11111111 11111111 00000000 00000000

/17 11111111 11111111 10000000 00000000 32766 2
/18 11111111 11111111 11000000 00000000 16382 4
/19 11111111 11111111 11100000 00000000 8190 8
/20 11111111 11111111 11110000 00000000 4094 16
/21 11111111 11111111 11111000 00000000 2046 32
/22 11111111 11111111 11111100 00000000 1022 64
/23 11111111 11111111 11111110 00000000 128
/24 11111111 11111111 11111111 00000000 510 256
/25 11111111 11111111 11111111 10000000 254 512
/26 11111111 11111111 11111111 11000000 126 1024
/27 11111111 11111111 11111111 11100000 62 2048
/28 11111111 11111111 11111111 11110000 30 4096
/29 11111111 11111111 11111111 11111000 14 8192
/30 11111111 11111111 11111111 11111100 6 1634
2

17 eBook PSP | IP Addressing & Subnetting

MERGEF
ORMAT

2 Create 50 Subnets with a Slash 16 Prefix

Example

A company requires 50 subnets and has chosen 172.31.0.0/16 as the network address.
Identify the network address, subnet mask, IP range and broadcast address for the
first subnet.

To answer this question, first identify the network and host portion (Table 1.10).

Table 1.10 Identify network and host portion

172 31 0 0

nnnnnnnn nnnnnnnn hhhhhhhh hhhhhhhh

Network portion Host portion

Next, borrow host bits starting from the left part of the 3rd octet until the number of
bits are enough to create the required subnets. 6 bits are borrowed from host to
create 64 subnets, and the remaining host bits left is 10(Table 1.11). This will create
210 – 2 = 1022 usable hosts per subnet.

Table 1.11 Bits borrowed from host portion 31 0 0
nnnnnnnn hhhhhhhh hhhhhhhh
172 nnnnnnnn nhhhhhhh hhhhhhhh
nnnnnnnn nnhhhhhh hhhhhhhh
nnnnnnnn nnnnnnnn nnnhhhhh hhhhhhhh
Bits borrowed =1, 2n =21 = 2 nnnnnnnn nnnnnnnn nnnnhhhh hhhhhhhh
Bits borrowed =2, 2n =22 = 4 nnnnnnnn nnnnnnnn nnnnnhhh hhhhhhhh
Bits borrowed =3, 2n =23 = 8 nnnnnnnn nnnnnnnn nnnnnnhh hhhhhhhh
Bits borrowed =4, 2n =24 = 16 nnnnnnnn
Bits borrowed =5, 2n =25 = 32 nnnnnnnn
Bits borrowed =6, 2n =26 = 64 nnnnnnnn

Since bits are borrowed from host portion, the subnet mask will also change
accordingly. The new subnet mask is 255.255.252.0 or /22 because the 3rd octet is
11111100 and the 4th octet is 00000000 in binary as shown in Table 1.12.

Table 1.12 New subnet mask 000000 00 00000000
172 31 111111 00 00000000
255 255

eBook PSP | IP Addressing & Subnetting 18

Subnets created will be in the range of 172.31.0.0 /22 to 172.31.252.0 /22. The following is
the details for the first subnet (Figure 1.7).

172 31 000000 00 00000000 Network address : 172.31.0.0 /22

172 31 000000 00 00000001 First IP address : 172.31.0.1 /22

172 31 000000 11 11111110 Last IP address : 172.31.3.254 /22

172 31 000000 11 11111111 Broadcast address : 172.31.3.255 /22
Figure 1.7 First subnet details

The steps taken to answer this question can also be used to subnet other prefix.

Subnet to Meet Requirements

Subnet Private versus Public IPv4 Address Space

Public and private IPv4 addresses can be used to segment an organization network into
subnets. Public address can be used to segment the DMZ part of the network while private
address can be used to segment the intranet part of the network.

Minimize Unused Host IPv4 Addresses and Maximize Subnets

Network administrator must consider these 2 factors when performing subnets to develop a
good network:

a. The number of hosts for each network
b. The number of subnets needed

Based on Table 1.13, the more subnets created, the lesser number of hosts will be available
and the more hosts assigned for subnet the less number of subnets can be created.

19 eBook PSP | IP Addressing & Subnetting

MERGEF Note
ORMAT
The allocation of hosts and subnets must be well planned to minimize unused hosts
2 and maximize subnet.

Table 1.13 Number of subnet vs number of hosts

Prefix Subnet mask in binary No. of hosts No. of
length subnets
11111111 11111111 00000000 00000000 32766
/16 11111111 11111111 10000000 00000000 16382 2
/17 11111111 11111111 11000000 00000000 8190 4
/18 11111111 11111111 11100000 00000000 4094 8
/19 11111111 11111111 11110000 00000000 2046 16
/20 11111111 11111111 11111000 00000000 1022 32
/21 11111111 11111111 11111100 00000000 64
/22 11111111 11111111 11111110 00000000 510 128
/23 11111111 11111111 11111111 00000000 254 256
/24 11111111 11111111 11111111 10000000 126 512
/25 11111111 11111111 11111111 11000000 62 1024
/26 11111111 11111111 11111111 11100000 30 2048
/27 11111111 11111111 11111111 11110000 14 4096
/28 11111111 11111111 11111111 11111000 6 8192
/29 11111111 11111111 11111111 11111100 2 1634
/30

eBook PSP | IP Addressing & Subnetting 20

Example

Number of needed subnets 2
Network Address 193.203.50.0
Address class
C
Default subnet mask 255.255.255.0
Customer subnet mask 255.255.255.192
Total number of subnets
Total number of host addresses 4
Number of usable addresses 62
Number of bits borrowed 64
2

What is the 3rd subnet range?

193.203.50.128 – 193.203.50.191

What is the subnet number for 2nd 193.203.50.64
subnet?
193.203.50.63
What is the subnet broadcast address 193.203.50.129 – 193.203.50.190
for the 1st subnet?

What are the assignable addresses for
3rd subnet?

Show your work in the space below. Example:

Number 256 128 64 32 16 8 4 2

of Hosts -

Number 2 4 8 16 32 64 128 256

of Subnets

-

Binary 128 64 32 16 8 4 2 1

values -

193.203.50. 0 0 0 0 0 0 0 0

(0) 0 0 193.203.50.0 to 193.203.50.63

(1) 0 1 193.203.50.64 to 193.203.50.127

(2) 1 0 193.203.50.128 to 193.203.50.191

(3) 1 1 193.203.50.192 to 193.203.50.255

21 eBook PSP | IP Addressing & Subnetting

MERGEF Tutorial / Exercise Subnetting
ORMAT

2

a. Problem 1 750
Number of needed subnets 195.25.0.0
Network Address
Address class
Default subnet mask
Customer subnet mask
Total number of subnets

Total number of host addresses
Number of usable addresses
Number of bits borrowed

What is the 15th subnet range?
What is the subnet number for 13th

subnet?
What is the subnet broadcast address

for the 10th subnet?
What are the assignable addresses for

6th subnet?

eBook PSP | IP Addressing & Subnetting 22

b. Problem 2 6
Number of needed subnets 123.0.0.0
Network Address
Address class
Default subnet mask
Customer subnet mask
Total number of subnets

Total number of host addresses
Number of usable addresses
Number of bits borrowed

What is the 15th subnet range?
What is the subnet number for 13th

subnet?
What is the subnet broadcast address

for the 10th subnet?
What are the assignable addresses for

6th subnet?

23 eBook PSP | IP Addressing & Subnetting

MERGEF c. Problem 3
ORMAT Based on the information in the graphic shown, design a network addressing schema that
will supply the minimum number of subnets, and allow enough extra subnets and hosts
2 for 100% growth in both areas. Circle each subnet on the graphic and answer the
questions below.

Figure 1.5 Problem 3

Address class
Customer subnet mask
Minimum number of subnets needed
Extra subnets required for 100% growth

(Round up to next whole number)

Total number of subnets needed
Number of host addresses
in the largest subnet group

Number of addresses needed for 100%
growth in the largest subnet.

(Round up to next whole number)

Total number of address
needed for the largest subnet

eBook PSP | IP Addressing & Subnetting 24

Start with the first subnet and arrange your sub-networks from the largest group to the
smallest.

IP address range for Science

IP address range for English

IP address range for Tech Ed Lab

IP address range for Router A to

Router B serial connection

d. Problem 4

Based on the information in the graphic shown, design a network addressing schema that
will supply the minimum number of subnets, and allow enough extra subnets and hosts
for 85% growth in all areas. Circle each subnet on the graphic and answer the questions
below.

Figure 1.6 Problem 4

25 eBook PSP | IP Addressing & Subnetting

MERGEF Address class
ORMAT Customer subnet mask
Minimum number of subnets needed
2 Extra subnets required for 85% growth

(Round up to next whole number)

Total number of subnets needed
Number of host addresses
in the largest subnet group

Number of addresses needed for 100%
growth in the largest subnet.

(Round up to next whole number)

Total number of address
needed for the largest subnet

Start with the first subnet and arrange your sub-networks from the largest group to the
smallest.

IP address range for Router A F0/1

IP address range for Management

IP address range for Router A to

Router B serial Connection

eBook PSP | IP Addressing & Subnetting 26

e. Problem 5

Based on the information in the graphic shown, design a network addressing schema that
will supply the minimum number of subnets, and allow enough extra subnets and hosts
for 70% growth in both areas. Circle each subnet on the graphic and answer the
questions below.

Figure 1.7 Problem 5
Address class
Customer subnet mask
Minimum number of subnets needed
Extra subnets required for 100% growth

(Round up to next whole number)

Total number of subnets needed
Number of host addresses
in the largest subnet group

Number of addresses needed for 100%
growth in the largest subnet.

(Round up to next whole number)

Total number of address
needed for the largest subnet

27 eBook PSP | IP Addressing & Subnetting

MERGEF Start with the first subnet and arrange your sub-networks from the largest group to the
ORMAT smallest.

2 IP address range for Kelantan
IP address range for Selangor

IP address range for Johor
IP address range for Router A to

Router B
IP address range for Router A to

Router C

eBook PSP | IP Addressing & Subnetting 28

Variable Length Subnet Mask (VLSM)

A standard subnetting scheme will create subnets that each will have the same amount of
hosts. Unfortunately, some of these subnets may not need this many hosts which will lead
to unused IPv4 addresses. Variable Length Subnet Mask (VLSM) was developed to minimize
unused IPv4 addresses.

Basic of VLSM

Using VLSM, each subnet created, does not necessarily have the same number of hosts as
long as its range of IP addresses do not overlap with each other. In VLSM, subnetting is
performed starting with the largest (more number of hosts) to smallest subnet (less number
of hosts).

Example

Given 192.168.0.0/24, create subnets based on information in Figure 1.8.

2 hosts R2
R1

Figure 1.8

By performing standard subnetting, 4 subnets will be created and each subnet will
have 62 usable hosts as shown in Table 1.14. 2 subnets can be used for LAN A and
LAN B while one subnet could be used for connection between R1 and R2.

Table 1.14 Standard subnetting result Host portion Dotted decimal
Network portion 00000000 192.168.0.0/24

11000000 10101000 00000000

0 11000000 10101000 00000000 00 000000 192.168.0.0/26 LAN A
1 11000000 10101000 00000000 01 000000 192.168.0.64/26 LAN B
2 11000000 10101000 00000000 10 000000 192.168.0.128/26
3 11000000 10101000 00000000 11 000000 192.168.0.192/26

However, since only 2 hosts are required for connection between R1 and R2, the
remaining 60 hosts will be wasted and unused. To avoid this unnecessary waste, VLSM
can be applied to create smaller subnets for connection between R1 and R2. For this
example, the last subnet which is 192.168.0.192/26 is chosen to be further subnetted
to provide smaller subnet for inter router connection.

29 eBook PSP | IP Addressing & Subnetting

MERGEF Table 1.14 Standard subnetting result
ORMAT Network portion

2 11000000 10101000 00000000

Host portion Dotted decimal
11000000 192.168.0.192/26

0 11000000 10101000 00000000 110000 00 192.168.0.192/30 R1 and R2
1 11000000 10101000 00000000 110001 00 192.168.0.196/30

2 11000000 10101000 00000000 110010 00 192.168.0.200/30

3 11000000 10101000 00000000 110011 00 192.168.0.204/30

.. . . .
.. . . .
.. . . .
15 11000000 10101000 00000000 111111 00 192.168.0.252/30

There are 6 host bits in 192.168.0.192/ 26 so, 2 host bits must be left in the host
portion while the other 4 bits can be borrowed as shown in Table 1.14. This will
change the prefix to /30. The smaller subnets created will have 2 hosts available and
is much more suitable to be assigned for inter router connection between R1 and R2
with no IP address waste. In this example, the first subnet is assigned to R1 and R2
connection.

The following is the network addresses and the address range for LAN A, LAN B and
R1-R2 connection.

Table 1.15 Address range for LAN A, LAN B and R1-R2 connection

Network address Address range

LAN A 192.168.0.0/26 192.168.0.1 – 192.168.0.62

LAN B 192.168.0.64/26 192.168.0.65 – 192.168.0.126

R1-R2 192.168.0.192/30 192.168.0.193 – 192.168.0.194

eBook PSP | IP Addressing & Subnetting 30

Tutorial / Exercise VLSM Addressing

a. Using the network diagram and information given create an addressing schema
which utilizes variable-length subnet masks. The company will be using the class C
address 219.20.160.0. Remember to start with your largest groups first.

Figure 1.9

b. Using the network diagram and information given create an addressing schema
which utilizes variable-length subnet masks. This company will be using the class C
address 223.130.80.0. Remember to start with your largest groups first.

Figure 1.10

31 eBook PSP | IP Addressing & Subnetting

MERGEF c. Using the network diagram and information given create an addressing schema
ORMAT which utilizes variable-length subnet masks. This company will be using the class C
address 193.146.44.0. Remember to start with your largest groups first.
2

Figure 1.11

d. You are setting up a small business network with the class C address
222.66.90.0/24. The marketing division will need 14 computers. Research and
development need 28 computers. The reception area will need two computers.
Management requires 20 computers. Divide the network using variable length
subnet masks. Complete the information required above. Remember to work from
largest to smallest.

e. A shipping company needs to set up its network across several locations. The
Penang office needs 8 computers. The Johor office needs 23 computers. The Perak
office will need 6 computers. The WAN links between all three locations need to be
included in the solution. Using the IP address 196.186.30.0/24 divide the network
using VLSM. Complete the information required above. Remember to work from
largest to smallest.

f. You are setting up a medium sized network with the class C address 211.26.21.0/24.
Marketing needs 28 computers. Administration needs 109 computers.
Bookkeeping will use 13 computers. The reception area will need four computers.
Management requires 59 computers. Divide the network using variable length
subnet masks. Complete the information required above. Remember to work from
largest to smallest.

eBook PSP | IP Addressing & Subnetting 32

Ipv6 Addressing and Subnetting

33 eBook PSP | IP Addressing & Subnetting

MERGEF
ORMAT

2 Internet Protocol version 6 (IPv6) Addressing

Introduction to IPv6

IPv6 is the next generation Internet Protocol (IP) address standard intended to supplement
and eventually replace IPv4, the protocol many Internet services still use today. The original
IP address scheme, called IPv4, is running out of addresses due to its widespread usage from
the proliferation of so many connected devices. IPv6 defines the same general functions as
IPv4, but with different methods of implementing those functions.

IPv6 features overview

IPv6 offers the following significant features:
 A larger address space, which is said to be sufficient for at least the next 30 years
 Globally unique and hierarchical addressing, based on prefixes rather than address
classes, to keep routing tables small and backbone routing efficient
 A mechanism for the auto-configuration of network interfaces
 Support for encapsulation of itself and other protocols
 A class of service that distinguishes types of data
 Improved multicast routing support (in preference to broadcasting)
 Built-in authentication and encryption
 Transition methods to migrate from IPv4

 Compatibility methods to coexist and communicate with IPv4

IPv6 versus IPv4

The table below shows some of the major differences between IPv4 and IPv6:

Table 2.1 Differences between IPv4 and IPv6

eBook PSP | IP Addressing & Subnetting 34

Quiz “Do you know it?”

1. Which of the following was a short-term solution to the IPv4 address exhaustion
problem?
a. IPv6
b. NAT
c. ARP
d. IPv5

2. A router receives an Ethernet frame that holds an IPv6 packet. The router then makes
a decision to route the packet out a serial link. Which of the following statements is
true about how a router forwards an IPv6 packet?
a. The router discards the Ethernet data-link header and trailer of the received
frame.
b. The router makes the forwarding decision based on the packet’s source IPv6
address.
c. The router keeps the Ethernet header, encapsulating the entire frame inside a
new IPv6 packet before sending it over the serial link.
d. The router uses the IPv4 routing table when choosing where to forward the
packet.

3. Which of the following is the shortest valid abbreviation for

FE80:0000:0000:0100:0000:0000:0000:0123?

a. FE80::100::123
b. FE8::1::123
c. FE80::100:0:0:0:123:4567
d. FE80:0:0:100::123

4. Which of the following is the unabbreviated version of IPv6 address
2001:DB8::200:28?

a. 2001:0DB8:0000:0000:0000:0000:0200:0028
b. 2001:0DB8::0200:0028
c. 2001:0DB8:0:0:0:0:0200:0028
d. 2001:0DB8:0000:0000:0000:0000:200:0028

5. Which of the following is the prefix for address
2000:0000:0000:0005:6000:0700:0080:0009, assuming a mask of /64?

a. 2000::5::/64
b. 2000::5:0:0:0:0/64
c. 2000:0:0:5::/64
d. 2000:0:0:5:0:0:0:0/64

35 eBook PSP | IP Addressing & Subnetting

MERGEF
ORMAT

2 IPv6 Terminology

There are several terminologies for IPv6. Terminology is used to define IPv6 concepts and
describe IPv6 features. The following is the terminology used for the IPv6 environment:

Table 2.2 Terminology and definition in IPv6

No Common Definition
Term

1 Node Any device that runs an implementation of IPv6. This includes routers
and hosts.

2 Router A node that can forward IPv6 packets not explicitly addressed to itself.

3 Host A node that cannot forward IPv6 packets not explicitly addressed to
4 Link itself (a non-router).
The set of network interfaces that are bounded by routers (or contains
no routers) and that use the same 64-bit IPv6 unicast address prefix.

5 Interface The representation of an attachment to a physical or logical link.

An identifier that can be used as the source or destination of IPv6
6 Address packets that is assigned at the IPv6 layer to an interface or set of

interfaces.

7 Subnet One or more links having the same 64-bit IPv6 address prefix.

Types of IPv6 Addresses

Unspecified, Loopback, Embedded IPv4

 Unspecified address is an all 0 address and cannot be assigned to an interface. It would
be typed as ::. This is only used as a source address to indicate the absence of an actual
address.

 Loopback Address is all 0’s except for the last bit, which is 1. It would be typed as ::1.
It operates the same as the IPv4 127.0.0.1 loopback address.

 IPv4 Embedded
Addresses are IPv6 addresses with an IPv4 address embedded in the low-order 32 bits.
They are used to transition networks from IPv4 to IPv6.

 Address Range:
0000:0000:0000:0000:0000:0000:0000:0000/8 to
00FF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF/8

Global Unicast

 Global Unicast addresses are used to uniquely identify a specific interface on a host
and can be used as a public address on the internet.

 Address Range:
2000:0000:0000:0000:0000:0000:0000:0000/3 to
3FFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF/3

eBook PSP | IP Addressing & Subnetting 36

Unique local Unicast

 Unique local Unicast addresses are roughly the same as IPv4 private addresses.
 Address Range:

FC00:0000:0000:0000:0000:0000:0000:0000/7 to
FDFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF/7

Link-local Unicast

 Link-local addresses are unicast addresses that are limited to a point to point
connection within a local network. Routers will not forward packets with a link-local
address.

 Address Range:
FE80:0000:0000:0000:0000:0000:0000:0000/10 to
FEBF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF/10

Multicast

 Multicast addresses are used to send a single packet to multiple destinations
simultaneously.

 Address Range:
FF00:0000:0000:0000:0000:0000:0000:0000/8 to
FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF/8

Quiz “Do you know it?”

1. What is the loopback address in IPv6?
a. 2000::5::/64
b. 127.0.0.1
c. ::/1
d. FE80:0:0::1/64

2. Which of the following is the largest quantity?
a. The number of atom in the human body
b. The number of bots on social media
c. The number of grains of sand on Earth
d. The number of IPv6 addresses

3. Which of the following data flows would you use with IPv6?
a. Broadcast
b. Multicast
c. Simulcast
d. No cast

37 eBook PSP | IP Addressing & Subnetting

MERGEF Abbreviating and Expanding IPv6 Addresses
ORMAT

2

The IPv6 address abbreviation rules let us to shorten IPv6 addresses. To make IPv6
addresses a little less imposing, two rules were developed to make them easier to work
with.
Rule 1: Omission of the Leading 0s,
Example: Global Unicast Address
Preferred Format: 2000:0000:0000:0000:0000:0000:0000:0001
Leading 0’s removed: 2000: 0: 0: 0: 0: 0: 0: 1 or 2000:0:0:0:0:0:0:1
Example: Link-local Address
Preferred Format: FE80:ACAD:0000:0197:0000:0000:0000:FF01
Leading 0’s removed: FE80:ACAD: 0: 197: 0: 0: 0:FF01 or FE80:ACAD:0:197:0:0:0:FF01
Example: Unique local Unicast Address
Preferred Format: FC80:0000:0000:ACAD:0000:0000:0000:0001
Leading 0’s removed: FC80: 0: 0:ACAD: 0: 0: 0: 1 or FC80:0:0:ACAD:0:0:0:1
Example: Multicast Address
Preferred Format: FF00:0000:0000:ACAD:0000:0000:FE00:0721
Leading 0’s removed: FF00: 0: 0:ACAD: 0: 0:FE00: 721 or FF00:0:0:ACAD:0:0:FE00:721
Example: Unspecified address
Preferred Format: 0000:0000:0000:0000:0000:0000:0000:0000
Leading 0’s removed: 0: 0: 0: 0: 0: 0: 0: 0 or 0:0:0:0:0:0:0:0
Example: Loopback Address
Preferred Format: 0000:0000:0000:0000:0000:0000:0000:0001
Leading 0’s removed: 0: 0: 0: 0: 0: 0: 0: 1 or 0:0:0:0:0:0:0:1

Let’s do some practice

eBook PSP | IP Addressing & Subnetting 38

Exercise | Omission of the Leading 0s Problems

Using Rule 1 reduce the IPv6 addresses to their shortened form.

1. 0000:0000:0000:0000:0000:0000:0000:0000
__________________________________________________________________

2. 2000:0000:0000:0000:0000:ABCD:0000:0025
__________________________________________________________________

3. 2340:0000:0010:0100:1000:ABCD:0101:1010
__________________________________________________________________

4. FE80:0000:0000:0000:DEAD:BEFF:FEEF:CAFE
__________________________________________________________________

5. 3FFF:FF00:0000:0000:ACAD:0000:0000:0127
__________________________________________________________________

6. FC00:0000:0000:0000:3E00:1275:0000:0034
__________________________________________________________________

7. FE95:FC6C:C540:0000:0000:0000:0000:9800
__________________________________________________________________

8. FF00:ACAD:0000:0000:1234:0000:0000:0001
__________________________________________________________________

9. 3ABC:0001:ACAD:0000:0000:1234:0000:0005
__________________________________________________________________

10. FE95:FC6C:C540:0000:0000:0000:0000:9800
__________________________________________________________________

39 eBook PSP | IP Addressing & Subnetting

MERGEF Rule 2: Omission of the All-0 Hextets
ORMAT

2

Rule 2 uses a double colon :: to represent a single contiguous set of all zero hextexts.
Example: Unspecified address
Preferred Format: 0000:0000:0000:0000:0000:0000:0000:0000
Contiguous 0’s removed: ::

Example: Loopback Address
Preferred Format: 0000:0000:0000:0000:0000:0000:0000:0001
Contiguous 0’s removed: ::0001

Example: Global Unicast Address
Preferred Format: 2000:0000:0000:0000:0000:0000:0000:0001
Contiguous 0’s removed: 2000: :0001 or 2000::0001

Example: Link-local Address
Preferred Format: FE80:ACAD:0000:0197:0000:0000:0000:FF01
Contiguous 0’s removed: FE80:ACAD:0000:0197::FF01

Example: Multicast Address
Preferred Format: FF00:0000:0000:ACAD:0000:0000:FE00:0721
Contiguous 0’s removed:
FF00::ACAD:0000:0000:FE00:0721 (Option #1)
FF00:0000:0000:ACAD::FE00:0721 (Option #2)

Note
Double colon :: can only be used once in any IPv6 address.

eBook PSP | IP Addressing & Subnetting 40

Exercise | Omission of the All-0 Hextets Problems

Using Rule 2 reduce the IPv6 addresses to their shortened form.

1. 0000:0000:0000:0000:0000:0000:0000:0000
__________________________________________________________________

2. 2000:0000:0000:0000:0000:ABCD:0000:0025
__________________________________________________________________

3. 2340:0000:0010:0100:1000:ABCD:0101:1010
__________________________________________________________________

4. FE80:0000:0000:0000:DEAD:BEFF:FEEF:CAFE
__________________________________________________________________

5. 3FFF:FF00:0000:0000:ACAD:0000:0000:0127
__________________________________________________________________

6. FC00:0000:0000:0000:3E00:1275:0000:0034
__________________________________________________________________

7. FE95:FC6C:C540:0000:0000:0000:0000:9800
__________________________________________________________________

8. FF00:ACAD:0000:0000:1234:0000:0000:0001
__________________________________________________________________

9. 3ABC:0001:ACAD:0000:0000:1234:0000:0005
__________________________________________________________________

10. FE95:FC6C:C540:0000:0000:0000:0000:9800
__________________________________________________________________

41 eBook PSP | IP Addressing & Subnetting

MERGEF
ORMAT

2 Combining Rule 1 and Rule 2

To reduce the size of IPv6 address even more you can combine Rule 1 with Rule 2.

Example: Unspecified address
Preferred Format: 0000:0000:0000:0000:0000:0000:0000:0000
Combined reduction: ::
Example: Loopback Address
Preferred Format: 0000:0000:0000:0000:0000:0000:0000:0001
Combined reduction: ::1
Example: Global Unicast Address
Preferred Format: 2000:0000:0000:0000:0000:0000:0000:0001
Combined reduction: 2000::1
Example: Global Unicast Address
Preferred Format: 2001:00FE:ACAD:2013:0000:0000:00AA:0271
Combined reduction: 2001:FE:ACAD:2013::AA:271
Example: Link-local Address
Preferred Format: FE80:ACAD:0000:0197:0000:0000:0000:FF01
Combined reduction: FE80:ACAD:0 : 197: :FF01
or
FE80:ACAD:0:197::FF01
Example: Multicast Address
Preferred Format: FF00:0000:0000:ACAD:0000:0000:FE00:0721
Combined reduction:
FF00::ACAD:0:0:FE00:721 (Option #1)
FF00:0:0:ACAD::FE00:721 (Option #2)

eBook PSP | IP Addressing & Subnetting 42

Exercise | Combining Rule 1 and Rule 2 Problems

Using Rule 1 and 2 reduce the IPv6 addresses to their shortest form.

1. 0000:0000:0000:0000:0000:0000:0000:0000
__________________________________________________________________
2. 0000:0000:0000:0000:0000:0000:0000:0001
__________________________________________________________________
3. 2000:0000:0001:0000:0000:ABCD:0000:0025
__________________________________________________________________
4. 3F00:0AB0:0000:0000:0000:0098:0000:0001
__________________________________________________________________
5. 2001:3756:0006:0000:ACAB:0000:0000:0075
__________________________________________________________________
6. 3FFE:FF00:0000:0000:ACAB:0025:0000:0127
__________________________________________________________________
7. 2001:ACAD:0000:ACAD:FFFE:0000:0000:0001
__________________________________________________________________
8. 3ABC:0001:ACAB:0000:0000:1234:0000:0005
__________________________________________________________________
9. FC00:0000:0000:0000:3D00:1275:0000:0034
__________________________________________________________________
10. FE70:FC6C:C540:0000:0000:0000:0000:7000
__________________________________________________________________

43 eBook PSP | IP Addressing & Subnetting

MERGEF Exercise | Reverting Reduced Address Problems
ORMAT

2

The following addresses have been shorted using Rule1 and/or Rule 2. Expand these
addresses back to preferred format.
1. 2000::1
__________________________________________________________________
2. ::1
__________________________________________________________________
3. 2003:0:0:0:0:ACAD:0:122
__________________________________________________________________
4. 3E80:70::0098:0000:0001
__________________________________________________________________
5. 2EFF:38AB:5:0:ACAD::5
__________________________________________________________________
6. 3FFE::ACAD:25:0:100
__________________________________________________________________
7. 2002:ACAD::1BCD:FFFF::4
__________________________________________________________________
8. 3FAA:0025::ACAB:ABCD:0000:0005
__________________________________________________________________
9. FFFF:4E00::1235:0:34
__________________________________________________________________
10. 3E10:6C:40::9800
__________________________________________________________________


Click to View FlipBook Version