当前版本:1.0.0.0
创建日期:2011-12-22
编写作者:ganjingwei
RIP代码分析
前言 3
关于此文档 3
参考资料 3
第一章 RIP协议报文格式 4
1.1 报文位置 4
1.2 RIP版本1报文 4
1.3 RIP版本2报文 5
第二章 动态学习过程 7
2.1 请求与应答 7
2.1.1 初始化 7
2.1.2 接收到request 7
2.1.3 接收到response 7
2.2 更新 8
2.2.1定期选路更新 8
2.2.2触发更新 8
2.3 其他机制与策略 9
2.3.1 水平分割 9
2.3.2 定时删除 9
前言
关于此文档
此文档是本人这段时间内研究GPL发布的RIP协议源码,总结并且整理出来的文档。供大家参考。 TIMEAR
1 前言,即此章节;
2 重要数据结构
3 接收与发送处理;
4 路由表结构
5 线程机制
6 ripd配置文件
参考资料
网络资源。
源码以linux2.6内核userspace为准。
第一章 数据结构
1.1 收发处理相关
那年冬天好大雪1.1.1 struct rip
struct rip
{
/* RIP socket. */
int sock;
/* Default version of rip instance. */
u_char version;
/* Output buffer of RIP. */
struct stream *obuf;
/* RIP routing information base. */
struct route_table *table;
/* RIP only static routing information. */
struct route_table *route;
/* RIP neighbor. */
struct route_table *neighbor;
营销科学
/* RIP threads. */
struct thread *t_read;
/* Update and garbage timer. */
struct thread *t_update;
/* Triggered update hack. */
int trigger;五纵七横
struct thread *t_triggered_update;
struct thread *t_triggered_interval;
薛定谔猫态
/* RIP timer values. */
unsigned long update_time;
unsigned long timeout_time;
unsigned long garbage_time;