Posts
秘秘秘秘秘密
Cancel

概览 dns 开发用的少, 简单了解, 后续有遇到问题再补充说明。 从访问网站到建立连接:DNS、缓存与故障判断的整体逻辑 一次典型的网站访问流程可以抽象为三步:名字解析 → 地址选择 → 建立通信。应用在发起访问时,首先需要将域名解析为 IP 地址,随后客户端基于选定的 IP 使用 TCP 或 UDP 进行通信,DNS 只参与连接建立前的解析阶段,后续数据传输与 DNS 无关。 ...

10.1. Introduction TCP 是面向连接的流式协议,可靠传输且保证顺序,适合文件、网页和邮件等需要完整有序数据的场景;UDP 是无连接的报文式协议,不保证可靠性,保持每个报文边界,适合实时性高、能容忍丢包的应用如视频、语音、DNS 查询和在线游戏。 10.2. UDP Header 1. UDP 头部概览 UDP 头部固定为 8 字节。 位于 UDP ...

7.2. Firewalls The two major types of firewalls commonly used include proxy firewalls and packet-filtering firewalls. The main difference between them is the layer in the protocol stack at which t...

5.1. Introduction IP provides a best-effort, connectionless datagram delivery service. 5.2. IPv4 and IPv6 Headers 5.2.1. IP Header Fields a host is not required to be able to receive an IPv4...

1. 基本结构说明 1.1 模块基本结构 ngx_module_s 是 Nginx 对模块元信息的统一描述结构。每个模块在编译期以一个全局 ngx_module_t 实例存在,Nginx 启动时遍历 ngx_modules[] 数组,根据该结构体完成模块识别、初始化及生命周期管理。模块本身并不在运行时主动注册,而是由核心代码按模块类型和顺序进行统一调度。 其中,index 表示模块在全...

4.1. Introduction ARP is used with IPv4 only; IPv6 uses the Neighbor Discovery Protocol, which is incorporated into ICMPv6. ARP provides a dynamic mapping from a network-layer address to a co...

3.1. Introduction Ethernet(以太网)是一套用于局域网的通信技术体系,主要由 IEEE 802.3 标准定义,规定了数据在链路层和物理层如何被封装、寻址、发送和接收。 Ethernet 之所以被设计成局域网技术,是因为它在地址、广播、时延假设和控制机制上,天然只适合小范围、低时延、受控规模的网络环境。 LAN 是网络的“使用范围/场景”,而 Ethern...

2.2. Expressing IP Addresses IPv6 blocks may omit leading zeros, and one run of zero blocks may be compressed with ::. Example: 2001:0db8::2, ::1 IPv4-mapped IPv6 addresses embed...

7.2 getsockopt 和setsockopt 函数 1. 函数原型 // 设置套接字选项 int setsockopt(int sockfd, int level, int optname, const void *optval, socklen_t optlen); // 获取套接字选项 int getsockopt(int sockfd, in...

6.1 概述 (select poll epoll) // 每次循环都要重新设置 fd 集合 // O(n) 扫描所有 fd //简单、跨平台 #include <stdio.h> #include <sys/select.h> #include <unistd.h> int main() { fd_set rfds; int max...

Trending Tags