|
J-Sim v1.2.1-p7 API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectdrcl.DrclObj
drcl.comp.Component
drcl.net.Module
drcl.inet.Protocol
drcl.inet.protocol.Routing
drcl.inet.protocol.ospf.OSPF
The package, drcl.inet.protocol.OSPF, implements the link-state routing protocol, OSPF v2, Open Shortest Path First routing protocol and follow the RFC2328. In this implementation, we refered much from OSPF code in GNU Zebra project, especially zebra 0.85.
The general data structure can refer to figure 9 and section 5 RFC2328 (If not specially mentioned, the following sections, figures, and etc. can be found in RFC 2328)
OSPF_Area,
OSPF_DBdesc,
OSPF_Packet,
OSPF_Interface,
OSPF_LS_Database,
OSPF_LSA,
OSPF_LSA_Header,
OSPF_LSack,
OSPF_LSrequest,
OSPF_LSupdate,
OSPF_Neighbor,
OSPF_TimeOut_EVT,
Serialized Form| Nested Class Summary |
| Nested classes inherited from class drcl.comp.Component |
Component.Locks |
| Field Summary | |
protected java.util.Vector |
area_list
The list of OSPF areas to which this router is attached |
protected static int |
DATABASE
A constant indicating a database description packet. |
static boolean |
debug
|
static int |
DEBUG_ACK
Debug level of handling LSA acknowledgement packets. |
static int |
DEBUG_DETAIL
Debug level of detailed messages for other levels. |
static int |
DEBUG_LSA
Debug level of handling LSA update packets. |
static int |
DEBUG_NEIGHBOR
Debug level of neighbor state changes. |
static int |
DEBUG_REFRESH
Debug level of LSA refresh events. |
static int |
DEBUG_SAMPLE
Debug level to enable sampled debug messages. |
static int |
DEBUG_SEND
Debug level of sending ospf packets. |
static int |
DEBUG_SPF
Debug level of calculating SPF tree and installing route entries. |
static int |
DEBUG_TIMEOUT
Debug level of handling timeout events. |
static boolean |
debug2
|
protected static int |
HELLO
A constant indicating a hello packet. |
protected static int |
LS_ACK
A constant indicating a link state acknowledge packet. |
protected static int |
LS_REQUEST
A constant indicating a link state request packet. |
protected static int |
LS_UPDATE
A constant indicating a link state update packet. |
protected java.util.Vector |
ospf_if_list
The list of OSPF Interfaces to which this router is attached |
protected int |
router_id
OSPF router ID of this node |
| Fields inherited from class drcl.inet.protocol.Routing |
queryPort, rtconfigPort |
| Fields inherited from class drcl.net.Module |
address, downPort, PortGroup_DOWN, PortGroup_UP, timerPort, upPort |
| Constructor Summary | |
OSPF()
Constructor. |
|
| Method Summary | |
void |
dataArriveAtDownPort(java.lang.Object data_,
Port downPort_)
Handle data arriving at the down port. |
protected void |
delayed_acknowledge(OSPF_LSA lsa)
Delayed acknowledgement Include multiple acks in one packet. |
protected void |
direct_acknowledge(OSPF_LSA lsa,
OSPF_Interface oif,
int now_,
boolean clone_)
Direct acknowledgement |
void |
duplicate(java.lang.Object source_)
Duplicates the content of source_, including ID, name, child components and connections among them, to this component. |
java.lang.String[] |
getDebugLevelNames()
Returns the names of defined debug levels; subclasses should override this method if debug levels are defined. |
java.lang.String |
getName()
Returns the (informational) name of the component. |
protected int |
inactivity_timer(OSPF_Neighbor nbr)
|
java.lang.String |
info()
Returns information regarding this component. |
protected void |
lsa_receive(OSPF_LSA lsa,
OSPF_Neighbor from)
Process every LSA received in LS update packet. |
protected void |
neighborDownEventHandler(int ifindex_,
NetAddress neighbor_,
Port inPort_)
Called back when a neighbor down event is received. |
protected void |
neighborUpEventHandler(int ifindex_,
NetAddress neighbor_,
Port inPort_)
Called back when a neighbor up event is received. |
protected void |
ospf_area_rt_install(OSPF_Area area)
Install area's vertex_list to routing table |
protected void |
ospf_dbdesc_seqnum_init(OSPF_Neighbor nbr)
|
protected OSPF_Interface |
ospf_if_lookup_by_addr(long addr)
|
protected void |
ospf_install_candidate(TreeMapQueue candidate,
OSPF_SPF_vertex w)
Install vertex w into candidate list the candidate list is sorted from the min cost to max cost |
protected void |
ospf_lsa_flood(OSPF_LSA lsa)
flood ospf_lsa within appropriate scope |
protected void |
ospf_lsa_flood(OSPF_LSA lsa,
int scope_type)
flood ospf_lsa within appropriate scope |
protected int |
ospf_lsa_has_link(OSPF_LSA w,
OSPF_LSA v)
Test whether there is a link in LSA w pointer to vertex v returns 1 if a link exists in w --> v |
protected void |
ospf_lsdb_install(OSPF_LSA new_lsa,
OSPF_Area area)
When installing more recent LSA, must detach less recent database copy from LS-lists of neighbors, and attach new one. |
protected void |
ospf_lsdb_install(OSPF_LSA new_lsa,
OSPF_LSA old_lsa)
|
protected void |
ospf_lsdb_install(OSPF_LSA new_lsa,
OSPF_LSA old_lsa,
int scope_type)
Install a new LSA into the database |
protected void |
ospf_lsdb_install(OSPF_LSA new_lsa,
OSPF_LSA old_lsa,
OSPF_Area area)
Replaces old_lsa with new_lsa and removes old_lsa from the retranslists in area. |
protected OSPF_LSA |
ospf_lsdb_lookup(int type,
int id,
int advrtr,
java.lang.Object scope)
ordinary lookup function |
protected Router_LSA |
ospf_make_router_lsa(OSPF_Area area)
|
protected void |
ospf_message_broadcast(int type,
java.lang.Object body,
int body_size,
OSPF_Interface oif)
Send the packet to every neighbor connected to this interfac. |
protected void |
ospf_message_send(int type,
java.lang.Object body,
int body_size,
long dst,
OSPF_Interface oif)
send the pkt to specific neighbor on specific if |
protected void |
ospf_nexthop_calculation(OSPF_Area area,
OSPF_SPF_vertex v,
OSPF_SPF_vertex w)
Calculate nexthop from root to vertex W. |
protected void |
ospf_possible_ack(OSPF_LSA received,
int ismore_recent,
OSPF_Interface oif,
int impliedack_flag,
int duplicate_flag,
int now_)
Possible ack action mentioned in sec 13 (5)(e) and (7)(b) |
protected void |
ospf_route_add(long dst,
OSPF_SPF_vertex new_en,
OSPF_Area area,
int now_)
Add a routing entry into RoutingTable and synchronize with drcl.inet.core.RT |
protected void |
ospf_router_lsa_flood(OSPF_Area area,
boolean check_)
|
protected int |
ospf_send_dbdesc(OSPF_Neighbor nbr)
Send the database description to the peer ref: 10.8 |
protected int |
ospf_send_hello(OSPF_Interface oif)
Sends hello pkts out at each functioning interface. |
protected int |
ospf_send_lsreq(OSPF_Neighbor nbr)
Send the LS request pkt to its peer. |
protected int |
ospf_send_single_hello(OSPF_Interface oif,
long dst)
used when receiving EVENT_IF_NEIGHBOR_UP, send only one hello packet to ensure two-way connection |
void |
ospf_set_area_id(int id_)
xxx: Specify the area id for this router (Needed to be modified) |
protected void |
ospf_spf_init(OSPF_Area area)
Initialization of calculatinf SPF |
protected static OSPF_SPF_vertex |
ospf_vertex_lookup(TreeMapQueue list,
long id)
Test whether a vertex exists in the list xxx: a hashtable would help the performance |
protected static OSPF_SPF_vertex |
ospf_vertex_lookup(java.util.Vector list,
long id)
Test whether a vertex exists in the list xxx: a hashtable would help the performance |
protected void |
process(java.lang.Object data_,
Port inPort_)
This method classifies inPort_ and delegates process of data
to the appropriate handler. |
void |
reset()
Resets the component for being used anew. |
protected void |
timeout(java.lang.Object evt_)
Handling timeout event. |
protected void |
transit_vertex_rtable_install(OSPF_SPF_vertex v,
OSPF_Area area,
int now_)
Hold the intermediate results on area routing table Install a new entry into routing table |
| Methods inherited from class drcl.inet.protocol.Routing |
addRTEntry, addRTEntry, addRTEntry, addRTEntry, addRTEntry, addRTEntry, addRTEntry, graftRTEntry, graftRTEntry, graftRTEntry, pruneRTEntry, pruneRTEntry, pruneRTEntry, removeAllRTEntries, removeRTEntry, removeRTEntry, replaceRTEntry, replaceRTEntry, retrieveAllRTEntries, retrieveBestRTEntryDest, retrieveRTEntry, retrieveRTEntryDest, retrieveRTEntrySrc |
| Methods inherited from class drcl.net.Module |
cancelTimeout, dataArriveAtUpPort, deliver, getAddress, removeDefaultDownPort, removeDefaultUpPort, removeTimerPort, setAddress, setTimeout, setTimeoutAt |
| Methods inherited from class drcl.DrclObj |
clone |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static boolean debug
public static boolean debug2
protected static final int HELLO
protected static final int DATABASE
protected static final int LS_REQUEST
protected static final int LS_UPDATE
protected static final int LS_ACK
protected int router_id
protected java.util.Vector area_list
protected java.util.Vector ospf_if_list
public static final int DEBUG_SAMPLE
public static final int DEBUG_NEIGHBOR
public static final int DEBUG_SEND
public static final int DEBUG_SPF
public static final int DEBUG_REFRESH
public static final int DEBUG_LSA
public static final int DEBUG_ACK
public static final int DEBUG_TIMEOUT
public static final int DEBUG_DETAIL
| Constructor Detail |
public OSPF()
| Method Detail |
public java.lang.String getName()
Component
getName in class Componentpublic java.lang.String[] getDebugLevelNames()
Component
getDebugLevelNames in class Componentpublic java.lang.String info()
Component
info in class Componentpublic void reset()
Component
reset in class Componentpublic void duplicate(java.lang.Object source_)
Component
duplicate in interface ObjectDuplicableduplicate in class Protocolprotected void timeout(java.lang.Object evt_)
timeout in class Moduleevt_ - event object got from the timer portModule.setTimeout(Object, double),
Module.setTimeoutAt(Object, double)
protected void process(java.lang.Object data_,
Port inPort_)
ModuleinPort_ and delegates process of data
to the appropriate handler. If a subclass decides to override this method,
then it should call super.process(data_, inPort_) to make those
handlers effective.
process in class ModuleModule.dataArriveAtUpPort(Object, drcl.comp.Port),
Module.dataArriveAtDownPort(Object, drcl.comp.Port),
Module.processOther(Object, drcl.comp.Port)
public void dataArriveAtDownPort(java.lang.Object data_,
Port downPort_)
dataArriveAtDownPort in class ModuledownPort_ - down port at which messages arrive.
protected void neighborUpEventHandler(int ifindex_,
NetAddress neighbor_,
Port inPort_)
neighborUpEventHandler in class Protocolifindex_ - index of the interface.Hello
protected void neighborDownEventHandler(int ifindex_,
NetAddress neighbor_,
Port inPort_)
Protocol
neighborDownEventHandler in class Protocolifindex_ - index of the interface.Protocol.createIFEventPort()protected int inactivity_timer(OSPF_Neighbor nbr)
protected void lsa_receive(OSPF_LSA lsa,
OSPF_Neighbor from)
protected Router_LSA ospf_make_router_lsa(OSPF_Area area)
protected void direct_acknowledge(OSPF_LSA lsa,
OSPF_Interface oif,
int now_,
boolean clone_)
protected void delayed_acknowledge(OSPF_LSA lsa)
protected void ospf_possible_ack(OSPF_LSA received,
int ismore_recent,
OSPF_Interface oif,
int impliedack_flag,
int duplicate_flag,
int now_)
protected void ospf_message_send(int type,
java.lang.Object body,
int body_size,
long dst,
OSPF_Interface oif)
protected void ospf_message_broadcast(int type,
java.lang.Object body,
int body_size,
OSPF_Interface oif)
protected int ospf_send_hello(OSPF_Interface oif)
protected int ospf_send_single_hello(OSPF_Interface oif,
long dst)
protected int ospf_send_dbdesc(OSPF_Neighbor nbr)
protected int ospf_send_lsreq(OSPF_Neighbor nbr)
protected void ospf_router_lsa_flood(OSPF_Area area,
boolean check_)
protected void ospf_lsa_flood(OSPF_LSA lsa)
protected void ospf_lsa_flood(OSPF_LSA lsa,
int scope_type)
protected OSPF_LSA ospf_lsdb_lookup(int type,
int id,
int advrtr,
java.lang.Object scope)
protected void ospf_lsdb_install(OSPF_LSA new_lsa,
OSPF_Area area)
protected void ospf_lsdb_install(OSPF_LSA new_lsa,
OSPF_LSA old_lsa,
OSPF_Area area)
protected void ospf_lsdb_install(OSPF_LSA new_lsa,
OSPF_LSA old_lsa)
protected void ospf_lsdb_install(OSPF_LSA new_lsa,
OSPF_LSA old_lsa,
int scope_type)
protected OSPF_Interface ospf_if_lookup_by_addr(long addr)
public void ospf_set_area_id(int id_)
protected void ospf_dbdesc_seqnum_init(OSPF_Neighbor nbr)
protected void ospf_spf_init(OSPF_Area area)
protected void ospf_nexthop_calculation(OSPF_Area area,
OSPF_SPF_vertex v,
OSPF_SPF_vertex w)
protected void ospf_area_rt_install(OSPF_Area area)
protected void transit_vertex_rtable_install(OSPF_SPF_vertex v,
OSPF_Area area,
int now_)
protected void ospf_route_add(long dst,
OSPF_SPF_vertex new_en,
OSPF_Area area,
int now_)
protected static OSPF_SPF_vertex ospf_vertex_lookup(java.util.Vector list,
long id)
protected static OSPF_SPF_vertex ospf_vertex_lookup(TreeMapQueue list,
long id)
protected void ospf_install_candidate(TreeMapQueue candidate,
OSPF_SPF_vertex w)
protected int ospf_lsa_has_link(OSPF_LSA w,
OSPF_LSA v)
|
J-Sim v1.2.1-p7 API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||