Raw socket three way handshake

M

Marco

I have a problem with the establishement of a three way handshake
through raw socket.
The problem is that if in my application client I use the syscall
socket(AF_INET,SOCK_RAW,IPPROTO_RAW)
the kernel will refuse the server answer because there isn't a
CONNECTED socket.
So I used the syscall connect()
but if I want sent another TCP packet I need to know the sequence
number that the
connect() has utilized and the ack from the server and I don't know how
capture this
information.
Can you help me, please?
Thanks in advantage.
 
P

pete

Marco said:
I have a problem with the establishement of a three way handshake
through raw socket.
The problem is that if in my application client I use the syscall
socket(AF_INET,SOCK_RAW,IPPROTO_RAW)
the kernel will refuse the server answer because there isn't a
CONNECTED socket.
So I used the syscall connect()
but if I want sent another TCP packet I need to know the sequence
number that the
connect() has utilized
and the ack from the server and I don't know how
capture this
information.
Can you help me, please?
Thanks in advantage.

Read the document at this URL:
http://www.ungerhu.com/jxh/clc.welcome.txt
and try to select a more appropriate newsgroup than this one.
 
B

Brand Bogard

Marco said:
I have a problem with the establishement of a three way handshake
through raw socket.
The problem is that if in my application client I use the syscall
socket(AF_INET,SOCK_RAW,IPPROTO_RAW)
the kernel will refuse the server answer because there isn't a
CONNECTED socket.
So I used the syscall connect()
but if I want sent another TCP packet I need to know the sequence
number that the
connect() has utilized and the ack from the server and I don't know how
capture this
information.
Can you help me, please?
Thanks in advantage.

This probably isn't the correct group for this kind of question but i will
try to put forth some kind of intelligible answer. It was my understanding
that TCP and sockets were a one to one relationship, so trying to connect
more than once to a socket that is already connected should fail. If you
want a single message to be "broadcasted" from a "server" you need an open
socket for each client. There might be some kind of support for
broadcasting in the tcp standard, but I don't know what they are or even if
they exist.
 
C

CBFalconer

Brand said:
.... snip ...

This probably isn't the correct group for this kind of question
but i will try to put forth some kind of intelligible answer. It
.... snip ...

Bad idea. Off topic answers do not get properly reviewed, because
the knowledgeable people are elsewhere. The proper response is to
refer the OP to an appropriate newsgroup.

--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell.org/google/>
Also see <http://www.safalra.com/special/googlegroupsreply/>
 
D

dfeustel

This question is dealt with in Stevens, _advanced network programming_
vol 1, sockets, 3rd ed. It is worth checking out.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,045
Latest member
DRCM

Latest Threads

Top