WEB PROGRAMMING
LECTURE 1
1.1: The Internet
1.1: The Internet
1.2: The World Wide Web (WWW)
2.1: Basic HTML
The Internet
Wikipedia: http://en.wikipedia.org/wiki/Internet
a connection of computer networks using the Internet Protocol (IP)
What's the difference between the Internet and the World Wide Web (WWW)?
The Web is the collection of web sites and pages around the world; the Internet is larger
and also includes other services such as email, chat, online games, etc.
World Wide Web vs. Internet
The Web: a brief history
World Wide Web: a global system of interconnected hypertext documents available via the Internet
(envisioned already in 1945)
• 1960s: Precursor to the Internet (ARPANET) devised by the US department of Defense
• Initial services: electronic mail, file transfer
• Late 1980s: Internet opened to commercial interests
• 1989: WWW created by Tim Berners-Lee (CERN)
• 1994: Netscape released its first Web browser
• 1995: Microsoft released Internet Explorer v1
• 1998: Google was founded
Prepared by Tanjia Chowdhury
WEB PROGRAMMING
• 2002: Mozilla released Firefox v1
Key aspects of the Internet
Internet: interconnected computer networks (subnetworks) that span the globe; communicating
through a common standard (TCP/IP)
• Sub-networks function autonomously
• No centralised (global) control instance
• Devices dynamically join and leave the network
• Devices interact through agreed-upon open standards; anyone can create a new device
• Easy to use: server/client software is widely available
Two important organisations
Internet Engineering Task Force (IETF)
“The mission of the IETF is to make the Internet work better by producing high quality,
relevant technical documents that influence the way people design, use, and manage the
Internet. “Request for Comments (RFC)
World Wide Web Consortium (W3C)
“The W3C mission is to lead the World Wide Web to its full potential by developing
protocols and guidelines that ensure the long-term growth of the Web.”
Network communication
• Conceptual model Open Systems Interconnection (OSI)
• Network protocols are matched to different “layers”
• Many network protocols exist; three are of interest to us: 11 HTTP TCP IP
IP: Internet Protocol
TCP: Transmission Control Protocol
HTTP: Hypertext Transfer Protocol
Others include: SSH, IMAP, STMP, FTP ….
HTTP uses reliable data-transmission protocols.
Layered architecture
Prepared by Tanjia Chowdhury
WEB PROGRAMMING
The internet uses a layered hardware/software architecture (also called the "OSI model"):
physical layer : devices such as ethernet, coaxial cables, fiber-optic lines, modems
data link layer : basic hardware protocols (ethernet, wifi, DSL PPP)
network / internet layer : basic software protocol (IP)
transport layer : adds reliability to network layer (TCP, UDP)
application layer : implements specific communication for each kind of program (HTTP,
POP3/IMAP, SSH, FTP)
Internet Protocol (IP)
a simple protocol for attempting to send data between two computers
each device has a 32-bit IP address written as four 8-bit numbers (0-
255)
Prepared by Tanjia Chowdhury
WEB PROGRAMMING
find out your internet IP address: whatismyip.com
find out your local IP address:
o in a terminal, type: ipconfig (Windows) or ifconfig (Mac/Linux)
Transmission Control Protocol (TCP)
adds multiplexing, guaranteed message delivery on top of IP
multiplexing: multiple programs using the same IP address
o port: a number given to each program or service
o port 80: web browser (port 443 for secure browsing)
o port 25: email
o port 22: ssh
o port 5190: AOL Instant Messenger
o more common ports
some programs (games, streaming media programs) use simpler UDP protocol instead of
TCP
1.2: The World Wide Web (WWW)
1.1: The Internet
1.2: The World Wide Web (WWW)
2.1: Basic HTML
Web servers and browsers (1.2.1)
Prepared by Tanjia Chowdhury
WEB PROGRAMMING
web server: software that listens for web page requests
o Apache
o Microsoft Internet Information Server (IIS) (part of Windows)
web browser: fetches/displays documents from web servers
o Mozilla Firefox
o Microsoft Internet Explorer (IE)
o Apple Safari
o Google Chrome
o Opera
Domain Name System (DNS) (1.2.2)
a set of servers that map written names to IP addresses
o Example: www.cs.washington.edu → 128.208.3.88
many systems maintain a local cache called a hosts file
o Windows: C:\Windows\system32\drivers\etc\hosts
o Mac: /private/etc/hosts
o Linux: /etc/hosts
Prepared by Tanjia Chowdhury
WEB PROGRAMMING
(1) Short for Domain Name System (or Service or Server), an Internet service that
translates domain names into IP addresses. Because domain names are alphabetic, they're
easier to remember. The Internet however, is really based on IP addresses. Every time
you use a domain name, therefore, a DNS service must translate the name into the
corresponding IP address. For example, the domain name www.example.com might
translate to 198.105.232.4.
The DNS system is, in fact, its own network. If one DNS server doesn't know how to
translate a particular domain name, it asks another one, and so on, until the correct IP
address is returned.
Uniform Resource Locator (URL)
an identifier for the location of a document on a web site
a basic URL:
http://www.aw-bc.com/info/regesstepp/index.html
~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~
protocol host path
upon entering this URL into the browser, it would:
o ask the DNS server for the IP address of www.aw-bc.com
o connect to that IP address at port 80
o ask the server to GET /info/regesstepp/index.html
o display the resulting page on the screen
URL syntax
Uniform resource locators offer a standardised way to point to any resource on the Internet
Not restricted to the http scheme, syntax slightly varies from scheme to scheme
General format (adhered to by most schemes):
-determines the protocol to use when connecting to the server.
Prepared by Tanjia Chowdhury
WEB PROGRAMMING
Prepared by Tanjia Chowdhury
WEB PROGRAMMING
Hypertext Transport Protocol (HTTP)
the set of commands understood by a web server and sent from a browser
some HTTP commands (your browser sends these internally):
o GET filename : download
o POST filename : send a web form response
o PUT filename : upload
HTTP (Hypertext Transfer Protocol) is the set of rules for transferring files (text, graphic images,
sound, video, and other multimedia files) on the World Wide Web. As soon as a Web user opens
their Web browser, the user is indirectly making use of HTTP. HTTP is an
application protocol that runs on top of the TCP/IP suite of protocols (the foundation protocols
for the Internet).
An introduction to HTTP messages
Web servers and clients
- Clients are most often Web browsers
- Servers wait for data requests - Telnet
- Answer thousands of clients simultaneously
- Host web resources
Web resource: any kind of content with an identity, including static files (e.g. text, images, video),
software programs, Web cam gateway, etc.
Prepared by Tanjia Chowdhury
WEB PROGRAMMING
HTTP error codes
when something goes wrong, the web server returns a special "error code" number to the
browser, possibly followed by an HTML document
common error codes:
Number Meaning
200 OK
301-303 page has moved (permanently or temporarily)
403 you are forbidden to access this page
404 page not found
500 internal server error
Web languages / technologies
Hypertext Markup Language (HTML): used for writing web pages
Cascading Style Sheets (CSS): stylistic info for web pages
PHP Hypertext Processor (PHP): dynamically create pages on a web server
JavaScript: interactive and programmable web pages
Asynchronous JavaScript and XML (Ajax): accessing data for web applications
eXtensible Markup Language (XML): metalanguage for organizing data
Structured Query Language (SQL): interaction with databases
Prepared by Tanjia Chowdhury