Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ arp(ADMP) — TCP/IP 1.2.0.i

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

arp(ADMN)

ifconfig(ADMN)

inet(ADMP)


 arp(ADMP)                       19 June 1992                       arp(ADMP)


 Name

    arp - Internet and Ethernet address protocol

 Description

    ARP is a protocol used to dynamically map between Internet (IP) and
    10Mb/s Ethernet addresses.  It is used by all the 10Mb/s Ethernet inter-
    face drivers running the Internet protocols.

    ARP caches Internet-Ethernet address mappings.  When an interface
    requests a mapping for an address not in the cache, ARP queues the mes-
    sage which requires the mapping and broadcasts a message on the associ-
    ated network requesting the address mapping.  If a response is provided,
    the new mapping is cached and any pending message is transmitted.  ARP
    will queue at most one packet while waiting for a mapping request to be
    responded to; only the most recently ``transmitted'' packet is kept.  The
    ARP protocol is implemented by a STREAMS driver to do the protocol nego-
    tiation, and a separate STREAMS module to do the address translation.

    To facilitate communications with systems which do not use ARP, ioctls
    are provided to enter and delete entries in the Internet-to-Ethernet
    tables.  Usage:

       #include <sys/ioctl.h>
       #include <sys/socket.h>
       #include <net/if.h>
       struct arpreq arpreq;

       ioctl(s, SIOCSARP, (caddr_t)&arpreq);
       ioctl(s, SIOCGARP, (caddr_t)&arpreq);
       ioctl(s, SIOCDARP, (caddr_t)&arpreq);


    Each ioctl takes the same structure as an argument.  SIOCSARP sets an ARP
    entry, SIOCGARP gets an ARP entry, and SIOCDARP deletes an ARP entry.
    These ioctls may be applied to any socket descriptor s, but only by the
    super-user.  The arpreq structure is as follows:

               /* ARP ioctl request */
       struct arpreq {
               struct sockaddr arp_pa;        /* protocol address */
               struct sockaddr arp_ha;        /* hardware address */
               int             arp_flags;     /* flags */
       };
               /*  arp_flags field values */
       #define ATF_COM         0x02    /* completed entry (arp_ha valid) */
       #define ATF_PERM        0x04    /* permanent entry */
       #define ATF_PUBL        0x08    /* publish (respond for other host) */
       #define ATF_USETRAILERS 0x10    /* send trailer packets to host */


    The address family specified in the arppa sockaddr field must be
    AFINET.  The address family specified in the arpha sockaddr field must
    be AFUNSPEC.  The only flag bits which may be written are ATFPERM,
    ATFPUBL and ATFUSETRAILERS.  ATFPERM causes the entry to be permanent
    if the ioctl call succeeds.  The peculiar nature of the ARP tables may
    cause the ioctl to fail if more than 8 (permanent) Internet host
    addresses hash to the same slot.  ATFPUBL specifies that the ARP code
    should respond to ARP requests for the indicated host coming from other
    machines.  This allows a host to act as an ``ARP server,'' which may be
    useful in convincing an ARP-only machine to talk to a non-ARP machine.

    ARP is also used to negotiate the use of trailer IP encapsulations;
    trailers are an alternate encapsulation used to allow efficient packet
    alignment for large packets despite variable-sized headers.  Hosts which
    wish to receive trailer encapsulations so indicate by sending gratuitous
    ARP translation replies along with replies to IP requests; they are also
    sent in reply to IP translation replies.  The negotiation is thus fully
    symmetrical, in that either or both hosts may request trailers.  The
    ATFUSETRAILERS flag is used to record the receipt of such a reply, and
    enables the transmission of trailer packets to that host.

    ARP watches passively for hosts impersonating the local host (that is, a
    host that responds to an ARP mapping request for the local host's
    address).

 Diagnostics


       duplicate IP address!! sent from ethernet address: Ethernet address

    This message means that ARP has discovered another host on the local net-
    work which responds to mapping requests for its own Internet address.

 Notes

    Trailers are not supported in the current implementation.

 Files

    /dev/inet/arp

 See also

    arp(ADMN), ifconfig(ADMN), inet(ADMP)
    RFC 826, RFC 893


Typewritten Software • bear@typewritten.org • Edmonds, WA 98026