View Single Post
  #3   Spotlight this post!  
Unread 12-02-2012, 11:34
LukeS LukeS is offline
4272 mentor, 1024 alumnus
AKA: Luke Shumaker
FRC #4272
Team Role: Mentor
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Indianapolis, IN
Posts: 60
LukeS is an unknown quantity at this point
Re: Java to Crio Downloading Issues

Quote:
Originally Posted by austin1743 View Post
ok cool,

i have the cRio at 10.17.43.2

and the computer at 10.17.43.5 (i believe)


what is the correct range?
By range, he means the same IP subnet.

How IP subnets work is if you look at the IP address and subnet mask in binary, the 1s in the subnet mask mean that that bit of the address is part of the the network address, and 0s in the subnet mask mean that that bit of the address is part of the the node address. So, they are in the same subnet if all of the network bits in the IP address are the same.

So,
Code:
// pseudo-code
// Addresses in binary
cRIO   = 10.17.43.2   ; // 00001010.00010001.00101011.00000010
laptop = 10.17.42.5   ; // 00001010.00010001.00101011.00000101
netmask= 255.255.255.0; // 11111111.11111111.11111111.00000000

// binary and
cRIO_network = cRIO & netmask
laptop_network = laptop & netmask;

println(" > "+cRIO_network); println(" > "+laptop_netowork);
 > 00001010.00010001.00101011.00000000
 > 00001010.00010001.00101011.00000000

println(" > "+(cRIO_network == laptop_network))
 > true
Without doing any binary math, though, if the subnet mask is all 255s and 0s, you can tell easily; 255 means that octet is network, and 0 means node. A mask of "255.255.255.0" means that your range is "10.17.42.*".
Reply With Quote