Good cheat sheet to read, Cheat Sheet of Computer Networks

Good cheat sheet to read and oractice

Typology: Cheat Sheet

2024/2025

Uploaded on 02/09/2026

naveen-more
naveen-more 🇮🇳

1 document

1 / 27

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Networking for DevOps
1
Networking for DevOps
Created
by
Lalit Tembhare
Created time
15-11-24
Tags
Networking
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:
Allow the connected devices to communicate with each other.
Enable multiple users to share devices over the network, such as music and
video servers, printers and scanners.
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:
1.
Switch:
It is a device which connects two or more computers.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b

Partial preview of the text

Download Good cheat sheet to read and more Cheat Sheet Computer Networks in PDF only on Docsity!

Networking for DevOps

Created by Lalit Tembhare Created time 15 - 11 - 24 Tags Networking

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: Allow the connected devices to communicate with each other. Enable multiple users to share devices over the network, such as music and video servers, printers and scanners. 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:

1. Switch:

It is a device which connects two or more computers.

2. Router:

It is a device which is actually used to connect one network

with another.

3. Modem:

It is also a device used for modulation and Demodulation.

4. Hub:

It is just a power extension dummy device that just broadcast

the signals to its connected computers.

5. NIC:

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.

6. Bridge:

It is also a networking device that connects multiple LANs

(local area networks) together to form a larger LAN. It

reduces the broadcasting part, and it store the MAC address

of the computer but now this device is also obsoleted and

replaced by switch.

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.

IP Address and its Types and Classes:

192.168.x.x 172.31.x.x

  1. Public IP : Used to identify devices on the internet. Assigned by ISPs and accessible globally.
  2. Private IP : Used within private networks (like home or office networks). Not accessible from the internet; usually in ranges like ,
  3. Static IP : , or -. Manually assigned, doesnʼt change. Often used for servers and devices that need a consistent address.
  4. 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. Class Range Purpose A 1.0.0.0 - 126.0.0.0 Large networks, like big organizations. B 128.0.0.0 - 191.255.0.0 Medium-sized networks. C 192.0.0.0 - 223.255.255. Small networks, like home or business LANs. 10.x.x.x 172.16.x.x

D 224.0.0.0 - 239.255.255. Reserved for multicasting. E 240.0.0.0 - 255.255.255. Experimental, used for research. 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. 0.0.0.0 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.

