home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / a_man / cat7 / arp.z / arp
Encoding:
Text File  |  2001-04-17  |  6.4 KB  |  133 lines

  1.  
  2.  
  3.  
  4. AAAARRRRPPPP((((7777PPPP))))                                                                AAAARRRRPPPP((((7777PPPP))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      arp - Address Resolution Protocol
  10.  
  11. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  12.      ARP is a protocol that provides a dynamic mapping from an IP address to
  13.      the corresponding physical network address. The 32-bit IP addresses only
  14.      make sense to the TCP/IP protocol suite. A physical network such as an
  15.      Ethernet or a token ring has it own addressing scheme (often 48-bit
  16.      addresses) to which any network layer using the physical network must
  17.      conform.  Two machines on a given physical network can communicate only
  18.      if they know each other's physical network address. ARP provides a
  19.      mapping between the two different forms of addresses.
  20.  
  21.      ARP caches IP-physical address mappings.  When an interface requests a
  22.      mapping for an address not in the cache, ARP queues the message which
  23.      requires the mapping and broadcasts a message on the associated network
  24.      requesting the address mapping.  If a response is provided, the new
  25.      mapping is cached and any pending message is transmitted.  Each address
  26.      mapping has a timer associated with it and completed address mappings are
  27.      aged after 20 minutes.  The timer is reset each time the address mapping
  28.      is updated by a SIOCSARP _i_o_c_t_l call or by sending a packet to the IP
  29.      address to which the mapping belongs. This timer value is not
  30.      configurable.  ARP will queue at most one packet while waiting for a
  31.      mapping request to be responded to; only the most recently
  32.      ``transmitted'' packet is kept.
  33.  
  34.      To facilitate communications with systems which do not use ARP, _i_o_c_t_ls
  35.      are provided to enter and delete entries in the IP-to-physical address
  36.      tables.  Usage:
  37.  
  38.           #include <sys/ioctl.h>
  39.           #include <sys/socket.h>
  40.           #include <net/if.h>
  41.           struct arpreq arpreq;
  42.  
  43.           ioctl(s, SIOCSARP, (caddr_t)&arpreq);
  44.           ioctl(s, SIOCGARP, (caddr_t)&arpreq);
  45.           ioctl(s, SIOCDARP, (caddr_t)&arpreq);
  46.  
  47.      Each ioctl takes the same structure as an argument.  SIOCSARP sets an ARP
  48.      entry, SIOCGARP gets an ARP entry, and SIOCDARP deletes an ARP entry.
  49.      These ioctls may be applied to any socket descriptor _s, but only by the
  50.      super-user.  The _a_r_p_r_e_q structure contains:
  51.  
  52.      /* ARP ioctl request */
  53.      struct arpreq {
  54.           struct sockaddr     arp_pa;        /* protocol address */
  55.           struct sockaddr     arp_ha;        /* hardware address */
  56.           int       arp_flags;     /* flags */
  57.      };
  58.      /*  arp_flags field values */
  59.      #define   ATF_COM        0x02 /* completed entry (arp_ha valid) */
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. AAAARRRRPPPP((((7777PPPP))))                                                                AAAARRRRPPPP((((7777PPPP))))
  71.  
  72.  
  73.  
  74.      #define   ATF_PERM       0x04 /* permanent entry */
  75.      #define   ATF_PUBL       0x08 /* publish (respond for other host) */
  76.      #define   ATF_USETRAILERS     0x10 /* send trailer packets to host */
  77.  
  78.      The address family for the _a_r_p__p_a sockaddr must be AF_INET; for the
  79.      _a_r_p__h_a sockaddr it must be AF_UNSPEC.  The only flag bits which may be
  80.      written are ATF_PERM, ATF_PUBL and ATF_USETRAILERS.  ATF_PERM causes the
  81.      entry to be permanent if the ioctl call succeeds.  The peculiar nature of
  82.      the ARP tables may cause the ioctl to fail if more than 8 (permanent)
  83.      Internet host addresses hash to the same slot.  ATF_PUBL specifies that
  84.      the ARP code should respond to ARP requests for the indicated host coming
  85.      from other machines.  This allows a host to act as an ``ARP server,''
  86.      which may be useful in convincing an ARP-only machine to talk to a non-
  87.      ARP machine.
  88.  
  89.      ARP is also used to negotiate the use of trailer IP encapsulations;
  90.      trailers are an alternate encapsulation used to allow efficient packet
  91.      alignment for large packets despite variable-sized headers.  Hosts which
  92.      wish to receive trailer encapsulations so indicate by sending gratuitous
  93.      ARP translation replies along with replies to IP requests; they are also
  94.      sent in reply to IP translation replies.  The negotiation is thus fully
  95.      symmetrical, in that either or both hosts may request trailers.  The
  96.      ATF_USETRAILERS flag is used to record the receipt of such a reply, and
  97.      enables the transmission of trailer packets to that host.
  98.  
  99.      ARP watches passively for hosts impersonating the local host (i.e. a host
  100.      which responds to an ARP mapping request for the local host's address).
  101.  
  102. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  103.      The following messages can appear on the console:
  104.      aaaarrrrpppp:::: hhhhoooosssstttt wwwwiiiitttthhhh eeeetttthhhheeeerrrr aaaaddddddddrrrreeeessssssss %%%%xxxx::::%%%%xxxx::::%%%%xxxx::::%%%%xxxx::::%%%%xxxx::::%%%%xxxx iiiissss uuuussssiiiinnnngggg mmmmyyyy IIIIPPPP aaaaddddddddrrrreeeessssssss
  105.      xxxx....xxxx....xxxx....xxxx
  106.      ARP has discovered another host on the local network which responds to
  107.      mapping requests for its own Internet address.
  108.      aaaarrrrpppp:::: eeeetttthhhheeeerrrr aaaaddddddddrrrreeeessssssss iiiissss bbbbrrrrooooaaaaddddccccaaaasssstttt ffffoooorrrr IIIIPPPP aaaaddddddddrrrreeeessssssss xxxx....xxxx....xxxx....xxxx
  109.      ARP has discovered another host on the local network which maps that
  110.      host's IP address onto the ethernet broadcast address.
  111.  
  112. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  113.      inet(7F), arp(1M), ifconfig(1M), intro(3)
  114.      ``An Ethernet Address Resolution Protocol,'' RFC826, Dave Plummer,
  115.      Network Information Center, SRI.
  116.      ``Trailer Encapsulations,'' RFC893, S.J. Leffler and M.J. Karels, Network
  117.      Information Center, SRI.
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.