|
INET Framework for OMNeT++/OMNEST
|
Implementation of PIM-DM protocol (RFC 3973).
More...
#include <PimDm.h>
|
| void | receiveSignal (cComponent *source, simsignal_t signalID, cObject *obj, cObject *details) override |
| |
| void | unroutableMulticastPacketArrived (Ipv4Address srcAddress, Ipv4Address destAddress, unsigned short ttl) |
| | The method process notification about new multicast data stream. More...
|
| |
| void | multicastPacketArrivedOnNonRpfInterface (Ipv4Address group, Ipv4Address source, int interfaceId) |
| | The method has to solve the problem when multicast data appears on non-RPF interface. More...
|
| |
| void | multicastPacketArrivedOnRpfInterface (int interfaceId, Ipv4Address group, Ipv4Address source, unsigned short ttl) |
| |
| void | multicastReceiverAdded (NetworkInterface *ie, Ipv4Address newAddr) |
| |
| void | multicastReceiverRemoved (NetworkInterface *ie, Ipv4Address oldAddr) |
| | The method process notification about multicast groups removed from interface. More...
|
| |
| void | rpfInterfaceHasChanged (Ipv4MulticastRoute *route, Ipv4Route *routeToSource) |
| | The method process notification about interface change. More...
|
| |
| void | processPruneTimer (cMessage *timer) |
| |
| void | processPrunePendingTimer (cMessage *timer) |
| |
| void | processGraftRetryTimer (cMessage *timer) |
| |
| void | processOverrideTimer (cMessage *timer) |
| |
| void | processSourceActiveTimer (cMessage *timer) |
| |
| void | processStateRefreshTimer (cMessage *timer) |
| |
| void | processAssertTimer (cMessage *timer) |
| |
| void | processJoinPrunePacket (Packet *pk) |
| |
| void | processGraftPacket (Packet *pk) |
| |
| void | processGraftAckPacket (Packet *pk) |
| |
| void | processStateRefreshPacket (Packet *pk) |
| | The method is used to process PimStateRefresh packet. More...
|
| |
| void | processAssertPacket (Packet *pk) |
| |
| void | processPrune (Route *route, int intId, int holdTime, int numRpfNeighbors, Ipv4Address upstreamNeighborField) |
| | The method process PIM Prune packet. More...
|
| |
| void | processJoin (Route *route, int intId, int numRpfNeighbors, Ipv4Address upstreamNeighborField) |
| |
| void | processGraft (Ipv4Address source, Ipv4Address group, Ipv4Address sender, int intId) |
| | The method is used to process PimGraft packet. More...
|
| |
| void | processAssert (Interface *downstream, AssertMetric receivedMetric, int stateRefreshInterval) |
| |
| void | processOlistEmptyEvent (Route *route) |
| |
| void | processOlistNonEmptyEvent (Route *route) |
| |
| void | sendPrunePacket (Ipv4Address nextHop, Ipv4Address src, Ipv4Address grp, int holdTime, int intId) |
| |
| void | sendJoinPacket (Ipv4Address nextHop, Ipv4Address source, Ipv4Address group, int interfaceId) |
| |
| void | sendGraftPacket (Ipv4Address nextHop, Ipv4Address src, Ipv4Address grp, int intId) |
| |
| void | sendGraftAckPacket (Packet *pk, const Ptr< const PimGraft > &graftPacket) |
| |
| void | sendStateRefreshPacket (Ipv4Address originator, Route *route, DownstreamInterface *downstream, unsigned short ttl) |
| |
| void | sendAssertPacket (Ipv4Address source, Ipv4Address group, AssertMetric metric, NetworkInterface *ie) |
| |
| void | sendToIP (Packet *packet, Ipv4Address source, Ipv4Address dest, int outInterfaceId) |
| |
| void | restartTimer (cMessage *timer, double interval) |
| |
| void | cancelAndDeleteTimer (cMessage *&timer) |
| |
| PimInterface * | getIncomingInterface (NetworkInterface *fromIE) |
| |
| Ipv4MulticastRoute * | findIpv4MulticastRoute (Ipv4Address group, Ipv4Address source) |
| |
| Route * | findRoute (Ipv4Address source, Ipv4Address group) |
| |
| void | deleteRoute (Ipv4Address source, Ipv4Address group) |
| |
| void | clearRoutes () |
| |
|
| enum | PimTimerKind {
HelloTimer = 1,
TriggeredHelloDelay,
AssertTimer,
PruneTimer,
PrunePendingTimer,
GraftRetryTimer,
UpstreamOverrideTimer,
PruneLimitTimer,
SourceActiveTimer,
StateRefreshTimer,
KeepAliveTimer,
RegisterStopTimer,
ExpiryTimer,
JoinTimer
} |
| |
| enum | State |
| |
| ModuleRefByPar< IIpv4RoutingTable > | rt |
| |
| ModuleRefByPar< IInterfaceTable > | ift |
| |
| ModuleRefByPar< PimInterfaceTable > | pimIft |
| |
| ModuleRefByPar< PimNeighborTable > | pimNbt |
| |
| opp_component_ptr< Pim > | pimModule |
| |
| bool | isUp = false |
| |
| bool | isEnabled = false |
| |
| const char * | hostname = nullptr |
| |
| double | helloPeriod = 0 |
| |
| double | holdTime = 0 |
| |
| int | designatedRouterPriority = 0 |
| |
| PimInterface::PimMode | mode = static_cast<PimInterface::PimMode>(0) |
| |
| uint32_t | generationID = 0 |
| |
| cMessage * | helloTimer = nullptr |
| |
| State | operationalState |
| |
| simtime_t | lastChange |
| |
| Operation | activeOperation |
| |
| cMessage * | activeOperationTimeout |
| |
| cMessage * | activeOperationExtraTimer |
| |
| static const Ipv4Address | ALL_PIM_ROUTERS_MCAST |
| |
| static simsignal_t | sentHelloPkSignal = registerSignal("sentHelloPk") |
| |
| static simsignal_t | rcvdHelloPkSignal = registerSignal("rcvdHelloPk") |
| |
Implementation of PIM-DM protocol (RFC 3973).
◆ RoutingTable
◆ PimDm()
◆ ~PimDm()
◆ cancelAndDeleteTimer()
| void inet::PimDm::cancelAndDeleteTimer |
( |
cMessage *& |
timer | ) |
|
|
private |
1692 cancelAndDelete(timer);
◆ clearRoutes()
| void inet::PimDm::clearRoutes |
( |
| ) |
|
|
private |
1732 bool changed =
true;
1735 for (
int i = 0; i <
rt->getNumMulticastRoutes(); i++) {
1736 Ipv4MulticastRoute *ipv4Route =
rt->getMulticastRoute(i);
1737 if (ipv4Route->getSource() ==
this) {
1738 rt->deleteMulticastRoute(ipv4Route);
1746 for (
auto& elem :
routes)
Referenced by stopPIMRouting().
◆ deleteRoute()
◆ findIpv4MulticastRoute()
1705 int numRoutes =
rt->getNumMulticastRoutes();
1706 for (
int i = 0; i < numRoutes; i++) {
1707 Ipv4MulticastRoute *route =
rt->getMulticastRoute(i);
1708 if (route->getSource() ==
this && route->getMulticastGroup() == group && route->getOrigin() == source)
Referenced by processSourceActiveTimer().
◆ findRoute()
1716 auto it =
routes.find(SourceAndGroup(source, group));
1717 return it !=
routes.end() ? it->second :
nullptr;
Referenced by multicastPacketArrivedOnNonRpfInterface(), multicastPacketArrivedOnRpfInterface(), multicastReceiverAdded(), multicastReceiverRemoved(), processAssertPacket(), processGraft(), processGraftAckPacket(), processJoinPrunePacket(), processStateRefreshPacket(), and rpfInterfaceHasChanged().
◆ getIncomingInterface()
◆ graftPruneStateString()
◆ handleCrashOperation()
◆ handleMessageWhenUp()
| void inet::PimDm::handleMessageWhenUp |
( |
cMessage * |
msg | ) |
|
|
overrideprotectedvirtual |
Implements inet::OperationalMixin< cSimpleModule >.
111 if (msg->isSelfMessage()) {
112 switch (msg->getKind()) {
149 throw cRuntimeError(
"PimDm: unknown self message: %s (%s)", msg->getName(), msg->getClassName());
153 Packet *pk = check_and_cast<Packet *>(msg);
154 const auto& pkt = pk->peekAtFront<PimPacket>();
156 throw cRuntimeError(
"PimDm: received unknown message: %s (%s).", msg->getName(), msg->getClassName());
159 EV_DETAIL <<
"PIM-DM is disabled, dropping packet.\n";
164 switch (pkt->getType()) {
190 EV_WARN <<
"Dropping packet " << pk->getName() <<
".\n";
◆ handleStartOperation()
Reimplemented from inet::PimBase.
65 throw cRuntimeError(
"PimDm: containing node not found.");
◆ handleStopOperation()
◆ initialize()
| void inet::PimDm::initialize |
( |
int |
stage | ) |
|
|
overrideprotectedvirtual |
◆ multicastPacketArrivedOnNonRpfInterface()
| void inet::PimDm::multicastPacketArrivedOnNonRpfInterface |
( |
Ipv4Address |
group, |
|
|
Ipv4Address |
source, |
|
|
int |
interfaceId |
|
) |
| |
|
private |
The method has to solve the problem when multicast data appears on non-RPF interface.
It can happen when there is loop in the network. In this case, router has to prune from the neighbor, so it sends Prune message.
1225 EV_DETAIL <<
"Received multicast datagram (source=" << source <<
", group=" << group <<
") on non-RPF interface: " << interfaceId <<
".\n";
1227 Route *route =
findRoute(source, group);
1230 UpstreamInterface *upstream = route->upstreamInterface;
1231 DownstreamInterface *downstream = route->findDownstreamInterfaceByInterfaceId(interfaceId);
1237 if (
pimNbt->getNumNeighbors(interfaceId) == 1) {
1239 Ipv4Address nextHop = (
pimNbt->getNeighbor(interfaceId, 0))->getAddress();
1248 if (route->isOilistNull()) {
1249 EV <<
"Route is not forwarding any more, send Prune to upstream" << endl;
1251 if (!upstream->isSourceDirectlyConnected()) {
1262 if (downstream->assertState == DownstreamInterface::NO_ASSERT_INFO) {
1270 downstream->assertState = DownstreamInterface::I_WON_ASSERT;
1271 downstream->winnerMetric = route->metric.setAddress(downstream->ie->getProtocolData<Ipv4InterfaceData>()->getIPAddress());
1275 else if (downstream->assertState == DownstreamInterface::I_WON_ASSERT) {
Referenced by receiveSignal().
◆ multicastPacketArrivedOnRpfInterface()
| void inet::PimDm::multicastPacketArrivedOnRpfInterface |
( |
int |
interfaceId, |
|
|
Ipv4Address |
group, |
|
|
Ipv4Address |
source, |
|
|
unsigned short |
ttl |
|
) |
| |
|
private |
1287 EV_DETAIL <<
"Multicast datagram arrived: source=" << source <<
", group=" << group <<
".\n";
1289 Route *route =
findRoute(source, group);
1291 UpstreamInterface *upstream = route->upstreamInterface;
1304 if (upstream->isSourceDirectlyConnected()) {
1308 PimInterface *pimInterface =
pimIft->getInterfaceById(upstream->ie->getInterfaceId());
1309 if (pimInterface && pimInterface->getSR())
1310 upstream->startStateRefreshTimer();
1315 upstream->maxTtlSeen =
std::max(upstream->maxTtlSeen, ttl);
1321 if (upstream->ie->getInterfaceId() == interfaceId && route->isOilistNull() && !upstream->isSourceDirectlyConnected()) {
1322 EV_DETAIL <<
"Route does not have any outgoing interface and source is not directly connected.\n";
1324 switch (upstream->graftPruneState) {
1329 upstream->startPruneLimitTimer();
1343 if (!upstream->isPruneLimitTimerRunning()) {
1345 upstream->startPruneLimitTimer();
Referenced by receiveSignal().
◆ multicastReceiverAdded()
1145 EV_DETAIL <<
"Multicast receiver added for group " << group <<
".\n";
1147 for (
int i = 0; i <
rt->getNumMulticastRoutes(); i++) {
1148 Ipv4MulticastRoute *ipv4Route =
rt->getMulticastRoute(i);
1151 if (ipv4Route->getSource() !=
this || ipv4Route->getMulticastGroup() != group)
1154 Route *route =
findRoute(ipv4Route->getOrigin(), group);
1158 UpstreamInterface *upstream = route->upstreamInterface;
1159 if (upstream->ie == ie)
1163 DownstreamInterface *downstream = route->findDownstreamInterfaceByInterfaceId(ie->getInterfaceId());
1165 EV <<
"Interface is already on list of outgoing interfaces" << endl;
1171 EV <<
"Interface is not on list of outgoing interfaces yet, it will be added" << endl;
1172 downstream = route->createDownstreamInterface(ie);
1173 ipv4Route->addOutInterface(
new PimDmOutInterface(ie, downstream));
1176 downstream->setHasConnectedReceivers(
true);
Referenced by receiveSignal().
◆ multicastReceiverRemoved()
The method process notification about multicast groups removed from interface.
For each old address it tries to find route. If there is route, it finds interface in list of outgoing interfaces. If the interface is in the list it will be removed. If the router was not pruned and there is no outgoing interface, the router will prune from the multicast tree.
1192 EV_DETAIL <<
"No more receiver for group " << group <<
" on interface '" << ie->getInterfaceName() <<
"'.\n";
1195 for (
int i = 0; i <
rt->getNumMulticastRoutes(); i++) {
1196 Ipv4MulticastRoute *ipv4Route =
rt->getMulticastRoute(i);
1197 if (ipv4Route->getSource() ==
this && ipv4Route->getMulticastGroup() == group) {
1198 Route *route =
findRoute(ipv4Route->getOrigin(), group);
1202 DownstreamInterface *downstream = route->findDownstreamInterfaceByInterfaceId(ie->getInterfaceId());
1204 bool wasInOlist = downstream->isInOlist();
1205 downstream->setHasConnectedReceivers(
false);
1206 if (wasInOlist && !downstream->isInOlist()) {
1207 EV_DEBUG <<
"Removed interface '" << ie->getInterfaceName() <<
"' from the outgoing interface list of route " << route <<
".\n";
1210 if (route->isOilistNull())
Referenced by receiveSignal().
◆ numInitStages()
| virtual int inet::PimDm::numInitStages |
( |
| ) |
const |
|
inlineoverrideprotectedvirtual |
◆ originatorStateString()
◆ processAssert()
| void inet::PimDm::processAssert |
( |
Interface * |
downstream, |
|
|
AssertMetric |
receivedMetric, |
|
|
int |
stateRefreshInterval |
|
) |
| |
|
private |
924 Route *route = check_and_cast<Route *>(incomingInterface->owner);
925 UpstreamInterface *upstream = route->upstreamInterface;
931 route->metric.setAddress(incomingInterface->ie->getProtocolData<Ipv4InterfaceData>()->getIPAddress()) :
932 incomingInterface->winnerMetric;
933 bool isEqual = receivedMetric == currentMetric;
934 bool isBetter = receivedMetric < currentMetric;
935 bool couldAssert = incomingInterface != upstream;
938 if (isBetter || isEqual) {
952 EV_DEBUG <<
"Received better metrics, going to I_LOST_ASSERT state.\n";
954 incomingInterface->winnerMetric = receivedMetric;
956 incomingInterface->startAssertTimer(
assertTime);
958 sendPrunePacket(incomingInterface->winnerMetric.address, route->source, route->group,
assertTime, incomingInterface->ie->getInterfaceId());
974 EV_DEBUG <<
"Received better metrics, going to I_LOST_ASSERT state.\n";
975 incomingInterface->assertState = DownstreamInterface::I_LOST_ASSERT;
976 incomingInterface->winnerMetric = receivedMetric;
978 sendPrunePacket(incomingInterface->winnerMetric.address, route->source, route->group,
assertTime, incomingInterface->ie->getInterfaceId());
995 EV_DEBUG <<
"Received better metrics, stay in I_LOST_ASSERT state.\n";
998 incomingInterface->winnerMetric = receivedMetric;
1000 sendPrunePacket(incomingInterface->winnerMetric.address, route->source, route->group,
assertTime, incomingInterface->ie->getInterfaceId());
1005 else if (receivedMetric.address == incomingInterface->winnerMetric.address) {
1015 EV_DEBUG <<
"Assert winner lost best route, going to NO_ASSERT_INFO state.\n";
1016 incomingInterface->deleteAssertInfo();
1023 else if (couldAssert) {
1031 EV_DEBUG <<
"Received inferior assert metrics, going to I_WON_ASSERT state.\n";
1032 incomingInterface->assertState = DownstreamInterface::I_WON_ASSERT;
1033 sendAssertPacket(route->source, route->group, route->metric, incomingInterface->ie);
1034 incomingInterface->startAssertTimer(
assertTime);
1036 else if (incomingInterface->assertState == DownstreamInterface::I_WON_ASSERT) {
1041 EV_DEBUG <<
"Received inferior assert metrics, stay in I_WON_ASSERT state.\n";
1042 sendAssertPacket(route->source, route->group, route->metric, incomingInterface->ie);
Referenced by processAssertPacket(), and processStateRefreshPacket().
◆ processAssertPacket()
| void inet::PimDm::processAssertPacket |
( |
Packet * |
pk | ) |
|
|
private |
650 const auto& pkt = pk->peekAtFront<PimAssert>();
651 int incomingInterfaceId = pk->getTag<InterfaceInd>()->getInterfaceId();
652 Ipv4Address srcAddrFromTag = pk->getTag<
L3AddressInd>()->getSrcAddress().toIpv4();
653 Ipv4Address source = pkt->getSourceAddress().unicastAddress.toIpv4();
654 Ipv4Address group = pkt->getGroupAddress().groupAddress.toIpv4();
655 AssertMetric receivedMetric = AssertMetric(pkt->getMetricPreference(), pkt->getMetric(), srcAddrFromTag);
658 Interface *incomingInterface = route->upstreamInterface->getInterfaceId() == incomingInterfaceId ?
659 static_cast<Interface *
>(route->upstreamInterface) :
660 static_cast<Interface *
>(route->findDownstreamInterfaceByInterfaceId(incomingInterfaceId));
661 ASSERT(incomingInterface);
663 EV_INFO <<
"Received Assert(S=" << source <<
", G=" << group
664 <<
") packet on interface '" << incomingInterface->ie->getInterfaceName() <<
"'.\n";
Referenced by handleMessageWhenUp().
◆ processAssertTimer()
| void inet::PimDm::processAssertTimer |
( |
cMessage * |
timer | ) |
|
|
private |
267 Interface *interfaceData =
static_cast<Interface *
>(timer->getContextPointer());
268 ASSERT(timer == interfaceData->assertTimer);
269 ASSERT(interfaceData->assertState != DownstreamInterface::NO_ASSERT_INFO);
271 Route *route = check_and_cast<Route *>(interfaceData->owner);
272 UpstreamInterface *upstream = route->upstreamInterface;
273 EV_DETAIL <<
"AssertTimer" << route <<
" interface=" << interfaceData->ie->getInterfaceName() <<
" has expired.\n";
283 EV_DEBUG <<
"Going into NO_ASSERT_INFO state.\n";
284 interfaceData->deleteAssertInfo();
287 if (interfaceData != upstream) {
288 bool isOlistNull = route->isOilistNull();
Referenced by handleMessageWhenUp().
◆ processGraft()
The method is used to process PimGraft packet.
Packet means that downstream router wants to join to multicast tree, so the packet cannot come to RPF interface. Router finds correct outgoig interface towards downstream router. Change its state to forward if it was not before and cancel Prune Timer. If route was in pruned state, router will send also Graft message to join multicast tree.
713 EV_DEBUG <<
"Processing Graft(S=" << source <<
", G=" << group <<
"), sender=" << sender <<
"incoming if=" << incomingInterfaceId << endl;
718 UpstreamInterface *upstream = route->upstreamInterface;
721 if (upstream->ie->getInterfaceId() == incomingInterfaceId) {
722 EV <<
"ERROR: Graft message came to RPF interface." << endl;
726 DownstreamInterface *downstream = route->findDownstreamInterfaceByInterfaceId(incomingInterfaceId);
734 bool olistChanged =
false;
735 switch (downstream->pruneState) {
741 downstream->stopPrunePendingTimer();
746 EV <<
"Interface " << downstream->ie->getInterfaceId() <<
" transit to forwarding state (Graft)." << endl;
747 downstream->stopPruneTimer();
749 olistChanged = downstream->isInOlist();
759 if (downstream->assertState == DownstreamInterface::I_LOST_ASSERT) {
766 sendAssertPacket(route->source, route->group, route->metric, downstream->ie);
Referenced by processGraftPacket().
◆ processGraftAckPacket()
| void inet::PimDm::processGraftAckPacket |
( |
Packet * |
pk | ) |
|
|
private |
772 const auto& pkt = pk->peekAtFront<PimGraft>();
773 EV_INFO <<
"Received GraftAck packet.\n";
777 Ipv4Address destAddress = pk->getTag<
L3AddressInd>()->getDestAddress().toIpv4();
779 for (
unsigned int i = 0; i < pkt->getJoinPruneGroupsArraySize(); i++) {
780 const JoinPruneGroup& group = pkt->getJoinPruneGroups(i);
781 Ipv4Address groupAddr = group.getGroupAddress().groupAddress.toIpv4();
783 for (
unsigned int j = 0; j < group.getJoinedSourceAddressArraySize(); j++) {
784 const auto& source = group.getJoinedSourceAddress(j);
785 Route *route =
findRoute(source.sourceAddress.toIpv4(), groupAddr);
787 UpstreamInterface *upstream = route->upstreamInterface;
791 if (destAddress != upstream->ie->getProtocolData<Ipv4InterfaceData>()->getIPAddress())
800 ASSERT(upstream->graftRetryTimer);
801 cancelAndDelete(upstream->graftRetryTimer);
802 upstream->graftRetryTimer =
nullptr;
Referenced by handleMessageWhenUp().
◆ processGraftPacket()
| void inet::PimDm::processGraftPacket |
( |
Packet * |
pk | ) |
|
|
private |
675 const auto& pkt = pk->peekAtFront<PimGraft>();
676 EV_INFO <<
"Received Graft packet.\n";
680 Ipv4Address sender = pk->getTag<
L3AddressInd>()->getSrcAddress().toIpv4();
681 NetworkInterface *incomingInterface =
ift->getInterfaceById(pk->getTag<InterfaceInd>()->getInterfaceId());
684 if (pkt->getUpstreamNeighborAddress().unicastAddress != incomingInterface->getProtocolData<Ipv4InterfaceData>()->getIPAddress()) {
689 for (
unsigned int i = 0; i < pkt->getJoinPruneGroupsArraySize(); i++) {
690 const JoinPruneGroup& group = pkt->getJoinPruneGroups(i);
691 Ipv4Address groupAddr = group.getGroupAddress().groupAddress.toIpv4();
693 for (
unsigned int j = 0; j < group.getJoinedSourceAddressArraySize(); j++) {
694 const auto& source = group.getJoinedSourceAddress(j);
695 processGraft(source.sourceAddress.toIpv4(), groupAddr, sender, incomingInterface->getInterfaceId());
Referenced by handleMessageWhenUp().
◆ processGraftRetryTimer()
| void inet::PimDm::processGraftRetryTimer |
( |
cMessage * |
timer | ) |
|
|
private |
366 EV_INFO <<
"GraftRetryTimer expired.\n";
367 UpstreamInterface *upstream =
static_cast<UpstreamInterface *
>(timer->getContextPointer());
369 ASSERT(timer == upstream->graftRetryTimer);
371 Route *route = upstream->route();
372 EV_INFO <<
"GraftRetryTimer" << route <<
" expired.\n";
379 sendGraftPacket(upstream->rpfNeighbor(), route->source, route->group, upstream->getInterfaceId());
Referenced by handleMessageWhenUp().
◆ processJoin()
| void inet::PimDm::processJoin |
( |
Route * |
route, |
|
|
int |
intId, |
|
|
int |
numRpfNeighbors, |
|
|
Ipv4Address |
upstreamNeighborField |
|
) |
| |
|
private |
519 UpstreamInterface *upstream = route->upstreamInterface;
522 if (upstream->ie->getInterfaceId() == intId && numRpfNeighbors > 1) {
530 cancelAndDelete(upstream->overrideTimer);
531 upstream->overrideTimer =
nullptr;
538 DownstreamInterface *downstream = route->findDownstreamInterfaceByInterfaceId(intId);
543 if (upstreamNeighborField != downstream->ie->getProtocolData<Ipv4InterfaceData>()->getIPAddress())
547 downstream->stopPrunePendingTimer();
549 downstream->stopPruneTimer();
559 if (downstream->assertState == DownstreamInterface::I_LOST_ASSERT) {
565 sendAssertPacket(route->source, route->group, route->metric, downstream->ie);
Referenced by processJoinPrunePacket().
◆ processJoinPrunePacket()
| void inet::PimDm::processJoinPrunePacket |
( |
Packet * |
pk | ) |
|
|
private |
477 const auto& pkt = pk->peekAtFront<PimJoinPrune>();
478 EV_INFO <<
"Received JoinPrune packet.\n";
482 auto ifTag = pk->getTag<InterfaceInd>();
483 NetworkInterface *incomingInterface =
ift->getInterfaceById(ifTag->getInterfaceId());
485 if (!incomingInterface) {
490 Ipv4Address upstreamNeighborAddress = pkt->getUpstreamNeighborAddress().unicastAddress.toIpv4();
491 int numRpfNeighbors =
pimNbt->getNumNeighbors(incomingInterface->getInterfaceId());
493 for (
unsigned int i = 0; i < pkt->getJoinPruneGroupsArraySize(); i++) {
494 JoinPruneGroup group = pkt->getJoinPruneGroups(i);
495 Ipv4Address groupAddr = group.getGroupAddress().groupAddress.toIpv4();
498 for (
unsigned int j = 0; j < group.getJoinedSourceAddressArraySize(); j++) {
499 const auto& source = group.getJoinedSourceAddress(j);
500 Route *route =
findRoute(source.sourceAddress.toIpv4(), groupAddr);
502 processJoin(route, incomingInterface->getInterfaceId(), numRpfNeighbors, upstreamNeighborAddress);
506 for (
unsigned int j = 0; j < group.getPrunedSourceAddressArraySize(); j++) {
507 const auto& source = group.getPrunedSourceAddress(j);
508 Route *route =
findRoute(source.sourceAddress.toIpv4(), groupAddr);
510 processPrune(route, incomingInterface->getInterfaceId(), pkt->getHoldTime(), numRpfNeighbors, upstreamNeighborAddress);
Referenced by handleMessageWhenUp().
◆ processOlistEmptyEvent()
| void inet::PimDm::processOlistEmptyEvent |
( |
Route * |
route | ) |
|
|
private |
◆ processOlistNonEmptyEvent()
| void inet::PimDm::processOlistNonEmptyEvent |
( |
Route * |
route | ) |
|
|
private |
◆ processOverrideTimer()
| void inet::PimDm::processOverrideTimer |
( |
cMessage * |
timer | ) |
|
|
private |
385 UpstreamInterface *upstream =
static_cast<UpstreamInterface *
>(timer->getContextPointer());
386 ASSERT(timer == upstream->overrideTimer);
389 Route *route = upstream->route();
390 EV_INFO <<
"OverrideTimer" << route <<
" expired.\n";
393 sendJoinPacket(upstream->rpfNeighbor(), route->source, route->group, upstream->getInterfaceId());
395 upstream->overrideTimer =
nullptr;
Referenced by handleMessageWhenUp().
◆ processPrune()
| void inet::PimDm::processPrune |
( |
Route * |
route, |
|
|
int |
intId, |
|
|
int |
holdTime, |
|
|
int |
numRpfNeighbors, |
|
|
Ipv4Address |
upstreamNeighborField |
|
) |
| |
|
private |
The method process PIM Prune packet.
First the method has to find correct outgoing interface where PIM Prune packet came to. The method also checks if there is still any forwarding outgoing interface. Forwarding interfaces, where Prune packet come to, goes to prune state. If all outgoing interfaces are pruned, the router will prune from multicast tree.
577 EV_INFO <<
"Processing Prune" << route <<
".\n";
584 UpstreamInterface *upstream = route->upstreamInterface;
585 if (upstream->ie->getInterfaceId() == intId && !upstream->isSourceDirectlyConnected()) {
593 if (!upstream->overrideTimer)
594 upstream->startOverrideTimer();
599 DownstreamInterface *downstream = route->findDownstreamInterfaceByInterfaceId(intId);
604 if (upstreamNeighborField != downstream->ie->getProtocolData<Ipv4InterfaceData>()->getIPAddress())
621 downstream->startPrunePendingTimer(prunePendingInterval);
629 EV <<
"Outgoing interface is already pruned, restart Prune Timer." << endl;
630 if (downstream->pruneTimer->getArrivalTime() < simTime() +
holdTime)
637 if (downstream->assertState == DownstreamInterface::I_LOST_ASSERT) {
644 sendAssertPacket(route->source, route->group, route->metric, downstream->ie);
Referenced by processJoinPrunePacket().
◆ processPrunePendingTimer()
| void inet::PimDm::processPrunePendingTimer |
( |
cMessage * |
timer | ) |
|
|
private |
341 DownstreamInterface *downstream =
static_cast<DownstreamInterface *
>(timer->getContextPointer());
342 ASSERT(timer == downstream->prunePendingTimer);
346 downstream->prunePendingTimer =
nullptr;
348 Route *route = downstream->route();
349 EV_INFO <<
"PrunePendingTimer" << route <<
" has expired.\n";
355 downstream->startPruneTimer(
holdTime);
360 if (route->isOilistNull())
Referenced by handleMessageWhenUp().
◆ processPruneTimer()
| void inet::PimDm::processPruneTimer |
( |
cMessage * |
timer | ) |
|
|
private |
305 DownstreamInterface *downstream =
static_cast<DownstreamInterface *
>(timer->getContextPointer());
306 ASSERT(timer == downstream->pruneTimer);
309 Route *route = downstream->route();
310 EV_INFO <<
"PruneTimer" << route <<
" expired.\n";
313 downstream->stopPruneTimer();
317 if (!route->isOilistNull())
Referenced by handleMessageWhenUp().
◆ processSourceActiveTimer()
| void inet::PimDm::processSourceActiveTimer |
( |
cMessage * |
timer | ) |
|
|
private |
406 UpstreamInterface *upstream =
static_cast<UpstreamInterface *
>(timer->getContextPointer());
407 ASSERT(timer == upstream->sourceActiveTimer);
410 Route *route = upstream->route();
411 EV_INFO <<
"SourceActiveTimer" << route <<
" expired.\n";
414 cancelAndDelete(upstream->stateRefreshTimer);
415 upstream->stateRefreshTimer =
nullptr;
418 Ipv4Address routeSource = route->source;
419 Ipv4Address routeGroup = route->group;
423 rt->deleteMulticastRoute(ipv4Route);
Referenced by handleMessageWhenUp().
◆ processStateRefreshPacket()
| void inet::PimDm::processStateRefreshPacket |
( |
Packet * |
pk | ) |
|
|
private |
The method is used to process PimStateRefresh packet.
The method checks if there is route in mroute and that packet has came to RPF interface. Then it goes through all outgoing interfaces. If the interface is pruned, it resets Prune Timer. For each interface State Refresh message is copied and correct prune indicator is set according to state of outgoing interface (pruned/forwarding).
State Refresh message is used to stop flooding of network each 3 minutes.
821 const auto& pkt = pk->peekAtFront<PimStateRefresh>();
822 EV <<
"pimDM::processStateRefreshPacket" << endl;
827 Route *route =
findRoute(pkt->getSourceAddress().unicastAddress.toIpv4(), pkt->getGroupAddress().groupAddress.toIpv4());
828 if (route ==
nullptr) {
834 auto ifTag = pk->getTag<InterfaceInd>();
835 Ipv4Address srcAddr = pk->getTag<
L3AddressInd>()->getSrcAddress().toIpv4();
836 UpstreamInterface *upstream = route->upstreamInterface;
837 if (ifTag->getInterfaceId() != upstream->getInterfaceId() || upstream->rpfNeighbor() != srcAddr) {
843 bool pruneIndicator = pkt->getP();
844 switch (upstream->graftPruneState) {
846 if (pruneIndicator) {
847 upstream->startOverrideTimer();
852 if (!pruneIndicator) {
853 if (!upstream->isPruneLimitTimerRunning()) {
855 upstream->startPruneLimitTimer();
859 upstream->startPruneLimitTimer();
863 if (pruneIndicator) {
864 if (!upstream->overrideTimer)
865 upstream->startOverrideTimer();
868 cancelAndDelete(upstream->graftRetryTimer);
869 upstream->graftRetryTimer =
nullptr;
881 if (pkt->getTtl() == 0) {
887 for (
unsigned int i = 0; i < route->downstreamInterfaces.size(); i++) {
888 DownstreamInterface *downstream = route->downstreamInterfaces[i];
890 if (downstream->assertState == DownstreamInterface::I_LOST_ASSERT)
897 sendStateRefreshPacket(pkt->getOriginatorAddress().unicastAddress.toIpv4(), route, downstream, pkt->getTtl() - 1);
902 if (downstream->assertState == DownstreamInterface::I_WON_ASSERT) {
913 AssertMetric receivedMetric(pkt->getMetricPreference(), pkt->getMetric(), srcAddr);
Referenced by handleMessageWhenUp().
◆ processStateRefreshTimer()
| void inet::PimDm::processStateRefreshTimer |
( |
cMessage * |
timer | ) |
|
|
private |
445 UpstreamInterface *upstream =
static_cast<UpstreamInterface *
>(timer->getContextPointer());
446 ASSERT(timer == upstream->stateRefreshTimer);
449 Route *route = upstream->route();
451 EV_INFO <<
"StateRefreshTimer" << route <<
" expired.\n";
453 EV_DETAIL <<
"Sending StateRefresh packets on downstream interfaces.\n";
454 for (
unsigned int i = 0; i < route->downstreamInterfaces.size(); i++) {
455 DownstreamInterface *downstream = route->downstreamInterfaces[i];
457 if (downstream->assertState == DownstreamInterface::I_LOST_ASSERT)
466 Ipv4Address originator = downstream->ie->getProtocolData<Ipv4InterfaceData>()->getIPAddress();
Referenced by handleMessageWhenUp().
◆ pruneStateString()
◆ receiveSignal()
| void inet::PimDm::receiveSignal |
( |
cComponent * |
source, |
|
|
simsignal_t |
signalID, |
|
|
cObject * |
obj, |
|
|
cObject * |
details |
|
) |
| |
|
overrideprivate |
199 Enter_Method(
"%s", cComponent::getSignalName(signalID));
202 const Ipv4Header *ipv4Header;
203 PimInterface *pimInterface;
208 ipv4Header = check_and_cast<const Ipv4Header *>(obj);
215 const Ipv4MulticastGroupInfo *info = check_and_cast<const Ipv4MulticastGroupInfo *>(obj);
216 pimInterface =
pimIft->getInterfaceById(info->ie->getInterfaceId());
222 const Ipv4MulticastGroupInfo *info = check_and_cast<const Ipv4MulticastGroupInfo *>(obj);
223 pimInterface =
pimIft->getInterfaceById(info->ie->getInterfaceId());
229 ipv4Header = check_and_cast<const Ipv4Header *>(obj);
236 ipv4Header = check_and_cast<const Ipv4Header *>(obj);
243 const Ipv4Route *entry = check_and_cast<const Ipv4Route *>(obj);
244 for (
int i = 0; i <
rt->getNumMulticastRoutes(); i++) {
246 Ipv4MulticastRoute *route =
rt->getMulticastRoute(i);
248 Ipv4Address source = route->getOrigin();
249 Ipv4Route *routeToSource =
rt->findBestMatchingRoute(source);
250 NetworkInterface *newRpfInterface = routeToSource->getInterface();
251 NetworkInterface *oldRpfInterface = route->getInInterface()->getInterface();
254 if (newRpfInterface != oldRpfInterface)
◆ restartTimer()
| void inet::PimDm::restartTimer |
( |
cMessage * |
timer, |
|
|
double |
interval |
|
) |
| |
|
private |
◆ rpfInterfaceHasChanged()
The method process notification about interface change.
Multicast routing table will be changed if RPF interface has changed. New RPF interface is set to route and is removed from outgoing interfaces. On the other hand, old RPF interface is added to outgoing interfaces. If route was not pruned, the router has to join to the multicast tree again (by different path).
1365 NetworkInterface *newRpf = routeToSource->getInterface();
1366 Ipv4Address source = ipv4Route->getOrigin();
1367 Ipv4Address group = ipv4Route->getMulticastGroup();
1368 int rpfId = newRpf->getInterfaceId();
1370 EV_DETAIL <<
"New RPF interface for group=" << group <<
" source=" << source <<
" is " << newRpf->getInterfaceName() << endl;
1372 Route *route =
findRoute(source, group);
1376 UpstreamInterface *oldUpstreamInterface = route->upstreamInterface;
1377 NetworkInterface *oldRpfInterface = oldUpstreamInterface ? oldUpstreamInterface->ie :
nullptr;
1378 delete oldUpstreamInterface;
1379 delete ipv4Route->getInInterface();
1380 ipv4Route->setInInterface(
nullptr);
1384 Ipv4Address newRpfNeighbor =
pimNbt->getNeighbor(rpfId, 0)->getAddress();
1385 UpstreamInterface *upstream = route->upstreamInterface =
new UpstreamInterface(route, newRpf, newRpfNeighbor, isSourceDirectlyConnected);
1386 ipv4Route->setInInterface(
new IMulticastRoute::InInterface(newRpf));
1389 DownstreamInterface *oldDownstreamInterface = route->removeDownstreamInterface(newRpf->getInterfaceId());
1390 if (oldDownstreamInterface) {
1391 ipv4Route->removeOutInterface(newRpf);
1392 delete oldDownstreamInterface;
1396 if (oldRpfInterface && oldRpfInterface->isUp()) {
1397 DownstreamInterface *downstream = route->createDownstreamInterface(oldRpfInterface);
1398 ipv4Route->addOutInterface(
new PimDmOutInterface(oldRpfInterface, downstream));
1401 bool isOlistNull = route->isOilistNull();
1406 if (!isOlistNull && !upstream->isSourceDirectlyConnected()) {
1413 upstream->stopPruneLimitTimer();
1417 upstream->startGraftRetryTimer();
1421 else if (isOlistNull) {
1423 upstream->stopPruneLimitTimer();
1426 cancelAndDelete(upstream->graftRetryTimer);
1427 upstream->graftRetryTimer =
nullptr;
Referenced by receiveSignal().
◆ sendAssertPacket()
1587 EV_INFO <<
"Sending Assert(S= " << source <<
", G= " << group <<
") message on interface '" << ie->getInterfaceName() <<
"'\n";
1589 Packet *packet =
new Packet(
"PimAssert");
1590 const auto& pkt = makeShared<PimAssert>();
1591 pkt->getGroupAddressForUpdate().groupAddress = group;
1592 pkt->getSourceAddressForUpdate().unicastAddress = source;
1594 pkt->setMetricPreference(metric.preference);
1595 pkt->setMetric(metric.metric);
1601 pkt->setCrcMode(
pimModule->getCrcMode());
1603 packet->insertAtFront(pkt);
Referenced by multicastPacketArrivedOnNonRpfInterface(), processAssert(), processGraft(), processJoin(), and processPrune().
◆ sendGraftAckPacket()
| void inet::PimDm::sendGraftAckPacket |
( |
Packet * |
pk, |
|
|
const Ptr< const PimGraft > & |
graftPacket |
|
) |
| |
|
private |
1536 EV_INFO <<
"Sending GraftAck message.\n";
1538 auto ifTag = pk->getTag<InterfaceInd>();
1540 Ipv4Address destAddr = addressInd->getSrcAddress().toIpv4();
1541 Ipv4Address srcAddr = addressInd->getDestAddress().toIpv4();
1542 int outInterfaceId = ifTag->getInterfaceId();
1544 Packet *packet =
new Packet(
"PIMGraftAck");
1545 auto msg = dynamicPtrCast<PimGraft>(graftPacket->dupShared());
1547 msg->setCrcMode(
pimModule->getCrcMode());
1549 packet->insertAtFront(msg);
1553 sendToIP(packet, srcAddr, destAddr, outInterfaceId);
Referenced by processGraftPacket().
◆ sendGraftPacket()
1504 EV_INFO <<
"Sending Graft(S=" << src <<
", G=" << grp <<
") message to neighbor '" << nextHop <<
"' on interface '" << intId <<
"'\n";
1506 Packet *packet =
new Packet(
"PimGraft");
1507 const auto& msg = makeShared<PimGraft>();
1508 msg->setHoldTime(0);
1509 msg->getUpstreamNeighborAddressForUpdate().unicastAddress = nextHop;
1511 msg->setJoinPruneGroupsArraySize(1);
1512 JoinPruneGroup& group = msg->getJoinPruneGroupsForUpdate(0);
1513 group.getGroupAddressForUpdate().groupAddress = grp;
1514 group.setJoinedSourceAddressArraySize(1);
1515 auto& address = group.getJoinedSourceAddressForUpdate(0);
1516 address.sourceAddress = src;
1519 msg->setCrcMode(
pimModule->getCrcMode());
1521 packet->insertAtFront(msg);
Referenced by processGraftRetryTimer(), processOlistNonEmptyEvent(), and rpfInterfaceHasChanged().
◆ sendJoinPacket()
1468 ASSERT(!src.isUnspecified());
1469 ASSERT(grp.isMulticast());
1471 EV_INFO <<
"Sending Join(S=" << src <<
", G=" << grp <<
") message to neighbor '" << nextHop <<
"' on interface '" << intId <<
"'\n";
1473 Packet *packet =
new Packet(
"PIMJoin");
1474 const auto& msg = makeShared<PimJoinPrune>();
1475 msg->getUpstreamNeighborAddressForUpdate().unicastAddress = nextHop;
1476 msg->setHoldTime(0);
1479 msg->setJoinPruneGroupsArraySize(1);
1480 JoinPruneGroup& group = msg->getJoinPruneGroupsForUpdate(0);
1481 group.getGroupAddressForUpdate().groupAddress = grp;
1482 group.setJoinedSourceAddressArraySize(1);
1483 auto& address = group.getJoinedSourceAddressForUpdate(0);
1484 address.sourceAddress = src;
1487 msg->setCrcMode(
pimModule->getCrcMode());
1489 packet->insertAtFront(msg);
Referenced by processOverrideTimer().
◆ sendPrunePacket()
1438 ASSERT(!src.isUnspecified());
1439 ASSERT(grp.isMulticast());
1441 EV_INFO <<
"Sending Prune(S=" << src <<
", G=" << grp <<
") message to neighbor '" << nextHop <<
"' on interface '" << intId <<
"'\n";
1443 Packet *packet =
new Packet(
"PIMPrune");
1444 const auto& msg = makeShared<PimJoinPrune>();
1445 msg->getUpstreamNeighborAddressForUpdate().unicastAddress = nextHop;
1449 msg->setJoinPruneGroupsArraySize(1);
1450 JoinPruneGroup& group = msg->getJoinPruneGroupsForUpdate(0);
1451 group.getGroupAddressForUpdate().groupAddress = grp;
1452 group.setPrunedSourceAddressArraySize(1);
1453 auto& address = group.getPrunedSourceAddressForUpdate(0);
1454 address.sourceAddress = src;
1457 msg->setCrcMode(
pimModule->getCrcMode());
1459 packet->insertAtFront(msg);
Referenced by multicastPacketArrivedOnNonRpfInterface(), multicastPacketArrivedOnRpfInterface(), processAssert(), processOlistEmptyEvent(), and processStateRefreshPacket().
◆ sendStateRefreshPacket()
1558 EV_INFO <<
"Sending StateRefresh(S=" << route->source <<
", G=" << route->group
1559 <<
") message on interface '" << downstream->ie->getInterfaceName() <<
"'\n";
1561 Packet *packet =
new Packet(
"PimStateRefresh");
1562 const auto& msg = makeShared<PimStateRefresh>();
1563 msg->getGroupAddressForUpdate().groupAddress = route->group;
1564 msg->getSourceAddressForUpdate().unicastAddress = route->source;
1565 msg->getOriginatorAddressForUpdate().unicastAddress = originator;
1576 msg->setCrcMode(
pimModule->getCrcMode());
1578 packet->insertAtFront(msg);
Referenced by processStateRefreshPacket(), and processStateRefreshTimer().
◆ sendToIP()
◆ stopPIMRouting()
| void inet::PimDm::stopPIMRouting |
( |
| ) |
|
|
protectedvirtual |
◆ unroutableMulticastPacketArrived()
| void inet::PimDm::unroutableMulticastPacketArrived |
( |
Ipv4Address |
source, |
|
|
Ipv4Address |
group, |
|
|
unsigned short |
ttl |
|
) |
| |
|
private |
The method process notification about new multicast data stream.
It goes through all PIM interfaces and tests them if they can be added to the list of outgoing interfaces. If there is no interface on the list at the end, the router will prune from the multicast tree.
1057 ASSERT(!source.isUnspecified());
1058 ASSERT(group.isMulticast());
1060 EV_DETAIL <<
"New multicast source observed: source=" << source <<
", group=" << group <<
".\n";
1062 Ipv4Route *routeToSrc =
rt->findBestMatchingRoute(source);
1063 if (!routeToSrc || !routeToSrc->getInterface()) {
1064 EV <<
"ERROR: PimDm::newMulticast(): cannot find RPF interface, routing information is missing.";
1068 PimInterface *rpfInterface =
pimIft->getInterfaceById(routeToSrc->getInterface()->getInterfaceId());
1074 Ipv4Address rpfNeighbor = routeToSrc->getGateway().isUnspecified() ? source : routeToSrc->getGateway();
1076 Route *route =
new Route(
this, source, group);
1077 routes[SourceAndGroup(source, group)] = route;
1079 route->upstreamInterface =
new UpstreamInterface(route, rpfInterface->getInterfacePtr(), rpfNeighbor, isSourceDirectlyConnected);
1082 if (isSourceDirectlyConnected) {
1084 if (rpfInterface->getSR())
1085 route->upstreamInterface->startStateRefreshTimer();
1086 route->upstreamInterface->startSourceActiveTimer();
1087 route->upstreamInterface->maxTtlSeen = ttl;
1090 bool allDownstreamInterfacesArePruned =
true;
1093 for (
int i = 0; i <
pimIft->getNumInterfaces(); i++) {
1094 PimInterface *pimInterface =
pimIft->getInterface(i);
1100 bool hasPIMNeighbors =
pimNbt->getNumNeighbors(pimInterface->getInterfaceId()) > 0;
1101 bool hasConnectedReceivers = pimInterface->getInterfacePtr()->getProtocolData<Ipv4InterfaceData>()->hasMulticastListener(group);
1104 if (hasPIMNeighbors || hasConnectedReceivers) {
1106 DownstreamInterface *downstream = route->createDownstreamInterface(pimInterface->getInterfacePtr());
1107 downstream->setHasConnectedReceivers(hasConnectedReceivers);
1108 allDownstreamInterfacesArePruned =
false;
1113 if (allDownstreamInterfacesArePruned) {
1114 EV_DETAIL <<
"There is no outgoing interface for multicast, will send Prune message to upstream.\n";
1121 Ipv4MulticastRoute *newRoute =
new Ipv4MulticastRoute();
1122 newRoute->setOrigin(source);
1124 newRoute->setMulticastGroup(group);
1126 newRoute->setSource(
this);
1127 newRoute->setInInterface(
new IMulticastRoute::InInterface(route->upstreamInterface->ie));
1128 for (
auto& elem : route->downstreamInterfaces) {
1129 DownstreamInterface *downstream = elem;
1130 newRoute->addOutInterface(
new PimDmOutInterface(downstream->ie, downstream));
1133 rt->addMulticastRoute(newRoute);
1134 EV_DETAIL <<
"New route was added to the multicast routing table.\n";
Referenced by receiveSignal().
◆ operator<<
| std::ostream& operator<< |
( |
std::ostream & |
out, |
|
|
const PimDm::Route & |
sourceGroup |
|
) |
| |
|
friend |
1930 out <<
"Upstream interface ";
1931 if (!route.upstreamInterface)
1934 out <<
"(name: " << route.upstreamInterface->ie->getInterfaceName() <<
" ";
1935 out <<
"RpfNeighbor: " << route.upstreamInterface->rpfNeighbor() <<
" ";
1937 auto t1 = route.upstreamInterface->getGraftRetryTimer();
1938 out <<
"graftRetryTimer: " << (t1 ? t1->getArrivalTime() : 0) <<
" ";
1939 auto t2 = route.upstreamInterface->getOverrideTimer();
1940 out <<
"overrideTimer: " << (t2 ? t2->getArrivalTime() : 0) <<
" ";
1941 out <<
"lastPruneSentTime: " << route.upstreamInterface->getLastPruneSentTime() <<
" ";
1943 auto t3 = route.upstreamInterface->getSourceActiveTimer();
1944 out <<
"sourceActiveTimer: " << (t3 ? t3->getArrivalTime() : 0) <<
" ";
1945 auto t4 = route.upstreamInterface->getStateRefreshTimer();
1946 out <<
"stateRefreshTimer: " << (t4 ? t4->getArrivalTime() : 0) <<
" ";
1947 out <<
"maxTtlSeen: " << route.upstreamInterface->getMaxTtlSeen() <<
") ";
1950 out <<
"Downstream interfaces ";
1951 if (route.downstreamInterfaces.empty())
1953 for (
unsigned int i = 0; i < route.downstreamInterfaces.size(); ++i) {
1954 out <<
"(name: " << route.downstreamInterfaces[i]->ie->getInterfaceName() <<
" ";
1956 auto t1 = route.downstreamInterfaces[i]->getPruneTimer();
1957 out <<
"pruneTimer: " << (t1 ? t1->getArrivalTime() : 0) <<
" ";
1958 auto t2 = route.downstreamInterfaces[i]->getPrunePendingTimer();
1959 out <<
"prunePendingTimer: " << (t2 ? t2->getArrivalTime() : 0) <<
") ";
◆ assertTime
| double inet::PimDm::assertTime = 0 |
|
private |
◆ graftRetryInterval
| double inet::PimDm::graftRetryInterval = 0 |
|
private |
◆ overrideInterval
| double inet::PimDm::overrideInterval = 0 |
|
private |
◆ propagationDelay
| double inet::PimDm::propagationDelay = 0 |
|
private |
◆ pruneInterval
| double inet::PimDm::pruneInterval = 0 |
|
private |
◆ pruneLimitInterval
| double inet::PimDm::pruneLimitInterval = 0 |
|
private |
◆ rcvdAssertPkSignal
| simsignal_t inet::PimDm::rcvdAssertPkSignal = registerSignal("rcvdAssertPk") |
|
staticprivate |
◆ rcvdGraftAckPkSignal
| simsignal_t inet::PimDm::rcvdGraftAckPkSignal = registerSignal("rcvdGraftAckPk") |
|
staticprivate |
◆ rcvdGraftPkSignal
| simsignal_t inet::PimDm::rcvdGraftPkSignal = registerSignal("rcvdGraftPk") |
|
staticprivate |
◆ rcvdJoinPrunePkSignal
| simsignal_t inet::PimDm::rcvdJoinPrunePkSignal = registerSignal("rcvdJoinPrunePk") |
|
staticprivate |
◆ rcvdStateRefreshPkSignal
| simsignal_t inet::PimDm::rcvdStateRefreshPkSignal = registerSignal("rcvdStateRefreshPk") |
|
staticprivate |
◆ routes
◆ sentAssertPkSignal
| simsignal_t inet::PimDm::sentAssertPkSignal = registerSignal("sentAssertPk") |
|
staticprivate |
◆ sentGraftAckPkSignal
| simsignal_t inet::PimDm::sentGraftAckPkSignal = registerSignal("sentGraftAckPk") |
|
staticprivate |
◆ sentGraftPkSignal
| simsignal_t inet::PimDm::sentGraftPkSignal = registerSignal("sentGraftPk") |
|
staticprivate |
◆ sentJoinPrunePkSignal
| simsignal_t inet::PimDm::sentJoinPrunePkSignal = registerSignal("sentJoinPrunePk") |
|
staticprivate |
◆ sentStateRefreshPkSignal
| simsignal_t inet::PimDm::sentStateRefreshPkSignal = registerSignal("sentStateRefreshPk") |
|
staticprivate |
◆ sourceActiveInterval
| double inet::PimDm::sourceActiveInterval = 0 |
|
private |
◆ stateRefreshInterval
| double inet::PimDm::stateRefreshInterval = 0 |
|
private |
The documentation for this class was generated from the following files:
Ipv4MulticastRoute * findIpv4MulticastRoute(Ipv4Address group, Ipv4Address source)
Definition: PimDm.cc:1703
cModule * findContainingNode(const cModule *from)
Find the node containing the given module.
Definition: ModuleAccess.cc:31
void processAssert(Interface *downstream, AssertMetric receivedMetric, int stateRefreshInterval)
Definition: PimDm.cc:922
simsignal_t ipv4DataOnRpfSignal
Definition: Simsignals.cc:58
@ FORWARDING
Definition: PimDm.h:40
double assertTime
Definition: PimDm.h:161
@ NO_ASSERT_INFO
Definition: PimBase.h:74
void rpfInterfaceHasChanged(Ipv4MulticastRoute *route, Ipv4Route *routeToSource)
The method process notification about interface change.
Definition: PimDm.cc:1363
void sendToIP(Packet *packet, Ipv4Address source, Ipv4Address dest, int outInterfaceId)
Definition: PimDm.cc:1610
@ ORIGINATOR
Definition: PimDm.h:45
@ Hello
Definition: PimPacket_m.h:93
void sendJoinPacket(Ipv4Address nextHop, Ipv4Address source, Ipv4Address group, int interfaceId)
Definition: PimDm.cc:1466
void processGraft(Ipv4Address source, Ipv4Address group, Ipv4Address sender, int intId)
The method is used to process PimGraft packet.
Definition: PimDm.cc:711
void sendAssertPacket(Ipv4Address source, Ipv4Address group, AssertMetric metric, NetworkInterface *ie)
Definition: PimDm.cc:1585
void processSourceActiveTimer(cMessage *timer)
Definition: PimDm.cc:404
const static std::string originatorStateString(UpstreamInterface::OriginatorState os)
Definition: PimDm.cc:1978
const B PIM_HEADER_LENGTH
Definition: PimPacket_m.h:68
ModuleRefByPar< IInterfaceTable > ift
Definition: PimBase.h:147
virtual void handleCrashOperation(LifecycleOperation *operation) override
Definition: PimBase.cc:88
void processOlistNonEmptyEvent(Route *route)
Definition: PimDm.cc:1656
@ ACK_PENDING
Definition: PimDm.h:42
static simsignal_t sentJoinPrunePkSignal
Definition: PimDm.h:168
@ SourceActiveTimer
Definition: PimBase.h:133
double propagationDelay
Definition: PimDm.h:157
static const Protocol ipv4
Definition: Protocol.h:93
void restartTimer(cMessage *timer, double interval)
Definition: PimDm.cc:1685
static simsignal_t sentStateRefreshPkSignal
Definition: PimDm.h:172
void deleteRoute(Ipv4Address source, Ipv4Address group)
Definition: PimDm.cc:1720
const B ENCODED_GROUP_ADDRESS_LENGTH
Definition: PimPacket_m.h:70
@ DenseMode
Definition: PimInterfaceTable.h:25
@ I_WON_ASSERT
Definition: PimBase.h:74
void processAssertTimer(cMessage *timer)
Definition: PimDm.cc:265
@ PIM_DM
managed by PIM-DM router
Definition: IRoute.h:168
bool isEnabled
Definition: PimBase.h:153
removed InterfaceReq
Definition: IUdp-gates.txt:11
RoutingTable routes
Definition: PimDm.h:176
removed DscpReq Ipv4ControlInfo Ipv6ControlInfo up L3AddressInd DispatchProtocolReq L4PortInd Ipv4ControlInfo Ipv6ControlInfo down DispatchProtocolReq
Definition: IUdp-gates.txt:25
void printSignalBanner(simsignal_t signalID, const cObject *obj, const cObject *details)
Utility function.
Definition: Simsignals.cc:126
static simsignal_t rcvdStateRefreshPkSignal
Definition: PimDm.h:173
removed DscpReq Ipv4ControlInfo Ipv6ControlInfo up L3AddressInd L3AddressInd
Definition: IUdp-gates.txt:20
static simsignal_t rcvdAssertPkSignal
Definition: PimDm.h:171
opp_component_ptr< Pim > pimModule
Definition: PimBase.h:150
void multicastReceiverAdded(NetworkInterface *ie, Ipv4Address newAddr)
Definition: PimDm.cc:1143
void clearRoutes()
Definition: PimDm.cc:1729
@ UpstreamOverrideTimer
Definition: PimBase.h:131
@ NO_INFO
Definition: PimDm.h:96
@ PRUNED
Definition: PimDm.h:41
void multicastPacketArrivedOnRpfInterface(int interfaceId, Ipv4Address group, Ipv4Address source, unsigned short ttl)
Definition: PimDm.cc:1285
void processGraftAckPacket(Packet *pk)
Definition: PimDm.cc:770
static simsignal_t rcvdGraftAckPkSignal
Definition: PimDm.h:167
static void insertCrc(const Ptr< PimPacket > &pimPacket)
Definition: Pim.cc:103
PimInterface * getIncomingInterface(NetworkInterface *fromIE)
Definition: PimDm.cc:1696
@ PrunePendingTimer
Definition: PimBase.h:127
static const Ipv4Address ALL_PIM_ROUTERS_MCAST
Definition: PimBase.h:143
Route * findRoute(Ipv4Address source, Ipv4Address group)
Definition: PimDm.cc:1714
double sourceActiveInterval
Definition: PimDm.h:159
virtual void handleStartOperation(LifecycleOperation *operation) override
Definition: PimBase.cc:60
removed DscpReq Ipv4ControlInfo Ipv6ControlInfo up L3AddressInd DispatchProtocolReq L4PortInd Ipv4ControlInfo Ipv6ControlInfo down PacketProtocolTag
Definition: IUdp-gates.txt:25
simsignal_t ipv4NewMulticastSignal
Definition: Simsignals.cc:56
static const Ipv4Address ALLONES_ADDRESS
255.255.255.255
Definition: Ipv4Address.h:94
@ StateRefresh
Definition: PimPacket_m.h:102
@ PruneLimitTimer
Definition: PimBase.h:132
void sendGraftAckPacket(Packet *pk, const Ptr< const PimGraft > &graftPacket)
Definition: PimDm.cc:1534
static const Protocol pim
Definition: Protocol.h:103
void processAssertPacket(Packet *pk)
Definition: PimDm.cc:648
@ StateRefreshTimer
Definition: PimBase.h:134
PimBase(PimInterface::PimMode mode)
Definition: PimBase.h:170
intscale< b, 1, 8 > B
Definition: Units.h:1168
@ PruneTimer
Definition: PimBase.h:126
static simsignal_t rcvdGraftPkSignal
Definition: PimDm.h:165
@ PRUNE_PENDING
Definition: PimDm.h:97
@ I_LOST_ASSERT
Definition: PimBase.h:74
void sendStateRefreshPacket(Ipv4Address originator, Route *route, DownstreamInterface *downstream, unsigned short ttl)
Definition: PimDm.cc:1556
static bool maskedAddrAreEqual(const Ipv4Address &addr1, const Ipv4Address &addr2, const Ipv4Address &netmask)
Test if the masked addresses (ie the mask is applied to addr1 and addr2) are equal.
Definition: Ipv4Address.cc:249
const static std::string pruneStateString(DownstreamInterface::PruneState ps)
Definition: PimDm.cc:1988
simsignal_t ipv4MulticastGroupRegisteredSignal
Definition: Simsignals.cc:52
void processOlistEmptyEvent(Route *route)
Definition: PimDm.cc:1630
removed HopLimitReq
Definition: IUdp-gates.txt:11
static simsignal_t sentGraftPkSignal
Definition: PimDm.h:164
ModuleRefByPar< PimInterfaceTable > pimIft
Definition: PimBase.h:148
void multicastReceiverRemoved(NetworkInterface *ie, Ipv4Address oldAddr)
The method process notification about multicast groups removed from interface.
Definition: PimDm.cc:1190
void processStateRefreshPacket(Packet *pk)
The method is used to process PimStateRefresh packet.
Definition: PimDm.cc:819
void processPrune(Route *route, int intId, int holdTime, int numRpfNeighbors, Ipv4Address upstreamNeighborField)
The method process PIM Prune packet.
Definition: PimDm.cc:575
simsignal_t interfaceStateChangedSignal
Definition: Simsignals.cc:32
INET_API InitStage INITSTAGE_LOCAL
Initialization of local state that don't use or affect other modules includes:
@ Graft
Definition: PimPacket_m.h:99
simsignal_t routeAddedSignal
Definition: Simsignals.cc:41
double pruneInterval
Definition: PimDm.h:154
const B ENCODED_SOURCE_ADDRESS_LENGTH
Definition: PimPacket_m.h:71
void processJoinPrunePacket(Packet *pk)
Definition: PimDm.cc:475
#define NUM_INIT_STAGES
Definition: InitStageRegistry.h:73
simsignal_t ipv4DataOnNonrpfSignal
Definition: Simsignals.cc:57
double max(const double a, const double b)
Returns the maximum of a and b.
Definition: SctpAssociation.h:266
double holdTime
Definition: PimBase.h:158
void processPruneTimer(cMessage *timer)
Definition: PimDm.cc:303
@ PRUNED
Definition: PimDm.h:98
void processHelloTimer(cMessage *timer)
Definition: PimBase.cc:95
static simsignal_t sentGraftAckPkSignal
Definition: PimDm.h:166
void processJoin(Route *route, int intId, int numRpfNeighbors, Ipv4Address upstreamNeighborField)
Definition: PimDm.cc:517
ModuleRefByPar< PimNeighborTable > pimNbt
Definition: PimBase.h:149
void sendGraftPacket(Ipv4Address nextHop, Ipv4Address src, Ipv4Address grp, int intId)
Definition: PimDm.cc:1502
void unroutableMulticastPacketArrived(Ipv4Address srcAddress, Ipv4Address destAddress, unsigned short ttl)
The method process notification about new multicast data stream.
Definition: PimDm.cc:1055
void processGraftPacket(Packet *pk)
Definition: PimDm.cc:673
double stateRefreshInterval
Definition: PimDm.h:160
static const Ipv4Address UNSPECIFIED_ADDRESS
0.0.0.0
Definition: Ipv4Address.h:91
#define Enter_Method(...)
Definition: SelfDoc.h:71
pico< s >::type ps
Definition: Units.h:1073
simsignal_t ipv4MulticastGroupUnregisteredSignal
Definition: Simsignals.cc:53
double pruneLimitInterval
Definition: PimDm.h:155
static simsignal_t sentAssertPkSignal
Definition: PimDm.h:170
double graftRetryInterval
Definition: PimDm.h:158
void processPrunePendingTimer(cMessage *timer)
Definition: PimDm.cc:339
static simsignal_t rcvdJoinPrunePkSignal
Definition: PimDm.h:169
void sendPrunePacket(Ipv4Address nextHop, Ipv4Address src, Ipv4Address grp, int holdTime, int intId)
Definition: PimDm.cc:1436
void processGraftRetryTimer(cMessage *timer)
Definition: PimDm.cc:364
@ AssertTimer
Definition: PimBase.h:125
virtual void stopPIMRouting()
Definition: PimDm.cc:91
double overrideInterval
Definition: PimDm.h:156
@ Assert
Definition: PimPacket_m.h:98
@ GraftRetryTimer
Definition: PimBase.h:130
const B ENCODED_UNICODE_ADDRESS_LENGTH
Definition: PimPacket_m.h:69
void processOverrideTimer(cMessage *timer)
Definition: PimDm.cc:383
virtual void handleStopOperation(LifecycleOperation *operation) override
Definition: PimBase.cc:81
void multicastPacketArrivedOnNonRpfInterface(Ipv4Address group, Ipv4Address source, int interfaceId)
The method has to solve the problem when multicast data appears on non-RPF interface.
Definition: PimDm.cc:1223
@ IFACENETMASK
comes from an interface's netmask
Definition: IRoute.h:30
virtual void initialize(int stage) override
Definition: PimBase.cc:37
const static std::string graftPruneStateString(UpstreamInterface::GraftPruneState ps)
Definition: PimDm.cc:1966
void processStateRefreshTimer(cMessage *timer)
Definition: PimDm.cc:443
void processHelloPacket(Packet *pk)
Definition: PimBase.cc:153
@ HelloTimer
Definition: PimBase.h:121
@ NOT_ORIGINATOR
Definition: PimDm.h:45
@ GraftAck
Definition: PimPacket_m.h:100
@ JoinPrune
Definition: PimPacket_m.h:96
ModuleRefByPar< IIpv4RoutingTable > rt
Definition: PimBase.h:146