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?

link|improve this question
This is really unclear. Are you asking if a TCP header is made up of segments? Or if a TCP segment is part of a TCP packet? – viking Jun 16 '11 at 14:51
You are not making things any clearer. TCP does not know packets. – Florenz Kley Jun 16 '11 at 15:13
feedback

6 Answers

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.

link|improve this answer
feedback

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:

Transmission Control Protocol accepts data from a data stream, 'segments' it into chunks, and adds a TCP header creating a TCP segment.

link|improve this answer
feedback

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.

link|improve this answer
feedback

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.

link|improve this answer
feedback

The "generic" term for things like this is Protocol Data Unit, or PDU.

LAYER # - OSI NAME     - COMMON PROTOCOL OR USE - PDU NAME
-------   ------------   ----------------------   --------------------------
Layer 1 - Physical     - Transceiver            - bits, or a physical signal
Layer 2 - Datalink     - Ethernet               - frame
Layer 3 - Network      - IP                     - packet
Layer 4 - Transport    - TCP                    - segment
Layer 5 - Session      - SIP                    - data, request, or response
Layer 6 - Presentation - Encryption/compression - data, request, or response
Layer 7 - Application  - HTTP                   - data, request, or response

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.

link|improve this answer
feedback

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".

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.