Getting a master's via some distance learning program is fairly easy, depending on what your shore tour work schedule is like. Mine is a bit of a challenge in that regard, as I have one of those shore tours that is "shore" only in name. Guys who go to the VT's or VP-30 typically can get time off during the week to attend grad classes so long as they are willing to come in on the occasional weekend.
Trying to do your master's during a sea tour, especially your first sea tour, would be difficult. It has been done, I know a guy who completed his on his first sea tour - but he didn't get out much. Between work, duty, and upgrading you're going to be extremely busy. If you throw grad school into that mix, very likely one of your activities is going to suffer. So, unless you really don't like to do ANYTHING social, wait till your shore tour.
I'm taking the GRE tomorrow for a program at UofWashington that I plan to start this fall (if I'm accepted). I'll be using tuition assistance from the Navy and my GI bill to pay for it (the "Top UP" program). All that I pay out of pocket will be for books and software.
Almost every person I work with is doing some sort of distance (online) master's program. Some are doing it through University of Phoenix or other schools that cater directly to the military, or through major universities. If you plan on making a career out of the Navy, you'll need a master's anyhow, so knocking it out early is good. A master's can be a fitrep bullet - it shows dedication to bettering yourself in perpetration for command.
One option, if you can get it, is to go to Navy Post Graduate School following your first sea tour. This is a great deal if you can get in. Free too! ROTC is another good place to go if you want more ed, but it generally doesn't look good in your record.
In short, there are a LOT of options for getting higher education, largely for free. There are several programs I didn't discuss. If you go to the Navy College Office on your base, they will hook you up with as much info as you want.
Again, I would caution anyone wanting to do a master's on their first sea tour. Enjoy that tour for all it is worth. Use your first shore tour to get the education you need/want. This is, of course, my opinion.
Good luck!