Skip to content

hyahong/ping

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ping

Sends ICMP packets for echo to network host.


Header

IP HEADER (DEFAULT 20 byte)

0        1        2        3        4        5        6        7        8
+--------+--------+--------+--------+--------+--------+--------+--------+
|  Ver   |   IHL  |  TypeOfService  |            Total Length           |
+--------+--------+--------+--------+--------+--------+--------+--------+
|           Identification          |          Fragment Offset          |
+--------+--------+--------+--------+--------+--------+--------+--------+
|       TTL       |     Protocol    |              Checksum             |
+--------+--------+--------+--------+--------+--------+--------+--------+
|                             Source Address                            |
+--------+--------+--------+--------+--------+--------+--------+--------+
|                           Destination Address                         |
+--------+--------+--------+--------+--------+--------+--------+--------+

ICMP HEADER (DEFAULT 8 byte)

0        1        2        3        4        5        6        7        8
+--------+--------+--------+--------+--------+--------+--------+--------+
|       Type      |       Code      |              Checksum             |
+--------+--------+--------+--------+--------+--------+--------+--------+
|             Identifier            |              Sequence             |
+--------+--------+--------+--------+--------+--------+--------+--------+

PAYLOAD (DEFAULT 56 byte)

0        1        2        3        4        5        6        7        8
+--------+--------+--------+--------+--------+--------+--------+--------+
|                                .......                                |
+--------+--------+--------+--------+--------+--------+--------+--------+
|                                .......                                |

...

Compilation

compile the binary

make

remove object files & clean all

make clean
make fclean

recompile all sources

make re

Usage

must be run with sudo to bind the socket

ubuntu-ping

About

just ping, but from scratch

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published