随笔分类 -  邻居nd netfilter

摘要:目前内核已经有filter 功能,但是往往实际运用中需要用到一些定制的filter 功能, 所以这个时候仅仅依靠现有的不能完成,于是就出现了conntrack的扩展功能, 最直接的就是tftp helper功能。 先看数据结构: /* struct sk_buff { struct nf_connt 阅读全文
posted @ 2020-05-08 22:25 codestacklinuxer 阅读(545) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2019-11-22 11:34 codestacklinuxer 阅读(390) 评论(0) 推荐(0)
摘要:要成功添加一条邻居表项,需要满足两个条件: 1. 本机使用该表项; 2. 对方主机进行了确认。 同时,表项的添加引入了NUD(Neighbour Unreachability Detection)机制,从创建NUD_NONE到可用NUD_REACHABLE需要经历一系列状态转移, 而根据达到两个条件 阅读全文
posted @ 2019-11-21 22:35 codestacklinuxer 阅读(450) 评论(0) 推荐(0)
摘要:1.5.1 当邻居项不处于NUD_CONNECTD状态时,不允许快速路径发送报文,函数neigh_resolve_output 用于慢而安全的输出,通常用初始化neigh_ops结构 来实例output函数,当邻居从NUD_CONNECT转到非NUD_CONNECT的时候,使用neigh_suspe 阅读全文
posted @ 2019-11-12 20:12 codestacklinuxer 阅读(796) 评论(0) 推荐(0)
摘要:1.4.1:状态定时器回调neigh_timer_handler 设置定时器来处理那些需要定时器处理的状态,定时器回调函数为neigh_timer_handler;函数会根据状态机变换规则对状态进行切换,切换状态后,如果需要更新输出函数则更新,并更新定时器下一次超时时间;其中NUD_INCOMPLE 阅读全文
posted @ 2019-11-06 22:40 codestacklinuxer 阅读(519) 评论(0) 推荐(0)
摘要:2.1 邻居子系统结构体解析 struct neigh_table 代表的是一种邻居协议的接口(比如 ARP)。 struct neigh_params 代表的是邻居协议在每个设备上的不同参数。 struct neigh_ops 邻居对应的一些操作函数。 struct hh_cache 缓存 L2 阅读全文
posted @ 2019-11-06 22:39 codestacklinuxer 阅读(759) 评论(0) 推荐(0)
摘要:1.3.1邻居系统状态图(老外给的解释) NUD_VALID : An entry is considered to be in the NUD_VALID state if its state is any one of the following, whichrepresent neighbor 阅读全文
posted @ 2019-11-06 22:39 codestacklinuxer 阅读(360) 评论(0) 推荐(0)
摘要:1.什么是邻居子系统 邻居:是指同一个IP局域网内的主机,或者邻居之间在三层上仅相隔一跳距离。 邻居子系统:提供了三层协议地址与二层协议地址之间的映射关系。同时还提供了二层首部缓存,用以加速发送数据报文, 以ipv4 发送数据为例,在发送数据时,先进行路由查找,如果查找到目的地址路径,再查看邻居表中 阅读全文
posted @ 2019-11-06 22:24 codestacklinuxer 阅读(1012) 评论(0) 推荐(0)
摘要:转贴自:http://alexanderlaw.blog.hexun.com/9791596_d.html Network Address Translation 地址转换用来改变源/目的地址/端口,是netfilter的一部分,也是通过hook点上注册相应的结构来工作 Nat注册的hook点和co 阅读全文
posted @ 2019-05-17 00:11 codestacklinuxer 阅读(382) 评论(0) 推荐(0)
摘要:Netfilter Connection Tracking and NAT Implementation 4 Implementation: Netfilter NAT NAT is a function module built upon conntrack module, it relies o 阅读全文
posted @ 2019-05-17 00:11 codestacklinuxer 阅读(280) 评论(0) 推荐(0)
摘要:conntrack 阅读全文
posted @ 2019-05-12 21:38 codestacklinuxer 阅读(2691) 评论(0) 推荐(1)
摘要:连接跟踪初始化 基础参数的初始化:nf_conntrack_standalone_init 会调用nf_conntrack_init_start 完成连接跟踪基础参数的初始化, hash slab 扩展项 等; nf_conntrack_l3proto_ipv4_init 函数初始化了协议和tupl 阅读全文
posted @ 2019-05-12 17:31 codestacklinuxer 阅读(1863) 评论(0) 推荐(0)
摘要:nf_contrack 阅读全文
posted @ 2019-05-11 23:50 codestacklinuxer 阅读(7429) 评论(0) 推荐(0)
摘要:Netfilter match target 阅读全文
posted @ 2019-05-11 23:49 codestacklinuxer 阅读(1241) 评论(0) 推荐(0)
摘要:filter 阅读全文
posted @ 2019-05-11 23:48 codestacklinuxer 阅读(1358) 评论(0) 推荐(0)
摘要:linux netfilter filter 阅读全文
posted @ 2019-05-11 23:47 codestacklinuxer 阅读(728) 评论(2) 推荐(0)
摘要:netfilter nat conntrack 阅读全文
posted @ 2019-05-11 23:43 codestacklinuxer 阅读(5575) 评论(1) 推荐(1)