Networking For DevOps 1739101246
Networking For DevOps 1739101246
What is a Network?
When two or more computers and computing devices connected together with each other
through communication channels, such as cables or wireless media and sharing some files,
then it is called a Network
A network is used to:
The Internet is the largest network in the world and can be called "the network of networks".
Types of Networks
There are different types of networks. But the main two are LAN and WAN
1. LAN (Local Area Network) - interconnects computer within a limited area, such as
residences, schools. e.g. Wi-Fi, Ethernet
2. MAN (Metropolitan area network) - used in metropolitan area (cities).
3. WAN (Wide Area Network) - extends LAN over a large geographic area. e.g:- optical
fiber cable
4. SONET (Synchronous Optical Network) - used in submarine.
Network Components:
2. Switch: Like a postal sorting centre for your local network. It connects different devices
within the same network (like your computer, printer, and smart TV) and makes sure data
gets to the right device.
3. Modem: The translator between your home network and the internet. It converts the
internet signal from your service provider into something your devices can understand.
4. Network Cable (Ethernet): The physical road that data travels on. Just like cars need roads,
data needs cables to move between devices when using wired connections.
5. Wireless Access Point (WAP): Think of this as a radio tower for your network. It broadcasts
your network signal wirelessly so devices can connect without cables. Your home WiFi router
usually includes this.
6. Firewall: The security guard of your network. It watches data coming in and going out,
blocking anything suspicious that might harm your network.
7. Network Card: Every device's ticket to join the network. It's like having the right pass to
enter a club - without it, your device can't connect to the network. It is known as Network
Interface Card which is used to connect your computer with the internet. It is wireless card preinstalled
on motherboard now-a-days. It has a MAC (Media Access Control) address.
8. Server: Like a library of information and services. It stores files, runs applications, and
provides services that other computers on the network can use.
What is Protocol?
A network protocol is a set of rules which is set up by people that determine how a particular data is
transmitted between different devices in the same network.
e.g. HTTP, TCP, IP, FTP, SMTP etc.
Types of IP Addresses
IPv4:
32-bit address, written as four numbers separated by dots (e.g., 123.89.46.7 ).
This is a 32-bit IP address, means it contains a combo of 32 (1 and 0's). In this version of IP
address there are 4 groups or Octets( 8 bits), and each octet is represented by a decimal value
in the address. It is easy to remember.
Commonly used, but limited number of addresses (about 4.3 billion)
IPv6:
128-bit address, written in eight groups of hexadecimal numbers
Provides a vastly larger pool of addresses, designed to replace IPv4 as it runs out.
Public IP:
Used to identify devices on the internet.
Assigned by ISPs and accessible globally.
Private IP:
Used within private networks (like home or office networks).
Not accessible from the internet; usually in ranges like 192.168.x.x , 10.x.x.x , or
172.16.x.x - 172.31.x.x .
Static IP:
Manually assigned, doesnt change.
Often used for servers and devices that need a consistent address.
Dynamic IP:
Automatically assigned by a DHCP (Dynamic Host Configuration Protocol) server.
Changes periodically; commonly used for home devices.
IP Address Classes (IPv4 Only)
There is an organization called IANA( Internet Assigned Numbers Authority) who divides the
IP address into different classes. You have to know about binary to decimal conversion to
understand this. IPv4 addresses are divided into five classes based on the starting number,
which determines their usage in networks.
Note:
Class A addresses in IPv4 officially start from 1.0.0.0 and go up to 126.0.0.0. The address
0.0.0.0 is not part of the Class A range and has a special purpose in networking.is a special
address, not part of the usable IP address range in Class A. The 127.0.0.0 to 127.255.255.255
range, especially 127.0.0.1, is reserved for loopback addresses in IPv4.
What is Loopback?
Loopback address allows a device to communicate with itself.
Its often used for testing network software on the local machine.
Key Points:
127.0.0.1 is commonly known as "localhost." Any IP address in the 127.x.x.x range will loop
back to the same device.
Useful for testing networking applications without needing an external network
There are two parts to an IP address Network ID and Host ID (Any device which gets the IP address is
called a Host).
The Network ID portion differs depending on the IP class
o Class A : 1st octet is the Network ID.
o Class B : 1st and 2nd octets are the Network ID.
o Class C : 1st, 2nd, and 3rd octets are the Network ID.
Direct Connection Devices with the same Network ID can connect without a router.
Router Requirement Devices with different Network IDs need a router to connect.
Subnet:
A subnet or subnetwork is a smaller network inside a large network. Subnetting makes network
routing much more efficient.
Example:
To create 4 subnets, each subnet will have 64 IP addresses. Here's how the subnets look:
CIDR (Classless Inter-Domain Routing): CIDR Classless Inter-Domain Routing) is a method for
allocating IP addresses and IP routing that replaces the older classful network system. It was
introduced to improve IP address utilization and simplify routing.
Network Models
There are mainly two types of network model –
The OSI Open Systems Interconnection) Model is a set of rules that explains how different computer
systems communicate over a network. OSI Model was developed by the International Organization
for Standardization ISO. The OSI Model consists of 7 layers and each layer has specific functions and
responsibilities.
1. Physical Layer Handles the physical connection between devices, transmitting raw data as bits
over cables, radio signals, etc.
2. Data Link Layer Manages data transfer between directly connected nodes. It handles error
detection and flow control. Examples: Ethernet, Wi-Fi.
3. Network Layer Manages packet forwarding and routing through the network. Uses IP
addressing. Example: IP Internet Protocol).
4. Transport Layer Ensures reliable data transfer with error correction and flow control.
Examples: TCP, UDP.
5. Session Layer Establishes, maintains, and manages communication sessions between
applications.
6. Presentation Layer Translates data formats to ensure compatibility between systems.
Handles encryption and compression. Example: SSL/TLS.
7. Application Layer Interfaces directly with the user and provides network services like HTTP,
FTP, SMTP.
Below is the list of protocols in each layer of the OSI model along with their port numbers (where
applicable):
SSL/TLS Port 443 for HTTPS, also used in other protocols): Encryption for secure data
transmission.
MIME Used for formatting email attachments.
JPEG/PNG Image formats used to encode multimedia files.
2. TCP/IP Model: The TCP/IP model, also known as the Internet Protocol Suite, is a simplified version
of the OSI model with only 4 layers instead of 7. This model is a real model which actually works in
real. This model consists of 4 layers.
Application Layer = Application Layer (Presentation Layer Session Layer) of OSI model
Transport Layer
Network Layer
Network Interface Layer = Data Link Layer Physical Layer) of OSI model
Web Services
Database Ports
Remote Access
Email Related
File Transfer
- WebSocket
When you type a website address (e.g., www.example.com ) into your browser, it needs to
know the IP address of that server.
The DNS process involves looking up the domain name and finding the corresponding IP
address through multiple DNS servers.
1. User Request:
2. DNS Query:
Your browser sends a request to a DNS server to get the IP address of www.example.com
3. DNS Resolution:
The DNS server checks if it has the IP address cached. If not, it contacts other DNS servers (root,
TLD, and authoritative servers) to find the IP address.
4. IP Address Found:
Once the IP address (e.g., 93.184.216.34) is found, the DNS server sends it back to your browser.
5. Connecting to the Website:
The browser uses this IP address to connect to the web server, and the website loads on your
screen .
Domains, Zones, and Delegation:
1. Domains
Domains are like branches in a tree-like structure of the internet. The root domain is the
highest level, followed by top-level domains TLDs) like .com , .org , etc. Subdomains (e.g.,
example.com ) branch off from TLDs.
2. Zones
A zone is a portion of the domain that is managed by a specific organization. For instance,
.com is a zone controlled by Verisign. ICANN manages the root zone at the top of the DNS
tree, while different organizations manage subdomains.
3. Delegation:
Delegation allows one organization to hand over control of part of its domain to another
organization. This is done using Nameserver NS records.
For example, ICANN controls the root domain and delegates .com to Verisign.
Verisign can then delegate control over example.com to "Example Ltd" by adding an NS
record those points to their nameserver.
The NS records direct traffic to the appropriate nameserver that manages a domain,
allowing different parts of the DNS tree to be managed independently by different
organization
DNS record types:
DNS records, also known as zone files, provide information about a domain. This includes the IP
address that is associated with this domain and how to handle queries for it. Each DNS record has a
time-to-live setting TTL which indicates how often a DNS server will refresh it.
Below are the most commonly used types of DNS records and their meaning:
DHCP
DHCP (Dynamic Host Configuration Protocol) is a network management protocol that automatically
assigns IP addresses and other network configurations (such as subnet mask, gateway, DNS servers)
to devices on a network.
Example:
When you connect your laptop to a Wi-Fi network, a DHCP server assigns it an IP address
automatically, allowing it to communicate with other devices on the network without
manual configuration.
Routers Connect different networks and direct data packets between them.
Switches Connect devices within the same network and use MAC addresses to forward data
to the correct device.
Firewalls
Firewalls control incoming and outgoing network traffic based on predetermined security
rules.
Load Balancers
Load balancers distribute incoming network traffic across multiple servers to ensure no single server
becomes overwhelmed.
VPN
VPN Virtual Private Network) provides a secure connection between remote users and the corporate
network over the internet.
Purpose Test network connections and protocols. How It Works Attempts to establish a
connection to a specified IP and port.
Usage Test if a specific service is reachable, e.g., telnet google.com 443 .
4. curl
Purpose Transfer data using multiple protocols, often for HTTP requests.
Usage:
o Basic GET request: curl http://example.com .
o Check headers: curl -I http://example.com .
o POST request: curl -X POST http://example.com .
o Save response to file: curl http://example.com/file -o output.file .
6. netstat
Usage:
These tools are invaluable for network diagnostics, troubleshooting, and secure communications,
which are critical skills for any DevOps engineer.