[comp.protocols.tcp-ip] question about berkeley TCP/IP

KVC@ENGVAX.SCG.HAC.COM (Kevin Carosso) (06/27/87)

When a SYN is sent to a Berkeley UNIX TCP/IP implementation (4.3 or 4.2)
it appears that UNIX can send the SYN-ACK without having to ARP for the
host it's ACKing.  Does it indeed add an entry to the ARP table when an
ethernet IP packet comes in?  I'll buy that anything to cut down
on ethernet broadcasts is a good thing...

This may seem like a dumb question, but the code is a little opaque and
I'm not a UNIX kernel hack.  I have a hypothesis which explains some behaviour
I'm seeing with the TCP I maintain (CMU/Tek for VAX/VMS) and UNIX must be
doing this if my theory's any good.

Thanks,

        /Kevin Carosso                     kvc@engvax.scg.hac.com
         Hughes Aircraft Co.               kvc%engvax@oberon.usc.edu

DCP@QUABBIN.SCRC.SYMBOLICS.COM.UUCP (06/29/87)

    Date: Fri, 26 Jun 87 19:06 PDT
    From: Kevin Carosso <@YMIR.BITNET:KVC@ENGVAX.SCG.HAC.COM>

    When a SYN is sent to a Berkeley UNIX TCP/IP implementation (4.3 or 4.2)
    it appears that UNIX can send the SYN-ACK without having to ARP for the
    host it's ACKing.  Does it indeed add an entry to the ARP table when an
    ethernet IP packet comes in?  I'll buy that anything to cut down
    on ethernet broadcasts is a good thing...

    This may seem like a dumb question, but the code is a little opaque and
    I'm not a UNIX kernel hack.  I have a hypothesis which explains some behaviour
    I'm seeing with the TCP I maintain (CMU/Tek for VAX/VMS) and UNIX must be
    doing this if my theory's any good.

That can't really work in the face of gateways, since on input the
source IP address does not correspond to the hardware source address of
the gateway, and on output routing is taking place so that the packet is
sent to the gateway's IP address, which the sender doesn't necessarily
have a translation for and may not have it handy.

karels%okeeffe@UCBVAX.BERKELEY.EDU.UUCP (06/29/87)

Of course a Berkeley host can send a SYN-ACK in response to an incoming SYN
without doing an ARP request!  If you got the SYN to it, you must have
sent an ARP request at some time (all of this assuming the hosts are
on the same Ethernet).  When the ARP request was received and processed,
the hardware address for your machine was added to the ARP cache.

		Mike

louie@trantor.UMD.EDU (Louis A. Mamakos) (06/29/87)

What probably happens is that who every sent the original packet with
a SYN segment first had to ARP for your address.  The 4.x BSD ARP
module caches the address of the host requesting your address; thus
when you want to reply, the ARP mapping is already present.

Louis A. Mamakos  WA3YMH    Internet: louie@TRANTOR.UMD.EDU
University of Maryland, Computer Science Center - Systems Programming

ron@TOPAZ.RUTGERS.EDU (Ron Natalie) (06/30/87)

I can't say if BSD is picking up on Ethernet hardware addresses
from the incoming connection request, but there is no reason why
this can't happen.  The internet address of remote end would be
entered into the arp cache with the gateway's hardware address.
This will work.  This is how gateways on Ethernet subnets trick hosts
that don't know about subnets into working properly.  The gateway
sends arp answers for IP addresses off the local subnet that it will
route for.

Nearly every device I've come across (including BSD UNIX systems
and other things for which we don't have source) will allow manyone
mappings of IP to Ethernet address.

=Ron