You are on page 1of 31

Internet Programming

CHAPTER 1

The Fundamentals

1
Chapter objective

At the end of this chapter students will be able to:

Define and understand Internet and its use.


Understand basics of WWW Browser and web server
Identify different document types.
Understand the use of URL and DNS
Understand Client-server architecture of www

2
1.1. Internet definition ,Uses and
Services
What is internet ?
Internet is the largest network in the world that
connects hundreds of thousands of individual
networks all over the world.
Network is a group of two or more computer
systems linked together.
It is a inter-connected computer networks, linked
by wires, cables, wireless connections, etc.
It is the network of network.
3
Cont
The popular term for the Internet is the
information highway.
Rather than moving through geographical
space, internet moves your ideas and
information through cyberspace the space of
electronic movement of ideas and information.
No one owns it.

4
The uses and service of the Internet
Communication : Communication is one of the
biggest advantages provided by the computer networks.
Different computer networking technology has
improved the way of communications people from the
same or different organization can communicate in the
matter of minutes for collaborating the work activities.
File Sharing: The major advantage of a computer
network is that is allows file sharing and remote file
access. A person sitting at one workstation of a network
can easily see the files present on the other
workstation, provided he is authorized to do so.
Resource Sharing: Resource sharing is also an important
benefit of a computer network. Internet enables as to
share resource like printer.
5
Cont
Increased Cost Efficiency:There are many software
available in the market which are costly and take
time for installation. Computer networks resolve
this issue as the software can be stored or installed
on a system or a server and can be used by the
different workstations.
Video conferencing: Before the arrival of the
computer networks there was no concept for the
video conferencing. LAN and WAN have made it
possible for the organizations and business sectors
to call the live video conferencing for important
discussions and meetings as well as for the 6
1.1.1. The World Wide Web(WWW)

WWW is a system of interlinked, hypertext


documents that runs over the Internet.
The Web (World Wide Web) consists of
information organized into Web pages
containing text and graphic images.
It contains hypertext links, or highlighted
keywords and images that lead to related
information.
Web: a collection of interconnected
documents and other resources. 7
Cont
A collection of linked Web pages that has a
common theme or focus is called a Web site.
Web Page: Any page that is hosted on the
Internet.
The main page that all of the pages on a
particular Web site are organized around and
link back to is called the sites home page.
Typically we name the home page in a web
site index.html

8
Basics of the WWW
Hypertext: a format of information which
allows one to move from one part of a
document to another through hyperlinks.
Uniform Resource Locator (URL): unique
identifiers used to locate a particular resource
on the network
Markup language: defines the structure and
content of hypertext documents

9
1.1.2. Browser and Web Server
Once you have your Internet connection, then you
need special software called a browser to access the
Web.
Web browsers are used to connect you to remote
computers, open and transfer files, display text and
images.
It is a program that retrieves information from the
Web.
Examples of Web browser:
Microsoft Internet Explorer
Most commonly used browsers
Opera, fire fox, chrome, etc
10
1.1.3. Document Types and MIME
A protocol for transmitting non-text
information across the Internet. Basically,
non-ASCII data is converted to ASCII for
transmission and then converted back at the
receiver.
A specification for automatically sending
objects other than text in email messages.
MIME (Multipurpose Internet Mail Extensions) is
usually associated with multimedia, such as images,
audio recordings, and movies.
Additional hardware and helper software are
usually required.
11
Common MIME Types
Type Subtype Description File extensions

Audio midi Musical Instrument Digital Interface .midi, .mid


realaudio Progressive Networks sound .ra, .ram
wav Microsoft sound .wav

Image gif Grapical Interchange Format .gif


jpeg Joint Photographic Experts Group .jpeg, .jpg, .jpe
png Portable Network Graphics .png

Text html Hypertext Markup Language .html, .htm


plain Unformatted text .txt

Video avi Microsoft audio video interleaved .avi


mpeg Moving Picture Experts Group .mpeg, .mpg
quicktime Apple QuickTime movie .qt, .mov

12
1.1.4. Uniform Resource Locators(URLs)

The IP address and the domain name each


identify a particular computer on the Internet.
However, they do not indicate where a Web
pages HTML document resides on that
computer.
To identify a Web pages exact location, Web
browsers rely on Uniform Resource Locator
(URL).

13
Cont
URL is a four-part addressing scheme that
tells the Web browser:
What transfer protocol to use for transporting
the file
The domain name of the computer on which
the file resides
The pathname of the folder or directory on
the computer on which the file resides
The name of the file
14
Cont
A domain name is a unique name associated
with a specific IP address by a program that
runs on an Internet host computer.
The domain identifier identifies the type of
institution or organization ( example: com,
edu)

15
Structure of a Uniform Resource Locators

pathname
protocol

http://www.chicagosymphony.com/civicconcerts/index.htm

Domain name filename

http => Hypertext Transfer Protocol

16
1.1.5 Domain Name System(DNS)
DNS Resolves domain names to IP addresses
and vice versa.
Users generally prefer names to numbers.
Computers prefer numbers to names.
DNS provides the mapping between the two
I have x, give me y.

www.refer.com DNS Server 130.182.125.66

17
1.1.6 Client-Server Architectural Overview of
WWW

Client/Server, Request/Response architecture

18
You request a Web page
e.g. http://www.msn.com/default.asp
HTTP request
The Web server responds with data in the form of
a Web page
HTTP response
Web page is expressed as HTML
Pages are identified as a Uniform Resource
Locator (URL)
Protocol: http
Web server: www.msn.com
Web page: default.asp
19
1.1.7 HTTP Protocol
What is protocol?
For proper communication, entities in
different systems must speak the same
language
there must be mutually acceptable
conventions and rules about the content,
timing and underlying mechanisms
Those conventions and associated rules are
referred as PROTOCOLS
protocol is the set of rules governing a
conversation between device in network.
20
Overview of HTTP and HTTPs
Hypertext Transfer Protocol(HTTP) is a
communications protocol. Its use for
retrieving inter-linked text documents
(hypertext) led to the establishment of the
World Wide Web.
HTTP is the set of rules governing the format
and content of the conversation between a
Web client and server.

21
cont
Hypertext Transfer Protocol(HTTP)
protocol used to access data on the WWW.
uses one TCP connection on well-known
port 80.
two types of http messages: Request,
Response
transfer data in the form of plain text,
hypertext, audio, video, and so on.

22
HTTPS
HTTPS: - Hypertext Transfer Protocol over
Secure Socket Layer or https is a URI scheme
used to indicate a secure communication such
as payment transactions.
Strictly speaking, https is not a separate
protocol, but refers to the combination of a
normal HTTP interaction over an encrypted
Secure Sockets Layer (SSL) or Transport Layer
Security (TLS) connection.

23
Here are some major differences
between HTTP and HTTPS

24
HTTP Methods
Two commonly used methods for a
request-response between a client and server
are: GET and POST.
Some notes on GET requests method
GET requests can be cached
GET requests remain in the browser history
GET requests should never be used when
dealing with sensitive data
GET requests have length restrictions
25
Cont
Some notes on POST requests:
POST requests are never cached
POST requests do not remain in the browser
history
POST requests have no restrictions on data
length

26
HTTP Messages
HTTP messages consist of requests from client
to server and responses from server to client.
HTTP-message = <Request> | <Response>
; HTTP/1.1 messages.
HTTP requests and HTTP responses use a
generic message format of RFC 822 for
transferring the required data. This generic
message format consists of the following four
items.

27
Cont
A Start-line
Zero or more header fields
An empty line
indicating the end of the header fields
Optionally a message-body

28
Cont...
Message Start-Line
It is the first line and has the following generic syntax:
start-line = Request-Line | Status-Line
Examples
GET /hello.htm HTTP/1.1 (This is Request-Line sent by the
client)

HTTP/1.1 200 OK (This is Status-Line sent by the


server)

Header Fields
HTTP header fields provide required information about the
request or response, or about the object sent in the message
body.

29
Cont
Message Body
The message body part is optional for an HTTP
message but if it is available, then it is used to
carry the entity-body associated with the request
or response. If entity body is associated, then
usually Content-Type and Content-Length
headers lines specify the nature of the body
associated.
A message body is the one which carries the actual
HTTP request data (including form data and
uploaded, etc.) and HTTP response data from the
server ( including files, images, etc.). 30
The HTTP Request/Response Model

HTML Codes
<html>

Request </html>

Response
Client Server

Program /
Scripts

31

You might also like