Академический Документы
Профессиональный Документы
Культура Документы
Subnet 1
Introduction 2
1 Introduction to IP addressing 3
3 Sub-networking 15
Answers to SAQs 23
Introduction
Understanding the structure of IP addresses and how they are used in networks is
central to being able to build and maintain local and wide area networks. As well as
carrying out the basic function of locating a host, IP addresses will also impact on the
workload of routers, network design, security and management.
This topic is covered thoroughly in the CCNA curriculum, and is further tested in the
practical session at the day school. However, determining network and host
addresses (subnetting) is a topic that needs practice.
This is the first part of two additional teaching texts that aim to give you an opportunity
to develop your understanding of IP addressing and sub-networking.
Aims
This text is in harmony with the Cisco Networking Academy™ online curriculum,
enabling you to develop your understanding and application of IP addressing and sub-
networking. Throughout this workbook is a selection of exercises that will improve
your skills for the Cisco certification exam and the commercial skills covered by the
CCNA™.
Learning outcomes
The content of this text meets the standards delivered in CCNA 1, 2 and 3, as well as
extending your knowledge base with CIDR and IPv6. The specific learning outcomes
addressed in this text are:
• an introduction to how IP addresses are used in networks
• an understanding of how IP addresses fit into the TCP/IP layered model
• an understanding of different IP address classes
• an understanding of how IP addresses can be subnetted to provide the required
number of sub-networks or hosts.
Abbreviations
IP internet protocol
TCP transmission control protocol
UDP user datagram protocol
MAC media access control
WAN wide area network
LAN local area network
OSI open systems interconnection
DEC digital equipment corporation
NIC network interface card
IEEE Institute of Electrical and Electronic Engineers
DHCP dynamic host configuration protocol
ISP internet service provider
VoIP voice over internet protocol
WAP wireless application protocol (please be aware that WAP also
denotes wireless access point)
MODEM modulator demodulator
FTP file transfer protocol
Subnet 1 | 2
T216 Cisco networking (CCNA)
1 Introduction to IP addressing
Whilst reading this text you may find some unfamiliar terms. That is because the
course team has assumed you have read the online curriculum.
Terms used in this text have already been introduced in the online curriculum. You
can also find them in the glossary in the online curriculum.
Subnet 1 | 3
T216 Cisco networking (CCNA)
C 1 5 C 0 9 9 C 1 5 C 0
1100 0001 0101 1100 0000 1001 1001 1100 0001 0101 1100 0000
The first three bytes are the Organisational Unique The last three bytes are the unique code that is managed
Identifier, which is issued by the IEEE to the and issued to the NIC (or other networking device) by
manufacturer the manufacturer
Exercise 1.1
First, start the command prompt on your computer (Figure 2).
Subnet 1 | 4
T216 Cisco networking (CCNA)
Subnet 1 | 5
T216 Cisco networking (CCNA)
Compared to MAC addresses, IP addresses are easier for humans to relate to. The
32-bit address structure is subdivided into four 8-bit portions called octets (an octet
being a byte of information). Figure 4 shows this structure.
binary value
128 64 32 16 8 4 2 1
result = 0 0 0 0 0 0 0 0 0
result = 255 1 1 1 1 1 1 1 1
Exercise 1.2
If you are on a ‘dial-up’ MODEM connection, please ensure that you are online; with a
broadband or LAN system, the connection is permanent. Turn back and repeat
Exercise 1.1, and observe how many IP addresses your connection needs in order to
operate.
Subnet 1 | 6
T216 Cisco networking (CCNA)
6 Presentation
1 Physical
OSI Protocol
5 LDAP
DNS
4 TCP UDP
HSRP
DHCP
3 IP RIP
BGP
OSPF
EIGRP
ICMP
2 ARP RARP
Subnet 1 | 7
T216 Cisco networking (CCNA)
00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
Acknowledgement
Data offset Reserved ECN Control bits Window
Checksum Urgent pointer
Options and padding
Data
Subnet 1 | 8
T216 Cisco networking (CCNA)
When the networked device reads the incoming data, it will find near the front of the
data sequence the source IP address. Based on the class information (see Section 2.2),
the device will make one of two decisions:
1 Accept incoming packet based on class and/or sub-network mask (see Section 3).
2 Reject incoming packet based on class and/or sub-network mask.
Exercise 2.1
• Open the Start/Settings/Control Panel/Network Connections window.
• Depending on the resources you may have on your computer, right-click on your
active local area connection and select Properties.
• Double-click on the TCP/IP option.
• Ensure you take a note of the current settings, as this is your insurance that you
will be able to read your mail in five minutes’ time. It is also worth taking the time
to familiarise yourself with this dialogue and the IP address options.
These steps are shown in Figure 9.
Subnet 1 | 9
T216 Cisco networking (CCNA)
Exercise 2.2
You need to be online for this exercise.
• Open the command prompt, as in Exercise 1.1.
• Enter the following command: ‘ping www.teraknor.co.uk’.
• The ping command will send an ICMP echo to the web server in question, which
will send an ICMP reply (Figure 10).
Subnet 1 | 10
T216 Cisco networking (CCNA)
Class
A B C D
1.0.2.1 128.14.21.19 192.168.0.1 224.0.0.5
10.5.45.99 172.16.12.14 195.100.0.0
69.0.224.255 191.90.254.2 223.255.255.254
126.4.0.0 160.10.0.4
99.1.1.2
100.100.100.100
Figure 12 IP address examples
SAQ 1
What is the class of each of these addresses?
1 101.0.0.0
2 129.0.0.0
3 123.0.0.0
4 191.0.0.0
5 193.0.0.0
6 1.0.0.0
The meaning of the numbers in each octet of the IP address depends on the class, as
shown in Figure 13.
Subnet 1 | 11
T216 Cisco networking (CCNA)
Class A example
provides the identity provides the identity
of the network of the host
10 5 5 1
Class B example
provides the identity provides the identity
of the network of the host
172 16 5 1
Class C example
provides the identity provides the identity
of the network of the host
192 168 5 1
A from 10 0 0 0
B from 172 16 0 0
As well as private addresses there are two other definitions of addresses for all types
of network:
2 the address that broadcasts information to the whole network (broadcast address).
The network address is a unique IP address and cannot be issued to any device on
Subnet 1 | 12
T216 Cisco networking (CCNA)
The network address always has a sequence of binary 0s in the host portion of the IP
address (Figure 15).
N H H H
A
10 0 0 0
N N H H
B
172 16 0 0
N N N H
C
192 168 1 0
N H H H
A
10 255 255 255
N N H H
B
172 16 255 255
N N N H
C
192 168 1 255
Exercise 2.3
As for Exercise 1.1, enter the command prompt and type ‘ipconfig /all’. Based on the
IP address you have and the information in Figure 16, ping the broadcast address of
your network (e.g. ping 192.168.0.255). If all is well (as some systems are suitably
configured to prevent this) you should get a reply. Then enter ‘arp –a’ to see all the
devices that responded to the first five echoes.
Note: you will have to be connected to a network.
Looking back at Figure 11, you may have realised there is also an anomaly with the
class A address range.
The range is from 0 to 127, but addresses 0 and 127 are reserved. In simple terms,
0.0.0.0 is the network address of the entire inter-network, or the internet. Sending a
message to this address is the same as communicating with everyone on the planet
simultaneously. Therefore this feature is blocked, for the sanity of network managers
everywhere. Figure 17 demonstrates the result of trying to ping 0.0.0.0.
Subnet 1 | 13
T216 Cisco networking (CCNA)
Exercise 2.4
Looking back to Exercise 2.1, try to change the IP address of your computer to
0.0.0.0. If all is well you should get an error similar to that shown in Figure 19.
Subnet 1 | 14
T216 Cisco networking (CCNA)
3 Sub-networking
This section will explore the principle of sub-networking, with the intention that it will
support the Cisco Academy curriculum. A subnet calculator is available as an
additional resource. You can find this on the course website. Do not depend on the
calculator as you will be required to do subnet calculations in the Cisco exam. Doing it
the long way now will help you understand.
subnet mask (see Section 3.2) acts as a division rule, where in theory you may have
2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, etc. subnets on your network.
Sub-networking provides a simple hierarchy, suitable for the management of any
network system (Figure 20).
Major network
172.16.0.0
Subnet 1 | 15
T216 Cisco networking (CCNA)
Destination IP address
172 16 20 17
1 0 1 0 1 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 1 0 0 0 1
Subnet mask
255 255 240 0
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0
The route will AND the subnet mask with the destination IP address
1 0 1 0 1 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 1 0 0 0 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0
Result
1 0 1 0 1 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0
172 16 16 0
Tip: ANDing is where 1 and 1 returns 1 but 0 and 0, 0 and 1, 1 and 0 all return 0
Figure 21 ANDing the subnet mask for routing decisions
To design a subnet mask is similar and as simple; all you need to do is remember
some straightforward rules:
1 You can borrow (subdivide) only from the host portion of the class of address in
question (look back to Section 2.2 if in doubt).
2 You can have only even numbers of sub-networks, all based on powers of 2, i.e. you
can have 2, 4, 8, 16, …, 1024, 2048, etc. Therefore round up to the nearest power
of 2. If you need 600 sub-networks don’t round down to 512, round up to 1024.
3 Binary 1s are always to the left – there are no exceptions for sub-networking.
7 Borrowing is done with a 1: each 1 means that you double the number of sub-
networks. The subnet mask is 32 bits; remember the dotted notation is only to
make the information human friendly.
Subnet 1 | 16
T216 Cisco networking (CCNA)
With the preceding rules in mind, work through the three examples in Figure 22.
You have a Class A network address and you want 1500 sub-networks
(tip: you must have 2048 sub-networks)
10 0 0 0
Network Host Host Host
1024
2048
128
256
512
16
32
64
2
4
1 1 1 1 1 1 1 1 1 1 81 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0
128
128
128
128
64
32
16
64
32
16
64
32
16
64
32
16
8
4
2
1
8
4
2
1
8
4
2
1
8
4
2
1
255 255 224 0
Example 1
You have a Class B network address and you want 450 sub-networks
(tip: you must have 512 sub-networks)
172 16 0 0
Network Network Host Host
128
256
512
16
32
64
2
4
8
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0
128
128
128
128
64
32
16
64
32
16
64
32
16
64
32
16
8
4
2
1
8
4
2
1
8
4
2
1
8
4
2
255 255 255 128 1
These are already borrowed and to the left as These are the bits borrowed
this is the network portion from the host portion
Example 2
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0
128
128
128
128
64
32
16
64
32
16
64
32
16
64
32
16
8
4
2
1
8
4
2
1
8
4
2
1
8
4
2
1
Example 3
Figure 22 Simple sub-networking
Subnet 1 | 17
T216 Cisco networking (CCNA)
SAQ 2
Based on the preceding examples and guidance, provide solutions for the following
problems.
1 For 10.0.0.0 create a subnet mask for 10 000 sub-networks.
2 For 192.168.0.0 create a subnet mask for 7 sub-networks.
3 For 172.30.0.0 create a subnet mask for 99 sub-networks.
Now you may already have begun to appreciate that you can also work from the bits
to the right, the 0s giving the number of hosts per sub-network. Follow exactly the
same rules in reverse:
• If creating the number of sub-networks you go from left to right with 1s.
• Then creating or calculating the number of hosts you go from right to left with 0s.
• And yes, round up.
Figure 23 takes the solutions from Examples 1–3 in Figure 22 and provides you with
information on the number of hosts per subnet.
8192
4096
2048
1024
2048
1024
512
256
128
128
256
512
64
32
16
16
32
64
8
4
2
2
4
8
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0
128
128
128
128
64
32
16
64
32
16
64
32
16
64
32
16
8
4
2
1
8
4
2
1
8
4
2
1
8
4
2
1
255 255 224 0
128
128
256
512
64
32
16
16
32
64
8
4
2
2
4
8
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0
128
128
128
128
64
32
16
64
32
16
64
32
16
64
32
16
8
4
2
1
8
4
2
1
8
4
2
1
8
4
2
1
255 255 255 128
8
4
2
2
4
8
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0
128
128
128
128
64
32
16
64
32
16
64
32
16
64
32
16
8
4
2
1
8
4
2
1
8
4
2
1
8
4
2
1
Subnet 1 | 18
T216 Cisco networking (CCNA)
10 0 0 0
255 255 240 0
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0
128
128
128
64
32
16
64
32
16
64
32
16
64
32
16
8
4
2
1
8
4
2
1
8
4
2
1
8
4
2
1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0
10 0 0 0
Network Host Host Host
131 072
262 144
524 288
16 384
32 768
65 536
1024
2048
4096
8192
128
256
512
16
32
64
32
16
2
4
8
8
4
2
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0
Class A has 524 288 sub-networks, each with 32 hosts
172 16 0 0
Network Network Host Host
1024
2048
128
256
512
16
32
64
32
16
2
4
8
8
4
2
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0
Class B has 2048 sub-networks, each with 32 hosts
192 168 1 0
Network Network Network Host
32
16
2
4
8
8
4
2
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0
Class C has 8 sub-networks, each with 32 hosts
Note: the number of sub-networks is different, but the number of hosts remains the same.
Figure 25 One mask having differing results
Subnet 1 | 19
T216 Cisco networking (CCNA)
Figure 26 shows the default subnet masks for each class of address. These are the
masks used when there is no ‘sub-networking’ to be done.
99 0 0 0
A
255 0 0 0
150 30 0 0
B
255 255 0 0
200 100 50 0
C
255 255 255 0
Subnet 1 | 20
T216 Cisco networking (CCNA)
Sub-network portion,
contains the sub
network identity
major network
address as well as
192.168.100.0 Host portion
subnet 0 address
255.255.255.224
128
64
32
16
8
4
2
1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0
Sub-network address 192.168.100.0 0 0 0 0 0 0 0 0
First host address 192.168.100.1 0 0 0 0 0 0 0 1
Subnet 0
Last host address 192.168.100.30 0 0 0 1 1 1 1 0
Sub-network broadcast address 192.168.100.31 0 0 0 1 1 1 1 1
Sub-network address 192.168.100.32 0 0 1 0 0 0 0 0
First host address 192.168.100.33 0 0 1 0 0 0 0 1
Subnet 1
Last host address 192.168.100.62 0 0 1 1 1 1 1 0
Sub-network broadcast address 192.168.100.63 0 0 1 1 1 1 1 1
Sub-network address 192.168.100.64 0 1 0 0 0 0 0 0
First host address 192.168.100.65 0 1 0 0 0 0 0 1
Subnet 2
Last host address 192.168.100.94 0 1 0 1 1 1 1 0
Sub-network broadcast address 192.168.100.95 0 1 0 1 1 1 1 1
Sub-network address 192.168.100.96 0 1 1 0 0 0 0 0
First host address 192.168.100.97 0 1 1 0 0 0 0 1
Subnet 3
Last host address 192.168.100.126 0 1 1 1 1 1 1 0
Sub-network broadcast address 192.168.100.127 0 1 1 1 1 1 1 1
Sub-network address 192.168.100.128 1 0 0 0 0 0 0 0
First host address 192.168.100.129 1 0 0 0 0 0 0 1
Subnet 4
Last host address 192.168.100.158 1 0 0 1 1 1 1 0
Sub-network broadcast address 192.168.100.159 1 0 1 1 1 1 1 1
Sub-network address 192.168.100.160 1 0 1 0 0 0 0 0
First host address 192.168.100.161 1 0 1 0 0 0 0 1
Subnet 5
Last host address 192.168.100.190 1 0 1 1 1 1 1 0
Sub-network broadcast address 192.168.100.191 1 0 1 1 1 1 1 1
Sub-network address 192.168.100.192 1 1 0 0 0 0 0 0
First host address 192.168.100.193 1 1 0 0 0 0 0 1
Subnet 6
Last host address 192.168.100.222 1 1 0 1 1 1 1 0
Sub-network broadcast address 192.168.100.223 1 1 0 1 1 1 1 1
Sub-network address 192.168.100.224 1 1 1 0 0 0 0 0
First host address 192.168.100.225 1 1 1 0 0 0 0 1
Subnet 7
Last host address 192.168.100.254 1 1 1 1 1 1 1 0
Sub-network broadcast address 192.168.100.255 1 1 1 1 1 1 1 1
Subnet 1 | 21
T216 Cisco networking (CCNA)
Naturally there is a quicker way, based on the simple fact that the borrowed sub-
network portion contains the sub-network identity you will be looking for.
Using this knowledge you can:
1 Subtract 1 from the network number (remember you are counting from 0, so for
example the 200th subnet is number 199).
2 Convert the new number of the network to binary.
3 Place the binary address to the right-hand side of the subnet masked portion.
4 Fill the gaps (if any) on the left with 0s back to the network portion of the class of
address (as well as the right host portion, which must be 0).
5 Now calculate the result, which is the nth subnet.
Figure 28 provides an example of how you can find the 200th subnet from a mask that
has 1024 sub-networks for a class B network of 150.150.0.0. (Hint: the mask is
255.255.255.192, which helps us to see which bits are allocated to the network
portion.)
Step Task
1 You want the 200th, therefore subtract 1
2 Convert 199 to binary, which is 11000111
128 64 32 16 8 4 2 1
1 1 0 0 0 1 1 1
3 Place the binary address to the right-hand side of the subnet masked portion
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0
1 1 0 0 0 1 1 1
4 Fill gaps with 0s
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0
network portion 0 0 1 1 0 0 0 1 1 1 0 0 0 0 0 0
5 Calculate the result
128
128
64
32
16
64
32
16
8
4
2
1
8
4
2
1
150 150 0 0 1 1 0 0 0 1 1 1 0 0 0 0 0 0
150 150 49 192
SAQ 3
1 For 10.0.0.0, with 255.255.128.0, identify the 10th subnet.
2 For 172.16.0.0, with 255.255.254.0, identify the 29th subnet.
3 For 126.0.0.0, with 255.255.255.224, identify the 1000th subnet.
Subnet 1 | 22
T216 Cisco networking (CCNA)
Answers to SAQs
SAQ 1
1 A
2 B
3 A
4 B
5 C
6 A
Ranges for each class are defined. You can either remember them or work them out
from the most significant bits, as shown in Figure 11.
SAQ 2
1 2
55.255.252.0
10 000 subnets requires 14 bits. Starting from the left, bits are taken from each
octet; that is 8 from octet 2 and 6 from octet 3. Mask for octet 3 can be found:
128 64 32 16 8 4 2 1
1 1 1 1 1 1 0 0 = 252
2 2
55.255.255.224
7 subnets requires 3 bits. Looking at the 8 bits in the fourth octet:
128 64 32 16 8 4 2 1
1 1 1 0 0 0 0 0 = 224
3 2
55.255.254.0
99 subnets requires 7 bits. Looking at the 8 bits in the third octet:
128 64 32 16 8 4 2 1
1 1 1 1 1 1 1 0 = 254
SAQ 3
The layout in this answer is different from above. Try to develop a method that works
for you.
1 0.4.128.0
1
The subnet mask tells us how many bits are allocated to the network part. In this
example 1 bit of the third octet is available for subnetting. Subnets start at 0, so we
are looking for the 9th. In this case the boundary between the 2nd and 3rd octet
has to be considered:
2nd octet 3rd octet
N N N N N N N N N H H H H H H H
256 128 64 32 16 8 4 2 1 count from the least significant bit
0 0 0 0 0 1 0 0 1 =9
128 64 32 16 8 4 2 1 128 64 32 16 8 4 2 1
get the address from the bit that equals 1 in each octet
Try your own approach to 2 and 3.
2 172.16.56.0
3 1
26.0.124.224
Subnet 1 | 23