CPEN105 Module 5
CPEN105 Module 5
Introduction:
This module builds on our previous WLAN and WAN topics. We’ll explore the
TCP/IP protocol suite, which is crucial for internet access. We’ll also learn about IP
addresses, especially IPv4, and how they are structured. The module includes
subnetting, a technique for managing network traffic, and ends with practical
exercises. This knowledge will help you understand network communication and IP
address management.
Objectives:
At the end of the topic module, the students should be able to:
As mentioned in our previous topics, millions of people all over the world today
depend on the applications enabled by the interconnection of networks (Internet and
World Wide Web (WWW)) build by TCP/IP.
Figure 6.1 denotes data flowing through the layers, with headers being added
at each layer. As seen, on the way down, headers are added and the data starts
growing and, on the way, up at the receiving end, the headers and trailers are stripped
away to finally receive the original data.
For further understanding, the TCP/IP is likened to the English language that
the whole world is using to communicate with each other. If our computer or device
does not support it, there is NO way we can connect to the internet. Like if we don’t
know the English language and we travel around the world, it won’t be so easy for us
unless we have a travel guide or a companion who speaks English.
The two (2) most important protocols in the TCP/IP suite are as follows:
The function of the TCP/IP protocol stacks, or suite (which will be discussed in
detail in Week 15 – TCP/IP Transport and Application Layer), is to transfer information
from one network device to another. In doing so, it closely maps the OSI reference
model (which is an ISO standard for worldwide communications that defines a
networking framework shown at the left of Figure 6.1) in the lower layers, and supports
all standard physical and data link protocols.
Similarities Differences
The OSI has seven (7) layers, while the
Both have layers TCP/IP appears simpler because it has
fewer layers (four [4] layers
The TCP/IP combines the presentation
and session layers into its application
layer; the characteristics of presentation
Both have application layers, though
layer are provided by the application
they include very different services
layer, whereas, the characteristics of
the session layer are provided by the
transport layer
Both have comparable transport and The TCP/IP combines the OSI data link
network layers and physical layers into one layer
The TCP/IP transport layer using UDP
Packet – switched (not circuit – does not always guarantee reliable
switched) technology is assumed delivery of packets as the transport
layer in the OSI model does
The OSI is truly a general model, while
Networking professionals need to know
TCP/IP cannot be used for any other
both
application
Table 6.1: Similarities and differences of the OSI reference
The Internet Protocol (IP) had undergone several version changes. Currently,
there are two (2) versions of an IP, which are the IP version 4 (IPv4) and the IP version
6 (IPv6). Table 6.2 below shows the comparisons between the two (2) IP versions:
IP version 4
IP version 6 (IPv6)
(IPv4)
Deployed 1981 1992
32 – bit (4 bytes)
Address
addressing 128 – bit (16 bytes) addressing scheme
Size
scheme
Dotted Decimal
Address Hexadecimal Notation:
Notation:
Format 3FFE:F200:0234:AB00:0123:4567:8 901:ABCD
192.149.252.76
Prefix
192.149.0.0/24 3FFE:F200:0234::/48
Notation
Number
of
2128
Addresse 232 =
=~340,282,366,920,938,463,374,607,431,768,211,4
s ~4,294,967,296
56
(Address
Space)
Table 6.2: IPv4 vs. IPv6
Note: Dotted decimal notation and hexadecimal notation will be discussed further in
IP addressing.
The present version of the TCP/IP, which is the IPv4 that was standardized in
September 1981 is obsolete. In 1992, the Internet Engineering Task Force (IETF)
supported the standardization of a new generation of IP, often called the IPng (ng for
next generation) and now known as the IPv6 improves on the current version through
providing a much larger address space.
The IPv6 has not yet gained wide implementation, but most vendors of
networking equipment have already released it. The technical functioning of the
Internet remains the same in both versions and it is likely that both versions will
continue to operate simultaneously on networks well into the future. At the current time,
networks that use IPv6 support both IPv4 and IPv6 addresses in their networks.
Hence, time will come that the IPv4 will be completely obsolete and IPv6 will
be the commonly used version and will become the dominant standard in the future.
Note: Inform the students that the discussion for the whole session will focus on the
IPv4. IPv6 is mentioned in the topic for them to recognize the IPv4’s limitation and how
it will be addressed by the IPv6.
IP Addressing
MAC (Media Access Control) address (aka physical address) refers to the
unique physical address of all computers, which are assigned by the manufacturer of
the network interface card. It is supposed to be permanent and could not be changed
by anyone as it was meant to identify a specific network interface card no matter where
it is in the world.
Each MAC address is a 48 bit value commonly represented in a hexadecimal
(base 16) format and comprised of two parts (shown in Figure 6.2) that attempt to
ensure that every MAC address is globally unique.
One of the uses of a MAC address which people are most likely to encounter
is MAC filtering, used by wireless routers to allow or disallow certain computers from
accessing the network. This is a quick and easy method if you only want a handful of
computers or laptops to connect. A MAC address can also be used to assign an IP
address to a certain computer. The server queries the MAC address of the network
card, looks it up in a list, and assigns the corresponding IP address.
It is universal in the sense that the addressing system must be accepted by any
host that wants to be connected to the Internet.
Figure 6.4 shows a yellow line that represents the division of two (2) different
IP addresses. The public IP address is what the computers use to find each other
online and exchange information. It is assigned to the computer by the Internet Service
Provider as soon as the computer is connected to the Internet gateway; user has no
control over the IP address (public) that is assigned to the computer. A public IP
address can be either of the following:
On the other hand, the private IP address is what computers on a network used
to talk to the router. It can change each time they are connected. An IP address is
considered private if the IP number falls within the class A, B and C address ranges
(shown in Table 6.3) to prolong the rapid decline in the number of available IP
addresses.
Note: Class A, B, and C address ranges will be discuss further as we go along the
topic.
Aside from public and private IP addresses, Table 6.4 shows the other three
(3) special ranged that are reserved for special purposes.
Each IP Address includes a network ID/field and a host ID/field shown in Figure
6.5.
Subnet mask or a default mask (shown in Table 6.5) determines which portion
of an IP address identifies the network and which portion identifies the host. Like the
IP address, it is represented by four octets. The network bits are represented by the
1s in the network mask, and the node bits are represented by the 0s.
Class D & E are used for Multicast and Research purposes and we are not
allowed to subnet them so they are not mentioned here.
The number behind the slash notation (/) specifies how many bits are turned
on (bit 1). For example:
“/8″ equals “1111 1111.0000 0000.0000 0000.0000 0000″ → 8 bits are turned
on (bit 1)
Default Gateway (shown in Figure 6.5) is used to specify the address of the
nearest routing device that is used by the host device to forward addressed packets
on to the network.
• In the command window, type “ipconfig /all” to show the MAC address, IP
address and the subnet mask (shown in Figure 6.8)
Figure 6.8: Command window showing the MAC address, IP address and the subnet mask
• However, if you only want to display the MAC address, just key in “getmac” to
the command window and the Figure 6.9 below will appear.
Figure 6. 9: Command window showing only the MAC
An IPv4 address is expressed in three (3) different notations below. The most
prevalent, however, is the dotted-decimal notation.
Solution:
01110101.10010101.00011101.00000010 → N16
Solution:
The IP address in the form of binary notation above is equivalent to
75.95.1D.02 when written in dotted-hexadecimal notation.
An IPv4 Address is divided into categories called classes, which define the
large, medium, and small networks. The classes were determined during the early
days of the Internet by the Internet Assigned Numbers Authority (IANA). The five (5)
IP address classes are as follows:
• Class A address – This uses only the first octet (8 bits) of the 32-bit number
to indicate the network address. The entire second to fourth octet are used for
host addresses, which is now equivalent to a total of 24 bits. With 24 bits, there
could be 224 = 16,777,216 addresses in the address space. However, an IP
address with the host bits zeroed out is used to identify the network address
while an IP address whose host bits are set to all ones is used for network
broadcast. Hence, this reduces the effective number of possible host
addresses in the address space to 16,777,214. Therefore, Class A addresses
are given out to networks with millions of hosts that need unique identification
numbers – a very large network.
Aside from the description above, the Class A address always has its higher-
ordered bit in the 32- bit number set to “0” (shown in Figure 6.9). Hence, the
first octet of this address would range from 00000000 to 01111111, or from 0
to 127 if expressed in decimal. However, 0 is reserved to refer to “This
Network”, while 127 is reserved for loopback testing (as in the case of the
loopback address of 127.0.0.1). With 0 and 127 reserved, this reduces to 126
Class A network addresses – from 128 unique values less two (2) reserved (0
and 127).
• Class B address – This uses two (2) of the four (4) octets (16 bits) to indicate
the network address. The two other octets, which specify the host addresses,
have now a total of 16 bits. With 16-bits for the host address part, there can be
up to 216 = 65,536 possible addresses in the address space. With the rule of all
host bits set to zeros for network address, and all host bits set to ones for
broadcast, the effective number of addresses in the space is 65,534. Class B
networks are given out to the networks that are mid-sized.
In addition to the description above, the Class C address always has the first
three higher-ordered bits in the 32-bit number set to “110” (shown in Figure
6.11). The first octet would then range from 11000000 to 11011111, or from
192 to 223 in decimal. Similar to Class B addresses, all addresses in the
address space are assignable. Given that only five (5) bits can be used to
define the first octet value, plus the whole 16-bits of the second and third octets,
there could be up to 221 = 2,097,152 Class C network addresses.
The first four bits of a Class D address must be 1110 (shown in Figure 6.12).
Hence, the first octet range for this class is 11100000 to 11101111, or 224 to
239. An IP address that starts with the above – mentioned range in the first
octet is a Class D address.
The first four bits of a Class E address are always set to “1111” (shown in
Figure 6.13). Therefore, the first octet range for Class E addresses is 11110000
to 11111111, 240 to 255.
By inspection, we can automatically determine the network and the host portion
of an IP address through its corresponding IP address class. Unfortunately, our
computer doesn’t think that way.
For our computer to tell where to break the IP address apart to get the
abovementioned parts of an IP address, the IP address must be “ANDed” with its
default mask in binary.
Note: In case AND is unfamiliar, here is how it works in pairs of bits: If the input
is ALL one (1), the output is one (1), otherwise the output will be zero (0)
Input Output
x y F=xy
0 0 0
0 1 0
1 0 0
1 1 1
Table 6. 6: ANDing Equation
Example:
Solution:
By inspection:
By looking at the first octet of the given IP address, we can conclude that it is Class C,
since it belongs to the range of 192 to 223. Hence, by following the pattern for Class
C in Figure 6.13, we can say that:
By computation:
Note: The following steps will be illustrated by the instructor on the whiteboard for a
step-by-step process.
Step 1:
The fourth octet (33) in binary is equal to 00100001; 00 is added to the left side to
value to complete the 8–bit binary value.
Step 2:
“AND” the binary equivalent of the IP address with its equivalent default mask in binary.
Note: By referring to Table 6.2, it is understood that the default mask to be used is
225.255.255.0 and/or 11111111.11111111.11111111.00000000 when an IP Address
is in Class C.
By doing the above process, the network address is essentially the first three octets,
written either as 200.133.175 or 200.133.175.00, while the host address is the last
octet to the right, the 33.
Hence, ANDing a particular IP address with its corresponding default subnet mask in
binary extracts the network address. This just zeros out the host address portion of the
IP address.
Subnetting:
When “borrowing” bits from the host ID to create the subnet ID, it is needed to
accurately determine the following information:
Sample Problem:
Solution:
1) Determine the class and the default mask of the IP address you have
been given.
4) Once we have decided how many bits to use for the subnet ID, we can
determine the custom subnet mask for our network through changing
the leftmost zeroes of the default masks to ones based from the six (6)
bits as being instructed above. Please see example below.
6) List each subnet address starting with the incremental value determined
in step 5 and increase that value until the total number of available
subnets is reached. Get the total number of subnets available by using
the formula 2s – 2. The s component is the number of bits required to
support the total number of subnets.
Thus, 26 – 1 will be equal to 64 – 2 = 62.
7) Determine the number of host addresses that could support each
subnetwork by means of counting the remaining bits (zero’s) to the
right-hand side of the custom subnet mask and then use the formula 2h
- 2 to acquire the number of hosts. The h component is the number of
host bits in the custom subnet mask. For a host, the bit is 0, which
means it’s off.
Post-test:
I. Multiple Choice:
Read each statement carefully. You can write down your answers on a
separate answer sheet. (1 point each)
1) What is the correct order of layers in the TCP/IP model from highest
to lowest?
a) Application, b) Network Access,
Transport, Internet, Internet, Transport,
Network Access Application
c) Transport, d) Internet, Transport,
Application, Application, Network
Internet, Network Access
Access
2) Which of the following is a feature of IPv6 over IPv4?
a) Smaller address b) Dotted decimal
space notation
c) Larger address d) Deployed in 1981
space
3) Which class of IP address provides the largest number of host
addresses?
a) Class A b) Class B
c) Class C d) Class D
4) What is the primary purpose of subnetting?
a) To reduce the b) To increase network
number of IP traffic
addresses
available
c) To create smaller, d) To change the physical
manageable network layout
network segments
5) What does the MAC address uniquely identify?
a) A network protocol b) A network interface
card
c) An IP address d) A subnet mask
6) What is the role of a default gateway in a network?
a) To assign IP b) To provide data
addresses to hosts storage
c) To forward packets d) To filter traffic based on
to other networks MAC addresses
7) How many layers does the OSI model have compared to the TCP/IP
model?
a) OSI has 4 layers, b) OSI has 7 layers,
TCP/IP has 7 TCP/IP has 4 layers
layers
c) Both have 7 layers d) Both have 4 layers
8) What is the structure of an IPv4 address?
a) 16-bit hexadecimal b) 32-bit binary notation
notation
c) 128-bit dotted d) 32-bit dotted decimal
decimal notation notation
9) What does a subnet mask do?
a) Identifies the host b) Identifies the network
portion of an IP portion of an IP
address address
c) Assigns IP d) Encrypts data packets
addresses to hosts
10) Who usually assigns IP addresses within a network?
a) The ISP b) The network
administrator
c) The default d) The MAC address
gateway
Answer Key with explanation:
1) A - The TCP/IP model layers are ordered from highest to lowest as Application,
Transport, Internet, and Network Access.
2) C - IPv6 has a larger address space than IPv4, using 128-bit addressing scheme
compared to IPv4’s 32-bit.
3) A - Class A IP addresses use only one octet for the network identifier, leaving
three octets for host addresses, providing the largest number of host addresses.
4) C - Subnetting is used to divide a larger network into smaller, more manageable
segments or subnetworks.
5) B - The MAC address uniquely identifies a network interface card (NIC) on a
network.
6) C - The default gateway is used to forward packets from a local network to other
networks.
7) B - The OSI model has 7 layers, while the TCP/IP model has 4 layers.
8) D - An IPv4 address is structured in a 32-bit dotted decimal notation.
9) B - A subnet mask identifies the network portion of an IP address.
10) B - The network administrator or internet service provider usually assigns IP
addresses within a network
Reference:
Mueller, S. (2013). Upgrading and Repairing PC's 21st Edition. Indianapolis, Ind.:
Que
Oliviero, A. (2014)., Cabling: the complete guide to copper and fiberoptic networking,
5th ed. Indianapolis, IN: John Wiley and Sons