JPH0221705B2 - - Google Patents
Info
- Publication number
- JPH0221705B2 JPH0221705B2 JP57152985A JP15298582A JPH0221705B2 JP H0221705 B2 JPH0221705 B2 JP H0221705B2 JP 57152985 A JP57152985 A JP 57152985A JP 15298582 A JP15298582 A JP 15298582A JP H0221705 B2 JPH0221705 B2 JP H0221705B2
- Authority
- JP
- Japan
- Prior art keywords
- data
- packet
- transmission
- flag
- reception
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Lifetime
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L12/407—Bus networks with decentralised control
- H04L12/413—Bus networks with decentralised control with random access, e.g. carrier-sense multiple-access with collision detection [CSMA-CD]
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Small-Scale Networks (AREA)
- Communication Control (AREA)
Description
【発明の詳細な説明】
この発明は、比較的狭い地域に分散したキヤツ
シユレジスタ等のコンピユータ機器を相互接続す
るローカルネツトワークシステムにおいて、デー
タパケツトや応答パケツト等のパケツトの送信を
効率的に行うデータ伝送方式に関する。特には、
データの始めと終りにデータを区切るコードとし
て所定のフラグが付けられた所謂HDLCパケツト
を用いる場合のデータ伝送方式に関する。DETAILED DESCRIPTION OF THE INVENTION The present invention provides a data system for efficiently transmitting packets such as data packets and response packets in a local network system that interconnects computer equipment such as cash registers distributed over a relatively narrow area. Regarding transmission methods. in particular,
The present invention relates to a data transmission system using a so-called HDLC packet in which a predetermined flag is attached as a code for delimiting data at the beginning and end of the data.
一般にローカルネツトワークシステムにおいて
は、データの伝送制御を次の手順によつて行う。 Generally, in a local network system, data transmission control is performed using the following procedure.
まず伝送ラインに接続された各端末がデータパ
ケツトの先頭に記述されている目的端末アドレス
を読み、自己のアドレスと一致すれば引き続くデ
ータを読み込む。CRCチエツクの結果、誤りが
なければACKデータを送信端末に送る。誤りが
あつた場合は受信データを捨てる。送信端末は、
タイマで送信後の時間を計測し、一定時間内に
ACKがない場合は再送する。また、さらに厳密
な伝送制御をおこなう場合には、ACKパケツト
を受信したときに送信端末に対してRACKパケ
ツトを送信する。 First, each terminal connected to the transmission line reads the destination terminal address written at the beginning of the data packet, and if it matches its own address, it reads the following data. If there is no error as a result of the CRC check, send the ACK data to the transmitting terminal. If there is an error, the received data is discarded. The sending terminal is
A timer measures the time after sending, and within a certain period of time
If there is no ACK, retransmit. Furthermore, when performing even stricter transmission control, a RACK packet is transmitted to the transmitting terminal when an ACK packet is received.
データパケツトの送信が他の端末との間で衝突
した場合(例えば、二つの端末が同時にアクセス
したときは少なくとも開始フラグまでは衝突が生
じないが次以降のデータで衝突が生じる)には、
衝突時点でパケツトの送信を打ち切る。この場合
衝突を起こした各端末は、所謂バツクオフ処理
(後述する)を行つて再送を試みる。 If the transmission of data packets collides with another terminal (for example, when two terminals access at the same time, there is no collision at least up to the start flag, but a collision occurs with the next data),
Packet transmission is terminated at the point of collision. In this case, each terminal that has caused a collision performs a so-called back-off process (described later) and attempts retransmission.
ところで、データの始めと終りにフラグを付け
るパケツトフオマツトを使用するシステムでは、
上記の伝送制御を行うときに、受信側では終りの
フラグを検出することでパケツトの受信完了を判
定する。すなわち、終りのフラグを検出するとデ
ータパケツト送信端末に対してACKパケツトま
たはNRDYパケツト等の応答パケツトの送信準
備を行う。 By the way, in a system that uses a packet format that flags the beginning and end of data,
When carrying out the above transmission control, the receiving side determines the completion of packet reception by detecting the end flag. That is, when the end flag is detected, preparations are made to transmit a response packet such as an ACK packet or NRDY packet to the data packet transmitting terminal.
ところが、このような伝送制御では、データパ
ケツト送信時に衝突が生じると受信端末において
再送パケツトを正常に受信出来なくなる可能性が
ある。前述のように、衝突が発生するとその時点
で送信が停止されるが、受信側ではその停止時点
からデータ待ち状態になり、再送されたデータパ
ケツトを前回に受信したデータの続きのデータと
みなして処理するからである。すなわち、このよ
うなケースでは、再送に係るデータパケツトの開
始フラグを前回のデータパケツト(途中で切れて
いる)の終了フラグとみなし、データ長が短いこ
とからエラー処理を行うが、続いて受信する再送
のデータパケツトについても、開始フラグが無い
と判断してそのパケツトについてもエラー処理を
行うことになる。この結果、受信側では衝突時の
再送パケツトを正常に受信出来なくなる。 However, with such transmission control, if a collision occurs during data packet transmission, there is a possibility that the receiving terminal will not be able to properly receive the retransmitted packet. As mentioned above, when a collision occurs, transmission is stopped at that point, but the receiving side enters a data waiting state from that point on and processes the retransmitted data packet, treating it as a continuation of the previously received data. Because it does. In other words, in such a case, the start flag of the data packet related to retransmission is regarded as the end flag of the previous data packet (which was cut off midway), and error processing is performed because the data length is short. Regarding the data packet, it is determined that there is no start flag, and error processing is performed for that packet as well. As a result, the receiving side cannot normally receive retransmitted packets at the time of collision.
この発明の目的は、衝突時に送信が停止したデ
ータパケツトを、再送に係るデータパケツトの受
信に影響を与えることなくエラー処理し、そのエ
ラー処理後に再送のデータパケツトを正常に受信
出来るようにしたローカルネツトワークシステム
のデータ伝送方式を提供することにある。 An object of the present invention is to provide a local network system in which an error is processed for data packets whose transmission is stopped due to a collision without affecting the reception of data packets related to retransmission, and after processing the error, the retransmitted data packets can be normally received. The purpose of the present invention is to provide a data transmission method.
この発明は、要約すれば
パケツト送信時にその開始フラグを受信エラー
処理時間よりも長い所定時間継続して送信するこ
とを特徴とする。 To summarize, the present invention is characterized in that when transmitting a packet, the start flag is continuously transmitted for a predetermined period of time longer than the reception error processing time.
すなわち、開始フラグを連続させることによつ
て、受信側では、衝突後の再送パケツトの一番最
初の開始フラグを前回のパケツトの終了フラグと
みなし、開始フラグが連続している間にそのエラ
ー処理を行い、その処理の終了後、続いて受信す
る開始フラグ以下のデータを正常に受信する。 In other words, by making the start flags consecutive, the receiving side considers the first start flag of the retransmitted packet after a collision to be the end flag of the previous packet, and processes the error while the start flags are consecutive. After the process is completed, the data below the start flag to be subsequently received is normally received.
この発明によれば、データパケツトの衝突が生
じても、受信側では、その衝突前に受信したデー
タ(開始フラグを少なくとも含む)に関しては、
再送パケツトに影響を与えずにエラー処理を行う
ため、常に正常な受信をすることが出来る。ま
た、フラグ送出の間にエラー処理を行うことが出
来るため、衝突後に再送されたデータパケツトを
逃すことなく受信出来る利点がある。 According to this invention, even if a collision of data packets occurs, on the receiving side, regarding the data (including at least the start flag) received before the collision,
Since error processing is performed without affecting retransmitted packets, normal reception is always possible. Furthermore, since error processing can be performed during flag transmission, there is an advantage that data packets retransmitted after a collision can be received without being missed.
以下この発明の実施例を図面を参照して説明す
る。 Embodiments of the present invention will be described below with reference to the drawings.
第1図はこの発明を実施するローカルネツトワ
ークシステムのブロツク構成図である。同図にお
いて、メインシステムである端末装置A〜Nは、
この発明の実施例の伝送インターフエイスI/F
を介して同軸ケーブルから成るデータ伝送ライン
Lに接続され、各端末相互間で任意に各種データ
の送受信が行なえるようになつている。第2図は
上記伝送インターフエイスI/Fのブロツク構成
図、第3図はさらにその詳細なブロツク構成図で
ある。 FIG. 1 is a block diagram of a local network system implementing the present invention. In the figure, terminal devices A to N, which are the main system, are
Transmission interface I/F of the embodiment of this invention
The terminals are connected to a data transmission line L consisting of a coaxial cable, so that various data can be freely transmitted and received between the respective terminals. FIG. 2 is a block diagram of the transmission interface I/F, and FIG. 3 is a more detailed block diagram thereof.
伝送インターフエイスI/Fは、送信制御回路
10、受信制御回路11、および送受信データ転
送制御回路12から構成される。送信制御回路1
0は、送信データまたは応答パケツトを所定のパ
ケツトフオマツトにて伝送ライン上に送出し、受
信制御回路11は、伝送ラインLから受信したデ
ータのパケツトフオマツトを判定し、その判定結
果に基づいて応答パケツトを作成する。また、送
受信データ転送制御回路12は、受信制御回路1
1、送信制御回路10と端末装置との間で送受信
データの転送を制御する。 The transmission interface I/F includes a transmission control circuit 10, a reception control circuit 11, and a transmission/reception data transfer control circuit 12. Transmission control circuit 1
0 sends the transmission data or response packet onto the transmission line in a predetermined packet format, and the reception control circuit 11 determines the packet format of the data received from the transmission line L, and applies the determination result to the transmission line. Create a response packet based on the Further, the transmission/reception data transfer control circuit 12 includes the reception control circuit 1
1. Controls the transfer of transmitted and received data between the transmission control circuit 10 and the terminal device.
第3図において、上記送受信データ転送制御回
路12は、送信データ転送制御回路1と受信デー
タ転送制御回路2とで構成される。送信データ転
送制御回路1は、各種データを送信する場合に端
末装置側から送られてきたデータを1バイト毎に
一時記憶するレジスタaと、同レジスタaへの書
込みを許可するときにセツトするフラグWEN
と、端末装置が総ての送信データを転送したとき
にセツトされるフラグWEDとを有する。また、
受信データ転送制御回路2は、各種データを受信
する場合にインタフエイス側の受信データを1バ
イト毎に端末装置に転送するための取込みレジス
タbと、受信データがあることをチヤネル毎に端
末装置に知らせるためのフラグRENと、端末装
置が総ての受信データを取り込んだことをチヤネ
ル毎にインターフエイス側に知らせるためのフラ
グREDと、および端末装置の受信準備が完了し
ていることをインターフエイス側に知らせるフラ
グRDYとを有する。 In FIG. 3, the transmission/reception data transfer control circuit 12 is comprised of a transmission data transfer control circuit 1 and a reception data transfer control circuit 2. The transmission data transfer control circuit 1 includes a register a that temporarily stores data sent from the terminal device side byte by byte when transmitting various data, and a flag that is set when permitting writing to the register a. WEN
and a flag WED that is set when the terminal device has transferred all transmission data. Also,
The reception data transfer control circuit 2 includes a reception register b for transferring the reception data on the interface side to the terminal device byte by byte when receiving various data, and a reception register b for transmitting the reception data on the interface side to the terminal device for each channel. A flag REN is used to notify the interface, a flag RED is used to notify the interface for each channel that the terminal has received all received data, and a flag RED is used to notify the interface that the terminal is ready to receive data. It has a flag RDY to notify.
上記送信制御回路10、および受信制御回路1
1は、チヤネル毎の送受信データおよびインター
フエイス制御プログラムを記憶するメモリ4、送
受信段階でのタイマー、インターラプト機能を制
御する制御回路6、メモリ4と上記送受信データ
転送制御回路1,2との間でデータをDMA転送
するDMAC3、送受信動作を制御し、送受信バ
ツフア用C,Fおよび送受信用シフトレジスタ
D,Eを有するリンクコントローラ7、送信時に
送信データを変調してライン上へ送出するととも
に複数の端末から同時にアクセス要求があつたか
どうかを検出する衝突検出回路を含むライン制御
回路8、ライン上の信号を受信し、その信号を復
調してリンクコントローラ7へ転送するライン制
御回路9、およびインターフエイス全体をメモリ
4に記憶されている制御プログラムに従つて制御
するサブCPU5から構成される。 The above transmission control circuit 10 and reception control circuit 1
1 is a memory 4 for storing transmission/reception data and an interface control program for each channel; a control circuit 6 for controlling a timer and an interrupt function at the transmission/reception stage; and a control circuit 6 between the memory 4 and the transmission/reception data transfer control circuits 1 and 2. A DMAC 3 performs DMA transfer of data, a link controller 7 controls transmission and reception operations and has transmission and reception buffers C and F and transmission and reception shift registers D and E, and a link controller 7 that modulates transmission data and sends it out on the line at the time of transmission, and also controls transmission and reception operations. A line control circuit 8 that includes a collision detection circuit that detects whether access requests are received from terminals at the same time, a line control circuit 9 that receives signals on the line, demodulates the signals, and transfers the signals to the link controller 7, and an interface. It is composed of a sub CPU 5 that controls the entire system according to a control program stored in a memory 4.
第4図は上記ライン制御回路8に設けられる衝
突検出回路の回路図である。同図のように、変調
後の信号と復調前段の信号とを、イクスクルーシ
ブOR回路81に与え、その出力をフリツプフロ
ツプ82のセツト信号にしている。このようにす
ることにより、送信データと受信データとが異な
るとき、すなわち衝突時において衝突検出信号
COが得られる。 FIG. 4 is a circuit diagram of a collision detection circuit provided in the line control circuit 8. As shown in the figure, the modulated signal and the pre-demodulation signal are applied to an exclusive OR circuit 81, whose output is used as a set signal for a flip-flop 82. By doing this, when the transmitted data and the received data are different, that is, at the time of a collision, the collision detection signal is
CO is obtained.
第5図は上記ライン制御回路9に設けられるキ
ヤリア検出回路の回路図である。また第6図は同
キヤリア検出回路のタイミングチヤートである。
この実施例では、ライン上にデータの流れがある
ことを示すキヤリア信号CD1と一定時間キヤリ
ア信号CD1がないことを示す信号CD2を得るよ
うにしている。すなわち、ラインより受けた信号
からレシーブクロツクaを復調回路90によつて
作成し、バイナリーカウンタ91およびラツチ回
路92へ入力して、信号CD1とCD2を得てい
る。第6図に示すように、レシーブクロツクが無
くなるとバイナリーカウンタ91のCL(クリア
ー)端子が解除され、カウントが基本クロツクφ
により進んで搬送波のミラーイメージ信号である
キヤリア信号CD1が得られる。さらにカウント
が進むと、クロツクφの周期によりあらかじめ設
定された処理時間tを加えた信号CD2が得られ
る。 FIG. 5 is a circuit diagram of a carrier detection circuit provided in the line control circuit 9. FIG. 6 is a timing chart of the carrier detection circuit.
In this embodiment, a carrier signal CD1 indicating that there is a flow of data on the line and a signal CD2 indicating that there is no carrier signal CD1 for a certain period of time are obtained. That is, a receive clock a is generated from a signal received from the line by a demodulation circuit 90, and inputted to a binary counter 91 and a latch circuit 92 to obtain signals CD1 and CD2. As shown in FIG. 6, when the receive clock disappears, the CL (clear) terminal of the binary counter 91 is released, and the count returns to the basic clock φ.
As a result, a carrier signal CD1, which is a mirror image signal of the carrier wave, is obtained. As the count progresses further, a signal CD2 is obtained which is obtained by adding a preset processing time t to the period of the clock φ.
各端末は、この信号CD1と信号CD2を個々に
検出し、図示しない回路によつて、信号CD2が
「ロー」(論理0)であるときにだけデータパケツ
トを送出出来、ACKパケツトまたはRACKパケ
ツト等の応答パケツトは信号CD1が「ロー」(論
理0)であるときにだけ送出出来るように制御す
る。このようにして信号CD1,CD2をチエツク
しながら送受信制御することにより、データパケ
ツト送出後のACK、およびRACKパケツト送出
に関して他の端末からのデータパケツトとの衝突
が防止される。第7図はライン上の信号と上記信
号CD1,CD2との関係を示している。図におい
て時間tはライン上にキヤリア信号がない一定時
間を表す。この時間は少なくともACKパケツト
再送許容時間よりも長く設定されていて、ACK
パケツトがこの時間t内に送出されなければ、ラ
インの占有は解除され、他の端末からの新たなア
クセスが許可される。 Each terminal individually detects the signals CD1 and CD2, and uses a circuit not shown to send out data packets only when the signal CD2 is "low" (logical 0), such as ACK packets or RACK packets. The response packet is controlled so that it can be sent only when the signal CD1 is "low" (logical 0). By controlling transmission and reception while checking the signals CD1 and CD2 in this way, collision with data packets from other terminals is prevented with respect to the transmission of ACK and RACK packets after data packet transmission. FIG. 7 shows the relationship between the signals on the line and the signals CD1 and CD2. In the figure, time t represents a certain period of time when there is no carrier signal on the line. This time is set at least longer than the allowable ACK packet retransmission time, and
If no packets are sent out within this time t, the line is de-occupied and new access from other terminals is allowed.
第8図はこのローカルネツトワークでの基本的
な伝送手順を示す。同図Aは送信端末と受信端末
がともに正常な状態にある場合の手順である。ま
ず、送信端末からフラグ、アドレス等のヘツダー
部を備えたデータパケツトを相手先へ送信する。
このデータパケツトが正常に受信されるとデータ
パケツト受信端末はACKパケツトを送信する。
ACKパケツトを受信したデータパケツト送信端
末は、ACKパケツトに対する応答パケツト
(RACKパケツト)を送信する。データパケツト
送信に対して、受信端末がデータパケツトを受け
入れる準備がない場合は同図Bのように、受信端
末がNRDYパケツトを送信して終了する。また、
送信されてきたデータパケツトのチヤネルに対応
する受信バツフアが塞がつている場合は、同図C
に示すようにバツフアフルのステートメントを付
けたNRDYパケツトを送信して終了する。 FIG. 8 shows the basic transmission procedure in this local network. Figure A shows the procedure when both the transmitting terminal and the receiving terminal are in a normal state. First, a data packet including a header section such as a flag and an address is transmitted from a transmitting terminal to a destination.
When this data packet is received normally, the data packet receiving terminal transmits an ACK packet.
The data packet transmitting terminal that has received the ACK packet transmits a response packet (RACK packet) in response to the ACK packet. When the receiving terminal is not ready to accept the data packet, the receiving terminal transmits an NRDY packet and ends the process, as shown in FIG. 2B. Also,
If the receiving buffer corresponding to the channel of the transmitted data packet is blocked,
The process ends by sending an NRDY packet with a buffer statement as shown in the figure below.
第9図はパケツトフオマツトを示す図である。
既に述べたように、この発明の伝送方式に用いる
パケツトとしては、データを開始フラグ(リーデ
イングフラグ)と終了フラグ(トレーリングフラ
グ)で区切るHDLCフオマツト構成のパケツトが
用いられる。 FIG. 9 is a diagram showing a packet format.
As already mentioned, the packets used in the transmission system of the present invention are those in the HDLC format, in which data is separated by a start flag (leading flag) and an end flag (trailing flag).
両方のフラグコードは7E(ヘキサデシマル)
である。トレーリングフラグはパケツトの終了を
表す終了コードとして機能する。デイステイネー
シヨンアドレスDAは受信局を指定する。ソース
アドレスSAは送信局を指定する。データタイプ
TYPEは転送フレームの種類を指定する。その種
類はデータ、ACK、RACK、NRADYの4種類
である。チヤネル番号CH.NOはパケツトのチヤ
ネル種別を指定する。回線ステータスDLSは
NRADYパケツト送信時でのステートメントを
記述する。そのステートメントには、受信不可と
受信バツフアフルとがある。バイトカウンタ
BCLとBCHはデータのバイト数を指定する。デ
ータフイールドDATAは転送するデータをセツ
トする。このデータフイールドDATAは、デー
タパケツトのみに存在する。CRCはエラー検出
用コードを与える。 Both flag codes are 7E (hexadecimal)
It is. The trailing flag functions as an end code indicating the end of the packet. The destination address DA specifies the receiving station. Source address SA specifies the transmitting station. data type
TYPE specifies the type of transfer frame. There are four types: data, ACK, RACK, and NRADY. The channel number CH.NO specifies the channel type of the packet. Line status DLS
Write the statement when sending NRADY packet. The statements include "receiving not possible" and "receiving buffer full." bite counter
BCL and BCH specify the number of bytes of data. The data field DATA sets the data to be transferred. This data field DATA exists only in data packets. CRC provides an error detection code.
次に第3図に示すインターフエイスの動作を、
第10図〜第11図を参照して説明する。 Next, the operation of the interface shown in Figure 3 is as follows.
This will be explained with reference to FIGS. 10 and 11.
(1) 送信動作
第10図A〜Cは、データの送信動作を示すフ
ローチヤートである。(1) Transmission Operation FIGS. 10A to 10C are flowcharts showing the data transmission operation.
今、仮に端末装置Aから端末装置Nに対して特
定のデータを送信するものとする。 Now, suppose that specific data is to be transmitted from terminal device A to terminal device N.
まず、ステツプn1(以下ステツプniを単にni
という)で、端末装置Aは送信データ転送制御回
路1の書込みレジスタaに対して1バイトのデー
タを書き込むとともに、フラグWENをセツトす
る。この時、端末装置Aからは送信データ長(バ
イト数)と、データをどのチヤネルで取り扱うか
を指定するチヤネル情報CHnとが上記データと
ともに送られて所定のエリアにセツトされる。 First, step n1 (hereinafter step ni is simply ni)
), the terminal device A writes 1 byte of data to the write register a of the transmission data transfer control circuit 1, and sets the flag WEN. At this time, the terminal device A sends the transmission data length (number of bytes) and channel information CHn specifying which channel to use for handling the data together with the data and sets it in a predetermined area.
これらのデータを受信した転送制御回路1は、
送信データのDMA転送チヤネルであるDRQ3チ
ヤネル(インターフエイス内でデータ転送に用い
るチヤネル)を選択し、DMAC3に対してDMA
転送を指示する(n2)。DMAC3はその指示を
受けると、メモリ4の転送先アドレスを設定し
(n3)、そのアドレスにある送信バツフアAにレ
ジスタaのデータを転送する(n4)。1バイト
の転送が終了すると、フラグWENをリセツトす
る(n5)。端末装置Aは上記フラグWENを監
視していて、リセツトされるのを知ると(n2
1)、n20へ戻つて次の1バイトのデータをレ
ジスタaに送る。こうして、端末装置Aではフラ
グWENを監視し、そのフラグがリセツトされる
毎に1バイトのデータをレジスタaに書き込む一
方、インターフエイス側では、DMACによつて、
レジスタaのデータを送信バツフアAに順次
DMA転送する。総てのデータの転送を終結する
と、端末装置AはフラグWEDをセツトしに行く
(n22)。このフラグWEDがセツトされると、
制御回路1は、n7、n8で指定バイト数の確認
チエツクと送信コマンドのチエツクを行い、正し
いときn9へ進む。DMAC3は、n9,n10
でバツフアAからバツフアBへのデータのDMA
転送を実行する。転送が終了すれば、送信バツフ
アが空き状態であることを示すためにフラグ
WEDをリセツトする(n11)。端末装置Aは、
フラグWEDがリセツト状態であることを知ると、
次に送信すべきデータがある場合に、上記と同じ
ようにして送信データをバツフアAに転送する。 The transfer control circuit 1 that received these data,
Select the DRQ3 channel (the channel used for data transfer within the interface), which is the DMA transfer channel for the transmit data, and send the DMA to DMAC3.
Instruct transfer (n2). Upon receiving the instruction, the DMAC 3 sets a transfer destination address in the memory 4 (n3), and transfers the data in register a to the transmission buffer A at that address (n4). When the transfer of 1 byte is completed, the flag WEN is reset (n5). Terminal device A monitors the above flag WEN, and when it learns that it will be reset (n2
1), return to n20 and send the next 1 byte of data to register a. In this way, terminal device A monitors flag WEN and writes 1 byte of data to register a each time the flag is reset, while on the interface side, DMAC writes 1 byte of data to register a.
Sequentially send data in register a to transmit buffer A
Perform DMA transfer. After completing the transfer of all data, the terminal device A goes to set the flag WED (n22). When this flag WED is set,
The control circuit 1 checks the specified number of bytes and the transmission command at n7 and n8, and if correct, proceeds to n9. DMAC3 is n9, n10
DMA of data from buffer A to buffer B
Perform the transfer. Once the transfer is complete, a flag is set to indicate that the transmit buffer is free.
Reset WED (n11). Terminal device A is
Knowing that the flag WED is in the reset state,
If there is data to be transmitted next, the transmitted data is transferred to buffer A in the same manner as above.
一方、上記のようにして送信バツフアBに送信
データが準備されると、インターフエイスの動き
を制御するCPU5は送信指示を行い(n30)、
リンクコントローラ7を送信レデイ状態に設定す
る(n31)。このときリンクコントローラ7は、
キヤリア検出回路CDで得た信号CD2をチエツク
し、「ロー」であれば直ちにライン制御回路8を
介して、パケツトの最初のデータであるリーデイ
ングフラグFをライン上に送出する(n32)。
続いてCPU5はDMAC3にメモリ4のバツフア
Bの先頭アドレスとデータのバイト数を設定し
(n33,n34)、バツフアBからリンクコント
ローラ7へのデータ転送を指示する。この間リン
クコントローラ7は、上記のリーデイングフラグ
Fを送出したままであるが、n34を終えると同
フラグFの送出を停止する(n35)。 On the other hand, when the transmission data is prepared in the transmission buffer B as described above, the CPU 5, which controls the movement of the interface, issues a transmission instruction (n30).
The link controller 7 is set to a transmission ready state (n31). At this time, the link controller 7
The signal CD2 obtained by the carrier detection circuit CD is checked, and if it is "low", the leading flag F, which is the first data of the packet, is immediately sent out on the line via the line control circuit 8 (n32).
Next, the CPU 5 sets the start address and the number of data bytes of the buffer B in the memory 4 in the DMAC 3 (n33, n34), and instructs data transfer from the buffer B to the link controller 7. During this time, the link controller 7 continues to send out the above-mentioned leading flag F, but after completing n34, it stops sending out the same flag F (n35).
リーデイングフラグFの連続送出は、このn3
2〜n35の段階で行うことになる。 Continuous sending of the leading flag F is performed by this n3
This will be done in stages 2 to n35.
次に、データ転送先であるリンクコントローラ
7の送信用バツフアCが空き状態で(n36)、
且つリンクコントローラ7よりDMAC3に対し
てバツフアCへのデータ転送可信号が送出される
と(n37)、n38で1バイト分のデータがバ
ツフアBからバツフアCへ転送される。リンクコ
ントローラ7はさらにバツフアCへの転送データ
をシフトレジスタDに転送し、1バイト分、シフ
トレジスタDへ転送すると(n40)、再びn3
7へ戻つてDMA転送を実行するとともに、シフ
トレジスタDのデータをライン制御回路8に送つ
て、変調後ラインへ送出する(n41〜n44)。
後述するように、以上の動作が二つ以上の端末で
同時に行われていた場合は、少なくともデータの
うちソースアドレスを送出した時に衝突が発生す
るが、この衝突が衝突検出回路COで検出された
ときはn44からn60へ進んで送信を禁止す
る。今、衝突がないものとすると、リンクコント
ローラ7は順次バツフアCからシフトレジスタD
への転送を行い、前述のようにしてバツフアCへ
DMA転送されるデータを順次ライン制御回路8
へ送る。この動作n37〜n45を繰り返して行
き、指定されたデータ長の送出を完了すると
DMAC3は内蔵するバイトカウンタがカウント
アツプすることにより、リンクコントローラ7へ
フレーム送出完了を告げる(n46)。これを受
けたリンクコントローラ7は、CRCを付け、1
フレームのデータ送出を完了する。そして、リン
クコントローラ7はCPU5に対し、1フレーム
のデータ送信が完了したことを示すインターラプ
ト信号を送り(n47)、CPU5はリンクコント
ローラ7を介して、ライン制御回路8にトレーリ
ングフラグFの送出を指示する(n48)。トレ
ーリングフラグFは、CPU5が送信完了処理を
行い(n49)、受信準備処理を行う(n50)
まで継続して送出し、これらの処理が完了した時
点でフラグ送出を停止するとともに(n51)、
インターフエイスを受信モードに設定する(n5
2)。 Next, when the transmission buffer C of the link controller 7, which is the data transfer destination, is in an empty state (n36),
When the link controller 7 sends a data transfer enable signal to the buffer C to the DMAC 3 (n37), one byte of data is transferred from the buffer B to the buffer C at n38. The link controller 7 further transfers the data transferred to the buffer C to the shift register D, transfers 1 byte to the shift register D (n40), and then transfers the data to the buffer C again to the shift register D (n40).
7 and executes DMA transfer, and at the same time sends the data in the shift register D to the line control circuit 8, and sends it out to the line after modulation (n41 to n44).
As will be explained later, if the above operations are performed simultaneously on two or more terminals, a collision will occur at least when sending the source address of the data, but this collision will be detected by the collision detection circuit CO. If so, the process advances from n44 to n60 to prohibit transmission. Now, assuming that there is no collision, the link controller 7 sequentially moves from buffer C to shift register D.
Transfer to Bathua C as described above.
The data to be transferred by DMA is sequentially transferred to the line control circuit 8.
send to Repeat these operations n37 to n45, and when the specified data length has been sent,
The DMAC 3 increments its built-in byte counter to notify the link controller 7 of completion of frame transmission (n46). Upon receiving this, the link controller 7 attaches a CRC and 1
Complete frame data transmission. Then, the link controller 7 sends an interrupt signal to the CPU 5 indicating that data transmission of one frame has been completed (n47), and the CPU 5 sends a trailing flag F to the line control circuit 8 via the link controller 7. (n48). For the trailing flag F, the CPU 5 performs transmission completion processing (n49) and reception preparation processing (n50).
When these processes are completed, the flag transmission is stopped (n51).
Set the interface to receive mode (n5
2).
トレーリングフラグFが上記のようにして連続
送信されている間は、当然信号CD2が「ハイ」
の状態を保持している。したがつて他の端末から
のアクセスは禁止されている。また、後述のよう
に端末装置Nでは、トレーリングフラグFを受信
している間信号CD1が「ハイ」にあるため、応
答パケツトの送信待ち状態にある。 While the trailing flag F is being continuously transmitted as described above, the signal CD2 is naturally high.
maintains the state of Therefore, access from other terminals is prohibited. Furthermore, as will be described later, in the terminal device N, since the signal CD1 is "high" while receiving the trailing flag F, the terminal device N is in a state of waiting for transmission of a response packet.
次にn44において、データパケツトが衝突し
た場合の動作を説明する。 Next, in n44, the operation when data packets collide will be explained.
データパケツトの衝突は、各端末によるアクセ
スが平等である共通チヤネル方式において、同時
に二つ以上の端末が送信しようとするときに生じ
る。信号CD2によつてアクセスタイミングが完
全に異なる場合の衝突は防止されるが、相互に離
れた端末間では伝播遅延が大きいため、他の端末
の送信を検出するまで時間がかかる。その結果、
衝突が起こりやすくなる。一般に、共通チヤネル
方式を採用したローカルネツトワークシステムで
は、上記の問題を解決するために、衝突検出後一
定時間を待つて再送するようにしている。この処
理をバツクオフ処理という。n60以下はこのバ
ツクオフ処理を行う手順である。 Data packet collisions occur when two or more terminals attempt to transmit at the same time in a common channel scheme where each terminal has equal access. Although the signal CD2 prevents collisions when the access timings are completely different, since the propagation delay is large between mutually distant terminals, it takes time to detect the transmission of another terminal. the result,
Collisions are more likely to occur. Generally, in a local network system that employs a common channel method, in order to solve the above problem, data is retransmitted after waiting a certain period of time after a collision is detected. This process is called back-off process. The steps below n60 are the steps for performing this back-off process.
衝突が衝突検出回路COで検出されると、デー
タパケツトを送信した端末はすべて送信を停止す
る(n60)。次に他の端末が衝突が発生したこ
とを容易に検出できるようにするためラインを
「ハイ」に持ち上げる(n61)。続いて信号CD
2の立ち下がりを検出し(n62)、その立ち下
がりタイミングでメモリ4に設けてある乱数テー
ブルTBLから所定のバツクオフタイマー値を読
みだし(n63)、制御回路6のタイマーTにそ
の値を設定する(n64)。続いてこのようにし
てセツトした所定時間が経過すれば(n65)、
CPU5は再度信号CD2の状態を検出し、そのレ
ベルが「ロー」であつてアクセス可能なときであ
れば、n30へ戻つて上述した送信動作を繰り返
す。信号CD2のレベルが「ハイ」であつてライ
ン使用が許可されない状態であれば、n67へ進
んで信号CD2が立ち下がるタイミングで再びバ
ツクオフタイマーを起動して(n64)、タイマ
ー経過時点が信号CD2のオフ状態になるときを
待つ。 When a collision is detected by the collision detection circuit CO, all terminals that have transmitted data packets stop transmitting (n60). Next, the line is raised to "high" so that other terminals can easily detect that a collision has occurred (n61). Then the signal CD
2 is detected (n62), and at the falling timing, a predetermined back-off timer value is read from the random number table TBL provided in the memory 4 (n63), and the value is set in the timer T of the control circuit 6. (n64). Subsequently, when the predetermined time set in this way has elapsed (n65),
The CPU 5 detects the state of the signal CD2 again, and if the level is "low" and access is possible, the process returns to n30 and repeats the above-described transmission operation. If the level of signal CD2 is "high" and line use is not permitted, the process advances to n67 and starts the back-off timer again at the timing when signal CD2 falls (n64). Wait until the switch is turned off.
第12図はA,B,C端末がほぼ同時(伝播遅
延等を原因に若干の誤差がある)にアクセスしよ
うとして衝突が生じたときの動作を示す。A,
B,C各端末が図示するように衝突を検出する
と、直ちに送信を停止して、信号CD2の立ち下
がりタイミングで、それぞれの端末で乱数テーブ
ルで発生させたバツクオフタイマー値t1,t
2,t3をスタートする。時間t1を経過した時
点でA端末は、信号CD2の状態を検出する。こ
のときB端末およびC端末はタイマー値t2,t
3が経過していないので送信をすることが出来な
い。したがつてその他の端末からのアクセスがな
い限り、信号CD2はオフ状態にあるためA端末
からの再送が可能になる。この例ではA端末から
B端末に対してデータパケツトを送信するケース
を示している。衝突があつたため送信出来なかつ
た他のB端末およびC端末については、A端末の
送信が成功した後に再送が試みられる。この方法
は上記と同様に行う。すなわち、信号CD2の立
ち下がりタイミングでタイマー値t2,t3をス
タートし、B端末は時間t2が経過した時点で信
号CD2の状態をチエツクして、オフであれば再
送をする。また、C端末は時間t3が経過した時
点で信号CD2をチエツクし、オフであれば再送
する。こうしてバツクオフ処理をしながら衝突し
た端末からの送信の順番を整理していく。 FIG. 12 shows the operation when terminals A, B, and C attempt to access almost simultaneously (with some errors due to propagation delays, etc.) and a collision occurs. A,
When each terminal B and C detects a collision as shown in the figure, they immediately stop transmitting, and at the falling timing of signal CD2, the back-off timer values t1, t generated by the random number table in each terminal are set.
2. Start t3. When time t1 has elapsed, terminal A detects the state of signal CD2. At this time, terminal B and terminal C have timer values t2, t
3 has not yet passed, so it cannot be sent. Therefore, as long as there is no access from other terminals, signal CD2 is in the OFF state, allowing retransmission from terminal A. This example shows a case where a data packet is transmitted from terminal A to terminal B. Regarding the other B terminals and C terminals that could not transmit due to the collision, retransmission is attempted after the A terminal's transmission is successful. This method is carried out in the same manner as above. That is, timer values t2 and t3 are started at the falling timing of signal CD2, and the B terminal checks the state of signal CD2 when time t2 has elapsed, and if it is off, retransmits. Furthermore, the C terminal checks the signal CD2 when time t3 has elapsed, and if it is off, retransmits it. In this way, the order of transmissions from colliding terminals is sorted out while performing back-off processing.
以上のように、この実施例ではバツクオフタイ
マーの起動時点を信号CD2の立ち下がりタイミ
ングに設定し、端末の種類に無関係に同一のタイ
ミングでスタートするようにしている。このた
め、再び衝突が生じる確率を小さく出来、バツク
オフタイマーの精度を向上出来る利点がある。な
お、n64でセツトされるバツクオフタイマー値
は、新たな衝突が生じない限り次にn64でセツ
トされるときも同じ値となるようにしている。 As described above, in this embodiment, the starting point of the back-off timer is set at the falling timing of the signal CD2, so that it starts at the same timing regardless of the type of terminal. Therefore, there is an advantage that the probability that a collision will occur again can be reduced and the accuracy of the back-off timer can be improved. The backoff timer value set at n64 is set to the same value the next time it is set at n64 unless a new collision occurs.
以上の動作によつてライン上に送出されるデー
タパケツトの構成を第13図に示す。 FIG. 13 shows the structure of the data packet sent out on the line by the above operation.
同図に示すように、パケツトの先頭にm個のリ
ーデインフラグFが位置し、パケツトの終りにj
個のトレーリングフラグFが位置している。前述
のようにm個のフラグはn32〜n35で送出さ
れ、j個のフラグはn48〜n51で送出され
る。このようにパケツトの先頭と終りにフラグを
連続させることによつて、送信端末は終りのフラ
グ連続送出の時間に受信準備をすることが出来、
受信端末は、連続するリーデイングフラグを受信
する間にモードを正常な受信モードにすることが
出来る。 As shown in the figure, m lead flags F are located at the beginning of the packet, and j lead flags F are located at the end of the packet.
Trailing flags F are located. As described above, m flags are sent out from n32 to n35, and j flags are sent out from n48 to n51. By consecutively placing flags at the beginning and end of the packet in this way, the transmitting terminal can prepare for reception at the time when the end flag is continuously sent.
The receiving terminal can change the mode to normal receiving mode while receiving consecutive reading flags.
送信端末が終りのフラグ連続送出の時間に受信
準備出来るのは、前述のようにn48〜n51の
ステツプから明らかである。そして、この時間に
は信号CD2の「ハイ」によつて他の端末からの
アクセスが禁止される。また、信号CD1の「ハ
イ」によつて、端末装置NからのACKパケツト
の送信も禁止される。 It is clear from the steps n48 to n51 as described above that the transmitting terminal can prepare for reception at the time of the final flag continuous transmission. During this time, access from other terminals is prohibited due to the "high" level of the signal CD2. Furthermore, the transmission of an ACK packet from the terminal device N is also prohibited due to the "high" level of the signal CD1.
受信端末が正常な受信モードに設定される場合
は、前述したようにデータパケツトが衝突して、
一定時間後に再送されようとしているときであ
る。このときの動作についてもういちど説明す
る。たとえば、受信端末が二つ以上の送信端末か
ら同時に受信したとすると、ソースアドレスを受
信したときで衝突を検出する。このとき、受信端
末はリーデイングフラグを既に受信しており、し
かも受信モードはリセツトされないからデータ待
ち状態にある。しかし、衝突を起こした二つの送
信端末は送信を打ち切つて、次のチヤンスを待つ
ている状態にある。そこでどちらかの端末或いは
他の端末から新たなデータパケツトの送信があれ
ば、データ待ち状態にある受信端末は最初のリー
デイングフラグをトレーリングフラグと見なして
(リーデイングフラグとトレーリングフラグとは
ともに「7E」の同一コードにある)、そのリー
デイングフラグを受けた時点でパケツトのフオマ
ツトが間違つていることを検出し(フオマツト長
が短い)、エラー処理を行う。したがつて、この
ような場合、もしリーデイングフラグが1個であ
ると、エラー処理を行つた後の受信データも、リ
ーデイングフラグが無いと見なしてエラー処理を
行う可能性がある。 If the receiving terminal is set to normal receiving mode, data packets will collide as described above, and
This is when the message is about to be retransmitted after a certain period of time. The operation at this time will be explained once again. For example, if a receiving terminal receives signals from two or more transmitting terminals at the same time, a collision is detected when the source address is received. At this time, since the receiving terminal has already received the reading flag and the receiving mode has not been reset, it is in a data waiting state. However, the two transmitting terminals that caused the collision have terminated their transmission and are waiting for the next chance. Therefore, when a new data packet is transmitted from either terminal or another terminal, the receiving terminal in the data waiting state regards the first leading flag as the trailing flag (the leading flag and the trailing flag are both "7E"). ), and upon receiving the reading flag, it detects that the format of the packet is incorrect (the format length is short) and performs error processing. Therefore, in such a case, if there is only one reading flag, there is a possibility that the received data after error processing will be treated as having no reading flag and error processing will be performed.
これに対して、データパケツトにリーデイング
フラグを適当な数だけ連続させれば、受信端末は
最初のリーデイングフラグを受信したときに、次
以降のフラグ受信時間でエラー処理を行い、正常
な受信モードになつたときにまだ続いているリー
デイングフラグを次回のパケツトのフラグとして
処理することが可能になる。 On the other hand, if an appropriate number of leading flags are consecutively placed in a data packet, when the receiving terminal receives the first leading flag, it will process the error at the reception time of the next flag and enter normal receiving mode. It becomes possible to process the still continuing reading flag as a flag for the next packet.
以上のように、m個のリーデイングフラグおよ
びj個のトレーリングフラグを付けることによつ
て、送信端末と受信端末とが常にパケツトを正常
に受信出来る状態にすることが出来る。 As described above, by attaching m leading flags and j trailing flags, it is possible to maintain a state in which the transmitting terminal and the receiving terminal can always receive packets normally.
(2) 受信動作
第11図A〜Cは、データの受信動作を示すフ
ローチヤートである。(2) Reception operation FIGS. 11A to 11C are flowcharts showing the data reception operation.
上記のようにしてライン上に送出されたデータ
パケツトは、端末装置N側のライン制御回路9で
受信され(n70)、復調されて(n71)リン
クコントローラ7のシフトレジスタEへ導かれる
(n72)。リンクコントローラ7は受信したデー
タの最初の1バイトがフラグかフラグ以外かを判
定し、フラグである場合は続いて次にくる1バイ
トのデータをシフトレジスタEに導く。フラグ以
外である場合は、デイステイネーシヨンアドレス
DAを読み取つてそのアドレスが自己アドレスか
どうかを判定し(n75)、自己アドレスに一致
している場合にn76へ進む。n76でシフトレ
ジスタEの受信データを受信バツフアFに転送
し、DMAC3に対して受信データ有りの指示を
行う(n77)。同時にデータをバツフアGに転
送するチヤネルとしてDRQ1を選択する。受信
データ有りの指示を受けたDMAC3は、上記受
信バツフアFの受信データをメモリ4のバツフア
Gに順次転送する。バツフアGはチヤネル数だけ
設けられていて、受信データはパケツトで指定さ
れるチヤネル番号に対応する部分に転送される。
この転送は、レジスタEに導かれるデータを1バ
イトづつ行い、データの区切りを示すフラグ(ト
レーリングフラグ)を検出した段階で受信を完了
したと判断して(n79)、リンクコントローラ
7はCPU5に対して受信完了指示を行う(n8
0)。この指示を受けたCPU5は受信モードを禁
止するとともに、送信されてきたデータの種別を
判定する。データ情報であるときは、受信時にお
いて端末装置がレデイ状態にあつて受信できるか
どうかを受信データ転送制御回路2内のフラグ
RDYによつて判定する(n89)。このフラグ
RDYは、端末装置によつて制御され、端末装置
が受信可能の状態にあるときはセツトされてい
る。そして受信可能であるなら、続いて指定チヤ
ネル(第9図のCH.Noで指定される)の受信バ
ツフアG(メモリ4内)が空き状態にあるかどう
かを判定される(n90)。前述のようにこの受
信バツフアGはチヤネル数用意されていて、各チ
ヤネルが空き状態にあるかどうかは、受信データ
転送制御回路2内のフラグRENによつて示され
るようにしている。すなわち、任意のチヤネルの
受信バツフアが空いている場合、そのチヤネルに
対応するフラグRENはセツトされる。反対にバ
ツフアフルの状態にある場合、そのチヤネルに対
応するフラグRENはリセツトされる。n90で
指定されたチヤネルの受信バツフアが空き状態に
あると、データパケツトを送信してきた端末に
ACKパケツトを送信する(n91)。第11図に
は示していないが、このACKパケツトの組立は
CPU5によつて行う。第9図から明らかなよう
に、ACKパケツトの組立は極めて簡単であり、
デイステイネーシヨンアドレスDAを除く他のデ
ータは固定コードとなる。デイステイネーシヨン
アドレス自体も作成する必要が無く、送られてき
たデータパケツトのソースアドレスSAをそのま
ま使用すれば良い。ACKパケツトの送信は、当
然、ラインLにキヤリアがないとき、すなわち信
号CD1が「ロー」にあるときに行われる。キヤ
リア検出回路COがキヤリアを検出しているとき
には、n91においてACKパケツトの送信待ち
状態にある。したがつて、端末装置Aにおいてト
レーリングフラグFを連続送信している間は、端
末装置N側はn91においてACKパケツト送信
待ち状態となる。ACKパケツト送信後、CPU5
は受信データ転送制御回路2内のデータ有りフラ
グREN(指定チヤネルの)をセツトし(n92)、
再受信モードにセツトされる。 The data packet sent onto the line as described above is received by the line control circuit 9 on the terminal device N side (n70), demodulated (n71), and guided to the shift register E of the link controller 7 (n72). The link controller 7 determines whether the first byte of the received data is a flag or something other than a flag, and if it is a flag, guides the next byte of data to the shift register E. If it is other than a flag, the destination address
The DA is read and it is determined whether the address is the own address (n75), and if it matches the own address, the process proceeds to n76. At n76, the received data of the shift register E is transferred to the reception buffer F, and an instruction is given to the DMAC 3 that there is received data (n77). At the same time, DRQ1 is selected as the channel for transferring data to buffer G. The DMAC 3, which has received the instruction that there is data to be received, sequentially transfers the received data in the reception buffer F to the buffer G in the memory 4. There are as many buffers G as there are channels, and the received data is transferred to the portion corresponding to the channel number specified in the packet.
This transfer is performed byte by byte of data guided to register E, and when a flag (trailing flag) indicating a data break is detected, it is determined that reception is complete (n79), and the link controller 7 transfers the data to the CPU 5. Instructs reception completion to (n8
0). Upon receiving this instruction, the CPU 5 prohibits the reception mode and determines the type of the transmitted data. If it is data information, a flag in the reception data transfer control circuit 2 indicates whether the terminal device is in a ready state and can receive data at the time of reception.
Determine by RDY (n89). this flag
RDY is controlled by the terminal device and is set when the terminal device is ready to receive. If reception is possible, then it is determined whether the reception buffer G (in the memory 4) of the designated channel (designated by CH.No. in FIG. 9) is free (n90). As mentioned above, this reception buffer G is provided with a number of channels, and the flag REN in the reception data transfer control circuit 2 indicates whether each channel is in an empty state. That is, if the reception buffer of any channel is empty, the flag REN corresponding to that channel is set. Conversely, if the channel is in a buffer-full state, the flag REN corresponding to that channel is reset. If the receiving buffer of the channel specified by n90 is free, the terminal sending the data packet will receive
Send an ACK packet (n91). Although not shown in Figure 11, the assembly of this ACK packet is
This is done by CPU5. As is clear from Figure 9, the assembly of the ACK packet is extremely simple.
Other data except the destination address DA is a fixed code. There is no need to create a destination address itself, and the source address SA of the sent data packet can be used as is. The transmission of the ACK packet naturally takes place when there is no carrier on line L, ie when signal CD1 is "low". When the carrier detection circuit CO is detecting a carrier, it is in a state of waiting for transmission of an ACK packet at n91. Therefore, while the terminal device A is continuously transmitting the trailing flag F, the terminal device N side enters the ACK packet transmission waiting state at n91. After sending the ACK packet, CPU5
sets the data presence flag REN (of the specified channel) in the reception data transfer control circuit 2 (n92),
Set to re-receive mode.
n89において、端末装置Nが受信不可である
場合は、n93でNRDYパケツトを送信して再
受信モードに戻る。また、n90で受信バツフア
フルである場合、すなわち指定チヤネルに対応す
るフラグRENがセツトされている場合は、n9
4でバツフアフル(NRDY)パケツトを送信し
て再受信モードに戻る。この場合も、NRDYパ
ケツトの送信は、トレーリングフラグの送信完了
を待つて行う。 If the terminal device N is unable to receive data at n89, an NRDY packet is transmitted at n93 and the process returns to the re-receiving mode. Also, if the reception buffer is full on n90, that is, when the flag REN corresponding to the specified channel is set, n90
In step 4, send a buffer full (NRDY) packet and return to re-reception mode. In this case as well, the NRDY packet is transmitted after waiting for the completion of the trailing flag transmission.
なお、図示していないがACKパケツト、およ
びNRDYパケツトの送信においても、トレーリ
ングフラグFを受信準備が完了するまで連続送信
するようにしている。この結果、端末装置Aから
のRACKパケツトも、端末装置Nが受信準備完
了となつたときに送られてくることになる。 Although not shown, the trailing flag F is continuously transmitted in the transmission of ACK packets and NRDY packets until preparation for reception is completed. As a result, the RACK packet from terminal device A will also be sent when terminal device N is ready to receive it.
以上の動作において、受信データが、データ,
ACK,RACK,NRDYおよびバツフアフルのい
ずれでも無い場合はエラーとして処理される。し
たがつて、データパケツトの衝突が発生して、受
信側で衝突時のデータを受信し、次いで再送パケ
ツトのリーデイングフラグFを受信したときに
は、上記のいずれのデータでもないとしてn86
→n97へと抜けて再受信モードに再設定され
る。なお、実際にはn86→n97へと抜けると
きに、前回受信したデータをクリアする処理(エ
ラー処理の一つ)を行う。このように衝突後、デ
ータパケツトが再送されるときには、再送パケツ
トの最初のリーデイングフラグFを受信した後エ
ラー処理を行い、続いて再受信モードに設定して
n70において次のパケツトの受信を行う。再送
パケツトの始めにはリーデイングフラグFが連続
しているため、n70に戻つたときには、再送パ
ケツトのリーデイングフラグFから受信を始め
る。すなわち、再送パケツトが正常なフオマツト
で受信されることになる。 In the above operation, the received data is
If it is not ACK, RACK, NRDY, or buffer full, it will be treated as an error. Therefore, when a collision of data packets occurs and the receiving side receives the data at the time of the collision and then receives the leading flag F of the retransmitted packet, it is determined that none of the above data is present and the data is n86.
→The device exits to n97 and is reset to re-receive mode. In fact, when exiting from n86 to n97, a process (one of error processes) to clear the previously received data is performed. When a data packet is retransmitted after a collision in this way, error processing is performed after receiving the first leading flag F of the retransmitted packet, and then the re-reception mode is set and the next packet is received at n70. Since the leading flag F is consecutive at the beginning of the retransmitted packet, when the process returns to n70, reception starts from the leading flag F of the retransmitted packet. That is, the retransmitted packet will be received in a normal format.
一方、端末装置Aでは、端末装置Nで上記のn
91において送信されたACKパケツトが受信さ
れるため、n82→n83→n95へと進む。通
常の場合データパケツト送信後はACKパケツト
待ち状態に遷移するため、n95→n96と進
み、ACKパケツト送信端末つまり端末装置Nに
対してRACKパケツトを送信し(n96)、送受
信制御部を受信モードに設定する(n97)。 On the other hand, terminal device A uses the above n in terminal device N.
Since the ACK packet transmitted at step 91 is received, the process proceeds from n82 to n83 to n95. In normal cases, after transmitting a data packet, the state transitions to an ACK packet wait state, so the process proceeds from n95 to n96, transmits a RACK packet to the ACK packet transmitting terminal, that is, terminal device N (n96), and sets the transmission/reception control unit to reception mode. (n97).
なお、n91でのACKパケツト送信、および
n96でのRACKパケツト送信は、いずれも送
信タイマーT1によつて時間管理され、ACKパ
ケツト送信が所定の回数失敗したとき、および
ACKパケツトを所定回数送信してもRACKパケ
ツトを送信出来ないとき、エラー処理がなされる
ようにしている。 Note that both the ACK packet transmission at n91 and the RACK packet transmission at n96 are time-controlled by a transmission timer T1, and when ACK packet transmission fails a predetermined number of times,
If a RACK packet cannot be transmitted even after transmitting ACK packets a predetermined number of times, error handling is performed.
上記のようにして端末装置AでRACKパケツ
トが送信されると、端末装置Nではn82→n8
3→n84→n98と進む。通常の状態遷移とな
るときはRACKパケツトの受信時にはすでに
ACKパケツトの送信を終了しているから、n9
8→n97へと進んで受信モードの設定をする。
もし、ACKパケツトを送信していない状態で
RACKパケツトを受信したときには、ACKパケ
ツトの再送を行つて(n99)受信モードの設定
をする(n97)。また、n85で受信パケツト
がNRDYパケツトである場合、n85→n10
0へと進む。通常NRDYパケツトを受信する場
合は、データパケツト送信後であるから、n10
0→n101へと進んで、端末装置に相手側が
NRDY状態(データの受付が出来ない状態)に
あることを知らせて、受信モードを設定する(n
97)。 When terminal device A transmits the RACK packet as described above, terminal device N changes n82→n8.
Proceed as 3 → n84 → n98. Normal state transition occurs when the RACK packet is received.
Since the transmission of the ACK packet has finished, n9
8→n97 to set the reception mode.
If the ACK packet is not sent,
When the RACK packet is received, the ACK packet is retransmitted (n99) and the reception mode is set (n97). Also, if the received packet at n85 is an NRDY packet, n85 → n10
Proceed to 0. Normally, when receiving an NRDY packet, it is after the data packet is sent, so n10
0 → n101, and the other party is on the terminal device.
Notify that the device is in NRDY state (state where data cannot be received) and set the reception mode (n
97).
応答パケツトの送信は、以上のようにn82以
下において行われるが、データパケツトを正常に
受信してACKパケツトを送信したときには、送
受信データ転送制御回路を介して、端末装置側と
の間で受信データの転送処理が行われる。この手
順をn110以下に示す。 Transmission of the response packet is performed at n82 and below as described above, but when the data packet is normally received and the ACK packet is transmitted, the received data is exchanged with the terminal device via the transmit/receive data transfer control circuit. Transfer processing is performed. This procedure is shown below n110.
n110において、端末装置Nは、図示しない
メインCPUが指定するチヤネルに対応したフラ
グRENのセツト有無をチエツクする。そのチヤ
ネルに対応するフラグRENがセツトされていれ
ば、受信データリードコマンドが受信データ制御
回路2に与えられる(n111)。そして上記フ
ラグRENをリセツトするとともに(n112)、
CPU5はメモリ5のバツフアG(指定チヤネル番
号の)の先頭アドレスおよび受信データ長(バイ
ト数)をDMAC3にセツトしてDMA転送の準備
を行う(n113)。さらにCPU5は、データ転
送のために使用するチヤネル(上記指定チヤネル
とは異なりインターフエイス内のデータ転送チヤ
ネルを指す)をDRQ2に設定し(n114)、
DMA転送を指示する(n115)。するとバツ
フアGからレジスタbに対して1バイト分のデー
タが転送され(n116)、端末装置Nに対して
インターラプト信号が出力される(n117)。
端末装置Nは、このインターラプト信号を受ける
と、n130→n131へと進んでレジスタbに
転送されたデータの取込みを行う。一方、データ
有りフラグRENがn112でリセツトされてい
るため、n78でバツフアFから新たな1バイト
分のデータがバツフアGに転送されてくる。そし
て同時にn77でフラグRENを再セツトする。
したがつて、n110以下が再び実行され、n1
16で次の1バイトのデータがレジスタHにセツ
トされ、端末装置Nがそのデータをn131で取
り込む。この動作を繰り返して、バツフアGのデ
ータがレジスタbを介して総て取り込まれたとき
にDMA転送が完了して、n119→n120へ
進んでDMAC3は、動作を停止する。 At n110, the terminal device N checks whether the flag REN corresponding to the channel specified by the main CPU (not shown) is set. If the flag REN corresponding to that channel is set, a received data read command is given to the received data control circuit 2 (n111). Then, the above flag REN is reset (n112),
The CPU 5 sets the start address and received data length (number of bytes) of the buffer G (of the specified channel number) in the memory 5 in the DMAC 3 to prepare for DMA transfer (n113). Furthermore, the CPU 5 sets the channel used for data transfer (different from the above specified channel, refers to the data transfer channel within the interface) to DRQ2 (n114),
Instructs DMA transfer (n115). Then, one byte of data is transferred from buffer G to register b (n116), and an interrupt signal is output to terminal device N (n117).
When the terminal device N receives this interrupt signal, it proceeds from n130 to n131 and takes in the data transferred to register b. On the other hand, since the data presence flag REN has been reset at n112, one new byte of data is transferred from buffer F to buffer G at n78. At the same time, the flag REN is reset at n77.
Therefore, n110 and below are executed again and n1
The next 1 byte of data is set in register H at step 16, and the terminal device N takes in this data at step n131. This operation is repeated, and when all the data in buffer G is taken in through register b, the DMA transfer is completed, the process proceeds from n119 to n120, and DMAC 3 stops operating.
端末装置N側は、受信データのバイト数と実際
に取り込んだデータのバイト数が一致するかどう
かをチエツクし、一致すれば取り込んだデータを
所望のフオマツトに加工し(n133)、その加
工処理が完了すれば(n134)、受信データ転
送制御回路2のフラグREDをセツトして(n1
35)取込み完了をインターフエイス側に知らせ
る。インターフエイス側のCPU5は、このフラ
グREDのセツトを検出すると(n121)、その
フラグREDをリセツトして(n122)次期デ
ータの送受信に備える。 The terminal device N side checks whether the number of bytes of the received data matches the number of bytes of the actually captured data, and if they match, processes the captured data into the desired format (n133), and the processing process is completed. When completed (n134), the flag RED of the reception data transfer control circuit 2 is set (n1
35) Notify the interface side of the completion of import. When the CPU 5 on the interface side detects that the flag RED is set (n121), it resets the flag RED (n122) and prepares for the next data transmission/reception.
以上のようにして、端末装置Aから端末装置N
に対して特定のデータの送信が行われる。 In the above manner, from terminal device A to terminal device N
Specific data is sent to.
第1図はこの発明を実施するローカルネツトワ
ークシステムのブロツク構成図である。第2図は
伝送インターフエイスI/Fのブロツク構成図、
第3図はさらにその詳細なブロツク構成図であ
る。第4図はライン制御回路8に設けられる衝突
検出回路の回路図である。第5図はライン制御回
路9に設けられるキヤリア検出回路の回路図であ
る。また第6図は同キヤリア検出回路のタイミン
グチヤートである。第7図はライン上の信号と信
号CD1,CD2との関係を示している。第8図は
このローカルネツトワークでの基本的な伝送手順
を示す。第9図はパケツトフオマツトを示す図で
ある。第10図A〜Cはデータの送信動作を示す
フローチヤートである。第11図A〜Cはデータ
の受信動作を示すフローチヤートである。第12
図はA,B,C端末がほぼ同時にアクセスしよう
として衝突が生じたときの動作を示す。第13図
はライン上に送出されるデータパケツトの構成を
示している。
第2図、10−送信制御回路、11−受信制御
回路、12−送受信データ転送制御回路、第3
図、1−送信データ転送制御回路、2−受信デー
タ転送制御回路、3−DMAC(ダイレクト・メモ
リアクセス・コントローラ)、4−メモリ、5−
サブCPU、6−制御回路、7−リンクコントロ
ーラ、8−ライン制御回路(送信)、9−ライン
制御回路(受信)。
FIG. 1 is a block diagram of a local network system implementing the present invention. Figure 2 is a block diagram of the transmission interface I/F.
FIG. 3 is a more detailed block diagram. FIG. 4 is a circuit diagram of a collision detection circuit provided in the line control circuit 8. FIG. 5 is a circuit diagram of a carrier detection circuit provided in the line control circuit 9. FIG. 6 is a timing chart of the carrier detection circuit. FIG. 7 shows the relationship between the signals on the line and the signals CD1 and CD2. FIG. 8 shows the basic transmission procedure in this local network. FIG. 9 is a diagram showing a packet format. FIGS. 10A to 10C are flowcharts showing the data transmission operation. FIGS. 11A to 11C are flowcharts showing the data receiving operation. 12th
The figure shows the operation when terminals A, B, and C attempt to access almost simultaneously and a collision occurs. FIG. 13 shows the structure of a data packet sent out on the line. FIG. 2, 10-transmission control circuit, 11-reception control circuit, 12-transmission/reception data transfer control circuit, third
Figure 1 - Transmission data transfer control circuit, 2 - Reception data transfer control circuit, 3 - DMAC (Direct Memory Access Controller), 4 - Memory, 5 -
Sub CPU, 6-control circuit, 7-link controller, 8-line control circuit (transmission), 9-line control circuit (reception).
Claims (1)
付けるフオマツト構成のパケツトを用い、データ
伝送ライン上にキヤリアがないと判定したときに
データパケツトを送信し、そのパケツト送信が衝
突したときはその送信を停止するとともに一定時
間後に再送し、再送が成功したときに応答パケツ
トを受信するデータ伝送方式において、パケツト
送信時にその開始フラグを受信エラー処理時間よ
りも長い所定時間継続して送信することを特徴と
する、ローカルネツトワークシステムのデータ伝
送方式。1 Using a formatted packet that flags the start and end positions of transmitted data, transmits a data packet when it is determined that there is no carrier on the data transmission line, and stops transmitting the packet when there is a collision. A data transmission method in which a response packet is retransmitted after a certain period of time and a response packet is received when the retransmission is successful, characterized in that a start flag is continuously transmitted for a specified period of time longer than the reception error processing time when the packet is transmitted. A data transmission method for local network systems.
Priority Applications (5)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP57152985A JPS5941948A (en) | 1982-08-31 | 1982-08-31 | Data transmission system of local network system |
| US06/525,665 US4672543A (en) | 1982-08-31 | 1983-08-23 | Data transmission control apparatus in local network systems |
| GB08322996A GB2126458B (en) | 1982-08-31 | 1983-08-26 | Local network system interface |
| CA000435700A CA1213015A (en) | 1982-08-31 | 1983-08-30 | Data transmission control apparatus in local network systems |
| DE3331233A DE3331233C2 (en) | 1982-08-31 | 1983-08-30 | Data control device in local connection networks |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP57152985A JPS5941948A (en) | 1982-08-31 | 1982-08-31 | Data transmission system of local network system |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPS5941948A JPS5941948A (en) | 1984-03-08 |
| JPH0221705B2 true JPH0221705B2 (en) | 1990-05-15 |
Family
ID=15552437
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP57152985A Granted JPS5941948A (en) | 1982-08-31 | 1982-08-31 | Data transmission system of local network system |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPS5941948A (en) |
Families Citing this family (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS6258745A (en) * | 1985-09-06 | 1987-03-14 | Nec Corp | Multiple address communication system |
| JPH0775362B2 (en) * | 1985-12-23 | 1995-08-09 | 株式会社リコー | Facsimile communication control method |
| JPH0771123B2 (en) * | 1986-05-31 | 1995-07-31 | キヤノン株式会社 | Binary signal receiver |
| JP2571617Y2 (en) * | 1991-01-23 | 1998-05-18 | 矢崎総業株式会社 | Controller for microcomputer meter |
| JP2636534B2 (en) * | 1991-03-22 | 1997-07-30 | 三菱電機株式会社 | Communications system |
| JP3276895B2 (en) * | 1997-01-14 | 2002-04-22 | 矢崎総業株式会社 | Transmission device, reception device, communication device, communication method, and communication system |
Family Cites Families (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS4871547A (en) * | 1971-12-27 | 1973-09-27 | Hitachi Ltd | |
| US4063220A (en) * | 1975-03-31 | 1977-12-13 | Xerox Corporation | Multipoint data communication system with collision detection |
-
1982
- 1982-08-31 JP JP57152985A patent/JPS5941948A/en active Granted
Also Published As
| Publication number | Publication date |
|---|---|
| JPS5941948A (en) | 1984-03-08 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US4672543A (en) | Data transmission control apparatus in local network systems | |
| US4225919A (en) | Advanced data link controller | |
| US4780814A (en) | Global serial channel for microcontroller | |
| JP2707529B2 (en) | Data communication system | |
| US4710871A (en) | Data transmitting and receiving apparatus | |
| EP0129581B1 (en) | Method and apparatus for graceful preemption on a digital communications link | |
| US5978865A (en) | System for performing DMA transfers where an interrupt request signal is generated based on the value of the last of a plurality of data bits transmitted | |
| AU655303B2 (en) | Method and apparatus for data collision detection in a multi-processor communication system | |
| EP0156557A2 (en) | Transceiver for multi-drop local area networks | |
| JPH0795767B2 (en) | Optimized method of data communication and system using the method | |
| JPH0771125B2 (en) | Data communication method and data communication system | |
| US5958024A (en) | System having a receive data register for storing at least nine data bits of frame and status bits indicating the status of asynchronous serial receiver | |
| EP0496177A1 (en) | Method of transmitting data by buffer chaining between a host computer and a communication controller | |
| US5133078A (en) | Serial frame processing system in which validation and transfer of a frame's data from input buffer to output buffer proceed concurrently | |
| JPS6113305A (en) | Input/output unit for industrial controller | |
| GB2301268A (en) | Interface apparatus and method in a mobile communication system | |
| JPH0221705B2 (en) | ||
| JPH1028150A (en) | Communications system | |
| US5721891A (en) | Detection of N length bit serial communication stream | |
| JPH0221704B2 (en) | ||
| CN112667540A (en) | Multi-device bus communication method and electronic device | |
| JPH056381B2 (en) | ||
| JPH0221703B2 (en) | ||
| JPS5941945A (en) | Data transmission system of local network system | |
| JPS5941947A (en) | Data transmission controller of local network system |