0% found this document useful (0 votes)
7 views60 pages

Chapter 1

Internet programing 1

Uploaded by

Dagim Mengesha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views60 pages

Chapter 1

Internet programing 1

Uploaded by

Dagim Mengesha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 60

Internet Programming I

(CoSc3121)

Chapter 1: Introduction

Prepared By: Helawe Behailu March, 2022


Content
• Introduction and history
• Internet services
• Types of web pages
• Client-Side Scripting
• Server-Side Scripting
Introduction
• What is the Internet?
Introduction (cont...)
• The internet is a global computer network providing a variety of
information and communication facilities, consisting of
interconnected networks using standardized communication
protocols.
Introduction (cont...)
• The Internet is the global system of interconnected computer
networks that use the Internet protocol suite (TCP/IP) to link devices
worldwide. It is a network of networks that consists of private, public,
academic, business, and government networks of local to global
scope, linked by a broad array of electronic, wireless, and optical
networking technologies.
Introduction (cont...)
• The internet is a globally connected network system that uses TCP/IP
to transmit data via various types of media. The internet is a network
of global exchanges – including private, public, business, academic
and government networks – connected by guided, wireless and fiber-
optic technologies.
Introduction (cont...)
• WAN is the generic for any Wide Area Network. And the Internet is a
particular implementation of a WAN, using TCP/IP packets and
supports http protocol.
• Computers connected to a wide-area network are often connected
through public networks, such as the telephone system. They can also
be connected through leased lines or satellites. The largest WAN in
existence is the Internet.
Introduction (cont...)
• Internet:
• Is an international network of networks that links together millions
of computers.
• Is commonly referred to as the 'Net’.
• Is a “network of networks” that consists of smaller domestic,
academic, business, and government networks.
• Is not a closely controlled ‘single’ system, rather it is an
assemblage of independent networks united by the common use
of TCP/IP protocol.
History
• 1957 (when everything begun)
History
• Before 1957, computers only worked on one task at a time. This is
called Batch Processing, of course it was quite ineffective. 
• With computers getting bigger and bigger, they had to be stored in a
special cooled rooms, but then the developers couldn’t work directly
on the computers anymore. 
• The year 1957 marked a big change. A remote connection had to be
installed, so that the developers could work directly on the
computers. (at the same time the idea of time sharing came up) ☺
• This is the first concept in computer technology to share the
processing power of one computer with multiple users.
History (cont...)
• On October, 4th 1957 during the cold war, the first unmanned satellite
called “Sputnik 1” was sent into orbit by the Soviet Union (USSR). The
fair of a missile gap emerged. In order to secure America’s leading
technology the US founded the Defense Advanced Research Project
Agency in February, 1958.
• At that time knowledge was only transferred by people. The DARPA
planned a large scale computer network in order to expatriate
knowledge transfer and avoid the doubling up of already existing
research. This network would become the ARPANET.
History (cont...)
• Further more, three other concepts would to be developed, which are
fundamental for the history of the internet:
• The concept to the military network by the RAND corporation in America.
• The commercial network of the National Physical Laboratory (NPL) in England.
• The scientific network CYCLADES in France.
• The scientific, military and commercial approaches of these concepts
are the foundations for our modern internet.
History (cont...)
• ARPANET (development begun in 1966)
• Universities was generally quite cautious about sharing their computers,
therefore small computers were put in front of the mainframe. This computer,
the Interface Message Processor (IMP) took over control of the network
activities, while the mainframe was only in charge of the initialization of
programs and data files.
• Since only the IMPs were interconnected in a network, this was also called
IMP subnet.
• For the first connections between the computers, the Network Working
Group developed the Network Control Protocol (NCP). Letter on the NCP was
replaced by the more efficient Transmission Control Protocol (TCP).
• The specific feature of the TCP is the verification of the file transfer.
History (cont...)
• National Physical Laboratory (NPL)
• Since the NPL network was designed on a commercial bases, a lot of users
and file transfer were expected. In order to avoid congestion of the lines, the
sent files were divided into smaller packets, which were put together again at
the receiver. PACKET-SWITCHING was born.
History (cont...)
• In 1962, American ferret aircrafts discovered middle and long range
missiles in Cuba, which were able to reach the United States. This stoked
fear of an atomic conflict. At that time information systems had a
centralized network architecture. To avoid breakdown during an attack, a
decentralized network architecture had to be developed, which in case of
loss of a node would still be operative.
• Communication still used to work through radio waves, that would have
caused problems in case of atomic attack: the ionosphere would be
affected and the long-wave radio waves wouldn’t work anymore. Therefore
they had to use direct waves, which, however, don’t have a long range.
• A better solution was the model of a distributed network. Thus long
distances could be covered with a minimum of interferences.
History (cont...)
• Another milestone followed with the development of the French
network “Cyclades”. Since Cyclades had a far smaller budget than
ARPANET and thus also fewer nodes, the focus was laid on the
communication with other networks. In this way the term “inter-net”
was born.
• Moreover, Cyclades’ concept went further than ARPA’s and the NPL’s.
During communication between sender and receiver the computers
went not to intervene anymore, but simply server as a transfer node.
Cyclades’ protocol went through all machines using a physical layer
that was implemented into the hardware, providing a direct
connection with the receiver – an end-to-end structure.
History (cont...)
• Inspired by the Cyclades network and driven by the incompatibility
between the networks, their connection gained in importance
everywhere.
• The phone companies developed the X.25 protocol which enables
communication through their servers – in exchange for monthly basic
charge of course.
• DARPA’s Transmission Control Protocol (TCP) was to connect the
computers through get-ways. And the International Organization for
Standardization designed the OSI Reference Model. The innovation of
OSI was the attempt to standardized the network from its ends, and
the channel’s division into a separate layers.
History (cont...)
• Finally the TCP assimilated the preferences of the OSI Reference
Model and gave way to the TCP/IP protocol – a standard which
guaranteed compatibility between networks and finally merged them,
creating the Internet.
• By February 28, 1990 the ARPANET hardware was removed, but the
internet was up and running.
History (cont...)
• The World Wide Web (WWW), also called the Web, is
an information space where documents and other web
resources are identified by Uniform Resource Locators
(URLs), interlinked by hypertext links, and accessible
via the Internet. English scientist Tim Berners-Lee
invented the World Wide Web in 1989. He wrote the
first web browser in 1990 while employed at CERN in
Switzerland.
• The browser was released outside CERN in 1991, first
to other research institutions starting in January 1991
and to the general public on the Internet in August Berners-Lee in 2014
1991. (Source: Wikipedia)
History (cont...)
• The WorldWideWeb browser:
• The first web browser, after all, when it was written in 1990 by Tim Berners-
Lee, it was the only way to see the web. Much later it was renamed Nexus in
order to save confusion between the program and the abstract information
space (which is now spelled World Wide Web with spaces).
• Berners-Lee wrote the program using a NeXT computer.
WorldWideWeb (Nexus)
The first web browser
Source (w3.org)
History (cont...)
• Mosaic (1992):
• NCSA Mosaic was neither the first web
browser (first was the WorldWideWeb of Berners-
Lee) nor the first graphical web browser (it
was preceded by the lesser-known Erwise and
ViolaWWW), but it was the web browser
credited with popularizing the World Wide
Web.
• Its clean, easily understood user interface,
reliability, Windows port and simple
Eric Bina (left) and Marc Andreessen (right)
installation all contributed to making it the Source (history-computer.com)
application that opened up the Web to the
general public.
NCSA Mosaic
Browser
Source (history-computer.com)
History (cont...)
• Today’s popular web browsers:
History (cont...)

Internet users in 2015 as a percentage of a country's population


Source: (International Telecommunications Union)
History (cont...)

A map of the percentage of the population of African countries using the Internet in 2015
Source: (International Telecommunications Union)
History (cont...)
• Most of the countries in Africa were connected to the Internet during
1995 and 1996.
• Prior to 1995, only four countries namely South Africa, Egypt, Zambia and
Tunisia were connected.
• In 1996 when 25 countries in Africa joined the “Internet village”.
• In January 1997, Ethiopia became the 26th country in Africa to join the
Internet.
• Currently all countries in Africa have Internet connection.
History (cont...)
• Internet expansion (as of websites):
Month/Year Number of websites
1/93 5
12/93 623
6/95 23,500
1/96 100,000
1/97 646,160
8/97 1,269,800
Today almost untraceable
Internet Services
• Internet is best characterized by the services it provides.
• It provides a wide range of capabilities for communicating and
retrieving information.
• It offers access to data in the form of text, graphics, sound, software
and also people through a variety of services and tools for
communication exchange.
• The services provided by the Internet is used for interaction, business,
marketing, downloading files, sending data etc. Various Internet
services are Electronic Mail, World Wide Web (WWW), File Transfer
Protocol (FTP), Chat Rooms, Mailing list, Instant Messaging, Chat, and
News Groups.
World Wide Web (WWW)
• A collection of interlinked multimedia documents that are stored on
the Internet and accessed using a common protocol (HTTP).
World Wide Web (WWW) [Cont...]
• Terms:
• Web server - A Web server is a piece of computer software that can respond
to a browser's request for a page, and deliver the page to the Web browser
through the Internet
• Hypertext - Machine-readable text that is not sequential but is organized so
that related items of information are connected
• Text that, when clicked, sends you to another piece of text or location
• Internet Service Provider (ISP)
• A company that provides dial-in or some other type of access to the Internet for a
monthly fee
• Uniform Resource Locator (URL)
• An address on the Internet, such as http://www.bdu.edu.et/scee, which enables
computers and other devices to visit it.
World Wide Web (WWW) [Cont...]
• How does it work?

