2. Ch2: Application Layer

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

What is a GET request?

used to request data from a specified source

What is a POST request?

used to send data to a server to create/update a resource

What is a mail access protocol?

Used to retrieve data from server

Describe the role of user agents and mail servers in electronic mail. Diagram with their interaction

User Agent - composing, reading, editing mail messages (Outlook) Mail Server - mailbox contains incoming messages for user - message queue of outgoing (to be sent) mail messages

What is UDP? How does it compare with TCP?

User Datagram Protocol is an alternative to TCP used primarily for establishing low-latency and loss-tolerating connections between applications on the internet (gaming, voice, video calls) - both UDP and TCP run on top of IP - UDP enables process-to-process communication while TCP supports host-to-host communication - TCP sends individual packest and is considered a reliable transport medium while UDP sends messages, called datagrams, and is considered a best-effort mode of communication - UDP does not provide error and flow control hence it's data transfer is unreliable - It's considered a connection-less protocol because it doesn't require a virtual circuit to be established before any data transfer occurs (no handshake) - Does not provide anything TCP does not provide and the above mentioned services

Explain the relation between TCP and IP with an example

When a Web server sends an HTML file to a client, it uses the HTTP protocol to do so. The HTTP program layer asks the TCP layer to set up the connection and send the file. The TCP stack divides the file into packets, numbers them and then forwards them individually to the IP layer, which defines and takes care of delivering packets of data from one computer to the other. Although each packet in the transmission will have the same source and destination IP addresses, packets may be sent along multiple routes. The TCP program layer in the client computer waits until all of the packets have arrived, then acknowledges those it receives and asks for the retransmission on any it does not (based on missing packet numbers), then assembles them into a file and delivers the file to the receiving application.

What are the 2 main internet transport protocols services?

- TCP (Transmission Control Protocol) - UDP (User Datagram Protocol)

How does the distributed, hierarchical DNS database work?

- there are 13 root name servers around the world - each responds to requests with a list of authoritative name servers for the appropriate TLD

What are local name servers? how are they useful?

(caching/forwarding) server -- a local name server that only caches information for local clients once it has been retrieved from an authoritative name server. The local server can effectively speed up name queries for the local network by serving up names found by prior queries, preventing a request to the authoritative server for that host's domain.

What is a web cache (proxy server)? What is it's goal?

- A cache server is a dedicated network server or service acting as a server that saves Web pages or other Internet content locally. By placing previously requested information in temporary storage, or cache, a cache server both speeds up access to data and reduces demand on an enterprise's bandwidth. - Goal: satisfy client request without involving origin server ○ user gets browser: web access via cache ○ browser sends all HTTP requests to cache § object in cache: cash returns object § else cache request object

Describe Nonpersistent HTTP. Response time? What is RTT?

- At most one object is sent over a TCP connection RTT: time for a small packet to travel from client to server and back Total response time = 1 RTT to initiate TCP connection + 1 RTT for HTTP requests and first few bytes of HTTP response to return + file transmission time

What are the main 4 transport services requirements, which apps require which?

- Data loss ~ can tolerate some loss: audio ~ require 100% reliable data: file transfer, telnet - Timing ~ require low delay to be effective: Internet telephony, interactive games - Throughput ~ require minimum amount of throughput to be effective: multimedia ~ make use of whatever throughput they get: elastic apps - Security ~ encryption and data integrity

What are the different method types in an HTTP request?

- HTTP/1.0 ~ GET ~ POST ~ HEAD - HTTP/1.1 ~ GET, POST, HEAD ~ PUT ~ DELETE

What are the 2 different categories of HTTP connections?

- Nonpersistent HTTP - Persistent HTTP

How is a message mail structured?

- RFC 822: standard for text format message ~ header lines * To: * From: * Subject: ~ body * the "message", ASCII characters only

Why not centralize DNS?

- Single point of failure - traffic volume - distant centralized database - maintenance - doesn't scale

Describe a Hybrid of client-server and P2P by explaining characteristics of examples: Skype and instant message

- Skype ~ voice-over-IP P2P application ~ centralized server finding addresses of remote parties ~ client-client connection: direct (not through server) - Instant messaging ~ chatting between two users is P2P ~ centralized server: client presence detection/location * the user registers its IP address with central server when it comes online * the user contacts central server to find IP address of buddies

What is the Application layer? What is its role?

