Path: utzoo!attcan!uunet!munnari.oz.au!uniwa!wacsvax!bison!jamesp From: jamesp@wacsvax.uwa.oz (James Pinakis) Newsgroups: comp.unix.wizards Subject: Raw Sockets and IP Datagrams Keywords: Confused Message-ID: Date: 7 Jun 90 05:08:37 GMT Sender: news@wacsvax.OZ Lines: 18 I'm trying to write programs which communicate via IP datagrams using the raw socket interface in SunOS 4.0.3. I was initially somewhat confused by the difference between sending a receiving a datagram i.e. when I do a 'sendto' on the raw socket I provide it with the data part of the datagram but when I do a 'recvfrom' I am provided the whole datagram including the header. Upon close inspection of the ip(4p) man page I found this to be as it should. Now I find that in received datagrams, the TOTAL LENGTH field contains only the length of the data part and does not include the length of the header as specified in the RFC. Also, it appears the HEADER CHECKSUM contains zero. Obviously the IP layer is changing these fields, but this isn't mentioned in the manual entry (which in fact says "Received datagrams are returned with the IP header and options intact"). Is this normal behaviour or am I experiencing something peculiar? Are there any other pitfalls to be wary of when using raw sockets? There seems to be a dearth of documentation in this area. james jamesp@bison.cs.uwa.oz.au