davidtaylor-juul commented on code in PR #193:
URL: https://github.com/apache/mynewt-newtmgr/pull/193#discussion_r1572844874


##########
nmxact/nmserial/serial_xport.go:
##########
@@ -50,7 +50,7 @@ var errTimeout error = errors.New("Timeout reading from 
serial connection")
 func NewXportCfg() *XportCfg {
        return &XportCfg{
                ReadTimeout: 10 * time.Second,
-               Mtu:         512,
+               Mtu:         128,

Review Comment:
   Dropping a comment here for anyone else who may have found this was a 
breaking change in some cases.
   
   This _does_ change the default value that is fed into `transceiver.go`, 
which does packet fragmentation at the layer above the serial transport (the 
CoAP layer). The value is read in the `MtuOut` method in 
[serial_sesn.go#L187](https://github.com/apache/mynewt-newtmgr/blob/cf9985f71c7fab6a71f345ab55438a7d58dc6a3f/nmxact/nmserial/serial_sesn.go#L187)
   
   We had to set the MTU provided to `transceiver.go` to "unlimited" to prevent 
it from fragmenting the CoAP payload, and instead allow the `serial_xport.go` 
`TxCoap` method to fragment based on the actual MTU.
   
   I'm not sure if there should be a broader fix for that, as it does seem 
redundant to have fragmentation at the CoAP layer, and again in the transport 
layer. At least over serial, fragmentation at the CoAP layer breaks re-assembly 
on the receiver end. Maybe other transports rely on the CoAP layer fragmenting 
and do not do transport layer fragmentation? I don't know, but in our use case 
it is necessary to disable the fragmentation in `transceiver.go:TxCoap` for 
serial connections.



-- 
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