IP Addressing: Format of An IP Address
IP Addressing: Format of An IP Address
An Internet Protocol address (IP Address) is a numerical label assigned to each device
connected to a computer network that uses the Internet Protocol for communication.
IP address has information about how to reach a specific host, especially outside the LAN.
An IP address serves two principal functions
i) host or network interface identification and
ii) location addressing.
An IP Address is a 32-bit unique address.
An IP address always consists of 4 numbers separated by periods, with the numbers having a
possible range of 0 through 255.
Example of IP address is 192.168.12.1
Format of an IP address
There are two notations in which IP address is written
i) dotted decimal notation and
ii) hexadecimal notation.
The format of the IP address differs with the class the IP address belongs to.
Classes of networks
IP addresses belong to five different network classes namely Class A, Class B, Class C,
Class D and Class E.
Classes A, B and C are the most important.
The first bits of the class determine which class an address belongs to.
The classes differ in how much of the address is taken up with the network address and
how much with the host address.
1
Class A
The IP address has 1 – 126 in the first octet. For example, 126.168.252.12 has 126 in
the first octet which falls in the range 1 to 126.
The first octet (the first 8 bits) is the network portion and the Octets 2, 3, and 4 (the next
24 bits) are for the hosts.
Class A addresses are used for networks that have more than 65,536 hosts (actually, up to
16777214 hosts!).
Class B
The IP address has 128 - 191 in the first octet. For example, 186.234.252.12 has 186 in
the first octet which falls in the range 128 to 191.
The first two octets (the first 16 bits) is the network portion and the Octets 3 and 4 (the
next 16bits) are for the hosts.
Class B addresses are used for networks that have between 256 and 65534 hosts.
Class C
The IP address has 192 - 223 in the first octet. For example, 192.168.12.2 has 192 in
the first octet which falls in the range 192 to 223.
The first three octets are the network portion. Octet 4 (8 bits) is for local subnets and
hosts
Class B is for networks with less than 254 hosts.
Class D
Class E
2
For example, Class A has the first 8 bits reserved for the Network part (Net ID) and the
last 24 bits are for the hosts portion (Node ID).
Task
a) 4.23.145.90
b) 227.34.78.7
c) 246.7.3.8
d) 129.6.8.4
e) 198.76.9.23
Types of IP Addresses
Two types of IP addresses are IPv4 and IPv6
IPv4 Addresses
The version that the Internet and most routers are currently configured for is IPv4 (Internet
Protocol Version 4).
3
IPv4 uses 32-bit addresses e.g. 12.244.233.165
It is limited only to 4,294,967,296 possible unique addresses. This means that as many
devices are connected to the internet the addresses will soon be used up.
IPv6 Addresses
As many devices are now connected on the internet, it means many IP addresses are required.
IPv6 would allow IP Address allocations to networks without any foreseeable problem with
the amount of addresses available.
IPv6 (Internet Protocol Version 6) can accommodate many addresses than the IPv4.
IPv6 that has 128-bit addresses e.g. 2001:0db8:0000:0000:0000:ff00:0042:7879.
However, in order to use IPv6 addresses existing routers and hardware would need to be
upgraded or configured to use this new version of IP addresses.
IPv4 and IPv6 cannot communicate with other but can exist together on the same network. This
is known as Dual Stack.
4
The private addresses in a network don't have to be synchronized with the rest of the world
and internet.
Private IP addresses are not unique throughout the world as your neighbor can use the same
Private addresses without any problem, because that's his or her network, not yours.
Direct access to the internet using a private IP address is not possible. In this case, the
connection to the internet is via NAT (network address translation that replaces the private IP
address with a public one).
Important! The use of a private IP address is more secure than the use of a public IP address, as
private IP addresses are not directly visible on the internet and are behind NAT, which also
ensures the security of the home network.
5
Network Address Translation (NAT)
NAT is a process in which a router changes a private IP Address into a public IP address
so that it can send traffic over the Internet, keeping track of the changes in the process.
When the information comes back to your router, it reverses the change from a real IP
address into a private one and forwards the traffic back to your computer.
In order to make sure that responses get back to the right hosts when packets are sent out into
the Internet, the router will construct a table associating outgoing packets with private IP
addresses; the address of the relevant table entry will be stored in the packet itself.
Subnet mask
A sub mask is a 32-bit combination which helps identify which portion of the address
identifies the subnet and which portion of the address identifies the node/host.
The subnet mask is used by the TCP/IP protocol to determine whether a host is on the local
subnet or on a remote network.
For example, 255.0.0.0 is the default subnet mask for Class A.
6
Example of IP settings
Default gateways
If a TCP/IP computer needs to communicate with a host on another network, it will usually
communicate through a device called a router.
A router that is specified on a host, which links the host's subnet to other networks, is called a
default gateway.
7
DNS Servers
DNS server is a server responsible for keeping the file that contains information about
the domain name(s) and corresponding IP addresses (zone file) as well as for providing the
above-mentioned information during DNS queries.
DNS servers are mostly provided by your Internet service provider (ISP).
Your computer may be using the router as its DNS server, but the router is forwarding
requests to your ISP’s DNS servers.
DNS servers match domain names to their associated IP addresses. When you type a domain
name into your browser, your computer contacts your current DNS server and asks what IP
address is associated with the domain name. Your computer then connects to the IP address
and retrieves the right web page for you.
Questions
1. Explain the format of an IP address. [2]
2. Distinguish between a MAC address and IP address. [4]
3. Explain the role of a Domain Name System [2] ZIMSEC 2019
4. Compare and contrast public IP address and private IP address. [6] ZIMSEC 2019
5. Compare the OSI model and TCP/IP models clearly showing any four differences between
the two models. [4] ZIMSEC 2019
6. Describe how Domain Name Servers (DNS servers) optimize searches on the internet. [4]