TCP connections and the handshake
TCP numbers bytes rather than packets, opens each connection with a three-way handshake, SYN, SYN-ACK, ACK, in which each side picks an unpredictable initial sequence number, and every acknowledgement number names the next byte expected, which is what connect and accept do underneath.