what does a ping look like code example
Example 1: how to ping in cmd
ping -n <number of echo request to send> -l <buffer size> <website url>
ping -n 10 -l 50 google.com
Example 2: ping options windows
Ping command syntax for Windows
-t Pings the specified host until stopped. To stop - type Control-C
-a Resolve adresses to hostnames
-n
Number of echo requests to send
-l Send buffer size
-f Set Don't Fragmet flag in packet (IPv4-only)
-i Set Time To Live
-v Set Type of Service (Setting has been deprecated)
-r Record route for count hops (IPv4-only)
-s Timestamp for count hops (IPv4-only)
-j Loose source route along host-list (IPv4-only)
-k Strict source route along host-list (IPv4-only)
-w Timeout in milliseconds to wait for each reply
-R Use routing header to test reverse route also (IPv6-only, deprecated per RFC 5095)
-S Source address to use
-c Routing compartment identifier
-p Ping a Hyper-V Network Virtualization provider address
-4 Force using IPv4
-6 Force using Ipv6
Example 3: linux ping options
-a Audible ping.
-A Adaptive ping. Interpacket interval adapts to round-trip time, so that effectively not more than one (or more, if preload is set) unanswered probes present in the network. Minimal interval is 200msec for not super-user. On networks with low rtt this mode is essentially equivalent to flood mode.
-b Allow pinging a broadcast address.
-B Do not allow ping to change source address of probes. The address is bound to one selected when ping starts.
-c count Stop after sending count ECHO_REQUEST packets. With deadline option, ping waits for count ECHO_REPLY packets, until the timeout expires.
-d Set the SO_DEBUG option on the socket being used. Essentially, this socket option is not used by Linux kernel.
-F flow label Allocate and set 20 bit flow label on echo request packets. (Only ping6). If value is zero, kernel allocates random flow label.
-f Flood ping. For every ECHO_REQUEST sent a period ''.'' is printed, while for ever ECHO_REPLY received a backspace is printed. This provides a rapid display of how many packets are being dropped. If interval is not given, it sets interval to zero and outputs packets as fast as they come back or one hundred times per second, whichever is more. Only the super-user may use this option with zero interval.
-i interval Wait interval seconds between sending each packet. The default is to wait for one second between each packet normally, or not to wait in flood mode. Only super-user may set interval to values less 0.2 seconds.
-I interface address Set source address to specified interface address. Argument may be numeric IP address or name of device. When pinging IPv6 link-local address this option is required.
-l preload If preload is specified, ping sends that many packets not waiting for reply. Only the super-user may select preload more than 3.
-L Suppress loopback of multicast packets. This flag only applies if the ping destination is a multicast address.
-n Numeric output only. No attempt will be made to lookup symbolic names for host addresses.