Porting applications & DNS issues. socket interface extensions for IPv6. Eva M. Castro. ecastro@dit.upm.es. dit. Porting applications & DNS issues UPM



Similar documents
CSE 333 SECTION 6. Networking and sockets

Socket Programming. Srinidhi Varadarajan

Socket Programming. Kameswari Chebrolu Dept. of Electrical Engineering, IIT Kanpur

Introduction to Socket Programming Part I : TCP Clients, Servers; Host information

NS3 Lab 1 TCP/IP Network Programming in C

Introduction to Socket programming using C

IT304 Experiment 2 To understand the concept of IPC, Pipes, Signals, Multi-Threading and Multiprocessing in the context of networking.

IPv6 Enabling CIFS/SMB Applications

Software changes for Website and Application IPv6 Readiness

TCP/IP - Socket Programming

Tutorial on Socket Programming

Socket Programming. Request. Reply. Figure 1. Client-Server paradigm

Unix Network Programming

Hostnames. HOSTS.TXT was a bottleneck. Once there was HOSTS.TXT. CSCE515 Computer Network Programming. Hierarchical Organization of DNS

Domain Name System (1)! gethostbyname (2)! gethostbyaddr (2)!

Application Architecture

Socket Programming in C/C++

Implementing Network Software

Elementary Name and Address. Conversions

Porting and Deploying VoIP to IPv6: Lessons Learned

Networks class CS144 Introduction to Computer Networking Goal: Teach the concepts underlying networks Prerequisites:

Elementary Name and Address Conversions

Windows Socket Programming & IPv6 Translation Middleware

INTRODUCTION UNIX NETWORK PROGRAMMING Vol 1, Third Edition by Richard Stevens

Lab 4: Socket Programming: netcat part

IBM i Version 7.2. Programming Socket programming IBM

IPv4/IPv6 Transition for SIP VoIP Applications

ICT SEcurity BASICS. Course: Software Defined Radio. Angelo Liguori. SP4TE lab.

UNIX. Sockets. mgr inż. Marcin Borkowski

Best practices in IPv6 enabled networking software development.

Communication Networks. Introduction & Socket Programming Yuval Rochman

Network Programming with Sockets. Anatomy of an Internet Connection

Concurrent Server Design Alternatives

UNIX Sockets. COS 461 Precept 1

Name and Address Conversions

Network Programming with Sockets. Process Management in UNIX

Programmation Systèmes Cours 9 UNIX Domain Sockets

ELEN 602: Computer Communications and Networking. Socket Programming Basics

BSD Sockets Interface Programmer s Guide

DESIGN AND IMPLEMENT AND ONLINE EXERCISE FOR TEACHING AND DEVELOPMENT OF A SERVER USING SOCKET PROGRAMMING IN C

sys socketcall: Network systems calls on Linux

Client / Server Programming with TCP/IP Sockets

KATRAGADDA INNOVATIVE TRUST FOR EDUCATION NETWORK PROGRAMMING. Notes prepared by D. Teja Santosh, Assistant Professor, KPES, Shabad, R.R. District.

The POSIX Socket API

M06 (31-May-2001) Requirements and guidelines for distributed laboratories application migration WP 3

Session NM059. TCP/IP Programming on VMS. Geoff Bryant Process Software

Generalised Socket Addresses for Unix Squeak

Lecture 7: Introduction to Sockets

Overview. Socket Programming. Using Ports to Identify Services. UNIX Socket API. Knowing What Port Number To Use. Socket: End Point of Communication

Computer Networks Network architecture

Porting and Running Asterisk to IPv6

Beej's Guide to Network Programming

VMCI Sockets Programming Guide VMware ESX/ESXi 4.x VMware Workstation 7.x VMware Server 2.0

IPv6 Applications. Formation IPv6 RENATER -Rouen, FR

Programming with TCP/IP Best Practices

Writing Client/Server Programs in C Using Sockets (A Tutorial) Part I. Session Greg Granger grgran@sas. sas.com. SAS/C & C++ Support

Operating Systems Design 16. Networking: Sockets

First Workshop on Open Source and Internet Technology for Scientific Environment: with case studies from Environmental Monitoring

DNS Domain Name System

Vicenza.linux.it\LinuxCafe 1

Networks. Inter-process Communication. Pipes. Inter-process Communication

Writing a C-based Client/Server

Network Programming. Chapter The Client-Server Programming Model

A Client Server Transaction. Introduction to Computer Systems /18 243, fall th Lecture, Nov. 3 rd

Limi Kalita / (IJCSIT) International Journal of Computer Science and Information Technologies, Vol. 5 (3), 2014, Socket Programming

Dissertation Title: SOCKS5-based Firewall Support For UDP-based Application. Author: Fung, King Pong

System calls. Problem: How to access resources other than CPU

Goal: learn how to build client/server application that communicate using sockets. An interface between application and network

RPG Does TCP/IP (Socket Progamming in RPG IV)

Use Domain Name System and IP Version 6

416 Distributed Systems. Feb 24, 2016 DNS and CDNs

3.5. cmsg Developer s Guide. Data Acquisition Group JEFFERSON LAB. Version

Packet Sniffing and Spoofing Lab

What is CSG150 about? Fundamentals of Computer Networking. Course Outline. Lecture 1 Outline. Guevara Noubir noubir@ccs.neu.

Bump In Host a Host-based IPv4 to IPv6 Translation

Network Programming using sockets

Network-Oriented Software Development. Course: CSc4360/CSc6360 Instructor: Dr. Beyah Sessions: M-W, 3:00 4:40pm Lecture 2

CS640: Computer Networks. Naming /ETC/HOSTS

Samba and Vista with IPv6

CSE 127: Computer Security. Network Security. Kirill Levchenko

A Client-Server Transaction. Systemprogrammering 2006 Föreläsning 8 Network Programming. Hardware Org of a Network Host.

Lecture 9: Network Security Introduction

TCP/IP Sockets in C. Practical Guide for Programmers

How do I get to

Project 4: IP over DNS Due: 11:59 PM, Dec 14, 2015

Transcription:

socket interface extensions for IPv6 Eva M. Castro ecastro@.upm.es

Contents * Introduction * Porting IPv4 applications to IPv6, using socket interface extensions to IPv6. Data structures Conversion functions Socket calls * IPv4 and IPv6 Interoperability Dual-stack * Study case: ISABEL

Introduction Existing IPv4 applications can work on IPv6 : 1. Porting the application networking part to manage IPv6 addresses. Using socket interface: * RFC 2553: Basic socket interface extensions for IPv6 (Draft Oct 2000). * RFC 2292: Advanced sockets API for IPv6 (Draft Nov 2000). 2. Reengineering the application to use new features in adion to larger address space: * QoS: Flow labels and priorities. * Mobility. * Multihoming. * Anycast communication. * Security: authentication and encryption. *...

Introduction BSD socket model => abstraction of the communication details to a common interface Network applications BSD sockets User Kernel generic socket management software INET sockets manages the communication end points for the IP based protocols TCP UDP IP

Contents * Introduction * Porting IPv4 applications to IPv6, using socket interface extensions to IPv6. Data structures Conversion functions Socket calls * IPv4 and IPv6 Interoperability Dual-stack * Study case: ISABEL

Porting IPv4 applications to IPv6, using socket interface extensions for IPv6 IPv6 addresses are 128 bit long. Changes in the application networking part 1. Data structures: Socket address struct 2. Conversion functions between: String and bynary representation Name and address 3. Socket calls

Contents * Introduction * Porting IPv4 applications to IPv6, using socket interface extensions to IPv6. Data structures Conversion functions Socket calls * IPv4 and IPv6 Interoperability Dual-stack * Study case: ISABEL

Generic Socket Address Struct sockaddr Length Family AF_XXXX Data struct sockaddr { uint8_t sa_len; sa_family_t sa_family; char sa_data[14]; }; 16 bits

