Skip to content

ARP behavior differs from arping (iputils) #40

@Mixlining

Description

@Mixlining

ARP behavior differs from arping (iputils) behavior (all packet captures were taken on the sender side using tcpdump)

Description:

The ARP behavior differs from arping (iputils) behavior:

When sending a GARP packet using arp(this pkg), the packet length is 46 bytes.

00:15:5d:bd:ac:3f > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 60: Ethernet (len 6), IPv4 (len 4), Request who-has 172.17.239.189 (ff:ff:ff:ff:ff:ff) tell 172.17.239.189, length 46

When sending a GARP packet using arping(iputil), the packet length is 28 bytes.

00:15:5d:bd:ac:3f > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Ethernet (len 6), IPv4 (len 4), Request who-has 172.17.239.189 (ff:ff:ff:ff:ff:ff) tell 172.17.239.189, length 28

Root Cause:

The dependency mdlayher/ethernet uses SOCK_RAW, which performs frame padding in user space. In contrast, arping uses PF_PACKET/SOCK_DGRAM, which handles this differently at the kernel level.

Could provide a configuration option to set the frame length to match arping's behavior?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions