Chapter 2: The Application Layer Flashcards
How does a client-server application architecture work?
A server is an always-on host with a permanent IP address, typically in data centres.
A client cannot communicate to another client directly; instead it communicates to a server, which forwards the request to the other client.
What is the peer-to-peer (P2P) architecture?
Arbitrary end systems communicate directly with each other. These (termed peers) request a service from other peers, while providing a service in return to other peers.
Peers change IP addresses and are intermittently connected. It still has ‘server’ and ‘client’ processes.
What is a process?
A program within a host.
What is a socket (or API)?
A software interface between two application layers, analogous to a letterbox.
How are processes addressed?
Each process is associated with a port number. To communicate, that socket’s identifier is the IP address and port.
What are the four main variables of data transmission that should be considered when choosing investigation transport service protocols?
Data Integrity
Throughput
Timing Guarantees
Security.
Give the things that an application protocol defines.
Types of message exchanged (request, response).
Message syntax (how fields are delineated).
Message semantics (meaning of information in fields).
Rules for when and how processes send and respond to messages.
Which of the following does TCP provide? Which does UDP provide?
reliable transport
timing
minimum throughput
congestion control
flow control
security
no set-up required
TCP: reliable transport, congestion control, flow control
UDP: No set up required
Why is HTTP is a stateless protocol?
It doesn’t maintain any information about the client.
[If a client asks again for an item, the server doesn’t recall that it has already been sent.]
Compare persistent and non-persistent connections.
In non-persistent connections, only one object can be sent over each HTTP connection. In persistent, there can be multiple object sent over the server.
What are the steps in a non-persistent HTTP connection?
- The HTTP client sends a TCP request to the server.
- The server accepts.
- The client sends the HTTP request to the server.
- The server sends the html file.
- The server sends a termination request, terminating the question
- The client receives the file, realises that there are objects linked to.
[Steps 1-5 are repeated for each object].
What is the response time for a non-persistent connection, with a base page and 10 objects?
1 RTT for TCP initiation
1 RTT for HTTP request and first few bytes of HTTP response to object/file transmission.
Then there is file transmission time.
Thus, we have (2 RTT + file transmission) + 10 * (2 RTT + object transmission).
What is the response time for a persistent connection, with a base page and 10 objects?
1 RTT for TCP set up
1 RTT for HTTP set up
11 * object transmission
= 2 RTT + 11 * object transmission
Give a standard example of a HTTP
GET request and header line for a non-persistent connection.
GET /somedir/page.html HTTP/1.1
Host: www.someschool.edu
Connection: close
User-agent: Mozilla/5.0
Accept-language: en
What are the HEAD and PUT HTTP methods used for?
HEAD is for debugging. PUT is used for uploading objects to a directory on a Server.
Give a standard response HTTP message.
HTTP/1.1 200 OK
Connection: close
Date: Tue, 18 Aug 2015 15:44:04 GMT
Server: Apache/2.2.3 (CentOS)
Last-Modified: Tue, 18 Aug 2015 15:11:03 GMT
Content-Length: 6821
Content-Type: text/html
What do the following sample codes represent?
200, 301, 400, 404, 505
200 - OK
301 - Moved Permanently
400 - Bad Request
404 - Not Found
505 - HTTP Version Not Supported
What are the four components of cookies?
- Cookie header line of HTTP response
- Cookie header line in next HTTP request message
- Cookie file kept on user’s host, managed by user’s browser
- Back-end database at website
Explain the steps of setting a cookie and using it at a later time.
- The client sends a HTTP request msg to the server.
- The server creates a cookie ID in its backend database.
- The server sends a HTTP response with a set-cookie line (and cookie ID)
- The client then sends a later message with that cookie ID and the server then knows the user.
Give four uses of cookies.
Authorisation
Shopping carts
Recommendations
User session state (web email)