# 第11章：网络编程

## [视频解说](https://www.bilibili.com/video/BV1RK4y1R7Kf?p=11)

## 导读

今天互联网中的大千世界都立足于TCP/IP协议之上，Socket甚至已经成为了网络编程的同义词。

历史：1983年BSD 4.2版本实现了TCP/IP协议，由于UC Berkeley强大的技术实力和良好的声誉，使得BSD 成为最流行的UNIX发行版，很多其他操作系统的网络部分都是基于BSD的源代码开发的，所以BSD加速了互联网前进的步伐，它是BSD对UNIX最重要的贡献之一，Socket的英文原意为 “插孔” 或者 “插座”，通常称作"套接字"，它允许两个进程进行通信，这两个进程可能运行在同一个机器上，也可能运行在不同机器上。

![](/files/-McXWCnCVD48bpvy_7GR)

从应用程序员的角度来看，它是应用层与TCP/IP协议族通信的中间软件抽象层，是一组接口API。

<div align="left"><img src="/files/-McXW6BmZLpJ7SpFK02i" alt=""></div>

## 学习方式

[CMU教授的视频课程 - Lecture21：网络编程 （上）](https://www.bilibili.com/video/BV1a54y1k7YE?p=27)，[CMU教授的视频课程 - Lecture22：网络编程 （下）](https://www.bilibili.com/video/BV1a54y1k7YE?p=28)

提及网路编程，W. Richard Stevens对我们这些学习Unix/Linux的程序员的影响是巨大的，每每捧读他写的书都会被感动，不仅被他那丰富的知识所折服，更是被他那一丝不苟，严谨治学的态度所折服。

“他不清楚的，他下决心要弄明白。他知道的，他要努力传授给所有感兴趣的人们！”这就是Stevens！

他的个人网站至今还能访问：<http://www.kohala.com/start/>，让我们向他致敬！

![](/files/-MZ6wEVDOG_1KQYWkRfk)

![](/files/-MZ6s9dokT0ABjxiP6wc)

## 实验解读

自己动手写一个小的Web服务器

## 延伸阅读

* [计算机网络 (自顶向下方法)：配套视频教程](https://www.bilibili.com/video/BV1gZ4y1c7Ju/)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://fengmuzi2003.gitbook.io/csapp3e/di-11-zhang-wang-luo-bian-cheng.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
