Purpose of Port 0.

Danny Niu <dannyniu@hotmail.com> Mon, 20 February 2017 08:31 UTC

Return-Path: <dannyniu@hotmail.com>
X-Original-To: ietf@ietfa.amsl.com
Delivered-To: ietf@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 55EC9129998 for <ietf@ietfa.amsl.com>; Mon, 20 Feb 2017 00:31:01 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.021
X-Spam-Level:
X-Spam-Status: No, score=-2.021 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=hotmail.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yB4wvbGHojc8 for <ietf@ietfa.amsl.com>; Mon, 20 Feb 2017 00:30:59 -0800 (PST)
Received: from COL004-OMC4S1.hotmail.com (col004-omc4s1.hotmail.com [65.55.34.203]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id AD7F01298A5 for <ietf@ietf.org>; Mon, 20 Feb 2017 00:30:59 -0800 (PST)
Received: from APC01-PU1-obe.outbound.protection.outlook.com ([65.55.34.200]) by COL004-OMC4S1.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008); Mon, 20 Feb 2017 00:30:59 -0800
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=G/PsliJ4ljplE7vYCRSNTYDQBdKHsrae87uf6PG9MeM=; b=M8frcgkSbySoB7OTfHllVjM/P232e0HtSHV0MLm8uZn0Sfqk3BU4sd2CuEvDxFevlW2PVZcdQJUYP38o7lHNwtOW62SHMMmuRoNmRaCul6JmqYHTYBUjHYv+h9EAXYsFEutMxmkul/WCZMSvZBgZ3j8VxwVpJgb1vbPZ4aHN7Cw87moWiNmkJ32Y8HxaF18C2BMwHKFAj5veInmCR42/t/hIp0HGdYhkr1q9zqXKuB30liHt1mh4pyOo1vpx19DZKs13HSnnL71NQz/GN68Ze/wwyL80dxz0Q8hm684JAEEnqfd3gfg+46Mt3DmRbNygVaKU7RGnTpvQWRyYvrmAyA==
Received: from PU1APC01FT115.eop-APC01.prod.protection.outlook.com (10.152.252.58) by PU1APC01HT008.eop-APC01.prod.protection.outlook.com (10.152.252.211) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.904.16; Mon, 20 Feb 2017 08:30:46 +0000
Received: from SG2PR06MB0710.apcprd06.prod.outlook.com (10.152.252.54) by PU1APC01FT115.mail.protection.outlook.com (10.152.252.208) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.904.16 via Frontend Transport; Mon, 20 Feb 2017 08:30:45 +0000
Received: from SG2PR06MB0710.apcprd06.prod.outlook.com ([10.162.197.144]) by SG2PR06MB0710.apcprd06.prod.outlook.com ([10.162.197.144]) with mapi id 15.01.0888.035; Mon, 20 Feb 2017 08:30:45 +0000
From: Danny Niu <dannyniu@hotmail.com>
To: "ietf@ietf.org" <ietf@ietf.org>
Subject: Purpose of Port 0.
Thread-Topic: Purpose of Port 0.
Thread-Index: AQHSi1DxuO1ub++PNkO0Iy9S1VhCGQ==
Date: Mon, 20 Feb 2017 08:30:45 +0000
Message-ID: <SG2PR06MB07108AF14AC5444D60CDBD36C15E0@SG2PR06MB0710.apcprd06.prod.outlook.com>
Accept-Language: en-US, zh-CN
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: ietf.org; dkim=none (message not signed) header.d=none;ietf.org; dmarc=none action=none header.from=hotmail.com;
x-incomingtopheadermarker: OriginalChecksum:6576CCD788312B64989F87781514AA46C572D1CDE516EBFF23264070BE2CC2E1; UpperCasedChecksum:DA0839D4BBDF7777C954BF10F5D0AFDD5B180AEC4FA5C0997F6E0C2257C7A44E; SizeAsReceived:7555; Count:37
x-ms-exchange-messagesentrepresentingtype: 1
x-tmn: [P//jLSCzmSRz6rLQae9tgpH29fZ9GGON]
x-incomingheadercount: 37
x-eopattributedmessage: 0
x-microsoft-exchange-diagnostics: 1; PU1APC01HT008; 5:VR7KIusxq866PThsESGK+KzHTBIpiorzzANBhjFJLr36cK4rUpD94LL+559s5EBLOQbm/PzcyPEM4LndFItRXmIzyi61r3mEa6macVd0YSzbXdDUaNhmndyuWydf0sV9xP2L/0+Cfufn99hGKW/3yEeyT3v2jcg5qGBjq77RxAU=; 24:PkLwUfYzV8y1SAKfW8CjuFHRN1qGEg69eGX6JQpLu71o97aYq+e8pnJXcrQpIVlrTF5rn1yPUo6RkK7XIUzQxXZOj/cAINiIE/tqRKrgS/0=; 7:mqhxuhwZY3BpOHPl940zVPlFwRcmCDI2TkRGiEFk+ioP8zn0d9O+KbnY3klPVH3yn8eCnjPFcd2/KclAdkTYwAzNqA3pXq2SHcyDyIuEtP9Ts7336v31PSK1hoCVLIc3pbHSQV0i4sveILfIEzXN82OIStqn1fN3Cy/dPEiBd8hIo2+omWJh2s3xH9/Gz/uJDpV8DOmMPHhTJALtXW/xw9Haz8DmyEnEo0IIEZsl2PCBsfzrnfcJuzPbtXXgLvGv72O+FSIUz0iDibTu7VpBRAv+AH1wHxYJPhQ6rLGJuJCIYBhXI/DVrViJRfvGqbv4
x-forefront-antispam-report: EFV:NLI; SFV:NSPM; SFS:(10019020)(98900012); DIR:OUT; SFP:1102; SCL:1; SRVR:PU1APC01HT008; H:SG2PR06MB0710.apcprd06.prod.outlook.com; FPR:; SPF:None; LANG:en;
x-ms-office365-filtering-correlation-id: 1a7550dc-2e64-484d-1218-08d4596ac3ca
x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201702061074)(5061506556)(5061507331)(1603103135)(1603101406)(1601125237)(1701031045); SRVR:PU1APC01HT008;
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(432015087)(444000031); SRVR:PU1APC01HT008; BCL:0; PCL:0; RULEID:; SRVR:PU1APC01HT008;
x-forefront-prvs: 02243C58C6
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: hotmail.com
X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Feb 2017 08:30:45.0881 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Internet
X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PU1APC01HT008
X-OriginalArrivalTime: 20 Feb 2017 08:30:59.0326 (UTC) FILETIME=[A9BA21E0:01D28B53]
Archived-At: <https://mailarchive.ietf.org/arch/msg/ietf/LbyPVSAPJ9VSzYkWJMD8-faDoL4>
X-BeenThere: ietf@ietf.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: IETF-Discussion <ietf.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/ietf>, <mailto:ietf-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/ietf/>
List-Post: <mailto:ietf@ietf.org>
List-Help: <mailto:ietf-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ietf>, <mailto:ietf-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 20 Feb 2017 08:31:01 -0000

Hi, all. 

Recently on the POSIX mailing list, there's a discussion on the correct way to bind to (or listen on) an ephemeral port. While I referenced the "UNIX Network Programming", we're not quite satisfied because even though it's co-written by someone involved in IETF, it's still JUST a textbook. 

The canonical way to do this, according to some (from stackoverflow.com, and other places), is to bind to port 0, which I assume had been reserved for this purpose, but I haven't find anything to back this up yet. 

On the POSIX list, they suggested that IETF should, (or should have already) state(d) that port 0 be reserved for binding to ephemeral ports. So can we find any reference for this? Or should we draft an RFC? 

Thanks.