Title: Extra Notes, Tutorial No.3
1Extra Notes, Tutorial No.3
- By Yanmin Zhu
- zhuym_at_cs.ust.hk
- Friday, 16 Mar 2006
2Applet Demonstration
- http//wps.aw.com/aw_kurose_network_3/0,9212,14063
46-,00.html - 1. HTTP Delay
- 2. DNS Query
3MIME TypesContent-Type type/subtype arameters
- Text
- example subtypes plain, html
- Image
- example subtypes jpeg, gif
- Audio
- exampe subtypes basic (8-bit mu-law encoded),
32kadpcm (32 kbps coding)
- Video
- example subtypes mpeg, quicktime
- Application
- other data that must be processed by reader
before viewable - example subtypes msword, octet-stream
4Multipart Type
From alice_at_crepes.fr To bob_at_hamburger.edu
Subject Picture of yummy crepe. MIME-Version
1.0 Content-Type multipart/mixed
boundaryStartOfNextPart --StartOfNextPart Dear
Bob, Please find a picture of a
crepe. --StartOfNextPart Content-Transfer-Encoding
base64 Content-Type image/jpeg base64 encoded
data ..... .........................
......base64 encoded data --StartOfNextPart Do
you want the recipe?
5DNS Records
- DNS distributed db storing resource records (RR)
- TypeA
- name is hostname
- value is IP address
- TypeCNAME
- name is alias name for some cannonical (the
real) name - www.ibm.com is really
- servereast.backup2.ibm.com
- value is cannonical name
- TypeNS
- name is domain (e.g. foo.com)
- value is IP address of authoritative name server
for this domain
- TypeMX
- value is name of mailserver associated with name
6DNS RR Example
- Suppose that root name server has the two
following records (umass.edu, dns.umass.edu,
NS) (dns.umass.edu, 128.119.40.111, A) , Also,
suppose that machine dns.umass.edu has the
following resource record (gaia.cs.umass.edu,
128.119.40.200, A). Suppose that you are working
at HKUST and your host machine needs to resolve
the name gaia.cs.umass.edu. Describe the sequence
of queries between your host and the servers
involved in the query process. Assume that the
resolved IP address is not cached at the local
host and that the processing of all queries is
recursive. - Answer
- 1. Local host contacts the local name server.
- 2. Local name server contacts the root server.
- 3. Root server contacts the authoritative server.
- 4. Authoritative server sends the resolved IP
address. - 5. Root server forwards the answer to the local
name server. - 6. Local name server forwards the answer to the
host.
7DNS RR Example
- Problem Is it possible that an organizations
Web server and mail server have exactly the same
name, e.g. foo.com? - Answer Yes, an organizations mail server and
Web server can have the same alias for a host
name. The MX record is used to map the mail
servers host name to its IP address.
8More Example
- Consider an HTTP client that wants to retrieve a
web document at a given URL. The IP address of
the HTTP server is initially unknown. The Web
document at the URL has one embedded GIF image
that resides as the same server as the original
document. What transport and application layer
protocols are needed in this scenario? - Solution Application layer protocols DNS and
HTTP. Transport layer protocols UDP for DNS TCP
for HTTP
9Command nslookup
- nslookup in both Windows and Unix
- Example
- nslookup www.mit.edu
- nslookup www.ust.hk
- nslookup 143.89.14.34
10BitTorrent Basic Idea
- Share very large files among many peers
- Chop file into many pieces
- Replicate different pieces on different peers as
soon as possible - A peer downloads pieces from other peers as it
uploads pieces to other peers - Solve the free-rider problem
- Assemble the entire file at the end
11BT Basic Components
- Seed
- Peer that has the entire file
- Leacher
- Peer that has an incomplete copy of the file
- A Torrent file
- Passive component
- Files are typically fragmented into 256KB pieces
- The torrent file lists SHA1 hashes of all the
pieces to allow peers to verify integrity - Typically hosted on a web server
- A Tracker
- Active component
- Allows peers to find each other
- Returns a random list of peers
12BT Pig Picture
Web Server
Tracker
.torrent file
Peer list
Seed
Leech
pieces
pieces
pieces
pieces
Leech
Leech
13BT References
- Official site http//bitconjurer.org/BitTorrent
- BitTorrent FAQ http//btfaq.com
- "BitTorrent Economics Paper" , Bram Cohen
- "BitTorrent protocol specification" , Bram Cohen
- "BitTorrent Resource Availability Analysis" ,
Brian Greinke and James Hsia. (Rice) - "Dissecting BitTorrent Five Months in a
Torrent's Lifetime" , M. Izal, G. Urvoy-Keller,
E.W. Biersack, P.A. Felber, A. Al Hamra, and
L.Garc es-Erice. (Institut Eurecom, France)