Download - Computer Networks: An Introduction
Computer Networks
December 2008
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
this sessionWhat we will cover in
Will help you understand
Read up yourself
Useful in real life
your syllabusWhat you need to learn in
Watch outI will deliberately lie once today
You can guess where at the end of the class
We will cover one or both these topics
When you type a web site, how does it appear the way it does on your browser?
How did the information travel fromthat machine into your machine?
THE INTERNET THE NETWORK
ST TOPICTHE INTERNET1
HTMLHTTP
CSS
URL
HostingPrivacy
Security
XMLSMTPJavascript
HackingPiracy
If you search on Google for “network”…
http://www.google.com/search?hl=en&q=network&...
scheme resource path query
When you type a URL…
http://www.google.com/search?hl=en&q=network&...
scheme resource path query
Which machine?What method? What to ask for?
http: Use the HTTP protocol, and connect to port 80ftp: Use the FTP protocol, and connect to port 21mailto: Use the SMTP protocol, and connect to port 25etc.
Use DNS (Domain Name System) to find the address of www.google.com> nslookup www.google.comNon-authoritative answer:Name: www.google.comAddress: 92.52.125.20
A HTTP request is sent to the resourceGET /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
The resource sends back a responseHTTP/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">
...
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>
It’s easy to create a web page yourself
• Type some text and save it as something.htmlHere is some simple text
• Add tags around itHere 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 onlineAmazon EC2 (Rs 5 / hr)
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
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?”
ND TOPICTHE NETWORK2
What is a network?
Examples of devices you connect?
What medium connects these devices?
How to connect multiple devices?
How to talk simultaneously?