-
Notifications
You must be signed in to change notification settings - Fork 856
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
Add printing for HSR/PRP protocols #1126
base: master
Are you sure you want to change the base?
Conversation
HSR is a redundancy protocol that duplicates traffic and sends it two ways in a ring with an HSR header that includes a sequence number. Other devices in the ring will forward the first occurrence of a packet, and discard the duplicate (based on SMAC + sequence number). This enables zero packet loss when a link goes down. Signed-off-by: Casper Andersson <[email protected]>
Supervision frames are sent out by the nodes to notify about their existence, and in the case of a RedBox it will notify about the upstream devices. Signed-off-by: Casper Andersson <[email protected]>
PRP is a redundancy protocol, like HSR, that duplicates packets and includes a sequence number. However, PRP uses a trailer on the packet, making the parsing a bit tricky. The trailer includes the packet size that can be used to help ascertain it is a valid PRP trailer, however it is still possible that this can appear naturally in a packet somewhere in a network that doesn't use PRP. Signed-off-by: Casper Andersson <[email protected]>
Test setup used: ip link add link veth1 type veth peer name veth2 ip link set dev veth1 up ip link set dev veth2 up ip link add name hsr0 type hsr slave1 veth1 slave2 veth2 version 1 proto 0 ip link set dev hsr0 up And same but with PRP: ip link add name prp0 type hsr slave1 veth1 slave2 veth2 proto 1 Supervision frames are automatically sent out by the kernel on HSR/PRP interfaces. Signed-off-by: Casper Andersson <[email protected]>
fddae2b
to
33b82d5
Compare
I suppose we could have some flag (new or maybe some existing that fits) for the PRP trailer (and potentially other protocols that could mismatch. Not that I can think of any, but maybe there exists more). I also noticed that I can't filter (like |
Does |
Yes that matches all HSR tagged packets. I meant if I want to filter on HSR tagged ARP packets I can't do that. I just realized you can't do |
I am not familiar with these protocols, and I get an impression one has to understand the matter well before implementing more code. Please have patience and do not commit too much into preparing libpcap code changes yet. |
Yes. Take your time. I haven't started any libpcap work. |
To avoid dissecting PRP trailer when we aren't using PRP.
HSR and PRP are redundancy protocols that duplicates frames and then eliminates the duplicates to ensure only one copy arrives at the destination. The protocols are interoperable and can be converted between. They are defined in the standard IEC62439-3.
Though, PRP is a bit odd so I'm not sure it can even be merged. It uses a trailer at the end of the packet to store the information. So parsing the packet means when need to search from the back. The trailer also holds the packet size to help verify that it is an actual PRP packet, but there's no guarantee. It could match on data in a non-PRP packet that just happens to coincide with the protocol specification. I didn't see any good way to handle this, but if you have ideas I could give it a try. If not possible I can remove the commit.
HSR tags work similar to VLAN tags, and are always placed after any VLAN tags.