datasheets.com EBN.com EDN.com EETimes.com Embedded.com PlanetAnalog.com TechOnline.com  
Events
UBM Tech
UBM Tech

Design Article

Guide to Embedded Systems Architecture - Part 2: PPP state pseudocode and Internet Protocol

Tammy Noergaard

4/26/2010 2:51 PM EDT

State Pseudocode: Request-Sent & ACK-Received
Request-Sent: In the Request-Sent state an attempt is made to configure the connection. A Configure-Request has been sent and the Restart timer is running, but a Configure-Ack has not yet been received nor has one been sent. [10-1]

reqsent (){
    if (event) {
        = DOWN : transition(STARTING); //transition to STARTING state
                end DOWN;
        = OPEN : transition(REQSENT); //transition to REQSENT state
                end OPEN;
        = CLOSE : irc(event); //action
                str(... ); //action
                transition(CLOSING); //transition to closing state
                end CLOSE;
        = TOP : scr(false); //action
                initialize PPPTimer(); //initialize PPP timer
                end TOP;
        = TON, RTA, RXJP, or RXR :
                end EVENT; //no action or state transition
        = RCRP : sca(... ); //action if (PAP
        = Server) { tlu(); //action
                transition(OPENED); //transition to OPENED state
            } else { //client
            transition(ACKSENT); //transition to ACKSENT state
            }
            end RCRP;
        = RCRN : scn(... ); //action
                end RCRN;
        = RCA : if (PAP
        = Server) { tlu(); //action
                transition(OPENED); //transition to OPENED state
            } else { //client
                irc(event); //action
                transition(ACKRCVD); //transition to ACKRCVD state
            }
            end RCA;
        = RCN : irc(event); //action
                scr(false); //action
                transition(REQSENT); //transition to REQSENT state
                end RCN;
        = RTR : sta(... ); //action
                end RTR;
        = RUC : scj(..); //action
                break;
        = RXJN : tlf(); //action
                transition(STOPPED); //transition to STOPPED state
                end RXJN;
        = any other event :
                wrongEvent; //indicate that when PPP in reqsent state no other event is processed
    }
}

ACK-Received: In the Ack-Received state, a Configure-Request has been sent and a Configure-Ack has been received. The Restart timer is still running, since a Config-ure-Ack has not yet been sent. [10-1]

ackrcvd (){
if (event) {
        = DOWN : transition(STARTING); //transition to STARTING state
                end DOWN;
        = OPEN, TON, or RXR:
                end EVENT; //no action or state transition
        = CLOSE : irc(event); //action
                str(... ); //action
                transition(CLOSING); //transition to CLOSING state
                end CLOSE;
        = TOP : scr(false); //action
                transition(REQSENT); //transition to REQSENT state
                end TOP;
        = RCRP : sca(... ); //action

                tlu(); //action
                transition(OPENED); //transition to OPENED state
                end RCRP;
        = RCRN : scn(... ); //action
                end RCRN;
        = RCA or RCN : scr(false); //action
                transition(REQSENT); //transition to REQSENT state
                end EVENT;
        = RTR : sta(... ); //action
                transition(REQSENT); //transition to REQSENT state
                end RTR;
        = RTA or RXJP : transition(REQSENT); //transition to REQSENT state
                end EVENT;
        = RUC : scj(... .); //action
                end RUC;
        = RXJN : tlf(); //action
                transition(STOPPED); //event
                end RXJN;
        = any other event :
                wrongEvent; //indicate that when PPP in ackrcvd state no other event is processed
    }
}





Please sign in to post comment

Navigate to related information

Datasheets.com Parts Search

185 million searchable parts
(please enter a part number or hit search to begin)