Lab 6 - IPv4 Addressing
Lab 6 - IPv4 Addressing
Lab 6
IPv4 Address Structure
Binary Notation
A string of 32 bits is difficult to interpret and even more difficult to remember. Therefore, we represent IPv4
addresses using dotted decimal format instead of binary.
In IPv4, addresses are 32-bit binary numbers. However, for ease of use by people, binary patterns representing
IPv4 addresses are expressed as dotted decimals. This is first accomplished by separating each byte (8 bits) of
the 32-bit binary pattern, called an octet, with a dot. It is called an octet because each decimal number
represents one byte or 8 bits.
Each octet is made up of 8 bits and each bit has a value, either 0 or 1. The four groups of 8 bits have the same
set of valid values in the range of 0 to 255 inclusive. The value of each bit placement, from right to left is 1, 2,
4, 8, 16, 32, 64, and 128.
Determine the value of the octet by adding the values of positions wherever there is a binary 1 present.
If all 8 bits are 1s, 11111111, the value of the octet is 255 (128+64+32+16+8+4+2+1)
If the 8 bits are mixed, the values are added together. For example, the octet 00100111 has a value
of 39 (32+4+2+1).
So the value of each of the four octets can range from 0 to a maximum of 255.
Reference : http://teachweb.milin.cc/datacommunicatie/tcp_osi_model/network_layer/ipv4.htm
https://www.geeksforgeeks.org/introduction-of-classful-ip-addressing/
Using the 32-bit IPv4 address, 11000000101010000000101000001010, convert the binary
representation to dotted decimal using the following steps:
Sample Questions
1. 11000000.10101000.00001110.10000011
2. 10101100.00010000.10000000.00000001
3. 00001000.10100111.10101010.00101101
Videos: https://www.youtube.com/watch?v=Y5yk4UJMq2A
https://www.khanacademy.org/math/algebra-home/alg-intro-to-
algebra/algebra-alternate-number-bases/v/number-systems- introduction
https://www.youtube.com/watch?v=dhjgLwqsUI8
https://networklessons.com/subnetting/subnetting-in-binary
Reference : http://teachweb.milin.cc/datacommunicatie/tcp_osi_model/network_layer/ipv4.htm
https://www.geeksforgeeks.org/introduction-of-classful-ip-addressing/
Converting from Decimal to Binary
In addition to being able to convert binary to decimal, it is also necessary to understand how to convert
decimal to binary.
Because we represent IPv4 addresses using dotted decimal format, it is only necessary that we examine
the process of converting 8-bit binary to the decimal values of 0 to 255 for each octet in an IPv4 address.
To begin the conversion process, we start by determining if the decimal number is equal to or greater than
our largest decimal value represented by the most-significant bit. In the highest position, we determine if
the octet number is equal to or greater than 128. If the octet number is smaller than 128, we place a 0 in
the bit position for decimal value 128 and move to the bit position for decimal value 64.
If the octet number in the bit position for decimal value 128 is larger than or equal to 128, we place a 1 in
the bit position for decimal value 128 and subtract 128 from the octet number being converted. We then
compare the remainder of this operation to the next smaller value, 64. We continue this process for all the
remaining bit positions.
Sample Questions
1. 12.11.10.4
2. 180.16.10.4
3. 220.150.11.3
Videos: https://www.youtube.com/watch?v=ec2AA4TfUow
https://www.youtube.com/watch?v=ImJSldHR0WA
https://www.youtube.com/watch?v=PZpGF25oES4
https://www.youtube.com/watch?v=uE5gdwr1mE0
Reference : http://teachweb.milin.cc/datacommunicatie/tcp_osi_model/network_layer/ipv4.htm
https://www.geeksforgeeks.org/introduction-of-classful-ip-addressing/
Classful Addressing
These are addressing space that is divided into five classes namely Class A,Class B, Class C and Class
E. Note Class A,B and C has valid IP addresses in which the order of bits in the first octet determine
the classes of IP address . Also it should be known that Class D and Class E are used for experimental
needs and reserved for multicast.
Network ID (N)
Host ID (h)
Classful
IPv4
Private
addresses
Reference : http://teachweb.milin.cc/datacommunicatie/tcp_osi_model/network_layer/
ipv4.htm https://www.geeksforgeeks.org/introduction-of-classful-ip-addressing/
Private Addresses
Reference : http://teachweb.milin.cc/datacommunicatie/tcp_osi_model/network_layer/ipv4.htm
https://www.geeksforgeeks.org/introduction-of-classful-ip-addressing/