Unit 7: Application Layer Flashcards
What is inter-process communication?
Two processes communicating within the same host, defined by the OS
How do processes in different hosts communicate?
By exchanging messages to/from the application layer via sockets
What 4 services does TCP provide?
- Reliable transport
- Flow control
- Congestion control
- Connection-oriented
Why is UDP sometimes preferred over TCP?
Some apps such as telephony and streaming apps can tolerate lossy data in UDP. There is also less overhead with UDP
How is HTTP stateless?
The Web/HTTP server maintains no information about past client requests
Give the formula for calculating non-persistent HTTP response time for:
a) html file with no referenced objects
b) html file with 10 referenced objects
One RTT initiates TCP connection
One RTT for HTTP request
Time to transmit file (usually negligible)
a) Response time = 2RTT + file transmission time
b) Response time = 2RTT + (2RTT*10) + file transmission time
What are 2 issues with non-persistent HTTP?
- Requires 2RTTs per object
2. OS overhead for each TCP connection
What happens in persistent HTTP that makes it different to non-persistent?
The server leaves the TCP connection open after sending a response therefore subsequent messages between same client/server are sent over open connection
What is an issue with persistent HTTP?
Open links waste resources, these should be closed after a period of time
What are the 4 components of cookies?
- The cookie header line of HTTP response message
- The cookie header line in next HTTP request message
- The cookie file kept on user’s host, managed by user’s browser
- The entry on the back-end database of website
Describe the steps of setting a cookie and retrieving this at a later date
- Client makes HTTP request
- Server creates cookie ID for user and creates entry on backend database
- Server responds with ID in HTTP response ‘set-cookie’
Some time passes… - Client makes HTTP request with cookie ID
- Server accesses the cookie, does something with it and responds with usual HTTP response
What is the purpose of a web cache/proxy server?
To satisfy a client request without involving the origin server. Caching locally reduces network delay and traffic
Describe the steps of a user sending a HTTP request via proxy server
- User sends HTTP request to proxy server
- Proxy server checks for copy of object stored locally and responds immediately if it is
- If not stored locally, TCP connection is opened to origin server and a request is made
- Response is acquired from origin server and response is sent back to client
Give 3 reasons why web caching is used
- Reducing response time for a client request
2. Reducing traffic on access link
How would you calculate access link utilisation?
e.g. 60% of requests are satisfied at origin, with a 15.4Mbps bandwidth and average request rate from browsers to origin servers = 15Mbps
Data rate to browsers = 0.6 * 15Mbps = 9Mbps
Utilisation = Data rate to browsers / access link bandwidth (bps)
9 / 15.4 = 0.58
What is the SMTP protocol?
Simple mail transfer protocol - protocol between mail servers to send email messages
Explain the process of sending mail from user agent A to user agent B and what protocols are used where
- User uses User Agent (UA) to compose message
- UA sends message to mail server via SMTP and is placed in message queue
- Client side mail server opens TCP connection
- SMTP client sends message over TCP connection
- The receiving mail server places the message in the recipient’s mail box via a mail access protocol
- The recipient invokes their UA to read messages
What type of connection does SMTP use?
Persistent
Give two differences and one similiarity between SMTP and HTTP
SMTP is a push protocol, HTTP is a pull protocol
In HTTP, each object is encapsulated in its own response message. In SMTP, multiple objects are sent in a multipart message
Both have ASCII command/response interaction and status codes
What are mail access protocols used for? Give examples
The delivery/storage to receiver’s server e.g. POP3, IMAP, HTTP
Describe the phases in POP3
Authorisation phase - consisting of client commands such as username + password, plus server responses such as +OK and -ERR
Transaction phase - Client commands to manipulate messages
Update phase - Server does actual deletion of messages
Give three features that IMAP has that POP3 doesn’t
- It keeps all messages in one place (server)
- Allows user to organise messages into folders
- Keeps user state across sessions
What is DNS used for?
Domain Name System (DNS) maps between IP addresses and hostnames and vice versa
What type of database is DNS?
Distributed database, meaning that it is a database that is implemented in a hierarchy of many name servers in multiple locations