www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2017/03/30/14:31:56

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:subject:references:to:from:reply-to:message-id
:date:mime-version:in-reply-to:content-type
:content-transfer-encoding; q=dns; s=default; b=W1wGZd3j4kVV+hmn
EmOU/FxSKaqy3RrQKWLJX9ARYPSs1AISGSJa3ISkGBFNtcc1ZQaul9YngA6paykI
gIkXsN2xLPYeUC7tE1Rm9YYHdVdAKv5l4OAIoZcL2kYBj/yFbnJxoRNUr9P9+lRZ
18YM/ro5ZCkKCqfL6nvy1D8PQqY=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:subject:references:to:from:reply-to:message-id
:date:mime-version:in-reply-to:content-type
:content-transfer-encoding; s=default; bh=LfTHkP73wxueU0dgif22iv
HYSq4=; b=MZMtlG7vdqMm5A3+A9tmZ6REvu4uoNrB7WtECe0AJ1UZK+QGpLUp5l
K9NHZzpSZM1pGOh3sc60z9/Q8AWf8RHMH6x3KR04k4P6XHsQPXLDK4zpK2p8eA61
+7hQnb66KxMf8HJ5so1GslKRGycAP0TxiWQyCKVcCRJvdS53wu714=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=1.1 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=enright, Enright, 9000, H*r:ip*192.168.1.100
X-HELO: smtp-out-so.shaw.ca
X-Authority-Analysis: v=2.2 cv=XbT59Mx5 c=1 sm=1 tr=0 a=WqCeCkldcEjBO3QZneQsCg==:117 a=WqCeCkldcEjBO3QZneQsCg==:17 a=IkcTkHD0fZMA:10 a=JYxMXA2QCXHR4n8hN8AA:9 a=QEXdDO2ut3YA:10 a=pcOxmZ23bpgA:10
Subject: Re: reply: problem with nc 1.107-4
References: <000701d2a91e$c9b5bed0$5d213c70$@139.com> <CAOC2fq9vVLxCjUGJQUW7e0vagpjsft5oLiZTqzwFdox+8apb9g AT mail DOT gmail DOT com>
To: cygwin AT cygwin DOT com
From: Brian Inglis <Brian DOT Inglis AT SystematicSw DOT ab DOT ca>
Reply-To: Brian DOT Inglis AT SystematicSw DOT ab DOT ca
Message-ID: <8506e5b9-8ab4-2fbd-2cf0-222c729f15c5@SystematicSw.ab.ca>
Date: Thu, 30 Mar 2017 12:31:35 -0600
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <CAOC2fq9vVLxCjUGJQUW7e0vagpjsft5oLiZTqzwFdox+8apb9g@mail.gmail.com>
X-CMAE-Envelope: MS4wfOsJu0FhXoU7dEvNTLMavgcq7ASim/YiWmaGkpTWqjZ8y1FDv/yBrskOHocvo3UCL4EM4WBs4ccoVOmxuZL0+4uC+KDl79DbWxDakskVhZ1h3OlRY0bi t/7nPL3+TykNDtgGEfhx1UVblnXtQMgNWr+BiiFsQHxPMpOZ8K+5DsF7MRKVKzEEsx8U726ilZ2jDQ==
X-IsSubscribed: yes

On 2017-03-30 10:44, Michael Enright wrote:
> On Wed, Mar 29, 2017 at 11:28 PM, 高锋 wrote:
>> Two days ago, I wanted to determine whether a udp port of another 
>> machine is open or not, which is deployed on different subnet. But
>> Windows platform does not provide utility that can do this. So I
>> downloaded a setup.exe from cygwin, of which version is 2.877 (64 
>> bit), and I had never used this utility before.
> 
> I tried this command on Debian 8.7. My conclusion is that this didn't
> tell me that the UDP port is listened to by another machine. I used
> your exact command, which had similarly uninformative results as
> yours. There is no 10.31.x.x machine that I can reach, yet 'nc -u'
> allowed me to send text to that address and port. Strace of 'nc -uz'
> showed that the special -z option (zero i/o port scan) code "sent
> successfully" a single byte to the destination, even though it 
> doesn't exist.
> 
> I conclude that "nc -uz" can't be used to determine unambiguously if
> a UDP host is available, because it will succeed even if the host is
> not present. And that carries to all systems that use the same 'nc' 
> utility as Debian or Cygwin.

man nc CAVEATS says -uz always reports success and suggests how it 
could be used.

nc is used, instead of a network daemon, as a patient network pipe that 
can be used to move arbitrary bytes, without having to previously set 
up direct routes between systems or daemons to handle specific types of 
connections e.g. if you have sshd set up on a target system, and a 
route to it, you may do:

src $ tar -cf - -C /export/mnt/home . | ssh dest tar -xf - -C /nfs/home

with nc if you don't have any direct route to the target or sshd set up 
still you may do:

 dest $ nc -dl 9000 | tar -xf - -C /nfs/home

inter $ nc -dl 9000 | nc 10.123.456.789 9000

  src $ tar -cf - -C /export/mnt/home . | nc 192.168.123.456 9000

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019