TCP/IP packets and datagrams

You are getting caught up in the details … packet and datagram are not exactly well defined terms. I also think that you are also looking at things backwards. In a conventional network:

  1. the link layer (e.g., 802.3 “Ethernet” or 802.11 “Wi-Fi”) presents frames to the network layer (e.g., IP, ICMP)
  2. The network layer assembles the frames into packets which are passed on to the next layer in the stack – the transport layer
  3. The transport layer, in turn, passes the bytes on to the application layer. The application layer API is really what distinguishes between data streams in TCP and datagrams in UDP

The OSI stack isn’t really used in practice any longer. In most cases, it has been replaced by the Internet Protocol Suite. The easiest way to understand how network stacks work is to buy a copy of “TCP/IP Illustrated: Volume 1”, download a nice network capture utility, and watch some Internet traffic. You can see how the packets are assembled from the physical layer upward.

Leave a Comment