Vous êtes sur la page 1sur 16

l

IEEE 802.4 Token-Bus

All r ights r eser ved. No par t of this publication and file may be r epr oduced, stor ed in a r etr ieval system,
or tr ansmitted in any for m or by any means, electr onic, mechanical, photocopying, r ecor ding or other wise,
without pr ior wr itten per mission of Pr ofessor Nen-Fu Huang (E-mail: nfhuang@cs.nthu.edu.tw).

Token-bus - 1

Token-Passing Bus Access Method


v Physically, it is a Bus networ k. Logically, it is a Ring networ k
v Stations ar e or ganized as a cir cular doubly-linked list
v A distr ibuted polling algor ithm is used to avoid bus contention
v Token: Right of access
v Token Holder (The station r eceiving the token)
l Tr ansmit one or mor e MAC-fr ame
l Poll other stations
l Receive r esponses
v Non-Token Holder
l Listen to the channel
l Respond to a poll
l Send Acknowledgement
v Logical Ring Maintenance
l Ring Initialization
l Addition to r ing
l Deletion fr om r ing
l Er r or Recover y
Token-bus - 2

Page 1

Token-Bus Networ k Example


50

60
20

60

50

40
30

10

us
30

20
30

50

60

20

Token-bus - 3

Fr ame For mat


>= 1

Pr eamble SD
l
l
l
l
l
l
l
l

2,6 2,6

>= 0

FC

DA SA

LLC

FCS ED

Pr eamble: Establish bit synchr onization and locate


the fir st bit of the fr ame
SD = Star t Delimiter ()
FC = Fr ame Contr ol ()
DA = Dsetination Addr ess ()
SA = Sour ce Addr ess ()
FCS = Fr ame Check Sequence ()
ED = End Delimiter ()
Maximum Length (Fr om SD to ED): 8191 Bytes
Token-bus - 4

Page 2

Specific IEEE 802.4 Fr ame For mats

Pr eamble SD 00000000

DA SA

= (0,2,4,6)

FCS ED

(a) - (Claim Token, CT). The fr ame has a data-unit whose value is ar bitr ar y
and whose length in octets (between addr esses and FCS exclusive) is 0,2,4, or 6
times the systems' s slot-time also measur ed in octets.
Pr eamble SD

00000001

DA

SA

FCS

ED

(b) --1 (Solicit-Successor -1, SS1). The fr ame has a DA= the contents of
the station' s NS r egister and a full data unit. One r esponse window always follows
this fr ame.
v Response Window: One slot time (Round-Tr ip pr opagation delay). The Token
holder exptects r esponse or acknowledgement fr om other stations in a given
number of Response Windows.
v Possible events in the r esponse window
l No r esponse
l One Response
l Multiple Response -- A gar bled Response (Contention)
Token-bus - 5

Specific IEEE 802.4 Fr ame For mats

Pr eamble

SD 00000010

DA

SA

FCS

ED

(c) --2 (Solicit-Successor -2, SS2). The fr ame has a DA= the contents of
the station' s NS or TS r egister and a full data unit. Two r esponse windows always
follows this fr ame.

Pr eamble

SD

00000011

DA SA

FCS

ED

(d) - (Who-follows, W). The fr ame has a data-unit = the value of the
station's NS r egister . The for mat and the length of the data-unit is the same as
a sour ce adr ess. Thr ee r esponse windows always follows this fr ame.(This gives
r eceiver s two extr a slot-time to make a compar ison with an addr ess other than TS.)
Pr eamble SD

00000100

DA

SA

FCS

ED

(e) - (Resolve-contention, R). The fr ame has a null data-unit. Four r esponse
windows always follows this fr ame.

Token-bus - 6

Page 3

Specific IEEE 802.4 Fr ame For mats

Pr eamble SD 00001000

DA

SA

FCS

ED

(f) (Token, T). The fr ame has DA = the contents of the station's NS r egister , and
has a null data-unit.

Pr eamble SD

00001100

DA SA

FCS

ED

(g) - (Set-Successor , S). The fr ame has DA = the SA of the last fr ame
r eceived, and data-unit = the value of the station' s NS or TS r egister . The
for mat and the length of the data-unit is the same as a sour ce addr ess.
Pr eamble

SD

01MMMPPP

DA

SA

LLC

FCS

ED

(h) LLC . LLC data fr ames have a DA and data-unit specified by a station's
LLC sublayer . A fr ame of this type with a nonnll data unit shall be passed to the
r eceiving staions' s LLC sublayer .

Token-bus - 7

Nor mal Token Passing Oper ation

v In numer ically descending or der (60 -> 50 -> 30 -> 20 -> 60)
v Each station in the r ing has knowledge of
l TS: This Stations' s addr ess ()
l NS: Next Station' s addr ess ()
l PS: Pr evious Stations's addr ess ()
v A station as a token holding timer to limit the time it can hold

the token. This value is set at the system initialization time by


the networ k management pr ocess.
v At the end of tr ansmission, the token is passed to the next
station.
v Once r eceived the token, the station either star ts to tr ansmit or
passes the token to the next station within one r esponse
window.
Token-bus - 8

Page 4

Nor mal Token Passing Example


l

l
l

The Logical r ing consists of stations 60,50,30,20. Station 10 is not


included in the logical r ing.
Station 50 passes a token to station 30 via the br oadcast bus.
All the stations in the bus can see the token, but only station 30
has the r ight to use the token.

20

50

60
60

50

30

DA SA

30 50 T

10

30

20
30

60

50

20

Token-bus - 9

Addition of a Station
v Token holder has the r esponsibility of per iodically (an inter -solicit-

count timer ) gr anting an oppor tunity for new stations to enter the
logical r ing befor e it passes the token.
v A Solicit-Successor -1 (SS1) contr ol fr ame is issued with
l DA = NS
l SA = TS
l Data = Null

v One r esponse window is r eser ved for those stations desr ied to enter

the logical r ing and their addr ess is between DA and SA. (If the
addr ess of the token-holder has the smallest addr ess in the logical
r ing, then a Solicit-Successor -2 fr ame is issued)
v The station desir ed to enter the logical r ing will r espond with a SetSuccessor fr ame with
l DA = Token-holder addr ess
l SA = TS (Its addr ess)
l Data = TS
Token-bus - 10

Page 5

Addition of a Station (Continued)


v The Token holder detects the event in the r esponse window and

takes appr opr iate actions:


l No Response: Pass token to the next station
l One Response: Pass token to the newly added station. The newly added

station will update its NS value by r ecall the DA field of the pr eviously
r eceived Solicit-Successor -1 fr ame.
l Multiple Responses:
u

A Resolve-Contention fr ame is issued by the token-holder with


DA = XX, SA = TS, Data = Null
A station desir ed to enter the logical r ing will r esponse with a Set-Successor
fr ame as befor e at the K-th window, wher e K is deter mined by the value of
the fir st two bits of its addr ess. However , if the channel is detected busy
befor e the K-th window, it will give up.
If no valid Set-Successor fr ame is r eceived by the token-holder , the tokenholder will issue another Resolve-Contention fr ame.
Now only those stations involved in the contention may tr y again. The value
of K now is deter mined by the next two bits.
The above pr ocedur e is r epeated until a valid Set-Successor fr ame is
r eceived by the token-holder . A new station is thus successfully added to the
logical r ing.
Token-bus - 11

Addition Example 1 (without Contention)


50

60
60

50

20

40
30

DA SA
1

30 50 SS1

30

20

20

50

60

30

DA SA DATA
50 40 40 S

50

60
20

60

50

40

30

50

30

20
30

Newly added Station

40

60

40

20
Token-bus - 12

Page 6

Addition Example 2 (with contention)


50

60

40

60

50

20

20

DA SA
1

DA SA

20 50 SS1

XX 50 R

DA SA DATA
50 30 30 S

30

20

DA SA DATA
50 40 40 S

60

50

Newly added Station


50

60
60

50

20

40
40

50

30

20

20

60

40

Token-bus - 13

Resolve Contention Example


l

Five stations: A,B,C,D,E. For simplicity, addr esses ar e assumed


to have only 8 bits.
Four Resolve-Contention fr ames ar e r equir ed to find out the station
with the lar gest addr ess (B). Each fr ame follows with four
Response Windows.
1

11

10

01

00

11

10

01

00

A B
C
2

11

10

01

B C
3

11

10

Give up

00
A

01

Give up

10 00 11 10

10 10 01 11

10 10 01 01

01 10 01 11

00 10 11 00

00

B C
4

11
B

10

01
C

00

Give up

Page 7

Token-bus - 14

Addition of a Station (Continued)


v Usually, NS < TS. But ther e is one station whose NS > TS (The one

with the smallest addr ess in the logical r ing). In this case SolicitSuccessor -2 (SS2) fr ame is issued followed by two Response
Windows.
v The fir st r esponse window is r eser ved for stations (X) whose

addr ess is less than this station.


l The second r esponse window is r eser ved for stations (Y) whose addr ess

is gr eater than its successor .


v Stations in Y will r espond with the Set-Successor fr ame only if ther e

is no r esponse in the fir st r esponse window.


v Each r esponse window may have the following events:
l No r esponse
l One r esponse -- A newly station is added
l Multiple r esponses -- Resolved contention pr ocedur e is invoked to find

