zebra/qugga ospf implemention 1

王朝other·作者佚名  2006-01-09
窄屏简体版  字體: |||超大  

1. start an ospf process

a. data structure

ospf_master{}

|--ospf--ospf{}

b. main routines

router_ospf

|--ospf_get

|--ospf_new

|--ospf_lsa_maxage_walker

|--ospf_lsa_refresh_walker

|--ospf_sock_init

|--ospf_read

c.notes

-there is only one router ospf process, but cisco can have many ospf process.

2. set a network area

a. data structure

ospf{} <--| <--|

|--networks--ospf_network{} | |

|--areas--ospf_area{} ---| |

|--oiflist--ospf_interface{} ---|

|--nbrs--ospf_neighbor{}

|--nbr_self--ospf_neighbor{}

b. main routines

ospf_network_area

|--ospf_network_set

|--ospf_if_new

|--ospf_nbr_add_self

|--ospf_network_run

|--ospf_if_up

|--OSPF_ISM_EVENT_SCHEDULE (ISM_InterfaceUp)

|--ospf_ism_event(ISM_Down-->ISM_Waiting)

ospf_if_new: construct an ospf_interface and a pseudo self ospf_neighbor (its state is always NSM_TwoWay)

ospf_nbr_add_self: add self ospf_neighbor to ospf_interface{}--nbrs

ospf_ism_event (ISM_Down-->ISM_Waiting)

|--ism_interface_up

|--ism_change_state

|--ospf_check_abr_status

|--ospf_router_lsa_timer_add

|--ism_timer_set (ISM_Waiting)

|--OSPF_ISM_TIMER_ON (ospf_hello_timer)

|--OSPF_ISM_TIMER_ON (ospf_wait_timer)

ospf_wait_timer

|--OSPF_ISM_EVENT_SCHEDULE (ISM_WaitTimer)

|--ospf_ism_event (ISM_Waiting-->ISM_DR)

|--ism_wait_timer

|--ospf_dr_election

|--ism_change_state

|--ospf_network_lsa_timer_add

|--ism_timer_set (ISM_DR)

|--OSPF_ISM_TIMER_ON (ospf_hello_timer)

|--OSPF_ISM_TIMER_ON (ospf_ls_ack_timer);

3. interact with a neighbor

situation: after the router become DR, start the other router

a. data structure

b. main routines

ospf_hello

|--ospf_nbr_get

|--ospf_nbr_add

|--ospf_nbr_new

|--nbr->state = NSM_Down

|--OSPF_NSM_EVENT_EXECUTE (NSM_HelloReceived)

|--ospf_nsm_event (NSM_Down-->NSM_Init)

|--nsm_hello_received

|--nsm_change_state

|--OSPF_ISM_TIMER_ON (oi->t_hello, ospf_hello_timer, 1)

if the router can see itself in the neighbor hello packet then

|--OSPF_NSM_EVENT_EXECUTE (NSM_TwoWayReceived)

|--ospf_nsm_event

|--nsm_twoway_received (NSM_Init-->NSM_ExStart)

|--nsm_change_state

|--ospf_db_desc_send ()

|--OSPF_ISM_EVENT_EXECUTE (ISM_NeighborChange)

|--ospf_ism_event (ISM_DR)

|--ospf_dr_election

if the router can not see itself in the neighbor hello packet then

|--OSPF_NSM_EVENT_EXECUTE (NSM_OneWayReceived)

|--ospf_nsm_event (NSM_Init-->NSM_Init)

after the router receive db desc packet from the neighbor.

ospf_db_desc

|--OSPF_NSM_EVENT_EXECUTE (NSM_TwoWayReceived)

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航