Data goes through preparations to traverse the network when being sent or received. It moves through the OSI model layer by layer adding headers and trailers at each layer.
The data starts at layer 7, the Application layer where it's raw data. As it goes down the stack information is added onto the data.
LAYER : PDU
The process generally looks like this:
[ L4 S D Ports ]
DATA [ L4 Trailer ]
[ L3 S D IP Addr ]
[L4]
DATA [L4]
[ L3 Trailer ]
[ L2 S D MAC Addr ]
[L3]
[L4]
DATA [L4]
[L3]
[ L2 FCS Trailer ]
Basic travel logic:
Once the packet gets to it's final destination the encapsulation process is reversed by the basic travel logic stated above. So long as the addresses match the receiving device will strip each layer's travel data until it can send the data to it's ultimate destination, perhaps port 80 HTTP traffic destined for a web server.