A From:	SMTP%"RELAY-INFO-VAX@CRVAX.SRI.COM" 19-JUL-1993 09:01:41.61  To:	EVERHART CC:	 Subj:	Re: SLIP   X-Newsgroups: comp.os.vms  Subject: Re: SLIP $ Message-Id: <14143197@zl2tnm.gen.nz>$ From: don@zl2tnm.gen.nz (Don Stokes) Date: 17 Jul 93 04:44:41 GMT; Sender: news@zl2tnm.gen.nz (GNEWS Version 2.0 news poster.)  Distribution: world  Organization: The Wolery
 Lines: 120 To: Info-VAX@kl.sri.com  X-Gateway-Source-Info: USENET   3 zrepachol@cc.curtin.edu.au (Paul Repacholi) writes: E > Why should I run a different protocol over say a DUP like dumb sync D > interface with a 9600 bps modem versus a dumb DL like async devise > with a 9600 bps modem?  & Simple: bit-oriented vs byte-oriented.  F In async comms, you have characters coming at you with an easy-to-spotG start bit to say when the character starts.  In sync comms, you don't;  J all you know is where the bits start and end (the modems do this; clockingG is (usually) done in the DCE and fed to the DTE, whereas in async comms 3 the clocking is done inside the UART in the DTE).     D This means that sync comms requires periodic synchronisation so that6 the two ends agree about which bits are coming when.    H There are two ways to do this: synch characters and out-of-band framing.H Synch characters are easy -- they're just characters, eight-bit patternsE that the receiver looks for when it's not sure about where in the bit G stream the characters start; typically, a packet will start with one or E more SYN characters.  Having recognised a SYN, the rest of the packet ( can be read off the bit stream as bytes.  J Out-of-band framing is a little more interesting.  Each packet both startsL and (usually) ends with a frame delimiter, usually 01111110, and usually theJ hardware is looking for this bit pattern to delimit the packet and pass itG to the software.  Because that pattern may appear in the packet data, a H technique called bit-stuffing is used, and this really requires hardwareH assistance to do efficiently.  If the sender finds six '1' bits to send,H it sends five '1's and then follows them with a '0'.  It then sends the J sixth '1' and continues.  The receiver then on receipt of five '1's checksJ the following bit; if it's a '1', this is a frame delimiter, if it's a '0'G it discards the '0' and takes the next bit as the sixth; thus six '1's  K never appear in the bit-stream except when they represent a frame delimiter  or an error.    H Most modern synchronous links these days use HDLC or SDLC, which utiliseJ the latter method.  I'm not sure what DDCMP does (I only ever just pluggedK it in and watched it go 8-).  Braindamaged protocols such as 2780 tended to G use SYN characters.  (I think I have permanent psychological scars from I staring too long at 2780/3780 traces.  Gack.  7-layer model?  Eh wassat?)   F The problem here is that sync links usually have hardware helping themJ along to do bit-stuffing, framing and often FCS computation, whereas asyncE hardware tends to be basically stupid.  If you try to model the async G protocols on the sync protocols, you find that you have to do something J special to create an eight-bit clean protocol, since you have no method ofH doing out-of-band framing (see below).  You also have to do a lot of theL stuff you were doing in hardware in software, which means that the solutions5 chosen have to be lightweight or they burden the CPU.   J Enter SLIP.  SLIP, Serial Line IP is the minimalist's minimalist protocol.H All SLIP provides is framing; it has no FCS, relying on the higher levelH protocols to decide whether a packet is bad.  (In my own SLIP code, I doI a few things to try to discard packets that might be bad, but the lack of ? a real frame check means that this checking is pretty minimal.)    This is what SLIP does:   K SLIP defines four special characters: END (0300 octal), ESC (0333), ESC_END F (0334) and ESC_ESC (0335).  Receipt of an END character terminates the8 packet.  Note that there is no packet start character.    G If an END character appears in the data stream, it is replaced with two K bytes: ESC ESC_END.  To complete the picture, and ESC character in the data # stream is escaped with ESC ESC_ESC.   H That's it.  No FCS, no protocol type, nothing but simple-minded framing.H Piss-easy to implement.  Bugger-all overhead.  Really easy to do in VMS:I just sling a bunch of largish QIOs at the terminal driver with terminator J masks specifying just the END character and what you get back are properly framed packets.   I There is one optimisation to this, which is optional, and that is to send F an END character at the beginning of each packet; this means that yourK SLIP driver gets to deal with zero-length packets, but if there's any noise F between packets, the noise and the next packet are treated as separate, things and the real packet doesn't get lost.  H SLIP is described by RFC 1055.  It includes a C code implementation, and> discussion of what SLIP doesn't do.  It's six pages long.  8-)  F There are a few gotchas with SLIP: since there is no frame checking inH the protocol, your higher level protocols had better check their packetsF themselves, and in UDP checking the checksum field is *optional*.  NFSE for example can be used without UDP checksums, but you should be able G to turn UDP checksumming on in your NFS implementation.  TCP does check  what it's doing.      I PPP is a bit more complex, and includes most of the features found in the K synchronous protocols.  Packets are frame-checked and bad packets discarded K before being passed up the protocol stack, and there is a packet type field @ to allow more than one protocol to be forwarded over a PPP link.  E There are PPP versions for both sync and async lines; the async stuff B includes dealling with things like XON/XOFF flow control and otherH nastyness intended for dealling with character oriented terminals ratherF than packet oriented network links.  However, PPP has more overhead onH async serial links than SLIP, both in terms of bytes sent and processingH required.  If you're just shipping IP around the place, SLIP is easiest,9 most common and lowest overhead, but has a few caveats.     K One other factor in all this is TCP header compression.  A single keystroke G in a telnet session gets sent with 20 bytes of IP header and another 20 J bytes of TCP header as well as any data-link layer overhead.  Van JacobsonI TCP header compression can collapse that 40 byte overhead into four bytes J (plus data plus DLL overhead) using the principle that very little in thatI 40 bytes actually changes from packet to packet and you only need to send G what changes plus the checksum.  This makes telnet sessions over 9k6 or C worse links beareable.  Since SLIP lacks a protocol type field, TCP J compression on SLIP links has to be implemented in the SLIP driver, ratherJ than implementing it separately and passing the compressed packets to SLIPJ as a separate protocol.  RFC 1144 describes how all this works.  (There's H a section entitled "Compatibility with past mistakes" that describes theJ hackery required to do this -- I've implemented SLIP with TCP compression,# and yes, it is a bit yucky.... 8-)     --O Don Stokes, CSC Network Manager, Victoria University of Wellington, New Zealand O Ph+64 4 495-5052  Fax+64 4 471-5386  Work:don@vuw.ac.nz  Home:don@zl2tnm.gen.nz   