+ All Categories
Home > Documents > EEC-484/584 Computer Networks Lecture 6 Wenbing Zhao [email protected].

EEC-484/584 Computer Networks Lecture 6 Wenbing Zhao [email protected].

Date post: 19-Dec-2015
Category:
View: 233 times
Download: 0 times
Share this document with a friend
23
EEC-484/584 EEC-484/584 Computer Networks Computer Networks Lecture 6 Lecture 6 Wenbing Zhao Wenbing Zhao [email protected] [email protected]
Transcript

EEC-484/584EEC-484/584Computer NetworksComputer Networks

Lecture 6Lecture 6

Wenbing ZhaoWenbing Zhao

[email protected]@ieee.org

Spring Semester 2007Spring Semester 2007 EEC-484/584: Computer NetworksEEC-484/584: Computer Networks 22Wenbing ZhaoWenbing Zhao

22

OutlineOutline• Reminder:

– Feb 19, no class due to President’s Day– Feb 21, quiz#1 (Ch.1 & Ch.7)

• Lecture 1-6; lab 1-2

– Feb 26, 3pm: CSU Data center tour• 10th floor of Rhodes Tower

– Feb 26, 6-8pm: Java Tutorial #1

• Web Caching• DNS Resource Records• In-class Exercises

Spring Semester 2007Spring Semester 2007 EEC-484/584: Computer NetworksEEC-484/584: Computer Networks 33Wenbing ZhaoWenbing Zhao

33

Web CachingWeb Caching

• user sets browser: Web accesses via proxy server

• browser sends all HTTP requests to proxy server– object in cache: returns

cached object

– else cache requests object from origin server, then returns object to client

Goal: satisfy client request without involving origin server

client

Proxyserver

client

HTTP request

HTTP request

HTTP response

HTTP response

HTTP request

HTTP response

origin server

origin server

Spring Semester 2007Spring Semester 2007 EEC-484/584: Computer NetworksEEC-484/584: Computer Networks 44Wenbing ZhaoWenbing Zhao

44

More about Web CachingMore about Web Caching

• Proxy server acts as both client and server

• Typically proxy server is installed by ISP (university, company, residential ISP)

Why Web caching?• Reduce response time for

client request• Reduce traffic on an

institution’s access link• Internet dense with

caches: enables “poor” content providers to effectively deliver content

Spring Semester 2007Spring Semester 2007 EEC-484/584: Computer NetworksEEC-484/584: Computer Networks 55Wenbing ZhaoWenbing Zhao

55

Non-Caching Example Non-Caching Example

Assumptions• Average object size =

100,000 bits• Avg. request rate from

institution’s browsers to origin servers = 15/sec

• Delay from institutional router to any origin server and back to router = 2 sec

originservers

public Internet

institutionalnetwork 10 Mbps LAN

1.5 Mbps access link

Spring Semester 2007Spring Semester 2007 EEC-484/584: Computer NetworksEEC-484/584: Computer Networks 66Wenbing ZhaoWenbing Zhao

66

Non-Caching Example Non-Caching Example

Consequences• Utilization on LAN = 15%• Utilization on access link =

100%• Total delay = Internet

delay + access delay + LAN delay

= 2 sec + minutes + milliseconds

originservers

public Internet

institutionalnetwork 10 Mbps LAN

1.5 Mbps access link

Spring Semester 2007Spring Semester 2007 EEC-484/584: Computer NetworksEEC-484/584: Computer Networks 77Wenbing ZhaoWenbing Zhao

77

Non-Caching ExampleNon-Caching Example

Possible solution• Increase bandwidth of

access link to, say, 10 Mbps

Consequences• Utilization on LAN = 15%• Utilization on access link = 15%• Total delay = Internet delay +

access delay + LAN delay

= 2 sec + msecs + msecs• Often a costly upgrade

originservers

public Internet

institutionalnetwork 10 Mbps LAN

10 Mbps access link

Spring Semester 2007Spring Semester 2007 EEC-484/584: Computer NetworksEEC-484/584: Computer Networks 88Wenbing ZhaoWenbing Zhao

88

Caching ExampleCaching Example

Install proxy server• Suppose hit rate is 0.4

Consequence• 40% requests will be satisfied almost

immediately• 60% requests satisfied by origin

server• Utilization of access link

reduced to 60%, resulting in negligible delays (say 10 msec)

• Total avg delay = Internet delay + access delay + LAN delay = .6*(2.01) secs + .4*milliseconds < 1.4 secs

originservers

public Internet

institutionalnetwork 10 Mbps LAN

1.5 Mbps access link

InstitutionalProxy server

Spring Semester 2007Spring Semester 2007 EEC-484/584: Computer NetworksEEC-484/584: Computer Networks 99Wenbing ZhaoWenbing Zhao

99

Type A RRType A RR

• Type A DNS records map a host name to an IPv4 address

; zone fragment for example.com $TTL 2d ; zone default = 2 days or 172800 seconds joe IN A 192.168.0.3 ; joe & www = same ip www IN A 192.168.0.3 ; functionally the same as the record above www.example.com. A 192.168.0.3 fred 3600 IN A 192.168.0.4 ; ttl overrides $TTL default ftp IN A 192.168.0.24 ; round robin with next IN A 192.168.0.7 mail IN A 192.168.0.15 ; mail = round robin mail IN A 192.168.0.32 mail IN A 192.168.0.3

Spring Semester 2007Spring Semester 2007 EEC-484/584: Computer NetworksEEC-484/584: Computer Networks 1010Wenbing ZhaoWenbing Zhao

1010

Type NS RRType NS RR• Type NS records within the zone file are

authoritative records for the zone's name servers; zone fragment for example.com ; name servers in the same zone $TTL 2d; zone TTL default = 2 days or 172800 seconds $ORIGIN example.com. @ IN SOA ns1.example.com. hostmaster.example.com. ( 2003080800 ; serial number 3h ; refresh = 3 hours 15M ; update retry = 15 minutes 3W12h ; expiry = 3 weeks + 12 hours 2h20M ; minimum = 2 hours + 20 minutes ) IN NS ns1 ; unqualified name ; the line above is functionally the same as the line below ; example.com. IN NS ns1.example.com. ; at least two name servers must be defined IN NS ns2 ; the in-zone name server(s) have an A record ns1 IN A 192.168.0.3 ns2 IN A 192.168.0.4

Spring Semester 2007Spring Semester 2007 EEC-484/584: Computer NetworksEEC-484/584: Computer Networks 1111Wenbing ZhaoWenbing Zhao

1111

Type CNAME RRType CNAME RR

• A Type CNAME record maps an alias or nickname to the real or Canonical name

; zone fragment for example.com $TTL 2d ; zone default = 2 days or 172800 seconds $ORIGIN example.com. .... server1 IN A 192.168.0.3 www IN CNAME server1 ftp IN CNAME server1

Spring Semester 2007Spring Semester 2007 EEC-484/584: Computer NetworksEEC-484/584: Computer Networks 1212Wenbing ZhaoWenbing Zhao

1212

Type MX RRType MX RR• Type MX records Specifies the name and

relative preference of mail servers for the zone ; zone fragment example.com ; mail servers in the same zone $TTL 2d ; zone default = 2 days or 172800 seconds $ORIGIN example.com. example.com. IN SOA ns1.example.com. root.example.com. ( 2003080800 ; serial number 3h ; refresh = 3 hours 15M ; update retry = 15 minutes 3W12h ; expiry = 3 weeks + 12 hours 2h20M ; minimum = 2 hours + 20 minutes ) IN MX 10 mail ; short form ; the line above is functionally the same as the line below ; example.com. IN MX 10 mail.example.com. ; any number of mail servers may be defined IN MX 20 mail2.example.com. ; use an external back-up IN MX 30 mail.example.net. ; the local mail server(s) need an A record mail IN A 192.168.0.3 mail2 IN A 192.168.0.4

Spring Semester 2007Spring Semester 2007 EEC-484/584: Computer NetworksEEC-484/584: Computer Networks 1313Wenbing ZhaoWenbing Zhao

1313

DNS Protocol, MessagesDNS Protocol, Messages

Name, type fields for a query

RRs in responseto query

records forauthoritative servers

additional “helpful”info that may be used

Spring Semester 2007Spring Semester 2007 EEC-484/584: Computer NetworksEEC-484/584: Computer Networks 1414Wenbing ZhaoWenbing Zhao

1414

Layered ProtocolsLayered Protocols

• Q1. If the unit exchanged at the data link level is called a frame and the unit exchanged at the network level is called a packet, do frames encapsulate packets or do packets encapsulate frames? Explain your answer.

Spring Semester 2007Spring Semester 2007 EEC-484/584: Computer NetworksEEC-484/584: Computer Networks 1515Wenbing ZhaoWenbing Zhao

