Data Encapsulation Process

When the data transmited accros the network from one devices to the other, the process is called encapsulation. each layer has their own process and and method to transmit data. each layer uses Protocol Data Unit (PDU) which is I has explained in short here in the PDU has specific name in each layer. and keep in your mind that PDU information is read only by their peer on the receiving devices. eg. network layer should be readed on the network layer too. after readed the data will stripped off and handed down to the next layer.

Proccess transmiting data begin from upper layer which is known as (Application, Presentation, and Session) generate Data Stream send it out to Transport layer. 

The Transport layer will check the data using TCP or UDP. if TCP then Transport will create virtual circuit by using three-way handshake to establish virtual circuit. in this layer data sream called as Segment.

Each Segment then handed down to the Network layer. The Network layer will provide logical addressing (IPv4/IPv6) and routing. In this layer the PDU will called as Packet or Datagram.

Data Link layer responsible taking packet from Network layer and encapsulated them as a Frame. which is containing hardware address source and destination. then will sent it out to the destination. if the destination on the remote network frame will sent to the router. once get to the remote network new frame is used to reach the destination.

The Physical layer is reponsible to convert it to the digital signal (encoding) then transfer it to destination.

At the receiving host the devices will extract the bit (decode) at this point devices will reconstruct frame and run CRC. after that frame will be pulled to Network layer. Network layer will check the address if address match Transport layer will rebuild data stream and doing acknoledge of each pieces. Finaly data come to upper layer.

At a transmitting device, the data encapsulation method works like this:
1. User information is converted to data for transmission on the network.
2. Data is converted to segments, and a reliable connection is set up between the transmitting and receiving hosts.
3. Segments are converted to packets or datagrams, and a logical address is placed in the header so each packet can be routed through an internetwork.
4. Packets or datagrams are converted to frames for transmission on the local network.
Hardware (Ethernet) addresses are used to uniquely identify hosts on a local network segment.
5. Frames are converted to bits, and a digital encoding and clocking scheme is used.