network-programmingipdefinitionosi

Definition of Network Units: Fragment, Segment, Packet, Frame, Datagram


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:

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


Solution

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