-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DoIP functional addressing responses not associated with preceding request #4547
Comments
Thanks for this issue. Could you please reference a section in the DoIP Standard which describes this behaviour? Besides this, you can also pin the target_address in the DoIPSocket.init function: scapy/scapy/contrib/automotive/doip.py Line 440 in c38a5de
Additionally, you can do the routing activation request yourself and eliminate the automatical setting of the target_address. Could you please proved a pcap file for analysis? |
Hey, thanks for taking a look. I don't think there's anything in the spec that explicitly describes this behavior, it seems more like emergent behavior of the general principles where functionally addressed diagnostic requests are broadcast, and that responses sent always have the source address set according to the sending ECU. Otherwise (e.g. if the ECU responded with the source address set to the functional address the preceding request was addressed to), the recipient wouldn't be able to associate the individual diagnostic message responses with the ECU sending them, when they receive multiple responses for a single broadcast request, right? I'm by no means an expert on this, I've just observed this behavior with the ECUs I'm working with, and it makes sense to me that this is how it works. Maybe I'm missing something? I have attached a pcap file that demonstrates the traffic I see when running the snippets I posted above: doip_functional_request.pcap.zip |
I guess it must not have been clear from my previous comments, but the setup I have here is that my test device is connected to a gateway (which has address 0x3107). The gateway is connected to a number of ECUs on the vehicle network side. ISO 13400-2:2019(E) Section 7.8 reads:
Thus, when sending functionally-addressed requests to the gateway, it will, in turn, broadcast them on the vehicle network, and route back any responses from the connected ECUs. |
Brief description
When sending a request over DoIP using functional addressing, the DoIP source addesses of the ECU responses will be different from the target address of the preceding request, as the ECUs respond from their actual address instead of the functional "broadcast address" used in the request.
DoIP.hashret
effectively filters out these "mismatched" packets, so when usingDoIPSocket.sr(...)
with a functional target address, no responses will ever be returned.Scapy version
2.6.0
Python version
3.11
Operating system
Linux 6.1.21-v8+
Additional environment information
No response
How to reproduce
Actual result
Expected result
This result was obtained by monkey-patching DoIP.hashret to ignore the addresses, based on a config setting, analogous to how scapy handles IP broadcast traffic with the
conf.checkIPaddr
setting (see below)Related resources
Just for reference, this is the monkey-patch I'm using at the moment to enable me to run functional addressing requests (by disabling the setting whenever I need it):
But there is maybe/probably a better way.
The text was updated successfully, but these errors were encountered: