12 - Application Protocols
ucla | CS 118 | 2024-11-21
Table of Contents
Client-Server vs. P2P
- Client-server - server always on with permanent IP, client connects with dynamic IP
- e.g., HTTP, IMAP, FTP
- P2P - no such server, all inter client connects, scalable
- e.g., torrent file sharing - bittorrent
Process Communication
- processes on the same host comms via Inter-Process Comms (IPC) via OS
- client-server - processes are either clients or servers and are always listening or trying to connect
- p2p - procs have both client and server ports
comms via sockets (abstraction) - procs identified by both IP and Port
- port e.g., HTTP:80, SMTP:25 (mail)
Application Level Protocols
protocols contain/define apps require transport service e.g. proc examples
TCP vs. UDP
e.g., app transport protocols TCP security (TLS)
Web and HTTP
- web page consists of objects stored in a DOM structure
- object an be HTML file/element, images, applets, auio, etc.
web-page consists of base HTML file (e.g. index.html) with several referenced objets addressable via URL e.g.
HTTP
- HTTP - hypertext transfer protocol
HTTP is persistent or non-persistent because storing state is complex e.g., Non-persistent HTTP non-persistent performance
persistent (HTTP 1.1) v. non-persistent pro cons messages are request (GET/POST/PUT…) or response (status ode, e.g. 404) request messages request messages
Cookies - State Management
- HTTP requests are stateless so for multi-step exchange or repeated connections, store cookies to maintain state (stored in the browser)
components - cookie header line of HTTP response message
- cookie header line in next HTTP request message
- cookie kept on user’s host and managed by user’s browser
- back-end DB at server website containing cookie id val to map state
- first party cookies - track user behavior for the given website
- third party cookies - tracks user behavior across multiple websites without visiting third party site
- GDPR (EU general data protection regulation) requires sites to inform users about 3rd party cookies
Web Cache
- to inc performance and decrease load on server, initial http get may include data and web cached data
may be done via proxy server which acts both as client and server intermediary - example
og bottleneck sol1: get faster link sol2: web cache, much cheaper than more expensive link
HTTP/2
- dec delay iin multi obj HTTP requets
- HTTP1.1 introdued multiple pipelined gets over single TCP connection
- server responds in order (FCFS) - this may cause head of line (HOL) blocks for small objs behind large objects -> loss recovery stalling transmission
e.g, HTTP/1.1 HOL issue e.g., HTTP/2 frame sol
HTTP/3
- HTTP/2 disadvantages
- single connection means recovery from packet loss still stalls object transmissions
- no security over vanilla TCP
- HTTP/3 adds security and per object error and congestion control via pipelining over UDP
Email, SMTP, IMAP
- composed of: user agents, mail servers, and SMTP
- SMTP - simple mail transfer protocol
- between mail servers on client (sender) - server (receiver) protocol
- user agent - mail reader, creating editing reading sending mail on various clients - outlook, gmail, iphone, etc,
- mail server - composed of mailbox (contains incoming messages) and message queue (outgoing mail queue)
request and response messages IMAP - internet mail access protocol - provides retrieval and deletion