Networking Basics

FTP
Networking
List of

Computers

Shell Accounts
UNIX
Windows
Command

Prompt

Ports
Comp

Security

Weboard

Links
Tutorials

& Games

Visual Basic
My Programs
Sign
Guestbook

View

Guestbook

Welcome, I am going to try and cover as much as I can of what I think will be useful to you.  If there is something you want to know about and you think I missed, let me know and I will see if I can help.  Also if you are interessted in how the wire works again let me know by posting a message on the web board and I will write a page.  Enjoy what I 've got so far :)  After being asked many times I would like to confirm that these pages are by me and is all the stuff that I have learned from reading and from what I do for a living.

Ok, we will start with a few terms and what they mean.  You really should get an understanding of these.

Analogue A type of transmission in which a continuously variable signal encodes and infinite number of values of the information being sent. Uh huh What the means in English.  Electrical signals representing sound ie, the phone lines.   Analogue travels at a max speed of 33.6k.  So if you get a 56k modem and plug it into your phone line you ain't gonna be getting 56k connection speeds.
Digital A type of transmission that encodes a discreet value for each unit of information being sent. ie you data is transmitted in 1's and 0's and you can reach high speeds depending on the wire.
Binary A base 2 counting system, consists only of 1's and 0's.
Octal A base 8 counting system, consists of the digits 0 to 7.
Decimal A base 10 counting system.
Hexadecimal A base 16 counting system, consists of the digits 0 to 9 and a to f.  Most command system that is used with computers.
Bit (b) A single unit of two state digital information.   Holds either a 0 or a 1.  Foundation of the binary number system.
Nibble A group of 4 bits, can hold the values 0 to 15.
Byte A group of 6, 8 or 10 bytes depending on interpretation.
Octet (B) A group of 8 bytes.  Can hold the values 0 to 255
Word A group of two octets.  Can hold the values 0 to 65535
Long Word A group of 4 octets.  Can hold the values 0 to 4 billion.
Page 256 bytes
Kilobit (Kb) 1024 bytes. USUALLY USED TO DESCRIBE THE RATE OF DATA FLOW.
Kilobyte (KB) 1024 bytes.  USUALLY USED TO DESCRIBE DATA STORAGE CAPACITY
Megabit (Mb) Either 1000 or 1024 Kb, depending on interpretation.   Usually used to describe the rate of data flow
Megabyte (MB) Either 1000 or 1024 KB, depending on interpretation,   Usually used to describe data storage capacity.
Gigabit (Gb) 1000 or 1024 Mb
Gigabyte (GB) 1000 or 1024 MB
Terabit (Tb) 1000 or 1024 Gb
TeraByte (TB) 1000 or 1024 GB
ASCII A 7 bit table used to describe the alphabet (upper and lower case), numeric, punctuation symbols and other Misc symbols.
EBCDIC An alternative to ASCII originally used by IBM.
Simplex One way communication, ie radio, TV.
Half Duplex Communication may only be made one way at a time.
Full Duplex Communications can be made in both ways at the same time.
Bandwidth The rate capacity of the communications medium.  The higher the bandwidth the more data that can be transmitted at any one interval.
Data Rate The rate of data transfer at any given time.
Error Rate The rate at which errors are occurring over a transmission medium.  Expressed as a percentage of the data rate.
Baud Rate The rate at which the signal level can be changed in a communications medium.  In a analogue medium this is refereed to as the modulation rate.  This is not the same as data rate, since each baud may represent more than one bit, although sometimes their values are the same.
Frame Represents the individual blacks of data transmitted onto a network.  These can vary in size often ranging from 1 byte to 16000.
Packet Usually the same as a frame but used to refer to a block of data within a frame.
Cell A frame which has a fixed size

So now you know what they all mean, I want to talk about a thing called the "7 layer model".  This is what the ISO have constructed which describes how different parts of a network should communicate.

7 Application This layer includes the application service provided by the network system.  This IS NOT the application programs themselves, but the mechanics required by them.  Examples of the TCP/IP application layer are Telnet, FTP, SMPT and POP.  ON IPX/SPX, RIP and NCP.
6 Presentation This layer is responsible for formatting data and encrypting it.  Most networks do not implement this.
5 Session This layer  establishes, maintains, disconnects a communications link between two stations in a network.  It works directly with the transport layer to ask for the session to be established.  Also can be used to validate users by checking passwords.  This layer also provides name to station address translation, allowing you to contact a system by name.  Protocols used in this layer include NetBIOS as used in windows and LAN manager and the WinSOCK service used with TCP/IP in UNIX systems.
4 Transport The transport layer identifies each connection between devices and maintains an identifying number so they can't be combined.   It also provides two of the following, Connection oriented (CO).  They provide an error free connection to another device.  The destination machine can either agree or refuse the connection.  All data is broken up into blocks that are suitable for transport.  This layer keeps track of all frames sent and any that are not received are re-requested. Examples.  TCP which uses IP as the layer 3 network protocol.   SPX which uses IPX as the layer 3 protocol.
Connection Less (CL) doesn't provide a guaranteed service, it simple sends packets and performs no checked.  Example.  UDP which uses IP as the layer 3 network protocol.
3 Network The layer 3 protocols are designed to provide a consistent and hierarchical addressing system across all the networks involved.   Communication maybe required across a variety of networks (X.25, lan, point to point etc) and each has a different addressing system.  This makes it difficult to determine where a device is, even when the address is known.  Layer 3 protocols provide an improved addressing system which break address into networks, sub-networks and hosts thus making it easier to route messages. IP, IPX, NetBEUI, AppleTalk, Decnet, DecLAT are all examples of network protocols.
2 DataLink This layer provides a secure data link between the two hosts.  This includes breaking data into frames and using checksum to validate frame integrity.  Examples include HDLC, LAPB, LAPD, LAPM, PPP, SLIP, ethernet (CSMA/CD) token ring and FDDI access methods, MAC addys and LLC.
1 Physical This layer defines the medium used for connection, the signaling methods used to detect transmit data and the methods used to detect signaling. Examples include, the copper wire, coaxial cables, fiber optics, infra-red signals and radio.

OK, I hope you got your self abit of understanding on all of that, now I am going to move on and talk about serial communications protocol.  So you ask yourself.  What are Serial communication protocols ?  Well I will explain:

Protocols provide a language to allow devices on a network to communicate.  Without these protocols the raw data that is sent accross the network would be meaningless.  The command feature that are providied by protocols are as follows:

  • Packets.  Data is broken down into small packets, which are transmittied individually, then if an error occurs, or packets get lost, only the effected packets need to be resent.  When the packets are recieved with out error, they are reconstructed back to the original data.  (this is seen best in tcp/ip)
  • Start and End.  Packets have a recongnisable start and end, which help the reciever determine where the data begins and ends.
  • Address.  Packets can have an address field which specifies who the data is for.  This is much more important if there is more than one machine on a single cable.
  • CheckSum.  Packets can have a checksum field which helps the reciver determine if the packet has been recievied correctly.
  • Identification.  Packets can have an identification field which specfies the type of data is holding.  For example it could be a file or simply a control message.
  • Control Messages.  Devices may need to communicate amongst them selves.  For example, if a packet was recieved in error, the reciever must inform the sender to transmit the packet again.
  • Clocking.  Protocols may provide additional clicking methods to help improve on that provided by the signalling method used (RZ, NRZ etc)

There are many serial communication protocols out there, how ever they all fall into one of two categories

  • Asynchronous data.  This is very simple protocol with few features, ie what all your pcs use.  It was used for cost cutting and is basically a load of rubbish, but it does its job.
  • Synchronous data.  This is a very power protocol which has many variants.  Such networks as Main Frame and Kilostream use this.

Asynchronous data is almost exclusively used with the NRZ encodeing method, which has no guaranteed clocking method of its own, and hence addition clocking methods are providied.  Asynchronous data is based upon a method of sending the data bit a byte at a time and encapsulating each byte in a start and stop bit.

Start
Bit

           Data Bits            Parity
Bit
Stop
Bit

The start bit is always a space and is used to help the recieving computer determine the moment when communications began.  At this point the reciever starts its clock.

The Data bits are the actual data that is transmittied.  There are either 7 or 8 data bits and the reciever tries to sample the data in the middle of each time period.   Since the recieve tries to sample the data in the middle of each data bit, data can still be correctly interpreted, even if the recievers clock differs slightly from that of the senders. Errors of up to 5% in the clocking can occur with out failure, allowing cheap equipment to be used.  Async chips (UARTS are commonplace in PC computers (COm1 and COM2).

The parity bit is optional and used to detect errors in the data bits.  Parity is calculated by adding up the numbers of 1's in the data and then storing the result which differs depending of the type of parity used:

  • NONE The parity bit isn't present
  • EVEN If there is an even number of bits set to 1 then the parity bit is set to 0, other wise it is set to 1.
  • ODD. If there is an even number of bits set to 1 then the parity bit is set to 1, other wise it is set to 0.

There are either one are two stop bits which are always set to mark.  These inform the recever to stop the clock and also to help to determine if errors are occuring.  ie, If the stop bit is set to not read as mark, then either there is a high error rate or the receiver is sampling the wrong speed.

The Universal Asynchronous Reciever Transmitter (UART) is used in most equipment to transmitt and recieve Asynchronous data.  Before it can be used it must be confgiured for:

  • Transmission speed
  • No. of data bits
  • Parity bit
  • No. of stop bits

A commonly used setting is 8 data bits, No parity and 1 stop bit.  This is known as 8N1.  There can only ever be one start bit hence it is never mentioned in configurations.


Synchronnous data is usually used with either NRZ or NRZi encoding methods, neither of which have a guaranteed clocking of their own.  To solve this prblem, additional clocking signals are transmittied along the serial cable.

  • Some standards (RS232, X.21 and RS422) use 1 transmit and one recieve clock.
  • Other Standards (RS449, RS530 and V.35) use 2 transmit and 2 recieve.

Unlike async communications, data is not sent in idividual bytes, but in large frames of data which can be thousnds of bytes long.  Theses frames contain  protocol information as well as the raw data.  There are a variety of different synchronnous protocols including:

  • Binary Synchronnous Control (BSC).  Developed by IBM.  Variants include 3270, 2780 and 3780.
  • Synchronnous Data Link Control (SDLC).  Developed by IBM and an integral part of SNA.
  • Advanced Data Communications Control Procedure (ADCCP).  A modified version of SDLC develpoed by ANSI.
  • High-level Data Link Control (HDLC). A modified version of ADCCP develpoed by the ITU-T.  Most synchronnous systems are based on this protocol.

Bitstuffing is a system which ensures that certain binary sequences will not appear in a data stream.  There are a variety of reasons for wanting to do this.

  • The clocking system provided by NRZi becomes very unreliable if there are too many adjacent 1's in the data.  Bit stuffing can be used to insert padding 0, in places where there are too many 1's.
  • Most synchronnous protocols have a special bit sequence, used to specify the start and end of a frame, which must not appear any where else in the frame.  If one of these sequences is detected in the data stream, bit stuffing can be used to break the sequence,

Assuming the reciever knows the bit stuffing methods used by the sener, it will be able to recontruct the orginal data again.

The HDLC frame has the following structure.

8 0, 8 or 16 8 16 8
Flag Address Control                          Data                          CRC Flag
  • The flag is the sequence 01111110 which specifies the start of the frame.  Bit stuffing is used to ensure that this pattern is never found else where in the frame
  • The address is used to specify the sender or intended reciever of the frame.  This allows multiple stations to conect on the same wire.
  • The control specifies the type of frame.  For example, whether the frame contains user data or is a supervisor frame (see HDLS frames types futher down the page).
  • The data portion is the raw data carried by the frame.   It doesn't have to be arranged into byte blocks.  It i a purely arbitaray collection of bits.
  • The CRC holds the cyclic redundancy check (checksum) which allows the reciever to determine whether the data has been received exactly as sent.   If the CRC fails, the frame is discarded,
  • The final flag also contains the pastter 01111110 and denotes the end of the flag.

There are 3 types of frame that are supported by HDLC:

  1. Unnumbered.  These are used for link management. Common uses are for setting up the local logical link between stations, specifying the mode of operation (see HDLC modes further down the page) and dissconnecting the the logical link.
  2. Supervisory.  These are used for the error and flow control.  This includes acknowledgements of data recieved and sequence numbers to ensure that data arrives in the correct order and with out duplications.
  3. Information. These contain the raw data.   In full duplex links, it is possible to piggyback data acknowledgements in the frame, to save sending additional supervisory frames.

The original HDLC implementation supports 3 possible modes of operation:

  1. Normal Responce Mode (NRM).  This is used in unbalanced configurations (where there is 1 primary station connected to 1 or more secondaries).  The  primary station has full control of the network and secondary machines can only communicate when given permission by the primary.  NRM provides flow control, error correction and guarantees accurate exchanges.  This mode of operation is very similar to SDLC.
  2. Async Response Mode (ARM).  This is very similar to NRM, but allows a secondary to initiate transmission without recieving permission from a primary.
  3. Async Balanced Mode (ABM).  This is used in balanced configurations (peer to peer), where each station has equal status.  This mode is often used in full diuplex point to point environments or for connections in packet switched networks ie X.25.

As HSLC grew and became more used in more and more enviroments, it became necessary to extens the HDLC protocols to provide more features.   The ITU-T develpoed the LAP standards as an extention to HDLC:

  • HDLC Lap Access Procedure Balanced (LAPB) is generally used in point to point enviroments.  It ensures that data is passed from node to node correctly and in order.  It is the basis of X.25 networks and is used on the ISDN B channel.
  • HDLC Lap Access Procedure for the D channel (LAPD) is used to carry signalling accross the ISDN D channel.
  • HDLC Lap Access Procedure for Modems (LAPM) is the primary protocol used for Async to sync conversion, flow control, error detection and correction.

Lets move onto the next section.