Is a TCP segment not part of a TCP packet?
Here's what I've read:
A segment is a piece of application data chopped into a transportable size by TCP and wrapped with a TCP header
Isn't the TCP header itself made up of segments?
|
|
We say
|
|||||||
|
|
The TCP header, also referred to as "segment header", and the payload, or data, or "segment data" make up the TCP segment, of varying size. |
|||
|
|
|
A header is not made up of segments. A header always has the same size and must be complete. Otherwise, the packet could not be decoded. What you refer to as "Segment" is the whole "packet" that is later on combined with others to the TCP stream. See:
|
||||
|
|
|
The original TCP RFC is kind of fuzzy with how it uses the term "segment". In some cases, the term "segment" refers to just the current piece of the application data stream that's being transmitted, which excludes the TCP headers. For example, the TCP "Maximum Segment Size" (MSS) is the maximum size of the application data chunk in this message, not counting the TCP headers. But in other cases the term "segment" includes the whole TCP message, including the TCP headers. In fact in at least one case the spec mentions TCP segments with no application data (such as plain Acks). A single whole IP message is a "datagram". The original IP RFC refers to link-layer messages as "packets". IP datagrams can be broken into "fragments" to fit into the packet size limits on small-packet networks. The IEEE 802.3 / Ethernet link layer refers to a single contiguous physical-layer transmission as a "packet". The MAC data-link portion of the packet is called the "frame". The frame begins with the destination MAC address and ends with the Frame Check Sequence. The part of the frame that may contain an IP datagram (or fragment thereof) is called the "MAC Client Data field". So, technically, there is no such thing as a "TCP packet" or an "IP packet". Packets are terms from the layers below IP. TCP has "segments", and IP has "datagrams". |
|||
|
|
|
A TCP Segment is called a Datagram. Typically,a Segment or a datagram is a Packet. When the datagram or packet is processed by the Network layer, it adds the IP Header to the data and it becomes a IP Packet. Transport layer segments the data into smaller units called Segments, datagrams or so called packets. But we usually refer them as Segments. |
|||
|
|
|
A TCP segment IS a packet. A segment is only a part of a TCP connection stream between two computers. A datagram is a "packet" in UDP terms. |
|||
|
|
|
An IP packet is made up of an IP header with data attached. The data, is a TCP header and a segment of application data, called TCP Segment. TCP Segement is what you usually call a TCP Packet. |
|||
|
|
|
The "generic" term for things like this is Protocol Data Unit, or PDU.
Things kind of get blurry with specific protocols from layer 4 and up (for example, to this day I don't know of anything that's really purely a session protocol, and there really isn't such a thing as a common "presentation" protocol but it's defintely almost separate layer in a lot of software/communication stacks). Also, as previously mentioned, each one of these PDU's has a header that's distinct from its payload, or data. The header has information about the data and possibly a checksum for verification on the other end. |
|||
|