WINC1500: send() more than 1 MTU (1400 bytes)

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

For the WINC1500, SOCKET_BUFFER_MAX_LENGTH defines the Maximum Transmission Unit (MTU) to be 1400 bytes. 

 

Assuming I've got an open socket in the WINC and I need to send more than one MTU, which is the right approach:

 

1. Issue multiple send() commands (with slices of 1400 bytes or less) without waiting for SOCKET_MSG_SEND callbacks.

2. Send one slice, wait for the SOCKET_MSG_SEND callback before sending the next slice.

3. Something else.

 

?

 

Thanks in advance.

 

 

Last Edited: Mon. Jan 25, 2021 - 06:19 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Update:

 

I've tried approach #1 (call send() repeatedly for each slice without waiting), and all the calls to send() elicit M2M_SUCCESS responses. 

 

But in the SOCKET_MSG_SEND callback, the first callback reports success (1400 bytes), but the second callback reports -12, which I believe is M2M_ERR_FAIL (which is not very helpful).

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Approach #2 is the way to go - you can only have one send() in flight at a time, so wait for the callback before the next call to send().

 

As I understand it, SOCKET_BUFFER_MAX_LENGTH does not indicate the network interface's MTU. That will be handled somewhere in the WINC1500 firmware's TCP/IP stack. I would expect the firmware to concatenate data from multiple send() calls into MTU-sized packets where possible.

 

In fact I just tested here by capturing the TCP handshake between my Mac and a WINC1500 device (firmware 19.4.4). The WINC1500 sets MSS=1446 in its SYN/ACK reply to my Mac's SYN. This could imply that the WINC1500 network interface uses an MTU of 1486 bytes.

 

Steve

Maverick Embedded Technologies Ltd. Home of Maven and wAVR.

Maven: WiFi ARM Cortex-M Debugger/Programmer

wAVR: WiFi AVR ISP/PDI/uPDI Programmer

https://www.maverick-embedded.co...