Rohde-Schwarz / dlepard

Router Implementation of Dynamic Link Exchange Protocol (DLEP)
MIT License
6 stars 3 forks source link

Session Initialization Response Incorrect Parsing #6

Open soxrok2212 opened 3 years ago

soxrok2212 commented 3 years ago

Hey again, I'm doing some more testing and it looks like the session initialization response is not being parsed correctly. It seems that the Destination Up message is parsed as a MAC address data item in the response message.

I attached a screenshot to show what I mean.

Screen Shot 2020-11-19 at 5 16 02 PM

The following messages also appear to be exchanged as raw TCP packets and not DLEP. Am I missing something here? Thank you!

soxrok2212 commented 3 years ago

Setting line 528 in dlepsession.py to item = None temporarily resolves the issue.

lawa23 commented 3 years ago

This problem occurs when more than a single DLEP message arrives in the TCP buffer, correct?

I found out this week that the current DLEPard implementation does not support reassembling DLEP packets. Which is a serious bug in my opinion. I will fix this soon.

An additional hint if you need a quick workaround:
I will implement an additional buffer either in DLEPSession.on_tcp_receive() or in TCPProxy.connection_made().

soxrok2212 commented 3 years ago

This problem occurs when more than a single DLEP message arrives in the TCP buffer, correct?

That would make sense as there is nothing else between Session Initialization Response and Destination Up.

I found out this week that the current DLEPard implementation does not support reassembling DLEP packets. Which is a serious bug in my opinion. I will fix this soon.

Great, thank you!

An additional hint if you need a quick workaround: I will implement an additional buffer either in DLEPSession.on_tcp_receive() or in TCPProxy.connection_made().

Ironically the issue stopped presenting itself in my testing yesterday, but I be if I try again it'll show up eventually. For now, I don't think the MAC address is used anywhere as a data item so leaving it commented out is enough of a bandaid for the time being.