1 / 10

Project Goal

Project Goal. Convert existing (real) TCP/IP applications to native API This should be done with minimum modifications of the applications’ source code The basic idea is to give the applications the illusion of working with a normal TCP/IP library. Socket TCP/IP API.

zarifa
Download Presentation

Project Goal

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Project Goal • Convert existing (real) TCP/IP applications to native API • This should be done with minimum modifications of the applications’ • source code • The basic idea is to give the applications the illusion of working with a • normal TCP/IP library

  2. Socket TCP/IP API • int socket(int type,int family,int protocol); • int bind(int socket,const struct sockaddr* sa,int addrlen); • int listen(int socket,int backlog); • int accept(int socket,struct sockaddr* sa,int* addrlen); • int connect(int socket,const struct sockaddr* sa,int addrlen); • int read(int fd,void* buffer,int buff_size); • int write(int fd,const void* buffer,int buff_size); • int recv(int fd,void* buffer,int buff_size,int flags); • int send(int fd, const void* buffer,int buff_size,int flags); • int sendto(int fd, const void* buffer,int buff_size, • const struct sockaddr* sa,int addrlen,int size); • int recvfrom(int fd,void* buffer,int buff_size, • struct sockaddr* sa,int* addrlen,int flags); • int setsockopt (int socket, int level, int optname, const char* optval, int optlen); • int getsockopt (int socket, int level, int optname, char* optval, int optlen); • int close(int socket); • struct hostent* gethostbyname(const char* hostname); • struct hostent* gethostbyaddr(const char* hostaddr,int addrlen);

  3. Fore ATM API • int atm_open(char* device,int flags,Atm_info* info); • int atm_bind(int fd,Atm_sap asap,Atm_sap* asap_assigned,int qlen); • int atm_listen(int fd,int*conn_id,Atm_endpoint* calling, • Atm_qos* qos,Aal_type* aal); • int atm_accept(int fd,int newfd,int conn_id,Atm_qos* qos,Atm_dataflow dataflow); • int atm_connect(int fd,Atm_endpoint* dest,Atm_qos* qos, • Atm_qos_sel* qos_sel,Aal_type aal,Atm_dataflow dataflow); • int atm_recv(int fd,caddr_t buffer,int buff_size); • int atm_send (int fd, caddr_t buffer,int buff_size); • int atm_close(int fd); • int atm_gethostbyname(char* hostname,Atm_address* dest_addr);

  4. Similarities between Socket TCP/IP and Fore ATM APIs TCP/IP API Fore ATM API socket atm_open bind atm_bind listen atm_bind + atm_listen accept atm_listen + atm_accept connect atm_connect read, recv atm_recv write, send atm_send close atm_close gethostbyname atm_gethostbyname

  5. Similarities between Socket TCP/IP and Fore ATM APIs (2) TCP/IP API Fore ATM API socket ATM file descriptor port ATM service access point IP address ATM address struct sockaddr Atm_endpoint

  6. General Assumptions • the source code of the application is available • the source code for the standard C/C++ runtime library is not available • the source code for the TCP/IP network library is not available

  7. local_address Address table File descriptor table IP ATM ref_cnt 2 fd name peer type buff qos SOCK_DGRAM 1 Endpoint table port nsap address ref_cnt 1 1 Data structures for connection-oriented (stream) sockets emulation

  8. local_address Address table (Fictive) File descriptor table IP ATM ref_cnt 2 fd real_fd type name SOCK_DGRAM 1 Real File descriptor table (one for each fictive fd) Endpoint table fd peer port nsap address ref_cnt 1 1 Data structures for connectionless (datagram) sockets emulation

  9. How should we modify the applications ? • The following line should be added as the first line in every source and header file: #include “atm_cheat.h” • The linker options should be set up to link the final code with the • libatm-cheat.a library • The ATM_HOST_NAME environment variable should be set at runtime to indicate • the name of the local host • This should be all :-). However some analysis of the source code of the original • application is still necessary (see the next slide: limitations)

  10. Limitations and Further Development • The dup() and dup2() system calls are not supported. This is a serious limitation. Lots • of real applications do use these calls. • I think it is possible to support these calls; however this requires some effort and • also either access to the source code of the runtime C/C++ library or some rewriting • of several standard I/O functions

More Related