Image of the glider from the Game of Life by John Conway
Skip to content

Firewire Networking In Linux

Today, I had the need to transfer a great deal of data from my wifes old iBook to my T61. As I sat down, I plugged in my USB 2.0 hard drive, and begin transferring the data. 3 minutes later, it's finished. Now, to plug it in to my T61 and repeat the process. This is taking too long. There has to be a faster solution. First, I thought about wireless. Both of our laptops have 802.11g, but that's only 54 Mbps, vs 480 Mbps with USB 2.0. That would take substantially longer. We both have 10/100 NIC cards, so 100 Mbps is better, but no where near USB 2.0. Then I recognize the Firewire ports, and remember reading years ago that you could network Firewire devices. At 400 Mbps, this seems to be a good solution if I can ad hoc the laptops.

After a Bit O' Google, I find the answer. First I needed to load the eth1394 driver into the kernel (and ieee1394 if not already):

aaron@kratos:~ 6673 % sudo modprobe eth1394
aaron@kratos:~ 6674 % lsmod | grep 1394    
eth1394                22024  0 
ohci1394               36532  0 
ieee1394              106968  3 eth1394,sbp2,ohci1394

Now, I have a new eth1 device, of which I can set an address to.

aaron@kratos:~ 6675 % ip addr show eth1
6: eth1:  mtu 1500 qdisc noop qlen 1000
    link/ieee1394 00:06:1b:03:2a:11:22:51 brd ff:ff:ff:ff:ff:ff:ff:ff
aaron@kratos:~ 6676 % sudo ifconfig eth1 10.19.84.1 netmask 255.255.255.0 up
aaron@kratos:~ 6677 % ip addr show eth1
6: eth1:  mtu 1500 qdisc pfifo_fast qlen 1000
    link/ieee1394 00:06:1b:03:2a:11:22:51 brd ff:ff:ff:ff:ff:ff:ff:ff
    inet 10.19.84.1/24 brd 10.19.84.255 scope global eth1

Now, to do the same on my wife's iBook. Because she's running Mac OS X, I'm not too terribly familiar with the tools on the command line, so, I'll pop into the GUI. First, I need to open up System Preferences and click on Network. Then listed is Firewire Networking. I'll click that and setup my connection manually, giving it the IP address of 10.19.84.2 with the same netmask of 255.255.255.0. Now to test the connection from my T61:

aaron@kratos:~ 6678 % ping -c 2 10.19.84.2
PING 10.19.84.2 (10.19.84.1) 56(84) bytes of data.
64 bytes from 10.19.84.2: icmp_seq=1 ttl=64 time=0.492 ms
64 bytes from 10.19.84.2: icmp_seq=2 ttl=64 time=0.476 ms

--- 10.19.84.2 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.476/0.484/0.492/0.008 ms

Success! Now, to transfer my file. I setup an SSH server on my T61 listening on all interfaces, so, from the terminal on the iBook, I could issue the following command:

athena:~ aaron$ scp ubuntu-8.04-dvd-i386.iso 10.19.84.1:~
-snip-
aaron@10.19.84.1's password:
ubuntu-8.04-dvd-i386.iso                      100% 3795MB  25.5MB/s   02:29

While definitely better than copying it from iBook to external hard drive, than external hard drive to T61, I was disappointed in the performance. Only 25.5MBps? I thought ieee1394a had 400Mbps, or 50MBps theoretical max. And I'm only getting half? I hope it's compression that's slowing it down. I may spend some time digging deeper to see if I can get a faster speed.

At any event, the file was transferred only once, and I was able to take advantage of the fastest speed I had available- networking with Firewire.

