DNS? Ports? DHCP? What are those?

Photo by JJ Ying on Unsplash

DNS? Ports? DHCP? What are those?

Having a basic understanding of networking fundamentals will follow and serve you will in any IT role you pursue, so let's go over some of the

What is a network? A network is often defined as a group of devices, thought of primarily as computers and servers, but a modern network will also include devices like phones, mobiles, sensors and alarms. These devices likely the require the need to communicate with each other and transfer information. It achieves this through networking.

🌍 IP Address (Internet Protocol Address)

The IP address (we're talking IPv4 here, we will cover IPv6 another day) is unique address that identifies a device on a network. It is a numerical address made up of four octets, consider it the identifier for a device that allows information to be sent between each other on a network. Some IP addresses and address blocks are reserved for specific purposes which you can read more about here.

🍺 CIDR (Classless Inter-Domain Routing)

CIDR, pronounced Cider, was created as a alternative approach to subnetting. As this is the way I learnt subnetting I will be explaining this approach, if you want to read up about the older, 'subnet mask' approach, you can do so here.

CIDR was introduced in 1993 by the Internet Engineering Taskforce (IETF) to fix the problem of exhausting IPv4 addresses as it allows networks to be divided into address spaces of difference sizes.

A CIDR address is made up of two sets of numbers, one which is the IP address and the CIDR suffix which dictates the total number of bits in the entire address. A CIDR notation will look something like 10.0.0.0/8 with 8 being the number of bits in the address.

Take for example, a network with the CIDR notation 172.16.0.0/16. With a /16 CIDR block we could use any address from 172.16.0.0 all the way to 172.16.255.254. This would result in a rather large subnet that would be harder to manage and lead to a lot of wasted IP addresses.

Blank diagram (2).png

A much better approach would be chop this up and create individual subnets for a specific service or product. For example we could split it up into three subnets, one for the database, application and front end servers. This would be easier to manage, segregate services, implement security whilst providing the flexibility to add more subnets in the future.

Blank diagram (1).png

🔌Ports

A port can be thought of as a logical tunnel which data can be sent and received to a specific application. When a host computer attempts to connect to a server, they also indicate the service they wish to communicate, this is so the data is sent to the correct application. For example 443 for HTTPS, 22 for SSH and 3389 for RDP.

The combination of an IP address and port number together are called a socket. I talk about them briefly here.

➡️DNS (Domain Name System)

Imagine for every website you wanted to visit, or computer you wish to remote onto you, had to remember it's IP address. It would be a nightmare! This is where DNS helps out!

DNS is a naming database where IP addresses, such as 172.217.169.35 are stored and translated into human readable names like Google.com. Some people like to think of it as a phonebook.

When you navigate to a website address, a server in the background will check if it has the corresponding IP address for that DNS record, if it doesn't have the record it will query other servers to see if they have it. Three DNS server types work together to get this result in the following order: DNS Root name servers, top-level domain name servers and authoritative name servers.

A domain name is made up of multiple segments called labels and are read from left to right. A simple example of a domain hierarchy can be seen below. Blank diagram (1).png

⚙️DHCP (Dynamic Host Configuration Protocol)

Every device on a network must be allocated a unique IP address to access resources and communicate with other devices on the same network. DHCP manages and automates the allocation process along with providing the additional needed configuration such as subnet mask and default gateway, a process which done manually would cause the mother of all headaches.

DHCP maintains what is called a 'pool' of IP addresses available and will 'lease' an available address to a device which is DHCP-enabled when it connects to the network. When leased, the DHCP server will often check in with the host and check it is still active, if it is, it will extend the lease, if it isn't, it will take the address back and add it to as available. DHCP can manage numerous pools.

Blank diagram (1).png