|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--SSF.OS.ProtocolSession
|
+--SSF.OS.BGP4.BGPSession
The BGP-4 inter-domain routing protocol. Despite the name of the class, each instance does not represent an individual peering session between two BGP speakers, but a BGP-4 protocol session running on a single router. In other words, an instance of this class is an instance of the protocol running on a router.
| Field Summary | |
static byte |
ACTIVE
Indicates the Active state in the BGP finite state machine (FSM). |
boolean |
alive
Whether or not the BGP process represented by this BGPSession object is actually alive. |
java.lang.String |
as_nh
The NHI address prefix uniquely identifying this BGP speaker's AS. |
int |
as_num
The AS number of this BGP speaker's AS. |
IPaddress |
as_prefix
The IP address prefix which is representative of this BGP's AS. |
boolean |
auto_advertise
Whether or not this BGP speaker should automatically advertise its AS's network prefix to all neighbors. |
IPaddress |
bgp_id
The BGP Identifier for this BGP speaker. |
static int |
BGPrun
Indicates an event that causes the BGP process to start up. |
static int |
BGPstart
Indicates the BGP Start event type. |
static int |
BGPstop
Indicates the BGP Stop event type. |
long |
cluster_num
If this is a route reflector, the number of the cluster of which it is a member. |
static byte |
CONNECT
Indicates the Connect state in the BGP finite state machine (FSM). |
long |
connretry_interval
The amount of time (in clock ticks) that should elapse between attempts to establish a session with a particular peer. |
static int |
ConnRetryTimerExp
Indicates the ConnectRetry Timer Expired event type. |
java.util.HashMap |
dampedRoutes
Keeps track of damped routes. |
Debug |
debug
A helper to manage debugging. |
static boolean |
distrib_done
Whether or not it has yet been determined if the simulator is running in a distributed fashion or on a single computer. |
static long |
EBGP_MRAI_DEFAULT
The "system" default Minimum Route Advertisement Timer Interval (in clock ticks) for external neighbors. |
static byte |
ESTABLISHED
Indicates the Established state in the BGP finite state machine (FSM). |
static java.lang.String[] |
eventNames
String representations of the different BGP event types. |
RoutingTable |
fwd_table
The forwarding table, kept in the IP protocol session, which is the "live" table used for lookups when this router forwards packets (currently, IP is responsible for doing the forwarding). |
static long |
HOLD_TIMER_DEFAULT
Default Hold Timer Interval (in clock ticks) to be used with peers for whom it is not specifically configured. |
static int |
HoldTimerExp
Indicates the Hold Timer Expired event type. |
static long |
IBGP_MRAI_DEFAULT
The "system" default Minimum Route Advertisement Timer Interval (in clock ticks) for internal neighbors. |
static byte |
IDLE
Indicates the Idle state in the BGP finite state machine (FSM). |
IP |
ip
A reference to the instance of IP running on the local router. |
static long |
KEEP_ALIVE_DEFAULT
Default Keep Alive Timer Interval (in clock ticks) to be used with peers for whom it is not specifically configured. |
double |
keep_alive_jitter
Jitter factor for Keep Alive Interval. |
static int |
KeepAliveTimerExp
Indicates the KeepAlive Timer Expired event type. |
tcpSocket |
listensocket
A socket listening for connection requests from (potential) peers (both internal and external). |
LocRIB |
loc_rib
The Loc-RIB. |
long |
masoi
The Minimum AS Origination Interval: the minimum amount of time (in clock ticks) that must elapse between successive advertisements of update messages that report changes within this BGP speaker's AS. |
double |
masoi_jitter
Jitter factor for Minimum AS Origination Interval. |
EventTimer |
masoiTimer
The Minimum AS Origination Timer. |
Monitor |
mon
A monitor to record events of interest. |
double |
mrai_jitter
Jitter factor for Minimum Route Advertisement Interval. |
static int |
MRAITimerExp
Indicates that an MRAI Timer expired. |
PeerEntry[] |
nbs
An array of data for each neighboring router (potential BGP peer). |
java.lang.String |
nh
The NH part of the NHI address for this BGP's router. |
int[] |
nhparts
An array containing the individual numbers which make up the BGP speaker's NHI address. |
static int |
NoticeUpdate
Indicates that an Update message arrived. |
static byte |
OPENCONFIRM
Indicates the OpenConfirm state in the BGP finite state machine (FSM). |
static byte |
OPENSENT
Indicates the OpenSent state in the BGP finite state machine (FSM). |
java.util.ArrayList |
outbuf
A buffer, which is a FIFO queue, which holds arbitrary processes to be executed (in the form of a Continuation objects) immediately after the current BGP event (from the incoming buffer, inbuf) is handled. |
static int |
PORT_NUM
The well-known port number for BGP. |
static int |
PROTOCOL_NUM
The well-known BGP protocol number. |
static boolean |
rate_limit_by_dest
Whether or not rate-limiting should be applied on a per-peer, per-destination basis. |
static int |
ReadTransConnOpen
Indicates the BGP Read Transport Connection Open event type. |
static int |
RecvKeepAlive
Indicates the Receive KeepAlive Message event type. |
static int |
RecvNotification
Indicates the Receive Notification Message event type. |
static int |
RecvOpen
Indicates the Receive Open Message event type. |
static int |
RecvUpdate
Indicates the Receive Update Message event type. |
boolean |
reflector
Whether or not this instance of BGP serves as a route reflector. |
boolean |
rfd
Whether route flap damping is turned on for this BGP speaker. |
RandomStream |
rng1
A random number generator for workload generation. |
RandomStream |
rng2
A random number generator for uses other than workload generation. |
Continuation |
RSCC
A read socket close Continuation. |
Continuation |
SCC
A socket close Continuation. |
PeerEntry |
self
A special peer entry which represents the local BGP speaker. |
socketMaster |
socketmaster
A reference to the Sockets protocol running on the local router. |
static java.lang.String[] |
statestr
An array of string versions of the state names. |
static Net |
topnet
A reference to the top-level Net. |
static int |
TransConnClose
Indicates the BGP Transport Connection Closed event type. |
static int |
TransConnOpen
Indicates the BGP Transport Connection Open event type. |
static int |
TransConnOpenFail
Indicates the BGP Transport Connection Open Failed event type. |
static int |
TransFatalError
Indicates the BGP Transport Fatal Error event type. |
static java.lang.String |
version
The developer's version string of this implementation of BGP-4. |
static int |
WriteTransConnOpen
Indicates the BGP Write Transport Connection Open event type. |
static int |
WriteTransConnOpenFail
Indicates the BGP Write Transport Connection Open Failed event type. |
| Fields inherited from class SSF.OS.ProtocolSession |
name, use |
| Constructor Summary | |
BGPSession()
Constructs a BGP protocol session. |
|
| Method Summary | |
void |
config(com.renesys.raceway.DML.Configuration cfg)
Sets configurable values for BGP. |
void |
decision_process_1(java.util.ArrayList infolist)
Runs Phase 1 of the Decision Process, which is responsible for calculating the degree of preference of newly added or updated routes. |
java.util.ArrayList |
decision_process_2(java.util.ArrayList changedroutes,
boolean dampReuse)
Runs Phase 2 of the Decision Process, which is responsible for selecting which routes (from Adj-RIBs-In) should be installed in Loc-RIB. |
void |
decision_process_3(java.util.ArrayList locribchanges)
Runs Phase 3 of the Decision Process, which is responsible for disseminating routes to peers. |
void |
die()
Kills the BGP process. |
int |
dop(Route rte)
Calculates the degree of preference of a route. |
static java.lang.String |
event2str(int eventnum)
Returns a string representation of a given BGP event number. |
void |
external_update(java.util.HashMap wds_table,
java.util.HashMap ads_table)
Tries to send update messages to each external peer if there is any new route information in Adj-RIBs-Out to be shared with them. |
void |
force_send(Message msg,
PeerEntry peer)
Sends a message immediately without incurring any CPU delay. |
void |
force_send(Message msg,
PeerEntry peer,
int casenum)
Sends a message immediately. |
void |
ftadd(RouteInfo info)
Adds a route to the local forwarding table. |
void |
ftrmv(RouteInfo info)
Removes a route to the local forwarding table. |
boolean |
handle_event()
This process handles both externally and internally generated BGP events. |
void |
handle_mrai_exp(TimeoutMessage tmsg,
PeerEntry peer)
Handles an MRAI Timer expiration. |
void |
handle_update(UpdateMessage msg)
This method takes all necessary action when an update message is received. |
void |
init()
Creates an SSF process whose primary purpose is to perform certain one-time-only BGP setup tasks. |
void |
listen()
Wait for a completed socket connection (with a neighbor). |
static long |
nh2cl(java.lang.String nh)
Returns a unique cluster number associated with a given NHI prefix address. |
int |
nh2peerind(java.lang.String nh)
Returns the index of a peer given it's NH address. |
long |
now()
Returns the current simulation time in ticks. |
double |
nowsec()
Returns the current simulation time in seconds. |
boolean |
push(ProtocolMessage message,
ProtocolSession fromSession)
This process optionally imposes a processing delay for certain BGP events, then passes them on to the receive method to be handled. |
void |
remove_all_routes(PeerEntry peer)
Removes from the Loc-RIB all routes learned from a given peer, then runs Phases 2 and 3 of the Decision Process to replace the routes with backups (if possible), and update neighbors with the changes. |
void |
reset_timer(PeerEntry peer,
int timertype)
Resets the indicated type of timer for the given peer (if applicable). |
void |
restart()
Restarts the BGP process. |
void |
routeAddedBy(RoutingInfo rinfo,
java.lang.String protocolName)
Notification that the named protocol has added a new entry to the forwarding table on this host. |
void |
routeDeletedBy(RoutingInfo rinfo,
java.lang.String protocolName)
Notification that the named protocol has removed an entry from the forwarding table on this host. |
void |
send(Message msg,
PeerEntry peer)
Generic procedure to take any kind of BGP message and push it onto the protocol below this one in the stack. |
void |
send(Message msg,
PeerEntry peer,
int casenum)
Generic procedure to take any kind of BGP message and push it onto the protocol below this one in the stack. |
void |
set_timer(Timer timer)
Sets the given BGP timer and also notes the time at which it was set. |
void |
set_timer(Timer timer,
long amount)
Sets the given BGP timer and also notes the time at which it was set. |
static double |
ticks2secs(long numticks)
Convenience method to convert simulation logical clock ticks into seconds. |
void |
try_send_update(UpdateMessage msg,
java.util.ArrayList senders,
PeerEntry peer)
Handles the sending of an update message. |
java.lang.String |
version()
Returns the developer's version string of this BGP-4 implementation. |
| Methods inherited from class SSF.OS.ProtocolSession |
close, closed, debugIdentifier, inGraph, open, opened, pushAfterDelay, pushAfterDelayFailed, setGraph |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String version
public static final int PROTOCOL_NUM
public static final int PORT_NUM
public static final long HOLD_TIMER_DEFAULT
public static final long KEEP_ALIVE_DEFAULT
public static final long EBGP_MRAI_DEFAULT
public static final long IBGP_MRAI_DEFAULT
public static final byte IDLE
public static final byte CONNECT
public static final byte ACTIVE
public static final byte OPENSENT
public static final byte OPENCONFIRM
public static final byte ESTABLISHED
public static final java.lang.String[] statestr
public static final int BGPrun
public static final int BGPstart
public static final int BGPstop
public static final int TransConnOpen
public static final int TransConnClose
public static final int TransConnOpenFail
public static final int TransFatalError
public static final int ConnRetryTimerExp
public static final int HoldTimerExp
public static final int KeepAliveTimerExp
public static final int RecvOpen
public static final int RecvKeepAlive
public static final int RecvUpdate
public static final int RecvNotification
public static final int MRAITimerExp
public static final int NoticeUpdate
public static final int ReadTransConnOpen
public static final int WriteTransConnOpen
public static final int WriteTransConnOpenFail
public static final java.lang.String[] eventNames
public boolean alive
public static Net topnet
public socketMaster socketmaster
public tcpSocket listensocket
public RoutingTable fwd_table
public IP ip
public java.lang.String as_nh
Util.AS_descriptor.
AS_descriptorpublic int as_num
public IPaddress as_prefix
public java.lang.String nh
public int[] nhparts
public IPaddress bgp_id
public LocRIB loc_rib
public boolean reflector
public long cluster_num
public PeerEntry[] nbs
public long connretry_interval
public long masoi
public double keep_alive_jitter
public double masoi_jitter
public double mrai_jitter
public static boolean rate_limit_by_dest
public EventTimer masoiTimer
public java.util.ArrayList outbuf
public PeerEntry self
public boolean auto_advertise
public Debug debug
public Monitor mon
public static boolean distrib_done
public RandomStream rng1
public RandomStream rng2
public boolean rfd
public java.util.HashMap dampedRoutes
public Continuation SCC
public Continuation RSCC
| Constructor Detail |
public BGPSession()
| Method Detail |
public static long nh2cl(java.lang.String nh)
nh - The NH address to be converted.
public static java.lang.String event2str(int eventnum)
eventnum - An integer representing a BGP event.
public void ftadd(RouteInfo info)
info - Route information about the route to be added.public void ftrmv(RouteInfo info)
info - Route information about the route to be removed.
public void routeAddedBy(RoutingInfo rinfo,
java.lang.String protocolName)
routeAddedBy in interface FIBChangeListenerrinfo - Information about the route added to the FIB.protocolName - The name of the protocol that added the route.
public void routeDeletedBy(RoutingInfo rinfo,
java.lang.String protocolName)
routeDeletedBy in interface FIBChangeListenerrinfo - Information about the route deleted from the FIB.protocolName - The name of the protocol that deleted the route.
public void config(com.renesys.raceway.DML.Configuration cfg)
throws com.renesys.raceway.DML.configException
init method.
config in interface com.renesys.raceway.DML.Configurableconfig in class ProtocolSessioncfg - contains the values for configurable BGP parameters
com.renesys.raceway.DML.configException - if any of the calls to find
or findSingle throw such an
exception.public void init()
init in class ProtocolSessionpublic final void listen()
public long now()
public double nowsec()
public static double ticks2secs(long numticks)
numticks - The number of ticks to be converted to seconds.
public final java.lang.String version()
version in class ProtocolSessionpublic void set_timer(Timer timer)
timer - The timer to be set.
public void set_timer(Timer timer,
long amount)
timer - The timer to be set.amount - The length of time which the timer will be set for.
public void reset_timer(PeerEntry peer,
int timertype)
peer - The peer entry for the peer with whom the timer
is associated (if applicable).timertype - The type of timer to be reset.public final int nh2peerind(java.lang.String nh)
public void handle_update(UpdateMessage msg)
msg - An update message received by this BGP speaker.public final int dop(Route rte)
rte - A route for which to calculate the degree of preference.
public final void decision_process_1(java.util.ArrayList infolist)
infolist - A list of route information for which to calculate the
degrees of preference.public void remove_all_routes(PeerEntry peer)
peer - The peer whose routes are to be invalidated.
public final java.util.ArrayList decision_process_2(java.util.ArrayList changedroutes,
boolean dampReuse)
changedroutes - A list of info on recent route changes.dampReuse - Whether called by dampReuseTimer callback.
public final void decision_process_3(java.util.ArrayList locribchanges)
locribchanges - A list of changes to the Loc-RIB.
public void external_update(java.util.HashMap wds_table,
java.util.HashMap ads_table)
wds_table - A table of NLRI of withdrawn routes which need to be
sent.ads_table - A table of routes which need to be advertised.
public void handle_mrai_exp(TimeoutMessage tmsg,
PeerEntry peer)
public final void send(Message msg,
PeerEntry peer)
msg - The BGP message to be sent out.peer - The entry for the peer to whom the message should be sent.
public final void send(Message msg,
PeerEntry peer,
int casenum)
msg - The BGP message to be sent out.peer - The entry for the peer to whom the message should be sent.casenum - Indicates info about this send for event recording.
public final void force_send(Message msg,
PeerEntry peer)
sendmsg, except that it is a public method. The
intended use of this method is by widgets (fake protocol sessions) on top
of BGP in the protocol stack whose only purpose is to inject certain
events at certain times. It is used in some validation tests and may also
be used for experimental purposes.
msg - The BGP message to be sent out.peer - The entry for the peer to whom the message should be sent.
public final void force_send(Message msg,
PeerEntry peer,
int casenum)
force_send(Message,PeerEntry).
msg - The BGP message to be sent out.peer - The entry for the peer to whom the message should be sent.casenum - Indicates info about this send for event recording.
public final void try_send_update(UpdateMessage msg,
java.util.ArrayList senders,
PeerEntry peer)
msg - The update message to send.senders - The NHI addresses of the senders of each route in the
update message; this information is required if the route
cannot be advertised right away.peer - The peer to whom the message should be sent.
public boolean push(ProtocolMessage message,
ProtocolSession fromSession)
receive method to be handled. All
thirteen types of events (both externally and internally generated) pass
through this method in the BGP flow of control. For externally generated
events, push is not called by the protocol directly below BGP
(which is Sockets) to pass a message up, but is called by BGP methods
which are reading from sockets. If the option to model processing delay
is in use, this method uses a queue to delay certain events/messages
accordingly. Message ordering is always preserved for all messages coming
through push.
push in class ProtocolSessionmessage - The incoming event/message.fromSession - The protocol session from which the message came.
public boolean handle_event()
public void die()
public void restart()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||