Encapsulation And Decapsulation in Computer Network, Encapsulation and Decapsulation in OSI model, Encapsulation And Decapsulation in Protocol Layering , Encapsulation and Decapsulation in TCP/IP Model.
Encapsulation and Decapsulation :
One of the important concepts in protocol layering in the Internet is encapsulation/ decapsulation.
We have not shown the layers for the link-layer switches because no encapsulation/ decapsulation occurs in this device In Figure , we show the encapsulation in the source host, decapsulation in the destination host, and encapsulation and decapsulation in the router.
Encapsulation at the Source Host :
1. At the application layer, the data to be exchanged is referred to as a message . A message
normally does not contain any header or trailer, but if it does, we refer to the whole as the message. The message is passed to the transport layer
2. The transport layer takes the message as the payload, the load that the transport layer should take care of. It adds the transport layer header to the payload, which contains the
identifiers of the source and destination application programs that want to communicate plus some more information that is needed for the end-to-end delivery of the message, such as information needed for flow error control, or congestion control. The result is the transport-layer packet, which is called the segment (in TCP) and the user datagram (in UDP). The transport layer then passes the packet to the network layer.
3. The network layer takes the transport-layer packet as data or payload and adds its own header to the payload. The header contains the addresses of the source and destination hosts and some more information used for error checking of the header, fragmentation information, and so on. The result is the network-layer packet, called a datagram. The
network layer then passes the packet to the data-link layer.
4. The data-link layer takes the network header, which contains the link link layer takes the network- layer packet as data or payload and adds its own header, which contains the link-layer addresses of the host or the next hop (the router).. The result is link- layer packet, which is called a frame. The frame is passed to the physical layer for transmission.
Decapsulation and Encapsulation at the Router :
3. The data-link layer of the next link encapsulates the datagram in a frame and passes it to the physical layer for transmission
Decapsulation at the Destination Host :
Addressing :
- Although it looks as if we need five pairs of addresses, one pair per layer, we normally have only four because the physical layer does not need addresses; the unit of data exchange at the physical layer is a bit, which definition cannot have an address.
- As the figure shows, there is a relationship between the layer, the address used in that layer, and the packet name at that layer.
- At the application layer, we normally use names to define the site that provides services, such as someorg.com, or the e-mail address,
- At the transport layer, addresses are called port numbers, and these define the application layer programs at the source and destination. Port numbers are local addresses that distinguish between several programs running at the same time.
- At the network-layer, the addresses are global, with the whole Internet as the scope. A network-layer address uniquely defines the connection of a device to the Internet.
- The link-layer addresses, sometimes called MAC addresses, are locally defined addresses, each of which defines a specific host or router in a network (LAN or WAN).
Multiplexing and Demultiplexing :
- Since the TCP/IP protocol suite uses several protocols at some layers, we can say that we have multiplexing at the source and demultiplexing at the destination.
- Multiplexing in this case means that a protocol at a layer can encapsulate a packet from several next-higher layer protocols (one at a time); demultiplexing means that a protocol can decapsulate and deliver a packet to several next--higher layer protocols (one at a time)
- To be able to multiplex and demultiplex, a protocol needs to have a field in its header to identify to which protocol the encapsulated packets belong.
- At the transport layer, either UDP or TCP can accept a message from several application-layer protocols.
- At the network layer, IP can accept a segment from TCP or a user datagram from UDP. IP can also accept a packet from other protocols such as ICMP, IGMP, and so on
- At the data-link layer, a frame may carry the payload coming from IP or other protocols such as ARP
The OSI model :
- Established in 1947, the International Organization for Standardization (ISO) is a multinational body dedicated to worldwide agreement on international standards. Almost three--fourths of the countries in the world are represented in the ISO. An ISO standard that covers all aspects of network communications is the Open Systems Interconnection (OSI) model. It was first introduced in the late 1970s
- An open system is a set of protocols that allows any two different systems to communicate regardless of their underlying architecture
- The purpose of the OSI model is to show how to facilitate communication between different systems without requiring changes to the logic of the underlying hardware and software.
- The OSI model is not a protocol; it is a model for understanding and designing a network architecture that is flexible, robust, and interoperable.
- The OSI model was intended to be the basis for the creation of the protocols in the OSI stack. The OSI model is a layered framework for the design of network systems that allows communication between all types of computer system. It consists of seven separate but related layers, each of which defines a part of the process of moving information across a network (see Figure above)
OSI versus TCP/IP :
- First, TCP/IP has more than one transport--layer protocol. Some of the functionalities of the session layer are available in some of the transport-layer protocols
- Second, the application layer is not only one piece of software. Many applications can be developed at this layer. If some of the functionalities mentioned in the session and presentation layers are needed for a particular application, they can be included in the development of that piece of software