You are not logged in. Login Now
 0-13          
 
Author Message
ball
Direct Connections Mark Unseen   Jan 4 05:31 UTC 2007

An item for the discussion of direct connections between
computers...
13 responses total.
ball
response 1 of 13: Mark Unseen   Jan 4 05:34 UTC 2007

On a unix system (I use NetBSD, but data points from other
systems are welcome), what is the drill for connecting two
hosts together using SLIP?  I have an appropriate DTE-DTE
"null modem" cable in place and I've tested it using an
ordinary tty login. Assuming the kernels at each end support
SLIP, is it just a question of running slattach at each end
and then using something like ifconfig to assign an IP
address to each end of the cable?
maus
response 2 of 13: Mark Unseen   Jan 4 14:42 UTC 2007

I have never worked with NBSD, but if memory serves me correctly, you
would first have to make sure you have slip support in your operating
environment's kernel, then plumb your slip0 interface, set up your
/etc/hostname.slip0 with your IP number and your peer's IP number, set
your route and then run your slip programme (slattach, I guess). 
maus
response 3 of 13: Mark Unseen   Jan 4 15:08 UTC 2007

http://www.netbsd.org/guide/en/chap-net-practice.html#chap-net-practice-p
2p-via-serial
nharmon
response 4 of 13: Mark Unseen   Jan 4 15:29 UTC 2007

I'm curious why anybody would make such a connection these days.
Wouldn't it be easier and faster to connect them using a crossover
ethernet cable?
maus
response 5 of 13: Mark Unseen   Jan 4 16:10 UTC 2007

If the device does not have a typical network interface, or if it has a
network interface for which drivers are not available, it would be
appropriate. Additionally, this may be done as a learning opportunity. 
ball
response 6 of 13: Mark Unseen   Jan 4 23:07 UTC 2007

Re #3: That's almost identical to what I tried.  Perhaps my
  default route is sending datagrams barking up the wrong
  tree though.  I'll have a tinker when I get home.

Re #4: I anticipate doing some work on boards that lack a
  wired network port, so...

Re #5: Spot on: I want to learn how to do it.
gull
response 7 of 13: Mark Unseen   Jan 5 23:46 UTC 2007

If learning is your goal, I'd also suggest playing with PPP a bit as 
well.  It's actually quite easy to get a PPP connection going between 
two computers, and turning up the logging level and watching how they 
negotiate the connection settings is pretty educational.  PPP is in 
much more common usage than SLIP, these days.
maus
response 8 of 13: Mark Unseen   Jan 6 00:02 UTC 2007

PPP is worth learning, but I would recommend learning SLIP first, as it
will give some perspective on where the peculiarities of PPP come from,
once you see the deficiencies that they were invented to address. I also
strongly recommend that you read _TCP/ip_Illustrated_ by Stephens and
_IP_Routing_Fundamentals_ by Sportack. 
ball
response 9 of 13: Mark Unseen   Jan 6 01:17 UTC 2007

SLIP seems cleaner than PPP, especially since the payload is
strictly IP.  I have used PPP with a modem before, but never
over a direct cable connection.  I'll keep it in mind as a
potential future experiment though.

I got SLIP working between two hosts by making ifconfig.sl0
files in each machine's /etc directory containing...

   ! /sbin/slattach -h -s 115200 /dev/tty00
   inet 192.168.3.128 192.168.3.129 up

           ...but with the IP addresses reversed at one end.
maus
response 10 of 13: Mark Unseen   Jan 7 00:47 UTC 2007

Sweet. Thanks for posting your solution. 

NBSD uses /etc/ifconfig.${ifname}? I thought the BSD standard was
/etc/hostname.${ifname}. One learns something new every day. 
ball
response 11 of 13: Mark Unseen   Jan 7 05:21 UTC 2007

I find ifconfig.{if} more intuitive.

  ,-------------,          ,-------------,
  |tinman       |          |almond       |
  |             |          |             |
  |192.168.3.129|---slip---|192.168.3.128|     to LAN,
  |             |          |192.168.0.254|---> router etc.
  `-------------'          `-------------'

As a temporary measure while I'm setting up software on
tinman, I would like almond to forward datagrams from its
SLIP interface out through the 10baseT port onto the LAN and
to accept datagrams for tinman from the LAN and forward them
down the right hole.  I understand that I need to use proxy-
arp on almond so that it's MAC address is provided when some
-one tries to look up tinman.  What should I use to forward
the datagrams though?  NAT need not apply.
maus
response 12 of 13: Mark Unseen   Jan 7 16:52 UTC 2007

You can set up almond to act as a router and advertise a route to
192.168.3.128/30 (you need to give it a /30, not a /31, since you lose
one address to the wire and one to the broadcast for any netblock, even
if a wire and broadcast are silly on a point-to-point link). I believe
all of the versions of BSD come with routed, which you can use to
accomplish this. 
gull
response 13 of 13: Mark Unseen   Jan 9 03:04 UTC 2007

Re resp:9: If you're only carrying IP, and only between two hosts, SLIP 
is indeed simpler.  (In fact, it's about as simple as it could possibly 
get.)  It gets messy in a hurry if you have to support multiple peers, 
though, because it has no support for things like automatically 
assigning IP addresses.
 0-13          
Response Not Possible: You are Not Logged In
 

- Backtalk version 1.3.30 - Copyright 1996-2006, Jan Wolter and Steve Weiss