Messages, Segments, Datagrams, and Frames

Messages, Segments, Datagrams, and Frames

The following figure 1 shows the physical path that data takes down a sending end system's protocol stack, up and down the protocol stacks of an intervening link-layer switch and router, and then up the protocol stack at the receiving end system. As we discuss later in this blog, routers and link-layer switches are both packet switches. Similar to end systems, routers and link-layer switches organize their networking hardware and software into layers. But routers and link-layer switches do not implement all of the layers in the protocol stack; they normally implement only the bottom layers. As shown in the following figure 1, link-layer switches implement layers 1 and 2; routers implement layers 1 through 3. This means, for instance, that Internet routers are capable of implementing the IP protocol (a layer 3 protocol), while link-layer switches are not. Well see later that while link-layer switches do not recognize IP addresses, they are capable of recognizing layer 2 addresses, such as Ethernet addresses. Note that hosts implement all five layers; this is consistent with the view that the Internet architecture puts much of its complexity at the edges of the network.

Hosts, routers, and link-layer switches; each contains a different set of layers, reflecting their differences in functionality.

The above figure 1 also demonstrates the important concept of encapsulation. At the sending host, an application-layer message (M in figure 1) is passed to the transport layer. In the simplest case, the transport layer takes the message and appends additional information (so-called transport-layer header information, H, in figure 1) that will be used by the receiver-side transport layer. The application-layer message and the transport-layer header information together constitute the transport-layer segment.  The transport-layer segment thus encapsulates the application-layer message. The added information might contain information allowing the receiver-side transport layer to deliver the message up to the proper application, and error-detection bits that allow the receiver to decide whether bits in the message have been changed in route. The transport layer then passes the segment to the network layer, which adds network-layer header information (Hn in figure 1) such as source and destination end system addresses, creating a network-layer datagram. The datagram is then passed to the link layer, which (of course!) will add its own link-layer header information and create a link-layer frame. Thus, we see that at each layer, a packet has two types of fields: header fields and a payload field. The payload is normally a packet from the layer above.

A useful analogy here is the sending of an interoffice memo from one corporate branch office to another via the public postal service. Suppose Alice, who is in one branch office, wants to send a memo to Bob, who is in another branch office. The memo is similar to the application-layer message. Alice puts the memo in an interoffice envelope with Bob's name and department written on the front of the envelope. The interoffice envelope is similar to a transport-layer segment - it contains header information (Bob's name and department number) and it encapsulates the application-layer message (the memo). When the sending branch-office mailroom receives the interoffice envelope, it puts the interoffice envelope inside yet another envelope, which is suitable for sending through the public postal service. The sending mailroom also writes the postal address of the sending and receiving branch offices on the postal envelope. Here, the postal envelope is similar to the datagram - it encapsulates the transport-layer segment (the interoffice envelope), which encapsulates the original message (the memo). The postal service delivers the postal envelope to the receiving branch-office mailroom. There, the process of de-encapsulation is begun. The mailroom extracts the interoffice memo and forwards it to Bob. Eventually, Bob opens the envelope and removes the memo.

The process of encapsulation can be more complicated than that described above. For instance, a large message may be divided into multiple transport-layer segments (which might themselves each be divided into multiple network-layer datagrams). At the receiving end, such a segment must then be reconstructed from its constituent datagrarns.


protocol stack, network layer, datagram

Copy Right

The contents available on this website are copyrighted by TechPlus unless otherwise indicated. All rights are reserved by TechPlus, and content may not be reproduced, published, or transferred in any form or by any means, except with the prior written permission of TechPlus.