prophet::Encounter Class Reference

Section 4.4.4, p. More...

#include <Encounter.h>

Inheritance diagram for prophet::Encounter:

prophet::ExpirationHandler

List of all members.

Public Types

enum  state_t {
  UNDEFINED_STATE = 0, WAIT_NB, SYNSENT, SYNRCVD,
  ESTAB, WAIT_DICT, WAIT_RIB, OFFER,
  CREATE_DR, SEND_DR, REQUEST, WAIT_INFO
}

Public Member Functions

 Encounter (const Link *nexthop, Oracle *oracle, u_int16_t instance)
 Constructor.
 Encounter (const Encounter &e)
 Copy constructor.
 ~Encounter ()
 Destructor.
void hello_interval_changed ()
 Callback to inform this instance that the hello_interval parameter has changed.
bool receive_tlv (ProphetTLV *tlv)
 Callback for this instance to receive TLVs received from peer by the host bundling system.
void handle_timeout ()
 Callback for timeout handler, either due to peer failure or unacceptable delay in messaging.
void handle_bundle_received (const Bundle *b)
 Callback for tracking which Bundle requests are outstanding.
bool operator< (const Encounter &e) const
 Operators.
u_int16_t remote_instance () const
 Accessors.
u_int16_t local_instance () const
 Accessors.
const char * remote_eid () const
 Accessors.
const Linknexthop () const
 Accessors.
state_t state () const
 Accessors.
const char * state_str () const
 Accessors.
bool neighbor_gone () const
 Accessors.
u_int time_remaining () const
 Accessors.

Static Public Member Functions

static const char * state_to_str (state_t st)

Protected Member Functions

bool dispatch_tlv (BaseTLV *tlv)
 TLV event handlers.
bool handle_hello_tlv (BaseTLV *hello)
 TLV event handlers.
bool handle_ribd_tlv (BaseTLV *ribd)
 TLV event handlers.
bool handle_rib_tlv (BaseTLV *rib)
 TLV event handlers.
bool handle_offer_tlv (BaseTLV *offer)
 TLV event handlers.
bool handle_response_tlv (BaseTLV *response)
 TLV event handlers.
bool send_hello (HelloTLV::hello_hf_t hf, ProphetTLV::header_result_t hr=ProphetTLV::NoSuccessAck, u_int32_t tid=0)
 Outbound message generators.
bool send_dictionary_rib (ProphetTLV::header_result_t hr=ProphetTLV::NoSuccessAck, u_int32_t tid=0)
 Outbound message generators.
bool send_offer (ProphetTLV::header_result_t hr=ProphetTLV::NoSuccessAck, u_int32_t tid=0)
 Outbound message generators.
bool send_response (ProphetTLV::header_result_t hr=ProphetTLV::NoSuccessAck, u_int32_t tid=0)
 Outbound message generators.
bool send_tlv (ProphetTLV *tlv)
 Outbound message generators.

Protected Attributes

Oracle *const oracle_
 collection of Prophet information
u_int16_t local_instance_
 local's instance for remote
u_int16_t remote_instance_
 remote's instance for local
u_int32_t tid_
 transaction id from peer's most recent TLV
u_int32_t next_tid_
 used to generate TID for outbound TLVs
u_int32_t timeout_
 most milliseconds expected between TLVs
const Linknext_hop_
 Link object for this encounter.
ProphetTLVtlv_
 most recent message received from peer
const bool synsender_
 whether active or passive during Hello phase
state_t state_
 which phase of Prophet protocol for this end
bool synsent_
 whether hello phase has sent SYN or SYNACK
bool estab_
 whether hello phase has been completed
volatile bool neighbor_gone_
 whether session has died
Dictionary local_ribd_
 16 bit index lookup to translate routes
Dictionary remote_ribd_
 16 bit index lookup for remote's routes
BundleOfferList remote_offers_
 in-memory rep of remote's offer
BundleResponseList local_response_
 Bundle requests sent to peer.
Table remote_nodes_
 in-memory representation of remote's RIB
u_int hello_rate_
 simple flow control for Hello messages (ACK, etc)
u_int32_t data_sent_
 timestamp of last TLV sent
u_int32_t data_rcvd_
 timestamp of last TLV received
Alarmalarm_
 callback registration for timeout handler


Detailed Description

Section 4.4.4, p.

28 The Routing Information Base lists the destinations a node knows of, and the delivery predictabilities it has associated with them. This information is needed by the PRoPHET algorithm to make decisions on routing and forwarding.

Section 4.4.3, p. 27 The Routing Information Base Dictionary includes the list of addresses used in making routing decisions. The referents remain constant for the duration of a session over a link where the instance numbers remain the same and can be used by both the Routing Information Base messages and the bundle offer messages.

Track the state for the Prophet protocol throughout the duration of this encounter between the local node and this remote.

Definition at line 50 of file Encounter.h.


Member Enumeration Documentation

Enumerator:
UNDEFINED_STATE 
WAIT_NB  Waiting for Neighbor.
SYNSENT  Sent SYN, waiting for SYNACK.
SYNRCVD  Received SYN, sent SYNACK, waiting for ACK.
ESTAB  Prophet link established with remote.
WAIT_DICT  Listener mode of bundle-passing phase.
WAIT_RIB  Listener rcvd RIBD, waiting for RIB.
OFFER  Listener sent Offer, waiting for Request.
CREATE_DR  Initiator creates and sends RIBD and RIB.
SEND_DR  Initiator sent RIBD and RIB, waiting for Offer.
REQUEST  Initiator sent Request, waiting for Bundles.
WAIT_INFO  All phases now complete, waiting for timer or ACK.

Definition at line 53 of file Encounter.h.


Constructor & Destructor Documentation

prophet::Encounter::Encounter ( const Link nexthop,
Oracle *  oracle,
u_int16_t  instance 
)

Constructor.

prophet::Encounter::Encounter ( const Encounter e  ) 

Copy constructor.

prophet::Encounter::~Encounter (  ) 

Destructor.


Member Function Documentation

bool prophet::Encounter::dispatch_tlv ( BaseTLV tlv  )  [protected]

TLV event handlers.

void prophet::Encounter::handle_bundle_received ( const Bundle b  ) 

Callback for tracking which Bundle requests are outstanding.

bool prophet::Encounter::handle_hello_tlv ( BaseTLV hello  )  [protected]

TLV event handlers.

bool prophet::Encounter::handle_offer_tlv ( BaseTLV offer  )  [protected]

TLV event handlers.

bool prophet::Encounter::handle_response_tlv ( BaseTLV response  )  [protected]

TLV event handlers.

bool prophet::Encounter::handle_rib_tlv ( BaseTLV rib  )  [protected]

TLV event handlers.

bool prophet::Encounter::handle_ribd_tlv ( BaseTLV ribd  )  [protected]

TLV event handlers.

void prophet::Encounter::handle_timeout (  )  [virtual]

Callback for timeout handler, either due to peer failure or unacceptable delay in messaging.

Implements prophet::ExpirationHandler.

void prophet::Encounter::hello_interval_changed (  ) 

Callback to inform this instance that the hello_interval parameter has changed.

u_int16_t prophet::Encounter::local_instance (  )  const [inline]

Accessors.

Definition at line 110 of file Encounter.h.

References local_instance_.

bool prophet::Encounter::neighbor_gone (  )  const [inline]

Accessors.

Definition at line 115 of file Encounter.h.

References neighbor_gone_.

const Link* prophet::Encounter::nexthop (  )  const [inline]

Accessors.

Definition at line 112 of file Encounter.h.

References next_hop_.

bool prophet::Encounter::operator< ( const Encounter e  )  const [inline]

Operators.

Definition at line 102 of file Encounter.h.

References remote_instance_.

bool prophet::Encounter::receive_tlv ( ProphetTLV tlv  ) 

Callback for this instance to receive TLVs received from peer by the host bundling system.

Encounter assumes ownership of memory pointed to by tlv. Return true if message processed successfully. Return false upon fault (peering session died).

const char* prophet::Encounter::remote_eid (  )  const [inline]

Accessors.

Definition at line 111 of file Encounter.h.

References next_hop_, and prophet::Link::remote_eid().

u_int16_t prophet::Encounter::remote_instance (  )  const [inline]

Accessors.

Definition at line 109 of file Encounter.h.

References remote_instance_.

bool prophet::Encounter::send_dictionary_rib ( ProphetTLV::header_result_t  hr = ProphetTLV::NoSuccessAck,
u_int32_t  tid = 0 
) [protected]

Outbound message generators.

bool prophet::Encounter::send_hello ( HelloTLV::hello_hf_t  hf,
ProphetTLV::header_result_t  hr = ProphetTLV::NoSuccessAck,
u_int32_t  tid = 0 
) [protected]

Outbound message generators.

bool prophet::Encounter::send_offer ( ProphetTLV::header_result_t  hr = ProphetTLV::NoSuccessAck,
u_int32_t  tid = 0 
) [protected]

Outbound message generators.

bool prophet::Encounter::send_response ( ProphetTLV::header_result_t  hr = ProphetTLV::NoSuccessAck,
u_int32_t  tid = 0 
) [protected]

Outbound message generators.

bool prophet::Encounter::send_tlv ( ProphetTLV tlv  )  [protected]

Outbound message generators.

state_t prophet::Encounter::state (  )  const [inline]

Accessors.

Definition at line 113 of file Encounter.h.

References state_.

const char* prophet::Encounter::state_str (  )  const [inline]

Accessors.

Definition at line 114 of file Encounter.h.

References state_, and state_to_str().

static const char* prophet::Encounter::state_to_str ( state_t  st  )  [inline, static]

Definition at line 68 of file Encounter.h.

References CASE, CREATE_DR, ESTAB, OFFER, REQUEST, SEND_DR, SYNRCVD, SYNSENT, WAIT_DICT, WAIT_INFO, WAIT_NB, and WAIT_RIB.

Referenced by state_str().

u_int prophet::Encounter::time_remaining (  )  const [inline]

Accessors.

Definition at line 116 of file Encounter.h.

References alarm_, and prophet::Alarm::time_remaining().


Member Data Documentation

callback registration for timeout handler

Definition at line 191 of file Encounter.h.

Referenced by time_remaining().

u_int32_t prophet::Encounter::data_rcvd_ [protected]

timestamp of last TLV received

Definition at line 190 of file Encounter.h.

u_int32_t prophet::Encounter::data_sent_ [protected]

timestamp of last TLV sent

Definition at line 189 of file Encounter.h.

whether hello phase has been completed

Definition at line 181 of file Encounter.h.

simple flow control for Hello messages (ACK, etc)

Definition at line 188 of file Encounter.h.

u_int16_t prophet::Encounter::local_instance_ [protected]

local's instance for remote

Definition at line 171 of file Encounter.h.

Referenced by local_instance().

Bundle requests sent to peer.

Definition at line 186 of file Encounter.h.

16 bit index lookup to translate routes

Definition at line 183 of file Encounter.h.

whether session has died

Definition at line 182 of file Encounter.h.

Referenced by neighbor_gone().

const Link* prophet::Encounter::next_hop_ [protected]

Link object for this encounter.

Definition at line 176 of file Encounter.h.

Referenced by nexthop(), and remote_eid().

u_int32_t prophet::Encounter::next_tid_ [protected]

used to generate TID for outbound TLVs

Definition at line 174 of file Encounter.h.

Oracle* const prophet::Encounter::oracle_ [protected]

collection of Prophet information

Definition at line 170 of file Encounter.h.

u_int16_t prophet::Encounter::remote_instance_ [protected]

remote's instance for local

Definition at line 172 of file Encounter.h.

Referenced by operator<(), and remote_instance().

in-memory representation of remote's RIB

Definition at line 187 of file Encounter.h.

in-memory rep of remote's offer

Definition at line 185 of file Encounter.h.

16 bit index lookup for remote's routes

Definition at line 184 of file Encounter.h.

which phase of Prophet protocol for this end

Definition at line 179 of file Encounter.h.

Referenced by state(), and state_str().

whether active or passive during Hello phase

Definition at line 178 of file Encounter.h.

whether hello phase has sent SYN or SYNACK

Definition at line 180 of file Encounter.h.

u_int32_t prophet::Encounter::tid_ [protected]

transaction id from peer's most recent TLV

Definition at line 173 of file Encounter.h.

u_int32_t prophet::Encounter::timeout_ [protected]

most milliseconds expected between TLVs

Definition at line 175 of file Encounter.h.

most recent message received from peer

Definition at line 177 of file Encounter.h.


The documentation for this class was generated from the following file:

Generated on Fri Jan 30 09:43:16 2009 for DTN Reference Implementation by  doxygen 1.5.8