Tcp – When does the three way handshake take place in relation to data flowing down the OSI stack

arpositcp

I am very new to networking and I am currently trying to get my head around the order things happen in relation to the OSI stack. I know that the Transport layer takes the data stream and converts it into segments before handing it to the Network layer where a header is added relating to the IP address creating a packet before passing this packet to the Data Link layer where a header and footer are added including the MAC addresses creating a frame before finally being passed to the Physical layer in order to be converted into bits and sent along the network.

The part I am struggling with is where in the process certain protocols are involved. For example, TCP performs the three way handshake, supposedly at layer 4 (Transport), does this mean that the SYN is sent to the destination machine at this layer before waiting for the ACK so that the data can be sent later on from the Physical layer? Does the SYN have to go down the stack to be sent by the Physical layer and in turn the ACK back up the stack of the host before the actual data is sent again by the Physical layer?

Another example is ARP, when an ARP request is sent out by the Data Link layer in order to find the MAC address of the destination machine, is this sent out before the frame is created at layer 2?

I am unsure as to whether the only communication on the network is done at the Physical layer or if each layer interacts with the network relating to different protocols, as the data moves down the stack?

I have not been able to find a good video or diagram of the actual real world order that things happen so does anyone have a suggestion?

Best Answer

Sometimes, I wish they'd stop teaching the OSI model. It seems to confuse more than it helps.

When we say that layers communicate with each other, we mean the data created by a particular layer (say, transport) on host A is processed by the same layer on host B. This is a logical connection.

The actual data (in this case, the segment containing the SYN flag) is encapsulated in the Network PDU (IP packet), then encapsulated in the data-link PDU (Ethernet), then finally transmitted on the Ethernet cable (Physical layer). Host B reverses this process, unencapsulating the PDU at each layer until it reaches the transport layer. The transport layer processes the SYN flag and creates a new PDU containing the SYN, ACK flags. Then it sends it to A using the same encapsulation process.

The only way data is actually sent from one host to another is via the physical wire. Layer to layer communication is just a mental construct.

Related Topic