|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
33 #include "ns3/wsn_node.h"
34 #include "ns3/proto-packet.pb.h"
35 #include "ns3/serializationwrapper.h"
36 #include "ns3/network-module.h"
37 #include "ns3/enums.h"
82 void Setup (uint16_t *onionPathlengths, uint16_t numOnionLengths,
int repeateTimes);
92 void Accept (Ptr<Socket> socket,
const ns3::Address &from);
204 void SendOnion (uint32_t firstHop,
int routeLen,
unsigned char *cipher,
int cipherLen);
208 std::map<uint32_t, std::string>
void SendOnion(uint32_t firstHop, int routeLen, unsigned char *cipher, int cipherLen)
The method constructs the onion message as a protobuf object.
int m_onionId
onion ID incremented each time a new onion is issued
std::string m_publickey
the encryption key: publickey
BodyOptions
Specifies how the onion body must behave.
int m_repeateTimes
Integer specifying the number of times to generate the onion message for each value in the m_onionPat...
std::stringstream m_onionStream
a string stream holding the onion represented as a string
void Setup(uint16_t *onionPathlengths, uint16_t numOnionLengths, int repeateTimes)
Setup sink node parameters after the application installation.
uint32_t m_decoyNum
dummy decoy value used to obfuscate the value carried in the onion body
int m_repeateCount
how many times the onion was sent at the current path length
uint32_t m_onionDelay
The sink will start sending onion messagess after OnionDelay seconds.
virtual void StartApplication(void)
1.Start the application run ns3::Wsn_node::Configure() 2.Generate new encryption keys 3....
void CheckOnion(void)
Each five seconds call the ns3::OnionValidator and check if at least one onion message is alive Other...
virtual ~Sink()
Default destructor.
virtual void StopApplication(void)
Stop the application.
std::map< uint32_t, std::string > m_nodeManager
hashmap to manage data about nodes in the WSN// pair <IP,publickey>
enum BodyOptions m_bodyOptions
bool m_fixedOnionSize
maintain the onion size fixed by adding padding (after layer decryption)
static TypeId GetTypeId(void)
Register this type.
The wsn node base class that manages the sending and receiving of packets and basic configuration of ...
void RecvHandshake(protomessage::ProtoPacket_Handshake *handshake_data, InetSocketAddress from)
When receiving a new handshake with a node.
Sink()
Default constructor.
std::string m_secretkey
the encryption key: secretkey
void SinkTasks()
Schedule the creation of a new onion based on the path length specified in m_onionPathLengths If all ...
The application of the sink node. The node that generates onion messagess.
uint16_t m_numnodes
The number of sensor nodes in the simulation.
void ReceivePacket(Ptr< Socket > socket)
Recieve a new packet from socket Check if the packet is a handshake packet or a packet containing an ...
void Accept(Ptr< Socket > socket, const ns3::Address &from)
Accept new TCP connections.
int m_onionLengthIndex
index of the current onion path length
void SelectRoute(int *route, int routeLen)
The method builds the path of the onion message by randomly selecting sensor nodes from the m_nodeMan...
void PrepareOnion(int *route, int routeLen)
Method that constructs the onion head from route and routeLen parameters.
uint16_t * m_onionPathLengths
array holding onion path lengths
void RecvOnion(protomessage::ProtoPacket_OnionBody *onion_body)
Triggered when an onion message is received back at the sink node Data about the message is captured ...
uint16_t m_numOnionLengths
size of the array m_onionPathsLengths