# TCP-IP-NetworkNote: A Chapter-by-Chapter C Companion to Yoon Sung-woo's TCP/IP Network Programming

> A Chinese-language study repository for the book TCP/IP Network Programming, with notes for 19 chapters and 96 C examples you compile with gcc on Linux. The site is polished; the licence status is not.

**riba2534/TCP-IP-NetworkNote** — 📘《TCP/IP网络编程》(韩-尹圣雨)学习笔记

- Repository: https://github.com/riba2534/TCP-IP-NetworkNote
- Website: https://tcp.riba2534.cn
- Stars: 2,524 · Forks: 410
- Language: C
- License: not declared
- Published: 2026-09-28 · Updated: 2026-09-28 · Language: en
- Canonical page: https://hysenlabs.com/projects/riba2534-tcp-ip-networknote

## What the TCP-IP-NetworkNote repository actually is

This is one person's study notebook for a Korean textbook, published as a repository. The README describes it as notes and complete code implementations for 《TCP/IP 网络编程》 by 尹圣雨 (Yoon Sung-woo), covering 19 chapters of theory and 96 C examples. The notes themselves are Chinese, so the material assumes you read Chinese or are willing to work alongside a translation of the book.

The audience is narrow and clear: someone reading that specific textbook who wants the sample programs already typed out and organised by chapter. Chapter folders run from ch01 through ch18 plus ch24, which mirrors the book's structure rather than a general networking curriculum. The README states the notes cover only the Linux part of the book, and the stated development environment is Ubuntu 18.04 LTS with gcc 7.3.0 and g++ 7.3.0.

If you want a general introduction to TCP/IP, this is the wrong shape. It is a companion, not a standalone course. The value is in the pairing: the book supplies the explanation, the repository supplies the code and a second pass through the same material in note form.

## How the notes and examples are organised

The repository splits into two deliverables that share one source of truth. Under each chapter directory sit the C files referenced by that chapter's notes, so ch01 contains hello_server.c, hello_client.c, low_open.c and low_read.c, while ch18 contains the thread examples. Alongside the chapter folders is site/, a VitePress project that renders the notes as an electronic book.

The site is published at tcp.riba2534.cn and offers full-text search, syntax-highlighted source viewing, and a responsive layout. That is a presentation layer over the same Markdown that lives in the repository. The practical consequence is that you can read a chapter in the browser, then jump to the matching folder and compile the file the note just discussed.

The chapter list is worth reading as a syllabus before you commit. It moves from sockets and address families through TCP and UDP servers, socket options, multi-process servers, IPC, I/O multiplexing, the epoll chapter, and multithreaded servers, ending at ch24 with building an HTTP server. Chapters 19 to 23 are absent from the folder listing, and the README's table of contents jumps from 第 18 章 to 第 24 章 without explanation. Treat the coverage as the book's Linux-relevant sections, not the whole book.

## Installing it and running the first server and client

There is nothing to install in the usual sense. You clone the repository, and you need a C toolchain. The README states the environment used was Ubuntu 18.04 LTS with gcc 7.3.0, and the examples are Linux-only.

Start with chapter 1. The README gives these exact commands to compile the two programs:

```bash
gcc hello_server.c -o hserver
gcc hello_client.c -o hclient
```

Then run them. The server takes a port number, the client takes an address and a port:

```bash
./hserver 9190
./hclient 127.0.0.1 9190
```

The README states that the server waits for a connection, and when the client connects to 127.0.0.1 on port 9190 the client receives the server's reply and prints Hello World!. Run the server in one terminal and the client in another, since the server blocks waiting for a connection.

One chapter needs an extra link flag. For the multithreaded examples in chapter 18, the README gives:

```bash
gcc thread1.c -o tr1 -lpthread
```

If you also want the book site locally, the README documents a VitePress setup:

```bash
cd site
npm install
npm run dev
```

The README says the dev server is reachable at http://localhost:5173, and that npm run build writes the static site to site/.vitepress/dist.

## Where the TCP-IP-NetworkNote notes fall short

The build instructions are thin. The README gives exact commands for the chapter 1 hello pair and for the chapter 18 thread example, and nothing else. There is no Makefile documented, no per-chapter build script, and no list of which of the 96 examples need additional libraries beyond the pthread case. You will be reading each chapter's note to find out how its file is meant to be compiled, and for some files the note may not say.

The platform restriction is real, not cosmetic. The README states plainly that the notes cover only the Linux part. Chapters in the book that discuss Windows sockets are not represented in the folder listing, and the note text makes the distinction explicit: it explains that Linux treats sockets as files, that descriptors 0, 1 and 2 are standard input, output and error, and that Windows uses the term handle instead. Code written against these examples will not port to Windows without rewriting the socket setup.

