Say a user does a telnet to host 172.16.0.2. The request is handed down from the application layer to the Transport Layer. The transport layer then sees that telnet is going to be used, and telnet utilizes TCP, so that is what is chosen. Transport layer adds the destination port (23) and src port (empherical port of 1043?), sets the TCP timer and then passes the completed TCP segment to the network layer. The Network layer, adds src IP and dest IP and encapsulates the TCP segment in a packet. The network layer then sets the appropriate flags (Fragment/DF) and passes the packet to the bottom layer which places the packet in a frame (frame type is dependant upon network topology type being used. 802.3, 802.2 etc). The frame is sent across the wire as electrical signals.
The destination computer's network card receives the electrical signals and interprets them. It removes the frame from the packet and passes the packet to the network layer. De-encapsulation begins. Network layer runs a CRC on the packet and looks at where it's heading. If it doesnt match the dest IP, the packet is discarded. If it indeed matches the dest IP, it de-encapsulates the packet (leaving only a TCP segment) and passes the TCP segment to it's Transport layer. It's transport layer receives the TCP segment and ack's the original sender. Here is where dissolved gets lost.
Please help me fill in the gaps. I know not everything above is correct. Anyway:
1 How does the transport layer communicate with the application layer? Isnt the application layer unaware the 3 bottom layers are there?
2. Framing is done at layer 2 correct? What happens in situations like in VLANs where 802.1q is used. Do regular ethernet frames get framed within 802.1q? Or is 802.1q their primary framing method?
3. What is the primary framing method for ethernet LANs?
4. How would the above look, if we were using the OSI model? I know that the TCP/IP protocol suite was based on the OSI.