How do protocols like TCP identify the beginning of a new frame?
TCP can be viewed as an ordered stream of bytes. I don't think TCP needs to identify the beginning of new frames. Frames are usually related to medium access control protocols such as ETHERNET.
ETHERNET protocol uses a preamble (sequence of bytes) to identify beginning of a frame.
This is a common TCP/IP STACK used on LANs:
TCP <-- transport (byte streams here)
------
IP <-- network (packets here)
------
ETHERNET <-- medium access (frames here)
------
RJ45 cable <-- physical layer
How does ETHERNET ensure that the preamble won't occur in TCP/IP section?
A TCP stream is carried in (broken into) one or more IP packets.
IP packets are carried in Ethernet frames.
The IP network device driver splits its IP packets into one or more Ethernet frames before transmission (splitting the IP packets, and adding Ethernet frame headers), and after reception it reassembles Ethernet frames into IP packets (discarding Ethernet frame headers and combining IP packet fragments).