Notes Lec 1
Notes Lec 1
Notes Lec 1
An application program that is stored on a remote server and delivered over the internet through
a browser interface. OR A web application (web app) is an application program that is stored on
a remote server and delivered over the internet through a browser interface. Web services are
web apps by definition and many, although not all, websites contain web apps.
For a web app to operate, it needs a web server, application server and database. Web servers
manage the requests that come from a client, while the application server completes the
requested task. A database stores any necessary information.
Web applications typically have short development cycles and small development teams.
Developers write most web apps in JavaScript, HTML5 or CSS. Client-side programming
typically utilizes these languages, which help build an application's front-end. Server-side
programming creates the scripts a web app will use. Languages such as Python, Java and Ruby
are commonly used in server-side programming.
Benefits
Web applications have many benefits. Some common benefits include the following:
Users can access the app through various platforms such as a desktop, laptop or mobile.
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.
LAYERS OF TCP/IP
TCP/IP is a four-layer model that defines how data is exchanged between applications, hosts, and
networks. The four layers are the application, transport, internet, and network access layers.
The diagrammatic comparison of the TCP/IP and OSI model is as follows:
The Internet Layer is a layer in the Internet Protocol (IP) suite, which is the set of protocols
that define the Internet. The Internet Layer is responsible for routing packets of data from one
device to another across a network. It does this by assigning each device a unique IP address,
which is used to identify the device and determine the route that packets should take to reach
it.
Example: Imagine that you are using a computer to send an email to a friend. When you click
“send,” the email is broken down into smaller packets of data, which are then sent to the
Internet Layer for routing. The Internet Layer assigns an IP address to each packet and uses
routing tables to determine the best route for the packet to take to reach its destination. The
packet is then forwarded to the next hop on its route until it reaches its destination. When all of
the packets have been delivered, your friend’s computer can reassemble them into the original
email message.
In this example, the Internet Layer plays a crucial role in delivering the email from your
computer to your friend’s computer. It uses IP addresses and routing tables to determine the
best route for the packets to take, and it ensures that the packets are delivered to the correct
destination. Without the Internet Layer, it would not be possible to send data across the
Internet.
3. Transport Layer
The TCP/IP transport layer protocols exchange data receipt acknowledgments and retransmit
missing packets to ensure that packets arrive in order and without error. End-to-end
communication is referred to as such. Transmission Control Protocol (TCP) and User
Datagram Protocol are transport layer protocols at this level (UDP).
TCP: Applications can interact with one another using TCP as though they were physically
connected by a circuit. TCP transmits data in a way that resembles character-by-character
transmission rather than separate packets. A starting point that establishes the connection,
the whole transmission in byte order, and an ending point that closes the connection make
up this transmission.
UDP: The datagram delivery service is provided by UDP, the other transport layer
protocol. Connections between receiving and sending hosts are not verified by UDP.
Applications that transport little amounts of data use UDP rather than TCP because it
eliminates the processes of establishing and validating connections.
4. Application Layer
This layer is analogous to the transport layer of the OSI model. It is responsible for end-to-end
communication and error-free delivery of data. It shields the upper-layer applications from the
complexities of data. The three main protocols present in this layer are:
HTTP and HTTPS: HTTP stands for Hypertext transfer protocol. It is used by the World
Wide Web to manage communications between web browsers and servers. HTTPS stands
for HTTP-Secure. It is a combination of HTTP with SSL(Secure Socket Layer). It is
efficient in cases where the browser needs to fill out forms, sign in, authenticate, and carry
out bank transactions.
SSH: SSH stands for Secure Shell. It is a terminal emulations software similar to Telnet.
The reason SSH is preferred is because of its ability to maintain the encrypted connection.
It sets up a secure session over a TCP/IP connection.
NTP: NTP stands for Network Time Protocol. It is used to synchronize the clocks on our
computer to one standard time source. It is very useful in situations like bank transactions.
Assume the following situation without the presence of NTP. Suppose you carry out a
transaction, where your computer reads the time at 2:30 PM while the server records it at
2:28 PM. The server can crash very badly if it’s out of sync.
The host-to-host layer is a layer in the OSI (Open Systems Interconnection) model that is
responsible for providing communication between hosts (computers or other devices) on a
network. It is also known as the transport layer.
Some common use cases for the host-to-host layer include:
Reliable Data Transfer: The host-to-host layer ensures that data is transferred reliably
between hosts by using techniques like error correction and flow control. For example, if a
packet of data is lost during transmission, the host-to-host layer can request that the packet
be retransmitted to ensure that all data is received correctly.
Segmentation and Reassembly: The host-to-host layer is responsible for breaking up
large blocks of data into smaller segments that can be transmitted over the network, and
then reassembling the data at the destination. This allows data to be transmitted more
efficiently and helps to avoid overloading the network.
Multiplexing and Demultiplexing: The host-to-host layer is responsible for multiplexing
data from multiple sources onto a single network connection, and then demultiplexing the
data at the destination. This allows multiple devices to share the same network connection
and helps to improve the utilization of the network.
End-to-End Communication: The host-to-host layer provides a connection-oriented
service that allows hosts to communicate with each other end-to-end, without the need for
intermediate devices to be involved in the communication.
Example: Consider a network with two hosts, A and B. Host A wants to send a file to host B.
The host-to-host layer in host A will break the file into smaller segments, add error correction
and flow control information, and then transmit the segments over the network to host B. The
host-to-host layer in host B will receive the segments, check for errors, and reassemble the file.
Once the file has been transferred successfully, the host-to-host layer in host B will
acknowledge receipt of the file to host A.
In this example, the host-to-host layer is responsible for providing a reliable connection
between host A and host B, breaking the file into smaller segments, and reassembling the
segments at the destination. It is also responsible for multiplexing and demultiplexing the data
and providing end-to-end communication between the two hosts.
Advantages of TCP/IP Model
Interoperability: The TCP/IP model allows different types of computers and networks to
communicate with each other, promoting compatibility and cooperation among diverse
systems.
Scalability: TCP/IP is highly scalable, making it suitable for both small and large
networks, from local area networks (LANs) to wide area networks (WANs) like the
internet.
Standardization: It is based on open standards and protocols, ensuring that different
devices and software can work together without compatibility issues.
Flexibility: The model supports various routing protocols, data types, and communication
methods, making it adaptable to different networking needs.
Reliability: TCP/IP includes error-checking and retransmission features that ensure reliable
data transfer, even over long distances and through various network conditions.
Transmission Control Protocol (TCP): Ensures process to process error and flow control.
Simple Network Time Protocol (SNTP): It is a protocol that synchronizes the clocks of devices
on a network. It's a subset of the Network Time Protocol (NTP), but is simpler and uses less
memory and processing power. SNTP is commonly used for applications that don't require
precise clock synchronization, such as IP cameras, DVRs, and some network switches. It
retrieves a timestamp from an NTP server.
Trivial File Transfer Protocol (TFTP): It is a simple, Internet-standard protocol for
transferring files between computers and server. TFTP is used to transfer files
between two TCP/IP machines, typically for bootstrapping remote devices. It's also used to
upload HTML pages to an HTTP server or download log files to a remote PC .
The core functions implemented by the main TCP/IP protocols such as IP, TCP and UDP are
designed to accomplish the internetworking functions of the protocol suite.
Applications provided by TCP/IP
fragmentation, packet addressing, routing, and packet reassembly
Packet Addressing allows the transmission of packets from one IP address to another.
Packet fragmentation and reassembly allows transmission of large data through small packets, and it is
this capability that allows connection to different network media.
Physical Storage: All website data is stored on a physical web server to ensure its safety. When
an end user enters the URL of your website or searches it using a keyword on a browser, a
request is generated and sent to the web server to process the data.
Web browser: The role of web browsers such as Firefox, Chrome, or Internet Explorer is to find
the web server on which your website data is located. Once the browser finds your server, it
reads the request and processes the information.
A web server can also perform several other functions, such as:
o Store and protect website data: A web server can store and protect critical website data from
unauthorized users.
o Control bandwidth to regulate network traffic: A web server can help eliminate the downtime
caused by high web traffic. Web hosts can set bandwidth to manage the rate of data transmission
over the internet and minimize the excess network traffic.
o Server-side web scripting: The server-side web scripting feature enables users to create
dynamic web pages using scripting languages such as Ruby, Python, and PHP.
o Virtual hosting: Web servers can also be used as virtual servers to run multiple applications,
websites, data, and other services.
Dynamic websites can personalize content based on a user's preferences, interests, browsing
history, and other factors. For example, a dynamic website might display product prices in a
visitor's local currency.
Static Web Server (or SWS abbreviated) is a tiny and fast production-ready web server suitable
to serve static web files or assets. We call it "static" because the server sends its hosted files as-is
to your browser.
VIRTUAL HOSTING
Virtual hosting is hosting several domain names on a single server. It simply means
hosting multiple websites on one machine. This server can share all its resources, such as
CPU and memory cycles, with the hosted domains. It is also known as shared hosting. It's a
cost-effective way for companies to share resources like memory, CPU, and
disk space.
IP-based or name-based: Virtual hosts can be either IP-based, where each website has a
different IP address, or name-based, where multiple names run on each IP address.
Cost-effective: Companies can share the cost of the server with other organizations.
Good for small to medium-sized websites: This system is well suited for businesses that
don't need all the resources of a server to operate efficiently.
Virtual hosting is used in a variety of ways, including:
External sales
Companies like GoDaddy and Wix use virtual hosting to host multiple websites on
their servers.
Internal traffic
Companies with an internal intranet and an external-facing website can use a virtual
host to avoid the need for two servers.
Chunked Transfer
Chunked transfer encoding (CTE) is a method of data transfer in Hypertext Transfer
Protocol (HTTP) that breaks data into chunks and sends them separately. CTE divides a data stream
into non-overlapping chunks, which are sent independently. Each chunk is preceded by its
size in bytes, and the transmission ends when a zero-length chunk is received.
Benefits
CTE improves performance and user experience by:
Allowing the client to start processing data before the entire response is received
Enabling smaller requests to use the connection between chunks
Allowing for faster load times in video streaming applications
When to use it
CTE is useful for sending large files or dynamically generated content, where the total
size of the response is unknown or cannot be predetermined.
How to indicate it
The chunked keyword in the Transfer-Encoding header indicates chunked transfer.
Caching Support
Web caching is a technique that stores copies of web objects, like images or
web pages, to improve the performance of a website or application:
How it works
When a user visits a website for the first time, the browser downloads the content from
the web server and saves it to a local cache. When the user visits the site again, the
browser can retrieve the content from the cache instead of the server, which speeds
up the page load time.
Benefits
Caching reduces the load on the web server, saves the user time, and reduces
network traffic. It can also protect against outages by delivering cached content when
servers are down.
Caching strategies
Caching servers can be set to refresh at specific intervals or in response to
events. This ensures that the freshest content is cached, which is useful for rapidly
changing information.
Security features
Some web cache solutions, like Oracle Web Cache, include security features like:
Password authentication
Control over which ports administration and invalidation operations can be requested
from
Timeout for inactive connections
IP and subnet administration restrictions
CDN caching
A CDN, or content delivery network, caches content (such as images, videos, or webpages) in
proxy servers that are located closer to end users than origin servers. (A proxy server is a server
that receives requests from clients and passes them along to other servers.) Because the servers
are closer to the user making the request, a CDN is able to deliver content more quickly.
UI extensibility
Allows developers to add new widgets, hide existing widgets, override default field labels, and
customize the theme for an application.
Browser extensions
Allow users to add new features, tools, or integrations to a web browser without altering the
core browser experience.
CSS Houdini
A set of APIs that allow developers to create new CSS features without waiting for them to be
implemented natively in browsers.
Extensible Web Server (EWS)
A distributed web server architecture that allows server nodes to be added or removed at any
time.
Extensibility is a design principle that prepares for the unknown by acknowledging that it's
impossible to predict all future needs. It's about creating flexible, modular systems that can adapt
to changing requirements over time.
SGML declaration: Specifies which characters and delimiters can appear in the application
Document type definition (DTD): Defines the syntax of markup constructs and rules for using
document elements
Specification: Describes the semantics to be ascribed to the markup
Document instances: Contain data and markup, and reference the DTD to be used to interpret
them
History of SGML
This standard descended from IBM’s GML (Generalized Markup Language).
Edward Mosher, Charles Goldfarb, and Raymond Lorie developed GML in the 1960s.
The editor of the international standard, Goldfarb, used the initials of their surnames to
coin the term GML.
SGML originated as a document markup language. It aimed to enable the sharing of
large-project documents that are machine-readable. It included docs in law, government,
and industry.
The military, aerospace, industrial publishing industries, and technical reference also
extensively applied SGML.
The XML profile advent made SGML suitable for its widespread application in general
purposes and small-scale industries.
Advantages of SGML
One can recreate the SGML on the basis of document structure instead of appearance
characteristics. It is good because such characteristics may change over time.
The documents produced originally for print media can re-adapt into other media, like the
computer display screen.
A compiler of SGML can interpret any document easily by referencing its DTD
(document type definition). Thus, it becomes more portable.
The SGML standard supports all media types, and it can encode the entire structure of
any document.
It separates the content from its appearance.
The stylesheets with SGML make its content reusable for various purposes.
The file encoding that SGML offers can perform more formatting when compared to
HTML.
SGML is much more in use compared to HTML because HTML provides capabilities for
coding visual representation, and it cannot structure the original information/data.
Due to ISO standards, many tools are available for SGML. Thus, it is well supported
currently.
Disadvantages of SGML
Coding software in SGML may be typical and complicated.
The tools in use with this standard are very expensive.
SGML may not have extensive use.
It needs special software for running and allowing the document to display.
Creating the DTDs requires exacting software engineering.
Components of SGML:
SGML provides a way of describing the relationships between these entities, elements, and
attributes, and tells the computer how it can recognize the component parts of a document
and it is based on the concept of a document being composed of a series of entities (object).
It provides rules that allow the computer to recognize where the various elements of a text
entity start and end.
Document Type Definition (DTD) in SGML is used to describe each element of the
document in a form that the computer can understand .
SGML is the simplest medium to produce files that can be read by people and exchanged
between machines and applications in a straightforward manner. It is easy to understand by the
human as well as the machine.
Structure of SGML
<main Object>
<sub Object>
</sub Object>
</main Object>
File_name.sgml
Example:
<EMAIL>
<SENDER>
<PERSON>
</PERSON>
</SENDER>
<BODY>
</BODY>
</EMAIL>
HTML5
Introduction: HTML stands for Hyper Text Markup Language. It is used to design web pages
using a markup language. HTML is an abbreviation of Hypertext and Markup language.
Hypertext defines the link between the web pages. The markup language is used to define the
text document within the tag which defines the structure of web pages. HTML 5 is the fifth and
current version of HTML. It has improved the markup available for documents and has
introduced application programming interfaces (API) and Document Object Model (DOM).
Features:
It has introduced new multimedia features which supports both audio and video controls by
using <audio> and <video> tags.
There are new graphics elements including vector graphics and tags.
Enrich semantic content by including <header> <footer>, <article>, <section> and
<figure> are added.
Drag and Drop- The user can grab an object and drag it further dropping it to a new
location.
Geo-location services- It helps to locate the geographical location of a client.
Web storage facility which provides web application methods to store data on the web
browser.
Uses SQL database to store data offline.
Allows drawing various shapes like triangle, rectangle, circle, etc.
Capable of handling incorrect syntax.
Easy DOCTYPE declaration i.e., <!doctype html>
Easy character encoding i.e., <meta charset=”UTF-8″>
Removed elements from HTML 5 : There are many elements which are depreciated from
HTML 5 are listed below:
Removed Elements Use Instead Elements
<acronym> <abbr>
<applet> <object>
<basefont> CSS
<big> CSS
<center> CSS
<dir> <ul>
<font> CSS
<frame>
<frameset>
<noframes>
Removed Elements Use Instead Elements
<isindex>
<tt> CSS
Advantages:
Example 1:
<!DOCTYPE html>
<html>
<head>
<title>HTML 5</title>
<style>
h1 {
font-size:50px;
}
</style>
</head>
<body>
<h1>FG Degree College Gujranwala Cantt</h1>
</body>
</html>
Example 2:
<!DOCTYPE html>
<html>
<head>
<title>HTML 5 Demo</title>
<style>
.GFG {
font-size:40px;
font-weight:bold;
color:green;
}
body {
text-align:center;
}
</style>
</head>
<body>
<div class = "GFG">FG DEGREE COLLEGE GUJRANWALA CANTT</div>
<aside>
<div>My old College</div>
</aside>
</body>
</html>
CSS3
Cascading Style Sheets Level 3 (CSS3) is a web technology that allows developers to style web
pages and make them more visually appealing and user-friendly:
Features
CSS3 includes many features that make web design more dynamic, such as animations,
transitions, gradients, shadows, and 3D transformations. It also supports responsive design and
cross-browser compatibility.
Benefits
CSS3 allows developers to create more complex layouts and precisely position elements on a
web page. It also simplifies many styling tasks, saving time and making it easier to create well-
structured websites.
Compatibility
CSS3 is supported by almost all modern web browsers, including Google Chrome, Firefox,
Safari, and Opera.
Modules
Some of the major modules of CSS3 include:
Box model
Image values and replaced content
Text effects
Selectors
Backgrounds and borders
Animations
User interface (UI)
Multiple column layouts
Uses a set of standard colors and basic Has a good collection of HSL, RGBA,
color schemes. HSLA, and gradient colors.
Can add background colors to list items Lists have a special display property and list
and lists, and set images for list items. items have counter reset properties.