You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/01/16 12:27:13 UTC

[GitHub] [incubator-nuttx] WaterBirdWayOrigin opened a new pull request #110: Set CONFIG_NET_ETH_PKTSIZE to 1514 for spresense

WaterBirdWayOrigin opened a new pull request #110: Set CONFIG_NET_ETH_PKTSIZE to 1514 for spresense
URL: https://github.com/apache/incubator-nuttx/pull/110
 
 
   Set CONFIG_NET_ETH_PKTSIZE to 1514 when performing
    $ tools/configure.sh spresense/rndis
   configuration
   
   CONFIG_NET_ETH_PKTSIZE defines the size of ethernet packet.
   Ethernet packet size is 1514 including the ethernet header.
   
   This commit can send 1514 bytes packet as follow:
     e.g) For OpenWrt Router
     nsh> ping -c 1 -s 1472 192.168.1.1
     PING 192.168.1.1 1472 bytes of data
     1472 bytes from 192.168.1.1: icmp_seq=0 time=0 ms
     1 packets transmitted, 1 received, 0% packet loss, time 1010 ms
     nsh>
   
   https://tools.ietf.org/html/rfc894
   said at Frame Format
   ```
      The minimum length of the data field of a packet sent over an
      Ethernet is 1500 octets, thus the maximum length of an IP datagram
      sent over an Ethernet is 1500 octets.  Implementations are encouraged
      to support full-length packets.
   ``
   
   Just for your information,
   include/nuttx/net/ethernet.h:78:#define ETH_HDRLEN       14     /* Header size: 2*6 + 2 */
   
   Signed-off-by: Koichi Okamoto <Ko...@sony.com>

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-nuttx] WaterBirdWayOrigin commented on issue #110: Set CONFIG_NET_ETH_PKTSIZE to 1514 for spresense

Posted by GitBox <gi...@apache.org>.
WaterBirdWayOrigin commented on issue #110: Set CONFIG_NET_ETH_PKTSIZE to 1514 for spresense
URL: https://github.com/apache/incubator-nuttx/pull/110#issuecomment-575136686
 
 
   > 
   > 
   > @WaterBirdWayOrigin
   > 
   > https://en.wikipedia.org/wiki/Ethernet_frame#Ethernet_II
   > 
   > The original Ethernet IEEE 802.3 standard defined the minimum Ethernet frame size as 64 bytes and the maximum as 1518 bytes (1500+header/trailer). The maximum was later increased to 1522 bytes to allow for VLAN tagging.
   
   I am not sure but I think the last CRC (4Byte) isn't consider by software tcp/ip stack side.
   
   The cause of 1500 byte maximum issue comes from original comment of uIP source code.
   https://github.com/adamdunkels/uip/blob/master/uip/uipopt.h#L369
   
   uIP original defines as follows:
   https://github.com/adamdunkels/uip/blob/master/uip/uipopt.h#L299
   And TCP maximum segment size
   #define UIP_TCP_MSS (UIP_BUFSIZE-UIP_LLH_LEN-UIP_TCPIP_HLEN)
   
   It seems to me that from the definition, UIP_BUFSIZE is considered to be a packet buffer including the header of Link Layer (14 bytes for Ethernet (excluding 4 bytes for FCS(CRC))) in the first place, so that the original comment misread.
   
   https://tools.ietf.org/html/rfc894 said
   ```
      The minimum length of the data field of a packet sent over an
      Ethernet is 46 octets. If necessary, the data field should be padded
      (with octets of zero) to meet the Ethernet minimum frame size. This
      padding is not part of the IP packet and is not included in the total
      length field of the IP header.
   
      The minimum length of the data field of a packet sent over an
      Ethernet is 1500 octets, thus the maximum length of an IP datagram
      sent over an Ethernet is 1500 octets. Implementations are encouraged
      to support full-length packets. Gateway implementations MUST be
      prepared to accept full-length packets and fragment them if
      necessary. If a system cannot receive full-length packets, it should
      take steps to discourage others from sending them, such as using the
      TCP Maximum Segment Size option [4].
   ```
   
   The above two paragraph said the data area of ethernet is from 46 byte to 1500 byte.
   As the header size of ethernet is 14 byte, from 60 byte to 1514 byte is ethernet packet size.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-nuttx] WaterBirdWayOrigin commented on issue #110: Set CONFIG_NET_ETH_PKTSIZE to 1514 for spresense

Posted by GitBox <gi...@apache.org>.
WaterBirdWayOrigin commented on issue #110: Set CONFIG_NET_ETH_PKTSIZE to 1514 for spresense
URL: https://github.com/apache/incubator-nuttx/pull/110#issuecomment-575138391
 
 
   uIP is also used contiki os:
   https://github.com/contiki-os/contiki/blob/master/core/net/ip/uipopt.h#L163
   /**
    * The size of the uIP packet buffer.
    *
    * The uIP packet buffer should not be smaller than 60 bytes, and does
    * not need to be larger than 1514 bytes. Lower size results in lower
    * TCP throughput, larger size results in higher TCP throughput.
    *
    * \hideinitializer
    */
   #ifndef UIP_CONF_BUFFER_SIZE
   #define UIP_BUFSIZE (UIP_LINK_MTU + UIP_LLH_LEN)
   #else /* UIP_CONF_BUFFER_SIZE */
   #define UIP_BUFSIZE (UIP_CONF_BUFFER_SIZE)
   #endif /* UIP_CONF_BUFFER_SIZE */
   
   This side is fixed to 1514, not 1500. 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-nuttx] patacongo commented on issue #110: Set CONFIG_NET_ETH_PKTSIZE to 1514 for spresense

Posted by GitBox <gi...@apache.org>.
patacongo commented on issue #110: Set CONFIG_NET_ETH_PKTSIZE to 1514 for spresense
URL: https://github.com/apache/incubator-nuttx/pull/110#issuecomment-575164538
 
 
   " am not sure but I think the last CRC (4Byte) isn't consider by software tcp/ip stack side."  That is my experience too.  The FCS is generated and consumed by hardware.
   
   I've also worked with Ethernet hardware that adds additional information at the end of the packet.
   
   There is a special configuration setting to allow additional space at the end of the packet for this hardware specific stuff.  It is CONFIG_NET_GUARDSIZE.  The total packet allocation size is the max payload (1500) plus the Ethernet header size (14) plus CONFIG_NET_GUARDSIZE.
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-nuttx] jerpelea commented on issue #110: Set CONFIG_NET_ETH_PKTSIZE to 1514 for spresense

Posted by GitBox <gi...@apache.org>.
jerpelea commented on issue #110: Set CONFIG_NET_ETH_PKTSIZE to 1514 for spresense
URL: https://github.com/apache/incubator-nuttx/pull/110#issuecomment-575509926
 
 
   @patacongo thanks for clarification

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-nuttx] WaterBirdWayOrigin commented on issue #110: Set CONFIG_NET_ETH_PKTSIZE to 1514 for spresense

Posted by GitBox <gi...@apache.org>.
WaterBirdWayOrigin commented on issue #110: Set CONFIG_NET_ETH_PKTSIZE to 1514 for spresense
URL: https://github.com/apache/incubator-nuttx/pull/110#issuecomment-575129944
 
 
   https://github.com/apache/incubator-nuttx/pull/109#issuecomment-575113032

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-nuttx] WaterBirdWayOrigin commented on issue #110: Set CONFIG_NET_ETH_PKTSIZE to 1514 for spresense

Posted by GitBox <gi...@apache.org>.
WaterBirdWayOrigin commented on issue #110: Set CONFIG_NET_ETH_PKTSIZE to 1514 for spresense
URL: https://github.com/apache/incubator-nuttx/pull/110#issuecomment-575454618
 
 
   @patacongo 
   Thank you for your confirmation !
   
   > Don't use uIP documentation.
   > Too much talking for such a simple change.
   
   I see.  Thank your for your advice.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-nuttx] Ouss4 merged pull request #110: Set CONFIG_NET_ETH_PKTSIZE to 1514 for spresense

Posted by GitBox <gi...@apache.org>.
Ouss4 merged pull request #110: Set CONFIG_NET_ETH_PKTSIZE to 1514 for spresense
URL: https://github.com/apache/incubator-nuttx/pull/110
 
 
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-nuttx] patacongo commented on issue #110: Set CONFIG_NET_ETH_PKTSIZE to 1514 for spresense

Posted by GitBox <gi...@apache.org>.
patacongo commented on issue #110: Set CONFIG_NET_ETH_PKTSIZE to 1514 for spresense
URL: https://github.com/apache/incubator-nuttx/pull/110#issuecomment-575320075
 
 
   The confusion here is between packet size, MTU, and additional FCS bytes.
   
   The MTU does not include either the Ethernet header or the FCS bytes.  CONFIG_NET_ETH_PKTSIZE is not the MTU and does include the Ethernet header (the FCS is provided by the GUARD size, if needed).
   
   So for an MTU of 1500, the correct value of CONFIG_NET_ETH_PKTSIZE is 1514.  So your change is correct.
   
   Too much talking for such a simple change.
   
   
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-nuttx] patacongo commented on issue #110: Set CONFIG_NET_ETH_PKTSIZE to 1514 for spresense

Posted by GitBox <gi...@apache.org>.
patacongo commented on issue #110: Set CONFIG_NET_ETH_PKTSIZE to 1514 for spresense
URL: https://github.com/apache/incubator-nuttx/pull/110#issuecomment-575318186
 
 
   Don't use uIP documentation.  The NuttX network does include a few things from uIP, but it is an original network and nothing you know about uIP applies here.
   
   Especially anything related to buffering.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services