1. Lecture 2
• Internet
• HTTP
• HTML
• Cookies
• Web servers
02/28/11 ΗΥ359 - Διαδικτυοκεντρικός Προγραμματισμός 1
Δημήτρης Κοτζίνος
2. History of the Internet
• ARPAnet
– Implemented in late 1960’s by ARPA (Advanced
Research Projects Agency of DOD)
– Networked computer systems of a dozen universities
and institutions with 56KB communications lines
– Grandparent of today’s Internet
– Intended to allow computers to be shared
– Became clear that key benefit was allowing fast
communication between researchers – electronic-mail
(email)
02/28/11 ΗΥ359 - Διαδικτυοκεντρικός Προγραμματισμός 2
Δημήτρης Κοτζίνος
3. History of the Internet (II)
• ARPA’s goals
– Allow multiple users to send and receive info at
same time
– Network operated packet switching technique
• Digital data sent in small packages called packets
• Packets contained data, address info, error-control info
and sequencing info
• Greatly reduced transmission costs of dedicated
communications lines
– Network designed to be operated without
centralized control
• If portion of network fails, remaining portions still able to
route packets
02/28/11 ΗΥ359 - Διαδικτυοκεντρικός Προγραμματισμός 3
Δημήτρης Κοτζίνος
4. History of the Internet (III)
• Transmission Control Protocol (TCP)
– Name of protocols for communicating over ARPAnet
– Ensured that messages were properly routed and that
they arrived intact
• Organizations implemented own networks
– Used both for intra-organization and communication
02/28/11 ΗΥ359 - Διαδικτυοκεντρικός Προγραμματισμός 4
Δημήτρης Κοτζίνος
5. History of the Internet (IV)
• Huge variety of networking hardware and
software appeared
– ARPA achieved inter-communication between all
platforms with development of the IP
• Internetworking Protocol
• Current architecture of Internet
– Combined set of protocols called TCP/IP
• The Internet
– Limited to universities and research institutions
– Military became big user
– Next, government decided to access Internet for
commercial purposes
02/28/11 ΗΥ359 - Διαδικτυοκεντρικός Προγραμματισμός 5
Δημήτρης Κοτζίνος
6. History of the Internet (V)
• Internet traffic grew
– Businesses spent heavily to improve Internet
• Better service their clients
– Fierce competition among communications carriers and
hardware and software suppliers
– Result
• Bandwidth (info carrying capacity) of Internet increased
tremendously
• Costs plummeted
02/28/11 ΗΥ359 - Διαδικτυοκεντρικός Προγραμματισμός 6
Δημήτρης Κοτζίνος
7. Growing of the Internet
• In 1988 when the Internet was first plugged into
a T1 backbone, there were a total of about
50,000 hosts.
• In 1993, when the World Wide Web came
online, the number of hosts had just passed 1
million mark.
• In 2001, there are more than 100 million hosts
on the Internet. The Internet is growing in a fast
speed.
• The most recent survey can be found at
http://www.isc.org/ds/.
02/28/11 ΗΥ359 - Διαδικτυοκεντρικός Προγραμματισμός 7
Δημήτρης Κοτζίνος
8. Major Events in Internet History (I)
Year Event
1957 USSR launches Sputnik
1968 First Packet Switching Network
1969 ARPANET Starts
1972 First Public Demo of ARPANET
Internet Mail Invented
1979 UseNet Starts
1983 ARPANET Changes Over to TCP/IP
ARPANET Splits into ARPANET & MILNET
1984 Internet Exceeds 1.000 Hosts
Domain Name Server Introduced
1987 Internet Exceeds 10.000 Hosts
1988 Worm Attacks 6.000 of Internet’s 60.000 Hosts
02/28/11 ΗΥ359 - Διαδικτυοκεντρικός Προγραμματισμός 8
Δημήτρης Κοτζίνος
9. Major Events in Internet History (II)
Year Event
1989 Internet Exceeds 100,000 Hosts
1990 ARPANET Dismantled Archie Starts
1986 NSFNET Created
1991 WAIS Started
Gopher Started
NSF Lifts Commercial Ban
1992 Internet Exceeds 1 million Hosts
Web Invented by Tim Berners-Lee
1993 MOSAIC Developed by Marc Andreesen
InterNIC Founded by NSF
02/28/11 ΗΥ359 - Διαδικτυοκεντρικός Προγραμματισμός 9
Δημήτρης Κοτζίνος
10. Client/Server
• A program running on the end-user
workstation is called a client.
• A program running on the service part is
called a server.
• Client/server describes the relationship
between two computer programs in which
one program, the client, makes a service
request from another program, the server,
which fulfills the request.
02/28/11 ΗΥ359 - Διαδικτυοκεντρικός Προγραμματισμός 10
Δημήτρης Κοτζίνος
11. History of the World Wide Web
• WWW
– Allows computer users to locate and view
multimedia-based documents
– Introduced in 1990 by Tim Berners-Lee
– HyperText (Nielsen, 1965)
• Internet today
– Mixes computing and communications technologies
– Makes information constantly and instantly available
to anyone with a connection
02/28/11 ΗΥ359 - Διαδικτυοκεντρικός Προγραμματισμός 11
Δημήτρης Κοτζίνος
12. Standard Bodies
• Internet Society (www.isoc.org)
• Internet Architecture Board (www.isi.edu/iab)
• Internet Engineering Task Force (IETF) (www.ietf.org)
• Internet Research Task Force (IRTF) (www.irtf.org)
• Internet network Information Center (InterNIC):
Domain Names (www.internic.net)
• Internet Assigned Numbers Authority (IANA):
IP addresses (www.iana.org)
• World Wide Wed Concortium (W3C) (www.w3c.org)
02/28/11 ΗΥ359 - Διαδικτυοκεντρικός Προγραμματισμός 12
Δημήτρης Κοτζίνος
13. World Wide Web Consortium
(W3C)
• Founded in 1994 by Tim Berners-Lee
– Devoted to developing non-proprietary and interoperable
technologies for the World Wide Web and making the Web
universally accessible
• Standardization
– W3C Recommendations: technologies standardized by W3C
• include Extensible HyperText Markup Language (XHTML), Cascading
Style Sheets (CSS) and the Extensible Markup Language (XML)
– Document must pass through Working Draft, Candidate
Recommendation and Proposed Recommendation phases before
considered for W3C Recommendation
02/28/11 ΗΥ359 - Διαδικτυοκεντρικός Προγραμματισμός 13
Δημήτρης Κοτζίνος
14. World Wide Web Consortium
(W3C) (II)
• W3C Structure
– 3 Hosts
• Massachusetts Institute of Technology (MIT)
• INRIA (Institut National de Recherche en Informatique et
Automatique)
• Keio University of Japan
– 400 Members (including Deitel & Associates)
• W3C homepage at www.w3c.org
• W3C Goals
– User Interface Domain
– Technology and Society Domain
– Architecture Domain and Web Accessibility Initiatives
02/28/11 ΗΥ359 - Διαδικτυοκεντρικός Προγραμματισμός 14
Δημήτρης Κοτζίνος
15. TCP/IP: The Internet Protocol
Application Layer (HTTP, FTP, SMTP)
Transport Layer (TCP, UDP)
Internet Layer (IP)
Physical Network
02/28/11 ΗΥ359 - Διαδικτυοκεντρικός Προγραμματισμός 15
Δημήτρης Κοτζίνος
16. TCP/IP
FPT HTTP TELNET SNMP MBONE
TCP UDP
Connection- Connectionles
oriented s
IP
(ICMP, IGMP)
Internet
addressing
Physical Layer
Physical wiring
02/28/11 ΗΥ359 - Διαδικτυοκεντρικός Προγραμματισμός 16
Δημήτρης Κοτζίνος
19. Name Servers
• DNS (Domain Names System, 1983,
University of Wisconsin)
• Domain Names
– .org, .com, .net, .gov, .edu, .mil
– .gr
02/28/11 ΗΥ359 - Διαδικτυοκεντρικός Προγραμματισμός 19
Δημήτρης Κοτζίνος
20. HyperText Transfer Protocol (HTTP)
www.w3c.org/protocols/HTTP
• Client / Server (browser / web server)
• Stateless
• MIME (binary data support)
• Data in two pieces: data & transfer
description
•fewer TCP connections
• Port 80 •compression/decompression
• version 1.1 •multiple languages
•virtual hosting
02/28/11 ΗΥ359 - Διαδικτυοκεντρικός Προγραμματισμός 20
Δημήτρης Κοτζίνος
21. Sockets and Ports (Diagram)
port 13 Time Service
Client
port 80 Web Service
Socket Socket
Server
02/28/11 ΗΥ359 - Διαδικτυοκεντρικός Προγραμματισμός 21
Δημήτρης Κοτζίνος
22. HTTP
1. Client opens connection
2. Client makes the request
3. Server sends response
4. Server closes connection
• HTTP-Keep Alive: server does not close
connection
• Restart from (2)
02/28/11 ΗΥ359 - Διαδικτυοκεντρικός Προγραμματισμός 22
Δημήτρης Κοτζίνος
23. HTTP methods
• GET
retrieves a resource from the server and returns it to the
client
GET <URL> HTTP/1.1
• HEAD
like GET but returns only info about a resource and NOT
the resource itself
• POST
sends data from the server to the client
02/28/11 ΗΥ359 - Διαδικτυοκεντρικός Προγραμματισμός 23
Δημήτρης Κοτζίνος
24. The HTTP Connection
• The HTTP protocol is text-based.
• HTTP headers:
– GET: identifies the request as HTTP version
1.1.
– Accept: identifies what image formats are
accepted.
– Accept-Language: specifies the language
used.
– Accept-Encoding: specifies the data
compression.
02/28/11 ΗΥ359 - Διαδικτυοκεντρικός Προγραμματισμός 24
Δημήτρης Κοτζίνος
25. The HTTP Connection
• HTTP headers (continued):
– User-Agent: identifies the user agent.
– Host: requests the homepage.
– Connection: specifies to keep the connection
open.
– Extension: Something about security.
02/28/11 ΗΥ359 - Διαδικτυοκεντρικός Προγραμματισμός 25
Δημήτρης Κοτζίνος
28. HTML form that uses GET
<FROM ACTION= “http://smaug.java.utoronto.ca:2021/cgi-bin/form1”
METHOD=GET>
<p> Search string: <INPUT TYPE=”text” NAME=”srch” VALUE=”dogfish”>
<p> Search Type:
<SELECT NAME=”srch_type”>
<OPTION> Insensitive Substrinb
<OPTION SELECTED> Exact Match
<OPTION> Sensitive Substring
<OPTION> Regular Expression
</SELECT>
<p> Search databases in:
<INPUT TYPE=“checkbox” NAME=“srvr” VALUE=“Canada” CHECKED> Canada
<INPUT TYPE= “chckbox” NAME=“srvr” VALUE=“Russia” > Russia
<INPUT TYPE=“checkbox” NAME=“srvr” VALUE=“Sweden” CHECKED> Sweden
<INPUT TYPE=“checkbox” NAME=“srvr” VALUE=“U.S.A.” > U.S.A
<em>(multiple items can be selected.)</em>
<P> <INPUT TYPE=“submit”> < <INPUT TYPE=reset>.
</FORM>
02/28/11 ΗΥ359 - Διαδικτυοκεντρικός Προγραμματισμός 28
Δημήτρης Κοτζίνος
29. Data sent to a HTTP server during
a form-based GET request
GET /cgi-bin/form1?
srch=dogfish&srch_type=Exact+Match&srvr=Ca
nanda&srvr=Sweden HTTP/1.0
Connection:keep-Alive
User-Agent: Mozilla/3.02 (Win95; I)
Host: smaug.java.utoronto.ca:2021
Accept: image/gif, image/x-xbitmap, image/jpeg,
image/pjpeg, */*
Accept-Language: en-US, fr, fr-CA
02/28/11 ΗΥ359 - Διαδικτυοκεντρικός Προγραμματισμός 29
Δημήτρης Κοτζίνος
31. HyperText Markup Language (HTML)
• readable by both humans and computers
• based on SGML (Standard Generalized
Markup Language)
• markup: tags describing the data
• tags: <> </> (tag names case-insensitive)
• Text, images,
02/28/11 ΗΥ359 - Διαδικτυοκεντρικός Προγραμματισμός 31
Δημήτρης Κοτζίνος
32. HTML – Elements and Tags
<h1>This is a level one heading</h1>
02/28/11 ΗΥ359 - Διαδικτυοκεντρικός Προγραμματισμός 32
Δημήτρης Κοτζίνος
33. HTML files
<html>
<head>
<title>Paragraph Attributes</title>
</head>
<body>
<h1>The Paragraph Attribute Align</h1>
<p align='left'> This is a paragraph with its text pushed against the left-hand
side of the page.
<p align='center'> This is a paragraph with its text placed in the center of the
page.
<p align='right'> This is a paragraph with its text pushed against the righthand
side of the page.
</body>
</html>
02/28/11 ΗΥ359 - Διαδικτυοκεντρικός Προγραμματισμός 33
Δημήτρης Κοτζίνος
35. HTML forms
• <form> …. </form>
• hidden forms: forms not showing on the
browser but used to preserve state
information
• Note: HTTP is a stateless protocol
02/28/11 ΗΥ359 - Διαδικτυοκεντρικός Προγραμματισμός 35
Δημήτρης Κοτζίνος