Vanetza
 
Loading...
Searching...
No Matches
vanetza::geonet::Router Class Reference

#include <router.hpp>

Public Types

enum class  PacketDropReason {
  Parse_Basic_Header , Parse_Common_Header , Parse_Secured_Header , Parse_Extended_Header ,
  ITS_Protocol_Version , Decap_Unsuccessful_Non_Strict , Decap_Unsuccessful_Strict , Hop_Limit ,
  Payload_Size , Security_Entity_Missing
}
 Reason for packet drop used by drop hook. More...
 
enum class  ForwardingStopReason { Hop_Limit , Source_PDR , Sender_PDR , Outside_Destination_Area }
 
typedef std::unique_ptr< DataRequestDataRequestPtr
 
typedef std::unique_ptr< PduPduPtr
 
typedef std::unique_ptr< DownPacketDownPacketPtr
 
typedef std::unique_ptr< UpPacket > UpPacketPtr
 
using PendingPacketForwarding = PendingPacket< GbcPdu, const MacAddress & >
 

Public Member Functions

 Router (Runtime &, const MIB &)
 
DataConfirm request (const ShbDataRequest &, DownPacketPtr)
 Request to send payload per single hop broadcast (SHB). If security is enabled, the message gets encapsulated in a security envelope. Returns whether data was valid to be sent.
 
DataConfirm request (const GbcDataRequest &, DownPacketPtr)
 Request to send payload per GeoBroadcast (GBC). If security is enabled, the message gets encapsulated in a security envelope. Returns whether data was valid to be sent.
 
DataConfirm request (const GucDataRequest &, DownPacketPtr)
 
DataConfirm request (const GacDataRequest &, DownPacketPtr)
 
DataConfirm request (const TsbDataRequest &, DownPacketPtr)
 
void indicate (UpPacketPtr, const MacAddress &sender, const MacAddress &destination)
 Handle the received packet on network layer. Packet handling involves these steps:
 
void update_position (const PositionFix &)
 Update router's local position vector.
 
void set_transport_handler (UpperProtocol proto, TransportInterface *ifc)
 Register a transport protocol handler.
 
void set_security_entity (security::SecurityEntity *entity)
 Register security entity used when itsGnSecurity is enabled.
 
void set_access_interface (dcc::RequestInterface *ifc)
 Register access layer interface.
 
void set_dcc_field_generator (DccFieldGenerator *dcc)
 Register generator for DCC-MCO fields.
 
void set_address (const Address &)
 Set Router's own GeoNetworking address.
 
const MIBget_mib () const
 Get Management Information Base (MIB)
 
const CbfPacketBufferget_cbf_buffer () const
 Get the Contention-Based-Forwarding buffer.
 
const LocationTableget_location_table () const
 Get the LocationTable. The table holds information about neighbouring ITS-Routers.
 
const LongPositionVectorget_local_position_vector () const
 Get the local position vector. This vector describes the current position of the router.
 
bool outside_sectorial_contention_area (const MacAddress &sender, const MacAddress &forwarder) const
 Check if router is outside the sectorial contention area See TS 102 636-4-1 v1.2.3 section E.4 and figure E.2 for details.
 
void set_random_seed (std::uint_fast32_t seed)
 Set seed for internal random number generator (RNG) RNG is used e.g. for random Beacon jitter.
 
NextHop forwarding_algorithm_selection (PendingPacketForwarding &&, const LinkLayer *ll=nullptr)
 

Public Attributes

Hook< PacketDropReasonpacket_dropped
 When a packet is dropped, this Hook is invoked.
 
Hook< ForwardingStopReason > forwarding_stopped
 When packet forwarding is stopped, this Hook is invoked.
 

Private Types

typedef std::map< UpperProtocol, TransportInterface * > transport_map_t
 

Private Member Functions

void on_beacon_timer_expired ()
 Send Beacon packet to all neighbours with updated position vector. Only to be called when the beacon timer expires.
 
void reset_beacon_timer ()
 Reschedule timer for next Beacon transmission Timer will be scheduled according to MIB's Beacon timer settings.
 
void reset_beacon_timer (Clock::duration next)
 Reschedule timer for next Beacon transmission.
 
void indicate_basic (IndicationContextBasic &)
 Process BasicHeader at packet indication.
 
void indicate_common (IndicationContext &, const BasicHeader &)
 Process CommonHeader at packet indication.
 
void indicate_extended (IndicationContext &, const CommonHeader &)
 Process ExtendedHeader at packet indication.
 
void indicate_secured (IndicationContextBasic &, const BasicHeader &)
 Process SecuredMessage at packet indication.
 
bool process_extended (const ExtendedPduConstRefs< BeaconHeader > &, const UpPacket &, const LinkLayer &ll)
 Process ExtendedHeader information. Update router's LocationTable and neighbour relationship.
 
bool process_extended (const ExtendedPduConstRefs< ShbHeader > &, const UpPacket &, const LinkLayer &ll)
 Process ExtendedHeader information. Update router's LocationTable and neighbour relationship. Pass packet up to transport layer for further processing.
 
bool process_extended (const ExtendedPduConstRefs< GeoBroadcastHeader > &, const UpPacket &, const LinkLayer &ll)
 Process ExtendedHeader information. Update router's LocationTable and neighbour relationship. Pass packet up to transport layer for further processing. Forward packets.
 
void flush_broadcast_forwarding_buffer ()
 Send all packets in the broadcast forwarding buffer with expired waiting time.
 
void flush_unicast_forwarding_buffer (const Address &addr)
 Send all matching packets in the unicast forwarding buffer with expired waiting time.
 
void execute_media_procedures (CommunicationProfile)
 Executes media specific functionalities Details are described in TS 102 636-4-2.
 
void execute_itsg5_procedures ()
 Executes ITS-G5 media specific procedures Details are described in TS 102 636-4-2.
 
void pass_down (const MacAddress &, PduPtr, DownPacketPtr)
 Pass down the packet to the access layer.
 
void pass_down (const dcc::DataRequest &, PduPtr, DownPacketPtr)
 Send packet using the information in the DataRequest. The packet is formed using the data in PDU and payload.
 
void pass_up (const DataIndication &, UpPacketPtr)
 Pass packet up to the transport layer.
 
bool decide_pass_up (bool within_destination, const GeoBroadcastHeader &gbc)
 Decide if GBC packet shall be passed up to transport layer.
 
void detect_duplicate_address (const Address &source, const MacAddress &sender)
 Helper method to handle duplicate addresses. If own address collides with the address of a received packet Router's address is set to a new random address.
 
bool detect_duplicate_packet (const Address &source, SequenceNumber sn)
 Detect duplicate packets See EN 302 636-4-1 v1.3.1 Annex A.2.
 
NextHop greedy_forwarding (PendingPacketForwarding &&)
 Determine next hop for greedy forwarding. See EN 302 636-4-1 v1.3.1 Annex E.2.
 
NextHop non_area_contention_based_forwarding (PendingPacketForwarding &&, const MacAddress *sender)
 Determine next hop for non-area contention-based forwarding See EN 302 636-4-1 v1.3.1 Annex E.3.
 
NextHop area_contention_based_forwarding (PendingPacketForwarding &&, const MacAddress *sender)
 Determine next hop for area contention-based forwarding See EN 302 636-4-1 v1.3.1 Annex F.3.
 
units::Duration timeout_cbf (units::Length distance) const
 Determine CBF buffering time for a packet. Complies to EN 302 636-4-1 v1.3.1 Annex E.3 (non-area CBF, eq. E.1) and F.3 (area CBF, eq. F.1)
 
units::Duration timeout_cbf (const MacAddress &sender) const
 Determine (area) CBF buffering time for a packet from a sender.
 
NextHop area_advanced_forwarding (PendingPacketForwarding &&, const LinkLayer *sender)
 Determine next hop for area advanced forwarding See EN 302 636-4-1 v1.3.1 Annex F.4.
 
void dispatch_repetition (const DataRequestVariant &, DownPacketPtr)
 Callback function for dispatching a packet repetition. Invoked by Repeater when a scheduled repetition is due.
 
DownPacketPtr encap_packet (ItsAid aid, Pdu &pdu, DownPacketPtr packet)
 Encaspulate a packet according to security profile.
 
std::unique_ptr< ShbPducreate_shb_pdu (const ShbDataRequest &)
 Create an initialized Single-Hop-Broadcast PDU.
 
std::unique_ptr< BeaconPducreate_beacon_pdu ()
 Create an initialzed Beacon PDU.
 
std::unique_ptr< GbcPducreate_gbc_pdu (const GbcDataRequest &)
 Create an initialized GeoBroadcast PDU.
 

Private Attributes

const MIBm_mib
 
Runtimem_runtime
 
dcc::RequestInterfacem_request_interface
 
DccFieldGeneratorm_dcc_field_generator
 
security::SecurityEntitym_security_entity
 
transport_map_t m_transport_ifcs
 
LocationTable m_location_table
 
PacketBuffer m_bc_forward_buffer
 
PacketBuffer m_uc_forward_buffer
 
CbfPacketBuffer m_cbf_buffer
 
LongPositionVector m_local_position_vector
 
SequenceNumber m_local_sequence_number
 
Repeater m_repeater
 
std::mt19937 m_random_gen
 
GbcMemory m_gbc_memory
 

Detailed Description

Router is the central entity for GeoNet communication

Incoming and outgoing GeoNet packets are handled by the router. It may even dispatch own packets (beacons) if necessary.

This implementation follows EN 302 636-4-1 v1.3.1

Definition at line 73 of file router.hpp.

Member Typedef Documentation

◆ DataRequestPtr

typedef std::unique_ptr<DataRequest> vanetza::geonet::Router::DataRequestPtr

Definition at line 76 of file router.hpp.

◆ DownPacketPtr

typedef std::unique_ptr<DownPacket> vanetza::geonet::Router::DownPacketPtr

Definition at line 78 of file router.hpp.

◆ PduPtr

typedef std::unique_ptr<Pdu> vanetza::geonet::Router::PduPtr

Definition at line 77 of file router.hpp.

◆ PendingPacketForwarding

◆ transport_map_t

typedef std::map<UpperProtocol, TransportInterface*> vanetza::geonet::Router::transport_map_t
private

Definition at line 263 of file router.hpp.

◆ UpPacketPtr

typedef std::unique_ptr<UpPacket> vanetza::geonet::Router::UpPacketPtr

Definition at line 79 of file router.hpp.

Member Enumeration Documentation

◆ ForwardingStopReason

enum class vanetza::geonet::Router::ForwardingStopReason
strong

Definition at line 99 of file router.hpp.

◆ PacketDropReason

Reason for packet drop used by drop hook.

Definition at line 84 of file router.hpp.

Constructor & Destructor Documentation

◆ Router()

vanetza::geonet::Router::Router ( Runtime rt,
const MIB mib 
)

Definition at line 129 of file router.cpp.

◆ ~Router()

vanetza::geonet::Router::~Router ( )

Definition at line 162 of file router.cpp.

Member Function Documentation

◆ area_advanced_forwarding()

NextHop vanetza::geonet::Router::area_advanced_forwarding ( PendingPacketForwarding &&  packet,
const LinkLayer sender 
)
private

Determine next hop for area advanced forwarding See EN 302 636-4-1 v1.3.1 Annex F.4.

Parameters
pdu
payload
lloptional link-layer control info (if not source operations)
Returns
next hop

Definition at line 892 of file router.cpp.

◆ area_contention_based_forwarding()

NextHop vanetza::geonet::Router::area_contention_based_forwarding ( PendingPacketForwarding &&  packet,
const MacAddress sender 
)
private

Determine next hop for area contention-based forwarding See EN 302 636-4-1 v1.3.1 Annex F.3.

Parameters
pdu
payload
senderoptional sender MAC address (if not first hop)
Returns
next hop

Definition at line 846 of file router.cpp.

◆ create_beacon_pdu()

std::unique_ptr< BeaconPdu > vanetza::geonet::Router::create_beacon_pdu ( )
private

Create an initialzed Beacon PDU.

Returns
PDU object

Definition at line 1225 of file router.cpp.

◆ create_gbc_pdu()

std::unique_ptr< GbcPdu > vanetza::geonet::Router::create_gbc_pdu ( const GbcDataRequest request)
private

Create an initialized GeoBroadcast PDU.

Parameters
request
Returns
PDU object

Definition at line 1237 of file router.cpp.

◆ create_shb_pdu()

std::unique_ptr< ShbPdu > vanetza::geonet::Router::create_shb_pdu ( const ShbDataRequest request)
private

Create an initialized Single-Hop-Broadcast PDU.

Parameters
request
Returns
PDU object

Definition at line 1214 of file router.cpp.

◆ decide_pass_up()

bool vanetza::geonet::Router::decide_pass_up ( bool  within_destination,
const GeoBroadcastHeader gbc 
)
private

Decide if GBC packet shall be passed up to transport layer.

Parameters
within_destinationis router located within destination area
gbcGeoBroadcast header
Returns
true if packet shall be passed up

Definition at line 1158 of file router.cpp.

◆ detect_duplicate_address()

void vanetza::geonet::Router::detect_duplicate_address ( const Address source,
const MacAddress sender 
)
private

Helper method to handle duplicate addresses. If own address collides with the address of a received packet Router's address is set to a new random address.

Note
Behaviour depends on MIB's itsGnLocalAddrConfMethod.
Parameters
sourceaddress of source (from packet header)
senderaddress of sender (link layer)

Definition at line 1182 of file router.cpp.

◆ detect_duplicate_packet()

bool vanetza::geonet::Router::detect_duplicate_packet ( const Address source,
SequenceNumber  sn 
)
private

Detect duplicate packets See EN 302 636-4-1 v1.3.1 Annex A.2.

Parameters
sourcesource address
snsequence number
Returns
true if packet is detected as a duplicate

Definition at line 1199 of file router.cpp.

◆ dispatch_repetition()

void vanetza::geonet::Router::dispatch_repetition ( const DataRequestVariant &  ,
DownPacketPtr   
)
private

Callback function for dispatching a packet repetition. Invoked by Repeater when a scheduled repetition is due.

Parameters
request
payload

Definition at line 760 of file router.cpp.

◆ encap_packet()

Router::DownPacketPtr vanetza::geonet::Router::encap_packet ( ItsAid  aid,
Pdu pdu,
DownPacketPtr  packet 
)
private

Encaspulate a packet according to security profile.

Parameters
aidITS-AID
pduPDU
packetPacket with payload

Definition at line 1247 of file router.cpp.

◆ execute_itsg5_procedures()

void vanetza::geonet::Router::execute_itsg5_procedures ( )
private

Executes ITS-G5 media specific procedures Details are described in TS 102 636-4-2.

Definition at line 667 of file router.cpp.

◆ execute_media_procedures()

void vanetza::geonet::Router::execute_media_procedures ( CommunicationProfile  com_profile)
private

Executes media specific functionalities Details are described in TS 102 636-4-2.

Parameters
profilee.g. ITS-G5

Definition at line 652 of file router.cpp.

◆ flush_broadcast_forwarding_buffer()

void vanetza::geonet::Router::flush_broadcast_forwarding_buffer ( )
private

Send all packets in the broadcast forwarding buffer with expired waiting time.

Definition at line 1171 of file router.cpp.

◆ flush_unicast_forwarding_buffer()

void vanetza::geonet::Router::flush_unicast_forwarding_buffer ( const Address addr)
private

Send all matching packets in the unicast forwarding buffer with expired waiting time.

Parameters
addrunicast packets for this address

Definition at line 1176 of file router.cpp.

◆ forwarding_algorithm_selection()

NextHop vanetza::geonet::Router::forwarding_algorithm_selection ( PendingPacketForwarding &&  packet,
const LinkLayer ll = nullptr 
)

Forwarding algorithm selection procedure as given by Annex D

Parameters
pduGeoNetworking PDU
payloadpacket payload
lllink-layer control info (unavailable for source operations)
Returns
routing decision (next hop's address, buffered, or discarded)

Definition at line 604 of file router.cpp.

◆ get_cbf_buffer()

const CbfPacketBuffer & vanetza::geonet::Router::get_cbf_buffer ( ) const
inline

Get the Contention-Based-Forwarding buffer.

Returns
read-only reference to CBF packet buffer

Definition at line 217 of file router.hpp.

◆ get_local_position_vector()

const LongPositionVector & vanetza::geonet::Router::get_local_position_vector ( ) const
inline

Get the local position vector. This vector describes the current position of the router.

Returns
read-only reference to LongPositionVector

Definition at line 233 of file router.hpp.

◆ get_location_table()

const LocationTable & vanetza::geonet::Router::get_location_table ( ) const
inline

Get the LocationTable. The table holds information about neighbouring ITS-Routers.

Returns
read-only reference to LocationTable

Definition at line 225 of file router.hpp.

◆ get_mib()

const MIB & vanetza::geonet::Router::get_mib ( ) const
inline

Get Management Information Base (MIB)

Returns
read-only reference to MIB

Definition at line 210 of file router.hpp.

◆ greedy_forwarding()

NextHop vanetza::geonet::Router::greedy_forwarding ( PendingPacketForwarding &&  packet)
private

Determine next hop for greedy forwarding. See EN 302 636-4-1 v1.3.1 Annex E.2.

Parameters
pdu
payload
Returns
next hop

Definition at line 766 of file router.cpp.

◆ indicate()

void vanetza::geonet::Router::indicate ( UpPacketPtr  packet,
const MacAddress sender,
const MacAddress destination 
)

Handle the received packet on network layer. Packet handling involves these steps:

  • header processing
  • packet forwarding
  • passing to transport layer
  • security decapsulation
Parameters
packetreceived packet from access layer
senderMAC address of sender
destinationMAC address of destination (might be broadcast)

Definition at line 363 of file router.cpp.

◆ indicate_basic()

void vanetza::geonet::Router::indicate_basic ( IndicationContextBasic ctx)
private

Process BasicHeader at packet indication.

Parameters
ctxContext holding data for further parsing

Definition at line 400 of file router.cpp.

◆ indicate_common()

void vanetza::geonet::Router::indicate_common ( IndicationContext ctx,
const BasicHeader basic 
)
private

Process CommonHeader at packet indication.

Parameters
ctxContext holding data for further parsing
basicPreviously decoded BasicHeader

Definition at line 426 of file router.cpp.

◆ indicate_extended()

void vanetza::geonet::Router::indicate_extended ( IndicationContext ctx,
const CommonHeader common 
)
private

Process ExtendedHeader at packet indication.

Parameters
ctxContext holding data for further parsing
commonPreviously decoded CommonHeader

Definition at line 543 of file router.cpp.

◆ indicate_secured()

void vanetza::geonet::Router::indicate_secured ( IndicationContextBasic ctx,
const BasicHeader basic 
)
private

Process SecuredMessage at packet indication.

Parameters
ctxContext holding data for further parsing
basicPreviously decoded BasicHeader

Definition at line 469 of file router.cpp.

◆ non_area_contention_based_forwarding()

NextHop vanetza::geonet::Router::non_area_contention_based_forwarding ( PendingPacketForwarding &&  packet,
const MacAddress sender 
)
private

Determine next hop for non-area contention-based forwarding See EN 302 636-4-1 v1.3.1 Annex E.3.

Parameters
pdu
payload
senderoptional sender MAC address (if not first hop)
Returns
next hop

Definition at line 805 of file router.cpp.

◆ on_beacon_timer_expired()

void vanetza::geonet::Router::on_beacon_timer_expired ( )
private

Send Beacon packet to all neighbours with updated position vector. Only to be called when the beacon timer expires.

Definition at line 716 of file router.cpp.

◆ outside_sectorial_contention_area()

bool vanetza::geonet::Router::outside_sectorial_contention_area ( const MacAddress sender,
const MacAddress forwarder 
) const

Check if router is outside the sectorial contention area See TS 102 636-4-1 v1.2.3 section E.4 and figure E.2 for details.

Parameters
sender
forwarder
Returns
bool true if either sender or forwarder is outside

Definition at line 952 of file router.cpp.

◆ pass_down() [1/2]

void vanetza::geonet::Router::pass_down ( const dcc::DataRequest request,
PduPtr  pdu,
DownPacketPtr  payload 
)
private

Send packet using the information in the DataRequest. The packet is formed using the data in PDU and payload.

Parameters
requestcontaining transmission parameters
pduheader information
payloadPacket payload

Definition at line 672 of file router.cpp.

◆ pass_down() [2/2]

void vanetza::geonet::Router::pass_down ( const MacAddress addr,
PduPtr  pdu,
DownPacketPtr  payload 
)
private

Pass down the packet to the access layer.

Parameters
addrMAC address of destination
pduheader information
payloadPacket payload

Definition at line 694 of file router.cpp.

◆ pass_up()

void vanetza::geonet::Router::pass_up ( const DataIndication ind,
UpPacketPtr  packet 
)
private

Pass packet up to the transport layer.

Parameters
indcontaining network information
packetpayload to be passed up to the next layer

Definition at line 708 of file router.cpp.

◆ process_extended() [1/3]

bool vanetza::geonet::Router::process_extended ( const ExtendedPduConstRefs< BeaconHeader > &  pdu,
const UpPacket &  packet,
const LinkLayer ll 
)
private

Process ExtendedHeader information. Update router's LocationTable and neighbour relationship.

Parameters
pducontaining the ExtendedHeader
packetreceived packet
lllink-layer control info
Returns
pass up decision (always false for Beacons)

Definition at line 1015 of file router.cpp.

◆ process_extended() [2/3]

bool vanetza::geonet::Router::process_extended ( const ExtendedPduConstRefs< GeoBroadcastHeader > &  pdu,
const UpPacket &  packet,
const LinkLayer ll 
)
private

Process ExtendedHeader information. Update router's LocationTable and neighbour relationship. Pass packet up to transport layer for further processing. Forward packets.

Parameters
pducontaining the ExtendedHeader
packetreceived packet
lllink-layer control info
Returns
pass up decision (depends on addressed area and router position)

Definition at line 1037 of file router.cpp.

◆ process_extended() [3/3]

bool vanetza::geonet::Router::process_extended ( const ExtendedPduConstRefs< ShbHeader > &  pdu,
const UpPacket &  packet,
const LinkLayer ll 
)
private

Process ExtendedHeader information. Update router's LocationTable and neighbour relationship. Pass packet up to transport layer for further processing.

Parameters
pducontaining the ExtendedHeader
packetreceived packet
lllink-layer control info
Returns
pass up decision (true for all non-duplicate SHBs)

Definition at line 980 of file router.cpp.

◆ request() [1/5]

DataConfirm vanetza::geonet::Router::request ( const GacDataRequest ,
DownPacketPtr   
)

Definition at line 348 of file router.cpp.

◆ request() [2/5]

DataConfirm vanetza::geonet::Router::request ( const GbcDataRequest request,
DownPacketPtr  payload 
)

Request to send payload per GeoBroadcast (GBC). If security is enabled, the message gets encapsulated in a security envelope. Returns whether data was valid to be sent.

Parameters
request
payloadfrom upper layers
Returns
result code if packet has been accepted

Definition at line 277 of file router.cpp.

◆ request() [3/5]

DataConfirm vanetza::geonet::Router::request ( const GucDataRequest ,
DownPacketPtr   
)

Definition at line 353 of file router.cpp.

◆ request() [4/5]

DataConfirm vanetza::geonet::Router::request ( const ShbDataRequest request,
DownPacketPtr  payload 
)

Request to send payload per single hop broadcast (SHB). If security is enabled, the message gets encapsulated in a security envelope. Returns whether data was valid to be sent.

Parameters
request
payloadfrom upper layers
Returns
result code if packet has been accepted

Definition at line 219 of file router.cpp.

◆ request() [5/5]

DataConfirm vanetza::geonet::Router::request ( const TsbDataRequest ,
DownPacketPtr   
)

Definition at line 358 of file router.cpp.

◆ reset_beacon_timer() [1/2]

void vanetza::geonet::Router::reset_beacon_timer ( )
private

Reschedule timer for next Beacon transmission Timer will be scheduled according to MIB's Beacon timer settings.

Definition at line 739 of file router.cpp.

◆ reset_beacon_timer() [2/2]

void vanetza::geonet::Router::reset_beacon_timer ( Clock::duration  next)
private

Reschedule timer for next Beacon transmission.

Parameters
nextDuration until next transmission

Definition at line 752 of file router.cpp.

◆ set_access_interface()

void vanetza::geonet::Router::set_access_interface ( dcc::RequestInterface ifc)

Register access layer interface.

Parameters
ifcinterface used for passing packets down to access layer

Definition at line 197 of file router.cpp.

◆ set_address()

void vanetza::geonet::Router::set_address ( const Address addr)

Set Router's own GeoNetworking address.

Parameters
addr

Definition at line 209 of file router.cpp.

◆ set_dcc_field_generator()

void vanetza::geonet::Router::set_dcc_field_generator ( DccFieldGenerator dcc)

Register generator for DCC-MCO fields.

Parameters
dccDCC-MCO field generator or nullptr for disabling feature

Definition at line 203 of file router.cpp.

◆ set_random_seed()

void vanetza::geonet::Router::set_random_seed ( std::uint_fast32_t  seed)

Set seed for internal random number generator (RNG) RNG is used e.g. for random Beacon jitter.

Parameters
seedreset RNG's state to this seed

Definition at line 214 of file router.cpp.

◆ set_security_entity()

void vanetza::geonet::Router::set_security_entity ( security::SecurityEntity entity)

Register security entity used when itsGnSecurity is enabled.

Parameters
entitysecurity entity

Definition at line 192 of file router.cpp.

◆ set_transport_handler()

void vanetza::geonet::Router::set_transport_handler ( UpperProtocol  proto,
TransportInterface ifc 
)

Register a transport protocol handler.

Parameters
protoregister handler for this upper protocol
ifcuse this interface or disable handling if nullptr

Definition at line 187 of file router.cpp.

◆ timeout_cbf() [1/2]

units::Duration vanetza::geonet::Router::timeout_cbf ( const MacAddress sender) const
private

Determine (area) CBF buffering time for a packet from a sender.

This is a shortcut for a re-curring pattern in Annex F.3 and F.4: 1) sender position is looked up in location table 2) position accuracy of sender is validated (if it is found) 3) progress is then distance between sender and local router

Parameters
senderMAC address of sender
Returns
CBF time-out

Definition at line 880 of file router.cpp.

◆ timeout_cbf() [2/2]

units::Duration vanetza::geonet::Router::timeout_cbf ( units::Length  distance) const
private

Determine CBF buffering time for a packet. Complies to EN 302 636-4-1 v1.3.1 Annex E.3 (non-area CBF, eq. E.1) and F.3 (area CBF, eq. F.1)

Parameters
distdistance or progress (interpretation depends on non-area vs. area CBF)
Returns
CBF time-out

Definition at line 864 of file router.cpp.

◆ update_position()

void vanetza::geonet::Router::update_position ( const PositionFix position_fix)

Update router's local position vector.

Parameters
fixcurrent position fix

Definition at line 167 of file router.cpp.

Member Data Documentation

◆ forwarding_stopped

Hook<ForwardingStopReason> vanetza::geonet::Router::forwarding_stopped

When packet forwarding is stopped, this Hook is invoked.

Template Parameters
ForwardingStopReasonwhy Router decided not to forward packet

Definition at line 161 of file router.hpp.

◆ m_bc_forward_buffer

PacketBuffer vanetza::geonet::Router::m_bc_forward_buffer
private

Definition at line 542 of file router.hpp.

◆ m_cbf_buffer

CbfPacketBuffer vanetza::geonet::Router::m_cbf_buffer
private

Definition at line 544 of file router.hpp.

◆ m_dcc_field_generator

DccFieldGenerator* vanetza::geonet::Router::m_dcc_field_generator
private

Definition at line 538 of file router.hpp.

◆ m_gbc_memory

GbcMemory vanetza::geonet::Router::m_gbc_memory
private

Definition at line 549 of file router.hpp.

◆ m_local_position_vector

LongPositionVector vanetza::geonet::Router::m_local_position_vector
private

Definition at line 545 of file router.hpp.

◆ m_local_sequence_number

SequenceNumber vanetza::geonet::Router::m_local_sequence_number
private

Definition at line 546 of file router.hpp.

◆ m_location_table

LocationTable vanetza::geonet::Router::m_location_table
private

Definition at line 541 of file router.hpp.

◆ m_mib

const MIB& vanetza::geonet::Router::m_mib
private

Definition at line 535 of file router.hpp.

◆ m_random_gen

std::mt19937 vanetza::geonet::Router::m_random_gen
private

Definition at line 548 of file router.hpp.

◆ m_repeater

Repeater vanetza::geonet::Router::m_repeater
private

Definition at line 547 of file router.hpp.

◆ m_request_interface

dcc::RequestInterface* vanetza::geonet::Router::m_request_interface
private

Definition at line 537 of file router.hpp.

◆ m_runtime

Runtime& vanetza::geonet::Router::m_runtime
private

Definition at line 536 of file router.hpp.

◆ m_security_entity

security::SecurityEntity* vanetza::geonet::Router::m_security_entity
private

Definition at line 539 of file router.hpp.

◆ m_transport_ifcs

transport_map_t vanetza::geonet::Router::m_transport_ifcs
private

Definition at line 540 of file router.hpp.

◆ m_uc_forward_buffer

PacketBuffer vanetza::geonet::Router::m_uc_forward_buffer
private

Definition at line 543 of file router.hpp.

◆ packet_dropped

Hook<PacketDropReason> vanetza::geonet::Router::packet_dropped

When a packet is dropped, this Hook is invoked.

Template Parameters
PacketDropReasonwhy Router decided to drop packet

Definition at line 155 of file router.hpp.


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