This "bump the sequence# forward by 1 for SYN and FIN flags" is sometimes referred to as the "Phantom Byte" -- since no actual byte of data is sent, but the presence of the SYN or FIN flag still increased the sequence number by 1.
The why behind it I think is easier to see with the FIN than it is for the SYN. And to show it I'll use this screenshot:
(source: TCP - 12 simple ideas to explain the Transmission Control Protocol
In this illustration, Alice & Bob are closing a TCP connection using FIN flags. Here is a quick description of the first 4 packets:
- Packet#1 is Alice sending her last 200 bytes of data, SEQ 1401
- Packet#2 is Bob acknowledging reception by sending ACK 1601
- Packet#3 is Alice closing her side of the connection with a FIN, SEQ 1601
- Packet#4 is Bob acknowledging reception by sending ACK 1602
Look at packet#2 and #4 -- notice one was Bob sending ACK 1601, and the other was ACK 1602. Notice the packets are identical, except for the ACK#
If the phantom byte didn't exist, then the ACK in packet#4 would (still) be 1601... and Alice would not be able to differentiate between packet#2 and packet#4 -- Which means Alice would not be able to determine whether this simply a resend or duplicate copy of packet#2, or a new ACK altogether.
the Phantom byte allows Bob to explicitly acknowledge the FIN, independent from acknowledging reception of data.
The same effect occurs a bit later with Packet #7 and #9 -- the increase of the ACK# sent by Alice allows us to differentiate these two packets:
- Packet#7 is Alice ACKnowledging receiving the last byte of Data
- Packet#9 is Alice ACKnowledging receiving the FIN from Bob
Granted, that explains the Phantom Byte from the FIN perspective, but maybe not exactly with the SYN. My best guess is TCP chose to use the Phantom Byte strategy for the SYN as well to keep things consistent.
The general rule with TCP is anything that TCP intends to have acknowledged will increase the Sequence number: Data, FIN packets, and SYN packets.
Disclaimer: I created the video from which the screenshot above was taken.