Networking Fundamentals

Network Fundamentals for DevOps
A few weeks ago I started learning computer networking from scratch - from physical internet (Devices, LAN,WAN,MAN, etc.), internet addressing, OSI model, TCP/IP model, DNS, Network Security, VPC.
But in this series I am only going to go over the topics that are really important for learning DevOps.
Let's start it with an example to try to understand what we are actually trying to learn before we jump to the models.
Lets say I place an order for an item on amazon --> the seller receives my order --> the item is packed --> the delivery person brings it to my home.
The Amazon app is where I choose and order the product.
Amazon records my order and delivery address.
The warehouse packs the correct item.
The delivery system makes sure it reaches me reliably.
The delivery person follows the correct route, and finally, the package physically travels from the warehouse to my home.
Computer network works in a similar way. Data travel's from one device to another, often across multiple networks, routers, switches, servers, and even continents.
For this communication to actually work we have two very important models.
The OSI Model
The TCP/IP Model
With the help of these models we can understand how data moves from one layer to another from a source to destination. Each layer has a specific responsibility and works with the layers above and below it. This makes networking easier to understand and troubleshoot.
The OSI Model
The OSI (Open Systems Interconnection) Model divides network communication into seven layers.
Starting from the top:
Physical Layer - responsible for transmitting raw data bits through physical network hardware.
Data Link Layer - handles communication between devices on the same local network. It uses Mac addresses to identify network interfaces.
Network Layer - Responsible for moving data between different networks. This layer handles IP addressing, routing and packet forwarding.
Transport Layer - responsible for delivering data between applications. Two important protocols that operate at this layer are TCP and UDP.
Session Layer - manages communication sessions between two systems. It is responsible for establishing a session, maintaining a session and terminating a session.
Presentation Layer - responsible for how data is formatted and represented. Encryption, Decryption, Compression and Data formatting are its responsibilities.
Application Layer - network services interact with applications used by the user on the application layer. It provides protocols that applications use to communicate over a network.
E.g. HTTP/HTTPS, DNS, FTP, SMTP, SSH.
The TCP/IP Model
Unlike the OSI model the TCP/IP model has only four layers.
Application Layer - Applications interact with the network. It also handles data formatting, provides encryption for secure communication and manage sessions to track ongoing connections. Which means the application, presentation and session layer from the OSI model becomes the application layer in the TCP/IP model.
Transport - Ensures reliable and efficient delivery of data between devices, managing segmentation, ordering, and retransmission as needed.
Internet - Responsible for addressing, packaging, and routing data packets so they can travel across networks and reach the correct destination device.
Network Access - Responsible for physically transmitting data over network hardware, including cables, switches, and wireless connections. It handles how data is formatted as well. Which also means the data link and physical layer from the OSI model becomes the Network access layer in the OSI model.
IP Addressing
IP addressing is like assigning an address to a device on the network.
From our amazon example, just like the we need an address to get our item delivered to, a network needs an IP address to know where the data needs to go.
E.g. My Laptop IP - 192.168.1.10
An IP address has two parts -
- Network Portion - This identifies the network.
2. Host Portion - This identifies a specific device within that network
E.g. 192.168.1.10/24
Here, 192.168.1 --> network portion and .10 --> host portion
The most common IP addressing system is IPv4.
IPv4 Address
192.168.1.10 --> This is how an IPv4 address looks like. It consists of four octets and each octet has a value from 0 - 255.
Subnet
A smaller network created from a larger network is called a subnet.
E.g. Imagine a three-sided building called Marine Heights.
Marine Heights has 30 apartments on a single floor. Initially, you can think of the entire building as one large network.
Now, the building committee decides to divide the building into three separate wings:
Marine Heights – Wing A
Marine Heights – Wing B
Marine Heights – Wing C
Instead of having one large section with 30 apartments, each wing now contains 10 apartments.
This makes it easier to identify which section of the building a particular apartment belongs to.
For example:
Marine Heights
│
├── Wing A
│ ├── Apartment 1
│ ├── Apartment 2
│ └── ...
│
├── Wing B
│ ├── Apartment 11
│ ├── Apartment 12
│ └── ...
│
└── Wing C
├── Apartment 21
├── Apartment 22
└── ...
This is similar to subnetting.
Marine Heights = The original large network
Each wing = A subnet
Each apartment = A device or host with an IP address
Subnetting takes one large network and divides it into smaller, more organized networks.
For example, instead of having one network, we can divide it into smaller subnets.
The same way that splitting Marine Heights into Wing A, Wing B, and Wing C makes the building easier to organize, subnetting makes a large network easier to manage, organize, and control.
Ports
A port identifies a specific service on a device. The IP gets you to the machine; the port gets you to the right application on it.
Some commonly used ports while working in DevOps are:
My take aways: A huge amount of "networking" in cloud/DevOps work isn't deep protocol theory it's knowing that an IP gets you to a machine, a port gets you to a service on that machine, and TCP vs UDP is about whether you need delivery guaranteed.
Resources for reference:
https://youtu.be/xN3BKHji12I?si=tTupCvhrLIlu-4GU
https://youtu.be/fQbBPa0ADvs?si=55S3zFNOZ36WKd46
All the images in the blog are AI generated.


