Application Layer
202401200817
Status: #idea
Tags: CN
Application Layer
P2P Architecture
- Does not have an always-on server
- Arbitrary end systems directly communicate
- Self scalability
- New peers bring new service capacity, as well as service demands
- Peers are intermittently connected and change IP addresses
- Complex to manage
Sockets
- Process sends/recieves messages to/from its socket
- TODO: Slides chp2 from beg to 15
TCP & UDP
- Streaming multimedia and internet telephony maybe use either TCP or UDP
- If latency is not important, most protocols use TCP
Securing TCP
- TCP and UDP do not have any encryption
- SSL/TLS
- At app layer
- Apps use SSL or TLS libraries which talk to TCP
Web and HTTP
- Web pages consist of objects (HTML file, image, audio file, etc.)
- Each object is addressed by a URL
- Client-server model
- Client: Requests, receives and displays web objects
- Server: Sends objects in response to requests
- Uses TCP
- Client initiates TCP connection to port 80
- Server accepts TCP connection from client
- HTTP messages are exchanged
- TCP connection is closed
- HTTP is stateless
- Server maintains no information about client's past requests
Non-Persistent HTTP & Persistent HTTP
- Non-persistent HTTP
- At most one object sent over the TCP connection
- Downloading multiple objects requires multiple connections
- Image from slide 2-23 and 2-24
- 1 RTT to initiate TCP connection
- 1 RTT for HTTP request and first few bytes of HTTP response to return
-
- TODO: Slide 2-26 till 2-32
- Persistent HTTP
- Multiple objects can be sent over a single TCP connection
HTTP Messages
- ASCII (human-reabable) format
Status Code Response Groups
| Code | Meaning |
|---|---|
| 1xx | Information |
| 2xx | Event-based |
| 3xx | Redirection |
| 4xx | Client error |
| 5xx | Server error |