IPv4 Socket Address Struct sockaddr_in Length Family Port Number IPv4 Address (32 bits) Unused 16 bits AF_INET struct sockaddr_in { uint8_t sin_len; sa_family_t sin_family; in_port_t sin_port; struct in_addr sin_addr; char sin_zero[8]; }; struct in_addr { uint32_t }; s_addr;

IPv6 Socket Address Struct sockaddr_in6 Length Family Port Number Flow Info IPv6 Address (128 bits) AF_INET6 struct sockaddr_in6 { uint8_t sin6_len; sa_family_t sin6_family; in_port_t sin6_port; uint32_t sin6_flowinfo; struct in6_addr sin6_addr; }; struct in6_addr { uint8_t s6_addr[16]; }; 16 bits

Contents * Introduction * Porting IPv4 applications to IPv6, using socket interface extensions to IPv6. Data structures Conversion functions Socket calls * IPv4 and IPv6 Interoperability Dual-stack * Study case: ISABEL

String and binary Address Conversions Conversions between the text representation and the binary value in network byte ordered (socket address structure). 1. String to 32-bit network byte ordered a.b.c.d a.b.c.d IPv4 only int inet_aton (const char *strptr, struct in_addr *addrptr); in_addr_t inet_addr (const char *strptr); /*deprecated*/ IPv4 & IPv6 int inet_pton (int family, const char *strptr, void *addrptr); 2. 32-bit network byte ordered to string a.b.c.d a.b.c.d IPv4 only IPv4 & IPv6 int int inet_ntoa (struct in_addr inaddr); inet_ntop (int family, const char *strptr, void *addrptr);

Conversions from Host Name to IP Address struct hostent *gethostbyname(const char *hostname); * Query for a DNS A record hostname.domain a.b.c.d IPv4 address * Query for a DNS AAAA record, RES_USE_INET6 resolver option is required: hostname.domain x:x:x:x:x:x:x:x IPv6 address ( if not found, IPv4-mapped IPv6 address = ::FFFF:x.x.x.x)

Conversions from Host Name to IP Address struct hostent *gethostbyname2(const char *hostname, int family); * Query for a DNS A record, family=af_inet is required: hostname.domain RES_USE_INET6 a.b.c.d ::FFFF:a.b.c.d IPv4 address IPv4-mapped IPv6 address * Query for a DNS AAAA record, family=af_inet6 is required: hostname.domain x:x:x:x:x:x:x:x IPv6 address

Conversions from Host Name to IP Address int getaddrinfo (const char *hostname, const char *service, const struct addrinfo *hints, const struct addrinfo **result); * Protocol independent function. hostname.domain + information type constraints: * family * socket type * protocol *... IP address (IPv4, IPv6)

Conversions from IP Address to Host Name struct hostent *gethostbyaddr(const char *addr, size_t len, int family); * From IPv4 address: a.b.c.d hostname.domain addr => in_addr len => sizeof(in_addr) family => AF_INET * From IPv6 address: x:x:x:x:x:x:x:x hostname.domain addr => in6_addr len => sizeof(in6_addr) family => AF_INET6 ::FFFF:a.b.c.d ::a.b.c.d => query in the domain for IPv4 address

Conversions from to IP Address to Host Name int getnameinfo (const struct sockaddr *sockaddr, socklen_t addrlen, char *host, size_t hostlen, char *serv, size_t servlen, int flags); * Protocol independent function. * From IPv4 address: a.b.c.d hostname.domain sockaddr => sockaddr_in len => sizeof(sockaddr_in) * From IPv6 address: x:x:x:x:x:x:x:x hostname.domain sockaddr => sockaddr_in6 len => sizeof(sockaddr_in6)

Contents * Introduction * Porting IPv4 applications to IPv6, using socket interface extensions to IPv6. Data structures Conversion functions Socket calls * IPv4 and IPv6 Interoperability Dual-stack * Study case: ISABEL

TCP Client-Server Socket Calls in IPv4 TCP client socket connect write read close TCP server socket bind listen accept read write read close

TCP Client-Server Socket Calls in IPv6 TCP client socket connect write read close TCP server socket bind listen accept read write read close

UDP Client-Server Socket Calls in IPv4 UDP client socket sendto UDP server socket bind recvfrom recvfrom sendto close

UDP Client-Server Socket Calls in IPv6 UDP client socket sendto UDP server socket bind recvfrom recvfrom sendto close

Same socket calls in IPv4 and IPv6 Some values in the API arguments change when using IPv4 or IPv6. * Address family, socket type and protocol in the socket call: int socket (int family, int type, int protocol); family type AF_INET AF_INET6 SOCK_STREAM SOCK_DGRAM SOCK_RAW TCP UDP IPv4 TCP UDP IPv6 protocol * A pointer to a sockaddr struct and its length are required in some calls: IPv4: Casting (sockaddr_in *) to (sockaddr *) Length => sizeof(sockaddr_in) IPv6: Casting (sockaddr_in6 *) to (sockaddr *) Length => sizeof(sockaddr_in6)

Contents * Introduction * Porting IPv4 applications to IPv6, using socket interface extensions to IPv6. Data structures Conversion functions Socket calls * IPv4 and IPv6 Interoperability Dual-stack * Study case: ISABEL

IPv4 and IPv6 Interoperability * During transition existing IPv4 applications should work with new IPv6 applications. Support IPv4 and IPv6 layers (Dual stack) TCP UDP IPv4 IPv6 Link Layer

IPv4 client - IPv6 server * IPv6 servers running in a dual stack host accept connections from IPv4 and IPv6 clients. IPv4 Client Client (IPv4) IPv6 Client Client (IPv6) IPv6 Server (dual stack host) Server (IPv6) Listen 0::0 and port TCP/UDP TCP/UDP TCP/UDP IPv4 mapped IPv6 ::FFFF:a.b.c.d IPv6 address x:x:x:x:x:x:x:x IPv4 IPv6 IPv4 IPv6 * Kernel converts from IPv4 to IPv4-mapped IPv6 address.

IPv6 client IPv4 server * IPv6 clients running in a dual stack host connect to IPv4 and IPv6 servers. IPv6 Client (dual stack host) IPv4 Server IPv6 Server Client (IPv6) Server (IPv4) Server (IPv6) TCP/UDP TCP/UDP TCP/UDP IPv4 mapped IPv6 ::FFFF:a.b.c.d IPv4 IPv6 IPv6 address x:x:x:x:x:x:x:x IPv4 a.b.c.d IPv6 x:x:x:x:x:x:x:x * Resolver converts from IPv4 to IPv4-mapped IPv6 address.

Portability * Make applications protocol independet of IPv4 or IPv6: Define a library to handle sockets, hiding protocol dependency and making application code simpler. * Use getaddrinfo, getnameinfo instead of gethostbyname and gethostbyaddr. * Special Addressess: 127.x.y.z and localhost

Contents * Introduction * Porting IPv4 applications to IPv6, using socket interface extensions to IPv6. Data structures Conversion functions Socket calls * IPv4 and IPv6 Interoperability Dual-stack * Study case: ISABEL

Study case: ISABEL ISABEL kernel application Audio Video Pointer... Ftp Eor Whiteboard Irouter Reliable transport Unreliable Flows Reliable Flows Network

Study case: ISABEL Application Level ISABEL component Communication Library ICF UDP TCP IPv4 / IPv6

Dual stack host IPv4 host IPv6 host ISABEL Master (isabel6) Irouter Reliable transport ISABEL Interactive (isabel) Irouter Reliable transport ISABEL Interactive (isabel6) Irouter Reliable transport UDP TCP UDP TCP UDP TCP IPv6 IPv4 IPv4 IPv4 address a.b.c.d IPv6 IPv4 address a.b.c.d Network