The PppHeader is a header used in PointToPoint networks /typically) by the PPP protocol, which is a L2.5 protocol (i.e., a protocol to adapt the underlying network to IP).
The IP header is... the IP header.
If the network is IP and it also uses PPP, in the packet you'll find first the PPP header, then the IP header.
Your code doesn't work because in ns-3 you have to remove the headers like in a stack. You can't remove a header before removing the headers in front of it. Since, most likely, your function is being called by a NetDevice callback, you'll have to remove the right headers before arriving at the IP one. Which headers... no idea.
Now, if there are no errors in the code, RemoveHeader should return zero if the header wasn't removed, for example because it's not there. However there are caveats - some headers might be mistaken for others. Hence, it's always a good idea to start with what YOU know about the packet, and proceed to a manual deserialisation, but I guess that this is beyond what you want to do.
About why you have 102.102.102.102, that's the IP address that is returned when the header is not removed correctly: it reverts the address to its default value (which we decided it's 102.102.102.102 to indicate a non-initialised address).
How you fix it?
That's the neat part: you don't (easily). The easiest way (but also the slower) is to leverage the packet printing:
- Use Packet::EnablePrinting () at the beginning of the script
- Print the packet to a std::string
- Parse the string
Beware: it's slow as hell.