<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Unexpected and unhandled MTU exchange request from peripheral followed by unexpected packet fragmentation</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/65463/unexpected-and-unhandled-mtu-exchange-request-from-peripheral-followed-by-unexpected-packet-fragmentation</link><description>I&amp;#39;ve attached a Wireshark capture of an issue I am attempting to troubleshoot. I am confused as to why the peripheral is sending an Exchange MTU Request (No. 157) to the central. Afterwards, even though it appears the MTU is successfully negotiated to</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 16 Feb 2021 08:53:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/65463/unexpected-and-unhandled-mtu-exchange-request-from-peripheral-followed-by-unexpected-packet-fragmentation" /><item><title>RE: Unexpected and unhandled MTU exchange request from peripheral followed by unexpected packet fragmentation</title><link>https://devzone.nordicsemi.com/thread/294554?ContentTypeID=1</link><pubDate>Tue, 16 Feb 2021 08:53:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c8e299ef-1c30-4b51-862e-681eb69dd69c</guid><dc:creator>dmerillat</dc:creator><description>&lt;p&gt;I&amp;#39;ve spent some time looking into exactly this.&lt;/p&gt;
[quote userid="7761" url="~/f/nordic-q-a/65463/unexpected-and-unhandled-mtu-exchange-request-from-peripheral-followed-by-unexpected-packet-fragmentation/267509#267509"]Why are you confused about that? I however wonder why your Linux computer says &amp;quot;Request Not Supported&amp;quot;, since it immediately after initiates its own ATT Exchange, which succeeds.[/quote]
&lt;p&gt;The problem I&amp;#39;m seeing is that very few BLE libraries expect the &lt;em&gt;peripheral&lt;/em&gt; to be sending an exchange&lt;em&gt; &lt;/em&gt;MTU &lt;em&gt;Request&lt;/em&gt;. Of course it&amp;#39;s unsupported, they expect to send the request themselves and handle the response. The handlers are registered for Response, not Request.&lt;/p&gt;
&lt;p&gt;The real fault here is this:&lt;/p&gt;
[quote userid="7761" url="~/f/nordic-q-a/65463/unexpected-and-unhandled-mtu-exchange-request-from-peripheral-followed-by-unexpected-packet-fragmentation/267681#267681"]&lt;em&gt;If the Error Response is sent by the server with the error code set to Request&lt;/em&gt;&lt;br /&gt;&lt;em&gt;Not Supported, the Attribute Opcode is not supported and the default MTU&lt;/em&gt;&lt;br /&gt;&lt;em&gt;shall be used.&lt;/em&gt;[/quote]
&lt;p&gt;When the softdevice (acting as server) receives Request Not Supported it appears to lock the MTU for that connection, even if the client sends an Exchange MTU Request of its own and gets a responsse that a larger MTU has been negotiated. Softdevice callback to the firmware stack reports that the data size is now 242, but when sending a notification only the first 20 bytes are actually transmitted.&lt;/p&gt;
&lt;p&gt;At the very least you should reject the larger size, responding with 23. It would be preferable to simply accept the more standard client-initiated exchange and raise the MTU despite the client rejecting the first unexpected server-initated exchange.&lt;/p&gt;
&lt;p&gt;I believe that would be valid according to the BLE spec, since it specifically says &amp;quot;If the Error Response is sent by the &lt;strong&gt;SERVER&lt;/strong&gt;&amp;quot;. I don&amp;#39;t believe the server is required to ignore the client-initiated exchange, even if the client responded originally with Request Not Supported.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>