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 , Packet_Size , Internal_Error
}
 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< TsbHeader > &, const UpPacket &, const LinkLayer &ll)
 packet handling of received TSB packet
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, ByteBuffer ssp, 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 265 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 101 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 132 of file router.cpp.

◆ ~Router()

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

Definition at line 165 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 890 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 844 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 1319 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 1331 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 1308 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 1252 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 1276 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 1293 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 758 of file router.cpp.

◆ encap_packet()

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

Encaspulate a packet according to security profile.

Parameters
aidITS-AID
sspService Specific Permissions
pduPDU
packetPacket with payload

Definition at line 1341 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 661 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 645 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 1265 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 1270 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 597 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 219 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 235 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 227 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 212 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 764 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 374 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 399 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 424 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 526 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 467 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 803 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 710 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 950 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 666 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 688 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 702 of file router.cpp.

◆ process_extended() [1/4]

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 1109 of file router.cpp.

◆ process_extended() [2/4]

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 1131 of file router.cpp.

◆ process_extended() [3/4]

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 978 of file router.cpp.

◆ process_extended() [4/4]

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

packet handling of received TSB packet

Parameters
pduPDU with TSB header
packetreceived packet
lllink-layer control info
Returns
pass up decision (true for all non-duplicate TSBs)

Definition at line 1013 of file router.cpp.

◆ request() [1/5]

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

Definition at line 359 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 284 of file router.cpp.

◆ request() [3/5]

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

Definition at line 364 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 222 of file router.cpp.

◆ request() [5/5]

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

Definition at line 369 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 737 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 750 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 200 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 212 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 206 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 217 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 195 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 190 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 878 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 862 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 170 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 163 of file router.hpp.

◆ m_bc_forward_buffer

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

Definition at line 555 of file router.hpp.

◆ m_cbf_buffer

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

Definition at line 557 of file router.hpp.

◆ m_dcc_field_generator

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

Definition at line 551 of file router.hpp.

◆ m_gbc_memory

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

Definition at line 562 of file router.hpp.

◆ m_local_position_vector

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

Definition at line 558 of file router.hpp.

◆ m_local_sequence_number

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

Definition at line 559 of file router.hpp.

◆ m_location_table

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

Definition at line 554 of file router.hpp.

◆ m_mib

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

Definition at line 548 of file router.hpp.

◆ m_random_gen

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

Definition at line 561 of file router.hpp.

◆ m_repeater

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

Definition at line 560 of file router.hpp.

◆ m_request_interface

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

Definition at line 550 of file router.hpp.

◆ m_runtime

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

Definition at line 549 of file router.hpp.

◆ m_security_entity

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

Definition at line 552 of file router.hpp.

◆ m_transport_ifcs

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

Definition at line 553 of file router.hpp.

◆ m_uc_forward_buffer

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

Definition at line 556 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 157 of file router.hpp.


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