Skip to content
This repository has been archived by the owner on Apr 14, 2024. It is now read-only.

Disabling one of multiple streams in interleaved mode doesn't work correctly #328

Closed
pstavirs opened this issue Nov 2, 2020 · 1 comment
Assignees
Labels
Milestone

Comments

@pstavirs
Copy link
Owner

pstavirs commented Nov 2, 2020

Isssue received over email -

Hi Srivats

I've been using Ostinato to test that some hardware I've designed handles the VLAN DEI bit correctly and I think I might have found an Ostinato bug.

I've set a transmit port into "Interleaved Streams" mode and created two streams (attached). One stream sends packets with the VLAN DEI bit zero, the other with the DEI bit one. This works as expected, tcpdump shows every second packet with the DEI bit set:

potatoes:/home/fnm # tcpdump -i eth3 -xx -n -s 16 | head
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth3, link-type EN10MB (Ethernet), capture size 16 bytes
11:13:17.712157 [|vlan]
        0x0000:  0002 c957 17cd 0002 c957 5953 8100 00c8
11:13:17.712159 [|vlan]
        0x0000:  0002 c957 17cd 0002 c957 5953 8100 10c8
11:13:17.712230 [|vlan]
        0x0000:  0002 c957 17cd 0002 c957 5953 8100 00c8
11:13:17.712232 [|vlan]
        0x0000:  0002 c957 17cd 0002 c957 5953 8100 10c8
11:13:17.712310 [|vlan]
        0x0000:  0002 c957 17cd 0002 c957 5953 8100 00c8

However, if I use the checkbox to disable a stream things get weird. If I disable the first stream (which has DEI=0) I get:

potatoes:/home/fnm # tcpdump -i eth3 -xx -n -s 16 | head
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth3, link-type EN10MB (Ethernet), capture size 16 bytes
11:15:46.256198 [|vlan]
        0x0000:  0002 c957 17cd 0002 c957 5953 8100 00c8
11:15:46.256274 [|vlan]
        0x0000:  0002 c957 17cd 0002 c957 5953 8100 00c8
11:15:46.256428 [|vlan]
        0x0000:  0002 c957 17cd 0002 c957 5953 8100 00c8
11:15:46.256501 [|vlan]
        0x0000:  0002 c957 17cd 0002 c957 5953 8100 00c8
11:15:46.256575 [|vlan]
        0x0000:  0002 c957 17cd 0002 c957 5953 8100 00c8

I.e. It appears I'm only getting traffic from the stream I disabled. If I disable just the second stream (DEI=1) then I get:

potatoes:/home/fnm # tcpdump -i eth3 -xx -n -s 16 | head
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth3, link-type EN10MB (Ethernet), capture size 16 bytes
11:17:08.544201 [|vlan]
        0x0000:  0002 c957 17cd 0002 c957 5953 8100 00c8
11:17:08.544285 [|vlan]
        0x0000:  0002 c957 17cd 0002 c957 5953 8100 00c8
11:17:08.544431 [|vlan]
        0x0000:  0002 c957 17cd 0002 c957 5953 8100 00c8
11:17:08.544504 [|vlan]
        0x0000:  0002 c957 17cd 0002 c957 5953 8100 00c8
11:17:08.544578 [|vlan]
        0x0000:  0002 c957 17cd 0002 c957 5953 8100 00c8

I.e. exactly the same.

So it appears that disabling any stream always causes the second stream to be disabled.

Let me know if you'd like any more information.

Best regards,

[Name REDACTED]

P.s. Ostinato is great for this sort of testing with its ability to modify particular fields, interleave streams and generate (pseudo) random packet sizes.

dei_streams.zip

@pstavirs
Copy link
Owner Author

pstavirs commented Nov 2, 2020

This problem is because when building the packet list in interleaved mode, we iterate over the streams twice.

In the first iteration, we build up various lists for each stream, skipping over the disabled streams. The number of items in each list is equal to the number of enabled streams.

In the second iteration, we build the actual packet for only the active/enabled streams using these lists. We actually build the packet, only if any aspect of the stream is variable. If not variable, we just reuse the packet content saved in the first iteration. When building the packet for a enabled stream with variable content we use the same index to index into the list built in the first iteration and the streamList. However, if there are some disabled streams, the index used should be different for the list and different for the streamList.

Problem will be seen only in interleaved mode when you have more than one streams, the disabled streams are before the enabled streams and the enabled stream(s) have some variable (increment/decrement/random) content.

Workaround

Always have disabled streams at the end of the stream list. The Ostinato cut-copy-paste feature can help to quickly do this.

@pstavirs pstavirs added this to the v1.2 milestone Nov 2, 2020
@pstavirs pstavirs added the bug label Nov 2, 2020
@pstavirs pstavirs self-assigned this Nov 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant