ISOTP
The key current transport protocol is ISOTP CAN (ISO 15765-3). Here are four different message types are defined:
- Single-Frame
- First-Frame
- Consecutive-Frame
- Flow-Control
The single-frame is used when the message is less than or equal to 7 bytes long, as illustrated.
Reason: A CAN message can hold a total of 8 bytes and the first byte is used as the protocol control information PCI. With a single-frame, the first four bits of the PCI-bytes are set to 0. The second four bits of this byte contain the data length of following data. The user data can now be large from one to seven bytes.
If a diagnostic message from more than 7 bytes of data exist, a segmentation is required. This is the first message of a so-called first-frame sent, as illustrated. There are also a PCI. However, there is two bytes. In the first 4 bits of the first byte is the value 1 It recognizes the recipient a first-frame. The remaining four bits and the whole of next byte together for a total of 12-bit, according to the number of data of the entire diagnostic message. Total of 4095 bytes. The remaining six remaining bytes of the first message to be filled with data.
Then send as many frames Consecutive follow until the entire message was. Consecutive in-frame, only the first byte of the PCI byte is used. With the top four bits to the value 2 and the following four bits with a set sequence number. This one just starting at 1 each Consecutive frames. And because we have only four bits are available, Modulo is expected 16th The first Consecutive frame has sequence number one and so on up to fifteen. Then it starts again from zero.
These three types of message sent by the transmitter. The fourth message type, the so-called flow-control frame, as opposed to the previous sent by the receiver. The flow-control frame consists of three bytes, which together form a PCI. The first byte begins in the upper 4 bits of value 3, indicating that there is a flow-control. Then follows the flow status. This flow state can be either 0. This shows the station that will send the data block that it can actually send. The value can be one too. This indicates to the recipient that he needs time and that the sender should wait. With the value two can indicate the recipient that it has come with him to a memory overflow, that the data block was ignored, and sending, if necessary, repeated.
The second byte, block size, the sender is informed about how many Consecutive frames in a row, he is allowed to send before the receiver again time for processing needs. The last shows the minimum separation distance between the minimum-time consecutive Consecutive frames to be observed by the station. The entire process is demonstrated by the following simple example, see illustration:
Example procedure - diagnostic message with 35 = 0x23 bytes, the receiver can. 24 bytes buffer
We assume that we have a diagnostic message with 35 bytes and the receiver can buffer only 24 bytes. The whole process starts from the transmitter with a first-frame message. It has placed in the top 4 bits is a one. This is followed by twelve bits that show the entire data length. Since we have 35 bytes, equivalent to 0x23 hexadecimal, here follows the value 0x23. Then come the first 6 bytes of data.
The reactions to the first frame, by returning a flow control frame in which the top 4 bits are indicative of the flow control to 3. We assume that the receiver is able to buffer 24 bytes. He is also ready to receive data. Therefore, in the lower 4 bits of the first byte ClearToSend set to 0. The following byte contains the number of blocks. Here these are 3 blocks (= 24 / 8). Here in the last byte the Minimum Separation Time is set to ten milliseconds (= 0x0A).
On the flow control frame, the transmitter responds by starting to send its Consecutive frames with the rest of the data. The Consecutive-frame begins with a PCI-byte, in which the upper 4 bits are set to 2. Then follows the sequence number one, because it is the first Consecutive frame. The remaining 7 bytes of the CAN message to be filled with the next 7 user data bytes. Since we have a block size of three, this process goes in accordance with the Separation Time further out of ten milliseconds this way: The next Consecutive frame follows the sequence number has changed and the 7 next data bytes are sent. Then the third Consecutive frame also follows with another 7 bytes of data, the sequence number has increased to 3.
Since the block size was set to three, can now be followed no further Consecutive frame. The sender waits for the receiver to him now on a second flow control frame notifies that the transmission can continue. Here are now in our example, the same values as in the first flow-control frame. Theoretically, the receiver could ask at this point to wait or he could with a different block size or work of another separation-Time.
After the actual station has now received this second flow control frame, it continues sending the data block. It follows another Consecutive frame with sequence number 4 and a final with the sequence number 5 Overall, the 35 data bytes have been sent successfully.
The expiry of this segmented data transfer is certainly rather complex, therefore, it provides a range of diagnostic and monitoring mechanisms that are listed briefly below:
Timeout Bedingungen
- For the station: The distance between the Embassy and the FF-FC-A: max. 1s
- For the recipient: distance between two CF messages: max. 1s
- If the receiver time to process required, it can force a flow control message with FS = Flow Status Wait a break until after max. 1s with a further flow control message for retransmission or re asking you to wait
- For diagnostic tester is BS = 0 and STMin= 0 required, ie reception on the tester side effectively without flow control
Error detection
- Transmitter and receiver to monitor the segmented transmission by the corresponding timeouts, the recipient also has the sequence number
- On failure a received message is ignored and informed the layer above.
- In the transport layer is no error handling, neither retransmission nor error message
The monitoring mechanisms will include a series of time conditions, ie time-out mechanisms. Between first-and flow-control frame can not exceed a time interval are of a second. Thus, if the recipient does not respond quickly enough with a flow-control-frame message, the sender knows that something is not right. Conversely, the receiver monitors the time interval between the consecutive frames. Also there must be underpinned by a second as the maximum distance between them. In addition to the segmented transmission that the segment numbers are monitored. If an error occurs in the segment numbers or a timeout, the received message is ignored. Whether the transmitter repeats the failed transmission is not specified in the transport layer, but must be clarified at the application level.
See also
-
Created12. January 2011
-
Version4
-
Amended05. April 2011
-
Hits2438