As I wrote in a past article, an IP address has a network and a host portion. We also discussed about the fact that a network prefix tells us how many bits in the address represent the network portion.
To define the network and host part of an address, the devices use the subnet mask represented on a 32 bit pattern. The subnet mask is created by adding a binary 1 for each bit that belongs to the network part, and a 0 for each bit in the host part.
We have as an example an IP address of 192.168.0.1/24 where /24 is the prefix length of the network.
We will use the same notation as above, green for host bits, blue for network bits.
In networking, a gateway is most commonly a router interface while on a TCP/IP network it serves as an access point to another network.
The default gateway is the route or the interface where the traffic will be sent to, when an IP address does not match any route in the routing table.
In other words a computer or a device knows some routes due to the directly connected networks, but it doesn’t know the route to any network. However it will know another interface or route where to send the traffic in order to be delivered to the final destination. The gateway will be on the same subnet as the device. All the traffic that does not match any route on a device, will be sent to this gateway.
A Domain Name Service resolves queries of any Internet resource (for example computers and services and many more) into IP addresses. All the Internet resources have a name and an IP. The IPs are used for devices to communicate between themselves, while for people it is more easy to remember names.
When we go and type a website name inside a browser, we will say we are accessing for example www.compinfopro.com. However, computers over the Internet will use IP addresses on their binary form to communicate and move data from client to server and backwards and hand you the information you requested on your browser. This is done with the help of the DNS. If we had no DNS running for us, we would have to type the IP address inside a browser, for example http://18.104.22.168 instead of www.compinfopro.com, where names are much more easy to remember than IPs.