out the lar gest addr ess involved in the contention.


v If both the r esponse windows have no r espone, then the token-

holder passes the token to the next station.


Token-bus - 15

Addition Example 3 (with SS2)

60

50

20

DA SA DATA
20 10 10 S

30

DA SA
1

60 20 SS2

10

30

20
30

60

60

50

20

50

50

60
10

50

60

30

Newly added
Station
10
20

30

20
60

30

10

50

20
Token-bus - 16

Page 8

Deletion of a Station
v The station wishes to be deleted may wait until it r eceives the

token, then sends a Set-Successor fr ame to its pr edecessor ,


with
v DA = PS
l SA = TS
l Data = NS

v The pr evious station once r eceives the Set-Successor fr ame

will modify its NS and send a token to its new next station.
v The next station once r eceives the Set-Successor fr ame will

modify its PS accor dingly.


v After these two modifications, the station is r emoved fr om the
logical r ing automatically.
v If the station fails, it will not r eceive the token. This will be
detected by the token-sender as explained later .
Token-bus - 17

Deletion Example
50

60
60

50

10

30

DA SA
1

30 50 T

10

30

20
60

20

30

50

10

60

50

20

50

10

60

DA SA DATA
50 30 20 S

20

DA SA
3

20 50 T

Deleted Station
10
20

30

20
60

50

10
Token-bus - 18

Page 9

Fault Management

vOne of the most impor tant issues of the

token-bus pr otocol is to maintain the logical


r ing under the following possible conditions:
l Multiple Tokens
l Unaccepted Token
l Failed Station
l Failed Receiver
l No Token

Token-bus - 19

Multiple Tokens

v Cause:
l Noise
l Duplicate Addr ess, each one may " r eceive" a token

v Detection:
l While holding the token, the station may hear a fr ame on

the bus which indicating that another station also has a


token.

v Action:
l Dr op the token
l If all stations dr op the token, the networ k becomes the

case of no token (see the pr ocedur e of handling no token


later )
Token-bus - 20

Page 10

Unaccepted Token or Failed Station

v Cause
l The token passed to the next station may be gar bled
l The next station fails
v Detection:
l No r esponse (Channel is idle) in one r esponse window
v Action:
l Tr y to pass token one mor e time
l It still no r esponse, then the next station is assumed to have failed
l The token holder then issues a Who-Follows fr ame with
u DA = XX, SA = TS, Data = NS
l All other stations once r eceived Who-Follows fr ame will compar e the
data with its PS value. If ther e is a match, it will issue a Set-Successor
fr ame back. Thr ee r esponse windows ar e r eser ved after Who-Follows.
The fir st two ar e needed to make a compar ison.
l If no r esponse to the Who-Follows fr ame, the above pr ocedur e will be
tr ied one mor e time.
Token-bus - 21

Unaccepted Token and Failed Station


l If still no r esponse to the Who-Follows fr ame, then it could be that the next

station to the next station has also failed.


l The token-holder will tr y to establish the r ing by issuing a Solicit-

l
l
l
l
l
l

Successor -2 fr ame, with


u DA = TS, SA = TS, Data = Null.
DA=SA=TS implies that ever y station is invited to r espond. Two r esponse
windows ar e r eser ved after this fr ame.
The fir st r esponse window is r eser ved for stations whose addr ess is less
than the sender .
The second r esponse window is r eser ved for stations whose addr ess is
gr eater than the sender .
The pr ocedur e of add a station is then used.
If still no r esponse to the Solicit fr ame, then either all stations have failed
(Left the r ing) or its own r eceiver has failed (so it cannot listen).
If the only one station has something to send, it sends the data. Then r epeat
the token passing pr ocess. Other wise, listen to the channel.

Token-bus - 22

Page 11

Station Fails Example 1 (Station 50)


50

60

60

50

10

30

DA SA

50 60 T

DA SA DATA

XX 60 50 W

10

DA SA DATA
60 30 30 S

30

20
60

20

30

20

50

10

50

60

30

10

DA SA
5

30 60 T

10
20

30

20
60

30

20

60

10

Token-bus - 23

Station Fails Example 1 (Stations 50 and 30)


50

60
60

50

10
1
2

DA SA

50 60 T

3
4

DA SA DATA
6

60 10 10 S

XX 60 50 W

60 60 SS2

DA SA DATA
60 20 20 S

30

20
30

60

10

50

60
10

DA SA

DA SA DATA

10
20

30

20

20

50

DA SA

20 60 T

20

30

20

10
60

60

10
Token-bus - 24

Page 12

No Token or Initialization
v Cause:
l The Token-holder station fails
l The token is destr oyed
l Networ k Initialization
v Detection:
l No channel activity has been hear d for a cer tain amount of time (BusIdle Timer expir ed)
v Action:
l Any station when its Bus-Idle timer is expir ed will issue a Claim-Token
fr ame, with
u DA = XX, SA = TS, Data = Any value with (0,2,4,6) slot times
depending on its addr ess
l The station with the gr eatest addr ess will get the token. This is done by
compar ing the addr ess. Two bits of the addr ess ar e compar ed at a time.
In each pass, only those stations who tr ansmitted the longest fr ame on
the pr evious pass tr y again.
Token-bus - 25

No Token or Initialization
l The station that succeeds on the last pass consider s itself the token holder .
l The differ ence is 2 slots in the fr ame padding. The station waits one slot for its

or other fr ame to pass. It then samples the channel at the second slot.
l The logical r ing can then be established by issuing Solicit-Successor fr ames as

descr ibed befor e.


00: Pr eamble

SD

00000000

DA

SA

FCS ED
0

01: Pr eamble

SD 00000000

DA SA

FCS ED
2

10: Pr eamble

SD 00000000

DA SA

FCS ED
4

11: Pr eamble

Addr ess bits

SD 00000000

DA SA

FCS ED
6

Token-bus - 26

Page 13

Pr ior ity Mechanism


6

v In the contr ol field of data fr ame, thr ee

bits ar e r eser ved to indicate fr ame pr ior ity.

v Only four access classes ar e consider ed


l 6 : The highest pr ior ity

l4

l2
l 0 : The lowest pr ior ity

v Hi-Pr i-Token-Hold-Time
l an upper bound set in each station that deter mines the
maximum time the highest pr ior ity fr ame can hold the token
l to avoid one station dominating the networ k
v Each lower access class in the station has a Tar get token

Rotation Time (TRT).


Token-bus - 27

Pr ior ity Handling of Fr ames


v Some Timer s set by the networ k management
l Class N: HPTHT (Hi-Pr i-Token-Hold-Time)
l Class N-1: TRT(N-1) Token-Rotation-Time

...
l Class 1: TRT(1)
l TRTC: Token-Rotation-Time-Counter
l TT: Tempor ar y Timer

N-1

TRTC

TT
Token-bus - 28

Page 14

Gener al
Pr ior ity
Algor ithm

TT 0

TT < HPTHT Y
Queue(N) <>

N
i = N-1

TRTC < TRT(i)


Queue(i) <>

N
i=i-1

i=0
Y
TRTC TT

Token-bus - 29

Pr ior ity Algor ithm Example


2

TRT = 1600

TRT = 1600

50

20

60
10

1
2
3
4
5
6
7
8
9
l
l
l
l
l
l
l
l

50

TRTC
76
2270
1782
1070
1870
1782
1070
1565
1877

3
3
3
3
3
3
3
3
3

60

20

TRTC
460
2270
1782
1070
1870
1782
1070
1565
1877

3
0
0
2
0
0
2
1
0

50

10
10

TRTC
1660
1070
1782
1870
1070
1782
1870
1165
1477

0
2
0
0
2
0
0
2
1

20

60

TRTC
1660
1782
1070
1870
1782
1070
1870
1877
1121

2
2
2
2
2
2
2
1
1

N=2
Station 60: Fr ame-size = 128 Bytes, Tr ansmit thr ee Class-2 fr ames at a time
Station 50: TRT(1) = 1600, Fr ame-size = 400 Bytes, Tr ansmit as many Class-1 fr ames as possible
Station 20: TRT(1) = 1600, Fr ame-size = 356 Bytes, Tr ansmit as many Class-1 fr ames as possible
Station 10: Fr ame-size = 305 Bytes, Tr ansmit two Class-2 fr ames at a time
Token passing time = 19 bytes
Initially all stations ar e idle
TRTC Calculation:
l Station 50: (Token Rotation no. 6), 1782 = 2(356)+2(305)+3(128)+4(19) > 1600
l Station 20: (Token Rotation no. 9), 1477 = 2(356)+1(305)+3(128)+4(19) < 1600

Token-bus - 30

Page 15

Token-bus
Pr ior ity
Algor ithm

Token-bus - 31

Encoding: Differ ential Manchester Encoding

SD +

V1 V0

V1 V0

V1 V0

V1 V0

1s

0s

+
-

0: (TT) T: Tr ansition
1: (T)
: No Tr ans.
NN: ( )(T )

ED

+
-

SD: NN0NN000
ED: NN1NN1IE

I: 1 if mor e fr ame
E: 1 if er r or
Token-bus - 32

Page 16

Vous aimerez peut-être aussi