Reputation: 6326
I want to implement a simplified TCP/IP stack. Now I am writting my tcp_connect
function.
In the handshake step, can I send the TCP segment without TCP options and data(Only send the TCP header in the client side)?
Upvotes: 0
Views: 390
Reputation: 103
There is only three (simple for implementation) options described in RFC793:
Kind Length Meaning ---- ------ ------- 0 - End of option list. 1 - No-Operation. 2 4 Maximum Segment Size.
You can try to append only "End of option list" to TCP header, or use predefined template.
As a client, you may not add data in outgoing handshake-segments, but you should be able to process incoming ones when you accept connection.
I tried as you saied, but cannot get response.
Did you try to use something like TCPdump on other side? Any incoming segments?
Upvotes: 0
Reputation: 781058
I don't think any options are required. However, it you don't send the Maximum Segment Size option, the default MSS that's assumed is only 576.
TCP handshaking segments don't usually include any data. However, it's legal to include it, so your stack should accept it if it receives it.
Upvotes: 1