We have created an object with the help of which we will want to send the ping to the IP address: 8.8.8.8 and open the socket. If the socket returns minus 1, then the socket in question has not been established. The time calculation for RTT measurement is carried out from the moment the message was sent until the moment we received an ack. With the help of recvform we are waiting for a response from the destination. Receiving the message reads when we received an amount greater than 0. And then we will close the RTT.
Terminal run:
wireshark:
Packet sniffers are programs that intercept the network traffic flowing in and out of a system through network interfaces.
So if you are browsing the internet then traffic is flowing and a packet sniffer would be able to catch it in the form of packets and display them for whatever reasons required.
Terminal run:


