1 / 44
文档名称:

20-network-programming.pptx

格式:pptx   页数:44
下载后只包含 1 个 PPTX 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

20-network-programming.pptx

上传人:钻石文档库 2013/9/7 文件大小:0 KB

下载得到文件列表

20-network-programming.pptx

文档介绍

文档介绍:Network Programming 15-213: Introduction puter Systems 20th Lecture, Nov. 2, 2010
Instructors:
Randy Bryant and Dave O’Hallaron
Last Time: Client-Server Transaction
Client
process
Server
process
1. Client sends request
2. Server
handles
request
3. Server sends response
4. Client
handles
response
Resource
Note: clients and servers are processes running on hosts
(can be the same or different hosts)
Last Time: Logical Structure of an
router
router
router
router
router
router
host
host
Connections
Clients and municate by sending streams of bytes over connections:
Point-to-point, full-duplex (2-munication), and reliable.
A socket is an endpoint of a connection
Socket address is an IPaddress:port pair
A port is a 16-bit integer that identifies a process:
Ephemeral port: Assigned automatically on client when client makes a connection request
Well-known port: Associated with some service provided by a server (., port 80 is associated with Web servers)
A connection is uniquely identified by the socket addresses of its endpoints (socket pair)
(cliaddr:cliport, servaddr:servport)
Putting it all Together: Anatomy of an Connection
Connection socket pair
(:51213, :80)
Server
(port 80)
Client
Client socket address
:51213
Server socket address
:80
Client host address

Server host address

51213 is an ephemeral port
allocated by the kernel
80 is a well-known port
associated with Web servers
Clients
Examples of client programs
Web browsers, ftp, , ssh
How does a client find the server?
The IP address in the server socket address identifies the host (more precisely, an adapter on the host)
The (well-known) port in the server socket address identifies the service, and thus implicitly identifies the server process that performs that service.
Examples of well know ports
Port 7: Echo server
Port 23: server
Port 25: Mail server
Port 80: Web server
Using Port