Lecture 4 Slides
Lecture 4 Slides
Introduction to Networks
Hisham Othman
Basma Mohamed Afifi
Nadeen Hamza
2
HTTP connections
Nonpersistent HTTP Persistent HTTP
At most one object is sent Multiple objects can be sent
3
Nonpersistent HTTP
time
4
Nonpersistent HTTP (cont.)
5
Non-Persistent HTTP: Response time
6
7
Roadmap: Application layer
DNS
8
Cookies and User-Server State
User-server state
HTTP is stateless
So how do web servers keep track of your
preferences?
10
User-server state: cookies
Many major Web sites use Example:
cookies Susan access Internet always
Four components: from PC
1) cookie header line of HTTP
visits specific e-commerce site
response message
2) cookie header line in HTTP for first time
request message when initial HTTP requests
3) cookie file kept on user’s host, arrives at site, site creates:
managed by user’s browser
4) back-end database at Web unique ID
site
entry in backend
database for ID
11
Cookies: keeping “state” (cont.)
client server
ebay 8734
usual http request msg
Amazon server
cookie file usual http response creates ID
Set-cookie: 1678 1678 for user create
ebay 8734 entry
amazon 1678
usual http request msg
cookie: 1678 cookie- access
specific
one week later: usual http response msg action backend
database
access
ebay 8734 usual http request msg
amazon 1678 cookie: 1678 cookie-
spectific
usual http response msg action
12
Cookies (continued)
What cookies can bring:
aside
authorization Cookies and privacy:
user session state cookies permit sites to
E.g.: Web e-mail learn a lot about you
shopping carts you may supply name and
e-mail to sites
recommendations
13
Web Cache / Proxy Server
Web caches (proxy server)
15
More about Web caching
Proxy server acts as both Why Web caching?
client and server reduce response time for
client request
Typically cache is installed reduce traffic on an
16
Caching example
origin
Assumptions
public servers
average object size = 1Mbits Internet
2 sec delay
avg. request rate from institution’s browsers to origin
servers = 15 req/sec Internet router
18
Caching example (cont)
19
Conditional GET
22
DNS
23
load distribution DB
replicated Web servers: set
of IP addresses for one
canonical name doesn’t scale!
Distributed, Hierarchical Database
24
a Verisign, Dulles, VA
c Cogent, Herndon, VA (also LA)
d U Maryland College Park, MD k RIPE London (also 16 other locations)
g US DoD Vienna, VA
h ARL Aberdeen, MD i Autonomica, Stockholm (plus
j Verisign, ( 21 locations) 28 other locations)
e NASA Mt View, CA m WIDE Tokyo (also Seoul,
f Internet Software C. Palo Alto, Paris, SF)
CA (and 36 other locations)
13 root name
b USC-ISI Marina del Rey, CA
l ICANN Los Angeles, CA
servers worldwide
25
TLD and Authoritative Servers
26
gaia.cs.umass.edu
28
DNS name
resolution example root DNS server
29
recursive query: 2 3
puts burden of name
7 6
resolution on contacted
name server TLD DNS server
heavy load?
local DNS server
dns.poly.edu 5 4
1 8
gaia.cs.umass.edu
DNS: caching and updating records
30
DNS Problem
1-31
Consider the network diagram on the right depicting three hosts H1, H2
and H3, as well as three levels of hierarchical DNS-Servers. The three
hosts perform a large number of domain-name lookups over the course
of a day.
When a given DNS-request is in the zone of a name-server, this means
the server can resolve the domain-name directly, in other words it doesn't
have to propagate the request to the next level. Imagine for example
host H3 is issuing DNS-requests to DNS3. We say that the probability
(Pz) of that request being in DNS3's zone is 17% when the expected
number of requests DNS3 can resolve directly is 0.17 of the total number
of requests. This in turn means that 0.83 of all the requests to DNS3 have
to be propagated to DNS2.
Furthermore, DNS2 and DNS3 perform caching. If for example the hit- Server Pz CHR
rate of a certain cache (denoted CHR) is 1/10, this means that on the DNS1 100% -
average, 1 in 10 requests can be resolved from that server's cache (the DNS2 43% 2/7
other 9 have to be resolved by propagation).
DNS3 17% 4/5
Consider the table containing the probabilities and CHRs for the
three name-servers. What is the overall average RTT for
domain-name lookups, if RTT1, RTT2 and RTT3 denote the
round-trip time from Hx to servers DNS1, DNS2 and DNS3
respectively?
Suppose 100 requests are sent to DNS3
Solution
1-32
in-zone in-cache up
# requests
DNS#
processed
7.138+2.703
DNS2 7.138 2.703 6.759
n2 = 9.84
17+66.4
DNS3
n3 = 83.4
17 66.4 16.6
Summary
1-34