Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Telnet can be used to manually do things that programs do automatically. When I connect to a server I noticed that it automatically does the 3-way handshake to establish a TCP connection. Can it be done manually in telnet? If not, then what program can do it?

share|improve this question
Could you explain why this is needed? – grawity Apr 7 '11 at 4:47
I'm learning about TCP/IP and there is a server that has been set up that I can experiment with. – tony_sid Apr 7 '11 at 5:27
You can use with nmap -sS family instead of scapy, scapy has been used for writing exploit. – PersianGulf Jan 19 at 7:59
up vote 8 down vote accepted

If by "manually" you mean "instruct telnet to send SYN and ACK packets", then no. This is done by the operating system, which needs to keep track of all TCP parameters for a connection – sequence numbers, window size, etc.

It would be possible for a program to use raw IP sockets and manage the TCP layer all by itself. But it's generally an incredibly pointless thing to do – it would copy a lot of code from kernel.

If you are trying to learn how TCP works, try Scapy. It can create and send packets using given parameters, including TCP. (You'll probably have to use a packet sniffer to watch for such things as SYN+ACK though.)

share|improve this answer

The book "TCP/IP Illustrated, Volume 1" by Stevens explains what goes on in creating and using a TCP connection. Yes, it has been around a while ( (c) 1994 ) but sometimes the explanations given when a technology is new have more depth than anything that comes after.

To see the details of what is happening on the wire a copy of Wireshark ( is what you need. When you understand how a header and message are structured and packed wireshark shows you the structure and you can drill down to the bit fields.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.