Skip to content

BR for Hummingbird #162

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

Open
wants to merge 101 commits into
base: scionlab
Choose a base branch
from
Open
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
2a814e3
BR for Hummingbird, squashed.
julesmba Sep 12, 2023
a57abab
fixed issues introduced in hummingbird rebase:
julesmba Oct 26, 2023
6026eeb
added support for hbird path type SCMP packets
julesmba Oct 26, 2023
bfd8f14
updated bazel build files
julesmba Oct 28, 2023
dd6c2f1
Fix bazel build files.
juagargi Oct 30, 2023
d81ee43
added very basic hbird e2e with no reservations
julesmba Oct 30, 2023
aab07e3
fixed peering flag causing segfaults
julesmba Oct 31, 2023
855f997
moved call of updateHbirdNonConsDirIngressSegID into mac verification…
julesmba Nov 1, 2023
e7af14d
added successfull partial reserved path integration test
julesmba Nov 1, 2023
da0e277
added moving flyover to next hop on crossover and reversing that late…
julesmba Nov 2, 2023
8fcb6cd
Fixed router not considering consdier for reservations. Added swappin…
julesmba Nov 6, 2023
605583b
added small multiple hops processing tests for hbird without reservat…
julesmba Nov 6, 2023
3ab42f8
added unit tests for nonconsdir and peering, fixed issues highlighted…
julesmba Nov 7, 2023
80cfc36
added additional unti tests for peering
julesmba Nov 8, 2023
c9bdbd2
fixed issues in hummingbird decoded FirstHopPerSeg
julesmba Nov 8, 2023
5ddaf8b
added UT, fixed integration test for full flyovers path (but broke it…
julesmba Nov 8, 2023
eba4b01
fixed partial reservations integration test and integration test flags
julesmba Nov 9, 2023
550f2c0
added derivation function deriving hbird sv from master key, minor ch…
julesmba Nov 9, 2023
4b21e2c
changed flyover mac from cmac to aes-cbc mac. Removed unused mac comp…
julesmba Nov 9, 2023
05612cd
added golden data tests for flyover mac computation
julesmba Nov 9, 2023
7390a75
adapted comments
julesmba Nov 9, 2023
bec9b4c
Removed the path.FlyoverLen and Path.LineLen constants which were dup…
julesmba Nov 9, 2023
22613ec
better separation between hummingbird and scion path constants
julesmba Nov 9, 2023
e21a718
added comments explaining origin and modifications to the hummingbird…
julesmba Nov 9, 2023
a235186
renamed NumHops to NumLines for Hummingbird, made use of the FlyoverL…
julesmba Nov 9, 2023
d62a04e
fixed outdated data input order for auth key computation
julesmba Nov 9, 2023
c84c144
fixing issues highlighted by linter
julesmba Nov 9, 2023
a36e0be
making RemoveFlyovers() private in decoded.co, replacing some integer…
julesmba Nov 9, 2023
a96eaa0
fixed isXover() error introduced two commits ago...
julesmba Nov 9, 2023
fdd1900
added additional UT for flyoverhopfield testing non-flyover hops
julesmba Nov 9, 2023
5bf19da
changed bounds check to be more efficient
julesmba Nov 9, 2023
bcd1ea9
fixed tests that were relying on mac computation to provide buffer if…
julesmba Nov 9, 2023
c5e1678
made replaceMac private
julesmba Nov 9, 2023
904daf0
improved client library, split process of putting reservations on a p…
julesmba Nov 11, 2023
eb1b2e6
rewrote data structures used in client library to improve readability…
julesmba Nov 12, 2023
38961c9
added additional methods to client library
julesmba Nov 13, 2023
cc134e6
added additional test cases for case where last hop is not flyover
julesmba Nov 14, 2023
f54cf23
added UT to hummingbird library
julesmba Nov 14, 2023
e4d708c
added bandwidth check
julesmba Nov 16, 2023
3834b5a
fixed most of the issues highlighted by linter
julesmba Nov 17, 2023
9457712
simplified comments of flyoverhopfield
julesmba Nov 17, 2023
f5c9413
added benchmark for standard library full flyover mac; added comment …
julesmba Nov 17, 2023
0e54f00
added UT for SetHopField
julesmba Nov 17, 2023
24c13e5
minor changes to conform to upstream
julesmba Nov 17, 2023
131967d
renamed setSecretValue to SetHbirdKey
julesmba Nov 17, 2023
aac847b
moved reservationExpired error to dataplane_hbird
julesmba Nov 17, 2023
759ce0b
grouping together hbird values in dataplane structs; minor changes
julesmba Nov 17, 2023
621778b
re-adding some comments that were lost earlier
julesmba Nov 17, 2023
b3c2953
added a forgotten assert.NoError
julesmba Nov 17, 2023
97ff22c
adapted comments in hummingbird path files
julesmba Nov 17, 2023
5d20e24
added additional test case for bandwidth check, added comments to tok…
julesmba Nov 17, 2023
0340e78
fixed faulty test
julesmba Nov 17, 2023
6f02cf7
removed flyover checks after crossover. Moving flyover to next hop no…
julesmba Nov 17, 2023
e1b913c
improved currentHopPointer() and currentInfoPointer() by making a cle…
julesmba Nov 20, 2023
37a6528
Update Bazel files.
juagargi Nov 20, 2023
ed0d3f9
changed bandwidth check to use resId-ingress-egress to differentiate …
julesmba Nov 24, 2023
7a8f061
fixed issue when multiple threads create new tokenbucket of the same …
julesmba Dec 6, 2023
688cf32
split processing of hbird with and without flyover, fixed last remain…
julesmba Jan 18, 2024
5a005b6
removed log statement printing every packet
julesmba Jan 23, 2024
15a93ad
added benchmarks for scion and hbird flyoverless processing
julesmba Jan 23, 2024
1c7310b
added benchmarks for flyovers, no xover, xover brtransit and xover as…
julesmba Jan 23, 2024
9eea093
compy to linter
julesmba Jan 23, 2024
94458b7
First commit -----------------------------
juagargi Nov 16, 2023
b2a03d5
Working on GetReservations sciond call.
juagargi Nov 14, 2023
273162c
Refactoring.
juagargi Nov 24, 2023
d16e811
Modified how clients build a hbird path.
juagargi Dec 13, 2023
86ca232
Cleanup, add comments.
juagargi Dec 13, 2023
fe5f48b
Cleanup.
juagargi Dec 13, 2023
8e44e10
Add new UT file for the reservations.
juagargi Dec 13, 2023
c635f4b
New protobuf definitions for Hummingbird.
juagargi Dec 13, 2023
0783f5a
Fix integration test.
juagargi Dec 13, 2023
f0bcf17
cleanup.
juagargi Dec 14, 2023
a490839
Cleanup.
juagargi Dec 14, 2023
0bd9a97
Fix hummingbird protobuf definitions.
juagargi Dec 14, 2023
8e9337e
More cleanup in tests.
juagargi Dec 14, 2023
4cf3ee9
Cleanup, names.
juagargi Dec 14, 2023
7bfd776
Modified Reservation internals. WIP.
juagargi Dec 14, 2023
362bce2
Rename receiver in Reservation methods.
juagargi Dec 14, 2023
11bc225
No need for applyReservations.
juagargi Dec 14, 2023
7eb8b96
Cleanup.
juagargi Dec 14, 2023
8000bf1
Changed signature of DeriveDataPlanePath.
juagargi Dec 14, 2023
8fa6c04
Extend protobuf definition of Reservation with flyovers.
juagargi Dec 15, 2023
d9674f7
Build reservation from existing hbird and flyover sequence.
juagargi Dec 16, 2023
803776f
Cleanup.
juagargi Dec 16, 2023
68fdcd5
Use the new Reservation in our gRPC code.
juagargi Dec 19, 2023
9f7a943
Update protobuf definition for bandwith.
juagargi Dec 19, 2023
c3f4898
Added DB logic.
juagargi Dec 21, 2023
0e3ee1e
Hook scion daemon with a hummingbird DB.
juagargi Dec 21, 2023
e40b9cd
Forward calls from scion daemon to hbird DB.
juagargi Dec 21, 2023
1347467
Make hbird-protobuf functions public.
juagargi Dec 21, 2023
35a8979
Hook daemon client with server via gRPC.
juagargi Dec 21, 2023
f49db76
Fix: no flyovers should work.
juagargi Jan 10, 2024
c4b4838
Fix bug deriving reservation without flyovers.
juagargi Jan 12, 2024
0423a20
Topology generator friendly with hummingbird.
juagargi Jan 12, 2024
f3ee7dc
Cleanup cheat function.
juagargi Jan 12, 2024
a0e4748
New integration test for hummingbird.
juagargi Jan 12, 2024
b3c5c7f
Flyovers to Map is a public function now.
juagargi Jan 12, 2024
5638971
WIP integration test uses flyovers in three different ways.
juagargi Jan 12, 2024
5ff4d2e
Fix bug in translate.
juagargi Jan 29, 2024
299b738
Fix bazel BUILD file.
juagargi Jan 29, 2024
6c34da3
Merge pull request #1 from netsec-ethz/juagargi/hummingbird_sciond
juagargi Mar 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -197,6 +197,8 @@ pkg_tar(
"//tools/braccept",
"//tools/buildkite/cmd/buildkite_artifacts",
"//tools/end2end",
"//tools/end2end_hbird",
"//tools/end2end_hbird_integration",
"//tools/end2end_integration",
"//tools/pktgen/cmd/pktgen",
"//tools/scion_integration",
1 change: 1 addition & 0 deletions daemon/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -17,6 +17,7 @@ go_library(
"//pkg/private/prom:go_default_library",
"//pkg/private/serrors:go_default_library",
"//private/env:go_default_library",
"//private/hummingbirddb:go_default_library",
"//private/revcache:go_default_library",
"//private/trust:go_default_library",
"//private/trust/grpc:go_default_library",
14 changes: 14 additions & 0 deletions daemon/cmd/daemon/main.go
Original file line number Diff line number Diff line change
@@ -113,12 +113,24 @@ func realMain(ctx context.Context) error {
})
defer pathDB.Close()
defer revCache.Close()

hbirdDB, err := storage.NewHummingbirdStorage(globalCfg.HbirdDB)
if err != nil {
return serrors.WrapStr("initializing hummingbird storage", err)
}
defer hbirdDB.Close()

cleaner := periodic.Start(pathdb.NewCleaner(pathDB, "sd_segments"),
300*time.Second, 295*time.Second)
defer cleaner.Stop()
rcCleaner := periodic.Start(revcache.NewCleaner(revCache, "sd_revocation"),
10*time.Second, 10*time.Second)
defer rcCleaner.Stop()
defer cleaner.Stop()

// Hummingbird DB has its cleaner started already in the New method. Use that one.
hbirdCleaner := hbirdDB.GetCleaner()
defer hbirdCleaner.Stop()

dialer := &libgrpc.TCPDialer{
SvcResolver: func(dst addr.SVC) []resolver.Address {
@@ -271,9 +283,11 @@ func realMain(ctx context.Context) error {
Cfg: globalCfg.SD,
},
),

Engine: engine,
RevCache: revCache,
DRKeyClient: drkeyClientEngine,
FlyoverDB: hbirdDB,
},
))

