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

Adding DataPlaneSpec to the IO-spec #230

Merged
merged 14 commits into from
Oct 18, 2023
77 changes: 77 additions & 0 deletions verification/io/dataplane_abstract.gobra
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
// Copyright 2022 ETH Zurich
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// +gobra

package io

type DataPlaneSpec adt {
DataPlaneSpec_{
linkTypes dict[IO_ifs]IO_Link
neighborIAs dict[IO_ifs]IO_as
localIA IO_as
topology TopologySpec
}
mlimbeck marked this conversation as resolved.
Show resolved Hide resolved
}

//TopologySpec provides information about the entire network topology because
mlimbeck marked this conversation as resolved.
Show resolved Hide resolved
//the dataplane lacks information needed for the IO-specification.
mlimbeck marked this conversation as resolved.
Show resolved Hide resolved
//core_as_set: set of ASIDs, which are core ASes in the network.
mlimbeck marked this conversation as resolved.
Show resolved Hide resolved
//links: representation of the network topology as a graph.
// links[a1][1] == a2 means that AS a1 has an edge to AS a2 via interface 1.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this enough? Or should we also keep track of the ingress interface to AS2?

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess we can decide on this on a later PR

type TopologySpec adt {
TopologySpec_{
core_as_set set[IO_as]
links dict[IO_as](dict[IO_ifs]IO_as)
jcp19 marked this conversation as resolved.
Show resolved Hide resolved
}
}

//A DataPlaneSpec is valid if and only if the domain of linkTypes and neighborIAs
//are equal, i.e., evey link connects to an AS. The entries of neigborIAs and links[localIA]
//are equal, i.e, all local neighbors are part of the network topology. Every core AS
//and localIA must be in the domain of links.
mlimbeck marked this conversation as resolved.
Show resolved Hide resolved
ghost
decreases
pure func (dp DataPlaneSpec) Valid() bool{
return domain(dp.linkTypes) == domain(dp.neighborIAs) &&
dp.localIA in domain(dp.topology.links) &&
dp.neighborIAs == dp.topology.links[dp.localIA] &&
(forall core IO_as :: {core in dp.topology.core_as_set} core in dp.topology.core_as_set ==> core in domain(dp.topology.links))
}

ghost
decreases
requires ifs in domain(dp.linkTypes)
pure func (dp DataPlaneSpec) GetLinkType(ifs IO_ifs) IO_Link {
return dp.linkTypes[ifs]
}

ghost
requires ifs in domain(dp.neighborIAs)
decreases
pure func (dp DataPlaneSpec) GetNeighborIA(ifs IO_ifs) IO_as {
return dp.neighborIAs[ifs]
}

ghost
decreases
pure func (dp DataPlaneSpec) GetLocalIA() IO_as {
return dp.localIA
}

ghost
decreases
pure func (dp DataPlaneSpec) GetCore_as_set() set[IO_as] {
mlimbeck marked this conversation as resolved.
Show resolved Hide resolved
return dp.topology.core_as_set
}
Loading
Loading