64

What units are used in network terminology? Where do we use them?

I know the following - but I'm not sure what their meaning is:

  • Fragment
  • Segment
  • Packet
  • Frame
  • Datagram

Can they be assigned to a specific OSI-Layer? Is it more complex?

7 Answers 7

94

Taking from Section 1.2 in TCP/IP Illustrated: Vol 1 by Richard Stevens et al., consider the 4 layered TCP/IP stack:

        +-------------+-------------------------+
        | Application |  Telnet, FTP, etc       |
        +-------------+-------------------------+
        | Transport   |  TCP, UDP               |
        +-------------+-------------------------+
        | Network     |  IP, ICMP               |
        +-------------+-------------------------+
        | Link        | drivers, interface card | 
        +-------------+-------------------------+

Segment: If the transport protocol is TCP, the unit of data sent from TCP to network layer is called Segment.

Datagram: This is used in 2 layers. If the network protocol is IP, the unit of data is called Datagram. At transport layer, if protocol is UDP, we use datagram there as well. Hence, we differentiate them as UDP Datagram, IP Datagram.

Frame: Physical layer representation.

Packet: It is a more generic term used either transport layer or network layer. TCP Packet, UDP Packet, IP Packet etc. I have not seen it to represent Physical layer data units.

Fragment: My guess here is that when a unit of data is chopped up by a protocol to fit the MTU size, the resultant unit of data is called Fragments. But I am guessing.

15
  • 2
    Whilst it's not common, you do occasionally hear of "ethernet packets", eg on the Wireshark wiki. "Frame" is certainly more standard at the physical layer. Jul 24, 2012 at 21:37
  • 2
    "Protocol data unit" is a generic, albeit achingly OSI-ish, term for all of these, across the hierarchy. Jul 24, 2012 at 21:38
  • I haven't read the book though I should.. but are you sure that's taken from stevens book? 'cos that doesn't really look quite right from a technical perspective.. e.g. I think in the TCP/IP reference model / architecture, it's Internetwork Layer not Network layer. Network layer is ISO/OSI terminology. And I think there's a "Link Layer" in the TCP/IP ref model that I don't see in your answer. And in the ISO OSI ref model, layer 1(Physical) I have heard a 'packet' there is called a symbol, Layer 2 is a frame.
    – barlop
    Nov 19, 2014 at 6:35
  • 1
    @barlop: Replace "Network" with "Internet" and replace "Physical" with "Network Access" in the above diagram, and it will match the TCP/IP model I studied from O'Reilly.
    – Wildcard
    Oct 8, 2015 at 8:06
  • 1
    @Wildcard The term datagram is used in the definition of UDP(the D in UDP), and the RFC for IP(uses the term IP datagram), and the term is defined in RFC 1594 See that definition. It says it should be self contained n have sufficient info to be routed from source to dest. UDP resembles the datagram definition because it is connection-less, so it doesn't rely on earlier messages, so is self contained in that sense.Packet resembles the datagram definition,'cos it has the source n dest network address so "self contained" and "sufficient information to be routed from source to dest")
    – barlop
    Oct 8, 2015 at 10:02
10

These terms are used to refer at which OSI layer we are referring to, the data remain same but the headers and trailers are getting added or removed.

In Phy layer i.e. physical layer the actual data is in "bits" i.e. 0 and 1.

When it reaches to data link layer or Layer 2 it becomes "frame" with source and destination mac address getting added.

When it reaches the third layer or the networking layer it becomes a "packet" with source and destination IP address attached to it.

Finally it become "segment" at Layer 4 or TCP/IP layer. Basically "segment" term is used for TCP connections and "datagrams" for UDP.

So what about other layers like : session, presentation and application ? In these layers the data is termed as "PDU" or "protocol data unit".

So when someone says, that a "frame" is being received by a networking device, then you know that the device is switch.

Router receives a packet and process it.

9
  • looks good, do you have a source ? it's interesting that you have all the funny obscure OSI terms like frame, PDU, segment, Then for physical layer you speak of bits, like a normal term, does the OSI use bits to refer to things in the physical layer the same way they use frame, segment, e.t.c. for other layers? is your source even the OSI? the OSI was the one that coined the terms frame e.t.c. afaik.
    – barlop
    Mar 9, 2019 at 19:40
  • @barlop He's using terminology that's consistent with amazon.com/dp/9332518742. May 30, 2019 at 11:05
  • @devouredelysium you're saying he's using the same terminology as Computer Networks 5th By Andrew S. Tanenbaum . Bear in mind though that a general book on networking will often not use correct/official terminology, often out of sloppyness. Can't comment much on his content specifically but dannyreviews.com/h/Computer_Networks.html shows a quote and looking at the quote I notice that he might be not clearly distinguishing between reference model and architecture.
    – barlop
    May 31, 2019 at 2:56
  • @barlop, just look at the wiki article. it's in full agreement with guo and the book I referred above: en.wikipedia.org/wiki/Protocol_data_unit#OSI_model. The physical layer unit is the bit. May 31, 2019 at 8:26
  • @devouredelysium What is at that wikipedia page is problematiic. Notice that that wikipedia page speaks of 4 layers and calls it OSI model , it has clearly mixed up TCP/IP with OSI. And possibly isn't clear in distinguishing reference and architecture. The terminology there may be more pragmatic, unclear whether it is using purely OSI terminology or purely TCPIP terminology when it comes to the physical layer, as it shows only 4 layers but calls it OSI model (The OSI architecture or of course the OSI reference model are 7 layer).
    – barlop
    May 31, 2019 at 10:02
4

The answer above is complete. Nevertheless, I think the term packet came from packet switching if I remembered that correctly ..

There are 2 types :

Circuit switching is a methodology of implementing a telecommunications network in which two network nodes establish a dedicated communications channel (circuit) through the network before the nodes may communicate. The circuit guarantees the full bandwidth of the channel and remains connected for the duration of the communication session. The circuit functions as if the nodes were physically connected as with an electrical circuit.(Wiki)

Packet switching is a digital networking communications method that groups all transmitted data – regardless of content, type, or structure – into suitably sized blocks, called packets.(Wiki)

I would have defined it myself, but just to be sure.

So here is the Packet Term. In regard of fragment I concur with Josua Schmid's answer.

2

I agree with the answers above, but it is important to emphasize that this is assuming the TCP/IP stack. If we use the OSI model, which in my opinion is more widespread, we would have the following case:

Transport layer: Segment if TCP, Datagram if UDP Network layer: Datagram, Fragment can be used if split (it would still be a datagram) Data-Link layer: Frame in MAC sublayer, frame or bit in LLC sublayer (depends on what level you work with, they are not interchangeable) Physical layer: Bit

And as mentioned in previous answers packet is more generic, it can be used for Transport, Network or Data-Link layer, but NOT for the physical layer. At this level it has not been "packed" yet. So I would say this is the biggest difference between the TCP/IP Stack model and the OSI model. The OSI model breaks down the physical layer from the TCP/IP stack into two layers: Data Link and Physical.

Hope this helps.

1
  • Upvoting for answering with a tie-in to OSI. However, I disagree with your "single biggest difference" statement: TCP/IP Stack model combines Data Link and Physical into "Network Access", it is true, but it also combines OSI's top three layers Application, Presentation, Session into "Application Layer."
    – Wildcard
    Oct 8, 2015 at 8:15
2

Frame as physical layer representation doesn't sound 100% accurate to me. It is mostly in the data-link layer, which is above the physical.

For a more operational definition, I would say that a frame is a protocol data unit that has means to determine its boundaries. Examples:

  • an HDLC frame has flags at the beginning and end and a bit stuffing
    mechanism
  • an Ethernet frame uses preamble and SFD
  • GFP uses HEC frame delineation, like ATM

A cell, as in ATM, just to introduce one term more, is a fixed-length frame.

A packet is instead a protocol data unit that relies on a lower layer unit to determine its boundaries. It may fit exactly in one frame or be broken into fragments if required. In the latter case fragmentation and reassembly mechanisms must be devised. Datagram is mostly a synonym for packet.

An application data stream can be broken into segments. A segment is carried over a datagram, then segments are reassembled into the original application stream. This is typically done by the TCP layer. So in TCP we have application stream over TCP segment over IP datagram over data-link frame. In UDP there is no segmentation, so the UDP datagram is one-to-one mapped onto the IP datagram.

3
  • This might be a useful answer, but keep in mind that the people reading this are trying to clear up a confusion on basic terminology, and introducing the additional terms HDLC, SFD, GFD, HEC, and ATM, is really not necessary to answering the question. Introducing "cell" is fine, because you included a definition for it also.
    – Wildcard
    Oct 8, 2015 at 8:12
  • 1
    @Wildcard He introduced that re Frame, because he was a little bit confused by the answer with 25 upvotes, so he says "Frame as physical layer representation doesn't sound 100% accurate to me" and he speaks of a more operational definition, And he goes technical because he can't simplify it.But,actually,it is much simpler..We can completely throw out the wrong definition of frame given in the answer with 25 upvotes.,Frame(an OSI term) is not a physical layer thing it's a data link layer thing.And is Data(like everything above physical).No need for different actual and operational definitions!
    – barlop
    Oct 8, 2015 at 9:06
  • Can we say that the Data sent in Transport layer are Packets consisting of a Header (Segment, Datagram) and a Message (data layer) ? Dec 14, 2015 at 23:31
1

a Datagram is.... A self-contained, independent entity of data carrying sufficient information to be routed from the source to the destination computer without reliance on earlier exchanges between this source and destination computer and the transporting network. (... used in UDP)

a Segment is .... A protocol data unit which consists a TCP header and an application data piece (packet) which comes from the (upper) Application Layer

1
  • Can you provide the other questions answers? Jun 8, 2016 at 4:02
0

Packet: The basic unit of communication between a source and a destination in a network is a packet. Packets are data units within the network layer in the OSI model. The packet is in a Network layer.

Fragment:Packets can often be larger than the maximum size, so each packet is also divided into smaller pieces of data called fragments. The Network layer is responsible for fragmentation.

Segment: A segment is a broken piece of a packet with a TCP header in each of them. segments increase the efficiency of network performance and improve security. Segments are in a Transport Layer.

Frame:Similar to a Packet, frames are small parts of a message in the network. a frame is the unit of data used in the OSI model’s data link layer.

Datagram:The datagram represents a data unit of transfer in networking. Data transmitted in a network is divided into smaller parts called datagrams. Transport layer

In addition, there is something class bit, this is in a Physical layer

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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