Multicast Routing Modelling In OMNeT++
pimDM.h
Go to the documentation of this file.
00001 
00009 #ifndef HLIDAC_PIMDM
00010 #define HLIDAC_PIMDM
00011 
00012 #include <omnetpp.h>
00013 #include "PIMPacket_m.h"
00014 #include "PIMTimer_m.h"
00015 #include "AnsaInterfaceTableAccess.h"
00016 #include "MulticastRoutingTableAccess.h"
00017 #include "RoutingTableAccess.h"
00018 #include "NotificationBoard.h"
00019 #include "NotifierConsts.h"
00020 #include "PimNeighborTable.h"
00021 #include "PimInterfaceTable.h"
00022 #include "IPControlInfo.h"
00023 #include "IPv4InterfaceData.h"
00024 
00025 #define PT 180.0                                                
00026 #define GRT 3.0                                                 
00027 #define SAT 210.0                                               
00028 #define SRT 60.0                                                
00033 class pimDM : public cSimpleModule, protected INotifiable
00034 {
00035         private:
00036                 IRoutingTable                   *rt;            
00037                 MulticastRoutingTable           *mrt;                   
00038             IInterfaceTable             *ift;           
00039             NotificationBoard                   *nb;                    
00040             PimInterfaceTable                   *pimIft;                
00041             PimNeighborTable                    *pimNbt;                
00043             // process events
00044             void receiveChangeNotification(int category, const cPolymorphic *details);
00045             void newMulticast(MulticastIPRoute *newRoute);
00046             void newMulticastAddr(addRemoveAddr *members);
00047             void oldMulticastAddr(addRemoveAddr *members);
00048             void dataOnPruned(IPAddress destAddr, IPAddress srcAddr);
00049             void dataOnNonRpf(IPAddress group, IPAddress source, int intId);
00050             void dataOnRpf(MulticastIPRoute *route);
00051             void rpfIntChange(MulticastIPRoute *route);
00052 
00053             // process timers
00054             void processPIMTimer(PIMTimer *timer);
00055             void processPruneTimer(PIMpt * timer);
00056             void processGraftRetryTimer(PIMgrt *timer);
00057             void processSourceActiveTimer(PIMsat * timer);
00058             void processStateRefreshTimer(PIMsrt * timer);
00059 
00060             // create timers
00061             PIMpt* createPruneTimer(IPAddress source, IPAddress group, int intId, int holdTime);
00062             PIMgrt* createGraftRetryTimer(IPAddress source, IPAddress group);
00063             PIMsat* createSourceActiveTimer(IPAddress source, IPAddress group);
00064             PIMsrt* createStateRefreshTimer(IPAddress source, IPAddress group);
00065 
00066             // process PIM packets
00067             void processPIMPkt(PIMPacket *pkt);
00068             void processJoinPruneGraftPacket(PIMJoinPrune *pkt, PIMPacketType type);
00069             void processPrunePacket(MulticastIPRoute *route, int intId, int holdTime);
00070             void processGraftPacket(IPAddress source, IPAddress group, IPAddress sender, int intId);
00071             void processGraftAckPacket(MulticastIPRoute *route);
00072             void processStateRefreshPacket(PIMStateRefresh *pkt);
00073 
00074             //create PIM packets
00075             void sendPimJoinPrune(IPAddress nextHop, IPAddress src, IPAddress grp, int intId);
00076             void sendPimGraft(IPAddress nextHop, IPAddress src, IPAddress grp, int intId);
00077             void sendPimGraftAck(PIMGraftAck *msg);
00078             void sendPimStateRefresh(IPAddress originator, IPAddress src, IPAddress grp, int intId, bool P);
00079 
00080 
00081 
00082         protected:
00083                 virtual int numInitStages() const  {return 5;}
00084                 virtual void handleMessage(cMessage *msg);
00085                 virtual void initialize(int stage);
00086 };
00087 
00088 #endif