2. A few questions before we start…
How many of you have…
Access to a PC and the Internet (home or nearby)
Chatted online
Used a Bluetooth device
Video-chatted
Uploaded a photo or video
Your own blog or website
Written a web application
Contributed to an open source project
3. What we will cover in What you need to learn in
this session your syllabus
Useful in Will help you Read up
real life understand yourself
4. Watch out
I will deliberately lie once today
You can guess where at the end of the class
5. We will cover one or both these topics
THE INTERNET THE NETWORK
When you type a web site, how does it How did the information travel from
appear the way it does on your browser? that machine into your machine?
6. URL
HTML XML
HTTP SMTP
CSS Javascript
Hosting Hacking
Privacy Piracy
Security
1 ST TOPIC
THE INTERNET
7. If you search on Google for “network”…
http://www.google.com/search?hl=en&q=network&...
scheme resource path query
8. When you type a URL…
http://www.google.com/search?hl=en&q=network&...
scheme resource path query
What to ask for?
What method? Which machine?
http: Use the HTTP protocol, and connect to port 80
ftp: Use the FTP protocol, and connect to port 21
mailto: Use the SMTP protocol, and connect to port 25
etc.
Use DNS (Domain Name System) to find the address of www.google.com
> nslookup www.google.com
Non-authoritative answer:
Name: www.google.com
Address: 92.52.125.20
9. A HTTP request is sent to the resource
GET /search?hl=en&q=network&meta= HTTP/1.1
Accept: image/gif, image/jpeg, */*
Accept-Language: en-gb
UA-CPU: x86
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0;
Windows NT 5.1)
Host: www.google.com
Proxy-Connection: Keep-Alive
10. The resource sends back a response
HTTP/1.1 200 OK
Cache-Control: private, max-age=0
Date: Sat, 06 Dec 2008 04:46:55 GMT
Expires: -1
Content-Type: text/html; charset=UTF-8
Set-Cookie: SS=Q0=bmV0d29yaw; path=/search
Server: gws
Content-Length: 29240
<!DOCTYPE html>
<html>
<head>
<title>network - Google Search</title>
<style type=text/css>
...
11. This is what the resulting HTML looks like
<!DOCTYPE html>
<html>
<head>
<title>network - Google Search</title>
<style type=text/css>
body{background:#fff;...
</style>
<script type=text/javascript>
...
</script>
</head>
<body id=gsr topmargin=3 marginheight=3>
<div id=header>
<div id=gbar>
<nobr> <b class=gb1>Web</b> <a href=... class=gb1>Images</a> </nobr>
....
</div>
</div>
</body>
</html>
12. It’s easy to create a web page yourself
• Type some text and save it as something.html
Here is some simple text
• Add tags around it
Here is some <b>bold</b> <i>italics</i> text
• Add links
<a href=“http://www.google.com/”>Google</a>
• Create headings
<h1>Heading</h1>
• Upload it. Search for “free web hosting”
Freehostia.com, Awardspace.com
• Rent your own server online
Amazon EC2 (Rs 5 / hr)
13. The response need not be HTML
• Text, images, video, audio as
• Structured data transferred as XML / JSON
• XML from Amazon’s ECommerce Service (ECS):
<ItemSearchResponse xmlns=http://webservices.amazon.com/AWSECommerceService/2005-03-23>
<Items>
<Request>
<IsValid>True</IsValid>
<ItemSearchRequest><Author>J K Rowling</Author>
<Condition>New</Condition>
<DeliveryMethod>Ship</DeliveryMethod>
...
</Items>
</ItemSearchResponse>
• HTML is a subset of XML with pre-defined tags
14. You don’t want to show everyone everything
Authorization: Are you who you say you are?
– Most online mail sites asks for login and password
– Some will remember you, using cookies
– Passwords are stolen. Hence, two-factor authentication
• Something you have + and something you know
• Examples: Credit Card and PIN, RSA SecureID and passcode
– Biometric sensors are common on most new laptops
Authentication: Are you allowed to do that?
– Use of “Pro” features on Yahoo! Mail or Flickr restricted to
Pro users
– What you’re allowed to do is often stored in one server.
Other machines ask this server, “Can this fellow do that?”
16. What is a network?
Examples of devices you connect?
What medium connects these devices?
How to connect multiple devices?
How to talk simultaneously?