Upload
jocelin-kelley
View
216
Download
1
Embed Size (px)
Citation preview
1draft-hiko-pana-api-02.txt
The PANA API
draft-hiko-pana-api-02.txt
Yoshihiko Kainuma
Fumio Teraoka
Graduate School of Science and Technology
Keio University
2draft-hiko-pana-api-02.txt
Assumed Usage of PANA Library
pana lib
PaCmain part
PaC processon mobile node
pana libdiameter
lib
PAA / AAAcmain part
diameterlib
AAArelaymain part
diameterlib
AAAhmain part
PAA / AAAc processon server or router
pana
snmp
diameter
diameter
(out of scope of this i-d)
AAA relay process
AAA home process
EP
router/bridge
3draft-hiko-pana-api-02.txt
PANA API Overview
• Based on draft-ietf-pana-pana-12.txt• Multi-Thread
Main thread Listener thread
Session thread
Retransmissionthread
Messagecallback thread
Timeoutcallback thread
listen to messages from peer.
manage timers.
retransmit messages.
execute message callbacks.
execute timer callbacks.
4draft-hiko-pana-api-02.txt
API List (1/2)• 37 functions are defined.• Initialization and Configurat
ion (3)– PANAOpen()– PANAClose()– PANAGetDefaultConfigFile
Name()• Callback registration (4)
– PANARegisterMessageCallback()
– PANADeregisterMessageCallback()
– PANARegisterTimerCallback()
– PANADeregisterTimerCallback()
• Session management (8)– PANANewSession()– PANAFreeSession()– PANARegisterSession()– PANASetSessionAttribute()– PANAGetSessionAttribute()– PANASessionValidityCheck()– PANADeriveAuthKey()– PANADeriveMasterKey()
5draft-hiko-pana-api-02.txt
API List (2/2)
• PANA operation (9)– PANAClientInitiation()– PANAStart()– PANAAuth()– PANABind()– PANAPing()– PANATerimnation()– PANAError()– PANAReauth()– PANAUpdate()
• EP control (2)– PANASetEP()– PANASetMasterKey()
• Dictionary lookup (6)– PANADictionaryEntryFrom
AVPCode()– PANADictionaryEntryFrom
Name()– PANAValueFromName()– PANAValueFromAVPCode()– PANALookupValueName
UsingValue()– PANAGetMessageCode()
• Message management (5)– PANACreateAVP()– PANAFreeAVP()– PANACreateAndAddAVPTo
List()– PANARemoveAVPFromList()– PANAComputeAuthAVP()
6draft-hiko-pana-api-02.txt
Callback Registration
• PANARegisterMessageCallback (PANAMessageCode code, PANAMessageFlag flg,
PANAVendorID vid,
char *messageName, PANACallback *callbac
k, PANACallbackPosition *position)
important parameters– code: Code of the message (e.g. PANA-Start: 2).– flg: Flag of the message (e.g. REQUEST: 0x8000).– callback: Callback to be registered.
7draft-hiko-pana-api-02.txt
Message Creation and Transmission
• PANAAuth (PANASessionID *id,
PANAMessageFlag flg,
PANA_AVP_LIST *avp_list)
important parameters– id: Identifier of the session to be handled.– flg: Flag of the message (e.g. REQUEST: 0x8000).– avp_list: AVP list to be attached to the message.
* other PANA functions have the similar syntax.
8draft-hiko-pana-api-02.txt
Example Implementation (PaC)
・・ ・
PaC PAA Diameter serverPCI
PSR
PSA
PAR
PANDiameter-EAP Request
Diameter-EAP Answer
Diameter-EAP Request
Diameter-EAP Answer
PBR
PBA
9draft-hiko-pana-api-02.txt
Example Implementation (PaC)PANAReturnCode HandleStartRequest(void *ptr){
PANAMessage *msg = (PANAMessage *)ptr;PANA_AVP_LIST *avpList;・・・
PANAReturnCode res = PANAStart(msg->sender, 0, avpList);return res;
}
int main(){
・・・
PANARegisterMessageCallback(PANA_START, REQUEST, 0, NULL, HandleStartRequest, PANA_APP_INSTALL_ANYWHERE);・・・
}
Register callback function
Create message and send it to PAA
10draft-hiko-pana-api-02.txt
Example Implementation (PAA to AAAc)
・・ ・
PaC PAA / Diameter client Diameter serverPCI
PSR
PSA
PAR
PANDiameter-EAP Request
Diameter-EAP Answer
Diameter-EAP Request
Diameter-EAP Answer
PBR
PBA
11draft-hiko-pana-api-02.txt
Example Implementation (PAA to AAAc)PANAReturnCode HandleAuthAnswer(void *ptr){
PANAMessage *msg_pana = (PANAMessage *)ptr;AAAMessage *msg_aaa;PANA_AVP_LIST *avpList;・・・
AAAReturnCode res = AAASendMessage(msg_aaa);return res;
}
int main(){
・・・
PANARegisterMessageCallback(PANA_AUTH, REQUEST, 0, NULL, HandleAuthAnswer, PANA_APP_INSTALL_ANYWHERE);・・・
}
Register callback function
Create message and send it to Diameter
12draft-hiko-pana-api-02.txt
Example Implementation (AAAc to PAA)
・・ ・
PaC PAA Diameter serverPCI
PSR
PSA
PAR
PANDiameter-EAP Request
Diameter-EAP Answer
Diameter-EAP Request
Diameter-EAP Answer
PBR
PBA
13draft-hiko-pana-api-02.txt
Example Implementation (AAAc to PAA)PANAReturnCode HandleEAPAnswer(void *ptr){
AAAMessage *msg_aaa = (AAAMessage *)ptr; PANAMessage *msg_pana;PANASessionID *id
PANA_AVP_LIST *avpList;・・・
PANAReturnCode res = PANABind(id, REQUEST, avpList);return res;
}
int main(){
・・・
AAARegisterCommandCallback(EAP_APPLICATION, AAA_NO_VENDOR_ID, NULL, 0, HandleEAPAnswer, AAA_APP_INSTALL_FIRST);・・・
}
Create message and send it to PaC
Registering callback function
14draft-hiko-pana-api-02.txt
Current Status
• PANA API implementation – based on draft-ietf-pana-pana-12.txt– developed on FreeBSD– running on *BSD and Linux– will be released with BSD license.
• Diameter API implementation – based on draft-ietf-dime-diameter-api-00.txt (expired)– developed on FreeBSD– running on *BSD and Linux– will be released with BSD license.
• Adapt this draft as WG document?