ArpPacket

Namespace inet

ArpPacket

class

ARP packet. This is a specialized version: prepared for IEEE 802 hardware addresses and IPv4. Packet fields are therefore represented by C++ classes MACAddress and IPv4Address. Also, some ARP protocol header fields are not modelled explicitly (their values are implied):

  • hardwareType (not needed for modelling);
  • protocol type (0x800 IPv4)
  • hardware address length (6)
  • protocol address length (4)

Extends

Name Type Description
FieldsChunk (unknown -- not in documented files)

Fields

Name Type Description
chunkLength

ARP header length for IPv4 (4-byte addresses) and 802 LANs (6-byte MAC addrs)

opcode ArpOpcode
srcMacAddress MacAddress
destMacAddress MacAddress
srcIpAddress Ipv4Address
destIpAddress Ipv4Address

Packet operations (observed)

actionmodule
insertAtFrontArp
peekAtFrontArp
popAtFrontPcapRecorder, MultiFieldClassifier

Source code

//
// ARP packet. This is a specialized version: prepared for IEEE 802 hardware
// addresses and IPv4. Packet fields are therefore represented by C++ classes
// MACAddress and IPv4Address. Also, some ARP protocol header fields are
// not modelled explicitly (their values are implied):
//   - hardwareType (not needed for modelling);
//   - protocol type (0x800 IPv4)
//   - hardware address length (6)
//   - protocol address length (4)
//
class ArpPacket extends FieldsChunk
{
    // ARP header length for IPv4 (4-byte addresses) and 802 LANs (6-byte MAC addrs)
    chunkLength = B(28);
    ArpOpcode opcode;
    MacAddress srcMacAddress;
    MacAddress destMacAddress;
    Ipv4Address srcIpAddress;
    Ipv4Address destIpAddress;
}

File: src/inet/networklayer/arp/ipv4/ArpPacket.msg