Internet Technology
The Internet :
1. The Internet is a public and global communication network that provides direct
connectivity to anyone over a local area network (LAN) or Internet Service
Provider (ISP).
2. The Internet is a public network that is connected and routed over gateways.
End users are connected to local access providers (LANs or ISPs), who are
connected to the Internet access providers, to network access providers, and
eventually to the Internet backbone.
3. Since access to the Internet is open to all, there is a lack of control that may
result in an unruly proliferation of information.
The Intranet :
1. An intranet is a corporate LAN or wide area network (WAN) that uses Internet
technology and is secured behind company’s firewalls (see security and
protection).
2. The intranet links various servers, clients, databases, and application programs
like Enterprise Resource Planning (ERP). Although intranets are developed on
the same TCP/IP protocol as the Internet, they operate as a private network
with limited access.
3. Only authorized employees are able to use it. Intranets are limited to
information pertinent to the company and contain exclusive and often
proprietary and sensitive information.
4. The firewalls protect the intranets from unauthorized outside access; the
intranet can be used to enhance the communications and collaboration among
authorized employees, customers, suppliers, and other business partners.
5. Since the intranet allows access through the Internet, it does not require any
additional implementation of leased networks. This open and flexible
connectivity is a major capability and advantage of intranet. Intranets provide
the infrastructure for many intrabusiness commerce applications.
The Extranet :
1. An extranet, or “extended intranet”, uses the TCP/IP protocol network of the
Internet, to link intranets in different locations.
2. Extranet transmission is usually conducted over the Internet, which offers little
privacy or transmission security.
3. Therefore, when using an extranet, it is necessary to improve the security of
connecting portions of he Internet. This can be done by creating tunnels (see
paragraph on security and protection) of secured data flows, using
cryptography and authorization algorithm.
4. The Internet with tunneling technology is known as a virtually private network
(VPN).
5. Extranets provide secured connectivity between corporation’s intranets and the
intranets of its business partners, material suppliers, financial services,
government, and customers.
6. Access to intranets is usually limited by agreements of the collaborating parties,
is strictly controlled, and is only available to authorized personnel.
7. The protected environment of the extranet allows groups to collaborate, sharing
information exclusively, and exchanging it securely.
8. Since an extranet allows connectivity between businesses through the Internet,
it is an open and flexible platform suitable for supply chain management.
9. To increase security, many companies replicate the database they are willing to
share with their business partners and separate them physically from their
regular intranets.
Fig. Diagrammatic Contrast of the Internet, Intranet, and Extranet
Different between internet, intranet, and extranet? Or compare internet, intranet and
extranet?
World Wide Web (WWW) :
1. The WWW is such an immensely popular Internet facility that for many
users, it has become synonymous with the Internet.
2. Developed in 1992 at the European Laboratory for Particle Physics at Cern,
Switzerland, the WWW links users to Internet sites.
3. The basic unit of WWW communication is the page, similar to this printed
page. Within a Web page are "links" on which users can click and be
automatically connected to related pages at the same or other Internet
Websites.
4. With its ease of use and its multimedia ability to transmit text, graphics,
audio, and video and to retrieve detailed information from anywhere in the
world in seconds, the WWW has quickly become the interface of choice for
Internet users.
COMPONENTS OF THE WWW :
Key to the success of the WWW is its powerful system of links, allowing
users to explore related sets of data stored in different computers on the
Internet. This system of embedding links in the text of a Web page, called
"hypertext," allows any sort of data to be accessed from a Web page by clicking
on highlighted and/or underlined links that point to other pages.
Users are automatically routed to the selected Web page even if it resides
in a distant computer. This web of interconnected pages gives the WWW its
name. Every Web page has its own unique title, known as the Uniform
Resource Locator (URL1 ). A URL contains both the Internet address of the
computer on which a Web page is stored and the name of the computer file that
actually contains the page. More than 1/2 million WWW sites exist on the
Internet, and each may contain numerous URLs.
The result is tens of millions of Web pages! So that users may view and
retrieve Web pages without having to know and type the URL each time, a
special type of program, known as a "browser," was developed. A browser
program operates on a personal computer, interfacing it with the Internet and
allowing users to "surf the WWW. Browsers are inexpensive and typically
available without cost to educators.
All browsers allow Internet users to
(1) retrieve Web pages from other computers,
(2) display these pages on the user's screen, using formatting commands
that were specified by the author of the page, and
(3) make the Web pages active, progressing to the referenced file or URL
by pointing and clicking on a hypertext link embedded in a page.
Browsers are very easy to use, and even a computer novice can become
accustomed to navigating the Internet within minutes.
The new user will soon realize, however, that navigating
effectively through millions of Web pages requires skill in searching. To
deal with this abundance of information, Internet users take advantage
of WWW software tools known as "search engines".
A Web site is a collection of related Web pages and associated
items, such as documents and pictures, stored on a Web server. A Web
server is a computer that delivers requested Web pages to your
computer. The same Web server can store multiple Web sites.
Internet Features and services :
1. The Internet is a public and global communication network that provides
direct connectivity to anyone over a local area network (LAN) or Internet
Service Provider (ISP).
2. The Internet is a public network that is connected and routed over gateways.
End users are connected to local access providers (LANs or ISPs), who are
connected to the Internet access providers, to network access providers,
and eventually to the Internet backbone.
3. Since access to the Internet is open to all, there is a lack of control that may
result in an unruly proliferation of information. Major Features of Internet:
1. The World Wide Web.
2. E-Mail.
3. News
4. Telnet.
5. File Transfer Protocol(FTP).
6. Internet Relay Chat(IRC).
TCP/IP(Overview) :
TCP/IP stands for Transmission Control Protocol/Internet Protocol and
is a suite of communication protocols used to interconnect network devices on
the internet. TCP/IP is also used as a communications protocol in a private
computer network -- an intranet or extranet.
The entire IP suite -- a set of rules and procedures -- is commonly
referred to as TCP/IP. TCP and IP are the two main protocols, though others
are included in the suite. The TCP/IP protocol suite functions as an abstraction
layer between internet applications and the routing and switching fabric.
TCP/IP specifies how data is exchanged over the internet by providing
end-to-end communications that identify how it should be broken into packets,
addressed, transmitted, routed and received at the destination. TCP/IP requires
little central management and is designed to make networks reliable with the
ability to recover automatically from the failure of any device on the network.
Internet Protocol Version 4 (IPv4) is the primary version used on the
internet today. However, due to a limited number of addresses, a newer
protocol known as IPv6 was developed in 1998 by the Internet Engineering
Task Force (IETF). IPv6 expands the pool of available addresses from IPv4
significantly and is progressively being embraced.
TCP/IP suite :
In this section, we will understand the TCP/IP suite, that contain the
different layers of the TCP/IP model and their functionality in the network
concept and the working flow of TCP/IP:
[Link] TCP/IP model is divided into four different layers:
Application layer
Transport layer
Internet layer
Network Access layer
Each layer performs a specific task on the data that is being transmitted over
the network channel, and data moves from one layer to another in a preset
pattern as mentioned below:
Fig. Data flow diagram of TCP/IP model(sender side to receiver
side)
The above model represents the flow of data when it is being transmitted from
the sender side. In the case of data being received, the layers of the model
work in reverse order.
Now, take a look at each of the layers in detail first:
Application Layer:
Fig. Visualization of application layer
This is the topmost layer which indicates the applications and programs
that utilize the TCP/IP model for communicating with the user through
applications and various tasks performed by the layer, including data
representation for the applications executed by the user and forwards it to the
transport layer.
The application layer maintains a smooth connection between the application
and user for data exchange and offers various features as remote handling of
the system, e-mail services, etc.
Some of the protocols used in this layer are:
HTTP: Hypertext transfer protocol is used for accessing the information
available on the internet.
SMTP: Simple mail transfer protocol assigned the task of handling e-mail-
related steps and issues.
FTP: This is the standard protocol that oversees the transfer of files over the
network channel.
Now, move on to the next layer,
Transport Layer:
Fig. Visualization of transport layer
This layer is responsible for establishing the connection between the
sender and the receiver device and also performs the task of dividing the data
from the application layer into packets, which are then used to create
sequences.
It also performs the task of maintaining the data, i.e., to be transmitted without
error, and controls the data flow rate over the communication channel for
smooth transmission of data.
The protocols used in this layer are:
TCP: Transmission Control Protocol is responsible for the proper
transmission of segments over the communication channel. It also
establishes a network connection between the source and destination
system.
UDP: User Datagram Protocol is responsible for identifying errors, and
other tasks during the transmission of information. UDP maintains
various fields for data transmission such as:
Source Port Address: This port is responsible for designing the
application that makes up the message to be transmitted.
Destination Port Address: This port receives the message sent from
the sender side.
Total Length: The total number of bytes of the user datagram.
Checksum: Used for error detection of the message at the destination
side.
Moving on to the next layer, we have:
Internet Layer:
Fig. Visualization of internet layer
The Internet layer performs the task of controlling the transmission of the
data over the network modes and enacts protocols related to the various steps
related to the transmission of data over the channel, which is in the form of
packets sent by the previous layer.
This layer performs many important functions in the TCP/IP model, some of
which are:
1. It is responsible for specifying the path that the data packets will use for
transmission.
2. This layer is responsible for providing IP addresses to the system for the
identification matters over the network channel.
Some of the protocols applied in this layer are:
IP: This protocol assigns your device with a unique address; the IP
address is also responsible for routing the data over the communication
channel.
ARP: This protocol refers to the Address Resolution Protocol that is
responsible for finding the physical address using the IP address.
The last layer in the network model is the network access layer, also we can
call it data link layer.
Network Access Layer:
Fig. Visualization of network access layer
This layer is the combination of data-link and physical layer, where it is
responsible for maintaining the task of sending and receiving data in raw bits,
i.e., in binary format over the physical communication modes in the network
channel.
It uses the physical address of the system for mapping the path of transmission
over the network channel.
[Link] flow of TCP/IP:
The TCP/IP protocol suite is the set of communication protocols used to
connect hosts on the Internet. TCP/IP allows computers on the same network
to identify and communicate with each other. TCP/IP is a two-layer protocol,
with the transport layer (TCP) responsible for reliable end-to-end
communication and the Internet layer (IP) accountable for routing packets from
the host to the host.
At the transport layer, TCP provides a reliable byte-stream service to
applications. TCP guarantees the delivery of data, and that data will be
delivered in the same order in which it was sent. TCP uses several
mechanisms to provide this service, including sequence numbers,
acknowledgments, and timeouts.
At the Internet layer, IP is responsible for routing datagrams (packets) from
host to host. IP does not guarantee the delivery of datagrams, but it tries to
deliver them as best. If a datagram cannot be delivered, IP will return an
error message to the source host.
The TCP/IP protocol suite is the most commonly used protocol suite on the
Internet today, and it is also the protocol suite used by most LANs and WANs.
IP Addressing and Routing
1. IP Addressing
IP (Internet Protocol) addressing is a system used to uniquely identify devices
on a network. Each device is assigned an IP address for communication.
1.1. Types of IP Addresses
Type Description Example
IPv4 32-bit address (most widely used) [Link]
IPv6 128-bit address (newer version, more addresses) 2001:db8::1
1.2. IPv4 Address Format
IPv4 addresses are written in dotted decimal notation, divided into four
octets(8-bit each). Example: [Link]
(Binary:11000000.10101000.00000001.00000001)
1.3. IPv4 Address Classes
Class Starting Range Subnet Mask Usage
Class [Link] –
[Link] Large networks
A [Link]
Class [Link] – Medium
[Link]
B [Link] networks
Class [Link] –
[Link] Small networks
C [Link]
Class [Link] –
- Multicasting
D [Link]
Class [Link] –
- Reserved
E [Link]
1.4. Private vs. Public IP Addresses
Type Usage Examples
[Link],
Public IP Assigned by ISP, used on the internet
[Link]
Private Used inside networks, not routable on [Link],
IP the internet [Link]
Reserved Private IP Ranges:
Class A: [Link] – [Link]
Class B: [Link] – [Link]
Class C: [Link] – [Link]
1.5. IPv6 Address Format
IPv6 uses a 128-bit address written in hexadecimal.
Example: 2001:db8:85a3::8a2e:370:7334
Advantages of IPv6:
More address space
Improved security
Better routing efficiency
2. Subnetting
Subnetting divides a large network into smaller subnetworks to improve
efficiency and security.
Subnet Mask
A subnet mask determines which part of an IP address is the network and which
part is the host.
Example:
IP Address: [Link]
Subnet Mask: [Link]
Network: [Link]
Host: 10
CIDR Notation (Classless Inter-Domain Routing)
CIDR is a method of efficient IP address allocation.
Example:
[Link]/24 → 24 bits for the network, 8 bits for hosts
[Link]/8 → 8 bits for the network, 24 bits for hosts.
3. Routing
Routing is the process of forwarding data from a source to a destination across
a network.
3.1. Types of Routing
Type Description
Static Routing Manually configured routes. Suitable for small networks.
Dynamic Automatically updates routes using protocols. Used in
Routing large networks.
Routes all traffic to a single gateway when no specific
Default Routing
route is found.
3.2. Routing Table
A routing table contains information about available routes. Example:
Destination Subnet Mask Next Hop
[Link] [Link] [Link]
[Link] [Link] [Link]
[Link] [Link] [Link] (Default Gateway)
3.3. Routing Protocols
Protocol Type Used For
RIP (Routing Information Distance Small networks, slow
Protocol) Vector convergence
OSPF (Open Shortest
Link State Large enterprise networks
Path First)
BGP (Border Gateway Internet backbone (ISP
Path Vector
Protocol) routing)
4. IP Addressing and Routing Workflow
1. Device gets an IP address (Static/DHCP).
2. Device checks if the destination is in the same subnet.
3. If in the same subnet, it sends the packet directly.
4. If not, it forwards the packet to the default gateway.
5. The router checks its routing table and forwards the packet.
6. Packet reaches the destination.
Routing Algorithm
1. Introduction to Routing Algorithms
Routing algorithms determine the best path for data to travel between networks.
They are classified based on the scope of routing:
Intra-Domain Routing → Used within a single Autonomous System (AS).
Inter-Domain Routing → Used between different Autonomous Systems.
2. Intra-Domain vs. Inter-Domain Routing
Category Description Examples
Intra-Domain Routing Used inside a single RIP, OSPF
Autonomous System.
Inter-Domain Routing Used to route between BGP
different ASes
(Autonomous Systems).
Autonomous System (AS) in Networking
1. What is an Autonomous System (AS)?
An Autonomous System (AS) is a large network or a group of networks under a single
administrative control that follows a common routing policy. It is used for internet
routing.
Key Characteristics of an AS
Identified by a unique Autonomous System Number (ASN).
Managed by one entity, such as an ISP, company, or university.
Uses Interior Gateway Protocols (IGPs) for internal routing.
Uses Exterior Gateway Protocols (EGPs) for communication with other ASes.
Classful and Classless Addressing –
1. Introduction
IP addressing is used to uniquely identify devices in a network. There are two
types of addressing:
Classful Addressing → Uses predefined IP address classes.
Classless Addressing (CIDR) → Allows flexible subnetting without predefined
classes.
2. Classful Addressing
Classful addressing divides IP addresses into five classes (A, B, C, D, E), based on
fixed subnet masks.
Clas Starting Ending Range Default Subnet Max Usage
s Range Mask Hosts
per
Networ
k
Clas [Link] [Link] [Link](/8) ~16 Large
sA 5 million networks
(e.g., ISPs,
big
organizatio
n
Clas 128.0.0. [Link] [Link](/16) ~65000 Medium-
sB 0 5 sized
networks
Clas 192.0.0. [Link] [Link](/ 254 Small
sC 0 5 24) networks
Clas 224.0.0. [Link] - - Multicastin
sD 0 5 g
Clas 240.0.0. [Link] - - Reserved
sE 0 5 for future
use
Advantages of Classful Addressing:
Simplicity and Easy to Understand
Automatic Default Subnet Masks,
Efficient Routing in Small Networks,
Backward Compatibility,
Standardized Network Design.
Limitations of Classful Addressing:
Wastes IP addresses (fixed subnet sizes).
No support for subnetting (cannot divide networks efficiently).
No VLSM (Variable Length Subnet Masking).
3. Classless Addressing (CIDR - Classless Inter-Domain Routing)
Classless addressing removes fixed IP classes and allows flexible subnetting.
Introduced in 1993, it optimizes IP usage.
3.1. CIDR Notation
Instead of fixed subnet masks, CIDR uses a suffix (slash notation) to define subnet
masks.
CIDR Notation Subnet Mask Hosts per Subnet
/8 [Link] 16 million
/16 [Link] 65,536
/24 [Link] 256
/30 [Link] 2 (used for point-to-point
links)
3.2. Advantages of Classless Addressing
Efficient IP allocation (no wastage).
Supports subnetting and VLSM.
Scalable and flexible for large networks.
3.3 Disadvantages of Classless Addressing
More Complex Configuration,
Increased Router Processing Load,
More Complex Routing Tables,
Difficult for Manual Network Design
Nor Compatible with Older Protocols.
Difference between Classful and Classless Addressing –
Feature Classful Addressing Classless Addressing
IP Allocation Fixed class (A, B, C) Flexible, based on need.
Subnet Mask Default subnet mask Variable-length subnet
(fixed) mask (VLSM)
Efficiency Wastes IP addresses Optimized IP address
allocation
Subnetting Support Not supported Fully supports subnetting
and VLSM
Routing Protocols Used in older protocols Used in modern protocols
(RIP v1) (RIP v2, OSPF, BGP)
Routing Table Size Smaller (fewer entries) Larger (more entries due
to VLSM)
Ease of Use Simple and easy to More complex (requires
understand subnetting knowledge)
Scalability Limited (fixed IP Highly scalable (custom
blocks) subnetting)
Usage Outdated, no longer Standard for modern IP
used in the internet networking.
MODULE 2
Client-server model –
The Client-Server Model is a network architecture where multiple clients request and
receive services from a centralized server. This model is widely used in web
applications, databases, and enterprise networks.
Definition
The Client-Server Model is a distributed architecture that divides tasks between service
providers (servers) and service requesters (clients). The client sends requests to the
server, and the server processes them and returns responses.
Components of the Client-Server Model
1. Client:
o Requests services from the server.
o Sends data input (e.g., HTTP requests).
o Receives responses from the server.
o Can be a web browser, mobile app, or any application.
2. Server:
o Processes client requests.
o Stores, manages, and sends data.
o Provides services such as web hosting, database access, or
authentication.
o Can be a physical machine, cloud server, or virtual server.
3. Network:
o Medium of communication between the client and the server.
o Can be the Internet, LAN, or WAN.
Working Process of the Client-Server Model
1. The client sends a request to the server using a network (e.g., HTTP request to
a web server).
2. The server processes the request and retrieves the necessary data or performs
the requested task.
3. The server sends a response back to the client.
4. The client receives and displays the data.
Types of Client-Server Models
1. Two-Tier Architecture: Direct communication between client and server. (E.g.,
Web Browser & Web Server)
2. Three-Tier Architecture: Involves an additional middle layer like a database
server. (E.g., Web Server → Application Server → Database Server)
3. Multi-Tier Architecture: More complex layers such as caching, load balancing,
etc.
Advantages of Client-Server Model
Centralized Management: Data and services are centrally managed.
Scalability: Servers can handle multiple clients.
Security: Centralized control improves security measures.
Resource Sharing: Multiple clients share server resources efficiently.
Disadvantages of Client-Server Model
Single Point of Failure: If the server crashes, all clients are affected.
High Cost: Server maintenance requires investment.
Network Dependency: Requires a stable network for communication.
Client-Server Model Diagram
Client 1 Client 2 Client 3
| | |
|--------------|---------------|
|
SERVER
Database / Storage
Berkeley Socket Interface –
1. Introduction to Berkeley Sockets
The Berkeley Socket Interface is a programming interface (API) used for network
communication in Unix-like operating systems (e.g., Linux, macOS). It provides
functions for creating, managing, and communicating over network connections using
protocols like TCP/IP and UDP.
The Berkeley sockets API is used in C, C++, Python, Java, and other programming
languages for client-server communication.
2. Socket Programming Basics
A socket is an endpoint for sending or receiving data across a network.
Types of Sockets
Socket Type Description Protocol Used
Stream Socket Provides reliable, TCP
connection-oriented
communication.
Datagram Socket Provides connectionless, UDP
fast communication.
3. Berkeley Socket Functions
The Berkeley socket API provides six primary functions for network communication.
Function Description
socket() Create a new socket.
bind() Assigns an IP address and port to the
socket.
listen() Marks the socket as passive (server
waiting for connections).
accept() Accepts incoming client connections.
connect() Connects the client to the server.
send()/recv() Sends or receives data over the
connection.
close() Close the soket.
4. Client-Server Communication using Berkeley Sockets
4.1. Server Workflow (TCP)
1. Create a socket → socket()
2. Bind to an IP and port → bind()
3. Start listening for clients → listen()
4. Accept a connection → accept()
5. Communicate (send/receive data) → send() / recv()
6. Close the socket → close()
4.2. Client Workflow (TCP)
1. Create a socket → socket()
2. Connect to the server → connect()
3. Communicate (send/receive data) → send() / recv()
4. Close the socket → close()
Common Protocols in TCP/IP suite –
The TCP/IP protocol suite is the foundation of internet communication. It consists of
various protocols, each serving a specific purpose. Below are some essential protocols:
1. ARP (Address Resolution Protocol)
ARP is used to map an IP address to a MAC (Media Access Control) address
in a local network.
It helps devices communicate within the same network by resolving IP addresses
into physical addresses.
Example: When a device wants to send data to another device within a LAN, it
uses ARP to find the recipient’s MAC address.
Working of ARP:
1. The sender broadcasts an ARP request on the network.
2. The device with the matching IP address responds with its MAC address.
3. The sender updates its ARP cache with the resolved MAC address.
2. RARP (Reverse Address Resolution Protocol)
RARP performs the opposite function of ARP: it maps a MAC address to an IP
address.
It is used by diskless systems that do not have an IP address assigned at
startup.
Replaced by DHCP, making RARP mostly obsolete.
3. ICMP (Internet Control Message Protocol)
ICMP is used for error reporting, diagnostics, and network troubleshooting.
It helps devices communicate network errors and status updates.
Common ICMP Messages:
Echo Request & Reply: Used by the ping command to check connectivity.
Destination Unreachable: Sent when a packet cannot reach its destination.
Time Exceeded: Sent when a packet's TTL (Time-To-Live) expires (used in
traceroute).
4. BOOTP (Bootstrap Protocol)
BOOTP is used to assign IP addresses dynamically to devices when they boot
up.
It also provides information like the default gateway and subnet mask.
Used in diskless workstations.
DHCP is an advanced version of BOOTP.
5. DHCP (Dynamic Host Configuration Protocol)
DHCP automatically assigns IP addresses to devices on a network.
It eliminates the need for manual IP configuration.
Can also provide subnet mask, default gateway, and DNS server addresses.
Working of DHCP:
1. DHCP Discover: The client broadcasts a request for an IP address.
2. DHCP Offer: The server responds with an available IP.
3. DHCP Request: The client requests the offered IP.
4. DHCP Acknowledgment: The server assigns the IP to the client.
6. FTP (File Transfer Protocol)
FTP is used to transfer files between a client and a server over a network.
It operates in two modes:
o Active Mode: The server opens a data connection to the client.
o Passive Mode: The client initiates both control and data connections.
Common FTP Commands:
get <filename> → Download a file from the server.
put <filename> → Upload a file to the server.
ls → List files on the server.
7. TELNET (Terminal Network)
TELNET is used for remote login and command execution on a remote system.
It allows users to control a remote machine as if they were using it locally.
TELNET is insecure because it transmits data in plain text.
Replaced by SSH for secure remote access.
DNS Domain Name System (DNS) – iterative versus recursive name
resolution.
1. What is DNS?
The Domain Name System (DNS) is a hierarchical system that translates human-
readable domain names (e.g., [Link]) into IP addresses (e.g.,
[Link]). This allows users to access websites without memorizing complex
numerical addresses.
When a user enters a domain name in a web browser, a DNS query is performed to
resolve the name to an IP address. This resolution process can occur in two ways:
Iterative and Recursive.
Comparison Table
Feature Recursive DNS Iterative DNS Resolution
Resolution
Query Handling The resolver handles the The resolver gives
entire resolution process. referrals, and the client
must query further.
Performance Slower for uncached Faster for direct responses
queries but faster for future but takes time for multiple
requests. queries.
Load on Resolver Higher, since it must Lower, as each server only
complete the entire provides the next step.
resolution.
Common Use Used by ISPs and public Used by authoritative
DNS resolvers (Google name servers and root
DNS, Cloudflare DNS). servers.
Simple Main Transfer Protocol (SMTP) – command and response
formats, POP3 and IMAP.
1. Simple Mail Transfer Protocol (SMTP)
SMTP is a standard email transmission protocol used to send emails from a client to
a mail server or between mail servers.
SMTP Command Format
Commands are sent in plain text.
Each command is a single line ending with CRLF (\r\n).
Command Description Example
Hello or EHLO Introduces the client to EHLO [Link]
the server
MAIL FROM: Specifies the sender’s MAIL
email address FROM:<sender@[Link]>
RCPT TO: Specifies the recipient’s RCPT
email address TO:<receiver@[Link]>
DATA Signals the start of the DATA
email content
QUIT Ends the SMTP session QUIT
SMTP Response Format
The server responds with 3-digit status codes followed by a text message.
The first digit of the code indicates the response type.
Code Meaning Example Response
220 Server ready 220 [Link]
ESMTP
250 Request completed 250 OK
successfully
354 Start email content input 354 End data with
<CRLF>.< CRLF >
550 Requested action not 550 No such user here
taken (e.g., user
unavailable)
2. POP3 (Post Office Protocol 3)
POP3 is used to retrieve emails from a mail server to a client (e.g., Outlook,
Thunderbird).
Key Features of POP3
Downloads emails to the client and deletes them from the server (by
default).
Works in offline mode after downloading emails.
Simple and fast, but lacks synchronization across devices.
POP3 Commands
Command Description
USER <username> Provide username for authentication.
PASS <password> Provide password for authentication.
LIST List available messages.
RETR <message_id> Retrieve a specific message.
DELE <message_id > Delete a specific message.
QUIT End the session.
3. IMAP (Internet Message Access Protocol)
IMAP is a more advanced protocol used to access emails while keeping them on
the server.
Key Features of IMAP
Emails remain on the server (can be accessed from multiple devices).
Supports folder management (e.g., Inbox, Sent, Spam).
Allows partial message retrieval (useful for slow connections).
Used by web-based email services like Gmail, Yahoo Mail, Outlook.
Command Description
LOGIN <username> <password> Authenticate user
SELECT <folder> Select a mailbox (e.g., Inbox)
FETCH <message_id> Retrieve an email
STORE <message_id> +FLAGS Mark an email for deletion
(\Deleted)
LOGOUT End the session
Hyper-Text Transport Protocol (HTTP) – request and response
formats, HTTP server.
HTTP is the foundation of data communication on the web. It is a stateless protocol
used for transmitting hypertext documents (e.g., web pages) between a client (browser)
and a web server.
1. HTTP Request Format
An HTTP request is sent from the client (browser) to the web server to request a
resource (e.g., a webpage or an image).
Structure of an HTTP Request
An HTTP request consists of:
1. Request Line (Method, URL, HTTP Version)
2. Headers (Metadata about the request)
3. Optional Body (Only for methods like POST, PUT)
Example of an HTTP Request
GET /[Link] HTTP/1.1
Host: [Link]
User-Agent: Mozilla/5.0
Accept: text/html
1.1. HTTP Methods
Method Description
GET Requests a resource (e.g., webpage,
image).
POST Sends data to the server (e.g., form
submission).
PUT Updates a resource.
DELETE Delete a resource.
HEAD Retrieves headers without the body.
1.2. Common HTTP Request Headers
Header Description
Host Specifies the target server (e.g., Host:
[Link]).
User-Agent Identifies the client (browser or app).
Accept Specific the response format (e.g.,
text/html).
Content-Type Specifies the type of data sent (for
POST/PUT requests).
2. HTTP Response Format
The server responds with an HTTP response that contains:
1. Status Line (HTTP version, Status Code, Status Message)
2. Headers (Metadata about the response)
3. Response Body (Actual content, e.g., an HTML page)
2.1. HTTP Status Codes
Code Category Meaning
1xx Informational Request received,
processing continues.
2xx Success Request successful (e.g.,
200 OK).
3xx Redirection Further action needed
(e.g., 301 Moved
Permanently).
4xx Client Errors Request failed due to client
error (e.g., 404 Not
Found).
5xx Server Errors Server failed to process
request (e.g., 500 Internal
Server Error).
3. HTTP Server
An HTTP server is software that handles HTTP requests and serves web pages.
Popular HTTP servers include:
Apache HTTP Server (Most widely used open-source server)
Nginx (High-performance server)
Microsoft IIS (Windows-based server)
How an HTTP Server Works
1. Client (Browser) Sends a Request
o Example: GET /[Link]
2. Server Processes the Request
o Looks for [Link]
3. Server Sends an HTTP Response
o Response includes 200 OK status and the requested page.
MODULE 3
1. What does HTML stand for?
a) Hyper Text Markup Language
b) Hyperlinks and Text Markup Language
c) Home Tool Markup Language
d) Hyperlink Transfer Markup Language
Answer: a) Hyper Text Markup Language
2. Which HTML tag is used to create a hyperlink?
a) <link>
b) <a>
c) <href>
d) <hyper>
Answer: b) <a>
3. Which tag is used to define an unordered list in HTML?
a) <ol>
b) <ul>
c) <li>
d) <list>
Answer: b) <ul>
4. What will happen if you place multiple <title> tags inside the <head>
section of an HTML document?
a) The browser will display an error.
b) The page title will be set to the content of the first <title> tag.
c) The page title will be set to the content of the last <title> tag.
d) The browser will concatenate all <title> tags and display them as a single title.
Answer: c) The page title will be set to the content of the last <title> tag.
5. Which of the following is the correct way to create a line break in HTML?
a) <br>
b) <lb>
c) <break>
d) <newline>
Answer: a) <br>
6. Which HTML element is used to display the largest heading?
a) <h6>
b) <h1>
c) <head>
d) <header>
Answer: b) <h1>
7. Which CSS properties contribute to an element’s box model?
a) width, height, color, display
b) border, margin, padding, width, height
c) font-size, text-align, visibility, z-index
d) overflow, clip, float, opacity
Answer: b) border, margin, padding, width, height
8. What does CSS stand for?
a) Creative Style Sheets
b) Cascading Style Sheets
c) Computer Style Sheets
d) Colorful Style Sheets
Answer: b) Cascading Style Sheets
9. Which property is used to change the background color in CSS?
a) background-color
b) bgcolor
c) color
d) background
Answer: a) background-color
10. How do you apply a CSS class to an element?
a) <div id="classname">
b) <div class="classname">
c) <div name="classname">
d) <div style="classname">
Answer: b) <div class="classname">
11. Which CSS property controls text size?
a) font-style
b) text-size
c) font-size
d) text-style
Answer: c) font-size
12. Which of the following is used to make a text bold in CSS?
a) font-weight: bold;
b) text-bold: true;
c) font-style: bold;
d) bold: yes;
Answer: a) font-weight: bold;
13. How to create an object in JavaScript?
a) var obj = {};
b) var obj = new Object();
c) var obj = [Link](null);
d) All of the above
Answer: d) All of the above
14. What will happen if you apply position: absolute; to an element without
specifying top, left, right, or bottom?
a) The element will be removed from the document flow and stay in its original
position.
b) The element will move to the top-left corner of the page.
c) The element will be positioned relative to its closest positioned ancestor.
d) The element will disappear from the page.
Answer: a) The element will be removed from the document flow and stay in its
original position.
15. What is the correct syntax to write a JavaScript comment?
a) /* This is a comment */
b) // This is a comment
c) # This is a comment
d) Both a and b
Answer: d) Both a and b
16. How do you declare a JavaScript variable?
a) var x;
b) let x;
c) const x;
d) All of the above
Answer: d) All of the above
17. Which operator is used for strict equality comparison in JavaScript?
a) ==
b) ===
c) !=
d) =
Answer: b) ===
18. Which function is used to print content in JavaScript?
a) [Link]()
b) print()
c) [Link]()
d) Both a and c
Answer: d) Both a and c
19. What is the correct way to write an array in JavaScript?
a) var arr = "red", "blue", "green";
b) var arr = ["red", "blue", "green"];
c) var arr = (1:"red", 2:"blue", 3:"green");
d) var arr = {"red", "blue", "green"};
Answer: b) var arr = ["red", "blue", "green"];
20. Which CSS property is used to change the text color of an element?
a) text-color
b) color
c) font-color
d) text-style
Answer: b) color