EECS 485 Lecture 18
Scaling Static Pages
John Kloosterman
Copyright By PowCoder代写 加微信 powcoder
Learning Objectives
• Identify what problem DNS (Domain Name Service) solves
• Perform a DNS lookup using the recursive resolution algorithm
• Describe what role Content Delivery Networks (CDNs) play on the Internet
Review: IP addresses
• Every computer on the Internet has an IP address • 141.211.243.251
• We don’t use these in practice • umich.edu
• DNS: way to change domain name to IP
• /etc/hosts
• Windows: c:\windows\system32\hosts.txt
• Text file mapping names to IP addresses
Name servers
• Provide a domain name, they will give back information about it
Which DNS server to use?
• When connect to network, DHCP gives you an IP address and says what your DNS server is
DNS hierarchy
• Don’t want Comcast to need a list of all names and IP addresses
DNS resolution
• “name resolution”: finding IP address for a name
DNS caching
• My computer only talks to Comcast
• DNS mappings change very rarely, so cached a long time
DNS and free wifi
• Free wifi signin pages (captive portals) are often implemented with DNS
• google.com => 192.168.1.1 (the login page) • after login, gives you correct DNS
DNS lookup
Parts of DNS record
• Main goal:
• name => IP address
• But also can encode more information • Name servers for subdomains
DNS record
$ dig umich.edu ANY
DNS recursive resolver
engin.umich.edu
Root name servers
• iana.org/domains/root/servers
Looking up .edu
$ dig @a.root-servers.net edu
;; AUTHORITY SECTION:
edu. 172800 IN NS b.edu-servers.net. edu. 172800 IN NS f.edu-servers.net. edu. 172800 IN NS i.edu-servers.net. edu. 172800 IN NS a.edu-servers.net.
;; ADDITIONAL SECTION:
b.edu-servers.net. 172800 IN A 192.33.14.30 b.edu-servers.net. 172800 IN AAAA 2001:503:231d::2:30 f.edu-servers.net. 172800 IN A 192.35.51.30 f.edu-servers.net. 172800 IN AAAA 2001:503:d414::30 i.edu-servers.net. 172800 IN A 192.43.172.30 i.edu-servers.net. 172800 IN AAAA 2001:503:39c1::30
Looking up umich.edu
$ dig @b.edu-servers.net umich.edu
;; AUTHORITY SECTION:
umich.edu. 172800 IN NS dns.cs.wisc.edu. umich.edu. 172800 IN NS dns2.itd.umich.edu. umich.edu. 172800 IN NS dns1.itd.umich.edu.
;; ADDITIONAL SECTION:
dns.cs.wisc.edu. 172800 IN A 128.105.2.10 dns2.itd.umich.edu. 172800 IN A 192.12.80.222 dns1.itd.umich.edu. 172800 IN A 192.12.80.214
Looking up engin.umich.edu
$ dig @dns2.itd.umich.edu engin.umich.edu
;; ANSWER SECTION:
engin.umich.edu. 300 IN A 141.211.54.243
;; AUTHORITY SECTION:
engin.umich.edu. 86400 IN NS dns1.itd.umich.edu. engin.umich.edu. 86400 IN NS dns3.umich.org. engin.umich.edu. 86400 IN NS dns2.itd.umich.edu.
;; ADDITIONAL SECTION:
dns1.itd.umich.edu. 1800 IN A 192.12.80.214 dns2.itd.umich.edu. 1800 IN A 192.12.80.222 dns3.umich.org. 1800 IN A 18.225.0.3
How it’s actually done
Say hi to partner
Question 1
• Why is the time-to-live (TTL) value very large (172800 seconds) for the NS records in the root servers, but smaller (300 seconds) for the A record for engin.umich.edu?
Question 2
• When creating a new domain name, like newdomain.eecs.umich.edu, people can use the new name right away. However, if the A record for newdomain.eecs.umich.edu changes from 141.212.111.100 to 141.212.222.200, it takes a long time for users to get the new IP. Why does this happen?
Content Delivery Networks
Reducing website load
• Server-side dynamic websites can be costly to run • Pay for CPU time and bandwidth
• Become #1 link on Reddit
• Your web traffic goes up from 10 people a day to 10 million
• Servers get overwhelmed and stop taking new connections
• This is bad!
• Nobody can see your page • Expensive
Website caching
• Wikipedia: frequent changes, but once an hour, not once a day
• Lots of work for a dynamic site to re-compute HTML • Save the HTML
Edge cache: Netflix Open Connect
• Advantage: keep traffic near ISP, not over longer- distance cables
• ISP likes this because they pay for transit
• Netflix likes this because load times go way down for customers
Content Delivery Network (CDN)
• Reddit pays a CDN to handle most of its traffic
• The CDN caches Reddit pages and only sends a request
to the real Reddit servers when not in cache • One CDN serves ~30% of all Internet traffic
Advantages to CDN
• Cheaper than paying for bandwidth
• AWS bandwidth is incredibly expensive
• Edge caches don’t use real Internet bandwidth
• Faster load times
• Resilience against attacks
DDOS Attack
• What if you want to take down a website you don’t like? • www.osu.edu
• Generate tons of web traffic, overwhelm the servers or network connection
• Then other people can’t load the site
• How to do this? Infect lots of regular people’s computers with malware, then have the malware request web pages
• Light bulbs
Protecting against DDOS attacks
• Be an expert on how to redirect Internet traffic • Have more bandwidth than attackers
• Limit impact to small area
• CDNs are great for all of these!
Question 1
• Which of the following parts of a client-side dynamic site would a CDN be able to cache?
• JavaScript bundle
• All API endpoints
• Only some API endpoints
Question 2
• Netflix’s edge caches do not have enough storage for all the files for all of their videos. What are some ways they could decide which content is stored on edge servers and which is stored elsewhere?
Learning Objectives
• Identify what problem DNS (Domain Name Service) solves
• Perform a DNS lookup using the recursive resolution algorithm
• Describe what role Content Delivery Networks (CDNs) play on the Internet
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com