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

feat(compute): Use IPv4 link-local ethernet networking #1970

Merged
merged 3 commits into from
Aug 2, 2018

Conversation

btmorr
Copy link
Contributor

@btmorr btmorr commented Jul 31, 2018

overview

OT2s have been having connectivity problems for ethernet connections. It appears that we were previously using a non-standard way of assigning an IPv6 link-local address. This PR does the following:

  • use nmcli instead of ip addr to configure the port (nmcli has access to the host OS, ip addr does not)
  • assign an IPv4 address in a valid link-local address space (169.254/16 instead of fd00:0:cafe:fefe::/64)
  • modify the bind statements to work with correct link-local addressing (not able to count on all robots having one exact IP address)
  • remove radvd (only used for IPv6)

Relates to #1964

Outstanding changes (to be addressed in another PR that @mcous has already started):

  • client changes are needed to find robots with the new address range
  • make tasks need to be updated to find the robot's address rather than relying on a single static address

changelog

  • use nmcli instead of ip addr to configure the port
  • assign an IPv4 address in a valid link-local address space
  • modify the bind statements to work with correct link-local addressing
  • remove radvd

review requests

Tested on moon-moon and young-moon, robots showing up in the Run App as WiFi when they're connected over ethernet.

@btmorr btmorr added api Affects the `api` project easyfix Ticket is an easy fix; good for first time contributors labels Jul 31, 2018
@codecov
Copy link

codecov bot commented Jul 31, 2018

Codecov Report

Merging #1970 into edge will decrease coverage by 0.46%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             edge   #1970      +/-   ##
=========================================
- Coverage   32.16%   31.7%   -0.47%     
=========================================
  Files         429     430       +1     
  Lines        6867    7217     +350     
=========================================
+ Hits         2209    2288      +79     
- Misses       4658    4929     +271
Impacted Files Coverage Δ
protocol-designer/src/steplist/utils.js 90.62% <0%> (-9.38%) ⬇️
...tocol-designer/src/file-data/selectors/commands.js 19.31% <0%> (-2.56%) ⬇️
...-designer/src/top-selectors/well-contents/index.js 47.05% <0%> (-0.95%) ⬇️
...tocol-designer/src/components/steplist/StepItem.js 0% <0%> (ø) ⬆️
...tocol-designer/src/containers/ConnectedTitleBar.js 0% <0%> (ø) ⬆️
...designer/src/components/steplist/TimelineAlerts.js 0% <0%> (ø) ⬆️
protocol-designer/src/steplist/generateSubsteps.js 0% <0%> (ø) ⬆️
protocol-designer/src/containers/Alerts.js 0% <0%> (ø) ⬆️
...rotocol-designer/src/containers/SelectablePlate.js 0% <0%> (ø) ⬆️
...tocol-designer/src/components/steplist/StepList.js 0% <0%> (ø) ⬆️
... and 10 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cb7f107...6a193b7. Read the comment docs.

@btmorr btmorr requested a review from mcous August 1, 2018 16:52
@btmorr btmorr added feature Ticket is a feature request / PR introduces a feature fix PR fixes a bug medium and removed easyfix Ticket is an easy fix; good for first time contributors labels Aug 1, 2018
@btmorr btmorr removed the fix PR fixes a bug label Aug 1, 2018
Copy link
Contributor

@Laura-Danielle Laura-Danielle left a comment

Choose a reason for hiding this comment

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

🐷

Copy link
Contributor

@Kadee80 Kadee80 left a comment

Choose a reason for hiding this comment

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

🍜

Dockerfile Outdated
@@ -19,8 +19,8 @@ ENV OT_UPDATE_PORT=34000
ENV OT_SERVER_UNIX_SOCKET_PATH=/tmp/aiohttp.sock

# Static IPv6 used on Ethernet interface for USB connectivity
ENV ETHERNET_STATIC_IP=fd00:0000:cafe:fefe::1
ENV ETHERNET_NETWORK_PREFIX=fd00:0000:cafe:fefe::
ENV ETHERNET_STATIC_IP=fe80::3c68:f2a4:a5f8:58bf
Copy link
Contributor

Choose a reason for hiding this comment

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

As per our discussion, this won't work right? Should we remove this line?

@@ -4,7 +4,7 @@ SHELL := /bin/bash
PATH := $(shell cd .. && yarn bin):$(PATH)

# make push host
host ?= \[fd00:0:cafe:fefe::1\]
host ?= \[fe80::3c68:f2a4:a5f8:58bf\]
Copy link
Contributor

Choose a reason for hiding this comment

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

Rather than slot something in for host that only works for one robot, can we remove this line (or comment it out). Passing host in as a make env var will still work without it

api/Makefile Outdated
@@ -6,7 +6,7 @@ SHELL := /bin/bash
PATH := $(shell cd .. && yarn bin):$(PATH)

# make push host
host ?= \[fd00:0:cafe:fefe::1\]
host ?= \[fe80::3c68:f2a4:a5f8:58bf\]
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment about hardcoding this value

@btmorr btmorr changed the title Refactor ethernet networking on robot feat(compute): Use IPv4 link-local ethernet networking Aug 1, 2018
Copy link
Contributor

@mcous mcous left a comment

Choose a reason for hiding this comment

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

🥇 so pleased with the switch to IPv4

@@ -19,9 +19,8 @@ ENV OT_UPDATE_PORT=34000
ENV OT_SERVER_UNIX_SOCKET_PATH=/tmp/aiohttp.sock

# Static IPv6 used on Ethernet interface for USB connectivity
Copy link
Contributor

Choose a reason for hiding this comment

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

Comment now out of date but whatever

@@ -46,7 +46,7 @@ http {
root /usr/share/nginx/html;

client_max_body_size 100m;
listen local-ethernet default_server ipv6only=on;
listen [::] default_server ipv6only=on;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should ipv6only=on still be set? Or is this server block only for ipv6?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That listen statement is ipv6 only. Can be ripped out later, but it's not the worst to leave the server listening on ipv6 also even though we're not currently using it

@btmorr btmorr merged commit 094ca28 into edge Aug 2, 2018
@btmorr btmorr deleted the compute_eth-on-host branch August 2, 2018 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Affects the `api` project feature Ticket is a feature request / PR introduces a feature medium
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants