Ethereal-users: Re: [Ethereal-users] GVRP pdu and protocol ID using RAW socket in Ethereal

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <gharris@xxxxxxxxx>
Date: Sun, 25 Apr 2004 12:54:15 -0700
On Sun, Apr 25, 2004 at 07:15:22AM -0700, Hemant Rath wrote:
> I'm using raw socket to form my own packet for GVRP
> pdu. The packet structure is as follows.
> 
> struct garp_packet {
> unsigned char dest_hw_addr[6]; //MAC address only:
> 01-80-C2-00-00-21
> unsigned char src_hw_addr[6]; //MAC address
> unsigned char proto_id[2];

That's a "Digital/Intel/Xerox" Ethernet header.  There are two kinds of
Ethernet packets:

	"Digital/Intel/Xerox" Ethernet packets, with a 2-byte protocol
	ID following the destination and source MAC addresses;

	"802.3" Ethernet packets, with a 2-byte *packet length*
	following the destination and source MAC addresses.

802.3 packets usually have an IEEE 802.2 header following the Ethernet
header (the one exception I know of is one form of Netware packet, which
puts the IPX header immediately after the Ethernet header).

GVRP packets are sent over Ethernet as 802.3 packets, not
Digital/Intel/Xerox packets.

> If I put the protocol ID as 0x0001 (PROTOCOL ID for
> GVRP), then the Ethereal tells me: Protolc: LLC, and
> [Malformed Packet]

That protocol ID is a GARP protocol ID.  That is *NOT* an Ethernet
protocol ID.

BPDU (Spanning Tree Protocol) and GARP packets are sent as 802.3 packets
with an 802.2 header; the 802.2 header has a destination service access
point value of 0x42.

GARP packets are distinguished from BPDU packets by the destination MAC
address; GARP packets are sent to addresses in the range
01-80-C2-00-00-20 to 01-80-C2-00-00-2F.  GVRP packets are sent to
01-80-C2-00-00-20 - Ethereal will not treat them as GVRP packets unless
they're sent to that address (and I don't think any other devices on the
network will do so, either).

> Do I need to add the checksum field in the packet? I
> do not understand, whether it is an Ethereal problem
> or packet error.

It's a packet error.