1515

Layered ProtocolsLayered Protocols

• Q2. A system has an n-layer protocol hierarchy. Applications generate messages of length M bytes. At each of the layers, an h-byte header is added. What fraction of the network bandwidth is filled with headers?

Spring Semester 2007Spring Semester 2007 EEC-484/584: Computer NetworksEEC-484/584: Computer Networks 1616Wenbing ZhaoWenbing Zhao

1616

Reliable CommunicationReliable Communication

• Q3. When a file is transferred between two computers, two acknowledgement strategies are possible. In the first one, the file is chopped up into packets, which are individually acknowledged by the receiver, but the file transfer as a whole is not acknowledged. In the second one, the packets are not acknowledged individually, but the entire file is acknowledged when it arrives. Discuss these two approaches.

Spring Semester 2007Spring Semester 2007 EEC-484/584: Computer NetworksEEC-484/584: Computer Networks 1717Wenbing ZhaoWenbing Zhao

1717

URLURL

• Q4. Imagine that someone in the CS Department at Stanford has just written a new program that he wants to distribute by FTP. He puts the program in the FTP directory ftp/pub/freebies/newprog.c. What is the URL for this program likely to be?

Spring Semester 2007Spring Semester 2007 EEC-484/584: Computer NetworksEEC-484/584: Computer Networks 1818Wenbing ZhaoWenbing Zhao

1818

HTTP and CachingHTTP and Caching• Q5. The If-Modified-Since header can be used to check

whether a cached page is still valid. Requests can be made for pages containing images, sound, video, and so on, as well as HTML. Do you think the effectiveness of this technique is better or worse for JPEG images ascompared to HTML?

Spring Semester 2007Spring Semester 2007 EEC-484/584: Computer NetworksEEC-484/584: Computer Networks 1919Wenbing ZhaoWenbing Zhao

1919

Web and CachingWeb and Caching• Q6. Consider an institutional network connected to the

internet. Suppose that the average object size is 900,000 bits and that the average request rate from the institution’s browsers to the origin servers is 1.5 requests per second. The bandwidth of the access link is 1.5 Mbps. Also suppose that the amount of time it takes from when the router on the Internet side of the access link forwards an HTTP request until it receives the response in two seconds on average. Model the total average response time as the sum of the average access delay (that is, the delay from Internet router to institution router) and the average Internet delay. (continued on next slide)

Spring Semester 2007Spring Semester 2007 EEC-484/584: Computer NetworksEEC-484/584: Computer Networks 2020Wenbing ZhaoWenbing Zhao

2020

Web and CachingWeb and Caching• Q6 (cont’d) For the average access delay, use /(1-),

where is the average time required to send an object over the access link and is the arrival rate of objects to the access link.– Find the total average response time.– Now suppose a cache is installed in the institutional LAN.

Suppose the high rate is 0.4. Find the total response time.

Spring Semester 2007Spring Semester 2007 EEC-484/584: Computer NetworksEEC-484/584: Computer Networks 2121Wenbing ZhaoWenbing Zhao

2121

DNSDNS

• Q7. DNS typically uses UDP instead of TCP. If a DNS packet is lost, there is no automatic recovery. Does this cause a problem, and if so, how is it solved?

Spring Semester 2007Spring Semester 2007 EEC-484/584: Computer NetworksEEC-484/584: Computer Networks 2222Wenbing ZhaoWenbing Zhao

2222

DNSDNS

• Q8. Although it was not mentioned in the text, an alternative form for a URL is to use the IP address instead of its DNS name. An example of using an IP address is http://192.31.231.66/index.html. How does the browser know whether the name following the scheme is a DNS name or an IP address.

Spring Semester 2007Spring Semester 2007 EEC-484/584: Computer NetworksEEC-484/584: Computer Networks 2323Wenbing ZhaoWenbing Zhao

2323

DNS, Web, HTTPDNS, Web, HTTP• Q9. Suppose within your Web browser you click on a link to

obtain a Web page. The IP address for the associated URL is not cached in your local host, so a DNS look-up is necessary to obtain the IP address. Suppose that n DNS servers are visited before your host receives the IP address from DNS; the successive visits incur an RTT of RTT1, …, RTTn. Further suppose that the Web page associated with the link contains exactly one object, consisting of a small amount of HTML text. Let RTT0 denote the RTT between the local host and the server containing the object. Assuming 0 transmission time of the object, how much time elapses from when the client clicks on the link until the client receives the object?


Recommended