Exploring the Internet Protocol

IP is a primary communication protocol that is used to deliver a datagram across networks. The datagram itself is a transfer unit associated with a packet-switched network. The role of IP is to deliver packets from the host to the host based on the IP address, which is stated in the packet's header. There are two versions of IP that are commonly used nowadays, which are IPv4 and IPv6.

Internet Protocol Version 4 – IPv4

IPv4 has become the standard IP address since 1980s and is used to obtain TCP/IP traffic from a computer to another over the network. An IP address is unique for every device connected over the Internet, and all devices can communicate with each other over the Internet as long as they have a valid IP address.

A valid IP address is constructed by four decimal numbers that are separated by three dots. The address only contains a decimal number from 0 to 255. We can say that 10.161.4.25 is a valid IP address since it contains four decimal numbers between 0 to 255 and is separated by three dots, while 192.2.256.4 is an invalid IP address because it contains decimal numbers greater than 255.

The decimal numbers actually convert the result from 8 binary digits. So, for the maximum 8-bit number, we will have 1111 1111 or 255 in decimal. This is why the range of a decimal number in an IP address is from 0 (0000 0000) to 255 (1111 1111).

To know our IP address configuration, we can use the ipconfig /all command again in our Command Prompt window. Then, it will display the output as follows:

Wireless LAN adapter Wi-Fi:
   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::f14e:d5e6:aa0a:5855%3
   IPv4 Address. . . . . . . . . . . : 10.1.6.165
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 10.1.6.1

The output will show the IP address in the IPv4 address and the IPv6 address. We can also see that in my device, 10.1.6.1 is used as a default gateway of the system. The Default Gateway parameter is a point on the computer network that is used to provide a path for the unmatched IP address or subnets.

An IP address must contain these two components: a network ID to identify the subnetwork or subnet where the computer is located and a host ID to identify the computer within that subnet. Every network ID indicates a group of hosts on a subnet of a network. Devices that have the same network IDs must have unique host IDs. If two or more devices have the same host ID and the same network ID (the IP address is the same for all four decimal numbers), there will be an IP address conflict.

For local networks, the subnet mask is used to identify the portion of a network ID and a host ID in the IP address. The following are a few common subnet masks:

  • 255.0.0.0
  • 255.255.0.0
  • 255.255.255.0

Imagine that we have the IP address 190.23.4.51 and the subnet mask 255.255.0.0. Now, we can find the network ID using the Boolean AND logic for each bit of the IP address corresponding to the subnet mask. The following table will convert the IP address and subnet mask into a binary digit and then use the Boolean AND logic to find out the network ID:

 

1st Octet

2nd Octet

3rd Octet

4th Octet

190.23.4.51

1011 1110

0001 0111

0000 0100

0011 0011

255.255.0.0

1111 1111

1111 1111

0000 0000

0000 0000

Network ID:

1011 1110

0001 0111

0000 0000

0000 0000

From the preceding table, we can obtain the network ID, which is 190.23.0.0.

The adjacent maximum number has to be applied in a subnet mask. This means that if the first zero is decided to be used, the remaining numbers have to be zero. So, a subnet mask of 255.0.255.0 is invalid. A subnet mask is also not allowed to begin with zero. This means that a subnet mask of 0.255.0.0 is invalid as well.

IPv4 can be classified into three primary address classes: Class A, Class B, and Class C. The class of the address is defined by the first number in the IP address and the subnet mask is predefined for each class. Here are the three ranges for each class:

Class

The first number

Range of the IP address

Subnet mask

Class A

1 to 126

1.0.0.0 to 126.255.255.254

255.0.0.0

Class B

128 to 191

128.0.0.0 to 191.255.255.254

255.255.0.0

Class C

192 to 223

192.0.0.0 to 223.255.255.254

255.255.255.0

Our computer is able to determine the class of the IP address by just looking at the first two bits after converting the first decimal number in the IP address. For instance, in Class A with the range 1 to 126, the binary digit is between 0000 0001 to 0111 1110. The first two bits might be 0 and 0 or 0 and 1. Class B with the range from 128 to 191 has the range in binary digits from 1000 0000 to 1011 1111. This means that the highest first bit is always 1 and the second is always 0. Class C with the range from 192 to 223 has the range in binary digits from 1100 0000 to 1101 1111. The bits will be all 1 for the first two bits. Refer to the following table to conclude how a computer determines the class of an IP address by just checking the first two bits of the IP address (here, X is ignored and can be any hexadecimal character):

Class

First number in binary digits

Class A

00XXXXXX

