Check out example codes for "router solicitation and advertisement magic is used by". It will help you in understanding the concepts better.

Code Example 1

ICMP

Learn ReactJs, React Native from akashmittal.com