UNIT1 Website Basics
UNIT1 Website Basics
Internet Overview - Fundamental computer network concepts - Web Protocols - URL – Domain Name-
Web Browsers and Web Servers- Working principle of a Website –Creating a Website - Client-side and
server-side scripting
[Link] Overview
➢ Internet is the collection of computers that can communicate with one another using
TCP/IP over an open, global communication network. In other words, Internet can be
described as a system of multiple computer networks interconnected across the globe that
share data, information and services using the TCP/IP protocol.
➢ At present, internet is the fastest mean of sending or exchanging information and data
between computers across the world.
➢ The internet works with the help of clients and servers. A device such as a laptop, which
is connected to the internet is called a client, not a server as it is not directly connected to
the internet.
➢ However, it is indirectly connected to the internet through an Internet Service Provider
(ISP) and is identified by an IP address, which is a string of numbers. The IP address is
provided by ISP.
➢ To have internet service one must go to the service providers like Airtel, Vodafone,
BSNL etc. A computer can be connected to the Internet Service Providers through DSL
(Digital Subscriber Line) or Phone-line Modem.
Uses of Internet:
➢ Online banking
➢ Online Shopping
➢ Cloud Computing
➢ Instant Messaging , Video conferencing, email services used through the internet.
➢ used to exchange information with people all over the world, communicate across great
distances, and locate information or answers fast on almost any subject.
The world wide web is a information system in which various documents containing
information are interlinked together. User can access this information or write the information via
computers. This information is typically stored on the web pages and through web browsers one can
access these webpages.
The web pages may contain the information in the form of text, audio, video, images and
graphics. Hyperlinks are used to navigate between the web pages.
Types of Networks
➢ There are various types of computer networks ranging from network of handheld
devices (like mobile phones or tablets) connected through Wi-Fi or Bluetooth within a
single room to the millions of computers spread across the globe. Some are connected
wireless while others are connected through wires.
➢ Based on the geographical area covered and data transfer rate, computer networks are
broadly categorised as:
i) PAN-Personal Area Network
It is a network formed by connecting a few personal devices like computers, laptops,
mobile phones, smart phones, printers etc., as shown in Figure. All these devices lie within
an approximate range of 10 metres. A personal area network may be wired or wireless. For
example, a mobile phone connected to the laptop through USB forms a wired PAN while
two smartphones communicating with each other through Bluetooth technology form a
wireless PAN or WPAN.
ii) LAN -Local Area Network
It is a network that connects computers, mobile phones, tablet, mouse, printer, etc.,
placed at a limited distance. The geographical area covered by a LAN can range from a
single room, a floor, an office having one or more buildings in the same premise,
laboratory, a school, college, or university campus. The connectivity is done by means of
wires, Ethernet cables, fibre optics, or Wi-Fi. A Local Area Network (LAN) is shown in
Figure.
Metropolitan Area Network (MAN) is an extended form of LAN which covers a larger
geographical area like a city or a town. Data transfer rate in MAN also ranges in Mbps, but
it is considerably less as compared to LAN. Cable TV network or cable based broadband
internet services are examples of MAN. This kind of network can be extended up to 30-40
km. Sometimes, many LANs are connected together to form MAN, as shown in Figure.
LAN
1
Networki LAN
ng
Device 3
LAN
2
Wide Area Network connects computers and other LANs and MANs, which are
spread across different geographical locations of a country or in different countries or
continents. A WAN could be formed by connecting a LAN to other LANs (Figure 10.7)
via wired/wireless media. Large business, educational and government organisations
connect their different branches in different locations across the world through WAN.
The Internet is the largest WAN that connects billions of computers, smartphones and
millions of LANs from different continents.
Modem stands for ‘MOdulator DEModulator’. It refers to a device used for conversion
between analog signals and digital bits. We know computers store and process data in terms of 0s and
1s. However, to transmit data from a sender to a receiver, or while browsing the internet, digital data
are converted to an analog signal and the medium (be it free-space or a physical media) carries the
signal to the receiver. There are modems connected to both the source and destination nodes. The
modem at the sender’s end acts as a modulator that converts the digital data into analog signals. The
modem at the receiver’s end acts as a demodulator that converts the analog signals into digital data
for the destination node to understand.
Modulation Demodulation
Digital Signal
Demodulation Modulation
Telephone Line
Modem Modem
Figure: MODEM
ii) Hub
Hubs are basic networking devices that operate at the physical layer of the OSI model. They
connect multiple devices within a local area network (LAN) and broadcast data to all connected
devices. Hubs do not filter or manage data; they simply amplify and distribute it.
iii) Repeater
Repeaters are devices designed to amplify and regenerate signals over long distances in order
to extend the reach of a network. By boosting signal strength, repeaters help overcome signal
degradation, reducing data loss and enhancing overall network performance.
iv) Bridge
Bridges operate at the data link layer of the OSI model and connect different segments of a
network. They filter and forward traffic based on MAC addresses, effectively dividing a network into
smaller collision domains. This enhances network efficiency by reducing congestion.
v) Switch
Switches operate at the data link layer and are more advanced than hubs. Unlike hubs that
broadcast data to all connected devices, switches intelligently forward data only to the specific device
for which it is intended. This significantly improves network efficiency and reduces unnecessary
traffic.
vi) Router
Routers operate at the network layer of the OSI model and connect different networks. They
direct data packets between networks, making decisions based on IP addresses. Routers play a crucial
role in determining the most efficient path for data to travel between devices on different subnets.
vii) Gateway
Gateways serve as protocol converters, facilitating communication between networks with
different communication protocols. They play a crucial role in ensuring interoperability in
heterogeneous network environments. Additionally, gateways often act as security checkpoints,
implementing firewalls and other security measures.
Network Topology
Topology defines the structure of the network of how all the components are interconnected to
each other. In other words, the arrangement of computers and other peripherals in a network is called
its topology. Common network topologies are Mesh, Ring, Bus, Star and Tree.
Mesh Topology
➢ In this networking topology, each communicating device is connected with every other device in
the network as shown in Figure. Such a network can handle large amounts of traffic since
multiple nodes can transmit data simultaneously.
➢ Also, such networks are more reliable in the sense that even if a node gets down, it does not
cause any break in the transmission of data between other nodes.
➢ This topology is also more secure as compared to other topologies because each cable between
two nodes carries different data. However, wiring is complex and cabling cost is high in creating
such networks and there are many redundant or unutilised connections.
Ring Topology
In ring topology, each node is connected to two other devices, one each on either side, as
shown in Figure. The nodes connected with each other thus forms a ring. The link in a ring
topology is unidirectional. Thus, data can be transmitted in one direction only (clockwise or
counterclockwise).
Bus Topology
In bus topology, each communicating device connects to a transmission medium, known as
bus. Data sent from a node are passed on to the bus and hence are transmitted to the length of the bus
in both directions. That means, data can be received by any of the nodes connected to the bus.
Bus
Star Topology
In star topology, each communicating device is connected to a central node, which is a
networking device like a hub or a switch, as shown in Figure.
Star topology is considered very effective, efficient and fast as each device is directly
connected with the central device. Although disturbance in one device will not affect the rest of the
network, any failure in a central networking device may lead to the failure of complete network.
The MAC address is engraved on NIC at the time of manufacturing and thus it is a permanent
address and cannot be changed under any circumstances. The machine on which the NIC is attached,
can be physically identified on the network using its MAC address.
Each MAC address is a 12-digit hexadecimal numbers (48 bits in length), of which the first six
digits (24 bits) contain the manufacturer’s ID called Organisational Unique Identifier (OUI) and the
later six digits (24 bits) represents the serial number assigned to the card by the manufacturer. A
sample MAC address looks like:
Thus, if a computer’s IP address is known, then one can communicate with that computer from
anywhere in the world. However, unlike MAC address, IP address can change if a node is removed
from one network and connected to another network.
The initial IP Address called version 4 (IPV4 in short), is a 32 bit numeric address, written as
four numbers separated by periods, where each number is the decimal (base-10) representation for
an 8-bit binary (base-2) number and each can take any value from 0 - 255.
With more and more devices getting connected to the Internet, it was realised that the 32-bit IP
address will not be sufficient as it offers just under 4.3 billion unique addresses. Thus, a 128 bits IP
address, called IP version 6 (IPV6 in short) was proposed. An IPv6 address is represented by eight
groups of hexadecimal (base-16) numbers separated by colons.
Every <start line> or <request line> consists of three parts, with a single space used to separate
adjacent parts.
i) Request method ii) Request-URI iii) HTTP Version
i) Request Method: HTTP protocol defines a set of request methods e.g., GET, POST, HEAD,
OPTIONS. The client can use one of these methods to send a request to the server.
HTTP Request method Description
GET A client can use the GET request to get a web resource from the server
TRACE ask the server to return a diagnostic trace of the actions it takes.
OPTIONS ask the server to return the list of request methods it supports.
ii) Request URI: Specifies the path of resource requested which must begin from the root “/” of the
document base directory.
URI: Uniform Resource Identifier is a string used to identify the names or resources on the
internet. URI is a combination of URL and URN.
URL Stands for UNIFORM RESOURCE LOCATOR For example, web address
[Link] denotes the URL
URN denotes specific name of the place or a person. For example, urn:ISBN 978-81-8431-123-
2 specifies the address of some book.
Request Headers: are in the form of name:value pairs. Multiple values, separated by commas , can
be specified.
Request Header Format:
request-header-name: request-header-value1, request-header-value2
For example:
Host:[Link]
Connection:Keep-Alive
Accept:image/gif,image/jpeg, */*
Accet-Language:us-en,fr,cn
BlankLine- Used to separate the header & body
Message body is Optional in HTTP request message.
• MIME is an acronym standing for Multipurpose Internet Mail Extensions, and refers to a
standard that can be used to pass a variety of types of information, including graphics and
applications, through e-mail as well as through other Internet message protocols.
Response Message: The response message is sent by the server to the client that consists of a status
line, headers, and sometimes a body.
Where, the HTTP- version denotes the version used by the server software when formatting the
response; the numeric status code indicating the type of response and a text string (the reason phrase)
that presents the information represented by the numeric status code in in human readable form.
For Example:
HTTP/1.1 200 OK
The first digit represents the general class of status code. The five classes of HTTP/1.1 status codes are
given in the table below
The last two digits of a status code define the specific status within the specified class.
➢ SNMP is a protocol which enables network administrators to manage network devices and to
diagnose network problems.
➢ The network management system is based on two main elements: a supervisor and agents.
i) The Supervisor is the terminal at which the network administrator requests for
network management.
ii) The agents are found at the level of each interface connecting the managed devices to
the network. With the help of these agents information on the different objects such as
switch, hub, routers can be collected.
➢ with the help of mail transfer agent and user agent, the SMTP sends and receives the emails.
➢ POP3 protocol works only at the receivers end and has no work at the sender’s end.
➢ The POP protocol has two parts, a client POP i.e receiver’s POP and a server POP i.e.,
receiver’s email server. The client i.e the receiver opens TCP connection with receiver’s POP server.
This client must be authenticated first by using the user name and password, Then the client can
receive the emails from the mailbox.
.
➢ The TCP allows the transmission of arbitrary amount of data by breaking it into stream of
separate IP packets.
➢ These IP packets are numbered so that it could be reassembled properly at arrivals. Along with
the data an acknowledgement is also sent/received in order to know whether the reliable
connection has occurred or not.
7. UDP
➢ The user datagram protocol is a connectionless protocol without any error detection facility.
➢ UDP is known as an unreliable protocol however this is much faster than TCP.
➢ One Internet application that is often run using UDP rather than TCP is the Domain Name
Service (DNS). DNS provides a mechanism for mapping back and forth between IP addresses
and host names.
scheme://authorityportion/path?query portion#
For example:
[Link]
• The portion of an http URL following the :// string and before the next slash (/) (or through
the completion of the URL, if there is no trailing slash) is known as the authority of the URL.
• In this example, the authority is [Link] and consists of the fully qualified
domain name [Link] followed by the port number 56789.
• The portion from the slash following the authority through the question mark (?) (or through
the end of the URL, if there is no question mark) is called the path of the URL.
• In this example, the path is /a/b/[Link]
• Following the path there may be a question mark followed by information up to a number sign
(#). The information between but not including the question mark and number sign is the query
portion of the [Link] this example, the query portion of the URL is t=win&s=chess.
Some Non-http URL schemes are given in the below table.
Domain Name:
The name which is used to identify computer within a network is called domain name.
Consider a Machine A, want to access it using the IP address [Link] is definitely not comfortable,
alternatively user can use the domain name. Also the domain name is easy for human reference.
➢ Domain name space is used to locate the computer uniquely. The internet logically arranges
the domain names in an hierarchical form.
➢ DNS is a service that translates the domain name into IP addresses. This allows the users of
networks to utilize user-friendly names when looking for other hosts instead of remembering the
IP addresses.
➢ DNS is a TCP/IP protocol used on different platforms. The domain name space is divided into
three different sections: generic domains, country domains, and inverse domain.
Generic Domains
o Each node in a tree defines the domain name, which is an index to the DNS database.
o It uses three-character labels, and these labels describe the organization type.
Country Domain
➢ The format of country domain is same as a generic domain, but it uses two-character country
abbreviations (e.g., us for the United States) in place of three character organizational
abbreviations.
Inverse Domain
➢ The inverse domain is used for mapping an address to a name. When the server has received a
request from the client, and the server contains the files of only authorized clients. To
determine whether the client is on the authorized list or not, it sends a query to the DNS server
and ask for mapping an address to the name.
Working of DNS
➢ DNS is a client/server network communication protocol. DNS clients send requests to the.
server while DNS servers send responses to the client.
➢ Client requests contain a name which is converted into an IP address known as a forward DNS
lookups while requests containing an IP address which is converted into a name known as
reverse DNS lookups.
➢ DNS implements a distributed database to store the name of all the hosts available on the
internet.
➢ If a client like a web browser sends a request containing a hostname, then a piece of software
such as DNS resolver sends a request to the DNS server to obtain the IP address of a hostname.
If DNS server does not contain the IP address associated with a hostname, then it forwards the
request to another DNS server. If IP address has arrived at the resolver, which in turn completes
the request over the internet protocol.
• A web client or web browser is software that accesses a web server by sending an HTTP
request message and processing the resulting HTTP response.
• In general, any web client that is designed to directly support user access to web servers is
known as a user agent. Furthermore, some web clients are not designed to be used directly by
humans at all. For example, software robots are often used to automatically crawl the Web and
download information for use by search engines
Basic Browser Functions
• The window of a typical modern browser is split into several rectangular regions, most of
which are known as bars. Figure 1 shows five standard regions in a Mozilla 1.4 window.
• The primary region is the client area, which displays a document. For many documents, the
title bar displays a title assigned by the document author to the document currently displayed
within the client area. The title bar also displays the browser name as well as standard window-
management controls. The menu bar contains a set of dropdown menus, much like most other
applications that incorporate a graphical user interface (GUI).
• The browser’s Navigation toolbar contains standard push-button controls that allow the user to
return to a previously viewed web page (Back), reverse the effect of pressing Back (Forward),
ask the server for an updated version of the page currently viewed (Reload), halt page
downloading currently in progress (Stop), and print the client area of the window (Print).
Clicking the small down-arrow to the right of some buttons produces a menu allowing users to
override the default behavior of the associated button.
• The Navigation toolbar also contains a text box, known as the Location bar, where a user can
enter a URL and press the Enter key in order to request the browser to display the document
located at the specified URL.
• Clicking the Search button instead of pressing Enter causes the information entered in the text
box to be sent to a search engine. Clicking the down-arrow at the right side of the Location bar
produces a dropdown menu of recently visited URLs that can be visited again with a single
click. Finally, the status bar displays messages and icons related to the status of the browser.
• A primary task of any browser is to make HTTP requests on behalf of the browser user.
• If a user types an http-scheme URL in Mozilla’s Location bar, for example, the browser must
perform a number of tasks:
➢ Reformat the URL entered as a valid HTTP request message.
➢ If the server is specified using a host name (rather than an IP address), use DNS to
convert this name to the appropriate IP address.
➢ Establish a TCP connection using the IP address of the specified web server.
➢ Send the HTTP request over the TCP connection and wait for the server’s response.
➢ Display the document contained in the response. If the document is not a plain-text
document but instead is written in a language such as HTML, this involves rendering
the document: positioning text and graphics appropriately within the browser window,
creating table borders, using appropriate fonts and colors, etc.
Title bar
Menu bar
Navigation toolbar
Client area
Status bar
Figure 1 Mozilla FireFox Window
Web Browser-User-Controllable Features
The primary feature of every web server is to accept HTTP requests from web clients and return an
appropriate resource (if available) in the HTTP response. Even this basic functionality involves a
number of steps
• The server calls on TCP software and waits for connection requests to one or more ports.
• When a connection request is received, the server dedicates a “subtask” to handling this
connection.
• The subtask establishes the TCP connection and receives an HTTP request.
• The subtask examines the Host header field of the request to determine which “virtual host”
should receive this request and invokes software for this host.
• The virtual host software maps the Request-URI field of the HTTP request start line to a
resource on the server.
• If the resource is a file, the host software determines the MIME type of the file and creates an
HTTP response that contains the file in the body of the response message.
• If the resource is a program, the host software runs the program, providing it with information
from the request and returning the output from the program as the body of an HTTP response
message.
• The server normally logs information about the request and response—such as the IP address
of the requester and the status code of the response—in a plain-text file
• If the TCP connection is kept alive, the server subtask continues to monitor the connection until
a certain length of time has elapsed, the client sends another request, or the client initiates a
connection close.
Examples of Web Servers are Apache and IIS (Internet Information Server) from Microsoft
Apache:
1. Apache is an excellent server because of its two important features: Reliability and Efficiency
2. Apache server is Open source software, suitable for both unix and windows systems.
3. Apache server can be configured as per the requirements using the file [Link]. This file is
present in the Apache Software package.
1. Apache server is suitable both Unix and IIS Web Server is used on Windows platform
Windows system
3. Apache web server can be controlled by editing 3. For IIS server, the behaviour is controlled by
the configuration file [Link] modifying the window-based management
programs called snap in. User can access IIS snap
in through control panel→Administrative Tools
Various types of Servers
1. Web server
2. Application server
[Link] server
1. A server that exposes business logic to client A server that handles HTTP protocol
applications through various protocols including
HTTP
2. Application server is used to serve web based Web server is used to serve web based
applications and enterprise based applications applications (i.e, servlets and JSP)
(i.e., servlets, JSP and EJB). Application server
may contain a web server internally.
Website: Definition
Website is a collection of web pages that are grouped together to achieve certain task under
single domain name.
Web page:
A web page is a html document that may contain text,audio, video and so on. Technically, a
web page is a special type of document written in scripting languages such as HTML, CSS, Javascript,
PHP etc.
1. Quality web content- People desire information in fast and reliable fashion. For business websites,
content should include important information. These types of web sites need to display high quality
pictures of their products and the highlight for client testimonials.
2. User friendly Navigation- A user friendly navigation scheme allows visitors to quickly find the
information needed. Important links must be easy to find and given logical, simple and include easy to
understand labels.
3. Simple and Professional Web design- The website must be simple and professional. Google is an
example of such a site. To keep websites simple, a balanced distribution of contents and graphics is
required.
4. Webpage Speed- People inherently lose patience quickly. when visiting a website. The website with
heavy graphics, audio and video takes time to load. A web design company must take care of all the
controlling factors that will maintain the desirable speed of the website.
5. Search Engine Optimization- A well designed website generally will receive many visitors and one
method to attract visitors is search engine optimization. This allows the insertion of search keywords in
website content, an appropriate link profile, social media signals.
[Link] Compatibility- A website should easily render on various resolutions, screen sizes, and
browsers. Increasing popularity of mobile devices, websites should function properly on these devices.
Jean Kaiser has suggested following design goals for web design
1. Simplicity- It is a general tendency of web designers to provide lot of animations, huge amount of
information, extreme visuals and so on. This makes the web design enormous and it should be avoided.
The web application must be moderate and simple.
[Link]- The contents of the web application should be constructed consistently. For example,
text formatting, font style should me same over all the text document of the web application.
4. Robustness- The user always expects robust contents and functions of the web applications. That
means any required functionality should not be missing at all. If any function or content is missing or
insufficient then web application will fail.
[Link] appeal- The web application are most visual and most dynamic and aesthetic in nature.
Various factors that contribute to visual appeal are Look and feel, interface layout, color coordination,
the balance of text, graphics and other media, navigation mechanism and so on.
7. Compatibility- The web application can be used in variety of environment and configurations such
as different browsers, internet connection types, operating systems and various browsers.
Creating a Web site :
➢ Website is a collection of web pages that are grouped together to achieve certain task under single
domain name. A web page is a html document that may contain text,audio, video and so on.
Technically, a web page is a special type of document written in scripting languages such as
HTML, CSS, Javascript, PHP etc.
➢ Web pages are written for web browers. commonly used web browsers are Safari, Mozilla, Opera.
Internet Explorer, Google chrome. etc.
➢ Website is used to find the required information for example, banking sites, educational sites.
➢ Website is used to complete a task for example to download softwares, online shopping etc.
➢ Web hosting company hosts web pages on web server. Website will be available to any
one by typing the URL.
➢ Most web hosting companies offer hosting services for both personal and business use.
➢ Domain name is an alias that points to actual location of website on web server. Domain
names are managed by the Internet Corporation for Assigned Names and Numbers
(ICANN). ICANN has agreements with a number of vendors to provide domain name
registration services.
➢ Most web hosting companies offer hosting services for both personal and business use.
➢ Type of website- e-commerce, informational site, a site for company and design
accordingly.
➢ To publish a web site on the web, web pages created are needed to be uploaded using File
transfer protocol. Using some softwares such as Microsoft Visual Studio or
AdobleDreamweaver used to files on the server.
Testing must be performed throughout the development of website. Factors for testing the websites are
Brower compatibility, multiple operating system support, security testing etc.
Client-side scripting generates code that may be executed on the client end without needing
server-side processing. These scripts are typically embedded into HTML text. Client-side scripting
may be utilized to check the user's form for problems before submitting it and to change the content
based on the user input. The web needs three components to function: client, database, and server.
The client-side scripting may significantly reduce server demand. It is intended to be utilized as
a scripting language with a web browser as the host program. The HTML and CSS are delivered as
plain text when a user uses a browser to request a webpage from the server, and the browser
understands and renders the web content at the client end.
There are various client-side scripting languages. Some main client-side scripting languages are as
follows:
[Link] -It is not a scripting language; it is a markup language. However, it serves as the basic
language for client-side web development, also referred to as front-end. The presence of hypertext on a
page denotes its hyperlinks. The markup language uses tags to define the structure and layout. It is a
programming language that is mainly used to design a web page's structure and layout.
2. CSS- is an abbreviation for Cascading Style Sheets. It provides a technique for creating
graphic elements that help a web application's appearance look more appealing. A style tag in a
web page defines all the specifics regarding the web page's presentation, including its border
styles, image styles, colour, font styles, borders, format, font size, margins, padding, etc.
3. Javascript is a client-side scripting language designed for a specific purpose, but several
JavaScript frameworks are already utilized as server-side scripting technologies.
Features of Client-side Scripting
1. It is intended to execute code on which a web browser runs, and the results of the inputs are
delivered to an accessible user.
2. Client-side scripting enables greater involvement with clients via the browser and is used to
validate programs and functionality based on the request.
3. The client does not include any contact with the server in client-side scripting; the only
interaction is receiving the requested data.
server-side scripting is a programming technique for creating code that may run software on
the server side. In other words, server-side scripting is any scripting method that may operate on a web
server. At the server end, actions such as website customization, dynamic changes in website content,
response creation to user requests, database access, and many more are carried out.
Python
It is an open-source language that is very powerful and easy to learn. It is suitable for beginners
because it is simple to learn and read. It is believed to be used by Google and YouTube. It is a OOPs
language with dynamic typing and data structures. It has grown to be one of the most popular
languages for both quick application development and web development.
PHP
It is an open-source server-side scripting programming language mainly designed for web apps and is
the most utilized scripting language
➢ It is connected with data access, error handling, and data processing speed.
➢ Using a highly integrated programming language makes it more secure than client-side
scripting.