10 changes: 10 additions & 0 deletions daemon/config/config.go
Original file line number Diff line number Diff line change
@@ -46,6 +46,7 @@ type Config struct {
Tracing env.Tracing `toml:"tracing,omitempty"`
TrustDB storage.DBConfig `toml:"trust_db,omitempty"`
PathDB storage.DBConfig `toml:"path_db,omitempty"`
HbirdDB storage.DBConfig `toml:"hbird_db,omitempty"`
SD SDConfig `toml:"sd,omitempty"`
TrustEngine trustengine.Config `toml:"trustengine,omitempty"`
DRKeyLevel2DB storage.DBConfig `toml:"drkey_level2_db,omitempty"`
@@ -61,6 +62,7 @@ func (cfg *Config) InitDefaults() {
&cfg.Tracing,
cfg.TrustDB.WithDefault(fmt.Sprintf(storage.DefaultTrustDBPath, "sd")),
cfg.PathDB.WithDefault(fmt.Sprintf(storage.DefaultPathDBPath, "sd")),
cfg.HbirdDB.WithDefault(fmt.Sprintf(storage.DefaultHbirdDBPath, "sd")),
&cfg.SD,
&cfg.TrustEngine,
)
@@ -75,6 +77,7 @@ func (cfg *Config) Validate() error {
&cfg.API,
&cfg.TrustDB,
&cfg.PathDB,
&cfg.HbirdDB,
&cfg.SD,
&cfg.TrustEngine,
&cfg.DRKeyLevel2DB,
@@ -103,6 +106,13 @@ func (cfg *Config) Sample(dst io.Writer, path config.Path, _ config.CtxMap) {
),
"path_db",
),
config.OverrideName(
config.FormatData(
&cfg.HbirdDB,
fmt.Sprintf(storage.DefaultHbirdDBPath, "sd"),
),
"hbird_db",
),
&cfg.SD,
&cfg.TrustEngine,
config.OverrideName(
4 changes: 4 additions & 0 deletions daemon/daemon.go
Original file line number Diff line number Diff line change
@@ -36,6 +36,7 @@ import (
"github.com/scionproto/scion/pkg/private/prom"
"github.com/scionproto/scion/pkg/private/serrors"
"github.com/scionproto/scion/private/env"
"github.com/scionproto/scion/private/hummingbirddb"
"github.com/scionproto/scion/private/revcache"
"github.com/scionproto/scion/private/trust"
trustgrpc "github.com/scionproto/scion/private/trust/grpc"
@@ -114,6 +115,8 @@ type ServerConfig struct {
Engine trust.Engine
Topology servers.Topology
DRKeyClient *drkey.ClientEngine

FlyoverDB hummingbirddb.DB
}

// NewServer constructs a daemon API server.
@@ -126,6 +129,7 @@ func NewServer(cfg ServerConfig) *servers.DaemonServer {
ASInspector: cfg.Engine.Inspector,
RevCache: cfg.RevCache,
DRKeyClient: cfg.DRKeyClient,
FlyoverDB: cfg.FlyoverDB,
Metrics: servers.Metrics{
PathsRequests: servers.RequestMetrics{
Requests: metrics.NewPromCounterFrom(prometheus.CounterOpts{
25 changes: 24 additions & 1 deletion daemon/internal/servers/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
load("//tools/lint:go.bzl", "go_library")
load("//tools/lint:go.bzl", "go_library", "go_test")

go_library(
name = "go_default_library",
srcs = [
"grpc.go",
"grpc_hummingbird.go",
"metrics.go",
],
importpath = "github.com/scionproto/scion/daemon/internal/servers",
@@ -13,6 +14,7 @@ go_library(
"//daemon/fetcher:go_default_library",
"//pkg/addr:go_default_library",
"//pkg/drkey:go_default_library",
"//pkg/hummingbird:go_default_library",
"//pkg/log:go_default_library",
"//pkg/metrics:go_default_library",
"//pkg/private/common:go_default_library",
@@ -24,6 +26,7 @@ go_library(
"//pkg/proto/daemon:go_default_library",
"//pkg/snet:go_default_library",
"//pkg/snet/path:go_default_library",
"//private/hummingbirddb:go_default_library",
"//private/revcache:go_default_library",
"//private/topology:go_default_library",
"//private/trust:go_default_library",
@@ -33,3 +36,23 @@ go_library(
"@org_golang_x_sync//singleflight:go_default_library",
],
)

go_test(
name = "go_default_test",
srcs = ["grpc_hummingbird_test.go"],
embed = [":go_default_library"],
deps = [
"//pkg/addr:go_default_library",
"//pkg/hummingbird:go_default_library",
"//pkg/private/common:go_default_library",
"//pkg/private/util:go_default_library",
"//pkg/private/xtest:go_default_library",
"//pkg/proto/daemon:go_default_library",
"//pkg/slayers/path:go_default_library",
"//pkg/slayers/path/scion:go_default_library",
"//pkg/snet:go_default_library",
"//pkg/snet/path:go_default_library",
"//private/hummingbirddb:go_default_library",
"@com_github_stretchr_testify//require:go_default_library",
],
)
3 changes: 3 additions & 0 deletions daemon/internal/servers/grpc.go
Original file line number Diff line number Diff line change
@@ -40,6 +40,7 @@ import (
sdpb "github.com/scionproto/scion/pkg/proto/daemon"
"github.com/scionproto/scion/pkg/snet"
snetpath "github.com/scionproto/scion/pkg/snet/path"
"github.com/scionproto/scion/private/hummingbirddb"
"github.com/scionproto/scion/private/revcache"
"github.com/scionproto/scion/private/topology"
"github.com/scionproto/scion/private/trust"
@@ -61,6 +62,8 @@ type DaemonServer struct {
ASInspector trust.Inspector
DRKeyClient *drkey_daemon.ClientEngine

FlyoverDB hummingbirddb.DB

Metrics Metrics

foregroundPathDedupe singleflight.Group
Loading