{ 16 } Comments

  1. jegHegy using Opera 9.50 on GNU/Linux | June 1, 2008 at 4:26 pm | Permalink

    The bottlenecks are most probably the HDDs.

  2. vom using Firefox 3.0b5 on GNU/Linux | June 1, 2008 at 4:48 pm | Permalink

    I vote the bottleneck is scp.

    http://www.psc.edu/networking/projects/hpn-ssh/

    I typically (temporarily) install/run a plain old FTP server for these kinds of xfers. It's always faster than scp. So fast in one case I got kcryptd jammed up because the transfer was faster than the encrypted disk could handle. If you're curious, pick an ftp server and temporarily enable it and ftp over your firewire connection.

  3. EnsGabe using Konqueror 3.5 on Kubuntu | June 1, 2008 at 5:45 pm | Permalink

    Did it take you more than 2-3 minutes to set up the firewire network? If so, I don't think you gained any time over using plain 100MB/s ethernet :) In addition, rsync with daemons running on both ends will skip over encrypting the data stream.

  4. Yuriy using Konqueror 3.5 on Kubuntu | June 1, 2008 at 5:53 pm | Permalink

    Good to know this works now. I tried it before (on Edgy, maybe Feisty too) and the system would freeze when I tried to configure the interface. I'll have to give it another try.

  5. Matt Mossholder using Firefox 3.0b5 on GNU/Linux 64 bits | June 1, 2008 at 7:22 pm | Permalink

    If you are stuck with SSH for one reason or the other, try using the "-c blowfish" switch... blowfish is a lot less computationally intensive, and has been known to speed up transfer rates.

  6. Aaron using Firefox 3.0 on GNU/Linux 64 bits | June 1, 2008 at 8:54 pm | Permalink

    @jegHegy- That was my first guess, however, both drives are rated above that speed.

    @vom- Nah. Both computers have a decent amount of computing power. They should be able to process the encryption decryption pretty fast without affecting much in performance.

    @EnsGabe- That's not the point. The point is to hack and learn, not gauge the value of my time.

    @Yuriy- Yeah, give it a shot. I didn't have a single hiccup during the process. Worked like a charm right out of the box, just like Ubuntu should.

    @Matt Mossholder- I'll give that a try, but I doubt I'll see much in the way of performance. Worth a shot though.

  7. Chris Nava using Firefox 3.0 on Mac OS | June 1, 2008 at 9:12 pm | Permalink

    The iBook has a "Target Disk Mode" which turns it's internal disk drive into an external firewire drive on your other machine... You should be able to get even faster transfer with this.

  8. giz404 using Firefox 2.0.0.14 on Windows XP | June 2, 2008 at 3:01 am | Permalink

    Nice tip ! I have a laptop running Ubuntu at home and an iMac, and file transfer via wifi is a pain.
    I'll try that solution .

  9. Feng Wai using Minefield 3.0pre on Windows XP | June 2, 2008 at 8:25 am | Permalink

    The problem is that many hard drives can't cope with the data transfer speed, thus limiting the benefit.

  10. vom using Firefox 3.0b5 on GNU/Linux | June 2, 2008 at 10:12 am | Permalink

    What I was really trying to say, is that it is a known issue that ssh/scp has an inherent disadvantage wrt throughput. Doesn't really matter how much computing power you have. Like I said, run a plain old ftp and see the difference.

  11. Joseph Scott using Firefox 2.0.0.14 on Mac OS | June 2, 2008 at 10:39 am | Permalink

    I second Chris Nava's suggestion. Just reboot the iBook in target disk mode and plug it in, at which point it looks like any other firewire drive.

  12. Colin using Firefox 3.0b5 on GNU/Linux 64 bits | June 4, 2008 at 2:09 am | Permalink

    It's your hard disks... With a crossover cable between two ASUS laptops that have GB eth, I get 19MB/s. With a crossover cable between two Dell *servers* with GB eth and 10k RPM SCSI disks, I get 49MB/s.

  13. Sean Harlow using Firefox 3.0 on Mac OS | June 11, 2008 at 8:50 pm | Permalink

    @Colin: that's not exactly a fair comparison though. I just did 25MB/sec over GigE from my laptop (2.5GHz Macbook Pro, 7200 RPM SATA, OS X 10.5.3) to my home server (homebrew 2.0GHz AMD, multiple 7200 RPM SATA and IDE using Linux LVM, Debian 4.0) with SCP. The same transfer from my desktop (homebrew 2.0GHz AMD, single 7200RPM SATA, Ubuntu Linux 8.04) hits around 28MB/sec.

    In your server comparo, there's probably a nice RAID controller and hardware offload capable Ethernet cards, where no laptop and few home desktops will have either.

  14. Cheerios using Firefox 3.0.4 on Ubuntu 64 bits | December 3, 2008 at 7:58 pm | Permalink

    Speed - the quest if never-ending :D

    Try reading the file and piping it through NC -U (Netcat over UDP) - on a two terminal network your packet loss should be nonexistent (fingers crossed)

  15. Linda using Firefox 3.6.12 on Ubuntu | November 7, 2010 at 7:11 pm | Permalink

    Your blog helped me to get Firewire LAN working between my laptop running Windows XP SP 2 + Ubuntu 10.10 and my desktop running Windows XP SP2.

    I got it working first with Windows.

    One thing that I found that I *assumed* that eth1 would be my Firewire card just as it was for you, but it wasn't. firewire0 was my Firewire card. eth1 for me was my wireless card. So, just wanted to point this out.

  16. Thomas using Firefox 3.6.18 on Windows XP | July 26, 2011 at 10:04 am | Permalink

    I would tend to agree with Feng Wai about one of the bottlenecks being the drive(s) themselves. (Sequential read speed is usually better than write speed too particularly on large files which don't benefit from the cache embedded within the drive). I've got a slightly more advanced setup and was transferring from a windows 7 pro (multiple 15+GB files) and averaged around 70-80MB/s (560Mbps - 640Mbps) over a GigE link attached to a switch. Both ends were operating on the on-board ethernet ports of GigaByte MBs. On the other end from the windows7 box is an ubuntu linux server with ext4 over lvm2 over 256bit crc encryption over lvm over software raid5 residing across (5) 1TB WD green harddrives (5400rpm). The reason that this was sped up had nothing to do with the processing power (only minimal load on each end) and much more to do with the data being written simultaneously to 4 separate drives (plus 1 for parity = 5 total). I'm even thinking about adding 5 more drives to the array and converting it to raid 6 in the process :-D.

Post a Comment

Your email is never published nor shared.

Switch to our mobile site