Preamble and frame gaps in Ethernet frames

Table of contents

1. What is frame gap (IFG)

1.1. Preamble

1.2. Frame start delimiter (SFD)

1.3. IFG (Interframe Gap)

2. Why and what is frame spacing?

3. What is the size of IFG?

4. How to use IFG

5. Summary of actual use of IFG

The content of the text basically comes from the reference of the following two links, thank you for sharing: https://blog.csdn.net/a827415225/article/details/79423264

https://blog.csdn.net/weixin_43916755/article/details/122697478

1. What is frame gap (IFG)

First of all, let’s summarize the total 20 bytes of Internet frame gap, including:

  1. Ethernet minimum frame gap 12Byte
  2. Data link layer frame 7Byte (preamble, used for clock synchronization)
  3. Frame start identification 1Byte (identifies the start of the frame)

Preamble 7Byte

Frame start delimiter (SFD) 1Bye

Frame length

Frame gap (IFG) 12Byte

1.1. Preamble:

        Contains 7 bytes and consists of 10 cycles. The content of each byte is: 10101010;

The function of the preamble is to synchronize the clock between the sender and the receiver. When the sender sends data, it adds the seven-byte preamble as the message header and sends it to the receiver. When the receiver receives At 10101010, it will adjust its byte clock in accordance with the protocol and prepare to receive data from the sender.

1.2. Frame start delimiter (SFD):

        The length is 1 byte and the content is 10101011. The meaning of this code is to notify the receiver that when the content after 11 is received, it is not a synchronization signal but real data.

The usually said preamble contains (Preamle and SFD) a total of 8 bytes, but it is actually 7+1. Just know the function of each byte.

1.3, IFG (Interframe Gap frame spacing)

       Represents the time period between two adjacent Ethernet frames. The Ethernet transmission method is to send one frame one frame. There needs to be a gap between frames, that is, the frame spacing.

The length of the IFG is 96 bits (12 Byte), also known as the Ethernet minimum frame gap (IEEE802.3), which means waiting for 12 bytes before sending the next frame. This is related to the CSMACD feature to avoid conflicts.

IFG can also be called IPG (interpacket Gap ). IFP refers to a period of time, not a distance, and the unit is usually microseconds (us) or nanoseconds (ns)

2. Why and what is frame spacing?

After receiving a frame, network devices and components require a brief period of time to recover and prepare to receive the next frame.

3. What is the size of IFG?

The minimum value of IFG is 96 bittime, which is the time required to send 96-bit original data in the medium. The minimum value of IFG is different in different media. Regardless of 10M/100M/1000M Ethernet, the minimum value between two frames It must have 96bit, IFGmin=96bit/s

4. How to use IFG

IFG solves speed matching problem in Ethernet's flow control mechanism

  1. Device 1 uses its own working clock (OSC1) to send the data to be sent to device 2;
  2. Packet coming into device 2:

①After processing by the clock data restorer CDR, the clock is extracted from the data, and the extracted clock CLK2 is given, and the data packet is stored in the receiving buffer. At this time, CLK2 and OSC1 are synchronized;

②The data is processed from the receiving buffer and stored in the sending buffer after being processed by the upper layer protocol.

  1. The send buffer uses the working clock OSC2 of device 2 to send data. Since Ethernet works asynchronously, OSC1 and OSC2, as local clocks of different devices, cannot be completely on the same frequency (the working clock of the Ethernet device is allowed to have a difference of plus or minus 50ppm frequency difference), the above figure assumes that OSC1 is greater than OSC2, then the receiving speed of device 2 will be greater than the sending speed. If the receiving buffer is full, packet loss will occur.

How to solve the above problem? On the sending side of device 2, the IFG frame spacing is reduced to speed up the sending of valid data packets, so that the sending speed can keep up with the receiving speed.

5. Summary of actual use of IFG

  • As the IFG increases, the effective speed of the device decreases, which can solve the problem of packet loss due to excessive speed.
  • The IFG decreases (but must be greater than 96bittime), and the effective speed of the device increases, which can solve the problem of test timeout caused by too slow speed.

Table of contents