01XXXXXX

Class B

10XXXXXX

Class C

11XXXXXX

By classifying the IP address, we can also determine the subnet mask by just looking at the IP address because each class has a different subnet mask, shown as follows:

Class

Range

Subnet Mask

Class A addresses

0 -126

255.0.0.0

Class B addresses

128 to 191

255.255.0.0

Class C addresses

192 to 223

255.255.255.0

By knowing the subnet mask, we can easily know the network ID. Suppose that we have these three IP addresses:

  • 174.12.1.8
  • 192.168.1.15
  • 10.70.4.13

Now, we can determine the network ID as follows:

The IP address

Class

Subnet mask

The Network ID

174.12.1.8

Class B

255.255.0.0

174.12.0.0

192.168.1.15

Class C

255.255.255.0

192.168.1.0

10.70.4.13

Class A

255.0.0.0

10.0.0.0

A subnet mask is also able to reference with an indicator known as Classless Inter-Domain Routing (CIDR), which is defined based on the number of bits. For instance, the subnet mask 255.0.0.0 uses 8 bits (a bit with the value of 0 is considered as unused bits), so it is referenced as /8. Similarly, the subnet mask 255.255.0.0 uses 16 bits and can be referenced as /16, and the subnet mask 255.255.255.0 uses 24 bits and can be referenced as /24. These are the CIDR notations for our previous IP address sample:

IP address

Subnet mask

CIDR notation

174.12.1.8

255.255.0.0

174.12.1.8 /16

192.168.1.15

255.255.255.0

192.168.1.15 /24

10.70.4.13

255.0.0.0

10.70.4.13 /8

Internet Protocol Version 6 – IPv6

IPv6 contains 128 bits and is launched to improve IPv4, which only consists 32 bits. With 32 bits in IPv4, it can address 4,294,967,296 addresses. The number was very high at the beginning, but now it has become insufficient because there are many devices that need an IP address. IPv6 is created to solve the problem because it can address more than 340,000,000,000,000,000,000,000,000,000,000,000,000, or about 3.4028e+38, which is more than enough—at least for now.

Note

IPv5 had been developed so that it consisted of 64 bits, but it was never adopted because it was believed that the Internet would run out of IP addresses quickly if it was used.

The prominent difference between the IPv4 address and IPv6 address is that instead of displaying the IP address in decimal numbers, IPv6 expresses the address in hexadecimal characters. We can determine whether it is IPv4 or IPv6 at first sight by just looking at this format number. We can call the ipconfig /all command to know our IPv6 address and see it in the Ethernet Adapter Network. I have fe80::f14e:d5e6:aa0a:5855%3, but yours must be different. The address itself is fe80::f14e:d5e6:aa0a:5855, and the last %3 variable is a zone index that is used to identify the network interface card. The number fe80 in the first IPv6 address is stated as a link-local address, which is an IP address that is automatically assigned on the network because it is not automatically configured by DHCP or has not been manually configured yet.

As we know, IPv6 is actually a set of 128 bits and converts its bits into a hexadecimal character in order to simplify its notation. Consider that we have a set of binary digits that form IPv6, as follows:

0010 0000 0000 0001 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0100 1111 0000 1001 0111 0011
1111 0101 1111 1110 1111 1000 1011 0110

Instead of memorizing all these digits, it is easier if we convert it into the IPv6 address format. First, we convert each four digits group into a hexadecimal character and we will get these hexadecimal characters:

2001000000000000004f0973f5fef8b6

Second, we separate each set of four characters with a colon, as follows:

2001:0000:0000:0000:004f:0973:f5fe:f8b6

Third, we can throw out the leading zero in each four digit collection, as follows:

2001:0:0:0:4f:973:f5fe:f8b6

Fourth, we collapse the consecutive zero groups into an empty group, shown as follows:

2001::4f:973:f5fe:f8b6

Now it is easier for us to memorize this IPv6 address.

Note

An empty group, which is indicated by two colons (::), means inserting as many as zeros as needed to form this address into 128 bits. IPv6 address is not allowed to have more than one empty group since it will be confusing for us to determine how many zeros there are in each empty group.

Similarly, with IPv4, which classifies the IP address by looking at the first number (the first two bit actually), the type of IPv6 can also be identified by looking at its prefix. This is how we write all the addresses that have a network ID 2001:04fe that begins with a 32-bit prefix:

2001:04fe:: /32

This means that the first 32 bits of all addresses are 0010 0000 0000 0001 000 0100 1111 1110. However, to ease the reading of this address, we use a hexadecimal character instead.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset