0% found this document useful (0 votes)
2 views20 pages

Networking Fundamentals

Uploaded by

blackmo12
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views20 pages

Networking Fundamentals

Uploaded by

blackmo12
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Networking Fundamentals

What is a Computer Network?


A computer network is a collection of interconnected devices, such as computers, servers,
routers, switches, and other hardware, that can communicate and share resources, data, and
services with one another. The purpose of a computer network is to enable communication and
resource sharing across multiple systems, regardless of their physical location.
Types of Networks
1. PAN (Personal Area Network)
A PAN is a small network typically used to connect personal devices like smartphones, tablets,
laptops, and other small devices within a very short range.
2. LAN (Local Area Network)
A LAN is a network that connects computers and other devices within a small geographic area
like a home, office, or school. It allows devices to share resources like printers, files, or an
internet connection.
3. WLAN (Wireless Local Area Network)
A WLAN is essentially a LAN that uses wireless technology (typically Wi-Fi) instead of wired
connections (Ethernet) to connect devices.
4. CAN (Campus Area Network)
A CAN connects networks across a campus or large facility, like a university, corporate campus,
or industrial complex. It can link multiple buildings and departments within a restricted area.
5. MAN (Metropolitan Area Network)
A MAN is a network that spans a larger geographic area than a LAN but smaller than a WAN,
often covering an entire city or large metropolitan area.
6. WAN (Wide Area Network)
A WAN is a large network that spans a broad geographic area, often connecting multiple LANs
and MANs over cities, countries, or even globally. The internet is the largest example of a WAN.
Types of Communications
1. Unicast Communication
Unicast is the most common type of communication where one sender communicates with one
receiver. In unicast communication, the data is sent from a single source to a single destination
device.
2. Multicast Communication
Multicast is used to send data from one sender to multiple receivers, but only to a specific group
of devices that have expressed interest in receiving the data. Unlike broadcast (which sends
data to all devices on a network), multicast is more efficient because it only targets devices that
need the information.
3. Broadcast Communication
Broadcast is a communication method in which data is sent from one sender to all devices on a
network. This means that every device in the network (or a particular subnet) will receive the
data, whether it needs it. Broadcast is typically used when the sender does not know the
specific destination or when a message needs to reach everyone.
Modes of Communication
1. Simplex Communication:
 Data flows in one direction only. The sender can transmit, but the receiver cannot send
data back.
 Example: TV broadcasting, radio signals.
2. Half-Duplex Communication:
 Data can flow in both directions, but not at the same time. One device sends, and then
the other device replies.
 Example: Walkie-talkies, CB radios.
3. Full-Duplex Communication:
 Data can flow in both directions simultaneously. Both devices can send and receive at
the same time.
 Example: Phone calls, video calls, modern internet connections.
Types of Network Architecture Models:
1. Client-Server Architecture
 Client: A device (such as a computer or smartphone) that requests services or resources
from the server.
 Server: A powerful device (like a web server, database server, or file server) that provides
services or resources to clients.
 Clients send requests to the server, and the server processes these requests and sends
back responses.
 Centralized management and control, often used for security, data storage, and
applications.
 Examples of servers: Web server, Database server, File server.
2. Peer-to-Peer (P2P) Architecture
In a peer-to-peer (P2P) architecture, all devices in the network are considered equal (peers),
and they can both request and provide services or resources to each other. Each device can act
as both a client and a server.
 No centralized server.
 Devices (peers) share resources directly, such as files, processing power, or network
bandwidth.
 Examples of P2P protocols: BitTorrent, Skype, and Napster.
