Computer Networks
A computer network is a collection of interconnected devices and systems that are capable of
exchanging data and resources. These devices can include computers, servers, routers, switches,
printers, and various other hardware components. The primary purpose of a computer network is to
enable communication and resource sharing among these devices, allowing them to work together
efficiently.
In essence, a computer network provides a means for devices to connect, communicate, and
collaborate, whether they are located within the same physical location (such as a local area network
or LAN) or spread across vast distances (such as a wide area network or WAN). By establishing
connections between devices and implementing communication protocols and technologies, computer
networks facilitate the transfer of data, the sharing of resources, and the coordination of activities
among interconnected systems.
Computer networks can be classified based on their size, geographic coverage, and transmission
technology. The main types of computer networks include:
1. Local Area Network (LAN): This is a network that interconnects computers and devices within a
limited geographical area, such as an office, school, or home. LANs are typically high-speed and
allow for efficient data transfer among connected devices.
2. Wide Area Network (WAN): A WAN spans a larger geographic area, often connecting LANs
across different locations or cities. WANs are commonly used by businesses, organizations, and
internet service providers to interconnect their networks.
3. Metropolitan Area Network (MAN): A MAN covers a larger area than a LAN but a smaller area
than a WAN, typically spanning a city or a town.
4. Personal Area Network (PAN): A PAN is a network that interconnects devices within a very
small area, such as a few meters. Examples include Bluetooth networks that connect devices like
smartphones, laptops, and peripherals.
The essential components of a computer network include:
1. Nodes: These are the computing devices, such as computers, servers, printers, or smartphones,
that are connected to the network.
2. Transmission media: This refers to the physical or wireless means through which data is
transmitted, such as copper cables, fiber optic cables, or radio waves.
3. Network devices: These are specialized hardware components that enable data transmission
and control the flow of data within the network. Examples include routers, switches, modems,
and access points.
Networks operate based on a set of rules and protocols that define how data is formatted, addressed,
transmitted, and received. The most widely used protocol suite is the TCP/IP (Transmission Control
Protocol/Internet Protocol), which forms the foundation of the internet.
Computer networks provide numerous benefits, including:
Resource sharing: Connected devices can share files, printers, and other resources.
Data transfer: Networks enable efficient data transfer between devices, facilitating
communication and collaboration.
Internet access: Networks provide access to the global internet, enabling various online services
and applications.
Remote access: Networks allow remote access to resources and control of devices from different
locations.
Network security, performance, and scalability are essential considerations in the design and
implementation of computer networks.
The OSI Model
The OSI model is a conceptual framework that describes how network communications work by
dividing the process into seven layers. Each layer has a specific function and interacts with the layers
above and below it. The OSI model is a reference model that provides a standard for different
computer systems to communicate with each other, making it a universal language for computer
networking.
The OSI model consists of seven distinct layers, with each layer representing a specific function or set
of protocols. These layers are:
1. Physical Layer: This layer is responsible for the actual physical connection between devices
and the transmission of individual bits. It provides bit synchronization and
converts signals into 0s and 1s.
2. Data Link Layer: This layer ensures reliable data transfer between two devices on the same
network. It breaks packets into frames and provides flow control and error
control.
3. Network Layer: This layer facilitates data transfer between different networks. It breaks up
segments from the transport layer into smaller units called packets, routes
them, and reassembles them on the receiving end.
4. Transport Layer: This layer ensures reliable data transfer between devices by providing flow
control and error control. It also ensures that data is delivered in the correct
order.
5. Session Layer: This layer establishes, maintains, and terminates connections between
applications. It ensures authentication and security
6. Presentation Layer: This layer handles data representation, encryption, and conversion,
ensuring that data is delivered in a format that can be understood by
the receiving application.
7. Application Layer: The application layer is the closest layer to the user and provides
services and protocols for various applications, such as HTTP, FTP,
SMTP, and DNS.
Advantages of OSI Model
Standardization: Each layer has fixed functions and protocols, making it easier to understand
and troubleshoot network issues.
Divided Network Communication: The OSI model divides network communication
into seven layers, making it easier to manage and improve.
Easier Troubleshooting: The OSI model helps diagnose network problems by isolating
issues to specific layers
The TCP/IP Reference Model
The TCP/IP (Transmission Control Protocol/Internet Protocol) reference model is a concise
architectural model that describes the set of protocols used in modern computer networks, particularly
the internet. The TCP/IP model is a practical implementation of the OSI reference model and is widely
used for communication over the internet and other networks. The TCP/IP model consists of four
layers, each with specific functions and protocols:
1. Application Layer: This layer provides services to end-user applications and includes
protocols like HTTP, FTP, SMTP, DNS, TELNET, and SNM
2. Transport Layer: The transport layer ensures reliable data transfer between devices. It
provides flow control, error correction, and segmentation of data
into smaller units called packets
3. Internet Layer: Also known as the network layer, this layer is responsible for logical
addressing and routing of data packets between networks. The main
protocol used in this layer is IP (Internet Protocol), which includes
IPv4 and IPv6.
4. Network Access Layer: This layer is responsible for the physical and logical connection
between devices. It includes protocols for accessing the physical
network, such as Ethernet and Wi-Fi
The TCP/IP model is more concise than the OSI (Open Systems Interconnection) reference model,
which has seven layers. However, the two models have similar principles and can be mapped to each
other, with the TCP/IP model's Network Access Layer corresponding to the combined functions of the
OSI model's Physical and Data Link layers.
Protocols and Hardware involved in the OSI model
1. Physical Layer:
Hardware: Network cables (coaxial, twisted-pair, fiber optic), network interface cards
(NICs), hubs, repeaters, modems, and other physical transmission media.
2. Data Link Layer:
Protocols: Ethernet (IEEE 802.3), Wi-Fi (IEEE 802.11), Point-to-Point Protocol (PPP),
High-Level Data Link Control (HDLC), and others.
3. Network Layer:
Protocols: Internet Protocol (IP), Internet Control Message Protocol (ICMP), Internet
Group Management Protocol (IGMP), and routing protocols like OSPF, EIGRP, and BGP.
4. Transport Layer:
Protocols: Transmission Control Protocol (TCP), User Datagram Protocol (UDP).
5. Session Layer:
Protocols: Remote Procedure Call (RPC), NetBIOS, and others.
6. Presentation Layer:
Protocols: JPEG, GIF, TIFF (for image compression/encoding), and data encryption
protocols like SSL/TLS.
7. Application Layer:
Protocols: HTTP, FTP, SMTP, DNS, DHCP, SNMP, and others.
Comparison of the OSI & the TCP/IP
OSI TCP/IP
OSI (Open System Interconnection) Model is a TCP/IP (Transmission Control Protocol / Internet
conceptual framework. Protocol ) Model is a communication protocol.
OSI Model has 7 layers. TCP/IP Model has 4 layers.
OSI is less reliable and easier to replace protocols. TCP/IP is more reliable and hard to replace
protocols.
OSI follows the vertical approach. TCP/IP follows the horizontal approach.
OSI has separate Data link layer and Physical TCP/IP combines the Data link layer and Physical
layer. layer into Network layer.
Includes error detection and correction at various Error detection primarily handled in the
layers. Transport layer.
Application layer
The Application Layer is the topmost layer in both the OSI (Open Systems Interconnection) and TCP/IP
reference models for computer networks. It is the layer that directly interacts with the user
applications and provides services for effective communication and data exchange between software
applications running on different hosts.
The main functions and characteristics of the Application Layer are:
1. Application Services: This layer defines the protocols and services that enable various network
applications to communicate with each other. Some common application-layer protocols
include:
HTTP (Hypertext Transfer Protocol) for web browsing
FTP (File Transfer Protocol) for file transfer
SMTP (Simple Mail Transfer Protocol) for email
DNS (Domain Name System) for domain name resolution
DHCP (Dynamic Host Configuration Protocol) for IP address assignment
SNMP (Simple Network Management Protocol) for network management
2. User Interface: The Application Layer provides a user interface for network services, allowing
users to interact with applications and access network resources.
3. Data Formatting and Representation: This layer handles the formatting, encryption, and
conversion of data for applications to ensure compatibility and proper interpretation of data
between communicating systems.
4. Session and Connection Management: Some application-layer protocols, such as HTTP and
FTP, manage the establishment, maintenance, and termination of sessions or connections
between applications.
5. Application-Specific Protocols: Developers can create custom application-layer protocols
tailored to the specific needs of their applications, allowing for flexibility and innovative
solutions.
Domain name space
The domain name space is a hierarchical naming system used on the Internet and computer networks
to assign unique identifiers, known as domain names, to resources such as websites, email servers, and
other network services. It provides a user-friendly way of addressing resources instead of using
numerical IP addresses.
The domain name space is organized in a tree-like structure, with the root domain (represented by a
single dot) at the top, followed by top-level domains (TLDs) such as .com, .org, .edu, .gov, and country
code top-level domains (ccTLDs) like .us, .uk, .in, etc. Below the TLDs are second-level domains, third-
level domains, and so on, forming a hierarchical structure.
How DNS works
1. DNS Server: A DNS server is a computer with a database containing public IP addresses
associated with website names. It acts as a phonebook for the internet,
mapping domain names to IP addresses.
2. DNS Resolution: When a user types a domain name into their web browser, the DNS
resolver initiates a DNS lookup process. This involves a series of queries to
various DNS servers to find the IP address associated with the domain
name.
3. Types of DNS Servers:
Authoritative Nameservers: These servers maintain the DNS records for a specific
domain. They are responsible for providing the correct
IP address for a domain name.
Recursive Servers: These servers act as middlemen, helping to find the correct IP
address by recursively querying other DNS servers. They are
responsible for handling DNS queries from clients.
Root Nameservers: These servers are the topmost level in the DNS hierarchy,
responsible for directing queries to the appropriate TLD (Top-
Level Domain) nameservers.
TLD Nameservers: These servers manage the DNS records for a specific TLD (e.g.,
.com, .org, .net).
4. DNS Queries:
Recursive Query: The DNS resolver requests the DNS server to find the IP address for a
domain name, even if it does not have the information locally. If the
server does not have the information, it will recursively query other
DNS servers until it finds the correct IP address.
Iterative Query: The DNS resolver requests the DNS server to provide the best
possible answer, which may be a partial answer or an error
message.
Non0Recursive Query: The DNS resolver queries a DNS server for a record that it
already has in its cache, reducing the need for further queries.
5. DNS Caching: DNS caching is the process of storing previously resolved DNS information,
including domain names and IP addresses, to speed up future DNS lookups
and reduce the overall time of DNS resolution .
Importance of DNS:
Ease of Use: DNS allows users to access websites using easy-to-remember domain names
instead of complex IP addresses.
Scalability: DNS enables the internet to handle a large number of devices and websites by
providing a hierarchical structure for managing domain names and IP addresses.
Security: DNS caching and recursive queries help improve the security of DNS lookups by
reducing the need for repeated queries and minimizing the risk of DNS spoofing.
Electronic Email
Electronic mail, commonly known as email, is a method of exchanging digital messages over computer
networks and the internet. It is one of the most widely used communication tools in the modern world,
facilitating the exchange of information between individuals, businesses, and organizations.
Components of an Email System
1. Email Client: Software or web-based application used by the sender and recipient to write,
send, receive, and read emails (e.g., Outlook, Gmail).
2. Mail Servers:
SMTP Server: Handles outgoing mail. It sends the email from the sender to the
recipient’s mail server.
POP3/IMAP Server: Handles incoming mail. It stores the email and delivers it to the
recipient’s email client upon request.
3. Email Address: A unique identifier for an email account, usually in the format
user@domain.com.
Protocols Used in Email
1. SMTP (Simple Mail Transfer Protocol): Used to send emails from the sender’s email client to
the recipient’s mail server. Handles email transmission
between mail servers.
2. POP3 (Post Office Protocol 3): Used by email clients to retrieve emails from the mail server.
Downloads emails to the local device and usually deletes them
from the server.
3. IMAP (Internet Message Access Protocol): Used to retrieve emails from the mail server.
Synchronizes emails across multiple devices,
allowing them to stay on the server.
Benefits of Email
1. Speed: Emails are delivered almost instantaneously anywhere in the world.
2. Cost: Sending emails is typically free, requiring only an internet connection.
3. Convenience: Emails can be sent and received at any time, from anywhere with internet access.
4. Attachments: Allows users to send various types of files along with the message.
5. Record Keeping: Emails provide a written record of communications which can be archived and
retrieved when needed.
FTP
FTP (File Transfer Protocol) is a standard network protocol used for transferring files between
computers over a network. It enables the upload, download, and management of files from one system
to another.
How FTP Works
1. Connection Establishment: FTP operates on a client-server model. The client establishes a
connection to the server using a control connection, typically
over TCP port 21.
2. Authentication: The server may require the client to authenticate by providing a username
and password. Some servers allow anonymous access, where users can log
in with a default username (usually "anonymous") and email address as the
password.
3. Command and Response: The client sends commands to the server, such as requests to
upload or download files. The server responds to these
commands with status codes indicating the success or failure
of the requested action.
4. Data Transfer: A separate data connection is established for transferring files. This
connection can use different ports depending on the mode (active or
passive) of FTP being used.
In active mode, the server initiates the data connection to the client from
port 20.
In passive mode, the client initiates the data connection to a port specified
by the server.
5. File Operations: The client can perform various operations like uploading files to the
server, downloading files from the server, listing directories, and deleting
or renaming files on the server.
WWW
WWW stands for the World Wide Web, which is a system of interconnected hypertext documents and
resources accessible over the internet. It is one of the most popular and widely used services on the
internet, allowing users to access and share information across the globe. Key components of the
WWW are Web pages, Web browsers, Web servers and Uniform Resource Locators (URLs).
How the WWW works
1. Requesting a Web Page: A user enters a URL in their web browser or clicks on a
hyperlink. The browser sends an HTTP request to the web server
specified in the URL.
2. Server Response: The web server processes the request and sends back an HTTP response
containing the requested web page or an error message if the page
cannot be found.
3. Rendering the Page: The web browser receives the response and renders the HTML
content, displaying the web page to the user. The browser also
processes CSS (Cascading Style Sheets) for styling and JavaScript for
interactive features.
HTTP
HTTP (Hypertext Transfer Protocol) is the foundation of data communication for the World Wide Web.
It is a client-server protocol that enabling the transfer of files such as text, images, sound, video, and
other multimedia between client devices and servers over the internet.
How HTTP works
1. Client-Server Model: HTTP operates on a client-server model, where the client (typically a web
browser) initiates requests for resources, and the server responds with
the requested data.
2. Request-Response Cycle: Communication in HTTP centers around the request-response cycle.
The client sends an HTTP request message containing information
like the requested resource and parameters. The server processes the
request and sends back an HTTP response message with the
requested resource and additional metadata.
3. HTTP Methods: HTTP defines methods (also known as verbs) to indicate the desired action to
be performed on the identified resource. The most common methods are GET
(retrieve data) and POST (send data to the server).
4. HTTP Headers: HTTP requests and responses include headers that provide additional
information, such as the client’s details, the requested resource, and response
metadata.
5. HTTP Body: The HTTP request body contains the data being sent to the server, while the HTTP
response body contains the requested resource
Advantages and Use Cases
1. Simplicity: HTTP is easy to implement, use, and scale, making it suitable for various
applications.
2. Flexibility: HTTP supports the transfer of different types of files, including text, images, audio
and video.
3. Widespread Adoption: HTTP is the primary protocol for web communication, enabling the
World Wide Web as we know it today.
SNMP
SNMP (Simple Network Management Protocol) is a standard protocol used for managing and
monitoring network devices such as routers, switches, servers, printers, and other networked devices
on an Internet Protocol (IP) network. It is an application-layer protocol that facilitates the exchange of
management information between network devices and management systems.
Components of SNMP
1. SNMP Manager: The SNMP manager acts as the client, responsible for initiating requests and
receiving responses from SNMP agents.
2. SNMP Agent: The SNMP agent is a software module installed on managed devices, such as
routers, servers, and printers. It collects and maintains information about the
device and responds to requests from the SNMP manager.
3. Management Information Base (MIB): The MIB is a database that organizes information
about managed devices. It contains variables that
describe the device’s status and configuration, which
can be queried by the SNMP manager.
How SNMP works
1. Communication: SNMP uses a client-server architecture, where the SNMP manager initiates
requests and the SNMP agent responds with the requested information.
2. Request-Response Cycle: The SNMP manager sends requests to the SNMP agent, which then
responds with the requested data. The SNMP agent can also send
trap messages to the SNMP manager when a significant event
occurs.
3. Message Types: SNMP defines five types of messages
GetRequest: Retrieves data from an SNMP agent.
GetNextRequest: Retrieves the value of a variable.
SetRequest: Sets the value of a variable.
GetResponse: Responds to a GetRequest.
Trap: Sent by the SNMP agent when a significant event occurs.