Search code examples
network-programmingpacketsosi

packets compared to frames (osi)


This is my first question here so sorry if something isn't pretty or badly written.

but i've been learning about the osi model for some time now and i can't find a good indepth explanation about frames (in the data-link layer) and what is the difference between frames and packets?

thanks in advance.


Solution

  • Frames are what layer-2 protocols encapsulate layer-3 packets in. The layer-3 packet header will have the source and destination layer-3 addresses, and the layer-2 frame header will have the layer-2 source and destination addresses. The same holds true for layer-4 segments, which are encapsulated by layer-3 packets. The layer-4 segment header will have the layer-4 source and destination addresses.

    Layer-2 frames are used to deliver data on a LAN; layer-3 packets deliver data between LANs; layer-4 segments deliver data between applications.