| Class C | 1st, 2nd & 3rd | 4th Octet | | Example: 192.168.1.1| (1) +---------------------+---------------------+----------------- Device Connection Scenario:

  1. Device A IP Address: 17.0.0.1 (Class A)
  2. Device B IP Address: 17.0.4.2 (Class A) Network ID for Class A: 17 (1st Octet) Since both devices have the same Network ID (17), they are in the same network and can connect directly. Connection Summary: +-----------------------+---------------------------+--------- | Device A IP | Device B IP | Connec +-----------------------+---------------------------+--------- | 17.0.0.1 | 17.0.4.2 | Direct +-----------------------+---------------------------+--------- | 17.0.0.1 | 192.168.1.5 | Requir +-----------------------+---------------------------+--------- Explanation:
  • If Device A and Device B are in the same network (same Netwo
  • If they are on different networks (different Network IDs), a Router Usage: +-----------------------+---------------------------+--------- | Different Networks | Example: | Connec +-----------------------+---------------------------+--------- | Device A Network ID | 17 (Class A) | | Device B Network ID | 192.168 (Class C) | | Router Needed | Yes | Requir +-----------------------+---------------------------+---------

Subnetting: Divides a network into smaller, more manageable segments. Example: A network with IP address 192.168.1.0/24 can be divided into subnets like 192.168.1.0/25 and 192.168.1.128/25.

Example of Subnetting:

Given network: 192.168.1.0/ 192.168.1.0/24 is a Class C network. /24 indicates a subnet mask of 255.255.255.0 , meaning there are 8 bits for hosts (32 total bits in IPv4 - 24 bits for the network portion 8 bits for hosts). 192.168.1.0/24 provides 256 IP addresses (from 192.168.1.0 to 192.168.1.255).

Dividing into Smaller Subnets:

To divide this into two equal subnets, we can use /25 subnet masks, which allocate 7 bits for hosts (32 - 25 7 bits for hosts).

  1. Subnet 1: 192.168.1.0/ Range : 192.168.1.0 to 192.168.1. Subnet Mask : 255.255.255. Total IPs : 128 addresses (126 usable for hosts, as the first address is the network address and the last is the broadcast address).
  2. Subnet 2: 192.168.1.128/ Range : 192.168.1.128 to 192.168.1. Subnet Mask : 255.255.255. Total IPs : 128 addresses (126 usable for hosts).

Summary Table

Subnet Range Subnet Mask Total IPs Usable Host IPs 192.168.1.0/ 192.168.1.0 - 192.168.1. 255.255.255.128 128 126

/0 0.0.0.0 4,294,967,296 Class A* 0.0.0.0/ means entire internet. Often used in public firewall rules Network Models There are mainly two types of network model -

  1. OSI Reference Model
  2. TCP/IP Model

1. OSI Reference 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.

Hereʼs a text-based structural diagram that shows the flow through the OSI model from Person X to Person Y : START: Person X Sends a Message │ ├── Application Layer (Layer 7) │ └── Prepare message using messaging app protocol (e.g., SM │ ├── Presentation Layer (Layer 6) │ └── Encode/Encrypt the message into a suitable format. │ ├── Session Layer (Layer 5) │ └── Establish a session with Person Y’s device through the │ ├── Transport Layer (Layer 4) │ └── Break the message into segments and add TCP/UDP header │ ├── Network Layer (Layer 3) │ └── Add source and destination IP addresses for routing. │ ├── Data Link Layer (Layer 2) │ └── Convert segments to frames and add MAC addresses for d │ ├── Physical Layer (Layer 1) │ └── Convert frames into bits (0s and 1s) for transmission. │ └── Transmit through Physical Medium (e.g., Ethernet/Wi-Fi) to │ ├── Person Y Receives Message │ ├── Physical Layer (Layer 1) │ └── Receive bits and reassemble into frames. │ ├── Data Link Layer (Layer 2) │ └── Verify and process frames with MAC addresses. │ ├── Network Layer (Layer 3)

The infographic below summarizes the seven layers of the OSI reference model.

6. Data Link Layer (Layer 2)

Ethernet : Defines physical addressing and channel access. PPP : Used for point-to-point connections. HDLC : For framing and error control on point-to-point links. ARP : Resolves IP addresses to MAC addresses.

7. Physical Layer (Layer 1)

Ethernet (Physical signaling) : Specifies electrical signals, cabling, etc. USB : Used to physically connect devices.

Summary with Ports

Application Layer (Layer 7) contains the most recognizable protocols with specific port numbers for communication (e.g., HTTP - Port 80 , HTTPS - Port 443 , SMTP - Port 25 ). Layers 2 to 6 typically deal with specific network management functions and do not use port numbers as these layers are responsible for connections and managing data formats. Port numbers are used primarily in the Application and Transport Layers to ensure data is delivered to the correct services and applications running on a computer.

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. 1. Application Layer = (Application Layer + Presentation Layer + Session Layer) of OSI model 2. Transport Layer 3. Network Layer

  1. Network Interface Layer = (Data Link Layer + Physical Layer) of OSI model Ports and Protocols: (remaining all are same like OSI model discussed above.)

amazon.com 403 Forbidden The client does not have enough permission to access the content. 404 Not Found The server canʼt find the requested resource. 408 Request Timeout The response was sent to an idle connection, and the server wants to terminate it. 500 Internal Server Error The server does not know how to handle a request. 502 Bad Gateway The server you are trying to access is a gateway or a reverse proxy (it sits between the client and an actual server that serves the page). You get this error when the gateway gets an incorrect response from a source server. 503 Service Unavailable The server canʼt process the request. This usually happens when a server is down or overloaded. 504 Gateway timeout Similar to 502, the gateway canʼt get a response in time. Find the complete list of status codes with detailed explanations by Mr. Abhishek Veeramalla (Thank you!): iam-veeramalla/http-status-codes: Repo to demonstrate HTTP status codes I have said that HTTP is a stateless protocol, means it never store any data of client in server. Then suppose when you will search for the second time then it should be logged out from the server, and you have to log in again for second time visit, but you don't. In second time, it's automatically

logged in, and you can see all of your saved carts 🛒 and all data. So how

it is possible?? Here, cookies come into the picture.

Cookies is a unique string stored as a file in your browser and

when you search for the second time the website you visited

previously, cookies which saved in your browser will send the

details through HTTP to the server and server will check it

and automatically logged you in.

  1. SMTP/POP (Simple Mail Transfer Protocol and Post Office Protocol): SMTP is used in sending and receiving any email from senders SMTP server to Receiver's SMTP server

POP is used to download any email from POP server

  1. FTP (File Transfer Protocol): FTP is used to download, upload and transfer files from one host to another host.
  2. Secure shell (SSH): Similar to Telnet. Itʼs used by system administrators to securely access to access a computer over an insecure network.
  3. TCP (Transmission Control Protocol) : Reliable and connection-oriented protocol. Ensures data is delivered successfully with acknowledgements and retransmission if needed. Used for applications where data integrity is crucial. Example: HTTP (port 80), SQL (port 1433). TCP and the Three-Way Handshake: Before transmitting packets, TCP must ensure that a stable connection has been set up between the sender and the recipient. This is where the three- way handshake (or SYN-SYN-ACK) comes in.