分类: IT职场
2010-03-05 00:04:20
Get from
Summary
Packet-based vs. stream-based:
COTP transports packets of data from one user to the other, so the receiver will get exactly the same data boundaries as the sender transmitted.
TCP transports a continuous stream of data to the receiver, so the protocol on top of TCP often has to add such boundaries itself (see the TPKT protocol for such a protocol).
TSAPs vs. ports:
To multiplex several conversations between two hosts, COTP uses TSAP's which are variable length binary blobs (often a meaningful string is used).
These TSAP's are matched at connection establishing phase, and replaced by the 2 byte (destination/source) references at data transfer.
TCP uses ports for this. One notable difference is that TSAP's are singletons - if a TSAP is used for a connection it cannot be used by another. XXX - Needs clarification. A single TSAP (Transport Service Access Point) may be used by multiple connections.
Tranport Layer:
Protocol Note
------------ ---------------------------------------------------------------------------------------
COTP
TPKT = TPKT works on TCP port 102 to emulate COTP
TCP
----------------------------------------------------------------------------------------------------------------
1. TPKT = RFC 1006
It start with \x03\X00.
TPKT is used to "emulate" ISO transport services COTP on top of TCP. The two major points missing in TCP (compared to COTP) are the TSAP addressing and the detection of packet boundaries on the receiving host.
Note that only TPDUs formatted for
transport class 0
[TP0] are exchanged (different transport classes may use slightly
different formats).
Include Packet Header and TPDU, The
format of the TPDU is defined in [ISO8073].
0
1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3
4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| vrsn | reserved | packet length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Header:version = always 3, 1 byte
TPDU = max. 65531. Based on the size of the data transfer (DT) TPDU, this permits a maximum TSDU size of 65524 octets.
2. COTP = ISO 8073 / RFC983
Connection-oriented transport protocol
To support expedited data, a non-standard TPDU, for expedited data is permitted. The format used for the ED TPDU is nearly identical to the format for the normal data, DT, TPDU. The only difference is that the value used for the TPDU's code is ED, not DT:
0 1
2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
header length | code |credit |TPDU-NR and EOT| user data |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ... | ... | ... | ... |
| ... | ... | ... | ... |
| ... | ... | ... | ... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
TPDU Code
-------------------
CR =
0xE0, Connection Request
CC = 0xD0, Connection Confirm
DR = 0x80,
Disconnection Request
DT = 0xF0, Data Transfer
ED = 0x70, Expected Data
transfer
After the credit field (which is always ZERO on output and ignored on input), there is one additional field prior to the user data.
TPDU-NR and EOT = 8 bits
Bit 7 (the high-order bit, bit mask 1000 0000) indicates the end of a TSDU. All other bits should be ZERO on output and ignored on input.
The format of a CR or CC TPDU is:
0 1
2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2
3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
header length | code | credit| destination reference |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| source reference | class |options| variable data
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
... | ... | ... | ... |
|
... | ... | ... | ... |
|
... | user data | ... | ... |
|
... | ... | ... | ... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The format of a DR TPDU is:
0 1
2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
header length | code | credit| destination reference |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| source reference | reason | variable data |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
... | ... | ... | ... |
|
... | ... | ... | ... |
|
... | user data | ... | ... |
|
... | ... | ... | ... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The format of a DT or ED TPDU is:
0 1
2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2
3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-++-+-+-+
|
header length | code | credit| TPDU-NR and EOT |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
user data | ... | ... | ... |
|
... | ... | ... | ... |
|
... | ... | ... | ... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3. ISO 8327-1
ISO Session Protocol
Format
-----------------------------------------------
SPDU Type -- 1 byte
Length -- 1 byte
Connect Accept Item -- 8 bytes
Session Requirement -- 4 bytes
Calling Session Selector -- 4 bytes
Called Session Selector -- 4 bytes
Session User Data -- ...
ISO Session Protocol (ISO-SP) Messages:
Functional unit |
SPDU code |
SPDU name |
Kernel |
CN |
CONNECT |
Negotiated release |
NF |
NOT FINISHED |
Half-duplex |
GT |
GIVE TOKENS |
Duplex |
No additional associated SPDUs | |
Expedited data |
EX |
EXPEDITED DATA |
Typed data |
TD |
TYPED DATA |
Capability data exchange |
CD |
CAPABILITY DATA |
Minor synchronize |
MIP |
MINOR SYNC POINT |
Symmetric synchronize |
MIP |
MINOR SYNC POINT |
Data separation |
No additional associated SPDUs | |
Major synchronize |
MAP |
MAJOR SYNC POINT |
Resynchronize |
RS |
RESYNCHRONIZE |
Exceptions |
ER |
EXCEPTION REPORT |
Activity management |
AS |
ACTIVITY START |
4. ISO 8823
ISO Presentation Protocol, on top of ASN.1, BER.
Frame format
-------------------------------------------------------------------------
Mode-selector -- 3 bytes
Normal-mode-parameters
Padding -- 1 byte
Protocol-version -- 1 byte, 80 = version-1
calling-presentation-selector -- 4 bytes
called-presentation-selector -- 4 bytes
presentation-contex-definition-list -- ??
Padding -- 1 byte
Presentation- requirement -- 1 byte
User-data -- ...
Protocol Structure - ISO-PP: OSI Presentation Layer Protocol (X.226, X.216, ISO 8823, 8822)
Connection Release Primitive Token Handling Primitive P-RELEASE request P-RELEASE indication P-RELEASE response P-RELEASE confirm P-TOKEN-GIVE request P-TOKEN-GIVE indication P-TOKEN-PLEASE request P-TOKEN-PLEASE indication P-CONTROL-GIVE request P-CONTROL-GIVE indication Presentation Exception Reporting Primitive Activity Management Primitive P-P-EXCEPTION-REPORT indication P-U-EXCEPTION-REPORT request P-U-EXCEPTION-REPORT indication P-ACTIVITY-START request P-ACTIVITY-START indication P-ACTIVITY-RESUME request P-ACTIVITY-RESUME indication P-ACTIVITY-INTERRUPT request P-ACTIVITY-INTERRUPT indication P-ACTIVITY-NTERRUPT response P-ACTIVITY-INTERRUPT confirm P-ACTIVITY-DISCARD request P-ACTIVITY-DISCARD indication P-ACTIVITY-DISCARD response P-ACTIVITY-DISCARD confirm P-ACTIVITY-END request P-ACTIVITY-END indication P-ACTIVITY-END response P-ACTIVITY-END confirm Synchronization Services Primitive P-SYNC-MINOR request P-SYNC-MINOR indication P-SYNC-MINOR response P-SYNC-MINOR confirm P-SYNC-MAJOR request P-SYNC-MAJOR indication P-SYNC-MAJOR response P-SYNC-MAJOR confirm
5. ISO 8650-1, ACSE-1
ISO Association Control Service Element (Layer 7)
The OSI method for establishing a call between two application programs. ACSE checks the identities and contexts of the application entities, and could apply an authentication security check.
ICCP uses the ISO Association Control Service element (ACSE) to establish logical associations. Multiple associations may be established from a client to multiple, different control center servers.
Application Association & network connection are different.
6. MMS
ISO 9506-2