Network Devices
1. Router
A router is a device that forwards data packets between different networks, typically between a
local area network (LAN) and a wide area network (WAN) (such as the internet). Routers
determine the best path for data to travel based on the destination IP address.
2. Switch
A switch is a device that connects devices within a single network (typically a LAN) and
forwards data based on MAC addresses. Unlike hubs, which broadcast data to all connected
devices, switches intelligently forward data only to the specific device that needs it.
3. Hub
A hub is a basic network device used to connect multiple devices in a LAN. It broadcasts data
packets to all connected devices, regardless of the recipient. This makes hubs less efficient
than switches, as they create more traffic and collisions.
4. Modem (Modulator-Demodulator)
A modem converts digital data from a computer or router into analog signals that can be
transmitted over a phone line, cable, or satellite link. On the receiving end, it converts the
analog signals back into digital form.
5. Access Point (AP)
An access point is a device that allows wireless devices to connect to a wired network. It acts as
a bridge between wireless devices (like laptops, smartphones, etc.) and the wired network (via a
router or switch).
6. Firewall
A firewall is a security device that monitors and controls incoming and outgoing network traffic
based on predetermined security rules. Firewalls can be either hardware-based or software-
based.
 Types of Firewalls: Packet-filtering firewalls, stateful inspection firewalls, and next-gen
firewalls (NGFW) that offer deep packet inspection and intrusion detection.
7. Bridge
A bridge is a device that connects and filters traffic between two or more network segments
(LANs), making them function as a single network. Bridges operate at the Data Link Layer
(Layer 2) of the OSI model.
8. Gateway
A gateway is a device that connects two different networks, often with different protocols. It
serves as an entry and exit point for data moving between networks, such as from a local
network to the internet.
9. Repeater
A repeater is a device that amplifies or regenerates signals to extend the range of a network. It
is typically used in long-distance communication to ensure that the signal doesn't degrade over
long cables or wireless links.
Network Topology
[Link] Topology:
All devices are connected to a single central cable (called the bus). Data sent by one device
travels along the bus and is received by all devices.
Advantages:
 Simple and easy to set up.
 Cost-effective for small networks.
Disadvantages:
 If the bus cable fails, the entire network goes down.
 Performance degrades as more devices are added.
 Difficult to troubleshoot as all devices share the same channel.
[Link] Topology:
Devices are connected to a central device (like a hub, switch, or router). All data passes
through this central device.
Advantages:
 Easy to manage and expand.
 Failure of one device doesn’t affect others.
 Centralized troubleshooting since all data goes through the hub.
Disadvantages:
 If the central hub fails, the entire network is down.
 Requires more cables, which can increase the cost.
 Performance may decrease if the central hub becomes overloaded.
[Link] Topology:
Devices are connected in a circular fashion, where each device has two connections: one to its
predecessor and one to its successor. Data travels in one direction (or sometimes two in dual
ring topology).
Advantages:
 Simple setup and design.
 Effective for managing large volumes of data.
Disadvantages:
 A failure in one device or connection can disrupt the entire network.
 Troubleshooting is harder as each device relies on its neighbours.
 Slower data transmission due to the circular path.
[Link] Topology:
Every device is connected directly to every other device. This creates multiple paths for data to
travel, ensuring high redundancy and reliability.
Advantages:
 No single point of failure.
 Provides high fault tolerance.
 Data can take multiple paths, reducing congestion.
Disadvantages:
 Very expensive and complex to install due to many cables and connections.
 Difficult to manage as the number of devices increases.
[Link] Topology:
A combination of two or more topologies (e.g., star-bus, star-ring). It is used to leverage the
advantages of different topologies depending on network needs.
Advantages:
 Flexible and scalable.
 Can be designed to suit specific requirements.
Disadvantages:
 More complex and expensive to set up and maintain.
 Can become difficult to troubleshoot as the network grows.
[Link] Topology:
A hierarchical topology that combines star topologies in a tree-like structure. Each device
connects to a central hub, but there are multiple levels of hubs.
Advantages:
 Scalable and easy to manage.
 Fault isolation is easier because of its hierarchical structure.
Disadvantages:
 If the central hub at the top level fails, the entire network can be disrupted.
 Requires more cabling, making it more expensive than simple topologies.
Ports and Protocols
Ports are numerical values used to distinguish different types of services running on a device.
They are part of the transport layer, helping direct traffic to the correct application.
Types of Ports:
1. Well-Known Ports (0–1023):
o Purpose: These are reserved for standardized services and protocols that are
universally recognized.
o Examples:
 HTTP: Port 80
 HTTPS: Port 443
 FTP: Port 21
 SMTP: Port 25
 DNS: Port 53
2. Registered Ports (1024–49151):
o Purpose: These ports are used by applications and services that are not as
universally standardized but still registered with IANA (Internet Assigned Numbers
Authority).
o Examples:
 MySQL Database: Port 3306
 SQL Server: Port 1433
 PostgreSQL: Port 5432
3. Dynamic/Private Ports (49152–65535):
o Purpose: These ports are dynamically allocated for temporary connections. They
are typically used by client-side applications for communication and are not fixed.
o Example: When a client opens a connection to a server, it often uses a dynamic
port number assigned by the OS (e.g., port 54321).
IP Addressing
IP Addressing is a system used to assign unique identifiers to devices (like computers,
smartphones, routers) on a network. These identifiers, called IP addresses, ensure that data
packets are delivered to the correct devices across local and wide-area networks (LANs and
WANs), including the internet.
An IP address is like a home address, which allows data to find its way to the right destination.
There are two main types of IP addressing: IPv4 and IPv6.
1. IPv4 (Internet Protocol Version 4)
IPv4 is the most widely used version of IP addressing. It uses 32-bit addresses, which are
written as four decimal numbers separated by dots.
 Range: Each section (octet) of the address can range from 0 to 255 (8 bits per section),
which means that IPv4 addresses are written as a series of four 8-bit numbers.
Example:
 [Link]
2. IPv6 (Internet Protocol Version 6)
IPv6 was developed to replace IPv4 due to the shortage of available IPv4 addresses. IPv6 uses
128-bit addresses, allowing for a much larger number of unique addresses. IPv6 addresses are
written in hexadecimal (base-16) and are divided into eight groups of four hexadecimal digits.
Example of IPv6 Address: 2001:0db8:85a3:0000:0000:8a2e: 0370:7334
Differences from IPv4:
 Address Length: IPv6 addresses are 128 bits long (IPv4 is 32 bits), providing a vastly
larger address space.
 Simplified Header: IPv6 has a simplified header structure compared to IPv4, making it
more efficient for routing and processing.
 No Need for NAT: With IPv6, each device can have a unique global IP address,
eliminating the need for Network Address Translation (NAT), which is common in IPv4.
 Improved Security: IPv6 was designed with security in mind and includes built-in IPsec
encryption for secure communications.
IPv4 Address Classes:
IPv4 addresses are divided into five classes based on their range and the type of network they
are used for:
 Class A: [Link] to [Link]
o Default Subnet Mask: [Link]
o Address Range: Used for very large networks (e.g., large organizations, internet
providers).
o Number of Hosts: 16 million.
 Class B: [Link] to [Link]
o Default Subnet Mask: [Link]
o Address Range: Used for medium-sized networks (e.g., universities, corporations).
o Number of Hosts: 65,000.
 Class C: [Link] to [Link]
o Default Subnet Mask: [Link]
o Address Range: Used for small networks (e.g., small businesses, home networks).
o Number of Hosts: 254.
 Class D: [Link] to [Link]
o Reserved for multicast addresses.
 Class E: [Link] to [Link]
o Reserved for experimental use.
Private IPv4 Address Range:
Some IPv4 addresses are reserved for private internal use within networks. These addresses
are not routable on the public internet but are used for local area networks (LANs).
 Class A: [Link] to [Link]
 Class B: [Link] to [Link]
 Class C: [Link] to [Link]
MAC address (Media Access Control address)
A MAC address (Media Access Control address) is a unique identifier assigned to a network
interface card (NIC) or network adapter for communication within a local network. It is used at
the Data Link Layer (Layer 2) of the OSI model and helps devices identify each other on a local
network segment, such as when using Ethernet or Wi-Fi.
A MAC address is 48 bits (6 bytes) long.
Typically written as 12 hexadecimal digits separated by colons (:) or hyphens (-).
o Example 1: 00:1A: 2B:3C: 4D:5E
o Example 2: 00-1A-2B-3C-4D-5E
How MAC Addresses Are Used
 Local Communication:
MAC addresses are used for device communication within the same local network. For
instance, when a device sends data over Ethernet, the switch uses the MAC address to
determine the correct destination device.
 ARP (Address Resolution Protocol):
When a device knows an IP address but needs to find the corresponding MAC address
(for local communication), it uses ARP to resolve the IP address to a MAC address.
Subnet Mask, CIDR, and Subnetting
In networking, subnetting is the process of dividing a network into smaller, more manageable
sub-networks, or subnets. Understanding subnet masks, CIDR (Classless Inter-Domain
Routing), and the subnetting process is essential for designing efficient and scalable networks.
1. Subnet Mask
A subnet mask is used in IPv4 addressing to separate the network portion from the host portion
of an IP address. It defines which part of the IP address refers to the network and which part
refers to the host.
 Format: It is written in the same format as an IP address (e.g., [Link]).
 The subnet mask is a 32-bit address with a sequence of 1s (representing the network
portion) and 0s (representing the host portion).
1s: Define the network part.
0s: Define the host part.
Example of Subnet Mask:
 Subnet Mask: [Link]
 In binary: 11111111.11111111.11111111.00000000
 The first 24 bits (1s) represent the network portion, and the last 8 bits (0s) represent the
host portion.
Common Subnet Masks:
 Class A: [Link] (or /8)
 Class B: [Link] (or /16)
 Class C: [Link] (or /24)
2. CIDR (Classless Inter-Domain Routing)
CIDR is a method for allocating and routing IP addresses more efficiently, overcoming
limitations of traditional class-based IP addressing.
CIDR Notation: Represents the subnet mask as an IP address followed by a slash and the
number of bits in the network portion (e.g., [Link]/24).
Example:
o [Link]/24: This means the first 24 bits are the network portion, and the
remaining 8 bits are for the host portion.
o Subnet Mask equivalent: [Link].
3. Subnetting
Subnetting is the process of splitting a large network into smaller sub-networks (subnets) to
improve the management and security of the network.
Steps to Subnetting:
1. Determine Network Requirements:
o Identify how many subnets you need.
o Calculate how many hosts you need per subnet.
2. Calculate Subnet Mask:
o Use CIDR notation or traditional subnet masks to determine the subnet size.
3. Determine the Number of Subnets:
o Based on the number of bits borrowed from the host portion of the IP address, you
can create a certain number of subnets.
o Formula: Number of subnets = 2^n, where n is the number of borrowed bits.
4. Calculate Hosts per Subnet:
o Formula: Number of hosts per subnet = 2^h - 2, where h is the number of host
bits.
o The -2 accounts for the network address and broadcast address, which cannot be
assigned to hosts.
Subnetting Example:
 IP Address: [Link]/24
 Required Subnets: 4
 New Subnet Mask: To create 4 subnets, you need to borrow 2 bits from the host portion
(2^2 = 4).
o Original Subnet Mask: [Link] or /24
o New Subnet Mask: [Link] or /26
Subnet Calculation:
 New Subnet Mask: /26 means 6 bits are used for the host portion, and 2 bits were
borrowed for subnetting.
 Number of Subnets: 2^2 = 4 subnets
 Number of Hosts per Subnet: 2^6 - 2 = 62 hosts
Resulting Subnets:
 Subnet 1: [Link]/26 (Network: [Link], Broadcast: [Link])
 Subnet 2: [Link]/26 (Network: [Link], Broadcast: [Link])
 Subnet 3: [Link]/26 (Network: [Link], Broadcast: [Link])
 Subnet 4: [Link]/26 (Network: [Link], Broadcast: [Link])
OSI 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. This layered approach makes it easier for different
devices and technologies to work together
1. Physical Layer (Layer 1)
The Physical Layer is responsible for the transmission of raw data bits over a physical medium
(such as copper wires, fibre optics, or radio waves). It converts the data into electrical, optical,
or radio signals.
Examples:
 Ethernet cables (RJ-45) transmitting data over wired connections.
 Wi-Fi for wireless data transmission.
2. Data Link Layer (Layer 2)
The Data Link Layer is responsible for error-free data transfer between two devices on the
same network and for defining how data is framed and addressed on the network. It ensures
that data is delivered to the correct device within a LAN and handles the physical addressing.
Examples:
 Ethernet (using MAC addresses to transmit frames).
 Wi-Fi (using MAC addresses in wireless networks).
3. Network Layer (Layer 3)
The Network Layer is responsible for routing data across different networks and devices and
ensuring that it reaches the correct destination. It manages IP addressing and routing between
devices on different networks.
Examples:
 IPv4 and IPv6 addressing schemes.
 Routing protocols like RIP, OSPF, and BGP.
4. Transport Layer (Layer 4)
The Transport Layer ensures that data is transferred reliably between two devices. It manages
the end-to-end communication and error recovery between devices, ensuring that data packets
are delivered accurately and in the correct order.
Examples:
 TCP (Transmission Control Protocol): Connection-oriented, reliable communication (e.g.,
web browsing, file transfer).
 UDP (User Datagram Protocol): Connectionless, faster, but unreliable communication
(e.g., video streaming, VoIP).
5. Session Layer (Layer 5)
The Session Layer establishes, manages, and terminates sessions (persistent connections)
between two devices. It is responsible for maintaining the session state and synchronizing data
exchange.
6. Presentation Layer (Layer 6)
The Presentation Layer is responsible for translating, encrypting, and compressing data. It
ensures that data is in a format that the receiving application can understand, regardless of the
underlying system's architecture.
Examples:
 JPEG, GIF (image formats), MPEG (video format).
 SSL/TLS for secure communications (HTTPS).
 ASCII, Unicode for text encoding.
7. Application Layer (Layer 7)
Function:
The Application Layer is the topmost layer that interacts directly with end-users and
applications. It is responsible for providing services such as file transfers, email, and web
browsing to the user.
Examples:
 HTTP/HTTPS (web browsing), FTP (file transfer), SMTP (email), DNS (domain name
resolution).
Below is the list of protocols in each layer of the OSI model along with their
port number.
1. Application Layer (Layer 7):
o HTTP: Port 80
o HTTPS: Port 443
o FTP: Port 21
o SMTP: Port 25
o POP3: Port 110
o IMAP: Port 143
o DNS: Port 53
o Telnet: Port 23
2. Presentation Layer (Layer 6):
o Does not directly use ports, but SSL/TLS encryption (for secure communication) is
used in HTTPS (Port 443) and other application protocols.
3. Session Layer (Layer 5):
o NetBIOS: Ports 137-139
o RPC: Random ports assigned for session communication (typically dynamic).
4. Transport Layer (Layer 4):
o TCP/UDP Port 80: HTTP (Web Traffic)
o TCP Port 443: HTTPS (Secure Web Traffic)
o UDP Port 53: DNS (Domain Name System)
o TCP Port 21: FTP (File Transfer)
o TCP Port 25: SMTP (Simple Mail Transfer Protocol)
o UDP Port 67: DHCP (Dynamic Host Configuration Protocol)
5. Network Layer (Layer 3):
o Layer 3 (IP) does not use ports directly. It handles IP addressing and routing, not
port-based communication. Port numbers are used at Layer 4 (Transport Layer).
6. Data Link Layer (Layer 2):
o Layer 2 does not use ports. It is responsible for framing and MAC (Media Access
Control) addressing. It handles the physical addressing of devices on the network
(MAC addresses).
7. Physical Layer (Layer 1):
o Layer 1 does not use ports. It deals with the physical medium for data
transmission (such as Ethernet cables, Fiber optics, and wireless signals).
TCP/IP Model
The TCP/IP model is a layered networking framework that explains how data is communicated
between devices over a network using standardized protocols to ensure reliable and efficient
transmission.
 Defined as a four-layer architecture consisting of Application, Transport, Internet, and
Network Access layers
 Standardized by RFC 1122, which specifies its structure and behaviour
 Simpler and more practical than the seven-layer OSI model
 Serves as the core framework of the modern Internet and networking systems
[Link] Access Layer
The Link Layer or Network Access Layer is responsible for the physical transmission of data
between two devices within the same network. It defines how data is transmitted over different
physical media such as Ethernet, Wi-Fi, and fibre optic cables. It handles framing, addressing,
and error detection on the local network.
Devices:
 Network Interface Cards (NICs)
 Switches
 Hubs
 Wi-Fi Access Points
2. Internet Layer
The Internet Layer is responsible for routing data between devices across different networks,
and it manages logical addressing using IP addresses. It ensures that data is correctly directed
from the source device to the destination device, even if they are on different networks.
Devices:
 Routers
 Gateways
3. Transport Layer
The Transport Layer ensures end-to-end communication between devices. It manages reliable
data transfer, error control, flow control, and segmentation of data for delivery. It makes sure
that the data is delivered correctly, in sequence, and without errors.
Protocols:
 TCP (Transmission Control Protocol):
o Reliable, connection-oriented communication.
o Provides error checking, flow control, and ensures the correct order of delivery.
o Used for applications where reliability is critical (e.g., HTTP, FTP, email).
 UDP (User Datagram Protocol):
o Unreliable, connectionless communication.
o Faster than TCP but doesn’t ensure delivery or order.
o Used for real-time applications (e.g., video streaming, VoIP, DNS).
Devices:
 Firewalls
 Load Balancers
4. Application Layer
Function:
The Application Layer is the topmost layer and directly interacts with the end-user. It provides
network services and interfaces for network applications. This layer defines the protocols and
services that end-user applications use to communicate over a network.
Devices:
 End-User Devices (PCs, smartphones, etc.)
 Web Servers
 Email Servers
 DNS Servers

TCP and UDP


1. Transmission Control Protocol (TCP)
TCP is a connection-oriented protocol, which means that a connection is established and
maintained until the data transfer is complete. It guarantees reliable, ordered, and error-checked
delivery of data between devices.
 Connection-Oriented:
o Before data can be transferred, a connection must be established between the
sender and receiver using a process called three-way handshake.
o The handshake ensures that both devices are ready to send and receive data.
 Reliability:
o TCP guarantees that data will arrive in order, without loss, and without duplication.
o It uses acknowledgments to confirm that data packets have been received
successfully. If a packet is lost or corrupted, TCP will retransmit it.
 Flow Control:
o TCP uses flow control mechanisms (e.g., sliding window) to ensure that the
sender does not overwhelm the receiver with too much data.
 Error Handling:
o Each data segment includes a checksum for error detection.
o If a packet is corrupted or lost, the receiver will request retransmission.
 Congestion Control:
o TCP uses algorithms like TCP Reno, TCP Tahoe, and TCP Cubic to adjust the
transmission rate when network congestion is detected. This prevents network
overload.
 Ordered Delivery:
o TCP ensures that data packets are delivered in the correct order by using
sequence numbers. If the packets arrive out of order, TCP will reorder them before
passing the data to the application.
TCP 3-Way Handshake
The TCP 3-Way Handshake is the process used to establish a reliable TCP connection between
a client and a server. It ensures both devices are ready to communicate, and it helps in setting
up synchronization and acknowledgment.
Steps in the 3-Way Handshake:
1. SYN (Synchronize) – Client to Server:
o The client sends a SYN message (a request to establish a connection) to the
server, along with an initial sequence number (to start the communication).
o This tells the server, "I want to talk to you."
2. SYN-ACK (Synchronize-Acknowledge) – Server to Client:
o The server responds with a SYN-ACK message, acknowledging the client's
request and sending its own sequence number back to the client.
o This step tells the client, "I received your request, and I’m ready to talk back."
3. ACK (Acknowledge) – Client to Server:
o The client sends an ACK message to the server, confirming that it has received
the server's SYN-ACK and is ready to begin data transfer.

2. User Datagram Protocol (UDP)


UDP is a connectionless protocol, meaning there is no need to establish a connection between
the sender and receiver. It sends data without ensuring reliability, ordering, or error correction,
making it faster but less reliable than TCP.
 Connectionless:
o No handshake or connection establishment is required before sending data.
o This makes UDP much faster but also less reliable.
 Unreliable:
o UDP does not guarantee delivery. If a packet is lost during transmission, it is not
retransmitted.
o There is no acknowledgment for received packets, so the sender has no way of
knowing whether the data was successfully delivered.
 No Flow Control:
o Unlike TCP, UDP does not manage the flow of data, so the sender can send data
as quickly as it wants. This can sometimes lead to network congestion or packet
loss.
 No Error Recovery:
o UDP includes basic error detection (using checksums), but it does not provide
mechanisms for retransmitting lost or corrupted packets.
 Unordered Delivery:
o UDP does not guarantee that packets will arrive in the order in which they were
sent.
o If the order of delivery matters, it must be handled at the application level.
Ports and Protocols
Ports are numerical values used to distinguish different types of services running on a device.
They are part of the transport layer, helping direct traffic to the correct application.
Types of Ports:
[Link]-Known Ports (0–1023):
These are reserved for standardized services and protocols that are universally recognized.
 Examples:
o HTTP: Port 80
o HTTPS: Port 443
o FTP: Port 21
o SMTP: Port 25
o DNS: Port 53
[Link] Ports (1024–49151):
These ports are used by applications and services that are not as universally standardized but
still registered with IANA (Internet Assigned Numbers Authority).
 Examples:
o MySQL Database: Port 3306
o SQL Server: Port 1433
o PostgreSQL: Port 5432
[Link]/Private Ports (49152–65535):
These ports are dynamically allocated for temporary connections. They are typically used by
client-side applications for communication and are not fixed.
 Example: When a client opens a connection to a server, it often uses a dynamic port
number assigned by the OS (e.g., port 54321).
DNS (Domain Name System)
DNS (Domain Name System) is essentially the phonebook of the internet. It translates human-
readable domain names into IP addresses, allowing devices to locate each other on the internet
or within a local network.
Steps in DNS Resolution:
1. User Request:
o A user types a website URL (e.g., [Link]) into their browser.
2. Check Local Cache:
o The device first checks its local DNS cache to see if the IP address for the domain
is stored. If found, it uses that IP and skips further steps.
3. Recursive Resolver:
o If the address is not in the cache, the device sends a query to a recursive DNS
resolver (usually provided by the ISP or a public DNS service like Google DNS or
Cloudflare).
o The resolver's job is to get the final IP address by querying other DNS servers if
necessary.
4. Root Name Servers:
o The recursive resolver contacts a root name server to find the address of the Top-
Level Domain (TLD) server, which corresponds to the last part of the domain
name (e.g., .com, .org).
5. TLD Name Servers:
o The TLD name server (e.g., .com servers) points the resolver to the authoritative
name server responsible for the domain.
6. Authoritative DNS Server:
o The authoritative DNS server has the actual IP address associated with the
domain name. It sends this information back to the resolver.
7. Final Resolution:
o The resolver then sends the IP address to the user's device. The browser can now
use this IP to access the website.
DNS Records
DNS records are instructions stored in authoritative DNS server Zone File that map domain
names to IP addresses and manage network traffic. Acting as the internet's phonebook, they
ensure browsers can load websites and services.
1. A Record (Host address) - Maps a domain name to an IPv4 address.
2. AAAA Record (IPv6 Host address)- Maps a domain name to an IPv6 address.
3. CNAME Record (Canonical Name Record) - Creates an alias for an existing domain name.
This allows multiple domain names to point to the same IP address.
4. MX Record (Mail Exchange Record) - Specifies the mail servers for a domain, directing
email traffic to the appropriate server.
5. TXT Record (Text Record) - Allows domain owners to store arbitrary text data in DNS.
Commonly used for verification and security purposes (e.g., SPF, DKIM).
6. NS Record (Name Server Record) - Specifies the authoritative DNS servers for the domain,
which are responsible for managing DNS records for the domain.
7. SOA Record (Start of Authority Record) - Provides information about the domain's DNS
zone, including the primary name server and the email of the domain administrator.
8. PTR Record (Pointer Record) - Used for reverse DNS lookup, where an IP address is
mapped to a domain name.
9. SRV Record (Service Record) - Specifies the location (hostname and port number) of
servers for specific services, such as VoIP, Instant Messaging, or XMPP.
10. SPF Record (Sender Policy Framework) - A TXT record used to prevent email spoofing by
specifying which mail servers are allowed to send email for a domain.
Dynamic Host Configuration Protocol (DHCP)
DHCP is a network protocol that automatically gives devices an IP address and other network
settings so they can connect and communicate on a network without manual configuration.
 Assigns a unique IP address to each device.
 Provides the subnet mask to define the local network range.
 Configures the default gateway for communication outside the local network.
 Supplies DNS server addresses for domain name resolution.
Components of DHCP
DHCP works using a client–server model where the client requests network settings, the server
allocates them from an address pool, and the settings are delivered as options for a fixed lease
time.
 DHCP Server: The device (router/server) that manages the DHCP service, keeps the IP
pool, and assigns IP addresses + configuration to clients.
 DHCP Relay: A router/switch feature that forwards DHCP requests and replies between
clients and the server when they are in different networks (different subnets).
 DHCP Client: Any device (PC, mobile, printer, IoT) that requests an IP address and
settings from the DHCP server.
 IP Address Pool: The range of IP addresses available for allocation to clients (often with
exclusions/reservations).
 Lease: The time for which an assigned IP address is valid; the client must renew the
lease to keep using it.
 Default Gateway: The router IP given to the client so it can communicate outside the
local network (reach the internet/other networks).
 DNS Servers: DNS addresses provided to the client so it can convert domain names
(like [Link]) into IP addresses
Internet Control Message Protocol (ICMP)
Internet Control Message Protocol (ICMP) is a network layer protocol widely used by network
devices such as routers, gateways and hosts to send error messages and operational
information. Since the Internet Protocol (IP) itself does not have an inbuilt error-reporting or
correction mechanism, ICMP is a supporting protocol within the IP suite that helps in reporting
errors and sending diagnostic messages. It is primarily used for:
 Error reporting: When data packets cannot reach their destination due to issues such as
unreachable hosts, timeouts or fragmentation errors.
 Operational queries: For example, echo requests and replies used in tools like ping.
ARP (Address Resolution Protocol)
ARP (Address Resolution Protocol) maps an IPv4 address to the corresponding MAC address
on a local network so frames can be delivered to the correct device.
 Resolves IP addresses to MAC addresses for local communication
 Works only within the same broadcast domain (LAN)
 Operates directly over link-layer technologies such as Ethernet
 Essential for delivering frames to the correct device
Network Adapters in Virtualization
In virtualization, network adapters are virtual interfaces that allow virtual machines (VMs) to
communicate with each other and the physical network.
Types of Network Adapters in Virtualization:
1. Bridged Network:
o A bridged network connects the virtual machine to the physical network as if it
were a physical device on that network.
o How it Works: The virtual machine gets its own IP address on the same network
as the host machine. It communicates directly with the external network,
bypassing any virtual network isolation.
2. Host-Only Network:
o A host-only network allows communication between the virtual machine and the
host machine but not with the external network.
o How it Works: The VM and the host share a virtual network but cannot access the
internet or other devices outside the host.
3. Internal Network:
o An internal network allows communication only between virtual machines within
the same virtualization host (no communication with the host or external network).
o How it Works: VMs can interact with each other but cannot communicate with the
host or external devices.
Routing and Routing Protocols
Routing is the process of determining the best path for data packets to travel from the source to
the destination across a network. Routers use routing protocols to make decisions about how to
forward these packets.
Routing Protocol Types:
1. Interior Gateway Protocols (IGP): Used within a single network or Autonomous System
(AS).
o RIP (Routing Information Protocol): Distance-vector, uses hop count, slow
convergence.
o OSPF (Open Shortest Path First): Link-state, uses cost (bandwidth), fast
convergence, scalable.
o EIGRP (Enhanced Interior Gateway Routing Protocol): Hybrid, uses bandwidth
and delay, fast convergence.
2. Exterior Gateway Protocols (EGP): Used between different networks or ASes.
o BGP (Border Gateway Protocol): Path vector, used for internet routing between
ISPs.
Switching and Switching Protocols
Switching is the process of forwarding data packets between devices within a network, typically
occurring at the Data Link Layer (Layer 2) of the OSI model. It is essential for communication
within local area networks (LANs), where switches use MAC addresses to make forwarding
decisions.
Switching Protocols:
1. STP (Spanning Tree Protocol): Prevents network loops by creating a loop-free
topology.
2. VLAN (Virtual LAN): Segments a network into smaller, isolated broadcast domains.
3. VTP (VLAN Trunking Protocol): Manages VLAN configurations across multiple
switches.
4. LACP (Link Aggregation Control Protocol): Combines multiple links into one logical
link for increased bandwidth.

You might also like