Skip to content

Conversation

@henry54809
Copy link
Collaborator

No description provided.

@henry54809 henry54809 requested a review from grafnu November 19, 2020 02:46
@codecov
Copy link

codecov bot commented Nov 19, 2020

Codecov Report

Merging #714 (5157e87) into master (2756daa) will increase coverage by 0.49%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #714      +/-   ##
==========================================
+ Coverage   81.97%   82.46%   +0.49%     
==========================================
  Files          29       29              
  Lines        4128     4147      +19     
==========================================
+ Hits         3384     3420      +36     
+ Misses        744      727      -17     
Flag Coverage Δ
aux 74.80% <70.83%> (+0.18%) ⬆️
base 77.14% <100.00%> (+0.15%) ⬆️
dhcp 73.47% <70.83%> (-0.03%) ⬇️
many 73.76% <70.83%> (-0.20%) ⬇️
topo 72.29% <70.83%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
daq/test_modules/native_host.py 94.02% <ø> (+3.88%) ⬆️
daq/network.py 97.32% <100.00%> (+0.11%) ⬆️
daq/test_modules/external_module.py 96.82% <100.00%> (+0.42%) ⬆️
daq/host.py 91.14% <0.00%> (+0.15%) ⬆️
daq/runner.py 90.76% <0.00%> (+1.29%) ⬆️
daq/base_gateway.py 94.59% <0.00%> (+2.70%) ⬆️

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 2756daa...5157e87. Read the comment docs.

@henry54809
Copy link
Collaborator Author

PTAL

mininet_subnet:
base_ip: 10.20.0.0
prefix_length: 16
# default test host subnet
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this default or internal? They have slightly different meanings -- just wondering about congruence. I'm fine either way (don't actually know what it's used for), but would at least want the comment to match the field :-)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This matches the default specified in code so I put the default in comment here. This is used when instantiating a mininet network. http://mininet.org/api/classmininet_1_1net_1_1Mininet.html#a1ed0f0c8ba06a398e02f3952cc4c8393
I thought of 1 issue where test hosts and devices' IPs may conflict. If mininet assigns test host an IP (it usually just increments from the subnet) and external DHCP server assigns the same IP to a device; this was why I made the mininet's subnet configurable.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Re: default vs. internal -- it's very confusing as written so please update to make it more clear.

Don't the test hosts have to be on the same subnet as the device? If not, then the device will try to send the test host traffic to the gateway mac address which would fail? I guess I don't understand the scenario... Might need a conversation outside of this PR (not sure it directly impacts this PR either).

daq/network.py Outdated
subnet_str = "%s/%s" % (subnet['base_ip'], subnet['prefix_length']
) if subnet else DEFAULT_MININET_SUBNET
self._mininet_subnet = ip_network(subnet_str)
subnet = config.get('mininet_subnet', self.DEFAULT_MININET_SUBNET)
Copy link
Collaborator

Choose a reason for hiding this comment

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

mininet_subnet?

// For specifying ip subnets assigned by external DHCP server
repeated IpSubnet external_dhcp_subnets = 54;
// For specifying ip subnets assigned by external DHCP server / static ips
repeated string external_subnets = 54;
Copy link
Collaborator

Choose a reason for hiding this comment

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

in terms of future-proofing, can you think of any potential information (properties) we'd maybe need to keep along with the subnet? E.g., DNS server or some other property? I can't specifically think of something -- just asking the question to make sure we're considering things. In general, having this be an object (not necessarily IpSubnet but maybe something like SubnetSpec) makes the system more flexible in the future since we can then add a property to each entry. If it's encoded as a string, then there's no path forward for adding annotations.

In the past, every time I've done something like "a list of strings" then I end up regretting it because I often then want to add some kind of information to it and then you're SOL.

@henry54809
Copy link
Collaborator Author

PTAL

@henry54809 henry54809 merged commit 0a9fd52 into faucetsdn:master Nov 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants