wangchen61698 opened a new pull request, #9254:
URL: https://github.com/apache/nuttx/pull/9254

   ## Summary
   RFC 1191
   When a router is unable to forward a datagram because it exceeds the
      MTU of the next-hop network and its Don't Fragment bit is set, the
      router is required to return an ICMP Destination Unreachable message
      to the source of the datagram, with the Code indicating
      "fragmentation needed and DF set".  To support the Path MTU Discovery
      technique specified in this memo, the router MUST include the MTU of
      that next-hop network in the low-order 16 bits of the ICMP header
      field that is labelled "unused" in the ICMP specification [7].  The
      high-order 16 bits remain unused, and MUST be set to zero.  Thus, the
      message has the following format:
   
          0                   1                   2                   3
          0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
         |   Type = 3    |   Code = 4    |           Checksum            |
         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
         |           unused = 0          |         Next-Hop MTU          |
         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
         |      Internet Header + 64 bits of Original Datagram Data      |
         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   RFC 1185
   Packet Too Big Message
   
          0                   1                   2                   3
          0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
         |     Type      |     Code      |          Checksum             |
         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
         |                             MTU                               |
         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
         |                    As much of invoking packet                 |
         +               as will fit without the ICMPv6 packet           +
         |                       exceeding 576 octets                    |
   
      IPv6 Fields:
   
      Destination Address
   
                     Copied from the Source Address field of the invoking
                     packet.
   
      ICMPv6 Fields:
   
      Type           2
   
      Code           0
   
      MTU            The Maximum Transmission Unit of the next-hop link.
   
      Description
   
      A Packet Too Big MUST be sent by a router in response to a packet
      that it cannot forward because the packet is larger than the MTU of
      the outgoing link.  The information in this message is used as part
      of the Path MTU Discovery process [RFC-1191].
   ## Impact
   N/A
   ## Testing
   IPv4
   
   Test networking
   
![image](https://github.com/apache/nuttx/assets/129070278/fe194d0e-086b-4349-9c0f-c69e0ea1ae89)
   
   Test step:
   1.Set the mtu of tap0 and sim0 to 1300;
   2.Ping a packet with a payload length of 1400 from sim1 to sim0
   
   Test result
   Except for the failure of sending the first packet, other packets are sent 
successfully
   
   
![image](https://github.com/apache/nuttx/assets/129070278/6ee4e81c-d996-4d76-a0e6-ba3b6dd6ed0d)
   
   
![image](https://github.com/apache/nuttx/assets/129070278/892a87f7-32b0-4bdf-acbb-53c6afa62e62)
   
   IPv6
   
   Test networking
   
![image](https://github.com/apache/nuttx/assets/129070278/27a9671d-aaae-4395-bf2c-636d721713be)
   
   Test step:
   1.Set the mtu of tap0 and sim0 to 1300;
   2.Ping a packet with a payload length of 1400 from sim1 to sim0
   
   Test result:
   Except for the failure of sending the first packet, other packets are sent 
successfully
   
   
![image](https://github.com/apache/nuttx/assets/129070278/c1b2a717-acb8-4c76-84ab-f65cc933fe0a)
   
   
![image](https://github.com/apache/nuttx/assets/129070278/43848a82-c4b0-42c8-aa50-3378559f26e9)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to