Networking Forums

Networking Forums > Computer Networking > Linux Networking > connect() - tcpdump output question

Reply
Thread Tools Display Modes

connect() - tcpdump output question

 
 
Ural Mutlu
Guest
Posts: n/a

 
      07-24-2006, 04:26 AM
hi,

I am working on a large C/C++ program, and I've narrowed down one of the
errors to a connect() call, ie, connect() returns negative number.

I use the loopback, eg, ::1 for testing and the following lines are the
output of my tcpdump. (127.0.0.1 gives me the same output)

04:48:10.549398 IP6 ::1.60782 > ::1.ntp: S 3853331357:3853331357(0) win
32752 <mss 16376,sackOK,timestamp 3414555 0,nop,wscale 7>
04:48:10.549424 IP6 ::1.ntp > ::1.60782: R 0:0(0) ack 3853331358 win 0

I am not sure how I am supposed to interpret these lines. The first line
tells me that the client sends a packet with a seq number and a win size,
and the second line ack's the seq but win 0? Connection rejected?

Does the tcpdump output tell me that the client side connect() is working,
at least trying to establish a connection, but the server side
listen() or accept() fail?

Regards,
Ural
 
Reply With Quote
 
 
 
 
Mark
Guest
Posts: n/a

 
      07-24-2006, 05:07 AM
On Mon, 24 Jul 2006 05:26:13 +0100, Ural Mutlu wrote:

> hi,
>
> I am working on a large C/C++ program, and I've narrowed down one of the
> errors to a connect() call, ie, connect() returns negative number.
>
> I use the loopback, eg, ::1 for testing and the following lines are the
> output of my tcpdump. (127.0.0.1 gives me the same output)
>
> 04:48:10.549398 IP6 ::1.60782 > ::1.ntp: S 3853331357:3853331357(0) win
> 32752 <mss 16376,sackOK,timestamp 3414555 0,nop,wscale 7>
> 04:48:10.549424 IP6 ::1.ntp > ::1.60782: R 0:0(0) ack 3853331358 win 0
>
> I am not sure how I am supposed to interpret these lines. The first line
> tells me that the client sends a packet with a seq number and a win size,
> and the second line ack's the seq but win 0? Connection rejected?


Yes. 'S' is for syn. 'R' is for reset, which is what is used to reject a
connection. Could be a firewall, or there is no service listening on that
port on the server.

> Does the tcpdump output tell me that the client side connect() is
> working, at least trying to establish a connection, but the server side
> listen() or accept() fail?


Yes. I think most likely the listen(). Try "netstat --inet -l" on the
server to check if there is a indeed something listening on the right port.

Regards,
Mark.

 
Reply With Quote
 
Rick Jones
Guest
Posts: n/a

 
      07-24-2006, 06:12 PM
>> 04:48:10.549398 IP6 ::1.60782 > ::1.ntp: S 3853331357:3853331357(0) win
>> 32752 <mss 16376,sackOK,timestamp 3414555 0,nop,wscale 7>
>> 04:48:10.549424 IP6 ::1.ntp > ::1.60782: R 0:0(0) ack 3853331358 win 0


The ntp port? Is your program indeed meant to talk to a Network Time
Protocol server, or have you simply selected a "well known" port
number than happens to be the one assigned to NTP?

rick jones
--
The glass is neither half-empty nor half-full. The glass has a leak.
The real question is "Can it be patched?"
these opinions are mine, all mine; HP might not want them anyway...
feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
tcpdump output - what is 0x0020? news8080@yahoo.com Linux Networking 4 01-30-2007 07:27 PM
tcpdump output kenz Linux Networking 16 09-14-2005 12:27 AM
Unusual tcpdump output? bakdong@hotmail.com Linux Networking 9 01-19-2005 01:36 PM
need help to analyse tcpdump output mike Linux Networking 1 05-31-2004 11:44 PM
Does anyone understand tcpdump output? Tim Sampson Linux Networking 0 08-15-2003 02:15 PM



1 2 3 4 5 6 7 8 9 10 11