Skip to content

Commit

Permalink
Dataplane internals
Browse files Browse the repository at this point in the history
Drawing up designs for the internals of the dataplane
  • Loading branch information
daniel-noland committed Dec 6, 2024
1 parent f0398b2 commit c0080e1
Show file tree
Hide file tree
Showing 3 changed files with 300 additions and 978 deletions.
2 changes: 1 addition & 1 deletion design-docs/src/mdbook/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
- [Dataplane project: executive summary](./dataplane/executive-summary.md)
- [Reflections from last time](./dataplane/reflections-from-last-time.md)
- [Hardware selection for dataplane project](./dataplane/hardware.md)
- [Offloading the dataplane](./dataplane/offloading-plan.md)
- [DPDK abstraction map](./dataplane/map-of-dpdk.md)
- [Build process](./build/index.md)
- [Prerequisites](./build/prerequisites.md)
Expand All @@ -12,6 +11,7 @@
- [Build dataplane](./build/just-cargo-build.md)
- [Sterile builds](./build/sterile-build.md)
- [Design session](./dataplane/design-session.md)
- [Offloading the dataplane](./dataplane/offloading-plan.md)
- [Development Plan](./dataplane/development-plan.md)
- [Configuration Persistence Investigation](./dataplane/tasks/configuration-persistence-investigation.md)
- [Configuration database schema](./dataplane/tasks/config-db-schema.md)
Expand Down
232 changes: 232 additions & 0 deletions design-docs/src/mdbook/src/dataplane/design-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -394,4 +394,236 @@ The control plane is, for the moment, just [bgpd] and [bfdd].

</section>

## Zoom in on dataplane

<figure title="Centralized strategy">

<div class="multi-column">

```plantuml
@startuml
rectangle state_manager as "state manager"
cloud flow_lib as "flow lib"
collections workers
collections rx_queue
collections tx_queue
rectangle nic
rectangle flow_queue as "flow queue"
workers <-- rx_queue : poll
workers --> tx_queue : push
state_manager <--> workers : state\nupdate
state_manager -> flow_lib : calls
flow_lib <---> flow_queue : edit/query\nflows
flow_queue <--> nic : push/pull
tx_queue -- nic : tx
rx_queue -- nic : rx
@enduml
```

```plantuml
@startuml
!pragma teoz true
box "worker" #lightblue
participant rx_queue
participant worker
participant tx_queue
end box
participant state_manager
database flow_rules
worker -> rx_queue ++ : rte_eth_rx_burst
return packets
worker -> state_manager ++ : updates
state_manager -> flow_rules : push updates
return verdicts
worker -> tx_queue : burst
@enduml
```

</div>

> Biscuits
</figure>

<figure title="Centralized with local cache">

<div class="multi-column">

<div>

#### Component diagram {#component-diagram-centralized-with-local}

```plantuml
@startuml
rectangle state_manager as "state manager"
cloud flow_lib as "flow lib"
collections workers
collections rx_queue
collections tx_queue
rectangle nic
rectangle flow_queue as "flow queue"
workers <-- rx_queue : poll
workers --> tx_queue : push
state_manager <--> workers : state\nupdate
state_manager -> flow_lib : calls
flow_lib <---> flow_queue : edit/query\nflows
flow_queue <--> nic : push/pull
tx_queue -- nic : tx
rx_queue -- nic : rx
@enduml
```
</div>
<div>

#### Sequence diagram {#sequence-diagram-centralized-with-local}

```plantuml
@startuml
!pragma teoz true
box "worker" #lightblue
participant rx_queue
participant worker
database local_state as "local state"
participant tx_queue
end box
participant state_manager
database flow_rules
worker -> rx_queue ++ : rte_eth_rx_burst
return packets
worker -> local_state ++ : table\nlookups
return verdicts
worker -> state_manager ++ : updates
state_manager -> flow_rules : push updates
return verdicts
worker -> tx_queue : burst
@enduml
```
</div>
</div>

> Biscuits
</figure>

<figure title="science">

<div class="multi-column">

```plantuml
@startuml
rectangle state_manager as "state manager"
cloud flow_lib as "flow lib"
collections workers
collections rx_queue
collections tx_queue
rectangle nic
collections flow_queue as "flow queue"
workers <-- rx_queue : poll
workers --> tx_queue : push
state_manager <--> workers : state\nupdate
workers <-> flow_lib : calls
flow_lib <--> flow_queue : edit/query\nflows
flow_queue <--> nic : push/pull
tx_queue --> nic : tx
rx_queue <-- nic : rx
@enduml
```


```plantuml
@startuml
!pragma teoz true
box "worker" #lightblue
participant rx_queue
participant worker
database local_state as "local state"
participant tx_queue
end box
participant state_manager
database flow_rules
worker -> rx_queue ++ : rte_eth_rx_burst
return packets
worker -> local_state ++ : table\nlookups
return verdicts
worker -> flow_rules : push updates
worker -> tx_queue : burst
worker -> state_manager : updates
@enduml
```

</div>

> Double biscuit
</figure>

```plantuml
@startuml
!pragma use toez
skinparam linetype ortho
skinparam hyperlinkUnderline false
hide empty description
hide empty members
hide circle
entity vpc
entity worker
entity peering
entity interface
entity chunk
entity subnet
interface ||-o{ subnet
subnet ||-|{ chunk
peering ||--o{ interface
vpc ||-o{ interface
vpc }o--|| worker
chunk }o--|| worker
@enduml
```

```plantuml
@startuml
!pragma teoz true
box "worker" #lightblue
participant rx_queue
participant worker
database local_state as "local state"
participant tx_queue
end box
database flow_rules
participant state_manager
worker -> rx_queue : rte_eth_rx_burst
return packets
worker -> local_state : table\nlookups
return verdict
worker -> flow_rules : push updates
worker -> tx_queue : rte_eth_tx_burst
worker -> local_state : chunk capacity ok?
alt chunk ok
local_state -> worker : chunk capacity ok?
else chunk low
local_state -> worker : get more chunk
worker -> state_manager : more chunk plz
return ok
worker -> local_state : refill chunk
end alt
@enduml
```


{{#include ../links.md}}
Loading

0 comments on commit c0080e1

Please sign in to comment.