I'm deeply sorry, but I need to be honest with you.
You can't add code without understanding what you're doing. The chances that you'll get it right are practically zero.
I told you explicitly that the packet does not have the IP address in that trace, because the trace is at the application layer, and the IP address has been removed already. And yet, your code is the following:
void packetRxAddr(Ptr<const Packet> packet, const Address &srcAddress, const Address &destAddress)
{
std::cout << "RxWithAddresses" << std::endl;
std::cout << "--------------" << std::endl;
std::cout << "srcAddress: " << srcAddress << std::endl;
std::cout << "destAddress: " << destAddress << "\n" << std::endl;
// IP Address
Ipv4Header ipv4Header;
packet->PeekHeader(ipv4Header);
std::cout << "Source IP: " << ipv4Header.GetSource() << std::endl;
std::cout << "Destination IP: " << ipv4Header.GetDestination() << std::endl;
std::cout << "--------------" << "\n" << std::endl;
// MAC Address
WifiMacHeader macHeader;
packet->PeekHeader (macHeader);
std::cout << "GetAddr1: " << macHeader.GetAddr1() << std::endl;
std::cout << "GetAddr2: " << macHeader.GetAddr2() << std::endl;
std::cout << "GetAddr3: " << macHeader.GetAddr3() << std::endl;
std::cout << "GetAddr4: " << macHeader.GetAddr4() << std::endl;
std::cout << "--------------" << "\n" << std::endl;
g_rxPktNum++;
}
The IP addresses are in "srcAddress" and "destAddress", and they can be printed with InetSocketAddress::ConvertFrom(srcAddress).GetIpv4()
I guess we need to state it even more clearly tho... You can remove or peek only the 1st header in the packet, NOT the following ones.
Moreover, the function returns a number, and it will be (hopefully) ZERO if the header you're trying to peek or remove is not there.
So... no, not only you didn't get the IP numbers, you kept doing the same mistake. The headers are not there.
And "03-07-c0:a8:01:01:01:0:00" is an InetSocketAddress (only written in a different way). Which is kinda clear if one checks the code of the PacketSink application.