190 likes | 366 Views
A tutorial on LOTOS. By: Ed Brinksma Presented by: Felipe Jovel. LOTOS. Specification language developed to formally specify protocols and services for computer networks. Developed with the Open Systems Interconnection (OSI) Reference model in mind. Based on: CCS CSP.
E N D
A tutorial on LOTOS By: Ed Brinksma Presented by: Felipe Jovel
LOTOS • Specification language developed to formally specify protocols and services for computer networks. • Developed with the Open Systems Interconnection (OSI) Reference model in mind. • Based on: • CCS • CSP
Distributed Systems • Described in terms of processes. • Specification of system is essentially a hierarchy of process definitions a P Q c b d
Lotos Process Abstraction process <process-identifier><parameter-part> := <behavior-expression>endproc • process-identifier – Name used to refer to process • parameter-part – List of potential external events • behavior-expression – Defines the behavior of the process
Lotos Process Abstraction process P[a,b,c] := … endproc Process Q[b,d] := … endproc a P Q c b d
; , [] operators and Stop process • B1;B2 • B1 [] B2 • Stop
Example 1 process one-time-buffer[in-data,out-data] := in-data ; out-data ; stopendproc in-data out-data
Example 2 process simple-duplex-buffer[in-a,in-b,out-a,out-b] := in-a ; ( in-b ; ( out-a ; out-b ; stop [] out-b ; out-a ; stop ) [] out-a ; in-b ; out-b ; stop ) [] in-b ; ( in-a ; ( out-b ; out-a ; stop [] out-a ; out-b ; stop ) [] out-b ; in-a ; out-a ; stop)endproc in-b out-b in-a out-a
Recursion processbuffer[in-data,out-data] := in-data ; out-data; buffer[in-data,out-data] endproc
Parallelism without internal communication process simple-duplex-buffer’[in-a,in-b,out-a,out-b] := one-time-buffer[in-a,out-a] ||| one-time-buffer[in-b,out-b] where process one-time-buffer[in,out] in ; out ; stopendprocendproc in-b out-b in-a out-a
Parallelism with internal communication process two-slot-buffer[in,out] := ( Buffer[in, middle] || Buffer[middle,out] )\[middle] where process Buffer[in,out] :=in ; out ; Buffer[in,out] endprocendproc out in m m = middle
Sequential composition of processes process Sender[ConReq,ConCnf,DatReq,DisReq] :=Connection-Phase[ConReq,ConCnf] >> Data-Phase[DatReq,DisReq]endprocwhere process Connection-phase[ConReq,ConCnf] :=ConReq ; ConCnf ; exitendproc process Data-phase[DataReq,DisReq] := ( DataReq ; Data-phase[DataReq,DisReq] [] DisReq ; stop )endprocendproc
Disruption of processes process Activity[a,b,c] := a ; b ; c ; Activity[a,b,c] [>Disrupt[discon,reason]endprocprocess disrupt[discon,reason] :=discon ; reason ; stop
Exercise pc1 Producer Channel Consumer cc1 pc2 cc2
Solution process Producer[pc1, pc2] := pc1; pc2; exit endproc process Consumer[ cc1, cc2] := cc1; (cc2; exit [] exit) [] cc2; exit []exitendproc process Channel[pc1, pc2, cc1, cc2] := pc1; ( pc2 ; cc1; exit [] cc1; pc2; exit [] i; pc2; exit ) >> ( cc2; exit [] i; exit) endproc
Solution with parallelism process Producer_Consumer[ pc1, pc2, cc1 cc2 ] := ( Producer [pc1,pc2] ||| Consumer [cc1,cc2] ) ||Channel[pc1,pc2,cc1,cc2]whereprocess Producer … process Consumer … process Channel …