Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TCP/IP packets and datagrams

Is it true that upon receiving a segment from Transport Layer(TCP) towards Network Layer(IP) the resulting data unit will be a packet. Whereas when receiving a user datagram from Transport Layer(UDP) the resulting data unit will be a datagram?

like image 597
user1927452 Avatar asked Dec 25 '12 00:12

user1927452


1 Answers

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.

like image 65
D.Shawley Avatar answered Oct 12 '22 20:10

D.Shawley