Networking Forums

Networking Forums > Computer Networking > Linux Networking > TCP client machine (Linux) sent the unexpected RST right after the SYN was sent - libnet_write(l) was used

Reply
Thread Tools Display Modes

TCP client machine (Linux) sent the unexpected RST right after the SYN was sent - libnet_write(l) was used

 
 
slsworking
Guest
Posts: n/a

 
      09-24-2007, 02:18 PM
When a SYN packet was sent from the client machine to the port 25 of a
remote machine via the libnet_write. A RST packet (the 3rd packet
listed below) was sent right away from the client before or after the
SYN|ACK packet was sent back from the server machine. That RST seemed
to be sent by the TCP stack because the TCP client didn't send it. Can
you explain and resolve this unknown RST problem during establishing
the TCP connection? My goal is to avoid the RST packet being sent so
that the TCP connection can be established and other SMTP commands can
be sent from the client thereafter. Any Idea? Thanks in advance.

Packets captured and libnet codes sending the SYN and ACK packets are
listed below:

Packet number 1:
From: 10.103.3.80 To: 10.103.3.79
seq: 1500
ack: 0
th_flags: 2
Protocol: TCP
Src port: 27
Dst port: 25
Payload (0 bytes):
Hex values:

Packet number 2:
From: 10.103.3.79 To: 10.103.3.80
seq: 1540646009
ack: 1501
th_flags: 12
Protocol: TCP
Src port: 25
Dst port: 27
Payload (0 bytes):
Hex values:

Packet number 3:
From: 10.103.3.80 To: 10.103.3.79
seq: 1501
ack: 0
th_flags: 4
Protocol: TCP
Src port: 27
Dst port: 25
Payload (0 bytes):
Hex values:

Packet number 4:
From: 10.103.3.80 To: 10.103.3.79
seq: 1501
ack: 1540646010
th_flags: 10
Protocol: TCP
Src port: 27
Dst port: 25
Payload (40 bytes): E..(....@.^r.g.P.g.O............P....]..
Hex values: 45 00 00 28 00 f2 00 00 40 06 5e 72 0a 67 03 50 0a 67 03
4f 00 1b 00 19 00 00 05 dc 00 00 00 00 50 02 7f ff 0e 5d 00 0a

Packet number 5:
From: 10.103.3.80 To: 10.103.3.79
seq: 1501
ack: 1540646010
th_flags: 10
Protocol: TCP
Src port: 27
Dst port: 25
Payload (97 bytes): EHLO 10.103.3.80 .E..(....@.^r.g.P.g.O........
[.dzP...M...E..(....@.^r.g.P.g.O............P ....]..
Hex values: 45 48 4c 4f 20 31 30 2e 33 2e 31 30 33 2e 38 30 00 45 00

l = libnet_init(
LIBNET_RAW4,
NULL,
errbuf);
t = libnet_build_tcp(
src_prt, /* 27 */
dst_prt, /* 25 */
send_seq, /* 1500 */
send_ack, /* 0 */
TH_SYN, /* control flags */
32767, /* window size */
0, /* checksum */
10, /* urgent pointer */
LIBNET_TCP_H + payload_s, /* payload_s is 0 */
payload, /* NULL */
payload_s, /* payload size */
l, /* libnet handle */
0); /* libnet id */

t = libnet_build_ipv4(
LIBNET_IPV4_H + LIBNET_TCP_H + payload_s, /* length */
0, /* TOS */
242, /* IP ID */
0, /* IP Frag */
64, /* TTL */
IPPROTO_TCP, /* protocol */
0, /* checksum */
src_ip, /* 10.103.3.80 */
dst_ip, /* 10.103.3.79 */
NULL, /* payload */
0, /* payload size */
l, /* libnet handle */
0); /* libnet id */


c = libnet_write(l); // send the initial SYN packet out

// then client captured the SYN&ACK packet from the server at the port
25
// then do the libnet_build_tcp, libnet_build_ipv4 and libnet_write
after getting the expected SYN&ACK packet => shown as the packet 4
listed above. My code doesn't send the packet 3 (RST - as listed
above) from the client site (port 27), but it was sent (by?). So the
TCP connection can't be established.

 
Reply With Quote
 
 
 
 
Lew Pitcher
Guest
Posts: n/a

 
      09-24-2007, 05:15 PM
On Sep 24, 10:18 am, slsworking <slswork...@gmail.com> wrote:
> When a SYN packet was sent from the client machine to the port 25 of a
> remote machine via the libnet_write.

[snip]

Didn't you just ask this question on comp.protocols.tcpip? What part
of the answer(s) you got there didn't satisfy you? Perhaps you could
post a followup to that newsgroup.



 
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
How to remotely login into a pure IPv6 Linux machine from a DualStack windows machine chaitan Linux Networking 1 11-21-2007 05:37 PM
Linux TCP - unexpected retransmissions Francois Linux Networking 9 05-30-2007 05:27 PM
how to configure windows machine as client on linux domain sem Linux Networking 1 12-14-2006 09:22 AM
Simple client/server socket program works on one Linux machine, it doesnot work on other machine GS Linux Networking 2 05-09-2006 12:55 PM
For some experience, would like to implement "e-mail client" on Linux machine GS Linux Networking 0 12-04-2005 09:00 PM



1 2 3 4 5 6 7 8 9 10 11