Repository navigation
ipv6tunneling: keep each tunnel interface on a link of its own - #1290
Open
adamgeorge309 wants to merge 1 commit into
Open
adamgeorge309 wants to merge 1 commit into
adamgeorge309 wants to merge 1 commit into
Conversation
RFC (Request for Comments) 2473 (Generic Packet Tunneling in IPv6) Section 3 models a tunnel as a point-to-point virtual link between its entry point and its exit point. Ipv6NetworkConfigurator instead linked every two Ipv6TunnelInterface modules of a network as members of one wireless local area network (LAN), and computed routes over those links. With two tunnels, a border router could route its own tunnel packets back into the tunnel, and simulation time stopped advancing. Ipv6TunnelInterface now declares isWireless = default(false), as TunInterface, the other ITunnelInterface module, does. NetworkInterface::initialize() classifies an interface as wireless when it has neither a phys$i nor a phys$o gate, unless the module declares an isWireless parameter (NetworkInterface.cc:121-124). Ipv6TunnelInterface has no phys gates and declared no isWireless. The configurator's extractTopology() links every pair of wireless interfaces that share a wireless identifier, and getWirelessId() returns "default" for an interface without a radio that no <wireless> element names (L3NetworkConfiguratorBase.cc:166-184, 497). That grouping is right for wireless interfaces; the tunnel interface was the one misclassified. Ipv4NetworkConfigurator and NextHopNetworkConfigurator run the same extractTopology(), so they now keep tunnel interfaces apart too. tests/module/IPv6_tunnel_configurator_routes.test reproduces it with two border routers and one tunnel each way. Before this change, borderB got the route 2001:db8:2::/64 via fe80:: dev tun0 ahead of the route via eth0. The tunnel exit point 2001:db8:2::1 is in that prefix, so borderB routed each tunnel packet into the tunnel again. Simulation time stayed at t=1.00001402 s until the test's 20 s central processing unit (CPU) time limit, and hostA and hostB each received 0 of 4 packets; now each receives 4 of 4. With explicit addresses in different prefixes on the two tunnel interfaces, the configurator stopped at initialization instead: "Explicit address 2001:db8:b::1 on Ipv6TunnelConfiguratorTestNetwork.borderB.tun0 is not within the link prefix 2001:db8:a::/64". Change: src.networklayer.ipv6tunneling | behavior.change.fix | test whatsnew
There was a problem hiding this comment.
🔍 Devin Review: 1 flag
Not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ipv6NetworkConfiguratorlinked every twoIpv6TunnelInterfacemodules of a network as members of one wireless local area network (LAN), because the module declared noisWirelessparameter. With two tunnels, a border router got a route to its own tunnel exit point through the tunnel and encapsulated each packet again while simulation time stood still. The interface now declaresisWireless = default(false), asTunInterfacedoes. Results change only in networks that have two or moreIpv6TunnelInterfacemodules when a network configurator runs (Ipv6NetworkConfigurator, and alsoIpv4NetworkConfiguratorandNextHopNetworkConfigurator, which share the topology extraction); no shipped example, showcase, tutorial or fingerprint configuration has that.Closes #1289
The problem
RFC (Request for Comments) 2473 (Generic Packet Tunneling in IPv6) Section 3 models a tunnel as a point-to-point virtual link between its two endpoints, and
Ipv6Tunnelmarks the interface point-to-point.NetworkInterface::initialize()(src/inet/networklayer/common/NetworkInterface.cc:121-124) classifies an interface withoutphysgates as wireless unless the module declaresisWireless.L3NetworkConfiguratorBase::extractTopology()then links every pair of wireless interfaces that share a wireless identifier, andgetWirelessId()returns"default"for an interface without a radio that no<wireless>element of the configuration names. That grouping is right for wireless interfaces; the tunnel interface was the one misclassified.The new test
tests/module/IPv6_tunnel_configurator_routes.testbuilds hostA - borderA - transitA - transitB - borderB - hostB, with a tunnel each way between the border routers and a manual route on each that sends the far host's prefix into its tunnel. The configurator computes all other routes, and each host sends 4 User Datagram Protocol (UDP) packets.via fe80:: dev tun0, ahead of the route via eth0With explicit addresses in different prefixes on the two tunnel interfaces, master stops at initialization:
Explicit address 2001:db8:b::1 on Ipv6TunnelConfiguratorTestNetwork.borderB.tun0 is not within the link prefix 2001:db8:a::/64. A configuration that put both tunnel interfaces into one prefix to get past that error still initializes and delivers its traffic on this branch, so no migration is needed.Architectural surface
One NED (Network Description) parameter added to
Ipv6TunnelInterface:bool isWireless = default(false), the same declaration as inTunInterfaceandExtInterface.NetworkInterface::isWireless()now returns false, andisWired()true, for a tunnel interface. The readers of the two:L3NetworkConfiguratorBaseand its three usersIpv6NetworkConfigurator,Ipv4NetworkConfiguratorandNextHopNetworkConfigurator: the change this pull request makes. All three runextractTopology(), so the IPv4 and next-hop configurators keep tunnel interfaces apart too.NetworkInterface::computeCarrier(): false for a wired interface without channels, but the lifecycle start of a tunnel interface sets the carrier withsetCarrier(true), as before. The interface reportsUP CARRIERin the test.Dsdv(Destination-Sequenced Distance Vector routing): an IPv4 routing protocol, which does not run over an IPv6 tunnel.StpandRstp(Spanning Tree Protocol and Rapid Spanning Tree Protocol, throughisWired()): they serve the ports of an Ethernet bridge, andStpalso requires a multicast interface.VirtualTunnelcopies the flag of the real interface it is configured on; none of the shipped configurations put it on anIpv6TunnelInterface.No packet format, C++ interface or feature descriptor changes.
Verification
Release build (
make MODE=release):The existing
IPv6_tunnel, which has one tunnel interface, passes on both.Full suites, release, on master 93210f4 and on this branch:
examples/ipv6/nclientsETHandPPPinmipv6-refactoring.csv; the errors are rows whose optional features are disabled in this build. No fingerprint moves: no shipped example, showcase, tutorial or fingerprint configuration namesIpv6TunnelInterface, and the tunnels that Mobile IPv6 (MIPv6) and Proxy Mobile IPv6 (PMIPv6) create appear only after the configurator has run.tcp_*,ConvolutionalCoder12/34,EtherHost_lifecycle,ExternalProcess_3,Ieee80211BitDomain/SymbolDomain,Ieee8021d-Rstp/Stp,IPv6_packet_too_big,MIPv6_tcp_handover,PacketGate_1,UDPSocket_1).tests/protocol/ipv626 of 27 pass on both (Rfc8200OverlappingFragmentsfails on both);tests/protocol/nd22 of 37 pass on both, with the same 15 failures.make MODE=debug,inet_run_module_tests -m debug --no-build -l ERROR -f IPv6_tunnel): all pass on this branch, and the new test fails on master in debug too.doc/project/enforcement/check-commits.sh,check-classification.shandcheck-architecture.shonsrc/inet/networklayer/ipv6tunnelingandsrc/inet/networklayer/ipv6: PASS. Statistical tests andcheck-cpp.shwere not run.Landing order
git merge-treeagainst the heads of the open pull requests #1228, #1232, #1252, #1256 and #1264 conflicts only inWHATSNEW, where each adds an item with the same number. The pull request that lands later renumbers its item.