1. What is frame gap (IFG)

1.1. Preamble

1.2. Frame start delimiter (SFD)

1.3. IFG (Interframe Gap)

2. Why and what is frame spacing?

3. What is the size of IFG?

4. How to use IFG

5. Summary of actual use of IFG

The content of the text basically comes from the reference of the following two links, thank you for sharing: https://blog.csdn.net/a827415225/article/details/79423264

https://blog.csdn.net/weixin_43916755/article/details/122697478

1. What is frame gap (IFG)

First of all, let’s summarize the total 20 bytes of Internet frame gap, including:

  1. Ethernet minimum frame gap 12Byte
  2. Data link layer frame 7Byte (preamble, used for clock synchronization)
  3. Frame start identification 1Byte (identifies the start of the frame)

Preamble 7Byte

Frame start delimiter (SFD) 1Bye

Frame length

Frame gap (IFG) 12Byte

1.1. Preamble:

        Contains 7 bytes and consists of 10 cycles. The content of each byte is: 10101010;

The function of the preamble is to synchronize the clock between the sender and the receiver. When the sender sends data, it adds the seven-byte preamble as the message header and sends it to the receiver. When the receiver receives At 10101010, it will adjust its byte clock in accordance with the protocol and prepare to receive data from the sender.

1.2. Frame start delimiter (SFD):

        The length is 1 byte and the content is 10101011. The meaning of this code is to notify the receiver that when the content after 11 is received, it is not a synchronization signal but real data.

The usually said preamble contains (Preamle and SFD) a total of 8 bytes, but it is actually 7+1. Just know the function of each byte.

1.3, IFG (Interframe Gap frame spacing)

       Represents the time period between two adjacent Ethernet frames. The Ethernet transmission method is to send one frame one frame. There needs to be a gap between frames, that is, the frame spacing.

The length of the IFG is 96 bits (12 Byte), also known as the Ethernet minimum frame gap (IEEE802.3), which means waiting for 12 bytes before sending the next frame. This is related to the CSMACD feature to avoid conflicts.

IFG can also be called IPG (interpacket Gap ). IFP refers to a period of time, not a distance, and the unit is usually microseconds (us) or nanoseconds (ns)

2. Why and what is frame spacing?

After receiving a frame, network devices and components require a brief period of time to recover and prepare to receive the next frame.

3. What is the size of IFG?

The minimum value of IFG is 96 bittime, which is the time required to send 96-bit original data in the medium. The minimum value of IFG is different in different media. Regardless of 10M/100M/1000M Ethernet, the minimum value between two frames It must have 96bit, IFGmin=96bit/s

4. How to use IFG

IFG solves speed matching problem in Ethernet's flow control mechanism

  1. Device 1 uses its own working clock (OSC1) to send the data to be sent to device 2;
  2. Packet coming into device 2:

①After processing by the clock data restorer CDR, the clock is extracted from the data, and the extracted clock CLK2 is given, and the data packet is stored in the receiving buffer. At this time, CLK2 and OSC1 are synchronized;

②The data is processed from the receiving buffer and stored in the sending buffer after being processed by the upper layer protocol.

  1. The send buffer uses the working clock OSC2 of device 2 to send data. Since Ethernet works asynchronously, OSC1 and OSC2, as local clocks of different devices, cannot be completely on the same frequency (the working clock of the Ethernet device is allowed to have a difference of plus or minus 50ppm frequency difference), the above figure assumes that OSC1 is greater than OSC2, then the receiving speed of device 2 will be greater than the sending speed. If the receiving buffer is full, packet loss will occur.

How to solve the above problem? On the sending side of device 2, the IFG frame spacing is reduced to speed up the sending of valid data packets, so that the sending speed can keep up with the receiving speed.

5. Summary of actual use of IFG

  • As the IFG increases, the effective speed of the device decreases, which can solve the problem of packet loss due to excessive speed.
  • The IFG decreases (but must be greater than 96bittime), and the effective speed of the device increases, which can solve the problem of test timeout caused by too slow speed.

Guess you like

Origin blog.csdn.net/han_better/article/details/129831333