Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query if PingApp is doing as documented - Every interface, or every address? #10

Open
edlongman opened this issue May 7, 2021 · 0 comments

Comments

@edlongman
Copy link
Owner

PingApp is documented as sending to each interface, however it actually sends to each assigned address, so multiple Ipv6Addresses on the same interface or having both Ipv4 and Ipv6 addresses will result in multiple (consecutive) messages to that node.

See documentation saying every interface: https://doc.omnetpp.org/inet/api-current/neddoc/inet.applications.pingapp.PingApp.html

But code

std::vector<L3Address> PingApp::getAllAddresses()
{
std::vector<L3Address> result;
int lastId = getSimulation()->getLastComponentId();
for (int i = 0; i <= lastId; i++) {
IInterfaceTable *ift = dynamic_cast<IInterfaceTable *>(getSimulation()->getModule(i));
if (ift) {
for (int j = 0; j < ift->getNumInterfaces(); j++) {
NetworkInterface *ie = ift->getInterface(j);
if (ie && !ie->isLoopback()) {
#ifdef INET_WITH_IPv4
auto ipv4Data = ie->findProtocolData<Ipv4InterfaceData>();
if (ipv4Data != nullptr) {
Ipv4Address address = ipv4Data->getIPAddress();
if (!address.isUnspecified())
result.push_back(L3Address(address));
}
#endif // ifdef INET_WITH_IPv4
#ifdef INET_WITH_IPv6
auto ipv6Data = ie->findProtocolData<Ipv6InterfaceData>();
if (ipv6Data != nullptr) {
for (int k = 0; k < ipv6Data->getNumAddresses(); k++) {
Ipv6Address address = ipv6Data->getAddress(k);
if (!address.isUnspecified() && address.isGlobal())
result.push_back(L3Address(address));
}
}
#endif // ifdef INET_WITH_IPv6
}
}
}
}
return result;
}

Also, Ping app doesn't work for the destAddresses=* when using NextHopAddresses

Also, destAddresess is inconsistent with destAddr parameter of Udp...App

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant