Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Jan 2007 08:15:32 -0500
From:      Randall Stewart <rrs@cisco.com>
To:        "Bruce M. Simpson" <bms@freebsd.org>
Cc:        freebsd-net@freebsd.org, Ricardo Nabinger Sanchez <rnsanchez@wait4.org>, hugme@hugme.org
Subject:   Re: Problem with port 0
Message-ID:  <45ACCFF4.4040709@cisco.com>
In-Reply-To: <45A807F8.7080603@FreeBSD.org>
References:  <f9876c510701120903r65543ef4nafc7eeead2becb42@mail.gmail.com>	<20070112163057.2a3ec8f0.rnsanchez@wait4.org> <45A807F8.7080603@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
So... I guess this really leads to a question..

What does "reserved" mean by IANA.

I know in SCTP we defined that port 0 is NOT to
be used (if I remember right)... but I am not
sure what IANA has in mind for TCP or UDP.

It is in the "lower range" of ports... and being
reserved implies that no app should use it..

This looks like a good question for tsvwg or end2end ..

I will pose it on tsv :-)

R

Bruce M. Simpson wrote:
> Ricardo Nabinger Sanchez wrote:
>> On Fri, 12 Jan 2007 12:03:17 -0500
>> "Hug Me" <hugme@hugme.org> wrote:
>>
>>  
>>> We believe FreeBSD is not allowing a UDP source port of 0 and the 
>>> kernel is
>>> dropping the packet before it ever reaches the tftp server but are 
>>> unable to
>>> verify this hypothesis. I was hoping someone here could help shed 
>>> some light
>>> on the problem.
>>>     
>>
>> But port 0 has special meaning to the kernel (ie, "give me some random
>> port").  Also, it is a reserved one.  Please check IANA:
>>
>>     http://www.iana.org/assignments/port-numbers
>>
>> I'm afraid you'll have to select another port number.
>>   
> Nope. A source port of 0 is perfectly legal for UDP.
> 
> I did an experiment with rpcbind whereby I performed a UDP based rpcinfo 
> query from one FreeBSD machine to another, captured the traffic, and 
> used tcpreplay to inject it from source port 0.
> 
> At first I thought the INPCB hash lookup was doing the wrong thing, then 
> I ktrace'd rpcbind and it was apparent that it was in fact being 
> delivered to rpcbind from udp_input().
> 
> rpcbind tries to reply to destination port 0. This was verified with 
> kdump and rpcbind -d. This quite rightly fails, and, indeed, we reject 
> this from the socket code.
> 
> So, FreeBSD appears to handle a UDP source port of 0 ok based on these 
> tests.
> 
> The most likely explanation for the failure in this case, without 
> looking further, is that inetd or the tftpd implementations can't handle 
> source port 0.
> 
> BMS
> 
> 
> 
> 
> _______________________________________________
> freebsd-net@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"
> 


-- 
Randall Stewart
NSSTG - Cisco Systems Inc.
803-345-0369 <or> 803-317-4952 (cell)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?45ACCFF4.4040709>