COMP211 Chapter 2 Flashcards
What are the possible structures for applications?
Client-server or peer-to-peer
Describe client-server architecture
Server = always-on host w/ permanent IP address (consider data centers for scaling) Client = communicate with server, may be intermittently connected, may have dynamic IP addresses, do not communicate directly with each other
Describe P2P (peer-to-peer) architecture
No always-on server, arbitrary end systems communicate directly. Peers request service from other peers, provide service in return to other peers (self-scalability - new peers bring new capacity, as well as new service demands). Peers are intermittently connected and change IP addresses.
What is a process?
A program running within a host
How can processes communicate?
In the same host, through inter-process communication (defined by OS). In different hosts, by exchanging messages across the network.
What are client/server processes?
Client processes initiate communication
Server processes wait to be contacted
How are processes addressed?
Processes have identifiers, including both the IP address and port number associated with the process and host.
What does the application-layer protocol define?
- types of messages exchanged (e.g. request/response)
- message syntax (e.g. what fields in message & how fields deliniated)
- message semantics (meaning of information in fields)
- rules (for when and how processes send & respond to messages)
- open protocols (defined in RFCs, allows for interoperability)
- proprietary protocols (e.g. Skype)
What transport service does an app need?
Data integrity, minimum throughput, timing, security
What services does TCP provide?
- reliable transport between sending & receiving process
- flow control (sender won’t overwhelm receiver)
- congestion control (throttle sender when network overloaded)
- does not provide timing, minimum throughput guarantee, security
- connection-oriented (setup required between client and server processes)
What services does UDP provide?
- unreliable data transfer between sending and receiving process
- does not provide reliability, flow control, timing, throughput guarantee, secutiry, connection setup
- really fckin fast
What security measures do TCP and UDP take?
None. No encryption, cleartext passwords sent into socket to traverse Internet unencrypted.
What is HTTP?
Hypertext Transfer Protocol, the WWW’s application layer protocol, working on a client-server model where the client is a browser and the server is a web server. HTTP uses TCP and maintains no information about past client requests (it’s “stateless”)
How does non-persistent HTTP differ from persistent HTTP?
Non-Persistent: At most one object sent over TCP connection, connection then closed. Downloading multiple objects requires multiple connections.
Persistent: Multiple objects can be sent over a single TCP connection between a client and server.
What is RTT (Round-Trip Time)?
Time taken for a small packet to travel from client to server and back
How long is a non-persistent HTTP transaction?
2RTT + file transfer time per object
What are some features of non-persistent HTTP?
OS overhead for each TCP connection, browsers often open parallel TCP connections to fetch referenced objects.
What are the time requirements for a persistent HTTP transaction?
As little as 1RTT + file transfer for all the referenced objects
What are the features of persistent HTTP?
Server leaves connection open after sending response, subsequent HTTP messages between same client/server sent over open connection, client sends requests as soon as it encounters a referenced object
What are the components of cookies?
1 cookie header line of HTTP response message
2 cookie header line in next HTTP request message
3 cookie file kept on user’s host, managed by user’s browser
4 back-end database at website
What are some uses of cookies?
Authorisation, shopping carts, recommendations, user session state
What is web caching?
A proxy server acts as a cache, with objects retrieved from the origin server without having to involve it. If the cache contains the requested object, it returns that object. If not, it requests the object form the origin server and then returns it.
Why use web caching?
Reduces response time for client requests, reduces traffic on an institution’s access link, internet dense with caches (enables poor content providers to effectively deliver content)
What are the three major components of email?
User agents, mail servers, SMTP (simple mail transfer protocol)
What is a user agent in the context of emails?
A mail reader capable of composing, editing and reading mail messages
What are the components of a mail server?
Mailbox (contains incoming messages for user), message queue (a queue of outgoing messages to be sent), SMTP (present between mail servers to send email messages, creates a client to send mail messages and server to receive them)
What does SMTP do?
Uses TCP to reliably transfer email messages from client to server through port 25.
What are the three phases of SMTP transfer?
Handshaking (greeting), transfer of messages, closure.
Describe SMTP interaction
Command-response interaction (like HTTP, FTP), across a persistent connection, with direct transfer from sending server to receiving server, where messages must be in 7-bit ASCII
What are some other mail access protocols?
POP: Post Office Protocol (ft. authorisation, download)
IMAP: Internet Mail Access Protocol (ft. authorisation, download, manipulation of stored messages on server)
HTTP (used for gmail, Hotmail, Yahoo! etc.)
How does POP3 differ to SMTP?
Messages are copied on different clients and the protocol remains stateless across sessions.
How does IMAP differ to POP3?
Keeps all messages on the server, allows user to organise messages in folders and keeps user state across sessions
What is DNS (Domain Name System)?
A distributed database, implemented in hierarchy of many name servers, which resolves names by translating a host name into its IP address
What are some disadvantages of centralising DNS (making it non-distributed)?
Single point of failure, traffic volume, distant centralised database, maintenance
What domains fall under TLD (top-level domain)?
.com, .net, .org, .edu, .aero, jobs, museums, top-level country domains (.uk, .fr, .ca, etc.)
What is an authoritative DNS server?
Organisation’s own DNS server, providing authoritative hostname to IP mappings for organisation’s named hosts
What is a local DNS name server?
The first point of contact when host makes a DNS query. Owned by residential/company/university ISP, has local cache of recent name-to-address translation pairs, acts as proxy, forwards queries into hierarchy (though isn’t necessary part of the hierarchy)
What is the file distribution equation?
The time taken to distribute F to N clients
Apply the file distribution equation to a client-server approach
DC-S > max{NF/us, F/dmin}
where F = file size, us = server upload capacity, NF/us = time to send N copies, dmin = minimum client download rate, and F/dmin = minimum client download time.
Apply the file distribution equation to a peer-to-peer approach
DP2P > max{F/us, F/dmin, NF/(us + ui)
where F = file size, N = number of peers, us = server upload capacity, di = peer i download capacity, ui = peer I upload capacity, F/us = time to send 1 copy, dmin = minimum client download rate, F/dmin = minimum client download time, us + ui = max P2P upload rate