Skip to content
This repository has been archived by the owner on Sep 19, 2019. It is now read-only.

Implement flags to allow routing messages over specific peers #30

Open
chris-- opened this issue May 13, 2014 · 2 comments
Open

Implement flags to allow routing messages over specific peers #30

chris-- opened this issue May 13, 2014 · 2 comments
Assignees
Milestone

Comments

@chris--
Copy link
Member

chris-- commented May 13, 2014

Extend the message format to include a via and reply-via flag to make sure a message passes a specific peer on its way back to the sender.

{
    to: '123abc',
    from: 'cba321',
    type: 'some-proto',
    payload: (...),
    reply-via: 'def123'
}

If peer 123abc receives a message with reply-via set, it answers with a message where the via-field is set to the value of reply-via like so:

{
    to: '123abc',
    from: 'cba321',
    type: 'some-proto',
    payload: (...),
    via: 'def123'
}
@chris--
Copy link
Member Author

chris-- commented May 13, 2014

As an alternative, we can include a reference to the original peer in the payload. The decision where to route the message to must then be taken by the registered protocol.

{
    to: '123abc',
    from: 'def123',
    type: 'some-proto',
    payload: {
        origin: 'cba321',
        (...)
    }
}

An answer to this message could look like this:

{
    to: 'def123',
    from: '123abc',
    type: 'some-proto',
    payload: {
        receiver: 'cba321',
        (...)
    }
}

When 123abc receives the message, the application protocol decides to relay the payload to the origin cba321.

@makkes makkes self-assigned this May 15, 2014
@makkes makkes added this to the BOPlish 2.0 milestone May 19, 2014
@makkes
Copy link

makkes commented May 19, 2014

Since the 'via' field is only useful in the routing protocol itself we better implement it as part of the payload of the routing protocol. Otherwise we would have to hold state in the router for every incoming message that has a 'via' field set (to set it correctly in the answer).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants