Tell me more ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|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

8 Answers

We say TCP segment is the protocol data unit which consists a TCP header and an application data piece (packet) which comes from the (upper) Application Layer. Transport layer data is generally named as segment and network layer data unit is named as datagram but when we use UDP as transport layer protocol we don't say UDP segment, instead, we say UDP datagram. I think this is because we do not segmentate UDP data unit (segmentation is made in transport layer when we use TCP).

Data Encapsulation and the TCP/IP Protocol Stack

share|improve this answer
1  
what's the difference between "package" and "packet"? – Janus Troelsen Mar 5 at 21:19
I meant packet :) I fixed it, thanks. – Ricardo Cristian Ramirez Mar 5 at 21:43

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.

share|improve this answer

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.

share|improve this answer

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

share|improve this answer

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.

share|improve this answer

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.

share|improve this answer

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.

share|improve this answer

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.

share|improve this answer
isn't the work TPDU used instead on the upper layers? see books.google.de/books?id=daqV_KzkoSIC&pg=PA147 – Janus Troelsen Mar 5 at 21:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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