[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

icmp/ping implementation in linux



Hi,
  I need to send ICMP echo requests with the IP's "no_defrag" bit set and
use large (upto 1500) packet sizes.

  I could get the NetBsd version at http://cvs.netbsd.org. Going through
the code, I find on netbsd, ping has the appropriate i.e the -D flag which
sets the no_defrag bit. The MAXPACKET size is also 6568 bytes which is
more than adquate for my purpose.

  Linux's ping also has the -s flag to set an userdefined packet size, but
just to confirm I looked up the /usr/src/linux/net/ipv4/icmp.c. Here in
the icmp_send() function I find there's a check in which if the packet
size is greater than 576, the extrabits are silently dropped. Or so it
seems. So I think the -s option is not much useful after that value. Can
anyone confirm this.

  On the other hand the function icmp_echo() and icmp_reply() doesnt seem
to have this 576 limitation. So will I be able to recieve such big pings.
However I am more interested in sending the pings with that size, I dont
mind if the replies are curtailed. 

  Also if one knows of an online version of linux's ping.c ( in iputils ),
i would love that link. ( Idont want to download the entire iputils right
now ).

-- sreangsu

p.s. is there any sysctl feature which sets the no defrag bit on outgoing
ip packets, or is it possible through ipchains etc