Difference between Packets and Frames


A packet is a data unit created in the network layer. A frame is a data unit created in the data link layer. A packet is created first followed by the Frame. Both of them consists of data that is being transferred.

What are Packets?

A packet is a small fraction of data that is transmitted between the systems through internet. During data transfer, the entire data is not sent as a single unit over the network. The data to be transferred is broken down into multiple segments called packets. Transferring data in small packets increases the speed of data transfer.

Every system has its own IP address which is unique. The data to be transferred is first broken down into multiple segments. Each segment is then put into a packet. A packet consists of two parts: header and payload.

In order to send data from their computer, they must know the receiver’s IP address. This IP address along with the sender’s IP address is present in packet’s header so that the data is delivered to the correct destination. Payload is the data which is being transferred.

A packet with IP address in its header is known as IP packet where IP stands for Internet protocol.

What are Frames?

A frame is a data link layer transmission unit. It transfers data in Open Systems Interconnection (OSI) layers. Frames contains packets within them. They also play an important role in transporting data. They contain more information about the data being transferred than that of packets.

Just like IP address, computers also contain Mac address which is unique for every system. Once the packets are made, then they are put inside the frames. Frame consists of three parts − header, payload or data, and trailer.

The Mac address of the receiver is unknown because it is on different network. But the Mac address of the default gateway is known. So, frame header contains this mac address in it. Data is the packet present inside it. Trailer contains information about the destination system. It consists of meta data. It also contains data related to error corrections. A frame also contains another part called Flag, which is present at the starting and ending of the frame. This helps in identifying the beginning and ending of the frames.

A frame is separated from the successive frame through inter frame gap. Framing of data is very important as it makes sure that the data is delivered to the right system securely. It also maintains the accuracy and efficiency of the data.

Frames are of two types:

  • Fixed length frames: Here, frame size acts as delimiter. So, there is no need to set the external limit for the frame. The major drawback of fixed length frames is that it undergoes internal fragmentation. One of the solution for this is padding.

  • Variable length frames: There is no fixed size. Hence it is necessary to set boundaries. Boundaries are set at the starting and ending of the frames to distinguish one from another.

Process of Data Transfer

  • Data from the sender’s computer is broken down into several parts.

  • Each part is put into an IP packet.

  • An IP packet consists the source and destination IP addresses along with the data to be transferred.

  • Then, a Frame is created and that packet is kept inside this frame.

  • Frame consists of the default gateway Mac address.

  • Computer sends this frame to the switch through LAN.

  • Switch looks at the header of the frame and sends it to its respective router (default gateway).

  • This router checks the mac address. If it matches, it further opens packets and looks for the destination IP address.

  • Then it makes a new frame with destination system Mac address.

  • This is further sent to the switch. This switch reads the destination mac address and send it to the receiver’s system. The data is released and frames and packets are destroyed.

Difference between Packets and Frames

The following table highlights the differences between Packets and Frames:

Parameter

         Packets

          Frames

Definition

A packet is a unit of data used in network layer

A frame is a unit of data used in data link layer

OSI laye

Network layer

Data link layer

Includes

IP address of both source and destination systems along with data

Mac address of both source and destination systems along with data

Information

It has less information regarding the data being transferred

A frame has more information about the data being transferred than that of a packet

Correlation

A segment of data is encapsulated within the packet

A frame consists of a packet encapsulated within it

Layer

It is in layer 3

It is in layer 2

Parts

A packet consists of two parts. They are header and payload

A frame consists of 4 parts namely flag, header, payload and trailer.

Conclusion

Both frames and packets are data units at different layers of networking. A segment of data along with the source and destination IP addresses forms a packet. A packet with Mac address of source and destination forms a Frame. Both of these packets and frames are temporary. Once the data is delivered, they are destroyed.

Updated on: 28-Aug-2023

261 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements