Registration.h Source File

Simu5G: Registration.h Source File
Simu5G
Registration.h
1//
2// Simu5G
3//
4// Authors: Andras Varga (OpenSim Ltd)
5//
6// This file is part of a software released under the license included in file
7// "license.pdf". Please read LICENSE and README files before using it.
8// The above files and the present reference are part of the software itself,
9// and cannot be removed from it.
10//
11
12#ifndef _REGISTRATION_H_
13#define _REGISTRATION_H_
14
15#include "simu5g/common/LteCommon.h"
16#include "simu5g/stack/rrc/ConnectionControlBase.h"
17#include <inet/common/ModuleRefByPar.h>
18#include <inet/networklayer/common/NetworkInterface.h>
19
20using namespace omnetpp;
21
22namespace simu5g {
23
28class Registration : public cSimpleModule, public cListener
29{
30 private:
31 MacNodeId lteNodeId = NODEID_NONE;
32 MacNodeId nrNodeId = NODEID_NONE;
33 RanNodeType nodeType = UNKNOWN_NODE_TYPE;
34 SessionType sessionType_ = IP_V4; // UE only: the type of the UE's session (the sessionType parameter)
35
36 // corresponding entry for our interface
37 opp_component_ptr<inet::NetworkInterface> networkIf;
38
39 inet::ModuleRefByPar<Binder> binder;
40 inet::ModuleRefByPar<ConnectionControlBase> connectionControl; // the node's control-plane entry point, told about multicast group joins
41
42 // UE only: the cellular interface's addresses the Binder maps to this UE
43 std::set<inet::L3Address> registeredAddresses;
44
45 protected:
46 void initialize(int stage) override;
47 int numInitStages() const override { return inet::NUM_INIT_STAGES; }
48 void handleMessage(cMessage *msg) override;
49 void finish() override;
50 using cListener::finish;
51
52 virtual void registerInterface();
53 virtual void registerMulticastGroups();
54
55 // UE only: makes the Binder map exactly the cellular interface's current unicast
56 // addresses, of both families, to this UE's LTE and NR node ids. Tentative IPv6
57 // addresses (duplicate address detection still running) are left out.
58 virtual void registerAddresses();
59
60 // Interface configuration changes: the UE's addresses can change during the run
61 // (an IPv6 link-local address, for one, appears only when Neighbor Discovery has
62 // started up), and the Binder must follow them
63 void receiveSignal(cComponent *source, simsignal_t signalID, cObject *obj, cObject *details) override;
64
65 public:
66 RanNodeType getNodeType() const { return nodeType; }
67 MacNodeId getLteNodeId() const { return lteNodeId; }
68 MacNodeId getNrNodeId() const { return nrNodeId; }
69 bool isDualTechnology() const { return lteNodeId != NODEID_NONE && nrNodeId != NODEID_NONE; }
70};
71
72} // namespace simu5g
73
74#endif
RRC Registration — registers the node with the Binder, sets up the network interface,...
Definition Registration.h:29
Definition AlertReceiver.h:24
constexpr MacNodeId NODEID_NONE
MAC node ID.
Definition LteTypes.h:54