Definition of Network Units: Fragment, Segment, Packet, Frame, Datagram
Asked Answered
H

7

65

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?

Horner answered 24/7, 2012 at 17:45 Comment(0)
K
99

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

        +-----------------------+-------------------------+
        | Application (Data)    | Telnet, FTP, etc        | 
        +-----------------------+-------------------------+
        | Transport   (Segment) | TCP, UDP                | 
        +-----------------------+-------------------------+
        | Network     (Packet)  | IP, ICMP                | 
        +-----------------------+-------------------------+
        | Link        (Frame)   | 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 the transport layer, if the 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.

Kuehnel answered 24/7, 2012 at 18:28 Comment(15)
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.Wedding
"Protocol data unit" is a generic, albeit achingly OSI-ish, term for all of these, across the hierarchy.Wedding
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.Goodlooking
@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.Teresaterese
@Teresaterese And that's exactly why this person's answer is wrong and completely mixed up. And by the way, your o'reilly book gets it all right, but it would be more accurate if it said "link layer" instead of "network access" layer. See en.wikipedia.org/wiki/Internet_layerGoodlooking
Also dead wrong about frame being a physical layer representation . It is famously an OSI term at the OSI's Data Link Layer. A frame(which is Data, like everything above the physical layer) is not an ethernet cable for example. This answer really should not be mixing that up as well, saying frame is physical!Goodlooking
@barlop: O'Reilly video course, actually—from Ric Messier. Thanks for clarifying frame as data link layer. I also found (surprisingly) the yahoo answer here re packet vs datagram to be very helpful: in.answers.yahoo.com/question/index?qid=20080311235220AApLDVK Does that look accurate to you?Teresaterese
@Teresaterese 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")Goodlooking
so, the term datagram, is defined in that RFC but isn't well defined. e.g. what is "self contained". calling a layer self contained is like asking if a module of a computer program is self contained, you could argue either way, so not really, no! And the whole concept of "layers" is just a stupid way of describing what is going on.. We should really have a term that includes all the headers. Maybe that'd be as self contained as data can be. Even the concept of self contained data is baloney.Goodlooking
It may even be the case(I think I read) that the definition in one RFC doesn't have to be true for other ones! And maybe even is only true for that RFC. Though i'm sure the RFCs on UDP and IP are considered consistent with the definition of datagram. But the definition of datagram itself is not well put together. I have read that RFCs are descriptive rather then prescriptive. i.e. the thing was built then they wrote it up afterwards, and not very technically either. Also, RFCs relate to elements of TCP/IP, rather than ISO OSI.Goodlooking
I think I read once somewhere that the ISO people were taking a long time with their ISO OSI architecture, and TCP/IP architecture while perhaps sloppier, got there first. Hence, the internet runs on TCP/IP but people still use the ISO OSI as a reference model . I suppose Datagram would be TCP/IP terminology though(since it's in RFCs), definitely not ISO OSI terminology., and being used for IP and UDP, it isn't layer specific.Goodlooking
@Goodlooking thanks for pointing. My response mixes up couple of things from the book. The section it is referring is "1.2 Layering" from the book. In the picture, instead of "Physical", it is "Link". Will edit the answer. The link layer logic sits in drivers or even further in software on ASICs. In today's networking industry, the data plane on a router is so evolved it is extremely hard to point where link-layer functionality starts and ends. In that context, the answer should provide a fair idea on what each term means.Kuehnel
You still haven't fixed your "definition" of frame, which already misled another one of the answerers(halberdier), and made his answer more convoluted.Goodlooking
would it be correct to say a "TCP datagram" or is that a no-no?Stricklin
@Goodlooking Actually symbol is something completely else. It can be very loosely viewed as an equivalent of a bit at the actual physical layer, i.e., at the level of voltages or electromagnetic waves. Also, a single symbol may carry non-integer number of information bits, e.g., 1/3, 1/2, 2/3, 4/3, 2, 3, 4, etc. depending on the modulation type and forward error correction code (actually on code rate matters) used. If I remember correctly, there is an MCS (modulation and coding scheme) in LTE that carries ~1.18 bit/symbol. In 3G, on the other hand, one bit could be divided into multiple chips.Nonresistant
P
11

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.

Plugboard answered 10/6, 2016 at 6:28 Comment(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.Goodlooking
@Goodlooking He's using terminology that's consistent with amazon.com/dp/9332518742.Tiein
@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.Goodlooking
@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.Tiein
@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).Goodlooking
That page cuts the OSI ref down to 4 layers and applies it to TCP/IP which is 4 layers. So is it using OSI terminology or TCP/IP terminology when it says "bit" , isn't clear. These wikipedia pages are perhaps more careful en.wikipedia.org/wiki/Internet_protocol_suite and en.wikipedia.org/wiki/OSI_model though they don't mention the name of what is on the physical layer.Goodlooking
Interestnigly though, your page en.wikipedia.org/wiki/Protocol_data_unit#OSI_model does link to en.wikipedia.org/wiki/Physical_layer which mentions "bit" but wikipedia says that page has multiple issuesGoodlooking
@Goodlooking it's quite clear the whole terminology around the layers is a complete mess nowadays.Tiein
@devouredelysium Not really. Wikipedia is generally more accurate than most books,ur wikipedia link is very unusual and an odd one out on wikipedia and it even says on your link about it needing references/citations. Books tend to have terminology wrong all the time on various subjects.RFCs are a bit peculiar with terminology in that the terminology might only be for that RFC. But still there are official standards.. People can still apply the OSI reference model to the TCP/IP architecture. AFAIK it's symbol at the physical layer in the OSI reference model(but the term seems a bit abstract)Goodlooking
L
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.

Leonardoleoncavallo answered 30/11, 2013 at 16:50 Comment(0)
S
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.

Swetiana answered 17/2, 2015 at 0:49 Comment(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."Teresaterese
I
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.

Irredentist answered 30/6, 2015 at 8:47 Comment(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.Teresaterese
@Teresaterese 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!Goodlooking
Can we say that the Data sent in Transport layer are Packets consisting of a Header (Segment, Datagram) and a Message (data layer) ?Peavey
V
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

Viscount answered 8/6, 2016 at 3:57 Comment(1)
Can you provide the other questions answers?Voile
A
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

Argentiferous answered 1/2, 2022 at 11:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.