Download presentation
Presentation is loading. Please wait.
1
A multi-platform programming interface for protocol development Carlos Miguel Tavares Calafate, Pietro Manzoni calafate@disca.upv.es Polytechnic University of Valencia (Spain)
2
Our area of research: Requirements: Network interface card control Strong interaction with packet flows – Sending / receiving process – Queue management – Routing table and forwarding process High level of kernel integration Communication protocols for wireless ad-hoc networks. Ex: AODV, DSR, OLSR
3
Problem Usually developed in Linux using ANSI C. Implementation is too bound to the type of the Operating System Conversion to other operating systems requires re-writing almost from scratch. Result: Windows 2000 and Windows CE users usually have to wait for a long time before these implementations are available.
4
Solution A library (PICA) that: –Is written in ANSI C –Makes available the required basic functions. –Targets the Linux, Windows NT & Windows CE platforms simultaneously. –Does not introduce great overhead. –Has self-explaining API
5
management IP Forwarding Threads Logging Privileges Timers Synchronization Sockets PICA NICs Routing table Packet System management primitives Network management primitives
6
Linux Windows NT Windows CE Common source code Other platforms PICA, PCAP & Std. C Libraries Platform specific binary Compiler
7
What is achieved? C code that only uses PICA library and standard C functions can be compiled directly on other supported platforms. Conversion of existing protocols to other Operating Systems is faster. New protocols can be created in a shorter period, and be available for all supported O.S. simultaneously.
8
Implementations with PICA Optimized Link State Routing (OLSR) protocol – Original implementation from INRIA (France) for the Linux platform. – Windows NT and Windows CE versions required only 3 weeks work with PICA. – Enhancements were easy and straightforward.
9
Example if (PICAgetAvailableDevices(&devs) == 0) { fprintf(stderr,"Error getting available devices\n"); exit(-1); } for (i=0;i<devs.num_devices;i++) {........ } if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { sprintf(logdata, "socket: %s\n", strerror(errno)); close(s); return; } ifc.ifc_len = sizeof (buf); ifc.ifc_buf = buf; if (ioctl(s, SIOCGIFCONF, (char *)&ifc) < 0) { sprintf(logdata, "ioctl (get interface configuration)\n", strerror(errno)); close(s); return; } ifr = ifc.ifc_req; cplim = buf + ifc.ifc_len; for (cp = buf; cp ifr_name) + size(ifr->ifr_addr)) {...... } Original (Linux) With PICA (multiplatform)
10
Other applications Even though PICA’s originally biased towards ad- hoc routing protocols, it turned out to be quite general purposed: – Network analyzers and sniffers – Software switches – Traffic shapers – Educational programs – etc.
11
Web page: http://pica-api.sourceforge.net
12
Questions?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.