Documentation ¶
Overview ¶
Package cases contains router acceptance cases that can be integrated into the braccept binary.
The process to add a new case is the following:
Step 0. Refer to the following for the test's setup:
- Overview: acceptance/router_multi/topology.drawio.png
- Topology Details: acceptance/router_multi/conf/topology.json
- MAC Addresses: acceptance/router_multi/test.py Note that all MAC addresses of interfaces on the far side of the A/B/C/D routers are identical: f00d:cafe:beef
Step 1. Add a new file with a representative name e.g. cases/child_to_child_xover.go
Step 2. Create a function inside that file which returns the new br accept testcase.
// ChildToChildXover <ADD DESCRIPTION> func ChildToChildXover(artifactsDir string, mac hash.Hash) runner.Case { ... return runner.Case{ Dscr: "ChildToChild", WriteTo: "veth_151_host", ReadFrom: "veth_141_host", Input: input.Bytes(), Want: want.Bytes(), } }
Step 3. In the braccept/main.go, include the above function
multi := []runner.Case{ cases.ChildToParent(artifactsDir, mac), cases.ChildToChildXover(artifactsDir, mac), }
Step 4. Do a local run, which means set up a working router, execute the braccept, shutdown the router. This is done in sequence by:
bazel test acceptance/router_multi:all --config=integration --nocache_test_results
Index ¶
- func ChildToChildXover(artifactsDir string, mac hash.Hash) runner.Case
- func ChildToInternalHost(artifactsDir string, mac hash.Hash) runner.Case
- func ChildToInternalHostShortcut(artifactsDir string, mac hash.Hash) runner.Case
- func ChildToInternalParent(artifactsDir string, mac hash.Hash) runner.Case
- func ChildToParent(artifactsDir string, mac hash.Hash) runner.Case
- func ChildToPeer(artifactsDir string, mac hash.Hash) runner.Case
- func ExternalBFD(artifactsDir string, mac hash.Hash) runner.Case
- func IncomingOneHop(artifactsDir string, mac hash.Hash) runner.Case
- func InternalBFD(artifactsDir string, mac hash.Hash) runner.Case
- func InternalHostToChild(artifactsDir string, mac hash.Hash) runner.Case
- func InternalParentToChild(artifactsDir string, mac hash.Hash) runner.Case
- func InvalidSrcInternalParentToChild(artifactsDir string, mac hash.Hash) runner.Case
- func JumboPacket(artifactsDir string, mac hash.Hash) runner.Case
- func MalformedPathCurrHFNotInCurrINF(artifactsDir string, mac hash.Hash) runner.Case
- func MalformedPathSingletonSegment(artifactsDir string, mac hash.Hash) runner.Case
- func NoSCMPReplyForSCMPError(artifactsDir string, mac hash.Hash) runner.Case
- func OutgoingOneHop(artifactsDir string, mac hash.Hash) runner.Case
- func ParentToChild(artifactsDir string, mac hash.Hash) runner.Case
- func ParentToInternalHost(artifactsDir string, mac hash.Hash) runner.Case
- func ParentToInternalHostMultiSegment(artifactsDir string, mac hash.Hash) runner.Case
- func PeerToChild(artifactsDir string, mac hash.Hash) runner.Case
- func SCMPBadMAC(artifactsDir string, mac hash.Hash) runner.Case
- func SCMPBadMACInternal(artifactsDir string, mac hash.Hash) runner.Case
- func SCMPBadPktLen(artifactsDir string, mac hash.Hash) runner.Case
- func SCMPChildToParentLocalXover(artifactsDir string, mac hash.Hash) runner.Case
- func SCMPChildToParentXover(artifactsDir string, mac hash.Hash) runner.Case
- func SCMPDestinationUnreachable(artifactsDir string, mac hash.Hash) runner.Case
- func SCMPExpiredHop(artifactsDir string, mac hash.Hash) runner.Case
- func SCMPExpiredHopAfterXover(artifactsDir string, mac hash.Hash) runner.Case
- func SCMPExpiredHopAfterXoverConsDir(artifactsDir string, mac hash.Hash) runner.Case
- func SCMPExpiredHopAfterXoverInternal(artifactsDir string, mac hash.Hash) runner.Case
- func SCMPExpiredHopAfterXoverInternalConsDir(artifactsDir string, mac hash.Hash) runner.Case
- func SCMPInternalXover(artifactsDir string, mac hash.Hash) runner.Case
- func SCMPInvalidDstIAChildToParent(artifactsDir string, mac hash.Hash) runner.Case
- func SCMPInvalidDstIAInternalHostToChild(artifactsDir string, mac hash.Hash) runner.Case
- func SCMPInvalidHopChildToChild(artifactsDir string, mac hash.Hash) runner.Case
- func SCMPInvalidHopParentToParent(artifactsDir string, mac hash.Hash) runner.Case
- func SCMPInvalidSrcIAChildToParent(artifactsDir string, mac hash.Hash) runner.Case
- func SCMPInvalidSrcIAInternalHostToChild(artifactsDir string, mac hash.Hash) runner.Case
- func SCMPParentToChildLocalXover(artifactsDir string, mac hash.Hash) runner.Case
- func SCMPParentToChildXover(artifactsDir string, mac hash.Hash) runner.Case
- func SCMPParentToParentLocalXover(artifactsDir string, mac hash.Hash) runner.Case
- func SCMPParentToParentXover(artifactsDir string, mac hash.Hash) runner.Case
- func SCMPQuoteCut(artifactsDir string, mac hash.Hash) runner.Case
- func SCMPTracerouteEgress(artifactsDir string, mac hash.Hash) runner.Case
- func SCMPTracerouteEgressAfterXover(artifactsDir string, mac hash.Hash) runner.Case
- func SCMPTracerouteEgressConsDir(artifactsDir string, mac hash.Hash) runner.Case
- func SCMPTracerouteIngress(artifactsDir string, mac hash.Hash) runner.Case
- func SCMPTracerouteIngressConsDir(artifactsDir string, mac hash.Hash) runner.Case
- func SCMPTracerouteIngressWithSPAO(artifactsDir string, mac hash.Hash) runner.Case
- func SCMPTracerouteInternal(artifactsDir string, mac hash.Hash) runner.Case
- func SCMPUnknownHop(artifactsDir string, mac hash.Hash) runner.Case
- func SCMPUnknownHopEgress(artifactsDir string, mac hash.Hash) runner.Case
- func SCMPUnknownHopWrongRouter(artifactsDir string, mac hash.Hash) runner.Case
- func SVC(artifactsDir string, mac hash.Hash) runner.Case
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChildToChildXover ¶
ChildToChildXover tests transit traffic over the same BR host and for which there is xover, e.g. a switch from up segment to core segment.
func ChildToInternalHost ¶
ChildToInternalHost tests traffic from a child to an AS host.
func ChildToInternalHostShortcut ¶
ChildToInternalHostShortcut tests traffic from a child to an AS host with a short-cut path. I.e., a path where only a partial path segment is used.
func ChildToInternalParent ¶
ChildToInternalParent tests traffic from a child to a parent link that goes out from a different BR.
func ChildToParent ¶
ChildToParent tests transit traffic over the same BR host.
func ChildToPeer ¶ added in v0.9.0
ChildToPeer tests transit traffic over one BR host and one peering hop. In this case, traffic enters via a regular link, and leaves via a peering link from the same router. To be valid, the path as to be constructed as one up segment over the normal link ending with a peering hop and one down segment starting at the peering link's destination. The peering hop is the second hop on the first segment as it crosses from a child interface to a peering interface. In this test case, the down segment is a one-hop segment. The peering link's destination is the only hop.
func ExternalBFD ¶
ExternalBFD sends an unbootstrapped BFD message to an external interface and expects a bootstrapped BFD message on the same interface.
func IncomingOneHop ¶
IncomingOneHop tests one-hop being sent from the remote AS to the local AS.
func InternalBFD ¶
InternalBFD sends an unbootstrapped BFD message to an internal interface and expects a bootstrapped BFD message on the same interface.
func InternalHostToChild ¶
InternalHostToChild tests transit from an AS local host out.
func InternalParentToChild ¶
InternalParentToChild tests transit from a different BR in this AS out to a child.
func InvalidSrcInternalParentToChild ¶ added in v0.9.0
InvalidSrcInternalParentToChild tests that transit packets, which are expected to be received from a different BR in this AS, are dropped if they come from an unexpected source address.
func JumboPacket ¶
JumboPacket tests jumbo packet transit traffic over the same BR host.
func MalformedPathCurrHFNotInCurrINF ¶ added in v0.12.0
MalformedPathCurrHFNotInCurrINF tests an invalid combination of CurrHF and CurrINF
func MalformedPathSingletonSegment ¶ added in v0.12.0
MalformedPathSingletonSegment tests invalid (non-peer) path segments with a single hop field. In this test case, an invalid single-hop core segment is included in an otherwise valid path. This is invalid and the semantics of this are consequently undefined; in our implementation of the router, this specific case would result in the same effective path as without the core segment, with both the ingress _and_ the egress router performing a segment cross over (https://github.com/scionproto/scion/issues/4524).
func NoSCMPReplyForSCMPError ¶
NoSCMPReplyForSCMPError tests that the router doesn't trigger another SCMP error packet for a packet that is already an SCMP error.
func OutgoingOneHop ¶
OutgoingOneHop tests one-hop being sent from the local AS to the remote AS.
func ParentToChild ¶
ParentToChild tests transit traffic over the same BR host.
func ParentToInternalHost ¶
ParentToInternalHost test traffic from a parent to an AS host.
func ParentToInternalHostMultiSegment ¶
ParentToInternalHostMultiSegment test traffic from a parent to an AS host where two path segments are involved.
func PeerToChild ¶ added in v0.9.0
PeerToChild tests transit traffic over one BR host and one peering hop. In this case, traffic enters via a peering link, and leaves via a regular link from the same router. To be valid, the path as to be constructed as one up segment ending at the peering link's origin and one down segment over the regular link. The peering hop is the first hop on the second segment as it crosses from a peering interface to a child interface. In this test case, the up segment is a one-hop segment. The peering link's origin is the only hop.
func SCMPBadMAC ¶
SCMPBadMAC tests a packet without a MAC set.
func SCMPBadMACInternal ¶
SCMPBadMACInternal tests a packet with a bad MAC that is sent from internal.
func SCMPBadPktLen ¶
SCMPBadPktLen tests a packet which has an invalid payload length specified.
func SCMPChildToParentLocalXover ¶
SCMPChildToParentLocalXover tests a packet that attempts a segment switch from a up segment to another up segment. The egress interface is on the same router than the ingress interface.
func SCMPChildToParentXover ¶
SCMPChildToParentXover tests a packet that attempts a segment switch from an up segment to another up segment. The egress interface is on a different router than the ingress interface.
func SCMPDestinationUnreachable ¶
SCMPDestinationUnreachable sends a packet for an SVC address that doesn't exist.
func SCMPExpiredHop ¶
SCMPExpiredHop tests a packet with an expired hop field.
func SCMPExpiredHopAfterXover ¶
SCMPExpiredHopAfterXover tests a packet with an expired hop field after an x-over. The relative timestamp can be encoded in the SPAO header and sent back to the src.
func SCMPExpiredHopAfterXoverConsDir ¶
SCMPExpiredHopAfterXoverConsDir tests a packet with an expired hop field after an x-over. The relative timestamp can be encoded in the SPAO header and sent back to the src.
func SCMPExpiredHopAfterXoverInternal ¶
SCMPExpiredHopAfterXoverInternal tests a packet with an expired hop field after an x-over received from an internal router. The expired path segment is against construction direction. The relative timestamp can be encoded in the SPAO header and sent back to the src.
func SCMPExpiredHopAfterXoverInternalConsDir ¶
SCMPExpiredHopAfterXoverInternalConsDir tests a packet with an expired hop field after an x-over received from an internal router. The expired path segment is in construction direction. The expired path segment is against construction direction. The relative timestamp can be encoded in the SPAO header and sent back to the src.
func SCMPInternalXover ¶
SCMPInternalXover tests a packet that attempts a segment switch but was received on the internal interface. That is never allowed.
func SCMPInvalidDstIAChildToParent ¶ added in v0.9.0
func SCMPInvalidDstIAInternalHostToChild ¶ added in v0.9.0
func SCMPInvalidHopChildToChild ¶ added in v0.9.0
SCMPInvalidHopChildToChild tests a packet that attempts a hop from a child to a child interface, with a valid hopfield MAC. This can only occur if the hop key has been compromised.
func SCMPInvalidHopParentToParent ¶ added in v0.9.0
SCMPInvalidHopParentToParent tests a packet that attempts a hop from a parent to a parent interface, with a valid hopfield MAC. This can only occur if the hop key has been compromised.
func SCMPInvalidSrcIAChildToParent ¶ added in v0.9.0
func SCMPInvalidSrcIAInternalHostToChild ¶ added in v0.9.0
func SCMPParentToChildLocalXover ¶
SCMPParentToChildLocalXover tests a packet that attempts a segment switch from a down segment to another down segment. The egress interface is on the same router than the ingress interface.
func SCMPParentToChildXover ¶
SCMPParentToChildXover tests a packet that attempts a segment switch from a down segment to another down segment. The egress interface is on a different router than the ingress interface.
func SCMPParentToParentLocalXover ¶
SCMPParentToParentLocalXover tests a packet that attempts a segment switch from a down segment to a up segment. The egress interface is on the same router than the ingress interface.
func SCMPParentToParentXover ¶
SCMPParentToParentXover tests a packet that attempts a segment switch from a down segment to a up segment. The egress interface is on a different router than the ingress interface.
func SCMPQuoteCut ¶
SCMPQuoteCut tests that a packet that triggers an SCMP quote and is very long is correctly cut off, i.e. the response packet does not exceed the maximum SCMP packet length.
func SCMPTracerouteEgress ¶
SCMPTracerouteEgress tests an SCMP traceroute request with alert on the egress interface.
func SCMPTracerouteEgressAfterXover ¶
SCMPTracerouteEgressAfterXover tests an SCMP traceroute request with alert on the egress interface after Xover and the packet was received on the internal interface..
func SCMPTracerouteEgressConsDir ¶
SCMPTracerouteEgressConsDir tests an SCMP traceroute request with alert on the egress interface.
func SCMPTracerouteIngress ¶
SCMPTracerouteIngress tests an SCMP traceroute request with alert on the ingress interface.
func SCMPTracerouteIngressConsDir ¶
SCMPTracerouteIngressConsDir tests an SCMP traceroute request with alert on the ingress interface.
func SCMPTracerouteIngressWithSPAO ¶ added in v0.9.0
SCMPTracerouteIngressWithSPAO tests an SCMP traceroute request with alert on the ingress interface and a SPAO header.
func SCMPTracerouteInternal ¶
SCMPTracerouteInternal tests a traceroute request from the AS itself.
func SCMPUnknownHop ¶
SCMPUnknownHop tests a packet with a wrong ingress interface ID.
func SCMPUnknownHopEgress ¶
SCMPUnknownHopEgress sends a packet for an egress interface that doesn't exists.
func SCMPUnknownHopWrongRouter ¶ added in v0.11.0
SCMPUnknownHopWrongRouter tests a packet from an AS local host sent to the wrong egress router. This packet must not be forwarded by the router.
Types ¶
This section is empty.
Source Files ¶
- bfd.go
- child_to_child_xover.go
- child_to_internal.go
- child_to_parent.go
- child_to_peer.go
- doc.go
- internal_to_child.go
- jumbo.go
- malformed_path.go
- onehop.go
- parent_to_child.go
- parent_to_internal.go
- peer_to_child.go
- scmp.go
- scmp_dest_unreachable.go
- scmp_expired_hop.go
- scmp_invalid_hop.go
- scmp_invalid_ia.go
- scmp_invalid_mac.go
- scmp_invalid_pkt.go
- scmp_invalid_segment_change.go
- scmp_invalid_segment_change_local.go
- scmp_traceroute.go
- scmp_unknown_hop.go
- svc.go