Simple architecture of the web


World Wide Web (WWW) [Cont...]

A little bit detailed architecture of the web


World Wide Web (WWW) [Cont...]
• How does it work?
• Requesting the page https://www.nhattyman.com
• The browser broke the URL into 3 parts:
• The protocol ("http")
• The server name ("www. nhattyman.com")
• The file name ("index.html")
• Browser ➔ DNS ……Name to IP translation
• Browser ➔ Server …..Creation of connection
• Browser sends a GET request to the server, asking for the file
"http://www. nhattyman.com/index.html".
• The server then sends the HTML text for the Web page to the
browser
• Browser displays the page based on the HTML tags
World Wide Web (WWW) [Cont...]

Architecture of the web


Showing the behind-the-scenes of
a user browsing the site
https://www.nhattyman.com
World Wide Web (WWW) [Cont...]
• Top Level Domain (TLD) names
• com - Originally for commercial organizations, but now used by individuals,
government agencies, and nonprofits as well. www.google.com
• Net - Internet service providers and other network-related companies.
www.mbc.net, www.mekdim.net
• org - Noncommercial (often nonprofit) organizations. www.ubuntu.org
• gov - government agencies. www.moe.gov.et
• mil - military
• edu - Educational domains. www.bdu.edu.et
• int - International organizations like NATO and the International Red Cross
World Wide Web (WWW) [Cont...]
• More three-or-more-letter TLDs are coming into use, such as:
• aero - Airlines
• arpa - Internet infrastructure
• biz - Businesses
• coop - Cooperatives
• info - Anyone
• museum - Museum
• name – Individuals
World Wide Web (WWW) [Cont...]
• Internet Address
• Each computer connected to the Internet must have a unique
address, known as IP address.
• Internet addresses are in the form xxx.xxx.xxx.xxx where xxx must
be a number from 0 – 255.
Servers
• Web server
• A computer program that is responsible for accepting HTTP requests
from clients (user agents such as web browsers), and serving them
HTTP responses along with optional data contents, which usually are
web pages such as HTML documents and linked objects (images, etc.).
• A computer that runs a computer program as described above.
• Common examples of web server software are
• Apache HTTP server
• MS Internet Information Server (IIS)
• Sun ONE web server
• Wamp (apache+ php+ mysql)
Client-Server Architecture
• A network architecture in which each computer or process on the
network is either a client or a server.
• Components of client/server architecture:
• Communication network
• Clients
• Servers
Client-Server Architecture (cont...)
• 2-tier client-server architecture:
• A two-tier architecture is a
software architecture in which a
presentation layer or interface runs
on a client, and a data layer or data
structure gets stored on a server.
Separating these two components
into different locations represents
a two-tier architecture, as opposed
to a single-tier architecture.
Client-Server Architecture (cont...)
• 3-tier client-server architecture:
• A three-tier client/server is a type of
multi-tier computing architecture in
which an entire application is distributed
across three different computing layers
or tiers. It divides the presentation,
application logic and data processing
layers across client and server devices.
• A three-tier client/server adds an
additional layer/tier to the client/server-
based two-tier models. This additional
layer is a server tier that acts as an
intermediary or middleware appliance.
URL
• URL (Uniform Resource Locator)
Example: http://bdu.edu.et:8080/cs320stu31/index.html
?? ?? ?? ??
Protocol Domain Port File
name number
HTTP
• Hypertext Transfer Protocol (HTTP):
• The Hypertext Transfer Protocol (HTTP) is an
application protocol for distributed, collaborative,
hypermedia information systems. HTTP is the
foundation of data communication for the World
Wide Web, where hypertext documents include
hyperlinks to other resources that the user can
easily access.
• HTTP was developed to facilitate hypertext and
the World Wide Web.
HTTP (cont...)
• HTTP/1.0 allowed only connectionless message passing
• each request/response required a new connection
• to download a page with images required multiple connections
• can overload the server, require lots of overhead
• HTTP/1.1 provides persistent connection by default
• once client & server connect, remains open until told to close it (or timeout)
• reduces number of connections, saves overhead
• client can send multiple requests without waiting for responses
• e.g., can request all images in a page at once
• HTTP/2.0 was published in May 2015.
HTTP (cont...)
• HTTP Request header fields:
• A request line (e.g., GET /images/logo.png HTTP/1.1, which requests a
resource called /images/logo.png from the server).
• Request header fields (e.g., Accept-Language: en).
• the client can specify additional information in the request like:
• Referrer - tells server where the user came from useful for logging and customer
tracking.
• From - contains email address of user generally not used for privacy reasons.
• Authorization - can send username & password used with documents that
require authorization.
• If-Modified-Since - only send document if newer than specified date used for
caching.
HTTP (cont...)
• HTTP Response header fields:
• The first line of the server’s response contains a status code.
• 200 OK request was processed successfully
• 301 Moved permanently document has been moved
• 304 Not modified if cached version is up-to-date

• 400 Bad request syntax error in client’s request


• 403 Forbidden client is not allowed access (e.g., protected)
• 404 Not found file could not be found

• 500 Internal server error server failed


• 503 Service unavailable server is overloaded
HTTP (cont...)
• HTTP Response header fields (cont...)
• In addition to the status code, the server’s response may include:
• Date, Server info, Last-modified, Content-length, Content-type , Expires
• Example:
Caching
• Browsers cache pages to save downloading
• Maintain temporary storage (cache) for recent pages when a page is
requested, check to see if already in cache if not in the cache, issue
GET request
• when response message arrives, display page and store in cache (along with
header info)
• if already stored in the cache, send GET request with If-Modified-
Since header set to the data of the cached page
• when response message arrives,
• if status code 200, then display and store in cache
• if status code 304, then display cached version instead
Cookies
• A cookie is a collection of information about the user.
• Server can download a cookie to the client’s machine using
the “Set-cookie” header in a response
• many e-commerce apps require persistent memory of customer
interactions
e.g., amazon.com
remembers your name, credit card, past purchases, interests.
Firewall
• A firewall is simply a program or hardware device that filters the
information coming through the Internet connection into your private
network or computer system.
• If an incoming packet of information is flagged by the filters, it is not
allowed to pass through.
• Methods
• Packet filtering
• Proxy service
• Stateful inspection
Types of web pages
• Static vs. dynamic pages
• Static web pages (most web pages are static)
• contents (text/links/images) are the same each time it is accessed
e.g., online documents, most homepages

• Dynamic web pages


• as the Web moves towards online services and e-commerce, Web pages
must also provide dynamic content
• pages must be fluid, changeable
• must be able to react to the user's actions, request and process info, tailor
services
e.g., amazon.com, www.facebook.com
Client-Side Scripting
• Used to define the operations performed on the client’s machine.
Required skills: XHTML, JavaScript, Java, Flash, SMIL, XML
• recall: HTML is good for developing static pages
• can specify text/image layout, presentation, links, …
• Web page looks the same each time it is accessed
• in order to develop interactive/reactive pages, must integrate programming
written in a separate programming language
Client-Side Scripting (cont...)
e.g., JavaScript, JScript, VBScript programs are embedded in the HTML
of a Web page, with tags to identify the program component
e.g., <script type="text/javascript"> … </script>
• the browser executes the program as it loads the page, integrating
the dynamic output of the program with the static content of HTML
Client-Side Scripting (cont...)
• Adding dynamic elements to the Web
• HTML and XHTML pages are static -no real interactivity with the
user.
• Web programming languages such as JavaScript can be used to
add interactivity to HTML/XHTML.
• Examples include responding to mouse and keyboard actions,
checking user input, building web pages dynamically, inputting and
displaying data, etc.
Client-Side Scripting (cont...)
• Common scripting tasks:
• Adding dynamic features to Web pages
• validation of form data
• image rollovers
• time-sensitive or random page elements
• handling cookies
• Defining programs with Web interfaces
• Utilize buttons, textboxes, clickable images, prompts, frames
Client-Side Scripting (cont...)
• Limitations of client-side scripting
• since script code is embedded in the page, viewable to the world
• for security reasons, scripts are limited in what they can do
e.g., can't access the client's hard drive
• since designed to run on any machine platform, scripts do not
contain platform specific commands
• script languages are not full-featured e.g., JavaScript objects are
crude, not good for large project development
Server-Side Scripting
• What is server-side code?
• Software that runs on the server, not the client
• Receives input from
• URL parameters
• HTML form data
• Cookies: Cookies are files that a site asks the browser to store on the computer of a user
to save data to be used in a later session.
• HTTP headers: define various characteristics of the data that is requested or the data
that has been provided
• Can access server-side databases, e-mail servers, files, mainframes, etc.
• Dynamically builds a custom HTML response for a client
• to define the operation to be performed on the server. Skills that are often
required: CGI, PHP, ASP, Perl, Java Servlet,…
Server-Side Scripting (cont...)
• To develop a website, three steps:
1. Obtain the appropriate equipment
• Web Server – hardware and software
2. Register the Web Server to an Internet Service Provider (ISP)
• Obtain the IP address and DNS address
3. Develop the contents
• Internet Programming
END

You might also like