1

I'm trying to write HDLC protocol working in ABM only (point to point) for a microcontroller project. I rely mostly on ISO 13239 document click.

Communication shall work in two-way simultaneous mode. For now I want to connect two USARTs of a micro running two HDLC contexts on the same micro. I've got a problem with understanding P/F bit purpose in ABM.

In half-duplex links with Normal Response Mode (NRM) principle is simple - primary station sends command frame(s) with P bits set on last frame, granting permission to secondary to respond with frame(s) with F bit also set on the last frame.

In full-duplex link in NRM primary station sends command with P bit set on first frame and can send more frames. When secondary receives this first command frame with P bit set it can send response frames with F bit set on first frame. The purpose of setting P/F bit on first command/response frame is speed - primary grants permission to transmit commands to secondary as fast as possible so secondary can send response(s) while primary is still sending commands (two-way simultaneous).

In full-duplex ABM situation complicates for me. There is no primary secondary relationship but both stations are combined stations, and both can send command(s) and response(s) at anytime (asynchronously). Here is an example exchange for information in ABM from the ISO document that i mentioned earlier info exchange. Why both stations use frames with P/F bit. Would not the exchange look the same without P/F bit ? When and WHY a station sends frames with P/F bit in ABM ?

2 Answers 2

0

As described in section 5.4.3.1.3 of ISO13239:

In ARM and ABM, the P bit set to "1" shall be used to solicit a response, at the earliest respond opportunity, with the F bit set to "1".

NOTE : For example, if the primary/combined station requires positive acknowledgement that a particular command has been received, it sets the P bit in the command to "1". This forces a response from the secondary/combined station as described in 5.4.3.1.6.

(The reference to 5.4.3.1.6 must be a typo, as that section doesn't exist...)

2
  • Finally got some reply :). This sections does not clarify anything to me. Sending ommand with P just to receive response with F bit set makes no sense. I presume they did it for comlience with other HDLC modes. There is a lot of haziness in ISO doc. I did not use P/F exchange at all. I just simply start a response timer for particullar command (SABM, DISC, RSET...). The same with information frames but i kept track of the oldest frame sent with reponse timer running. This response timer is reset with each incomming information frame and RR, RNR and REJ frame (by NR seq. num.).
    – i777
    May 7, 2019 at 16:15
  • I agree that it doesn't seem particularly useful for ABM, and that it seems to be more for consistency with other modes. Of course, if you're responsible for both ends of the link you can make it work however you like - it's when you have to interoperate with other implementations that these things become significant. (For example, if you don't set the P bit, somebody else's implementation might not transmit its response immediately.)
    – Jeremy
    May 8, 2019 at 7:08
0

When and WHY a station sends frames with P/F bit in ABM?

When? Station sends command frame (frame with destination station address and P/F bit set. P/F bit is treated as P bit in this case) as soon as possible. I.e. at the beggining of the conversation, and then each time it receives response. Response is the frame with transmitting station address(peer address) and P/F bit set. P/F bit is treated as F bit in this case.

6.4 Addressing scheme

In all classes (unbalanced, balanced, and connectionless), commands shall always be sent containing a destination data station address, and responses shall always be sent containing the assigned transmitting data station address.

Why? Because of checkpointing. It helps to detect lost frames and retransmit them. You can use REJ frame also, but it is optional.

5.4.3.3.4 Checkpointing

in ABM In ABM, the N(R) of a received I, RR or RNR response frame which has the F bit set to "1" shall cause the received combined station to initiate appropriate error recovery if the N(R) does not acknowledge at least all I frames transmitted by the receiving combined station previous to, and concurrent with, the last frame which was transmitted by the receiving combined station with the P bit set to "1".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.