Determine the network prefix and host suffix for an IPV4 address
Class | IP address in "dotted decimal" notation | IP address in binary |
A | 64.200.128.3 | 01000000.11001000.10000000.00000011 |
B | 160.200.128.3 | 10100000.11001000.10000000.00000011 |
C | 202.200.128.3 | 11001010.11001000.10000000.00000011 |
Class A address: The leftmost bit of the leftmost field of the binary representation is 0.
Class B address: The leftmost two bits of the leftmost field of the binary representation are 10.
Class C address: The leftmost three bits of the leftmost field of the binary representation are 110.
The leftmost bit is used only to identify the type of address, therefore it is not part of the actual address. The remaining bits of the leftmost field (in the above example, 1000000) constitute the network prefix (which identifies a particular subnet within the Internet). The remaining fields (11001000.10000000.00000011) are concatenated to form the host suffix (which identifies a particular computer within a subnet).
Therefore, in the above example,
The leftmost two bits are used only to identify the type of address, therefore they are not part of the actual address. The remaining bits of the leftmost field (in the above example, 100000), concatenated with the second-leftmost field (11001000) constitute the network prefix. The remaining fields (10000000.00000011) are concatenated to form the host suffix.
Therefore, in the above example,
The leftmost three bits are used only to identify the type of address, therefore they are not part of the actual address. The remaining bits of the leftmost field (in the above example, 01010), concatenated with the second- and third-leftmost fields (11001000.10000000) constitute the network prefix. The remaining field (00000011) forms the host suffix.
Therefore, in the above example,
column 111111111122222222223 123456789012345678901234567890 line 1:64.200.128.3[EOL] 2:160.200.128.3[EOL] 3:202.200.128.3[EOL] 4:127.255.255.255[EOL] :[EOF]
column 111111111122222222223333333333 123456789012345678901234567890123456789 line 1:Program 2 by team 0[EOL] 2:prefix = 64 suffix = 13139971[EOL] 3:prefix = 8392 suffix = 32771[EOL] 4:prefix = 706688 suffix = 3[EOL] 5:prefix = 127 suffix = 16777215[EOL] 6:End of program 2 by team 0[EOL] :[EOF]