Upload
others
View
1
Download
0
Embed Size (px)
Citation preview
© 2015 Steven Barth
Networking
Steven Barth
© 2015 Steven Barth
The Good ol’ Days…
Image: “legacy-caution” by Phil Benchoff; CC BY 2.0
Static Configuration- Fixed private addresses- DHCP to clients- Leases & hostnames stored- NAT hides dynamic changes
Bootstrapping
DHCP
EthernetCable etc.
PPP(oE/A)Modems (DSL, 3G, …)
IPCP
© 2015 Steven Barth
… and bootstrapping now
RA + DHCPV6
6rdIPv6 in IPv4
DHCP
EthernetCable etc.
PPP(oE/A)Modems (DSL, 3G, …)
IPCP
DS-LiteIPv4 in IPv6
MAP-E / LW4o6IPv4 in IPv6 + NAT
MAP-TNAT46 + 44
464XLATNAT46
MBIM3G / 4G
QMI3G / 4G
Other 3G/4GNCM, DirectIP, ...
© 2015 Steven Barth
Expose it to the user?
© 2015 Steven Barth
Configure only what is necessary!
Ethernet / WiFiconfig interface wan option ifname eth1 option proto dhcp
config interface wan6 option ifname eth1 option proto dhcpv6
DSL (PPPoE/A)config interface wan
option ifname eth1option proto pppoeoption username #user#option password #pass#
3G / 4Gconfig interface wan
option proto wwanoption pincode #code#option apn #apn#
© 2015 Steven Barth
Network Subsystem Overview
netifdconfig + management
firewall3iptables abstraction
ProtocolsDHCP, DHCPv6, ...
DNS cache
Client ConfigurationDHCP, RA, DHCPv6, ...
DevicesEthernet, WiFi, ... Other Services
PCP, MDNS, UPNP, ...
© 2015 Steven Barth
netifd: heart of the network subsystem
Device Setup
bring up / teardownhotplug & carrier-detectionbridges, 802.1q/ad, macvlansettings: L2-address, MTU, …
Configuration & Events
store and manage configurationcalculate minimal changesreact to events: kernel, ubus
Layer 3 Protocols
ubus + shell based APIstackable protocolsdependency support
Addresses & Route
manage and distributesend ubus + script eventshandle auxiliary data (DNS, ...)
© 2015 Steven Barth
Example Flowconfig interface wan option ifname eth1 option proto dhcp
option hostname foobar
Kernel device event eth1 available and cable plugged in
Configuration Eventnew interface using device eth1→ listen for eth1 device events
Run dhcp protocol handlerpass option hostname
Protocol Eventsuccess: IP=1.2.3.4, GW=2.3.4.5on wan (eth1)
Assign addresses and routesAssign 1.2.3.4 to eth1Setup default route to 2.3.4.5
© 2015 Steven Barth
Declaring protocolsfile: /lib/netifd/proto/dhcpv6.sh (simpl.)1. Some Preamble
2. Declare Configuration
3. Protocol setup functiona: retrieve configuration
b: spawn protocol daemon
4. Declare teardown function
5. Register protocol
© 2015 Steven Barth
Handling protocol repliesfile: /lib/netifd/dhcpv6.script (simpl.)1. Some Preamble
2. Declare a setup functionParse status data and turn it intonetifd configuration information
3. Declare a teardown function
4. Depending on daemon state, runsetup or teardown function
© 2015 Steven Barth
Stackable Protocols and Dependenciesconfig interface wan
option proto wwanoption pincode #code#option apn #apn#
Create interface wan_6 (dhcpv6)configure IPv6 layer 3detect if 464XLAT / DNS64 is used
Run interface wan (wwan)detect and bring up modem “link”(IPv6 modem “link” was brought up)
Create interface wan_6_4 (464xlat)configure virtual IPv4 layer 3
© 2015 Steven Barth
WiFi Featuresmulticast to unicast
generic conversion layerworkaround WiFi shortcomings
iwinfo: monitoring
status abstraction layerquery settings & capabilitiesquery associated stationsscan for nearby networks
netifd: configuration
change managementplugins to abstract driverswpad (hostapd) integration
client “pseudo-bridge”
in the absence of WDSrelayd: proxy ARP, DHCPodhcpd: proxy NDP, RA, DHCPv6
© 2015 Steven Barth
Custom IPv6 Stack
Uplink Configuration
auto-detected bootstrapmany painful ISP work-aroundsprefix distribution support
Client Configuration
designed for compatibilityoptimized power saving defaultssupport for downstream routers
Softwire support
lots of transitional technologiesencapsulation and nattingIPv4 address sharing support
© 2015 Steven Barth
Firewall
Zones
aggregation of interfacessource and destination of rulesassigned via config or protocol
Generic
event-triggered iptables rule generatorhooks and daemon integration (PCP, UPNP IGD, …)
Rules
filtering and NATstatic rules through UCI configdynamic rules from protocols
© 2015 Steven Barth
Other OpenWrt network projects in core
odhcp6c IPv6 Router Advertisement & DHCPv6+PD client
uhttpd2 http(s) daemon + json-rpc - ubus bridge
mdns DNS-SD querier & announcer
map + 464xlat MAP-E, MAP-T, LW4over6 & 464xlat implementation
umbim MBIM 3g/4g modem client
uqmi QMI 3g/4g modem client
omcproxy IGMPv3 / MLDv2 multicast proxy
© 2015 Steven Barth
QoS, SQM and Bufferbloat.net
Bufferbloat?High latency & congestion through lotsof large dumb buffers all over the data paths.
(TCP) packets clog queues → latency rises!
Solution?controlled delay (fq_codel) by defaultoptionally full smart queue management scriptsfor full control over the bottleneck
© 2015 Steven Barth
Multi-router and multi-ISP networks
What if I want to utilize multiple ISPs at once (ala multipath TCP or Google’s QUIC)?
→ IPv6 + source-address aware routing
What if I want to directly access my IOT devices without going through the cloud?
→ Layer 2 bridging? Take it to Layer 3!→ Multi Router SOHO networks
This is unmanageable… for a user!
Internet
?
© 2015 Steven Barth
Research in the IETF homenet WG...
We can build relatively universal more or less self-configuring IPv4 + IPv6 SOHO routers!
Can we take this one step further?Getting rid of WAN-port and LAN-bridge?
Can we scale this up to arbitrary networks?“Plug & Play” routers?But who “owns” the network(s)?
→ Find a consensus among equal routers→ DNCP: a distributed consensus protocol
→ Specify requirements for interoperability→ HNCP: autonomous networks using
DNCP
Firewall
DHCP
DHCPv6 6rd
LW4over6DS-LiteMAP
PCP
464XLAT
Source-Dest-Routing
?
© 2015 Steven Barth
… towards autonomous networks!→ Topology Detection
→ Border Discovery & Setup
→ Routing Setup
→ Naming & Service Discovery
→ Status Distribution
→ Security Bootstrap
Read more→ www.homewrt.org
© 2015 Steven Barth
Thank you for your attention! Questions?
Steven Barth<[email protected]>
Licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)