Go to Post With FIRST, its all about style! In the northeast, we are alllll style. - Andy Grady [more]
Home
Go Back   Chief Delphi > Technical > Control System > FRC Control System
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 11-07-2016, 17:37
Ryan_Todd's Avatar
Ryan_Todd Ryan_Todd is offline
ye of little faith
FRC #0862 (Lightning Robotics)
Team Role: Mentor
 
Join Date: Apr 2006
Rookie Year: 2005
Location: Plymouth, MI
Posts: 114
Ryan_Todd has a reputation beyond reputeRyan_Todd has a reputation beyond reputeRyan_Todd has a reputation beyond reputeRyan_Todd has a reputation beyond reputeRyan_Todd has a reputation beyond reputeRyan_Todd has a reputation beyond reputeRyan_Todd has a reputation beyond reputeRyan_Todd has a reputation beyond reputeRyan_Todd has a reputation beyond reputeRyan_Todd has a reputation beyond reputeRyan_Todd has a reputation beyond repute
The IP Address Paradox

Original thread:
"What is the strangest issue with a robot you have ever seen?"

This thread:
I read the following post (full text in the above thread), and it got me thinking.


Quote:
Originally Posted by Aaron.Graeve View Post
Lone Star this year (I was FTAA). One robot refused to connect to the Driver Station, and the Driver Station refused to connect to FMS. As it was practice day, we were willing to take extra time and figure out what the issue was.

...snip...

Fast forward 30 minutes, still no progress. We have re-run FMS pre-start at least 4 times; the 5 other robots come up fine, but this Driver Station and robot refuse to budge. The team is understandably panicking that they may not be able to compete at all. As a shot in the dark, I turn to the FTA and ask if the Field could be getting a 10.41.*.* IP address from the convention center. As it turns out, the field was getting a 10.41.255.* address with a subnet that conflicted with the 10.41.55.* addresses that the team needed to use.

5 minutes later, the problem is resolved and both of the teams laptops are working fine. The Field exterior IP address is usually checked during setup day for possible conflicts, but must have been missed for some reason. The team was extremely grateful for the resolution and was patient and helpful the entire time.

TL;DR:
A 1 in ~650,000 chance that the FMS wants your IP as its IP.
(emphasis mine)


That may sound like it's practically impossible, but I'm pretty sure that's not the case.
For a quick refresher of the concepts involved, here's a closely related example from your everyday life: The Birthday Paradox.
Anyhow, I was struck with inspiration...
This is just the kind of question that can only be answered one way: MATH!

-------------------

If there is a "1 in ~650,000 chance" that any given team will experience an IP address conflict with the FMS, then there's a ~(1 - (1 / 650,000)) = ~99.99985% chance that any given team will *not* experience such a conflict at any given event.
Note: I'm electing to work backwards from this number, as opposed to using the probability of a conflict (1/650,000) directly; otherwise, we'd pretty much end up solving for the Nth root of the number of molecules in an unladen swallow.
.
Since the FRC rule for assigning team IP addresses means that we don't have to worry about conflicts *between* teams, the odds of a conflict happening at an event with 66 teams are best expressed as (1 - (~0.9999985 ^ 66)) = ~0.01015%.
Also note that my actual math uses way more sig-figs than I've shown in this post. Since all of this math is only based on rough numbers in the first place, however, this works out just fine.
.
That may sound pretty unlikely, but what happens if we expand all of the way out to the scope of an entire FRC season? We'll need to know the number of times an FMS received a new IP address, and the number of teams that connected to each of these IPs.

Counting events with multiple competition fields like MSC and CMP, teams competed on a freshly configured FMS no less than 137 times this past season; depending on whether or not each FMS got a new IP on Saturday morning, there may have been as many as 272 unique IP addresses used by competition FMS setups this season (note that the Einstein fields only operated for one day each). Of course, this ignores any possible field resets mid-day due to technical difficulties!

As for the number of teams that connected to each FMS, I can't seem to find a solid number for the average number of teams per FMS. Since I didn't feel like making a Dropbox account just to pull up Jaci's Data Dump, I just spent a few minutes clicking around the event results listing at random; this (completely unscientific) survey pointed to an average around 50.

.
Taking all these numbers together, we get a lower estimate somewhere around (1 - ((0.9999985 ^ 50) ^ 137)) = 1.05% and an upper estimate around (1 - ((0.9999985 ^ 50) ^ 272)) = 2.07%.

-----------------

TL; DR:
There was at least a 1% chance of a robot-to-FMS IP conflict happening to somebody during the 2016 competition season; still not exactly likely, but well within the realm of possibility.

Now, how many shared birthdays do we have among this year's robots?
__________________

Last edited by Ryan_Todd : 11-07-2016 at 17:41. Reason: formatting
Reply With Quote
  #2   Spotlight this post!  
Unread 11-07-2016, 18:04
Aaron.Graeve Aaron.Graeve is offline
Registered User
FRC #1477 (Texas Torque)
Team Role: Alumni
 
Join Date: Jan 2012
Rookie Year: 2012
Location: College Station, Texas
Posts: 103
Aaron.Graeve is a name known to allAaron.Graeve is a name known to allAaron.Graeve is a name known to allAaron.Graeve is a name known to allAaron.Graeve is a name known to allAaron.Graeve is a name known to all
Re: The IP Address Paradox

I think I should chime in with why I spit-balled the 1 in 650,000 odds. I was basing this on some (rather shaky) assumptions about DHCP, scorekeeper tendencies, and the reader.

For the sake of laziness, I assumed that the IP addresses the FMS is handed by DHCP are uniformly distributed at least in the first two bytes. I also assumed that the reader (the "your" in the quote) has one team association and does not care about the other teams. Lastly, I assumed that scorekeepers check for an IP conflict 9 out of every 10 times they should (i.e. they forget 10% of the time).

In order for a reader's specific team to get an IP and subnet conflict using the assumptions above, the first octet of the IP would need to be 10 (a 1 in 256 chance), the second octet would need to be the reader's team's first two digits as applicable (another 1 in 256), and the third octet would need to be different from the last two digits of the reader's team number (255 out of 256). Taken together and based on the assumptions given, there should be a 1 in ~65,700 chance that the IP FMS gets from DHCP will conflict with a specific team IP (I truncated to two sig-figs just because). Given that the scorekeeper/FTA will catch an IP conflict 9 out of every 10 times, the odds that a conflict would impact a specific team would be reduced to 1 in ~650,000.

Overall, it is a very small chance that it will happen to you, but a not so small chance that it will happen to someone.

Another good example of the birthday paradox. Props to OP for the math and teachable moment.
__________________

2016:
Alamo, Bayou, and Lone Star Regional FTAA
2015:
Dallas, Alamo, Bayou, and Lone Star Regional FTAA
2014:
Alamo, Dallas, and Lone Star Regional FTAA
Alamo Regional Robot Inspector
2013:
Einstein Champion and 2013 World Champion (Thanks 1241 & 610), Galileo Division Champion, Razorback Regional Winner, Alamo Regional Semifinalist, Bayou Regional Semifinalist, Lone Star Regional Quarterfinialist
2012:
Curie Division Semifinalist, Lone Star Regional Finalist, Bayou Regional Winner, Alamo Regional Winner

Last edited by Aaron.Graeve : 11-07-2016 at 18:09. Reason: Formatting
Reply With Quote
  #3   Spotlight this post!  
Unread 12-07-2016, 11:39
AllenGregoryIV's Avatar
AllenGregoryIV AllenGregoryIV is offline
Engineering Coach
AKA: Allen "JAG" Gregory
FRC #3847 (Spectrum)
Team Role: Coach
 
Join Date: Jul 2008
Rookie Year: 2003
Location: Texas
Posts: 2,545
AllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond repute
Send a message via AIM to AllenGregoryIV
Re: The IP Address Paradox

That math all assumes the odds of any number in the first octet are equal when in fact at most venues the FMS is likely to be given a private IP (https://en.m.wikipedia.org/wiki/Private_network) so 10, 172, or 192 are far more likely to start the address then say 1 or 254.
__________________

Team 647 | Cyber Wolf Corps | Alumni | 2003-2006 | Shoemaker HS
Team 2587 | DiscoBots | Mentor | 2008-2011 | Rice University / Houston Food Bank
Team 3847 | Spectrum | Coach | 2012-20... | St Agnes Academy
LRI | Alamo Regional | 2014-20...
"Competition has been shown to be useful up to a certain point and no further, but cooperation, which is the thing we must strive for today, begins where competition leaves off." - Franklin D. Roosevelt
Reply With Quote
  #4   Spotlight this post!  
Unread 19-08-2016, 16:18
cpapplefamily cpapplefamily is offline
Registered User
FRC #3244 (Granite City Gearheads)
Team Role: Mentor
 
Join Date: May 2015
Rookie Year: 2015
Location: Minnesota
Posts: 232
cpapplefamily has a spectacular aura aboutcpapplefamily has a spectacular aura about
Re: The IP Address Paradox

I wonder if this has something similar to do with our experiences a few weeks ago with our robot, driver station, and Kangaroo. This is a alink to the start of the discussion. https://www.chiefdelphi.com/forums/s...1&postcount=19
It starts at post #19 and continues from there
https://www.chiefdelphi.com/forums/s...=149295&page=2
Reply With Quote
  #5   Spotlight this post!  
Unread 19-08-2016, 17:13
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,695
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: The IP Address Paradox

Quote:
Originally Posted by cpapplefamily View Post
I wonder if this has something similar to do with our experiences a few weeks ago with our robot, driver station, and Kangaroo. This is a alink to the start of the discussion. https://www.chiefdelphi.com/forums/s...1&postcount=19
It starts at post #19 and continues from there
https://www.chiefdelphi.com/forums/s...=149295&page=2
I can't say this was the problem, but each of the IPs you chose for your Kangaroo are incorrect for field use.

Keep the last numbers .5 or greater and less than or equal to .19. 5<=IP<=19
The field begins assigning DHCP addresses at .20, but is not necessarily assigning them sequentially. Any static IP you use between .20 and .200 can randomly produce a conflict.
It's quite likely that your Driver Station or roboRIO was receiving a duplicate .20 address.

Static IPs for the Kangaroo, but dynamic IPs for the Driver Station and roboRIO will also prevent it from working with the competition pit/home dynamic IPs of 169....
For your use case I would recommend that you keep everything at consistent 10.TE.AM static IPs, both for at home and for competition.
Don't worry about your robot radio IP. You can leave it at the setting given it by the home or competition radio kiosk.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 19-08-2016 at 18:26.
Reply With Quote
  #6   Spotlight this post!  
Unread 19-08-2016, 17:52
cpapplefamily cpapplefamily is offline
Registered User
FRC #3244 (Granite City Gearheads)
Team Role: Mentor
 
Join Date: May 2015
Rookie Year: 2015
Location: Minnesota
Posts: 232
cpapplefamily has a spectacular aura aboutcpapplefamily has a spectacular aura about
Re: The IP Address Paradox

Through that thread we adapted team 900 zebra vision iP assignments. Post #22 https://www.chiefdelphi.com/forums/s...6&postcount=22
It uses the ranges that you explain. The biggest trouble we haven't uncovered was why in the pits after configured the radio for the event we had no driverstational to roborio comms everything else seemed ok. We panicked before the first match and removed everything but the radio and Rio to get comms. Never tested on the field and worked fine when we got back home before re-configuring the radio.
Reply With Quote
  #7   Spotlight this post!  
Unread 19-08-2016, 18:55
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,695
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: The IP Address Paradox

There might have been an unanticipated problem in your setup mixing USB communications with Ethernet communications.

When you use a USB connection between the Driver Station and the roboRIO (through that UNITEK USB device or direct) that introduces yet another IP address that can break your setup.
The DS USB to roboRIO uses a hardcoded 172.11.22.1 IP address scheme.
That's fine for DS to roboRIO communication, but would not allow your DS to communicate directly with either the Kangaroo or the IP camera.
There's nothing in the communication path that can bridge 172. addresses to 10. addresses.
If the DS doesn't interface with either of those, then it won't matter. If the DS does then it would work when the DS was communicating wirelessly or through an Ethernet tether, but not in the pits at competition or at home when connected via a USB tether.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 19-08-2016 at 19:03.
Reply With Quote
  #8   Spotlight this post!  
Unread 19-08-2016, 19:27
cpapplefamily cpapplefamily is offline
Registered User
FRC #3244 (Granite City Gearheads)
Team Role: Mentor
 
Join Date: May 2015
Rookie Year: 2015
Location: Minnesota
Posts: 232
cpapplefamily has a spectacular aura aboutcpapplefamily has a spectacular aura about
Re: The IP Address Paradox

We kind of sniped the original post topic. I would love to continue the conversation maybe over in my original thread? I'm not quite following the last post. In the pits we had DS to Kangaroo, DS to IP camera, but no DS to Roborio.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 21:17.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi