On Sat, Jul 29, 2000 at 04:39:59PM -0700, Ben Greear wrote:
> I'm using a PF_PACKET, SOCK_RAW socket to send ethernet packets.
> 
> I write the dst MAC address, src MAC address, and proto into a buffer,
> then append my payload.  I send the whole thing to the socket, using
> a length that includes the ethernet header and my payload.
> 
> But, I think I've been using MTU wrong the whole time.
> 
> Assuming a 'normal' MTU of 1500 on an ethernet NIC.  Does that mean
> I have 14 bytes of ethernet payload, 1500 bytes of payload, and 4 bytes of
> ethernet CRC (I don't specify the CRC, I assume the driver appends that?), or
> does it mean I have 14 bytes of header, 1486 bytes of payload and a CRC?

        1500 bytes of IP level payload.  The MACs, type field and CRC
        are extra.   For transmit you need  6+6+2+1500 bytes for max
        size IP frame.

> Am I correct in assuming that the CRC is taken care of for me?

        For transmit it is generated by the hardware, for receive
        it is checked by the hardware, and if found invalid, usually
        the packet is discarded adding "frame" errors counter.

> Can I see the CRC in user-space?

        Propably yes.  The last 4 bytes of the received packet at the
        ethernet drivers typically carry the CRC.  Not always, though!

> Thanks,
> Ben
> 
> -- 
> Ben Greear ([EMAIL PROTECTED])  http://www.candelatech.com
> Author of ScryMUD:  scry.wanfear.com 4444        (Released under GPL)
> http://scry.wanfear.com               http://scry.wanfear.com/~greear

/Matti Aarnio <[EMAIL PROTECTED]>
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]

Reply via email to