0

Can a TCP data segment with a 1 byte length have, at the same time, the flags ACK, PSH, URG set ? Is it conform or not to the TCP protocol ?

Thank you.

2
  • Unfortunately, you have not provided enough information to be able to answer the question. Please edit the question to include the firewall model and configuration. Also, remember that programming and host/server questions are off-topic here
    – Ron Maupin
    May 10 at 14:02
  • "When establishing the connection to the database (after the TCP 3-way handshake)" After the three-way handshake, the connection is already established. I do not know what yo mean about establishing it after the three-way handshake because it is established during the three-way handshake.
    – Ron Maupin
    May 10 at 14:46

1 Answer 1

0

During the initial handshake, the OJDBC driver sends a packet with three TCP flags : ACK, PSH, URG. This packet is dropped by the firewall between the client and the DB server and the connection is not established.

That is correct. The initial segment from the initiator ("client") to the listener ("server") needs to use the SYN flag. If successful, the listener replies with SYN+ACK. Then the initiator sends a final ACK, mutually synchronizing their respective sequence number values. This is the classic TCP 'three-way handshake'.

PSH and/or URG flags may be used with any subsequent data segments, with or without ACK - these segments may not be empty though (not just a pure ACK without sending data). Using those flags within the initial SYN - SYN+ACK - ACK handshake isn't legal accordingly. Using stateful inspection, a firewall may reject an empty segment with PSH or URG.

Can a TCP data segment with a 1 byte length have, at the same time, the flags ACK, PSH, URG set ?

Yes. There's nothing in RFC 793 or common logic that prohibits such a segment, as long as it contains valid acknowledgement number and urgent pointer fields. You can check for yourself in RFC 793.

1
  • 1
    small note: every segment except the first one has an ACK flag set.
    – Effie
    May 11 at 5:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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