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

YS001: Yggdrasil Core Specification #1

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open

YS001: Yggdrasil Core Specification #1

wants to merge 23 commits into from

Conversation

neilalexander
Copy link
Member

@neilalexander neilalexander commented Oct 27, 2019

This is the initial draft of the YS001 Yggdrasil Core Specification. It is still a work in progress.

Still to do:

  • DHT details
    • Bootstrap
    • Requests
    • Responses
    • Searches
    • Maintenance traffic
    • Chord ring directions
  • Sessions
    • Session setup
    • Session expiry
    • Session ephemeral keys
    • Session closure
  • Protocol messages
    • Which crypto keys are used?
  • Link protocol messages
    • Two layers of encryption
    • Which crypto keys are used?
  • Traffic forwarding
    • Traffic message type
    • Distance metric
    • Distance tiebreak

... and probably a number of other things!

@neilalexander neilalexander added draft Document is still a draft work in progress Document is incomplete - don't merge labels Oct 27, 2019
Copy link

@cathugger cathugger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I skimmed some parts so I don't know how much stuff I've missed. There goes some comments, though.

ys001-yggdrasil-core-specification.md Outdated Show resolved Hide resolved
ys001-yggdrasil-core-specification.md Outdated Show resolved Hide resolved
ys001-yggdrasil-core-specification.md Outdated Show resolved Hide resolved
ys001-yggdrasil-core-specification.md Outdated Show resolved Hide resolved
hops from the root node down to a given node.

The root node sends a switch update message to all directly connected peers,
containing a timestamp and its own signing key. The switch update message

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is timestamp in unix epoch seconds? or maybe milliseconds?
does this mean that nodes need to have synchronized times, or this timestamp is not absolute but relative to node key of node which sends it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Epoch seconds in practice but I that it just needs to be an increasing number so that an update doesn’t get replayed in the future. This section can definitely be made clearer.

from the sender's public encryption key in the protocol message headers matches
the searched target Node ID (after applying a bitmask to account for any
unknown bits of the Node ID). If it does, the search is considered to be
completed and the node **should not** send any additional search requests

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They're cached indefinitely? That doesn't sound too good, there should be limit of how long data is cached.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review is outdated - which lines are you referring to exactly?

ys001-yggdrasil-core-specification.md Outdated Show resolved Hide resolved
ys001-yggdrasil-core-specification.md Outdated Show resolved Hide resolved
ys001-yggdrasil-core-specification.md Outdated Show resolved Hide resolved
3. Continue through the bytes until the initial length value has been reached

### Message types

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When a socket connection is initialized with a link, a meta message is exchanged.

Format of that message is

  1. bytes ['m', 'e', 't', 'a']
  2. varu64 Major version
  3. varu64 Minor version
  4. bytes Encryption key (32 bytes)
  5. bytes Signing key (32 bytes)
  6. bytes Encryption key for this connection (32 bytes)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is deliberately not in the message types at the moment because it's not really a true protocol message — in our current implementation it is specific to TCP/TLS peerings. I am not sure if it is best to add a section specifically about TCP/TLS, or whether that should really be an extension spec.

Copy link

@vuldin vuldin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glad to see a document like this taking shape! I'm someone who isn't very familiar with how Yggdrasil works, but I thought giving some feedback to this doc from outsider or fresh perspective may be helpful.

must be specified and known. Byte arrays **must** only be variable-length if
they are the last field in the message.

#### Coordinates
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this section could briefly mention the purpose of coordinates. I'm not sure how a node's dynamic locator and coordinates are related based on what I've read here.

Comment on lines +32 to +35
The routing scheme is name-independent - that is, that the permanent address of
a given node is not permanently associated with the location of the node on the
network. This allows a certain amount of node mobility without relying on
subnet-based routing.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section brought up two questions for me. I'm not sure if these questions should be answered in this document, but I'll leave them here in case others have an opinion:

  1. Node mobility is considered (which is awesome), but are there any known limitations in a node's ability to move and change their location within the network?
  2. How is the locator assignment related to a node's relative location to other nodes?

Comment on lines +37 to +41
Yggdrasil is a greedy routing algorithm. All nodes on the network have the
capacity to forward traffic on behalf of other nodes so long as doing so brings
the traffic closer to the intended destination, using only local knowledge. In
practice, only nodes that are directly connected to more than one peer will
forward traffic on behalf of other nodes.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section brings up the following questions (feel free to ignore if it isn't relevant):

  1. Is it possible to merge bandwidth from multiple connected peers in order to have increased bandwidth to some other node?
  2. How quickly can nodes discover and begin making use of a node connection? Would yggdrasil be suitable for a drone swarm, or an interconnected car network, for example?

Comment on lines +43 to +45
Knowing the destination locator of the traffic in question, and the locators of
all directly connected peers, a node can work out which egress peering will take
the traffic closer to the intended destination.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If multiple nodes have a closer connection to a destination, then do nodes persist these possible routes to the destination? If so, then how are these routes prioritized, and how long are they persisted?

Comment on lines +642 to +645
Coordinates are an ephemeral identifier which represent the switch's location on
the network graph, relative to the root node. They are not a fixed value and can
change at any time depending on the node's own peers, or changing connectivity
on the path from the node up to the root node.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this definition of coordinates could be moved up to the Coordinates section starting at L177.

responsibility of an implementation to know the format for a defined message
type and to be able to determine the end of a given field based on the
characteristics of that field type. Further details on this are available in the
base type definitions below.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a great design, because it prevents you from defining new packets in a backwards-compatible way.

@uis246
Copy link

uis246 commented Mar 9, 2022

Any news? It would be useful for everyone who wants to implement ygg router.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
draft Document is still a draft work in progress Document is incomplete - don't merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants