飞书用户1263OV的组织
用户8279
添加快捷方式
分享
Computer Network
输入“/”快速插入内容
Computer Network
用户8279
用户8279
2025年12月10日修改
P2P distribution: t((M-1)+logN) M chunks N peers
Application Layer
Client-server paradigm
•
Server: permanent IP address
•
Client: may be intermittently connected, may have dynamic IP addresses
•
Examples: HTTP, IMAP, FTP
Peer-peer paradigm
•
Peers request service from other peers, provide service in return to other peers
•
Peers are intermittently connected and change IP addresses
•
Example: P2P file sharing
Network app
Socket: process sends/receives messages to/from its socket 类似一个门 一次连接需要两个socket (one on each side)
Identifier: includes both IP address and port numbers associated with process on host.
Web and HTTP
HTTP
hypertext transfer protocol
Client: browser that requests, receives, (using HTTP protocol) and displays Web objects
Server: Web server sends (using HTTP protocol) objects in response to requests
HTTP uses TCP
•
client initiates TCP connection (creates socket) to server, port 80
•
server accepts TCP connection from client
•
HTTP exchanged between browser (HTTP client) and Web server (HTTP server)
•
TCP connection closed
HTTP is stateless, server maintains no information about past client requests
Non-persistent HTTP
1.
TCP connection opened
2.
at most one object sent over TCP connection
3.
TCP connection closed
Downloading multiple objects requires multiple connections
Persistent HTTP
1.
TCP connection opened to a server
2.
Multiple objects can be sent over single TCP connection
3.
TCP connection closed
Non-persistent HTTP
Non-persistent HTTP response time=2RTT+file transmission time
Persistent HTTP (HTTP 1.1)
•
Server leaves connection open after sending response