Back to the dissection lab!
Just like an Ethernet frame encapsulates an IP datagram, an IP datagram encapsulates a TCP segment. A TCP segment is the protocol data unit (mentioned in my previous post) that contains a TCP header and an application data piece (packet) which comes from the (upper) Application Layer. We typically refer to transport layer data as a segment and network layer data as a datagram.
Here’s how they all of our Lego pieces fit together:

So remember, an Ethernet frame has a special payload section which is really just the entire contents of an IP datagram.
Also remember that an IP datagram has a payload section and this is made up of what’s known as a TCP segment.
A TCP segment is made up of a TCP header and a data section (packet).
The data section in the TCP segment is just another payload area for where the Application layer places its data.
The TCP header is split into lots of fields:

Source Port – A high numbered port chosen from a special section of ports known as ephemeral ports. A source port is required in order to keep lots of … Read the rest