service and protocol (i) · sap. vertical communication delivered by peer entities in layer (n)...
TRANSCRIPT
Modeling and Simulation of Communication Systems and Networks
Summer Term 2010
3. Finite State Machines 1
Modeling and Simulation of
Communication Systems and Networks
Service and Protocol (I)
Modeling & Simulation - 3. Finite State Machines 2
Service User
1
Service User
2
Service Provider
1
Service Provider
2
Modeling and Simulation of Communication Systems and Networks
Summer Term 2010
3. Finite State Machines 2
Service and Protocol (II)
Modeling & Simulation - 3. Finite State Machines 3
Peer entities on one layer
Utilize the service of the layer below (if there is one)
Offer their service to the layer above (if there is one)
Only know the interface to the service beneath, but NOT its
implementation
Communicate with each other according to specific rules
Receive input
Generate events
Thus, the service is delivered by cooperation of the peer
entities in one layer
Definition of “Service”
Modeling & Simulation - 3. Finite State Machines 4
Service = Set of functions in one layer.
Delivered by co-operating / communicating entities of the layer, which obey a specific protocol.
Offered at the service access point of the layer.
Defined by a set of service primitives and rules for their usage.
Utilized or indicated by service primitives:
Request
Indication
Response
Confirmation
Modeling and Simulation of Communication Systems and Networks
Summer Term 2010
3. Finite State Machines 3
Illustration of “Service”
Modeling & Simulation - 3. Finite State Machines 5
Abstract Medium Mi
Commu-
nicating
Entity
Ii+11
Commu-
nicating
Entity
Ii+12
Commu-
nicating
Entity
Ii+1n-1
Commu-
nicating
Entity
Ii+1n
...
Service Primitive
Service
Interface Di
Service
Access
Point
Layer (N)
Layer (N)-Service
Modeling & Simulation - 3. Finite State Machines 6
Set of functions offered by layer
(N) at its Service Access Point (N)-
SAP.
vertical communication
Delivered by peer entities in layer
(N) that communication with each
other utilizing (N-1)-service.
horizontal communication
How the (N)-service is achieved
remains hidden in Layer (N).
(N) - SAP
(N+1)-entity
(N)-entity
(N) - SAP
(N+1)-entity
(N)-entity
Modeling and Simulation of Communication Systems and Networks
Summer Term 2010
3. Finite State Machines 4
The Idea Behind Protocols
Modeling & Simulation - 3. Finite State Machines 7
Rules for concurrently running, but co-operating entities
Enhancement of the quality and the functions of the layer below
Distributed algorithm
Problem: failures and faults must be considered
Specification
In most cases only for two entities
Finite state machines
Message-sequence-charts (MSC)
Finite State Machine
Modeling & Simulation - 3. Finite State Machines 8
TConReq
TConCnf
TPAboInd1
TDisInd
TConRsp
TDisReq
TConInd
TPAboInd2
.... .... ....
States for data exchange and
connection release
; TPAboInd1, TPAboInd2
TConRsp;
TConCnf
TConReq;
TConInd
TConReq;
TPAboInd1
; TPAboInd1, TPAboInd2
TDisReq; TDisInd
Connection established Idle
Connection being
established
Modeling and Simulation of Communication Systems and Networks
Summer Term 2010
3. Finite State Machines 5
Communication Networks -11. The Internet 9
Clo
se P
assive
Clo
se A
cti
v
Co
nn
ec
tio
n E
stab
lish
me
nt
Example: TCP Connection Management Closed
Listen
SYN rcvd SYN sent
Estblshd
FIN wait1
FIN wait2
Closed
Closing
Timed wait
Close wait
Last ACK
Connect; SYN
Close; -
Listen; - Close; -
SYN; SYN+ACK
RST; - Send
SYN; SYN+ACK
(synchronous)
ACK; -
SYN+ACK; ACK
Close; FIN Close; FIN FIN; ACK
FIN; ACK
Close; FIN
FIN; ACK
ACK; - ACK; -
ACK; -
FIN+ACK;
ACK
(Timeout; -)
Example: Alternating Bit Protocol
Modeling & Simulation - 3. Finite State Machines 10
The Alternating Bit Protocol implements a service for confirmed data
transfer based on a service for unconfirmed data transfer.
Service primitives are:
DtReq;
DtInd;
DtRsp;
DtCnf.
Acknowledgment is done with alternating acknowledgment numbers 0
and 1. Thus, one can distinguish between message and acknowledgement
loss.
After the confirmed data transfer has been completed, the protocol
entity enters the idle state until the next data transfer is requested.
Modeling and Simulation of Communication Systems and Networks
Summer Term 2010
3. Finite State Machines 6
Service Description with a
Message Sequence Chart
Modeling & Simulation - 3. Finite State Machines 11
SAP
AO
SAP
BO
ODtReq(XX)
ODtCnf(YY)
ODtReq(ZZ)
ODtCnf(UU)
ODtInd(XX)
ODtRsp(YY)
ODtInd(ZZ)
ODtRsp(UU)
Sender Receiver
Medium O
Finite State Machine - Entity S
Modeling & Simulation - 3. Finite State Machines 12
Entity S
Start and
Idle
State
Awaiting
Ack 0
Awaiting
Ack 1
Idle
State
UDtIndBA(0,<m,1>);
ODtCnf(m)
ODtReq(n);
UDtReqAB(<n,0>)
UDtIndBA(0,<m,0>);
ODtCnf(m)
ODtReq(n);
UDtReqAB(<n,1>)
UDtIndBA(0,<m,1>)
or
UDtIndBA(1,<m,b>);
UDtReqAB(<n,0>)
UDtIndBA(0,<m,0>)
or
UDtIndBA(1,<m,b>);
UDtReqAB(<n,1>)
Medium O
Medium U
SAP AO
SAP AU UDtReqAB(<n,b>) UDtIndBA(f,<m,b>)
ODtReq(n) ODtCnf(m)
Modeling and Simulation of Communication Systems and Networks
Summer Term 2010
3. Finite State Machines 7
Entity S Described in a
Message Sequence Chart
Modeling & Simulation - 3. Finite State Machines 13
SAP
AO
SAP
AU
UDtReqAB(<XX,0>)
UDtReqAB(<XX,0>)
UDtIndBA(1,<YY,0>)
UDtIndBA(0,<YY,0>)
UDtReqAB(<ZZ,1>)
UDtIndBA(0,<UU,1>)
Medium U
ODtReq(XX)
ODtCnf(YY)
ODtReq(ZZ)
ODtCnf(UU)
<XX,0>
<YY,0> Error
<XX,0>
<ZZ,1>
<UU,1>
<YY,0>
Entity S
Definition of PDUs
Modeling & Simulation - 3. Finite State Machines 14
Octet 0: contains sequence number b in the lowest bit
Octet 1+2: codes the length of the user data
Remaining Octets: user data n
x x x x x x x b i i i i i i i i i i i i i i i i n n n n n n n n n n n n n n n n
7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
Octet 0 Octet 1 Octet 2 Octet 3 Octet 3+l-1
l
Length of User Data
n
User Data as submitted by O
Example: PDU format <n, b>
...
...
...
Modeling and Simulation of Communication Systems and Networks
Summer Term 2010
3. Finite State Machines 8
Modeling & Simulation - 3. Finite State Machines 15
ASN.1 ASN.1 (Abstract Syntax Notation 1) is a standard defined
by ISO ASN.1 allows
definition of data types
specification of values
Data types are subdivided into 4 classes: Universal: Globally defined data types, e. g. Integer
Application: Data types that are defined in some othe (application oriented) standard (e. g. FTAM, MHS)
Private: Data types which have been defined for some specific non-standard application
Context-Specific: Some shorter represenation of data types that are valid only within a given (application) context
ASN.1: Universal Data Types
Modeling & Simulation - 3. Finite State Machines 16
Primitive data types:
Boolean, Integer, Bit String, Octet String, IA5 String, …
Constructed data types:
Sequence: Ordered list of data types (cf. record in PASCAL)
Set: Unordered set of data types
Sequence OF: Ordered list of elements of the same data type
(cf. array in PASCAL)
Set OF: Unordered set of elements of the same data type
Choice: Unordered set of data types, of which some may be chosen
(cf. variant record in PASCAL)
Example:
Staff_Member ::= Set { name IA5String,
year_of_birth Integer,
personnel_nr Integer }
Modeling and Simulation of Communication Systems and Networks
Summer Term 2010
3. Finite State Machines 9
Modeling & Simulation - 3. Finite State Machines 17
ASN.1: Coding & Decoding Basic Encoding Rules, BER:
Bit 7 6 5 4 3 2 1 0
Type Length Value
Example: Integer Value 5
Universal
Primitive 2
Integer
0 0 0 0 0 0 1 0
Type Length
0 0 0 0 0 0 1 0
1
0 0 0 0 0 1 1 0
Value
5
Class of Type 00: Universal 01: Application 02: Context Specific 03: Private
Sort of type 0: Primitive 1: Constructed
Tag 0..30: as given 31: next (complete) byte contains tag
Complete Example
Modeling & Simulation - 3. Finite State Machines 18
Medium O
Medium U
ODtReq(n) ODtCnf(m) ODtInd(n) ODtRsp(m)
Entity
S
Entity
R
AU BU
AO BO
UDtReqAB(n) UDtIndBA(f,m) UDtReqBA(m) UDtIndAB(f,n)
Modeling and Simulation of Communication Systems and Networks
Summer Term 2010
3. Finite State Machines 10
Service O
Modeling & Simulation - 3. Finite State Machines 19
Medium O
ODtReq(n) ODtCnf(m) ODtInd(n) ODtRsp(m)
AO BO
Awaiting
Response
Start and
Idle State
ODtReq(n); ODtInd(n)
ODtRsp(m); ODtCnf(m)
Basic Service U
Modeling & Simulation - 3. Finite State Machines 20
Medium U
UDtReqAB(n) UDtIndBA(f,m) UDtIndAB(f,n) UDtReqBA(m)
AU BU
Awaiting
Transfer
Start and
Idle State
UDtReqAB(n); UDtIndAB(0,n)
UDtReqAB(n); UDtIndAB(1,x)
UDtReqBA(m); UDtIndBA(0,m)
UDtReqBA(m); UDtIndBA(1,y)
Modeling and Simulation of Communication Systems and Networks
Summer Term 2010
3. Finite State Machines 11
Entity R
Modeling & Simulation - 3. Finite State Machines 21
Entity R
Received
Ack 0
Idle
State
Start and
Idle
State
Received
Ack 1 UDtIndAB(0,<n,1>);
ODtInd(n)
ODtRsp(m);
UDtReqBA(<m,0>)
UDtIndAB(0,<n,0>);
ODtInd(n)
ODtRsp(m);
UDtReqBA(<m,1>)
UDtIndAB(0,<n,0>)
or
UDtIndAB(1,<n,b>);
UDtReqBA(<m,0>)
UDtIndAB(0,<n,1>)
or
UDtIndAB(1,<n,b>);
UDtReqBA(<m,1>)
Medium O
Medium U
SAP BO
SAP BU UDtReqBA(m) UDtIndAB(f,n)
ODtRsp(m) ODtInd(n)
Complete Message Sequence Chart
Modeling & Simulation - 3. Finite State Machines 22
SAP
AO
SAP
AU
UDtReqAB(<XX,0>)
UDtReqAB(<XX,0>)
UDtIndBA(1,<YY,0>)
UDtIndBA(0,<YY,0>)
UDtReqAB(<ZZ,1>)
UDtIndBA(0,<UU,1>)
ODtReq(XX)
ODtCnf(YY)
ODtReq(ZZ)
ODtCnf(UU)
<XX,0>
<YY,0> Error
<XX,0>
<ZZ,1>
<UU,1>
<YY,0>
UDtIndAB(0,<XX,0>) ODtInd(XX)
ODtRsp(YY)
ODtInd(ZZ)
ODtRsp(UU)
UDtReqBA(<YY,0>)
UDtIndAB(0,<XX,0>)
UDtReqBA(<YY,0>)
UDtIndAB(0,<ZZ,1>)
UDtReqBA(<UU,1>)
SAP
BU
SAP
BO
Entity S Entity R Medium U
Modeling and Simulation of Communication Systems and Networks
Summer Term 2010
3. Finite State Machines 12
References
Modeling & Simulation - 3. Finite State Machines 23
Halsall, F. (1996). Data Communications, Computer Networks, and Open Systems. Harlow, England; Reading, Massachusetts; Menlo Park, California, Addison-Wesley.
Lynch, W. (1968). "Reliable full-duplex file transmission over half-duplex telephone lines“. Communications of the ACM 11 (6): 407–410.
Popovic, M. (2006). Communication Protocol Engineering. Boca Raton, CRC Press Inc.
Tanenbaum, A. S. (2002). Computer Networks. Upper Saddle River, New Jersey, Pearson Education.
Venkataram, P. and S.S. Manvi (2004). Communication Protocol Engineering. Delhi, Prentice-Hall of India Pvt. Ltd.