Coder Social home page Coder Social logo

COP-1 Frame Acking Question about ccsds HOT 4 CLOSED

dariol83 avatar dariol83 commented on June 7, 2024
COP-1 Frame Acking Question

from ccsds.

Comments (4)

dariol83 avatar dariol83 commented on June 7, 2024 1

Mmm ... you are using a reversed approach, which might actually work... in fact, if you get for instance a CLCW value equal to e.g. 8, and FopSlWnd=2 it means that frames 7 and 6 are acked. Well, try to change the code and re-run the unit tests. If that works, feel free to propose a pull request for me to integrate, so that you will be given the proper credits :)

from ccsds.

dariol83 avatar dariol83 commented on June 7, 2024

Hi Lucas,

Thanks a lot for your feedback and for the question.

In short, the acknowledgement that you receive from the CLCW via its report value is not related to 'a single frame', but to 'all frames before the reported one'. In other words, the CLCW report value is telling the FOP engine which is the next frame counter value that the FARM is expecting, meaning that the FARM received all frames before that one.

In order to delete a succesfully transferred frame (i.e. 5 in your example), the report value must contain the value 6. Therefore the expander set is initialised the fopSlidingWindow values, i.e. all the possible report values that will mark the frame as 'acknowledged'. So 6 and 7, in your example.

Remember: the FARM is not expected to acknowledge each and every single frame with a corresponding report value. I might have a FOP sliding window of 20, I can send then TC frames from 0 to 19 (assuming that the CLCW is reporting me a report value = 0 when I start sending) in, let's say, 2 seconds (depending on the transmission bitrate) and, depending on the TM frame generation rate on-board (assume 1 frame per second), I could get back CLCWs with report values like: 3, 7, 13, 18, 20 in the following 5 seconds. With the first report value I see (3), the FOP knows that the FARM processed correctly the first 3 TC frames (0, 1, 2). With the second value (7), the FOP knows that up to TC frame 6 was correctly received, and so on.

I hope it is clearer how it works now, and therefore why there is + 1 there :)

Cheers,
Dario

from ccsds.

lucas-bremond avatar lucas-bremond commented on June 7, 2024

Ahah!

the CLCW report value is telling the FOP engine which is the next frame counter value that the FARM is expecting

That was the part I was missing. I was assuming the CLCW to contain the frame counter of the last received frame. I should have read the spec better.

Thank you so much for the clear explanation, and cheers as well!

from ccsds.

lucas-bremond avatar lucas-bremond commented on June 7, 2024

And while we're at it: I was wondering if the expander couldn't be computed only once (and out of loop), like:

while(acked && !this.sentQueue.isEmpty()) {
    ...
    int currentNNR = next.getFrame().getVirtualChannelFrameCount();
    Set<Integer> expander = new HashSet<>();
    for(int i = 0; i < fopSlidingWindow; ++i) {
        expander.add((currentNNR + 1 + i) % 256);
    }
    // If the set contains the clcw report, all fine
    if(expander.contains((int) clcw.getReportValue())) {
        ...
    }
    ...
}

could maybe become something along the lines of:

// Out of while loop
int NR = (int) clcw.getReportValue();
Set<Integer> expander = new HashSet<>();
for(int i = 0; i < fopSlidingWindow; ++i) {
    expander.add((NR - 1 - i + 256) % 256);
}

while(acked && !this.sentQueue.isEmpty()) {
    ...

    int currentNNR = next.getFrame().getVirtualChannelFrameCount();
    
    if(expander.contains(currentNNR)) {
        ...
    }
    ...
}

?

from ccsds.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.