SSF.OS.BGP4
Class Monitor

java.lang.Object
  |
  +--SSF.OS.BGP4.Monitor

public class Monitor
extends java.lang.Object

Monitors a BGP instance for events of interest and reports them when they occur.


Field Summary
static int ADDED_ROUTE
          Indicates option to show when new routes are added to routing table.
static int AGGREG
          Indicates option to show messages related to route aggregation.
static int BIN_EVENT
          Indicates a bin event, which is a meta-event indicating how many of a certain event type occurred in a given time interval.
static java.lang.String[] bool_opt_names
          The names of the those boolean monitoring options which can be overridden by individual BGP instances.
static int BYTES_PER_INT
          Indicates option to specify the number of bytes use to encode an int.
static int CONN_ESTAB
          Indicates option to show when peer connections are established.
static int CONNRETRY_EXP
          Indicates option to show when ConnectRetry Timers expire.
static int CPU_BUSY
          Indications option to show CPU activity.
static int DEC_PROC
          Indicates option to show the steps of the Decision Process execution.
static int DONE_PROC
          Indicates option to show when processing of an event is done (including CPU delay).
static int DOP_CALC
          Indicates option to show degree of preference whenever calculated.
static int DUMP_FWD_TABLES
          Indicates option to dump the local forwarding table at simulation end.
static int DUMP_LOC_RIB
          Indicates option to dump the Loc-RIB at simulation end.
static int DUMP_RIBS_IN
          Indicates option to dump the Adj-RIBs-In at simulation end.
static int DUMP_RIBS_OUT
          Indicates option to dump the Adj-RIBs-Out at simulation end.
static int DUMP_STABILITY
          Indicates option to dump the stability state at simulation end.
static int EXEC_STATE
          Indicates option to show changes in the execution state of the BGP process.
static int EXT_UPDATE
          Indicates option to show when the external update process begins.
static int FWD_TABLE_ADD
          Indicates option to show when routes are added to the local forwarding table.
static int FWD_TABLE_RMV
          Indicates option to show when routes are removed from the local forwarding table.
static int FWD_TABLES
          Indicates option to print the local forwarding table each time BGP changes it.
static int HANDLE_EVENT
          Indicates option to show when BGP events are handled.
static int HANDLE_UPDATE
          Indicates option to show steps in the execution of the handle_update method in class BGPSession.
static int HOLD_EXP
          Indicates option to show when Hold Timers expire.
static int HOLD_VALUE
          Indicates option to show negotiated Hold Timer Interval values.
static int IBGP_CLUSTER
          Indicates option to show the configuration of IBGP clusters.
static int ID_DATA
          Indicates option to show AS number and prefix for each BGP router.
static int IN_POLICY
          Indicates option to show inbound policy rule filtering messages.
static int JITTER
          Indicates option to show jitter factor values at startup.
static int KA_EXP
          Indicates option to show when KeepAlive Timers expire.
static int KA_VALUE
          Indicates option to show Keep Alive Timer Interval values in use.
static int LOC_RIB
          Indicates option to print the Loc-RIB each time it changes.
static int MAX_RECORD_VAL
          Maximum integer value for record numbers.
static int MRAI_EXP
          Indicates option to show when Minimum Route Advertisement Interval Timers expire.
static int NB_INFO
          Indicates option to show neighbor info for each BGP speaker.
static int NO_MSG_WAITING
          Indicates option to show when Minimum Route Advertisement Interval Timer expires and there are no messages waiting.
static int num_bool_opts
          The number of boolean options kept in the opt array.
static int OUT_POLICY
          Indicates option to show outbound policy rule filtering messages.
static int RCV_KA
          Indicates option to show when KeepAlive messages are received.
static int RCV_NOTIF
          Indicates option to show when Notification messages are received.
static int RCV_OPEN
          Indicates option to show when Open messages are received.
static int RCV_UPDATE
          Indicates option to show when Update messages are received.
static int REFLECT
          Indicates option to show when route reflection is performed.
static int RFD
          Indicates option to show route flap damping information.
static int RIBS_IN
          Indicates option to print the Adj-RIBs-In each time it changes.
static int RIBS_OUT
          Indicates option to print the Adj-RIBs-Out each time it changes.
static int SET_HOLD
          Indicates option to show when Hold Timers are set.
static int SET_KA
          Indicates option to show when KeepAlive Timers are set.
static int SET_MRAI
          Indicates option to show when Minimum Route Advertisement Interval Timers are set.
static int SND_KA
          Indicates option to show when KeepAlive messages are sent.
static int SND_NOTIF
          Indicates option to show when Notification messages are sent.
static int SND_OPEN
          Indicates option to show when Open messages are sent.
static int SND_UP
          Indicates option to show when Update messages are sent (brief version).
static int SND_UPDATE
          Indicates option to show when Update messages are sent.
static int SOCKET_EVENT
          Indicates option to show when notable Sockets events occur.
static int START_EVENT
          Indicates option to show when BGP Start events occur.
static int STATE_CHANGE
          Indicates option to show when BGP state changes occur (according to the BGP finite state machine).
static int STOP_EVENT
          Indicates option to show when BGP Stop events occur.
static int TIMER_CONFIG
          Indicates option to show manually (DML) configured BGP attributes.
static int TRANSCLOSE
          Indicates option to show when Transport Connection Closed events occur.
static int TRANSFAIL
          Indicates option to show when Transport Connection Open Failed events occur.
static int TRANSFATAL
          Indicates option to show when Transport Fatal Error events occur.
static int TRANSOPEN
          Indicates option to show when Transport Connection Open events occur.
static int USE_RADIX_TREES
          Indicates option to use radix trees for the simulation.
static boolean usenhi
          Whether or not to use full NHI addressing.
static int USENHI
          Indicates option to use NHI addressing when possible.
 boolean wrapup
          Whether or not any wrap-up functions need to be performed on behalf of this monitor at the end of the simulation.
 java.io.BufferedOutputStream zmrtTableOut
          Used for writing the routing table in Zebra-MRT format.
 java.io.BufferedOutputStream zmrtUpsOut
          Used for writing update records in Zebra-MRT format.
 
Constructor Summary
Monitor(BGPSession b)
          Constructs a monitor for the given BGP session instance.
 
Method Summary
static int aspath2bytes(Route rte, byte[] bytes, int bindex, boolean usenhi)
          Converts a simple AS path (no set or sequence information) to a series of bytes.
static int bgpid2bytes(IPaddress bgpid, byte[] bytes, int bindex)
          Converts a BGP ID to bytes.
static int bytes2aspath(java.lang.StringBuffer aspath, byte[] bytes, int bindex, boolean usenhi)
          Converts a series of bytes to a simple AS path (no set or sequence information).
static int bytes2bgpid(java.lang.StringBuffer bgpid, byte[] bytes, int bindex)
          Converts a series of four bytes into a BGP ID.
static int bytes2cl(java.lang.StringBuffer cl, byte[] bytes, int bindex)
          Converts a series of bytes to a cluster list.
static int bytes2int(byte[] bytes, int bindex)
          Converts a series of bytes to an integer.
static int bytes2int(byte[] bytes, int bindex, int bytesPerInt)
          Converts a series of bytes to an integer.
static int bytes2ipprefix(java.lang.StringBuffer ipprefix, byte[] bytes, int bindex, boolean usenhi)
          Converts a series of bytes to an IP address prefix.
static int bytes2nh(java.lang.StringBuffer nh, byte[] bytes, int bindex)
          Converts a series of bytes to an NH address.
static int bytes2update(java.lang.StringBuffer msg, byte[] bytes, int bindex, boolean usenhi)
          Converts a series of bytes into the NLRI and withdrawn routes parts of an update message.
static int cl2bytes(ClusterList cl, byte[] bytes, int bindex)
          Converts a cluster list to a series of bytes.
 void config(com.renesys.raceway.DML.Configuration cfg)
          Configures monitoring options set in DML for a single BGP instance.
 void debugmsg(int typ, int caseno, PeerEntry peer, int i, int i2, java.lang.Object o, java.lang.Object o2)
          Records a debugging message regarding a specific type of event.
 void dump_zmrt_table()
          Dumps the routing table (RIB) to a file in Zebra-MRT format.
 void dump_zmrt_update(UpdateMessage msg)
          Dumps a given update to a file in Zebra-MRT format.
static int get_bytes_per_int()
          Returns the number of bytes that are used to encode an integer.
 void handle_delayed_msgs()
          Handles debugging messages that were delayed because the simulation was not yet fully configured at the time the attempt to record them was made.
 void init()
          Initializes the monitor, getting references to appropriate data structures needed for recording output information.
static int int2bytes(int iii, byte[] bytes, int bindex)
          Converts an integer to bytes, returning the number of bytes used.
static int int2bytes(int iii, int bytesPerInt, byte[] bytes, int bindex)
          Converts an integer to bytes, returning the number of bytes used.
static int int2bytes(java.lang.String intstr, byte[] bytes, int bindex)
          Converts an integer, given as a string, to bytes, returning the number of bytes used.
static int ipprefix2bytes(IPaddress ipprefix, byte[] bytes, int bindex, boolean usenhi)
          Converts an IP address prefix to a series of bytes.
 void msg(int msgtype)
          Each variation of the msg method handles the reporting of a message about the BGP session's execution.
 void msg(int msgtype, double d)
           
 void msg(int msgtype, int caseno)
           
 void msg(int msgtype, int caseno, double d)
           
 void msg(int msgtype, int caseno, int i)
           
 void msg(int msgtype, int caseno, int i, int i2)
           
 void msg(int msgtype, int caseno, int i, int i2, java.lang.Object o)
           
 void msg(int msgtype, int caseno, int i, java.lang.Object o)
           
 void msg(int msgtype, int caseno, java.lang.Object o)
           
 void msg(int msgtype, int caseno, java.lang.Object o, java.lang.Object o2)
           
 void msg(int msgtype, int caseno, PeerEntry pe)
           
 void msg(int msgtype, int caseno, PeerEntry pe, double d)
           
 void msg(int msgtype, int caseno, PeerEntry pe, int i)
           
 void msg(int msgtype, int caseno, PeerEntry pe, int i, int i2)
           
 void msg(int msgtype, int caseno, PeerEntry pe, int i, java.lang.Object o)
           
 void msg(int msgtype, int caseno, PeerEntry pe, java.lang.Object o)
           
 void msg(int msgtype, int caseno, PeerEntry pe, java.lang.Object o, java.lang.Object o2)
           
 void msg(int msgtype, java.lang.Object o)
           
 void msg(int msgtype, PeerEntry pe)
           
 void msg(int msgtype, PeerEntry pe, int i)
           
 void msg(int msgtype, PeerEntry pe, int i, int i2)
           
 void msg(int msgtype, PeerEntry pe, java.lang.Object o)
           
 void msg(int msgtype, PeerEntry pe, java.lang.Object o, java.lang.Object o2)
           
static int nh2bytes(java.lang.String nh, byte[] bytes, int bindex)
          Converts an NH address to a series of bytes.
static void set_bytes_per_int(int bpi)
          Sets the number of bytes to be used when encoding and decoding integers.
static int update2bytes(UpdateMessage msg, byte[] bytes, int bindex, boolean usenhi)
          Converts the NLRI and withdrawn routes parts of an update message to a series of bytes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

num_bool_opts

public static final int num_bool_opts
The number of boolean options kept in the opt array.

See Also:
Constant Field Values

bool_opt_names

public static final java.lang.String[] bool_opt_names
The names of the those boolean monitoring options which can be overridden by individual BGP instances. Some boolean monitoring options, such as use_nhi_addressing cannot be overridden by individual BGP instances, and are treated separately.


DUMP_STABILITY

public static final int DUMP_STABILITY
Indicates option to dump the stability state at simulation end.

See Also:
Constant Field Values

START_EVENT

public static final int START_EVENT
Indicates option to show when BGP Start events occur.

See Also:
Constant Field Values

STOP_EVENT

public static final int STOP_EVENT
Indicates option to show when BGP Stop events occur.

See Also:
Constant Field Values

CPU_BUSY

public static final int CPU_BUSY
Indications option to show CPU activity.

See Also:
Constant Field Values

TRANSOPEN

public static final int TRANSOPEN
Indicates option to show when Transport Connection Open events occur.

See Also:
Constant Field Values

TRANSCLOSE

public static final int TRANSCLOSE
Indicates option to show when Transport Connection Closed events occur.

See Also:
Constant Field Values

TRANSFAIL

public static final int TRANSFAIL
Indicates option to show when Transport Connection Open Failed events occur.

See Also:
Constant Field Values

TRANSFATAL

public static final int TRANSFATAL
Indicates option to show when Transport Fatal Error events occur.

See Also:
Constant Field Values

RCV_OPEN

public static final int RCV_OPEN
Indicates option to show when Open messages are received.

See Also:
Constant Field Values

RCV_UPDATE

public static final int RCV_UPDATE
Indicates option to show when Update messages are received.

See Also:
Constant Field Values

SND_UPDATE

public static final int SND_UPDATE
Indicates option to show when Update messages are sent.

See Also:
Constant Field Values

RCV_KA

public static final int RCV_KA
Indicates option to show when KeepAlive messages are received.

See Also:
Constant Field Values

SND_KA

public static final int SND_KA
Indicates option to show when KeepAlive messages are sent.

See Also:
Constant Field Values

RCV_NOTIF

public static final int RCV_NOTIF
Indicates option to show when Notification messages are received.

See Also:
Constant Field Values

SND_NOTIF

public static final int SND_NOTIF
Indicates option to show when Notification messages are sent.

See Also:
Constant Field Values

SND_OPEN

public static final int SND_OPEN
Indicates option to show when Open messages are sent.

See Also:
Constant Field Values

SET_KA

public static final int SET_KA
Indicates option to show when KeepAlive Timers are set.

See Also:
Constant Field Values

SET_HOLD

public static final int SET_HOLD
Indicates option to show when Hold Timers are set.

See Also:
Constant Field Values

SET_MRAI

public static final int SET_MRAI
Indicates option to show when Minimum Route Advertisement Interval Timers are set.

See Also:
Constant Field Values

KA_EXP

public static final int KA_EXP
Indicates option to show when KeepAlive Timers expire.

See Also:
Constant Field Values

CONNRETRY_EXP

public static final int CONNRETRY_EXP
Indicates option to show when ConnectRetry Timers expire.

See Also:
Constant Field Values

HOLD_EXP

public static final int HOLD_EXP
Indicates option to show when Hold Timers expire.

See Also:
Constant Field Values

MRAI_EXP

public static final int MRAI_EXP
Indicates option to show when Minimum Route Advertisement Interval Timers expire.

See Also:
Constant Field Values

EXEC_STATE

public static final int EXEC_STATE
Indicates option to show changes in the execution state of the BGP process. That is, it shows when it starts and stops running.

See Also:
Constant Field Values

BIN_EVENT

public static final int BIN_EVENT
Indicates a bin event, which is a meta-event indicating how many of a certain event type occurred in a given time interval.

See Also:
Constant Field Values

HANDLE_UPDATE

public static final int HANDLE_UPDATE
Indicates option to show steps in the execution of the handle_update method in class BGPSession.

See Also:
Constant Field Values

ADDED_ROUTE

public static final int ADDED_ROUTE
Indicates option to show when new routes are added to routing table.

See Also:
Constant Field Values

HANDLE_EVENT

public static final int HANDLE_EVENT
Indicates option to show when BGP events are handled.

See Also:
Constant Field Values

DOP_CALC

public static final int DOP_CALC
Indicates option to show degree of preference whenever calculated.

See Also:
Constant Field Values

DEC_PROC

public static final int DEC_PROC
Indicates option to show the steps of the Decision Process execution.

See Also:
Constant Field Values

DONE_PROC

public static final int DONE_PROC
Indicates option to show when processing of an event is done (including CPU delay).

See Also:
Constant Field Values

SND_UP

public static final int SND_UP
Indicates option to show when Update messages are sent (brief version).

See Also:
Constant Field Values

EXT_UPDATE

public static final int EXT_UPDATE
Indicates option to show when the external update process begins.

See Also:
Constant Field Values

ID_DATA

public static final int ID_DATA
Indicates option to show AS number and prefix for each BGP router.

See Also:
Constant Field Values

RFD

public static final int RFD
Indicates option to show route flap damping information.

See Also:
Constant Field Values

NB_INFO

public static final int NB_INFO
Indicates option to show neighbor info for each BGP speaker.

See Also:
Constant Field Values

FWD_TABLES

public static final int FWD_TABLES
Indicates option to print the local forwarding table each time BGP changes it.

See Also:
Constant Field Values

JITTER

public static final int JITTER
Indicates option to show jitter factor values at startup.

See Also:
Constant Field Values

AGGREG

public static final int AGGREG
Indicates option to show messages related to route aggregation.

See Also:
Constant Field Values

NO_MSG_WAITING

public static final int NO_MSG_WAITING
Indicates option to show when Minimum Route Advertisement Interval Timer expires and there are no messages waiting.

See Also:
PeerEntry.waiting_adv, Constant Field Values

CONN_ESTAB

public static final int CONN_ESTAB
Indicates option to show when peer connections are established.

See Also:
Constant Field Values

STATE_CHANGE

public static final int STATE_CHANGE
Indicates option to show when BGP state changes occur (according to the BGP finite state machine).

See Also:
Constant Field Values

TIMER_CONFIG

public static final int TIMER_CONFIG
Indicates option to show manually (DML) configured BGP attributes.

See Also:
Constant Field Values

FWD_TABLE_ADD

public static final int FWD_TABLE_ADD
Indicates option to show when routes are added to the local forwarding table.

See Also:
Constant Field Values

FWD_TABLE_RMV

public static final int FWD_TABLE_RMV
Indicates option to show when routes are removed from the local forwarding table.

See Also:
Constant Field Values

SOCKET_EVENT

public static final int SOCKET_EVENT
Indicates option to show when notable Sockets events occur.

See Also:
Constant Field Values

REFLECT

public static final int REFLECT
Indicates option to show when route reflection is performed.

See Also:
Constant Field Values

IBGP_CLUSTER

public static final int IBGP_CLUSTER
Indicates option to show the configuration of IBGP clusters.

See Also:
Constant Field Values

HOLD_VALUE

public static final int HOLD_VALUE
Indicates option to show negotiated Hold Timer Interval values.

See Also:
Constant Field Values

KA_VALUE

public static final int KA_VALUE
Indicates option to show Keep Alive Timer Interval values in use.

See Also:
Constant Field Values

IN_POLICY

public static final int IN_POLICY
Indicates option to show inbound policy rule filtering messages.

See Also:
Constant Field Values

OUT_POLICY

public static final int OUT_POLICY
Indicates option to show outbound policy rule filtering messages.

See Also:
Constant Field Values

DUMP_FWD_TABLES

public static final int DUMP_FWD_TABLES
Indicates option to dump the local forwarding table at simulation end.

See Also:
Constant Field Values

DUMP_RIBS_IN

public static final int DUMP_RIBS_IN
Indicates option to dump the Adj-RIBs-In at simulation end.

See Also:
Constant Field Values

DUMP_LOC_RIB

public static final int DUMP_LOC_RIB
Indicates option to dump the Loc-RIB at simulation end.

See Also:
Constant Field Values

DUMP_RIBS_OUT

public static final int DUMP_RIBS_OUT
Indicates option to dump the Adj-RIBs-Out at simulation end.

See Also:
Constant Field Values

RIBS_IN

public static final int RIBS_IN
Indicates option to print the Adj-RIBs-In each time it changes.

See Also:
Constant Field Values

LOC_RIB

public static final int LOC_RIB
Indicates option to print the Loc-RIB each time it changes.

See Also:
Constant Field Values

RIBS_OUT

public static final int RIBS_OUT
Indicates option to print the Adj-RIBs-Out each time it changes.

See Also:
Constant Field Values

USENHI

public static final int USENHI
Indicates option to use NHI addressing when possible.

See Also:
Constant Field Values

BYTES_PER_INT

public static final int BYTES_PER_INT
Indicates option to specify the number of bytes use to encode an int.

See Also:
Constant Field Values

USE_RADIX_TREES

public static final int USE_RADIX_TREES
Indicates option to use radix trees for the simulation.

See Also:
Constant Field Values

MAX_RECORD_VAL

public static final int MAX_RECORD_VAL
Maximum integer value for record numbers.

See Also:
Constant Field Values

usenhi

public static boolean usenhi
Whether or not to use full NHI addressing. Using it means that AS numbers, IP prefixes and IP addresses will be converted to NHI addresses in output whenever possible.


wrapup

public boolean wrapup
Whether or not any wrap-up functions need to be performed on behalf of this monitor at the end of the simulation. It is true only if at least one of the dump options has been set.


zmrtUpsOut

public java.io.BufferedOutputStream zmrtUpsOut
Used for writing update records in Zebra-MRT format.


zmrtTableOut

public java.io.BufferedOutputStream zmrtTableOut
Used for writing the routing table in Zebra-MRT format.

Constructor Detail

Monitor

public Monitor(BGPSession b)
Constructs a monitor for the given BGP session instance.

Parameters:
b - The BGPSession with which this monitor is associated.
Method Detail

set_bytes_per_int

public static void set_bytes_per_int(int bpi)
Sets the number of bytes to be used when encoding and decoding integers. It also recalculates the value of the maximum encodable integer. This method is typically called by a data player which will be decoding data records.

Parameters:
bpi - The desired number of bytes per integer.
See Also:
VerbosePlayer

get_bytes_per_int

public static int get_bytes_per_int()
Returns the number of bytes that are used to encode an integer.

Returns:
the number of bytes used to encode an integer

config

public void config(com.renesys.raceway.DML.Configuration cfg)
            throws com.renesys.raceway.DML.configException
Configures monitoring options set in DML for a single BGP instance. The global configurations will have (should have) been set before this method is called.

Parameters:
cfg - Contains attribute-value pairs for each configurable BGP option attribute
Throws:
com.renesys.raceway.DML.configException - if any of the calls to find or findSingle throw such an exception.

dump_zmrt_table

public void dump_zmrt_table()
Dumps the routing table (RIB) to a file in Zebra-MRT format. The Zebra-MRT format is very similar to the MRT format, but does have a few differences. The results can be processed with MRT's route_btoa tool.


dump_zmrt_update

public void dump_zmrt_update(UpdateMessage msg)
Dumps a given update to a file in Zebra-MRT format. The Zebra-MRT format is very similar to the MRT format, but does have a few differences. The results can be processed with MRT's route_btoa tool.

Parameters:
msg - The update message to be dumped.

init

public void init()
Initializes the monitor, getting references to appropriate data structures needed for recording output information.


msg

public final void msg(int msgtype)
Each variation of the msg method handles the reporting of a message about the BGP session's execution. The message is often used to report the occurrence of particular events or to dump the state of particular aspects of the BGP session.

Parameters:
msgtype - A constant indicating the type of message.

msg

public final void msg(int msgtype,
                      int caseno)
See Also:
msg(int)

msg

public final void msg(int msgtype,
                      int caseno,
                      int i)
See Also:
msg(int)

msg

public final void msg(int msgtype,
                      int caseno,
                      int i,
                      int i2)
See Also:
msg(int)

msg

public final void msg(int msgtype,
                      int caseno,
                      int i,
                      int i2,
                      java.lang.Object o)
See Also:
msg(int)

msg

public final void msg(int msgtype,
                      int caseno,
                      int i,
                      java.lang.Object o)
See Also:
msg(int)

msg

public final void msg(int msgtype,
                      int caseno,
                      PeerEntry pe)
See Also:
msg(int)

msg

public final void msg(int msgtype,
                      int caseno,
                      java.lang.Object o)
See Also:
msg(int)

msg

public final void msg(int msgtype,
                      int caseno,
                      PeerEntry pe,
                      int i)
See Also:
msg(int)

msg

public final void msg(int msgtype,
                      int caseno,
                      PeerEntry pe,
                      int i,
                      int i2)
See Also:
msg(int)

msg

public final void msg(int msgtype,
                      int caseno,
                      PeerEntry pe,
                      java.lang.Object o)
See Also:
msg(int)

msg

public final void msg(int msgtype,
                      int caseno,
                      PeerEntry pe,
                      java.lang.Object o,
                      java.lang.Object o2)
See Also:
msg(int)

msg

public final void msg(int msgtype,
                      int caseno,
                      java.lang.Object o,
                      java.lang.Object o2)
See Also:
msg(int)

msg

public final void msg(int msgtype,
                      int caseno,
                      PeerEntry pe,
                      int i,
                      java.lang.Object o)
See Also:
msg(int)

msg

public final void msg(int msgtype,
                      PeerEntry pe)
See Also:
msg(int)

msg

public final void msg(int msgtype,
                      java.lang.Object o)
See Also:
msg(int)

msg

public final void msg(int msgtype,
                      PeerEntry pe,
                      int i)
See Also:
msg(int)

msg

public final void msg(int msgtype,
                      PeerEntry pe,
                      int i,
                      int i2)
See Also:
msg(int)

msg

public final void msg(int msgtype,
                      PeerEntry pe,
                      java.lang.Object o)
See Also:
msg(int)

msg

public final void msg(int msgtype,
                      PeerEntry pe,
                      java.lang.Object o,
                      java.lang.Object o2)
See Also:
msg(int)

msg

public final void msg(int msgtype,
                      double d)
See Also:
msg(int)

msg

public final void msg(int msgtype,
                      int caseno,
                      double d)
See Also:
msg(int)

msg

public final void msg(int msgtype,
                      int caseno,
                      PeerEntry pe,
                      double d)
See Also:
msg(int)

int2bytes

public static int int2bytes(java.lang.String intstr,
                            byte[] bytes,
                            int bindex)
Converts an integer, given as a string, to bytes, returning the number of bytes used. A preset value is used for number of bytes used to encode an integer.


int2bytes

public static int int2bytes(int iii,
                            byte[] bytes,
                            int bindex)
Converts an integer to bytes, returning the number of bytes used. A preset value is used for number of bytes used to encode an integer.


int2bytes

public static int int2bytes(int iii,
                            int bytesPerInt,
                            byte[] bytes,
                            int bindex)
Converts an integer to bytes, returning the number of bytes used. The number of bytes used to encode an integer is given as a parameter.


bytes2int

public static int bytes2int(byte[] bytes,
                            int bindex)
Converts a series of bytes to an integer. A preset value is used for number of bytes used to encode an integer.


bytes2int

public static int bytes2int(byte[] bytes,
                            int bindex,
                            int bytesPerInt)
Converts a series of bytes to an integer. The number of bytes used to encode an integer is given as a parameter.


nh2bytes

public static int nh2bytes(java.lang.String nh,
                           byte[] bytes,
                           int bindex)
Converts an NH address to a series of bytes. The first byte always indicates the total number of bytes to follow it.

Parameters:
nh - The NH address to convert to bytes.
bytes - A byte array in which to place the results.
bindex - The index into the given byte array at which to begin placing the results.
Returns:
the total number of bytes after conversion (including size byte)

bytes2nh

public static int bytes2nh(java.lang.StringBuffer nh,
                           byte[] bytes,
                           int bindex)
Converts a series of bytes to an NH address. The first byte must indicate the total number of bytes to follow it.

Parameters:
nh - A StringBuffer into which the results will be placed. It must be initialized to the empty string.
bytes - The byte array to convert to an NH address.
bindex - The index into the given byte array from which to begin converting.
Returns:
the total number of bytes used in the conversion (including size byte)

ipprefix2bytes

public static int ipprefix2bytes(IPaddress ipprefix,
                                 byte[] bytes,
                                 int bindex,
                                 boolean usenhi)
Converts an IP address prefix to a series of bytes. The conversion may be done on either the traditional IP address format or the equivalent NHI address. If NHI addressing is used, the first byte indicates the total number of bytes which follow it, except in the case of the special 'bogus' address, in which case the first byte is always 111, under the presumption that the number of bytes required by an NHI address will never be anywhere near 111.

Parameters:
ipprefix - The IP address prefix to convert to bytes.
bytes - A byte array in which to place the results.
bindex - The index into the given byte array at which to begin placing the results.
usenhi - Whether or not to use NHI addressing.
Returns:
the total number of bytes after conversion (including size byte)

bytes2ipprefix

public static int bytes2ipprefix(java.lang.StringBuffer ipprefix,
                                 byte[] bytes,
                                 int bindex,
                                 boolean usenhi)
Converts a series of bytes to an IP address prefix. The usenhi member variable determines whether or not traditional IP address format or the equivalent NHI address is being used. If NHI addressing is used, the first byte indicates the total number of bytes which follow it. In either case, the results are returned as a string.

Parameters:
ipprefix - A StringBuffer into which the results will be placed. It must be initialized to the empty string.
bytes - The byte array to convert to an IP address.
bindex - The index into the given byte array from which to begin converting.
usenhi - Whether or not to use NHI addressing.
Returns:
the total number of bytes used in the conversion (including size byte)

bgpid2bytes

public static int bgpid2bytes(IPaddress bgpid,
                              byte[] bytes,
                              int bindex)
Converts a BGP ID to bytes. The conversion always uses the traditional IP address format, never the equivalent NHI address.

Parameters:
bgpid - The BGP ID (IP address) to convert to bytes.
bytes - A byte array in which to place the results.
bindex - The index into the given byte array at which to begin placing the results.
Returns:
the total number of bytes produced by the conversion (always 4)

bytes2bgpid

public static int bytes2bgpid(java.lang.StringBuffer bgpid,
                              byte[] bytes,
                              int bindex)
Converts a series of four bytes into a BGP ID. The conversion always uses the traditional IP address format, never the equivalent NHI address.

Parameters:
bgpid - A StringBuffer into which the results will be placed. It must be initialized to the empty string.
bytes - The byte array to convert to a BGP ID.
bindex - The index into the given byte array from which to begin converting.
Returns:
the total number of bytes used in the conversion (always 4)

aspath2bytes

public static int aspath2bytes(Route rte,
                               byte[] bytes,
                               int bindex,
                               boolean usenhi)
Converts a simple AS path (no set or sequence information) to a series of bytes. The conversion may be done using either traditional AS numbers (integers) or AS-NHI addresses. If NHI addressing is used, each AS-NHI value is preceded by one byte which indicates the total number of bytes in that AS-NHI. The very first byte in the overall conversion represents the total number of ASes in the path list.

Parameters:
bytes - A byte array in which to place the results.
bindex - The index into the given byte array at which to begin placing the results.
usenhi - Whether or not to use NHI addressing.
Returns:
the total number of bytes after conversion (including size byte)

bytes2aspath

public static int bytes2aspath(java.lang.StringBuffer aspath,
                               byte[] bytes,
                               int bindex,
                               boolean usenhi)
Converts a series of bytes to a simple AS path (no set or sequence information). The conversion may result in either traditional AS numbers (integers) or AS-NHI addresses. If NHI addressing is used, each AS-NHI value must be preceded by one byte which indicates the total number of bytes in that AS-NHI. The very first byte must represent the total number of ASes in the path list.

Parameters:
aspath - A StringBuffer into which the results will be placed. It must be initialized to the empty string.
bytes - The byte array to convert to a simple AS path.
bindex - The index into the given byte array from which to begin converting.
usenhi - Whether or not to use NHI addressing.
Returns:
the total number of bytes used in the conversion (including size byte)

cl2bytes

public static int cl2bytes(ClusterList cl,
                           byte[] bytes,
                           int bindex)
Converts a cluster list to a series of bytes. The first byte indicates the total number of bytes which follow it (number of cluster IDs in the list).

Parameters:
cl - The cluster list to convert to bytes.
bytes - A byte array in which to place the results.
bindex - The index into the given byte array at which to begin placing the results.
Returns:
the total number of bytes after conversion (including size byte)

bytes2cl

public static int bytes2cl(java.lang.StringBuffer cl,
                           byte[] bytes,
                           int bindex)
Converts a series of bytes to a cluster list. The first byte must indicate the total number of bytes which follow it (number of cluster IDs in the list).

Parameters:
cl - A StringBuffer into which the results will be placed. It must be initialized to the empty string.
bytes - The byte array to convert to a cluster list.
bindex - The index into the given byte array from which to begin converting.
Returns:
the total number of bytes used in the conversion (including size byte)

update2bytes

public static int update2bytes(UpdateMessage msg,
                               byte[] bytes,
                               int bindex,
                               boolean usenhi)
Converts the NLRI and withdrawn routes parts of an update message to a series of bytes. The conversion may be done using either traditional IP address prefixes or NHI addresses. If NHI addressing is used, each address starts with a bytes indicating how many bytes are used to represent the address (excluding the 'size' byte itself).

Parameters:
msg - The update message to convert to bytes.
bytes - A byte array in which to place the results.
bindex - The index into the given byte array at which to begin placing the results.
usenhi - Whether or not to use NHI addressing.
Returns:
the total number of bytes after conversion (including size bytes)

bytes2update

public static int bytes2update(java.lang.StringBuffer msg,
                               byte[] bytes,
                               int bindex,
                               boolean usenhi)
Converts a series of bytes into the NLRI and withdrawn routes parts of an update message. The conversion may be done using either encoded traditional IP address prefixes or encoded NHI addresses. If NHI addressing is used, each address must start with a byte indicating how many bytes are used to represent the address (excluding the 'size' byte itself). In either case, the very first byte must indicate the total number of encoded NLRI, and the first byte following the encoded NLRI must indicate the total number of withdrawn routes.

Parameters:
msg - A StringBuffer into which the results will be placed. It must be initialized to the empty string.
bytes - The byte array to convert to an update message representation.
bindex - The index into the given byte array at which to begin placing the results.
usenhi - Whether or not to use NHI addressing.
Returns:
the total number of bytes used in the conversion (including size bytes)

handle_delayed_msgs

public void handle_delayed_msgs()
Handles debugging messages that were delayed because the simulation was not yet fully configured at the time the attempt to record them was made.


debugmsg

public void debugmsg(int typ,
                     int caseno,
                     PeerEntry peer,
                     int i,
                     int i2,
                     java.lang.Object o,
                     java.lang.Object o2)
Records a debugging message regarding a specific type of event.

Parameters:
typ - Indicates the type of situation that the message is reporting on.
caseno - A case number, applicable to certain message types.
peer - The entry for a peer associated with this message.
i - Numeric data whose meaning varies depending on msg type.
i2 - Numeric data whose meaning varies depending on msg type.
o - An object whose meaning varies depending on msg type.
o2 - An object whose meaning varies depending on msg type.