// JP opened flex table

Click to See Complete Forum and Search --> : TCP packets reception on RAW sockets


amiramin
December 19th, 2007, 11:47 AM
hi everyone,


I am implemeting a application using Winsock which receive data from interface (192.168.0.178 in following ethereal summary) using IP raw sockets. And it sends out the packet using Winpcap (as windows xp does not allow transmit on raw sockets).

My application is also generating the TCP connection packets. I am having a problem in this process as shown in following ethereal summary. It sends out packet 2 (TCP SYN) and gets the response packet 3 (TCP SYN-ACK). Before application can send next required packet 5 (TCP ACK), windows responds on its own with packet 4 (TCP RST) which destroy the connection and application does not work anymore.

2 24.103098 192.168.0.178 192.168.0.199 TCP 2500 > http [SYN] Seq=0 Len=0 MSS=1460
3 24.103324 192.168.0.199 192.168.0.178 TCP http > 2500 [SYN, ACK] Seq=0 Ack=1 Win=65535 Len=0 MSS=1260
4 24.103346 192.168.0.178 192.168.0.199 TCP 2500 > http [RST] Seq=1 Len=0
5 24.111957 192.168.0.178 192.168.0.199 TCP 2500 > http [ACK] Seq=1 Ack=1 Win=65535 Len=0

Is there a way that windows is prevented from automatically responding to this TCP SYN,ACK packet. Or I can reserve this port number 2500 so that windows ignores packets on this port.

I will appreciate any help in this regards.

Thanks,
Amir

MikeAThon
December 19th, 2007, 04:20 PM
it sends out the packet using Winpcap (as windows xp does not allow transmit on raw sockets).
It's correct that Win XP SP2 does not allow raw sockets.

Why do you think that use of Winpcap will get around this limitation? AFAIK, you cannot get around the limitation on raw sockets, and the RST that you are seeing is a direct result of prohibition on raw sockets.

Mike

amiramin
December 20th, 2007, 03:12 AM
I could complete leave out the RAW sockets for this application. And used the Winpcap for receiving and sending the packets. I still see the same problem that application only "sniffs" the packet and TCP/IP stack of windows responds to packet also. My target is to set windows to ignore packets on this port.

Amir

//JP added flex table