RE: [BEHAVE] running two application on same port

"Dan Wing" <dwing@cisco.com> Tue, 16 January 2007 18:28 UTC

Received: from [127.0.0.1] (helo=stiedprmman1.va.neustar.com) by megatron.ietf.org with esmtp (Exim 4.43) id 1H6t2Y-0008K0-0M; Tue, 16 Jan 2007 13:28:10 -0500
Received: from [10.91.34.44] (helo=ietf-mx.ietf.org) by megatron.ietf.org with esmtp (Exim 4.43) id 1H6t2W-0008Jn-H9 for behave@ietf.org; Tue, 16 Jan 2007 13:28:08 -0500
Received: from sj-iport-5.cisco.com ([171.68.10.87]) by ietf-mx.ietf.org with esmtp (Exim 4.43) id 1H6t2U-0006Fz-5W for behave@ietf.org; Tue, 16 Jan 2007 13:28:08 -0500
Received: from sj-dkim-7.cisco.com ([171.68.10.88]) by sj-iport-5.cisco.com with ESMTP; 16 Jan 2007 10:28:05 -0800
Received: from sj-core-4.cisco.com (sj-core-4.cisco.com [171.68.223.138]) by sj-dkim-7.cisco.com (8.12.11/8.12.11) with ESMTP id l0GIS5kN025833; Tue, 16 Jan 2007 10:28:05 -0800
Received: from dwingwxp ([10.32.240.196]) by sj-core-4.cisco.com (8.12.10/8.12.6) with ESMTP id l0GIS4nF021631; Tue, 16 Jan 2007 10:28:04 -0800 (PST)
From: Dan Wing <dwing@cisco.com>
To: 'Vikas' <pjain01@gmail.com>, behave@ietf.org
Subject: RE: [BEHAVE] running two application on same port
Date: Tue, 16 Jan 2007 10:28:04 -0800
Message-ID: <031901c7399c$1011ec80$c4f0200a@amer.cisco.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Office Outlook 11
In-Reply-To: <876aa5be0701160933q1cba0f45n2d34a247e168d484@mail.gmail.com>
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
Thread-Index: Acc5lJH0EVfYVdiZSjSCVPHfAiw2AwABohUQ
DKIM-Signature: v=0.5; a=rsa-sha256; q=dns/txt; l=1663; t=1168972085; x=1169836085; c=relaxed/simple; s=sjdkim7002; h=Content-Type:From:Subject:Content-Transfer-Encoding:MIME-Version; d=cisco.com; i=dwing@cisco.com; z=From:=20=22Dan=20Wing=22=20<dwing@cisco.com> |Subject:=20RE=3A=20[BEHAVE]=20running=20two=20application=20on=20same=20 port |Sender:=20; bh=2UNBXGtvkDL8mgOblatDDaCn57wRlrquCktdX2HXKlw=; b=X3bR5kLv0l0r8K6pzTHJWw4cG06WWXLBCSHEH5qJtRFKUOJ0kF5w8buY0wezhHD/g5Cs9Rr/ 7x9aEndGIwpjWCm0zP1zXhdme55cpBUBv7OBuYRSuUwf/ZYBygtmLTYl;
Authentication-Results: sj-dkim-7; header.From=dwing@cisco.com; dkim=pass (s ig from cisco.com/sjdkim7002 verified; );
X-Spam-Score: 0.0 (/)
X-Scan-Signature: 97adf591118a232206bdb5a27b217034
Cc:
X-BeenThere: behave@ietf.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: mailing list of BEHAVE IETF WG <behave.ietf.org>
List-Unsubscribe: <https://www1.ietf.org/mailman/listinfo/behave>, <mailto:behave-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www1.ietf.org/pipermail/behave>
List-Post: <mailto:behave@ietf.org>
List-Help: <mailto:behave-request@ietf.org?subject=help>
List-Subscribe: <https://www1.ietf.org/mailman/listinfo/behave>, <mailto:behave-request@ietf.org?subject=subscribe>
Errors-To: behave-bounces@ietf.org

> For STUN client to determine the NAT type we may have to run 
> it on the port over which the needy application is already running.

RFC3489 recommended determining the NAT type.  However, in practice,
this has been found to not work well because some NATs change their
behavior after a several round-trips of UDP messages (becoming full 
cone, for example), and others change their behavior to "symmetric"
if multiple hosts behind the NAT use the same source UDP port.  

Because of this, it is now considered 'state of the art' to _not_
probe to determine the kind of NAT you're behind.

>   How can we achieve this functionality as now we have to run 
> stun client using the same port  and same protocol as our 
> application is using?

You have to multiplex STUN with your application protocol.  Some
application protocols, such as RTP (RFC3550) are easily multiplexed
with STUN because the first few bits of a STUN packet and of an
RTP packet are different.  DTLS happens to demultiplex well, too
(see table in 
http://tools.ietf.org/html/draft-mcgrew-tls-srtp-00#section-3.6.2).

If your application protocol doesn't demultiplex as easily, you
may find it useful to rely on STUN's MAGIC-COOKIE attribute and
FINGERPRINT attributes to demultiplex STUN and your application 
protocol.  You could, of course, prefix all of your 
application protocol messages with an 8-bit value that 
doesn't overlap with STUN's first 8 bits, but that shouldn't be
necessary considering STUN's MAGIC-COOKIE and FINGERPRINT 
attributes, which were designed to make it possible to 
demultiplex STUN with arbitrary application protocols.

-d

_______________________________________________
Behave mailing list
Behave@ietf.org
https://www1.ietf.org/mailman/listinfo/behave