RARP - The reverse Address Resolution Protocol.
 
  - ARP says "give me the ethernet address for this IP address"
 
  - RARP says "here is my ethernet address, give me the corresponding
    IP address".
 
  - Used for machines that want to get IP addresses at boot time from
    a central server
  - Also used for diskless clients.
 
  - It uses the same protocol as ARP, except the "op" is 003 for a request
    and 0004 for a reply.
 
        - In ethernet frame, old ethernet has "type" field of 0835,
        - 802.3 has 0835 in the "type" field of the data.
 
 
  - Server machines are configured with tables that map ethernet addresses
    into IP addresses.  That server answers RARP requests.
 
 
Proxy ARP
 
   - Proxy ARP is a facility where a machine will answer ARP requests on
     behalf of another machine.
 
   - An administrator can set up Proxy Arp instead of having subnet masks
     on each host (a subnet mask is only needed on machines doing
     the Proxy Arp).
 
   - Example:
 
     Suppose we have a Class B network of 169.124.0.0.  Let's say we
     partitioned the network as follows:
 
      A      B      C      R1    D     E    F
      |      |      |     /  \   |     |    |
     ---------------------    ------------------
 
     The machines have the following addresses:
 
     Machine              IP Address          Ethernet Address
     -------              ----------          -----------------
        A                 169.124.15.1        08:00:01:02:03:01
        B                 169.124.15.2        08:00:01:02:03:02
        C                 169.124.15.3        08:00:01:02:03:03
        R1 (interface 1)  169.124.15.3        08:00:01:02:03:04
        R1 (interface 2)  169.124.19.1        08:00:01:02:03:05
        D                 169.124.19.2        08:00:01:02:03:06
        E                 169.124.19.3        08:00:01:02:03:07
        F                 169.124.19.4        08:00:01:02:03:08
 
    Because we are not using subnet masks on A, B, C, D, E, and F, we
    must set up R1 to use Proxy Arp.
 
    Here's how it works:
 
    The administrator configures R1 to use Proxy Arp.  The administrator
    sets the subnet mask of R1 to be 255.255.255.0.  The administrator
    also sets up R1 to do the following:
 
        1.  If a request comes in on interface 1 for any IP address
            starting with 169.124.19, respond with R1's ethernet
            address corresponding to interface 1.
 
        2.  If a request comes in on interface 2 for any IP address
            starting with 169.124.15, respond with R1's ethernet
            address corresponding to interface 2.
 
    Now let's see what happens when A wants to talk to another machine.
    Note that the routing tables for A has only one entry:
 
             169.124.0.0  169.124.15.1  interface_1
 
    If a wants to talk to 169.124.15.2, it issues the following ARP request:
 
   ----------------------------------------------------------------
   | Preamble | SOF | ff ff ff ff ff ff | 08 00 01 02 03 01 | 0806 |
   -----------------------------------------------------------------
   | 0001 0800  06  04  0001 08 00 01 02 03 01 A9 7C 0F 01         |
   | 00 00 00 00 00 00 A9 7C 0F 02
   -----------------------------------------------------------------
   |  checksum |
   -------------
 
    Note that A9 7C 0F 01 is 169.124.15.1 and A9 7C 0F 02 is 169.124.15.2.
 
    As expected, machine B replies:
 
   ----------------------------------------------------------------
   | Preamble | SOF | 08 00 01 02 03 01 | 08 00 01 02 03 02 | 0806 |
   -----------------------------------------------------------------
   | 0001 0800  06  04  0002 08 00 01 02 03 02 A9 7C 0F 02         |
   | 08 00 01 02 03 01 A9 7C 0F 01                                 |
   -----------------------------------------------------------------
   |  checksum |
   -------------
 
   Now, let's say machine A wants to send a packet to machine E.
 
   The IP on A looks in it's routing table, and sees it should deliver
   the packet direct.  So, IP gives the packet to ARP, telling ARP to
   send the packet to 169.124.19.3 (i.e., machine E).
 
   ARP then issues the ARP request:
 
   ----------------------------------------------------------------
   | Preamble | SOF | ff ff ff ff ff ff | 08 00 01 02 03 01 | 0806 |
   -----------------------------------------------------------------
   | 0001 0800  06  04  0001 08 00 01 02 03 01 A9 7C 0F 01         |
   | 00 00 00 00 00 00 A9 7C 13 03
   -----------------------------------------------------------------
   |  checksum |
   -------------
 
   Note that A9 7C 13 03 is 169.124.19.3.
 
   At this point, Machine R1 replies to the ARP request!  (remember
   that the administrator set up R1 to respond for all addresses
   starting with 169.124.19.
 
   So, R send the following ARP response:
 
   ----------------------------------------------------------------
   | Preamble | SOF | 08 00 01 02 03 01 | 08 00 01 02 03 04 | 0806 |
   -----------------------------------------------------------------
   | 0001 0800  06  04  0002 08 00 01 02 03 04 A9 7C 13 03         |
   | 08 00 01 02 03 01 A9 7C 0F 01                                 |
   -----------------------------------------------------------------
   |  checksum |
   -------------
 
   Note that the packet says "the ethernet address of 169.124.19.3
   is 08 00 01 02 03 04".  That, of course, is a total fabrication.
   But, things will now work correctly!  When A now sends the IP packet,
   the destination IP address will be 169.124.19.3.  But, the ethernet
   address will be that of R1!  That is exactly
   address will be that of R1!  That is exactly what would have happened if
   machine A were using subnet masks and had R1 as a router.
 
 
 
IP -- The Internet Protocol.
 
 - As we know, IP is the network layer of the TCP/IP protocol suite
 
 - IP provides unreliable, connectionless datagram delivery service
    - unreliable - no guarantee that the datagram will get to its destination
        - IP provides a "best effort" to deliver datagram
        - if something goes wrong (i.e., router temporarily runs out
          of memory, or router can't figure out where to go next),
          IP throws away the datagram and tries to send an ICMP message
          to the IP software on the source machine.
    - connectionless - no state information is maintained.  Each datagram
      is sent independent of others.
        - packets can take different routes.
 
The IP packet format:
 
-------------------------------------------------------------------------
| 4-bit   | 4-bit header |8-bit "type | 16-bit total length (in bytes)  |
| version | length       |of service" |                                 |
-------------------------------------------------------------------------
| 16-bit identification               | 3-bit | 13-bit fragment offset  |
|                                    | flag  |                         |
-------------------------------------------------------------------------
| 8-bit "time to live"   | 8-bit      |  16-bit header checksum        
|                        | protocol   |                                  |
-------------------------------------------------------------------------
|         32-bit source IP address                                      |
-------------------------------------------------------------------------
|         32-bit destination IP address                                 |
-------------------------------------------------------------------------
|          options (if any)                                             |
-------------------------------------------------------------------------
|                                                                       |
|                      data                                            |
|                                                                       |
-------------------------------------------------------------------------
 
 
   Version - currently has the value 4
   Header length - the number of 32-bit words in the header
                 - because this is 4 bits, the max header length
                   is 15 words (i.e. 60 bytes)
                 - the header is at least 20 bytes, but options may
                   make it bigger
   Type of Service - contains a 3-bit precedence field (that is
                     ignored today), 4 service bits, and 1 unused bit.
                     The four service bits can be:
                     1000 - minimize delay
                     0100 - maximize throughput
                     0010 - maximize reliability
                     0001 - minimize monetary cost
                   - This is a "hint" of what characteristics of the
                     physical layer to use
                   - The Type of Service is not supported in most
                     implementations.  However, some implementations
                     have extra fields in the routing table to indicate
                     delay, throughput, reliability, and monitary cost.