The licence is the sharpest limitation. The README's licence section says the note content is for study and exchange, that reproduction should credit the source, and that the code examples are for study use with the original book. GitHub's badge in the README claims MIT, but there is no LICENSE file in the top-level repository listing. If you intend to reuse any of this code in something you ship, that gap is worth resolving with the author before you build on it.

## TCP-IP-NetworkNote compared with Beej's Guide to Network Programming

The natural alternative for an English-speaking reader is Beej's Guide to Network Programming, which is a self-contained tutorial rather than a companion to a purchased textbook. Beej's Guide teaches the same socket API and covers both Linux and Windows, so a reader who needs portability gets it from one document instead of being told the notes stop at Linux.

The difference in approach matters more than the topic overlap. TCP-IP-NetworkNote is structured as a second pass through a book you are already reading, chapter by chapter, with the code for each chapter sitting next to the notes for it. Beej's Guide is structured as a standalone progression that assumes no other text. If you have the Yoon Sung-woo book and read Chinese, the repository's chapter alignment is the thing Beej's Guide cannot offer. If you do not have the book, the repository's notes will feel like commentary on an argument you cannot see.

A second reference point is the man pages themselves, which are what the note text quotes when it reproduces function signatures such as socket, bind, listen and accept with their return values. The repository's value over man pages is the ordering and the worked examples, not the API documentation.

## Maintenance, releases and what upgrading costs you

The repository is not archived, and its last push was on 2026-06-28. Two releases are listed: v1.0 on 2019-02-07, described as the study notes for the book, and v2.0 on 2026-01-07, described as a typography optimisation. The README also points to PDF versions of the notes in the project's releases.

That release history tells you what to expect from upgrades. The only tagged change in seven years is a formatting revision, which fits the nature of the project: a book's socket API does not change, so the notes do not need to either. The chapter 1 material discusses socket, bind, listen, accept, open, close, read and write exactly as they behave on Linux today. There is no dependency surface to track, no version matrix, and no migration path to plan.

The cost you do carry is the toolchain. The stated environment is gcc 7.3.0 on Ubuntu 18.04 LTS. Newer compilers will generally accept this code, but the README does not document which warnings or standard-version flags were used, so if you build with stricter flags you may see diagnostics the author never saw. The VitePress site under site/ is the one part with real dependency churn, and it is optional: you only touch it if you want to preview or rebuild the book locally.

## Conclusion

Adopt this if you are working through Yoon Sung-woo's book on a Linux machine and want runnable C alongside the text, especially for the epoll and multithreaded server chapters. Do not adopt it if you need a portable Windows or macOS course, want per-file build instructions for all 96 examples, or require a clear reuse licence: the README says code examples are for study use with the book, and no LICENSE file is present at the repository root. Before you start, clone the repository, run the ch01 hello_server and hello_client pair on port 9190, and check whether the ch18 thread example links with -lpthread on your toolchain. If those two build and run, the rest of the chapters are worth your time.

## FAQ

### Can you explain TCP/IP in simple words, and does TCP-IP-NetworkNote do that?

The repository is a set of Chinese study notes for Yoon Sung-woo's book TCP/IP Network Programming, so it explains the material chapter by chapter rather than in a single simple summary. The chapter 1 note uses a telephone analogy for the socket call sequence: socket is installing the phone, bind is assigning a number, listen is connecting the line, and accept is picking up the handset. It assumes you have the book alongside it.

### Why is TCP/IP still used today, and does the TCP-IP-NetworkNote repository address that?

The repository does not discuss why the protocol suite remains in use. It is a study companion covering sockets, address families, TCP and UDP servers, I/O multiplexing, epoll and multithreaded servers as taught in the book, with 96 C examples. Questions about the protocol's continued relevance are outside what the notes cover.

### Is TCP/IP the same as Ethernet, and does TCP-IP-NetworkNote cover Ethernet?

The repository's chapter list covers sockets, address families and data sequences, TCP and UDP server and client code, socket options, multi-process and multithreaded servers, and I/O multiplexing. Ethernet as a link-layer topic is not part of the documented chapter list, which follows the Linux portions of the book.

## Sources

- [Issues](https://github.com/riba2534/TCP-IP-NetworkNote/issues)
- [Project website](https://tcp.riba2534.cn)
- [README](https://github.com/riba2534/TCP-IP-NetworkNote/blob/master/README.md)
- [Releases](https://github.com/riba2534/TCP-IP-NetworkNote/releases)
- [riba2534/TCP-IP-NetworkNote on GitHub](https://github.com/riba2534/TCP-IP-NetworkNote)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/riba2534-tcp-ip-networknote
