views:

116

answers:

2

How can I send a datagram with an Ethernet trailer? If I use SocketType.Raw, I'll have to send the whole IP header and I have no idea how to do that.

Here's a picture that will explain this better:

alt text

As you can see, there's no data. The "00 00 00 00 ..." is the trailer.

Thanks.

EDIT: I removed the language requirement, added a WireShark capture.

A: 

That trailer is used to pad ethernet frames to their minimum length (46 bytes of payload). So send a small UDP packet - smaller than 18 bytes (as IP + UDP is normally 28 bytes)

nos
Can you show an example please? I tried to send a simple udp packet with 17 bytes, it just sends it as data.
TTT
even an empty datagram, or a 1 byte datagram shows this behavior ? How many bytes total (ethernet+ip+udp) did ethereal show you ?
nos
60 bytes.......
TTT
A: 
dwelch