Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
43 changes: 32 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -538,8 +538,8 @@ newtype_derive = "0.1.6"
ntp-admin-api = { path = "ntp-admin/api" }
ntp-admin-client = { path = "clients/ntp-admin-client" }
ntp-admin-types = { path = "ntp-admin/types" }
mg-admin-client = { git = "https://github.com/oxidecomputer/maghemite", rev = "08f2a34d487658e87545ffbba3add632a82baf0d" }
ddm-admin-client = { git = "https://github.com/oxidecomputer/maghemite", rev = "08f2a34d487658e87545ffbba3add632a82baf0d" }
mg-admin-client = { git = "https://github.com/oxidecomputer/maghemite", rev = "835553064c9702789fc09af7fa1eb3f12caa91c5" }
ddm-admin-client = { git = "https://github.com/oxidecomputer/maghemite", rev = "835553064c9702789fc09af7fa1eb3f12caa91c5" }
multimap = "0.10.1"
nexus-auth = { path = "nexus/auth" }
nexus-background-task-interface = { path = "nexus/background-task-interface" }
Expand Down Expand Up @@ -667,6 +667,7 @@ ratatui = "0.29.0"
raw-cpuid = { git = "https://github.com/oxidecomputer/rust-cpuid.git", rev = "a4cf01df76f35430ff5d39dc2fe470bcb953503b" }
rayon = "1.10"
rcgen = "0.12.1"
rdb-types = { git = "https://github.com/oxidecomputer/maghemite", rev = "835553064c9702789fc09af7fa1eb3f12caa91c5" }
reconfigurator-cli = { path = "dev-tools/reconfigurator-cli" }
reedline = "0.40.0"
ref-cast = "1.0"
Expand Down
8 changes: 8 additions & 0 deletions common/src/api/external/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3281,6 +3281,11 @@ pub enum BgpPeerState {
/// Waiting for keepaliave or notification from peer.
OpenConfirm,

/// There is an ongoing Connection Collision that hasn't yet been resolved.
/// Two connections are maintained until one connection receives an Open or
/// is able to progress into Established.
ConnectionCollision,

/// Synchronizing with peer.
SessionSetup,

Expand All @@ -3298,6 +3303,9 @@ impl From<mg_admin_client::types::FsmStateKind> for BgpPeerState {
FsmStateKind::Active => BgpPeerState::Active,
FsmStateKind::OpenSent => BgpPeerState::OpenSent,
FsmStateKind::OpenConfirm => BgpPeerState::OpenConfirm,
FsmStateKind::ConnectionCollision => {
BgpPeerState::ConnectionCollision
}
FsmStateKind::SessionSetup => BgpPeerState::SessionSetup,
FsmStateKind::Established => BgpPeerState::Established,
}
Expand Down
1 change: 1 addition & 0 deletions nexus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ qorb.workspace = true
rand.workspace = true
range-requests.workspace = true
ref-cast.workspace = true
rdb-types.workspace = true
regex.workspace = true
reqwest = { workspace = true, features = ["json"] }
ring.workspace = true
Expand Down
8 changes: 4 additions & 4 deletions nexus/db-queries/src/db/datastore/vpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3905,21 +3905,21 @@ mod tests {
assert!(resolved.iter().any(|x| {
let k = &x.dest;
let v = &x.target;
*k == subnet.ipv4_block.0.into()
*k == IpNet::from(subnet.ipv4_block.0)
&& match v {
RouterTarget::VpcSubnet(ip) => {
*ip == subnet.ipv4_block.0.into()
*ip == IpNet::from(subnet.ipv4_block.0)
}
_ => false,
}
}));
assert!(resolved.iter().any(|x| {
let k = &x.dest;
let v = &x.target;
*k == subnet.ipv6_block.0.into()
*k == IpNet::from(subnet.ipv6_block.0)
&& match v {
RouterTarget::VpcSubnet(ip) => {
*ip == subnet.ipv6_block.0.into()
*ip == IpNet::from(subnet.ipv6_block.0)
}
_ => false,
}
Expand Down
4 changes: 2 additions & 2 deletions nexus/src/app/background/tasks/sync_switch_configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ use futures::future::BoxFuture;
use mg_admin_client::types::{
AddStaticRoute4Request, ApplyRequest, BgpPeerConfig, CheckerSource,
DeleteStaticRoute4Request, ImportExportPolicy as MgImportExportPolicy,
Prefix as MgPrefix, Prefix4, Prefix6, ShaperSource, StaticRoute4,
StaticRoute4List,
ShaperSource, StaticRoute4, StaticRoute4List,
};
use nexus_db_queries::{
context::OpContext,
Expand All @@ -47,6 +46,7 @@ use omicron_common::{
internal::shared::ParseSwitchLocationError,
},
};
use rdb_types::{Prefix as MgPrefix, Prefix4, Prefix6};
use serde_json::json;
use sled_agent_client::types::{
BgpConfig as SledBgpConfig, BgpPeerConfig as SledBgpPeerConfig,
Expand Down
18 changes: 10 additions & 8 deletions nexus/src/app/bgp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ impl super::Nexus {
for r in &router_info {
let asn = r.asn;

let peers = match client.get_neighbors(asn).await {
let peers = match client.get_neighbors_v2(asn).await {
Ok(result) => result.into_inner(),
Err(e) => {
error!(
Expand Down Expand Up @@ -196,12 +196,12 @@ impl super::Nexus {
let mut xps = Vec::new();
for ex in exports.iter() {
let net = match ex {
mg_admin_client::types::Prefix::V4(v4) => {
rdb_types::Prefix::V4(v4) => {
oxnet::Ipv4Net::new_unchecked(
v4.value, v4.length,
)
}
mg_admin_client::types::Prefix::V6(v6) => {
rdb_types::Prefix::V6(v6) => {
let v6 = oxnet::IpNet::V6(
oxnet::Ipv6Net::new_unchecked(
v6.value, v6.length,
Expand Down Expand Up @@ -237,7 +237,11 @@ impl super::Nexus {
))
})? {
let history = match client
.message_history(&MessageHistoryRequest { asn: sel.asn })
.message_history_v2(&MessageHistoryRequest {
asn: sel.asn,
direction: None,
peer: None,
})
.await
{
Ok(result) => result.into_inner().by_peer.clone(),
Expand Down Expand Up @@ -265,7 +269,7 @@ impl super::Nexus {
pub async fn bgp_imported_routes_ipv4(
&self,
opctx: &OpContext,
sel: &params::BgpRouteSelector,
_sel: &params::BgpRouteSelector,
Copy link
Contributor

Choose a reason for hiding this comment

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

If we're no longer querying imported routes by ASN, we should propagate that up through the omicron API function networking_bgp_imported_routes_ipv4 so users of the API don't have to specify an ASN that's no longer used for anything. Then we can remove the sel parameter.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed. However, the change I'm envisioning would be to deprecate the old endpoint (/v1/system/networking/bgp-routes-ipv4) and introduce a new endpoint that will not be specific to BGP or IP version (e.g. /v1/system/networking/routes). I'm not sure exactly what this will look like yet from a Nexus API standpoint, so I put this in as a placeholder for the time being.

) -> ListResultVec<BgpImportedRouteIpv4> {
opctx.authorize(authz::Action::Read, &authz::FLEET).await?;
let mut result = Vec::new();
Expand All @@ -276,9 +280,7 @@ impl super::Nexus {
})? {
let mut imported: Vec<BgpImportedRouteIpv4> = Vec::new();
match client
.get_imported(&mg_admin_client::types::AsnSelector {
asn: sel.asn,
})
.get_rib_imported(Some(&rdb_types::AddressFamily::Ipv4), None)
.await
{
Ok(result) => {
Expand Down
9 changes: 5 additions & 4 deletions nexus/tests/integration_tests/switch_port.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ use omicron_common::api::external::{
LinkSpeed, NameOrId, SwitchPort, SwitchPortSettings,
};
use omicron_common::api::external::{ImportExportPolicy, Name};
use oxnet::IpNet;

type ControlPlaneTestContext =
nexus_test_utils::ControlPlaneTestContext<omicron_nexus::Server>;
Expand Down Expand Up @@ -229,11 +230,11 @@ async fn test_port_settings_basic_crud(ctx: &ControlPlaneTestContext) {
assert_eq!(ifx0.kind, external::SwitchInterfaceKind::Primary);

let route0 = &created.routes[0];
assert_eq!(route0.dst, "1.2.3.0/24".parse().unwrap());
assert_eq!(route0.dst, IpNet::from_str("1.2.3.0/24").unwrap());
assert_eq!(&route0.gw.to_string(), "1.2.3.4");

let addr0 = &created.addresses[0];
assert_eq!(addr0.address, "203.0.113.10/24".parse().unwrap());
assert_eq!(addr0.address, IpNet::from_str("203.0.113.10/24").unwrap());

// Get the port settings back
let roundtrip: SwitchPortSettings = NexusRequest::object_get(
Expand Down Expand Up @@ -271,11 +272,11 @@ async fn test_port_settings_basic_crud(ctx: &ControlPlaneTestContext) {
assert_eq!(ifx0.kind, external::SwitchInterfaceKind::Primary);

let route0 = &roundtrip.routes[0];
assert_eq!(route0.dst, "1.2.3.0/24".parse().unwrap());
assert_eq!(route0.dst, IpNet::from_str("1.2.3.0/24").unwrap());
assert_eq!(&route0.gw.to_string(), "1.2.3.4");

let addr0 = &roundtrip.addresses[0];
assert_eq!(addr0.address, "203.0.113.10/24".parse().unwrap());
assert_eq!(addr0.address, IpNet::from_str("203.0.113.10/24").unwrap());

// Delete port settings
NexusRequest::object_delete(
Expand Down
7 changes: 7 additions & 0 deletions openapi/nexus.json
Original file line number Diff line number Diff line change
Expand Up @@ -16324,6 +16324,13 @@
"open_confirm"
]
},
{
"description": "There is an ongoing Connection Collision that hasn't yet been resolved. Two connections are maintained until one connection receives an Open or is able to progress into Established.",
"type": "string",
"enum": [
"connection_collision"
]
},
{
"description": "Synchronizing with peer.",
"type": "string",
Expand Down
12 changes: 6 additions & 6 deletions package-manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -654,10 +654,10 @@ source.repo = "maghemite"
# `tools/maghemite_openapi_version`. Failing to do so will cause a failure when
# building `ddm-admin-client` (which will instruct you to update
# `tools/maghemite_openapi_version`).
source.commit = "08f2a34d487658e87545ffbba3add632a82baf0d"
source.commit = "835553064c9702789fc09af7fa1eb3f12caa91c5"
# The SHA256 digest is automatically posted to:
# https://buildomat.eng.oxide.computer/public/file/oxidecomputer/maghemite/image/<commit>/mg-ddm-gz.sha256.txt
source.sha256 = "b11b8446669c525342c5a5e70e8d6bfffb637d23b4c30a0f39c964bd2c2cb972"
source.sha256 = "86ffc098943954a3850cdbe792e7137988b8d219a29a8db118b61d9c04019465"
output.type = "tarball"

[package.mg-ddm]
Expand All @@ -670,10 +670,10 @@ source.repo = "maghemite"
# `tools/maghemite_openapi_version`. Failing to do so will cause a failure when
# building `ddm-admin-client` (which will instruct you to update
# `tools/maghemite_openapi_version`).
source.commit = "08f2a34d487658e87545ffbba3add632a82baf0d"
source.commit = "835553064c9702789fc09af7fa1eb3f12caa91c5"
# The SHA256 digest is automatically posted to:
# https://buildomat.eng.oxide.computer/public/file/oxidecomputer/maghemite/image/<commit>/mg-ddm.sha256.txt
source.sha256 = "56aa1984ba58fd4d64eba3a0c321cdfbcd22f97f9c31e20055fd6292b7f69bdc"
source.sha256 = "2e23ad7aaa5bd170ac93d94869523a339cd7e2f4fb9b186cda0da153267f96aa"
output.type = "zone"
output.intermediate_only = true

Expand All @@ -685,10 +685,10 @@ source.repo = "maghemite"
# `tools/maghemite_openapi_version`. Failing to do so will cause a failure when
# building `ddm-admin-client` (which will instruct you to update
# `tools/maghemite_openapi_version`).
source.commit = "08f2a34d487658e87545ffbba3add632a82baf0d"
source.commit = "835553064c9702789fc09af7fa1eb3f12caa91c5"
# The SHA256 digest is automatically posted to:
# https://buildomat.eng.oxide.computer/public/file/oxidecomputer/maghemite/image/<commit>/mgd.sha256.txt
source.sha256 = "5f0f682cd13e18b7bb428aff336ee7e42796e43a5cbbab7a23b086d0fd67050b"
source.sha256 = "2cc222793487c19fd42da538477515779861b5a79c16fb0c9e5859f1feda5809"
output.type = "zone"
output.intermediate_only = true

Expand Down
1 change: 1 addition & 0 deletions sled-agent/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ propolis-mock-server.workspace = true # Only used by the simulated sled agent
propolis_api_types.workspace = true
rand = { workspace = true, features = ["os_rng"] }
range-requests.workspace = true
rdb-types.workspace = true
repo-depot-api.workspace = true
repo-depot-client.workspace = true
reqwest = { workspace = true, features = ["rustls-tls", "stream"] }
Expand Down
5 changes: 3 additions & 2 deletions sled-agent/src/bootstrap/early_networking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ use mg_admin_client::types::BfdPeerConfig as MgBfdPeerConfig;
use mg_admin_client::types::BgpPeerConfig as MgBgpPeerConfig;
use mg_admin_client::types::ImportExportPolicy as MgImportExportPolicy;
use mg_admin_client::types::{
AddStaticRoute4Request, ApplyRequest, CheckerSource, Prefix, Prefix4,
Prefix6, ShaperSource, StaticRoute4, StaticRoute4List,
AddStaticRoute4Request, ApplyRequest, CheckerSource, ShaperSource,
StaticRoute4, StaticRoute4List,
};
use omicron_common::OMICRON_DPD_TAG;
use omicron_common::address::DENDRITE_PORT;
Expand All @@ -35,6 +35,7 @@ use omicron_common::backoff::{
};
use omicron_ddm_admin_client::DdmError;
use oxnet::IpNet;
use rdb_types::{Prefix, Prefix4, Prefix6};
use slog::Logger;
use slog_error_chain::InlineErrorChain;
use std::collections::{HashMap, HashSet};
Expand Down
Loading
Loading