ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I'm trying to write an application in C that estabilish a TCP connection
"the hard way", I mean, using raw sockets and so filling up all the ip and
tcp headers fields... after some days I'm almost finished but i've a
i send the first packet (the SYN one), the host B answer me with a packet
with flags SYN ACK, and until here, all goes well, but i can't send the
third packet with the last ACK... i sniffed with ethereal and i see this:
to send the data i tried to use the same socket used for the
first packet, then i tried creating another one... but the result is the
same... someone knows if I'm missing something?
thanks for the help
your host A tcp is responding to the SYN|ACK from host B with a RESET, as according to the TCP protocol. port 1234 on host A is not open, so it is not expecting to recieve random SYN|ACK packets, so when it recieve the reply it properly sends a RST. you can't do anything about that unless u hack up the protocol stack. or perahps u can use a iptables rule to drop outgoing RST packets from host A while u do ur testing.
the KERNEL LEVEL NETWORK PROTOCOL STACK, in follownig the tcp protocol, will SEND A RST whenever it receives a SYN|ACK on a closed port, or on an open port when it is not expecting to receive a SYN|ACK. when the client B computer receives this RST, it will then take the socket out of the SYN received state and put it back into LISTEN state. unless u make an iptables rules on client B that drops all incoming RST's , i dont see how to accomplish what you are doing.