Discussion:
mss and obsd
(too old to reply)
Friedrich Locke
2016-08-02 19:14:24 UTC
Permalink
Hi folks,

i am pinging my desktop from a obsd machine and i am very curious about the
size of packet an sending. Here you have it:

***@etosha$ ping -s 65467 gustav.cpd.ufv.br
PING gustav.cpd.ufv.br (200.235.177.58): 65467 data bytes
65475 bytes from 200.235.177.58: icmp_seq=0 ttl=63 time=12.241 ms
65475 bytes from 200.235.177.58: icmp_seq=1 ttl=63 time=11.940 ms
--- gustav.cpd.ufv.br ping statistics ---
2 packets transmitted, 2 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 11.940/12.090/12.241/0.186 ms
***@etosha$ ping -s 65468 gustav.cpd.ufv.br
ping: packet size is too large: 65468
***@etosha$

I cannot ping with a message size above 65467, why ?
I realize the difference between 65535 and 65467 is 68 bytes. What is obsd
accounting for ?

Thanks in advance.
Christian Weisgerber
2016-08-02 20:54:06 UTC
Permalink
Post by Friedrich Locke
ping: packet size is too large: 65468
I realize the difference between 65535 and 65467 is 68 bytes. What is obsd
accounting for ?
Maximum IP packet size: 65535
Maximum IP header size: 60
ICMP header size: 8
--
Christian "naddy" Weisgerber ***@mips.inka.de
Peter J. Philipp
2016-08-03 06:58:19 UTC
Permalink
Hi,

The maximum payload in ping.c (all source has been run through cat -n) is:

92 #define MAXPAYLOAD (IP_MAXPACKET - MAXIPLEN - 8) /* max
ICMP payload size */

which consists of:

90 #define MAXIPLEN 60

This is the maximum IP len since the value is leftshifted by 2 and
consists the size of a nibble (4 bits).
60 dec == 111100 bin

...and 8 bytes which is probably meant by ICMP_MINLEN defined in
/usr/include/netinet/ip_icmp.h.

The check where you're running into is here:


294 case 's': /* size of packet to send */
295 datalen = strtonum(optarg, 0,
MAXPAYLOAD, &errstr);
296 if (errstr)
297 errx(1, "packet size is %s: %s",
errstr,
298 optarg);
299 break;


I hope that helps?

-peter
Post by Friedrich Locke
Hi folks,
i am pinging my desktop from a obsd machine and i am very curious about the
PING gustav.cpd.ufv.br (200.235.177.58): 65467 data bytes
65475 bytes from 200.235.177.58: icmp_seq=0 ttl=63 time=12.241 ms
65475 bytes from 200.235.177.58: icmp_seq=1 ttl=63 time=11.940 ms
--- gustav.cpd.ufv.br ping statistics ---
2 packets transmitted, 2 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 11.940/12.090/12.241/0.186 ms
ping: packet size is too large: 65468
I cannot ping with a message size above 65467, why ?
I realize the difference between 65535 and 65467 is 68 bytes. What is obsd
accounting for ?
Thanks in advance.
Loading...