Path: utzoo!utgpu!watserv1!watmath!att!linac!uwm.edu!spool.mu.edu!uunet!mcsun!unido!ira.uka.de!irafs2!guenther From: guenther@irafs2.ira.uka.de (Guenther Schreiner) Newsgroups: comp.protocols.tcp-ip Subject: Re: why UDP send ICMP port unreachable message? Keywords: BSD, UDP connections, ICMP port unreachable Message-ID: <91.060.16:34:30@ira.uka.de> Date: 1 Mar 91 16:34:30 GMT References: <9103011243.AA10028@ucbvax.Berkeley.EDU> Sender: news@ira.uka.de (USENET News System) Reply-To: guenther@irafs2.ira.uka.de (Guenther Schreiner) Followup-To: <9103011243.AA10028@ucbvax.Berkeley.EDU> Organization: University of Karlsruhe, FRG Lines: 29 In article <9103011243.AA10028@ucbvax.Berkeley.EDU>, TAYBENGH@NUSDISCS.BITNET writes: > Hi netlanders, > After reading thru the implementation of TCP/IP from > the book The Design and Implementation of the 4.3BSD OS (published by > Addison-Wesley) and the source code of BSD4.3 TCP/IP, I am puzzled of > the purpose of ICMP Port Unreachable error message sent by UDP that appeared > in the routine udp_input(). According to my understanding, this ICMP message > is never received by UDP, nor is reported to the user if the user send a > UDP message to a non-existent server (destination port). So why it is sent > by the UDP? Did I misunderstand sth? Even if it sounds strange, it is possible to establish a UDP "connection". If you do so (with the system call connect() and I/O with send()/recvfrom()), the I/O system calls will return EADDRNOTAVAIL, ENETDOWN and ENETUNREACH after an appropriate incoming ICMP message. In opposite to this the I/O calls will NOT return an error if you use a loose UDP connection (with sendto() and recvfrom() calls without a connect()). Hope this helps, Guenther -- Guenther Schreiner University of Karlsruhe, West Germany c/o Fakultaet fuer Informatik Phone: (0721) 608-2749 Am Fasanengarten 5 UUCP: ...!seismo!unido!uka!guenther 7500 Karlsruhe 1 CSNET: guenther@ira.uka.de EARN: GUENTHER at DKAUNI0I --