APPROVED
U1.00031-01 33 02-LU
SOFTWARE
COMPUTER EDUCATIONAL COMPLEX
"ELECTRONICS MS 0202"
THE LOCAL NETWORK
PROGRAMMER'S GUIDE
.00031-01 33 02
SHEETS 14
1987
LITERA A
- 2 -
.00031-01 33 01
ANNOTATION
This document is a guide for users
working with a local area network (LAN) class.
A set of network programs consists of programs that provide
reception / transmission of information, as well as restoring network integrity
.
This document describes the principles of working with this
network and network programs that ensure network operability.
- 3 -
.00031-01 33 01
CONTENT
1. PURPOSE AND TERMS OF USE ........................... 4
2.1. Work with a complex of programs ........................... 5
2.1.1. Network operation in the phase of information transfer ............... 5
2.1.2. Network operation in the reconfiguration / recovery phase ..... 7
2.1.3. Transmission conditions .......................... 9
2.2. The composition of the complex ....................................... 9
3. APPEAL TO THE PROGRAM ..................................... 11
4. INPUT AND OUTPUT DATA ................................. 12
4.1. The format of the control unit .............................. 12
4.2. Assignment of individual fields of control units .......... 12
5. MESSAGE ............................................... .. 13
- 4 -
.00031-01 33 01
1. PURPOSE AND TERMS OF USE
The universal and massive use of microcomputers in industry and
science for the control of technological processes and equipment,
design automation, scientific research, etc.
It requires the education of a new generation of people for whom the
use of computers in work and life is a familiar and
natural process. This training should be carried out from the
first classes at school until graduation, at work, at
home.
This system uses a local area network
(LAN) with a ring structure transmitting a medium on a twisted
pair, standard asynchronous transceivers as
transceivers of network adapters, and a byte-oriented
protocol for controlling access to the transmission medium based on the
method of relay transmission of a control token .
It is characterized by:
- low cost of a separate training place;
- high reliability in work;
- resistance to severe operating conditions (school);
- the ability to build simple learning models;
- the maximum reduction in costly external
devices;
- extensive system and application
software;
- controllability of the learning process.
The peculiarity of this LAN is the refusal to use a
monitor station in the phases of information transfer along the ring and
reconfiguration, as well as the use of a byte-oriented
protocol.
Byte-oriented flow ol allows the use of simple e
-transceivers and, accordingly, reduce the cost of network adapter hardware
.
In a ring network there can be up to 63 stations, the numbers of which are
set by microswitches on the network adapter. The
host machine is 63. The host and stations use
the same network interface. The speed of information transmission over the
network is 57600 baud. Information over the network is transmitted in frames of
arbitrary size. At the same time, no more than
one request for frame reception / transmission can be processed . Direct transmission of the
frame is carried out only after receiving the control marker.
- 5 -
.00031-01 33 01
The programs that ensure the operation of the local network are
assigned the functions of error-free reception and transmission of frames and restoration of network integrity in case of failures in the transmission and reconfiguration environment .
At a station connected to the network, communication programs must be
permanently in memory. Since they can be
used by various programs, it is advisable to arrange them as
an MC driver in the FODOS-2 operating system (or a compatible
operating system). For use, the driver must
be loaded using the LOAD MC monitor command , and for access to the transmission medium it is necessary to refer to the routines that are part of this driver.
2. CHARACTERISTICS OF THE PROGRAM COMPLEX
2.1. Work with a complex of programs
School LAN performs the following main functions:
- transfer of information between stations;
- reconfiguration of the network when connecting new or disconnecting
old stations;
- restoration of network operability after failures and
failures essential for this protocol.
In the network, two phases are distinguished - the phase of information transfer
and the reconfiguration / recovery phase.
2.1.1. Network operation in the phase of information transfer
If station " A " wants to transmit an information frame to station " C " , then it first waits for the arrival of the control token, absorbs it and emits a frame (Fig. 1).
- 6 -
.00031-01 33 01
Station " A " is waiting for a control token
+ ----- + + ----- + ---- ! A! <---------------! D! <- ! + ----- + + ----- +! ! ! ! ! ! ! ! ! ! + ----- + + ----- +! ---> ! B! --------------->! C! <- + ----- + + ----- +
Fig. 1
Stations " B " and " D " , having determined that the frame is not intended for them,
relay the frame further to the network. Station " C " , having determined that the
frame is intended for it, also relays it further to the network, but
at the same time copies it, as the frame spreads around the
ring, to its own receive buffer (Fig. 2).
Station " C " copies the information frame
+ ----- + + ----- +
---- ! A! <---------------! D! <- ! + ----- + + ----- +! ! ! ! ! ! ! ! ! ! + ----- + + ----- +! ---> ! B! --------------->! C! <- + ----- + + ----- +
Fig.2
Having completed the roundabout, the frame again enters station " A " ,
which absorbs it. At the same time, station " A " emits a control marker
(Fig. 3), thereby transferring the baton to another station.
- 7 -
.00031-01 33 01
Having absorbed its own frame, station " A " emits
a control marker
+ ----- + + ----- +
---- ! A! <---------------! D! <- ! + ----- + + ----- +! ! ! ! ! ! ! ! ! ! + ----- + + ----- +! ---> ! B! --------------->! C! <- + ----- + + ----- +
Fig.3
2.1.2. Network operation in the reconfiguration / recovery phase
The absence of a control token at the time of switching on the network or
its loss during network failures or during reconfiguration leads to a
disruption in the normal functioning of this circuit. Therefore, after not
detecting for a certain period of time any
frames or marker, network stations begin to compete among
themselves for the right to emit a control marker. At the same time, each
“candidate” establishes the sign of “
election victory” in the local memory and emits a special kind of frame called a
“voting ballot” (Fig. 4), which includes its
own station number.
Stations " A " and " C " generate a "voting ballot"
+ ----- + + ----- + - ---- ! A (1)! <---------------! D (4)! <- ! ! ! + ----- + + ----- +! ! - ! ! ! ! ! ! ! ! ! ! + ----- + + ----- +! - ---> ! B (2)! --------------->! C (3)! <- ! ! - sign + ----- + + ----- + ! - "victory ! in the election"
Fig . 4
- 8 -
.00031-01 33 01
When going around the station’s ring, “candidates” compare the address of the
received “newsletter” with their own address (Fig. 5).
If your own address is less than accepted, then the sign of " election victory
" is suppressed.
Station " A " suppresses the sign of "election victory "
+ ----- + + ----- +
------ ----! A (1)! <---------------! D (4)! <- ! ! ! + ----- + + ----- +! --- ! ! ! ! ! ! ! ! ! + ----- + + ----- +! - --->! B (2)! --------------->! C (3)! <-! ! - sign + ----- + + ----- +! - "victory ! in the election"
Fig . 4
As a result of this procedure, the only station that has
retained the sign of "election victory" remains . Having accepted and absorbed
its own “voting bulletin”, this station emits a control token
, returning the network to the information transfer phase (Fig. 6).
Stations " A " and " C " absorb their "ballot papers."
Station " C " generates a control token.
+ ----- + + ----- +
---- ! A ! <---------------! D ! <-
! + ----- + + ----- +!
! !
! !
! !
! !
! + ----- + + ----- +!
---> ! B ! --------------->! C ! <-
+ ----- + + ----- +
Fig.6
- 9 -
.00031-01 33 01
2.1.3. Transfer Conditions
In order for the transmitted frame to be received, the following conditions must be
met:
- the receiving station is present in the network and connected to
it;
- the receiving station has a request to receive a frame from
the sending station or "from all";
- the size of the transmitted frame does not exceed the maximum
frame size specified in the request;
- when receiving a frame, no errors were detected in the control
amount.
If at least one of these conditions is violated, the transfer
is considered unsuccessful.
A request for receiving or transmitting frames may be rejected
if, for a given number of attempts, it was not possible to restore the
integrity of the ring.
After issuing a request to receive or transmit a frame, it is necessary to
wait until the readiness bit appears in the status byte. If at
least one of them is different from 0, then the request is completed with an error.
A request to cancel the reception or transmission of a frame is not processed
immediately, therefore, after it it is also necessary to wait for the availability
bit in the status byte of the control block of the request.
The control unit is described in detail in paragraph 4.
2.2. The composition of the complex
The LAN software package provides the following
functions:
- reconfiguration / restoration of the network in case of failures and loss
of a control token;
- broadcast transmission of information frames;
- directional transmission of information frames;
- frame reception from any network station;
- directional reception of an information frame;
- 10 -
.00031-01 33 01
- simultaneous execution of requests for reception / transmission;
- fulfillment of requests for disconnecting / connecting stations to the
network;
- longitudinal-transverse control of frames in parity with
automatic repetition of frame transmission;
- transmission of acknowledgment of the reception of the frame from the receiver to the
source directly in the frame transmitted from the source to the
receiver;
- code independence of the information field of the transmitted
frame.
A program that implements these functions has an
interface with a high level that allows it to be completely "immersed" in the
equipment. Corresponding upper-level programs turn to the MC driver , passing the control unit address to it. The control unit contains a field, analyzing which you can establish the fact of the correct processing of the request. It is also possible to connect the MAC layer with the higher levels of interruptions.
These functions are implemented by the following routines:
Subprogram: NETON
Number 1
Function: Connect the station to the network
Login: No
Output: R 0 - station network address
Errors: No
Subprogram: NETOFF
Number: 2
Function: Disconnect the station from the network
Login: No
Output: No
Errors: No
Subroutine: RFRAME
Number: 3
Function: Frame Reception Request
Input: R 0 - address of the control block request
Output: No
Errors: Bit " C " is set, R 0 = 0 - such a request already exists R 0 = 1 - error in the parameters
Subroutine: WFRAME
Number: 4
Function: Frame Request
Input: R 0 - address of the control block request
Output: No
Errors: Bit " C " is set, R 0 = 0 - such a request already exists R 0 = 1 - error in the parameters
- 11 -
.00031-01 33 01
Subroutine: RCANCL
Number: 5
Function: Frame Reject Request
Login: No
Output: No
Errors: Bit " C " is set, R 0 = 0 - there is no corresponding request
Subroutine: WCANCL
Number: 6
Function: Request to cancel frame transmission
Login: No
Output: No
Errors: Bit " C " is set, R 0 = 0 - there is no corresponding request
Through the register R 0 the address of the control unit is transmitted. In
case of improper handling, bit " C " is set , and an error code is returned in R 0 .
3. APPEAL TO THE PROGRAM
Subroutines are called by the CALLMC macro :
.MACRO CALLMC N
MOV @ # 360, R1
ADD -2 * N (R1), R1
JSR PC, (R1)
.ENDM CALLMC
where 360 is the interrupt vector address associated with the network
adapter, and N is the subroutine number.
- 12 -
.00031-01 33 01
4. INPUT AND OUTPUT DATA
4.1. Control block format
When a request for transmission or reception is issued via R 0
, the address of the control unit is transmitted.
The control unit when the control unit when
receiving a frame: frame transmission:
-------------------- --------------------
! one! 0! ! one! 0!
-------------------- --------------------
! 3! 2! ! 3! 2!
-------------------- --------------------
! . 4 ! ! . 4 ! -------------------- -------------------- ! . 6! ! . 6! -------------------- -------------------- ! . ten! --------------------
4.2. Assigning individual fields to control blocks
Bytes 0 and 1 (control and status bytes, respectively)
have the following format:
7 6 5 4 3 2 1 0
-----------------------------------
! RESEARCH!
Control Byte:! . . . . . !
-----------------------------------
7 6 5 4 3 2 1 0
-----------------------------------
! BIT! B & T S O B & B O K!
Status Byte:! GOT! . . . . . !
-----------------------------------
Bit 7 in the status byte is the ready bit, which is
set after processing the request. If the request cannot
be executed, then in addition to the readiness bit, error bits
are set.
- 13 -
.00031-01 33 01
Byte 2:
- when receiving a frame - the address of the sending station,
or 377 when receiving “from all”.
- when transmitting a frame, the address of the receiving station, or
0 when transmitting to "everyone".
Byte 3:
- when receiving a frame, the address of the sending station of the
received frame (actual).
- when transmitting a frame, the number of retries when
transmission fails . At zero
takes the number of repetitions
determined in MAC - level.
Bytes 4,5:
- address of the memory area with the transmitted / received
information.
Bytes 6.7:
- when receiving a frame, the maximum size of the received
frame.
- when transmitting a frame, the size of the transmitted frame.
Bytes 10.11:
- when receiving a frame, the actual size of the received frame.
- when transmitting a frame - missing.
5. MESSAGES
There are no messages in this software package.
- 14 -
.00031-01 33 01
-------------------------------------------------- ----------------
! CHANGE REGISTRATION SHEET!
! ------------------------------------------------- -----------------!
! ! NUMBERS OF SHEETS (PAGES)! TOTAL ! ! INCOMING! ! !
! ! -------------------------! SHEETS! N ! N BACK! SUBP! YES!
! ! MEASURES! REPLACEMENT! NEW! ANNULES -! (PAGES)! DOCUMENT-! DIVING-! ! TA!
! ISM! NEN! NEN! ! ROWAN-! IN THE DOCUMENT. ! TA. ! GO DOCUMENT! ! !
! ! NEW! NEW! ! NEW! ! ! AND DATE! ! !
! ---! -----! -----! -----! -------! ---------! --------! ---------! ----! -!
! ! ! ! ! ! ! ! ! ! !
! ---! -----! -----! -----! -------! ---------! --------! ---------! ----! -!
! ! ! ! ! ! ! ! ! ! !
! ---! -----! -----! -----! -------! ---------! --------! ---------! ----! -!
! ! ! ! ! ! ! ! ! ! !
! ---! -----! -----! -----! -------! ---------! --------! ---------! ----! -!
! ! ! ! ! ! ! ! ! ! !
! ---! -----! -----! -----! -------! ---------! --------! ---------! ----! -!
! ! ! ! ! ! ! ! ! ! !
! ---! -----! -----! -----! -------! ---------! --------! ---------! ----! -!
! ! ! ! ! ! ! ! ! ! !
! ---! -----! -----! -----! -------! ---------! --------! ---------! ----! -!
! ! ! ! ! ! ! ! ! ! !
! ---! -----! -----! -----! -------! ---------! --------! ---------! ----! -!
! ! ! ! ! ! ! ! ! ! !
! ---! -----! -----! -----! -------! ---------! --------! ---------! ----! -!
! ! ! ! ! ! ! ! ! ! !
! ---! -----! -----! -----! -------! ---------! --------! ---------! ----! -!
! ! ! ! ! ! ! ! ! ! !
! ---! -----! -----! -----! -------! ---------! --------! ---------! ----! -!
! ! ! ! ! ! ! ! ! ! !
! ---! -----! -----! -----! -------! ---------! --------! ---------! ----! -!
! ! ! ! ! ! ! ! ! ! !
! ---! -----! -----! -----! -------! ---------! --------! ---------! ----! -!
! ! ! ! ! ! ! ! ! ! !
! ---! -----! -----! -----! -------! ---------! --------! ---------! ----! -!
! ! ! ! ! ! ! ! ! ! !
! ---! -----! -----! -----! -------! ---------! --------! ---------! ----! -!
! ! ! ! ! ! ! ! ! ! !
! ---! -----! -----! -----! -------! ---------! --------! ---------! ----! -!
! ! ! ! ! ! ! ! ! ! !
! ---! -----! -----! -----! -------! ---------! --------! ---------! ----! -!
! ! ! ! ! ! ! ! ! ! !
! ---! -----! -----! -----! -------! ---------! --------! ---------! ----! -!
! ! ! ! ! ! ! ! ! ! !
! ---! -----! -----! -----! -------! ---------! --------! ---------! ----! -!
! ! ! ! ! ! ! ! ! ! !
! ---! -----! -----! -----! -------! ---------! --------! ---------! ----! -!
! ! ! ! ! ! ! ! ! ! !
! ---! -----! -----! -----! -------! ---------! --------! ---------! ----! -!
! ! ! ! ! ! ! ! ! ! !
! ---! -----! -----! -----! -------! ---------! --------! ---------! ----! -!
! ! ! ! ! ! ! ! ! ! !
! ---! -----! -----! -----! -------! ---------! --------! ---------! ----! -!
! ! ! ! ! ! ! ! ! ! !
! ---! -----! -----! -----! -------! ---------! --------! ---------! ----! -!
! ! ! ! ! ! ! ! ! ! !
! ---! -----! -----! -----! -------! ---------! --------! ---------! ----! -!