> For the complete documentation index, see [llms.txt](https://shniu.gitbook.io/cs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://shniu.gitbook.io/cs/framework/netty.md).

# Netty

一个异步的基于事件驱动的高性能网络应用框架。

| 必须掌握的知识                        |
| ------------------------------ |
| Netty 的设计思想，设计哲学，它是如何理解这个网络世界的 |
| Netty 的线程模型和网络处理模型             |
| Netty 对 ByteBuffer 的改进和优化      |
| Netty 开发应用的一般流程                |

### IO 模型

### Netty 线程模型和运行架构 (Reactor 模型实现)

![Netty Reactor](https://1617012602-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M5PFXCiDtVclypn0iMK%2F-MRFPmFyzimpDkV3FPnJ%2F-MRFPt5vCbaqyqxS0WGK%2Fimage.png?alt=media\&token=5746a980-b8d1-40f7-a503-bf93ecaf0e74)

### Netty 源码分析

### Netty 高并发高性能架构设计精髓

* 主从 Reactor 线程模型
* IO 多路复用非阻塞
* 无锁串行化设计思想
* 支持高性能序列化协议
* 零拷贝技术(使用 Java 提供的直接内存和 OS 的 DMA 能力)

扩展阅读：

1. [搞懂 零拷贝技术](https://www.cnblogs.com/xiaolincoding/p/13719610.html)

* ByteBuf 内存池设计
* 灵活的 TCP 参数配置能力
* 并发优化

Todo:

* Netty Bootstrap, EventLoop, EventLoopGroup etc.

> 1. git clone <https://github.com/shniu/netty.git>&#x20;
> 2. git remote add upstream <https://github.com/netty/netty.git>&#x20;
> 3. git remote -v git fetch upstream git checkout -b 4.1.55.Final&#x20;
> 4. git pull upstream netty-4.1.55.Final
> 5. &#x20;<https://git-scm.com/book>
