IP fragmentation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi everyone,

I declared a buffer size of 4096, and in it stored a string of 20 chars.
After that, i sent this packet as an ICMP packet using raw sockets. I am
using the ICMP chk_sum function provided by the object utilities of the
Stevens free code. to this function, you supply a pointer to the start
of the packet, and the length of the packet. When i send this packet
(with check sum put in), i use the sendto() fn. TO my surprise, i found
(using tcpdump) that 3 packets (fragmants) were transmitted. When i
changed the original buffer size to 128, only one packet was sent.
Finally, when i changed the buffer size to 8192, 6 packets were sent.

Can someone tell me what's going on? In all three cases, i sent the
exact same data of 20 chars. The data is copied into icmp->icmp_data
using strcpy()  (which does add a '\0' to terminate the buffer) and use
strlen() to calculate the length of the packet.

Any suggestions are welcome.

Sunny days,
Aditya

-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.rutgers.edu


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux