Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 5565 Network Architecture and Protocols

Similar presentations


Presentation on theme: "CS 5565 Network Architecture and Protocols"— Presentation transcript:

1 CS 5565 Network Architecture and Protocols
Lecture 7 Godmar Back

2 Announcements Problem Set 1 due Feb 18 Project 1A due Feb 19
Submission website will be up soon Required Reading: research paper, see website CS 5565 Spring 2009 5/31/2018

3 Application Protocols
Part 1: HTTP

4 Mashups Web applications that combine and mix data from different sources CS 5565 Spring 2009 5/31/2018

5 Base Server http://www.lib.edu Source A
Mash-Up Server Source B HTML Source C Client Browser Base Page A C B Server-side Mash-Up

6 Base Server http://www.lib.edu Source A
HTML+JavaScript Proxy Source B XMLHttpRequest Source C Client Browser Base Page A C B Proxy-Based Mash-Up

7 Base Server http://www.lib.edu Source B http://opac.lib.edu/sourceB
HTML+JavaScript Same Origin Restriction Same Domain Restriction Source A XMLHttpRequest + XML/Text XMLHttpRequest + XML/Text No Domain Restriction Client Browser Base Page Source C A B C B (via hidden frame) <SCRIPT> + JSON Client-side Mash-Up

8 HTTP & JSON In modern web applications, HTTP is increasingly initiated from code Either directly, e.g., XMLHttpRequest Or indirectly, via SCRIPT/JSON Example: callThisFunction({" ":{"bib_key":" ", "info_url": " "preview_url": " preview":"noview", "embeddable":false}}); CS 5565 Spring 2009 5/31/2018

9 HTTP & AJAX AJAX Frameworks no longer build entire web pages from an HTML description Rather: bootstrap small amount of code, then dynamically load and update page “piece-by-piece” Will explore this in HTTP Wireshark Lab CS 5565 Spring 2009 5/31/2018

10 Goal – Use of AJAX Page 1 Page 2 Page 3 Conventional Navigation Model
Submit button pressed Submit button pressed Page 1 Servlet1 Servlet1-1 Update portion of page HTML Page returned Page 2 Submit button pressed Mouse Hover Servlet 2 Servlet 1-2 Page 3 HTML Page returned Update Portion of Page Popularity of ajax over recent years because of advtgs AJAX is the technology responsible for the Web 2.0 hype. Many companies have started using AJAX for their projects because of the notable advantages that it offers in terms of user-interaction Our first goal was to implement the Edition Builder as a web application because Web-applications can be accessed by any user with a computer and an Internet connection. Moreover , web applications can be updated and maintained without installation of software on the client side. Hence, deployment of changes and updates can be done transparently from the user and in an expedited fashion. Problems in conventional navigation model Disruptive page refreshes after each user-interaction Confusing because of hyper-links and page layout AJAX Asynchronous JavaScript and XML Incremental update of pages (No page refreshes) Higher levels of interactivity and responsiveness Explain Working of AJAX An AJAX application has an intermediate layer between the user and the server called the AJAX engine. Each user interaction results in a call to the AJAX engine. The AJAX engine decides, whether a call requires action from the server. If the AJAX engine itself can service a call, it does so without resorting to communication with the server. In this way, unnecessary http requests to the server are avoided and user-interaction can proceed smoothly with other components that do not require server-processing at that moment. Thus, due to the interposition of the AJAX engine, a user interacts with the application without interruptions Conventional Navigation Model AJAX Navigation Model

11 Rich User Interaction with AJAX
Ad hoc AJAX programming problems Browser Incompatibility JavaScript development Scripting language History of ad hoc usage causing un-maintainable code Developers responsible for low level details AJAX Frameworks Provide libraries, API for above problems Save development time and effort Variety of frameworks to choose from Diff frameworks evaluation was a part of this wrk

12 Server centric vs. Client centric AJAX frameworks
Browser Browser Generated HTML+ JavaScript Client Side AJAX Engine Application HTML+ JavaScript Client Side AJAX Engine Dom Dom Server Side AJAX Engine Web Application Web Application Scraps of sample code that you find on the Web and that you can cut and paste into your own application, to comprehensive frameworks. Just above the level of code scraps are individual JavaScript components that present an API for a specific purpose. Some of these represent UI widgets that will appear on a Web page, like the Dojo Button, and others are for solving lower-level, plumbing-related issues like communicating with the server or manipulating the browser DOM (for example the Prototype APIs). Fundamental choices Give examples of toolkits that follow either model Explain dom If you look at the diagrams in Figure 2 below, you can see that in the server-centric model, the application programmer develops the entire application in what appears to the programmer to be server-side code. Of course, DHTML and JavaScript are involved when the application runs, but the framework does not expose these to the programmer. The framework provides both a server-side and client-side Ajax engine. The server-side engine generates HTML and JavaScript that is served into the browser along with a client-side engine, which provides APIs used by the generated code to manipulate the browser DOM, receive events, and push them back to the server-side engine, which communicates events back to the application. A client-side framework, on the other hand, expects the application programmer to write both the server side of the application and the part that will run in the browser. The client-side code is served into the browser along with the Ajax engine, which performs the same intercession functions between the DOM and the application code that it does in the server-centric model An advantage of client side frameworks is that developers can leverage JavaScript skills to combine features from various frameworks and create a complex application. But, client side frameworks entail significant amount of JavaScript programming, which can still give rise to unmaintainable JavaScript code. Moreover, with client-centric AJAX frameworks, the programmer needs to take the responsibility of sending client state to the server periodically. If the client fails to send state information to the server then the server may not be able to retain consistency of the application based on the client-state. Server Server Server-Centric Client-Centric Framework code Application Code Generated Code

13 Application Protocols
Part 2: DNS

14 DNS: Domain Name System
People: many identifiers: SSN, name, passport # Internet hosts, routers: IP address (32 bit) - used for addressing datagrams “name”, e.g., - used by humans Q: map between IP addresses and name ? Domain Name System: distributed database implemented in hierarchy of many name servers application-layer protocol host, routers, name servers to communicate to resolve names (address/name translation) – not built into the network! CS 5565 Spring 2009 5/31/2018

15 DNS Why not centralize DNS? single point of failure traffic volume
distant centralized database maintenance doesn’t scale! DNS services Hostname to IP address translation Host aliasing Canonical and alias names Mail server aliasing Load distribution Replicated Web servers: set of IP addresses for one canonical name CS 5565 Spring 2009 5/31/2018

16 Distributed, Hierarchical Database
Root DNS Servers com DNS servers org DNS servers edu DNS servers poly.edu DNS servers umass.edu yahoo.com amazon.com pbs.org Client wants IP for 1st approx: Client queries a root server to find .com DNS server Client queries .com DNS server to get amazon.com DNS server Client queries amazon.com DNS server to get IP address for CS 5565 Spring 2009 5/31/2018

17 Resource Types Type Name Value A Hostname www.cs.vt.edu IP Address
CNAME Alias rlogin.cs.vt.edu Canonical Hostname hn1.cs.vt.edu NS Domainname vt.edu Authoritative Nameserver nomen.cns.vt.edu MX Mail Domain cs.vt.edu Mail Server antispam.cs.vt.edu CS 5565 Spring 2009 5/31/2018

18 DNS: Root Name Servers List published at Replicated using IP anycast
a Verisign, Dulles, VA c Cogent, Herndon, VA (also Los Angeles) d U Maryland College Park, MD g US DoD Vienna, VA h ARL Aberdeen, MD j Verisign, ( 11 locations) 13 root name servers worldwide k RIPE London (also Amsterdam, Frankfurt) i Autonomica, Stockholm (plus 3 other locations) m WIDE Tokyo e NASA Mt View, CA f Internet Software C. Palo Alto, CA (and 17 other locations) b USC-ISI Marina del Rey, CA l ICANN Los Angeles, CA List published at ftp://ftp.internic.net/domain/named.cache See Replicated using IP anycast See Links section at website for more information CS 5565 Spring 2009 5/31/2018

19 TLD and Authoritative Servers
Top-level domain (TLD) servers: responsible for com, org, net, edu, etc, and all top-level country domains uk, fr, ca, jp, .... Network solutions maintains servers for com TLD Educause for edu TLD Authoritative DNS servers: organization’s DNS servers, providing authoritative hostname to IP mappings for organization’s servers (e.g., Web and mail). Can be maintained by organization or service provider CS 5565 Spring 2009 5/31/2018

20 Caching and Local Name Servers
Q: do we want every (of the 280 million) Internet hosts be contacting a dozen or so root servers all the time? A: No. Caching is needed Local Name Servers bundle queries by clients they serve and cache their results CS 5565 Spring 2009 5/31/2018

21 Local Name Server Does not strictly belong to hierarchy
When a host makes a DNS query, query is sent to its local DNS server Acts as a proxy, forwards query into hierarchy. Each ISP (residential ISP, company, university) has one (or more.) Also called “default name server” or resolver Contacted by resolver library (libresolv.so, or part of libc – provides such functions as gethostbyname(), getaddrinfo() etc. – more on this later CS 5565 Spring 2009 5/31/2018

22 Caching Records Aside: Local Name Server crucial resource
Once (any) name server learns mapping, it caches mapping cache entries time out (disappear) after some time 86,400 seconds per day TLD servers typically cached in local name servers Thus root name servers not often visited Aside: Local Name Server crucial resource Proper cache management required See Bernstein’s comments on caching in BIND (Berkeley Internet Name Domain) program CS 5565 Spring 2009 5/31/2018

23 DNS Protocol: Query Types
Possible constellations: Client’s resolver library talks to local name server Local name server talks to other name servers: root server, TLD servers, … Beauty of DNS Protocol: same protocol can be used for either constellation Uses two query types Recursive: “please resolve this name for me and send me the result” Good for client, harder for server Iterated: “please tell me what you know about the name – partial resolution is okay, I’ll ask the next server in hierarchy” Easy for server, harder for client CS 5565 Spring 2009 5/31/2018

24 Recursive vs. Iterative Queries
root DNS server a.root-servers.net 2 TLD DNS server a3.nstld.com 3 Host at gback.cs.vt.edu wants IP address for godmar.stanford.edu Sends recursive query to voodoo Voodoo performs iterative queries 4 5 local DNS server voodoo.slo.cs.vt.edu 7 6 1 8 authoritative DNS server Argus.stanford.edu requesting host gback.cs.vt.edu godmar.stanford.edu CS 5565 Spring 2009 5/31/2018


Download ppt "CS 5565 Network Architecture and Protocols"

Similar presentations


Ads by Google