(TWN) DevOps Prerequisite: Computer Networking Essentials
Computer networks are fundamental to modern computing. Computer networks allow us to share/pool resources such as sharing of printer or servers for those in a network.
As a DevOps engineer, understanding computer networks enhances our ability to build, deploy, and maintain scalable, secure, and efficient systems.
In this blog post, we will look at:
How do Computer Networks work? How do computers connect to the internet? What is an IP address?What is DNS?
What is a Local Area Network (LAN) ?
Local Area Network (LAN):
- Collection of devices connected together in a physical location.
- Each device has a unique IP address.
- Devices communicate via their IP addresses.
IP (Internet Protocol): Can range from D.O.D.O (0.0.0.0) to 255.255.255.255.
How do devices know each other's IP addresses?
Switch:
- Links all the devices to their IP addresses.
- Facilitates the communication of all devices within the LAN.
Router:
- Connects outside the LAN.
- Sits between LAN and Wide Area Networks (WAN).
Important Note: The IP address of the router is called a gateway. Router & Network gateway are the same thing.
What is a subnet?
- Logical subdivision of an IP set network.
- Splits a network into 2 or more networks.
What is a subnet Mask?
Defines how many bits in the IP address are fixed and makes the rest flexible.
Questions to consider:
When to assign an IP address or range?
18 IP addresses → 192.168.0.1
Subnet Mask → 255.255.255.0
The subnet mask basically tells us the range of IP addresses that are available.
Examples:
For 192.168.0.0/10:
Subnet Mask: 255.255.255.0 (fixed)
Flexible part: variable
For 192.168.0.0/24:
Subnet Mask: 255.255.255.0 (fixed)
Flexible part: variable
Any device needs 3 pieces of data for communication:
1. IP Address
2. Subnet
3. Gateway
What is a Network Address Translation (NAT)?
NAT is described as a function (or process) performed by a device.
Public IP → Communication with the outside internet
Private IP → Communication within your local network
Firewall:
A system that prevents unwanted access from outside a private network. It controls which IP addresses can access your server.
Ports and Services
What is a port?
Each device has a set of ports.
You can allow specific ports (doors). Different applications listen on specific ports:
Standard ports for many applications:
Web browsers → Port 80
Databases → Port 3306
For every application, you need a port. Each port is unique on a device.
Additional Concepts
Firewall Configuration: Allows a specific combination of device IP addresses and ports to be accessed.
Port Forwarding Configuration: Ensures that specific ports are accessible.
Domain Name Service (DNS): Maps IP addresses to names. Translates domain names to IP addresses.