So welcome back guys. next we will discuss the data encapsulation and decapsulation
So in this slide you can see that data encapsulation
happens on sending machine that is the machine which generates data and
Data decapsulation happens on the machine which receives the data that is receiving machine
So in the middle you can see the tcp/ip stack
Comprising of application, transport network data link. so in data encapsulation
The application generates a message
Now here the application could be any application running on the sending machine
for example, the application could be as simple as your
some messenger
or
It could be as simple as browsing the internet through web browser
So at the end of the day any network applications generate a data
This data is passed by the application to the transport layer
Now in this case the transport layer means that any protocol
Transport layer means it could be UDP protocol. It could be TCP protocol or it could be any other transport layer protocols
What does transport layer do the transport layer
Attaches its own header, which is called transport layer header
Now depending on the transport layer protocol whether it is UDP protocol or TCP protocol, the transport layer
attaches the corresponding header that is UDP header or TCP header and
The vital information that is contained in the transport header is
The encoding of the information of sending and receiving process
So note that the transport layer header contains the information of the sending and receiving
process
Now
What is that information which identify the process?
We will discuss that in detail when we will be discussing the transport layer
Because there has to be some process or some application which is running on the receiving machine
So the transport layer encodes the information of
The process which is running on the sanding machine and receiving machine
Once the transport layer attaches its transport layer header
The combined message is passed to the next layer in the tcp/ip stack
Which is the network layer?
Now the network layer protocol could be IP protocol. It could be ipv6 protocol or it could be any other protocol
But the most famous protocols are IP and ipv6
The network layer attaches its own header called IP header
or if the network layer protocol is ipv6 protocol, then it will attach ipv6 header and
in this
network layer header
What is encoded is the source and destination IP address that is the identity of the source machine
That is sending machine and the identity of the destination machine
Now the identity of the machines are identified using IP addresses
So what is encoded in the IP header is the identity of source and destination machines
Once the network layer attaches its own header
The rest of the message is passed down and the tcp/ip stack to the next layer called data link layer
Data link layer attaches its own header. We call it as Mac header and
what is that information which is encoded in Mac header?
The information which is encoded in the Mac header is the current node and next node MAC address
We will discuss in detail when we will be
learning l2 routing that
How MAC addresses are encoded in the MAC header and once the data link layer
Finished with attaching its own MAC header, the combined message is then passed to the next layer called physical layer
So you can see that the physical layer eventually places the data on the wire so
You can see that the physical layer eventually places the data on the wire in the form of electrical signals
Electrical signals are nothing but these are the varying high and low
voltages where high voltage represent one and the low voltage represent zero
So we will not going into too much detail regarding the physical layer
So let us assume that once the data is placed on the wire by the physical layer, the data
flows over the Internet
passes through the series of routers and machines and eventually
Reaches the receiving machine which is the destination machine
So on the destination machine
What happens that once the data is received on the destination machine the process of decapsulation happens
So let us say that the data has arrived on the destination machine
So on the destination machine, it is the data link layer which picks up the data from the wire
it examines the MAC header that was attached to the packet and
After examining the MAC header the data link layer passes the rest of the message to the layer above it
So the layer above it, that is the network layer
Receives the data and examines its own header, which is the IP header
We are assuming that the network layer protocol running is the IP protocol
So the network layer detaches its own IP header examines the IP header and
Passes the rest of the message to the layer above it in the tcp/ip stack
that is it passes the rest of the message to the transport layer and
The transport layer does the same thing it detaches its own transport header. It examines the transport header and
Passes the rest of the message to the application running on the top of the transport layer
The application finally consumes the data or optionally the application can reply back to the sending machine
so as you can see that in data decapsulation
That in data decapsulation
Whenever any layer receives a packet
from the layer below it, it first examines its own header and
Depending on the header content
It may choose to forward the packet to the layer running above it or it may discard the packet
So what is those criteria?
What does the layer actually
examines? That we will discuss in detail when we will be discussing each of the layer of the tcp/ip stack in the subsequent modules
data encapsulation
each layer
Attaches its own header and passes the message
with its header to the layer running below it in the tcp/ip stack and
In data decapsulation process each layer receives the data or packet from the layer
Running below it in the tcp/ip stack. it
Detaches its own header and passes the rest of the message to the layer running above it in the tcp/ip stack
So this is the entire picture that is a big picture of data encapsulation and data decapsulation
So next we will take a deeper dive into what actually happens
during data encapsulation and data decapsulation