Skip to content
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 DuplicateDevice #33

Open
Centaurus99 opened this issue Mar 27, 2024 · 10 comments
Open

Add DuplicateDevice #33

Centaurus99 opened this issue Mar 27, 2024 · 10 comments
Labels
enhancement New feature or request

Comments

@Centaurus99
Copy link
Member

No description provided.

@Centaurus99 Centaurus99 added the enhancement New feature or request label Mar 27, 2024
@un-lock-able
Copy link
Contributor

When the device has decided that a packet should be duplicated, where should the duplicated packet go? Should it be at the head of the queue or at the tail of the queue, or a random position within?

@Centaurus99
Copy link
Member Author

When the device has decided that a packet should be duplicated, where should the duplicated packet go? Should it be at the head of the queue or at the tail of the queue, or a random position within?

@un-lock-able We can implement this DuplicateDevice in the simplest method. We can refer to LossDevice and check if it is a duplicate when dequeuing. If it is, we copy the packet and send it out, while leaving the original packet in place.

For more complex duplicate modes, such as a combination of duplicate and reordering, we can implement a new device in the future to handle it.

@un-lock-able
Copy link
Contributor

I'm now writing the DuplicateDeviceEgress and I have found that unlike DelayDevice and LossDevice, there is no DuplicatePattern, DuplicateTrace and DuplicateTraceConfig defined in the netem_trace crate. Should I create them in netem_trace or define them somewhere in this project?

@BobAnkh
Copy link
Member

BobAnkh commented Jun 24, 2024

I'm now writing the DuplicateDeviceEgress and I have found that unlike DelayDevice and LossDevice, there is no DuplicatePattern, DuplicateTrace and DuplicateTraceConfig defined in the netem_trace crate. Should I create them in netem_trace or define them somewhere in this project?

As for this question, we should define all trace-relavant things in netem-trace crate.

@minhuw
Copy link
Member

minhuw commented Jun 24, 2024

What a pity there is no such thing as a formal specification of network emulation trace. Maybe we could write one to make things like alignment between loss / throughput / delay more predictable.

@BobAnkh
Copy link
Member

BobAnkh commented Jun 24, 2024

What a pity there is no such thing as a formal specification of network emulation trace. Maybe we could write one to make things like alignment between loss / throughput / delay more predictable.

I think it may be enough for alignment if the calibrated start time is implemented.

@BobAnkh
Copy link
Member

BobAnkh commented Jun 30, 2024

@un-lock-able I have published a new version (v0.3.4) of the crate netem-trace containing the packet duplicate trace so that you can continue on this issue now.

@un-lock-able
Copy link
Contributor

To duplicate a packet, should I add a trait bound of Clone on the trait Packet or should I manually copy the content the packet in the DuplicateDeviceEgress?

@BobAnkh
Copy link
Member

BobAnkh commented Jul 1, 2024

To duplicate a packet, should I add a trait bound of Clone on the trait Packet or should I manually copy the content the packet in the DuplicateDeviceEgress?

I think we can just make Packet Cloneable? cc @minhuw

@minhuw
Copy link
Member

minhuw commented Jul 2, 2024

Yes, we could make Packet Cloneable. Each packet type needs to has its own Clone implementation because different drivers may have different memory management schema. For example, StdPacket could use the standard allocator, but XDPPacket are all allocated from pre-registered chunks. I'll implement Clone for XDPPacket later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants