Just like Ethernet Frame encapsulates IP datagram, IP datagram encapsulates TCP segment. Ethernet frame has a payload section, which is really just the entire contents of an IP datagram. IP datagram also has a payload section which is made up of TCP segment.

Untitled

A TCP segment is made up of a TCP header and a data section

This data section, as you might guess, is just another payload area for where the application layer places its data.

Untitled

Source port and Destination port

Destination port: The port of the service the traffic is intended for.

Source port: A high-numbered port chosen from a special section of ports known as ephemeral ports

Ephemeral port is a temporary network communication endpoint that is used to establish a connection with a server application over the internet or a local network.

Ephemeral ports are also known as dynamic or private ports. They are part of a range of port numbers from 49153 to 65535 in the IANA (Internet Assigned Numbers Authority) port number range

Source port is required for the server to respond to the request by the client.

Sequence number

A 32-bit number that’s used to keep track of where in a sequence of TCP segments this one is expected to be.

There are limits to the total size of what we send across the wire. An Ethernet frame is usually limited in size to 1518 bytes but we usually need to send way more data than that.