Internet Sharing on Leopard

I’m trying to fix up my stylesheet so I can post code and assembly more neatly.

Now that my Spring semester is over, I’ll be at home for the next 15 weeks or so. It’s a long enough time that I dedicated several hours today to setting up my workstation. At school I use my MacBook Pro exclusively, but while at home I like to multitask on my recently-upgraded iMac G5. I set it up with teleport and AirFoil, and it’s just like I plugged a third display in. (I can even turn on distcc to compile Universal Binaries faster.)

Since my parents use laptops exclusively, the home network is powered by a 802.11g Linksys wireless router. It’s fast enough for my MacBook Pro to enjoy fast, albeit sometimes intermittent, ‘net access. Unfortunately, the iMac G5 doesn’t have AirPort, and at the moment I don’t have a wireless USB adapter. It seemed like the perfect opportunity to try out OS X’s Internet Sharing.

Misadventures with Bluetooth

My first thought was that I have an unused Bluetooth USB adapter I bought on impulse. OS X seems to like it, so I thought I’d try sharing my AirPort connection over the Bluetooth PAN network device I activated under the “Advanced” sheet of the Bluetooth preference pane.

Unfortunately, though the service was offered, the iMac G5 didn’t want to connect to the MacBook Pro’s network. The menu item for it is grayed out. Google didn’t find me any valuable information to speak of. I’ll post back if I dig anything up later; this isn’t the first time I’ve tried (and failed at) sharing an Internet connection with another Mac over Bluetooth.

The Wired Route

Since the computers are only inches apart, I dug out a two-foot Ethernet cable and ran it between them, then told the MacBook Pro to share its connection through it. No luck, though, as the iMac G5 got a self-assigned IP address. Confused, I turned to the Console on the MacBook Pro and saw this repeated every ten seconds:

com.apple.launchd[1] (com.apple.InternetSharing[5303]) Exited with exit code: 1
com.apple.launchd[1] (com.apple.InternetSharing) Throttling respawn: Will start in 10 seconds

Apparently, the whenever the Internet Sharing daemon exits the system just tells it to relaunch. Needless to say, this doesn’t resolve the issue of why it quit in the first place, and just leads to an endless loop.

Manual Override

The locate command tells me that InternetSharing is in /usr/libexec/, and also that there’s a manpage on the program. The latter, in turn, tells me that the -d flag prints out debug details:

$ sudo /usr/libexec/InternetSharing -d
InternetSharing[5205]: InternetSharing starting
/etc/bootpd.plist is empty/missing
InternetSharing[5205]: 802.1X is active - exiting

I’m not entirely sure why it’s complaining about 802.1X — it shouldn’t be active at home, and I went ahead and removed all of my 802.1X profiles in the Network preference pane. This didn’t stop the daemon from complaining and stubbornly refusing to stay open.

Determined to fix the problem, I pulled out a disassembler and looked for the logic that prints out the “802.1X is active” line:

0x5906 movl 0x00007274,%eax
0x590b calll 0x00004f52 Anon42
0x5910 testb %al,%al
0x5912 je 0x00005930
 
0x5914 movl $0x00006ed5,0x04(%esp) 802.1X is active - exiting
0x591c jmpl 0x00005378

The code calls some function Anon42 which returns a boolean value of whether or not 802.1X is active. If so, it jumps to a routine that prints out and exits the program. If we altered the instruction at 0x5912 to be an unconditional jump, the program would run regardless of the state of 802.1X.

Now, there’s undoubtedly a good reason for performing this check, but since it was behaving erroneously, I went ahead and applied the patch and tried sharing again. I’m happy to report that the daemon stays open and shares the Internet connection with the iMac just fine.

Fat Pipe

To give you an idea of the relative speeds of the connections:

MacBook Pro
iMac G5

It looks like we add 20 ms to our ping and cut back the download rate by 2 MBits/sec, but otherwise the speeds are, in my opinion, respectable.

· · ·

Paper Accepted

My first paper, Defining the Dimensions of the Human Semantic Space, has been accepted as a poster at the 30th Annual Meeting of the Cognitive Science Society conference to be held in Washington, D.C. from July 23 - 28. I am second author on the paper; many thanks go to graduate student V. Dan Veksler for his guidance on the project, and to Wayne D. Gray for letting me choose my own research on the first week of classes during my Freshman year.

· · ·

Inside Rensselaer on ISTS6

Rensselaer’s Inside Rensselaer bulletin, which is sent to faculty and staff, ran an article on RPISEC’s participation in ISTS6 at the Rochester Institute of Technology. It’s a bit sensationalistic, though it couldn’t go into too much detail.

· · ·

Competitions

Since I haven’t had much to post about as of late, I’ll provide you with an update of what I’ve been doing lately:

UPE Programming Competition

From 2-5:30 PM today I participated in the UPE Programming Competition sponsored by Morgan Stanley and hosted by the Rensselaer Student Chapter of the Association for Computing Machinery. The competition consisted of 9 puzzles for participants to solve using C, C++, or Java.

Here’s a .zip of the problems, along with example inputs and outputs, grading code, and solutions. My solutions aren’t particularly well-written, so I’m not going to post them here.

I solved four puzzles and took home first place, which was a $1,000 Amazon gift certificate. The puzzles I solved were:

account (submitted 3:12:45)
Given a list of users’ last names, this puzzle required you to generate logins for a system such that each login name was the shortest unique substring of the name with an optional numeral afterwards.

maze (submitted 3:47:20)
Given a maze, output the path from the center to the exit. This consisted of parsing the input into a data structure, locating the exit, then running a pathfinding routine.

pool (submitted 4:29:02)
Given the (x, y) coordinates of a ball on a pool table along with its vertical and horizontal velocities, determine which rails the ball will collide with and which pocket it ends up in. This required a bit of algebra to solve. I worked it out mostly on paper before coding up a solution.

symtab (submitted 5:25:08)
Given a list of strings, find the shortest combination such that each input string is found in the output, and print their indices in the output string. This took me the least amount of time to solve, but the timestamp is almost an hour after pool — I implemented it very quickly, then thought a recursive solution would find a more optimal output. After wrestling with ostringstream for a while, I finally got it to work — but it exceeded the 30 second time limit. I had to spend a few minutes longer backpedaling to my iterative solution.

Information Security Talent Search 6

On March 28 and 29, my computer security team, RPISEC, participated in ISTS6 hosted by RIT. The team, consisting of Alex Radocea, Henry Filgueiras, Rob Escriva, and myself, took third place and each of us brought home a 4 GB Cruzer Professional flash drive.

The competition consisted of 5 hours of setting up a server and three attack computers. The server had to run a variety of services for the other teams to attack, such as FTP and SMTP. Points were awarded for keeping your services up or knocking your opponents’ services down. (I contacted one of the organizers for our score but they have not replied.)

I previously participated in the iCTF wargame. Other members of RPISEC participated in Polytechnic University’s CSAW 2007 wargame and took 4th place and earned the distinction of “Best Undergraduate Team.”