- The application layer provides services for an application program to effectively communicate with another application program on a network. It's an abstraction to the transmission process, where the details of how the app layer relies on all layers below to complete the transmission gets hidden from the user. - Provides end-user access to network services with protocols for each ○ Dynamic Host Configuration Protocol (DHCP) ○ Domain Name System (DNS) ○ File Transfer Protocol (FTP) ○ Hypertext Transfer Protocol (HTTP) ○ Simple Mail Transfer Protocol (SMTP) ○ Simple network management protocol (SNMP)

How is a web page structured? What is an object? What is a URL?

- a web page consists of objects - object can be HTML file, JPEG image, Java applet, audio file... - web page consists of base HTML file which includes several referenced objects - each object is addressed by a URL (Uniform Resource Locator) ~ Example URL www.someSchool.edu/someDept/pic.gif hostname: www.someSchool.edu path name: someDept/pic.gif

Describe the flow of a HTTP connection using TCP between client and server

- client initiates a TCP connection (creates socket) to server, port 80 - server accepts TCP connection from client - HTTP messages (application-layer protocol messages) exchanged between browser (HTTP client) and Web server (HTTP server) - TCP connection closed

What are some of the services offered by DNS?

- host name to IP address - host aliasing: canonical, alias names - mail server aliasing - load distribution ~ replicated web servers: set of IP addresses for one canonical name

Describe a Peer to Peer (P2P) Architecture

- no always server - arbitrary end systems directly communicate - peers are intermittently connected and change IP address - self-scale-ability ~ Example: in file sharing applications each peer generates work-load by requesting files but each peer also adds service capacity to the system by distributing files to other peers - unlike usual, upstream rate of transmission tends to be higher than downstream

Describe the DNS messaging protocol

- query and replay messages, both with the same format

What are the issues with Nonresistent HTTP?

- requires 2 RTTs per object - OS overhead for each TCP connection - browser often open parallel TCP connections to fetch referenced objects

What is a HEAD request?

- same as GET but without the response body, it will just get the head - a way of seeing what a GET request will return before actually making the request

How are processed addressed/identified for them to communicate with each other?

- to receive messages, process must have identifier ~ identifier includes both IP address and port numbers associated - host device has a unique 32-bit IP address (128.227.205.212) - port number example: 80

What does the application layer protocol define? What are the 2 categories for the different types?

- types of messages exchanged: request, response - message syntax: the fields in a message and how they are delineated - message semantics: meaning of information in fields Types: - Public-domain protocols ~ Allow for inter-operability: e.g., HTTP, SMTP - Proprietary protocols: e.g., Skype - Proprietary protocols

What are the 3 components in the electronic mail?

- user agents - mail servers - Simple Mail Transfer Protocol (SMTP)

What is a socket?

A host-local, application-created, OS-controlled interface (a "door") into which application process can both send and receive messages to/from another application process ~ a door between application process and end-to-end-transport protocol (UCP or TCP)

What is a root name server?

A root name server is a name server for the root zone of the Domain Name System (DNS) of the Internet. It directly answers requests for records in the root zone and answers other requests by returning a list of the authoritative name servers for the appropriate top-level domain (TLD).

What are cookies?

A small text file (up to 4KB) created by a website that is stored in the user's computer either temporarily for that session only or permanently on the hard disk (persistent cookie). Cookies provide a way for the website to recognize you and keep track of your preferences.

What are Authoritative DNS servers?

An authoritative Nameserver is a nameserver (DNS Server) that holds the actual DNS records (A, CNAME, PTR, etc) for a particular domain/ address. A recursive resolver would be a DNS server that queries an authoritative nameserver to resolve a domain/ address.

What is the difference between HTTP and SMTP?

Both protocols are used to transfer files from one host to another: HTTP transfers files (also called objects) from a Web server to a Web client (typically a browser); SMTP transfer files (that is, e-mail messages) from one mail server to another mail server. When transferring the files, both persistent HTTP and SMTP use persistent connections. Thus, the two protocols have common characteristics. However, there are important differences. First, HTTP is mainly a pull protocol - someone loads information on a web server and users use HTTP to pull the information from the server at their convenience. In particular, the TCP connection is initiated by the machine that wants to receive the file. On the other hand, SMTP is primarily a push protocol - the sending mail server pushes the file to the receiving mail server. In particular, the TCP connection is initiated by the machine that wants to send the file. A second difference, which we alluded to earlier, is that SMTP requires each message, including the body of each message, to be in 7-bit ASCII format. If the message contains characters that are not 7-bit ASCII (for example, French characters with accents) or contain binary data (such as an image file), then the message has to be encoded into 7-bit ASCII. HTTP data does not impose this restriction. A third important difference - HTTP: each object encapsulated in its own response message - SMTP: multiple objects sent in multiparty` message

How does web caching impact the HTTP message format?

Chache-control HTTP, validation HTTP headers can be added to the HTTP header max-age=3600 => specifies max amount of time to consider something fresh must-revalidate => tells caches that they must obey any freshness information you give them When a cache has a representation stored that includes a Last-Modified header, it can use it to ask the server if the representation has changed since the last time it was seen, with an If-Modified-Since request.

How and why is a conditional GET used?

Goal: don't send object if cache has up to date cache version

What is HTTP? Describe it

Hypertext Transfer Protocol - web's application layer protocol - client: browser that requests, receives web objects - server: web server that sends objects in response to requests from client - uses TCP - HTTP is stateless ~ server maintains no information about past client requests * protocols that maintain state are complex: past history (state) must be maintained; if server/client crashes, their views of "state" maybe be inconsistent, must be reconciled

What is IMAP

IMAP allows emails to be accessed from different devices. The message remains until you delete them. - Keep all messages in one place: the server - Allows user to organize messages in folders - IMAP keeps user state across sessions - names of folders and mappings between messages IDs and folder name

What are the performance improvements of installing cache with hit rate of 0.4? Assume: - average object size = 100,000 bits - avg. request rate from institution's browsers to origin server = 15/sec - delay from institutional router to any origin server and back to router = 2 sec

Initial performance: - utilization of LAN = 15% - utilization on access link = 100% - total delay = internet delay + access delay + LAN delay = 2 sec + min + millsec With Cache: ○ 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 = 0.6 * 2.01 secs + 0.4 * milliseconds < 1.4 secs

What is Persistent HTTP?

Multiple objects can be sent over a single TCP connection between client and server - server leaves connection open after sending response - subsequent HTTP messages between same client/server sent over open connection - client sends request as soon as it encounters a referenced object - as little as one RTT for each referenced objects

Do either TCP or UDP provide any encryption/security? What solution has been implemented?

No An enhancement for TCP has been developed Secure Socket Layer (SSL) - SSL does everything TCP does and provides security services as encryption, data integrity and end-point authentication

What is a process? How do processes communicate within the same host? in different hosts? What is the difference between client and server process? Can an application do both?

Process: program running on a host - within the same host, two processes communicate using inter-process communication (defined by the OS) - process in different hosts communicate by exchanging messages Client process: process that initiates communication Server process: process that waits to be contacted Applications with P2P architecture have client processes and server processes

Compare persistent and nonpersistent HTTP with an example. Assume user enters URL www.someSchool.edu/someDepartment/home.index where home.index has 10 jpeg objects references

RTT = time for packet to travel from client to server and back Nonpersistent requires TCP connection for each object requested Time = 1 RTT to initiate TCP connection + 1 RTT to get home.index + file transmission => then the same 10 times for each jpeg reference Persistent HTTP creates TCP connection and leaves it open till all reference objects are requested Time = 1 RTT + objects ( 1 RTT + file transmission)

What is a PUT request?

Same as POST, but idempotent, meaning calling the same POST request multiple times will always produce the same result ~ POST repeated calls have side effects of producing the same resource multiple times

What are the main characteristics of the server and client in a Client-server architecture?

Server - always-on host - permanent IP address - server farms for scaling Client - communicate with server - maybe intermittently connected - may have dynamic IP address - do not communicate directly with each other

What is SMTP?

Simple Mail Transfer Protocol § uses TCP to reliably transfer email message from client to server, port 25 § direct transfer: sending server to receiving server § uses persistent connections § three phases of transfer □ handshaking (greeting) □ transfer of messages □ closure § command/response interaction □ commands: ASCII text □ response: status code and phrase § header and body must be in 7-bit ASCII § uses CRLF.CRLF to determine end of message □ CRLF = Carriage Return, Line Feed (\r\n)

What is socket? What is it for?

Socket: interface between the process and the computer network process sends/receives messages to/from socket

What is POP3 and it's purpose?

Stands for Post Office Protocol 3 and is the most recent version of standard protocol for receiving email. It is a client/server protocol in which email is received and held for you by your internet server

Compare TCP and UDP Java client implementation

TCP client creates Socket clientSocket = new Socket("hostname", 6789) And some InputStream and OutputStream connected to clientSocket while UDP client creates DatagramSocket clientSocket = new Datagram() ip = InetAdress.getByName("hostname) sendPacket = new DataGram(data, length, ip, 9876) clientSocekt.send(sendPacket) receiveData = new DatagramPacket(data, length) clientSocekt.receive(receiveData)

Comparison of TCP and UDP

TCP is a connection oriented stream over an IP network. It guarantees that all sent packets will reach the destination in the correct order. This imply the use of acknowledgement packets sent back to the sender, and automatic retransmission, causing additional delays and a general less efficient transmission than UDP. UDP is a connection-less protocol. Communication is datagram oriented. The integrity is guaranteed only on the single datagram. Datagrams reach destination and can arrive out of order or don't arrive at all. It is more efficient than TCP because it uses non ACK. It's generally used for real time communication, where a little percentage of packet loss rate is preferable to the overhead of a TCP connection. In certain situations UDP is used because it allows broadcast packet transmission. This is sometimes fundamental in cases like DHCP protocol, because the client machine hasn't still received an IP address (this is the DHCP negotiaton protocol purpose) and there won't be any way to establish a TCP stream without the IP address itself.

Compare TCP and UDP Java server implementation

TCP server creates a ServerSocket(6789) welcomeSocket while UDP server creates a DatagramSocket(9876) serverSocket Then both inside while(true) TCP accepts a connection: Socket connectionSocket = welcomeSocket.accept() then creates InputStream and OutputStream connected to connectionSocket (connectionSocket.getInputStream()) UDP creates: receivePacket = new DatagramPacket(data, length) serverSocket.receive(receivePacket) Ip = receivePacket.getAddress() port = receivePacket.getPort() sendPacket = new DatagramPacket(data, length, ip, port) serversocket.send(sendPacket)

What is DNS?

The Domain Name System (DNS) is a hierarchical decentralized naming system for computers, services, or other resources connected to the Internet or a private network. It associates various information with domain names assigned to each of the participating entities - distributed database implemented in hierarchy of many name servers - core Internet function implemented as part of the application layer protocol

What is DNS? What are the steps in a DNS lookup of example.com

The Domain Name System is the phonebook of the internet, it's a distributed database implemented as a hierarchy of many name servers. DNS translates domain names to IP addresses so browsers can load Internet resources - user types 'example.com' into browser, the query travels into the Internet and is received by a DNS recursive resolver - the resolver then queries a DNS root name server (1 of 13 servers in the world) - the root name server responds with the address of a Top Level Domain (TLD) DNS server (such as .com or .net), which stores information of its domains - the TLD server then responds with the IP address of the domain's name server, example.com (authoritative name server [server that leads to actual DNS record]) - lastly, the recursive resolver sends a query to the domain's name server - the IP address for example.com is then returned to the resolver from the name server - the DNS resolver then responds to the web browser with the IP address of the domain requested initially

What is TTL?

The time-to-live (TTL) is the number of hops that a packet is permitted to travel before being discarded by a router. A packet is the fundamental unit of information transport in all modern computer networks, and increasingly in other communications networks as well.

What are TLDs?

Top level domains at the highest level in the hierarchy of DNS - last part of domain name Examples: com, net, edu

What is TCP?

Transmission Control Protocol that defines how to establish and maintain a network conversation to allow exchange of data between application programs - TCP is a connection oriented protocol, meaning a connection is established (initial handshake) and maintained until the application programs at each end have finished exchanging messages. - It determines how to break application data into packets and then sends them to the network layer, and accepts packets from the network layer and delivers it to the application layer in way it can understand - Provides reliable transport between sending and receiving process; all data sent without error and in the proper order. To do this it handles re-transmission of dropped or garbled packets as well as acknowledgement of all packets that arrive - Provides a flow control mechanism to prevent data loss from faster sender and slow receiver - Provides congestion control, meaning prevents a situation in which too many sources attempt to send data and the router buffers start overflowing which causes data loss and then re-transmissions increase the problem - Does not provide: timing, minimum throughput guarantees, security

What is a DELETE request?

deletes file/resource specified in the URL


Set pelajaran terkait

MADM 431 leadership ch 1 and 2 set B

View Set

MRP: Material Requirements Planning

View Set

Macro Final Exam Study material.

View Set

4th Grade Social Studies Test - Chapter 5 Northeast Region

View Set

Understanding Operating System CH 5

View Set

GRE Most Important Math Concepts

View Set