Chapter 10 IPv4 and IPv6 Interoperability

Slides:



Advertisements
Similar presentations
IPv4 and IPv6 Interoperability
Advertisements

Chapter 10 IPv4 and IPv6 Interoperability. contents Introduction IPv4 Client, IPv6 Server IPv6 Client, IPv4 Server IPv6 Address Testing Macros IPV6_ADDRFORM.
Socket Programming with IPv6. Why IPv6? Addressing and routing scalability Address space exhaustion Host autoconfiguration QoS of flow using flowlabel.
Sockets: Network IPC Internet Socket UNIX Domain Socket.
Chapter 14 Application Layer and Client-Server Model.
Elementary TCP Sockets© Dr. Ayman Abdel-Hamid, CS4254 Spring CS4254 Computer Network Architecture and Programming Dr. Ayman A. Abdel-Hamid Computer.
Today’s topic: Basic TCP API –Socket –Bind –Listen –Connect –Accept –Read –Write –Close.
Networks: TCP/IP Socket Calls1 Elementary TCP Sockets Chapter 4 UNIX Network Programming Vol. 1, Second Ed. Stevens.
Elementary TCP Sockets Chapter 4 UNIX Network Programming Vol. 1, Second Ed. Stevens.
Quick Overview. 2 ISO/OSI Reference Model Application Application Presentation Presentation Session Session Transport Transport Network Network Data Link.
1 Socket Interfaces Professor Jinhua Guo CIS527 Fall 2003.
Tutorial 8 Socket Programming
Programming with Berkeley Sockets Presented by Chris GauthierDickey Written by Daniel Stutzbach (I think!) for CIS 432/532 Useful References: ● man pages.
CS 311 – Lecture 18 Outline IPC via Sockets – Server side socket() bind() accept() listen() – Client side connect() Lecture 181CS Operating Systems.
ISP – 9 th Recitation Socket programming – Client side.
1 Advanced Name and Address Conversions getaddrinfo, getnameinfo, gai_strerror, freeaddrinfo host_serv, tcp_connect, tcp_listen, udp_client, udp_connect,
Basic Socket Programming TCP/IP overview. TCP interface Reference: –UNIX Network Programming, by Richard Stevens. –UNIX man page.
ECE 4110 – Internetwork Programming Client-Server Model.
Sockets and intro to IO multiplexing. Goals We are going to study sockets programming as means to introduce IO multiplexing problem. We will revisit socket.
Fall 2000Datacom 11 Socket Programming Review Examples: Client and Server-Diagnostics UDP versus TCP Echo.
TCP/IP Protocol Stack IP Device Drivers TCPUDP Application Sockets (Gate to network) TCP: –Establish connection –Maintain connection during the communication.
Assignment 3 A Client/Server Application: Chatroom.
Socket Programming. Introduction Sockets are a protocol independent method of creating a connection between processes. Sockets can be either – Connection.
Client-Side Network Programming
CS345 Operating Systems Φροντιστήριο Άσκησης 2. Inter-process communication Exchange data among processes Methods –Signal –Pipe –Sockets.
IT1352-NETWORK PROGRAMMING AND MANAGEMENT
Sirak Kaewjamnong Computer Network Systems
McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Chapter 16 Socket Interface
Sockets API Overview Sockets with UDP Sockets with TCP Fast Sockets (Fast UDP) IP Multicasting.
 Wind River Systems, Inc Chapter - 13 Network Programming.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Chapter 16 Socket Interface.
CPSC 441 TUTORIAL – FEB 13, 2012 TA: RUITNG ZHOU UDP REVIEW.
TELE202 Lecture 15 Socket programming 1 Lecturer Dr Z. Huang Overview ¥Last Lecture »TCP/UDP (2) »Source: chapter 17 ¥This Lecture »Socket programming.
CSCE 515: Computer Network Programming UDP Socket Wenyuan Xu Department of Computer Science and Engineering.
Chapter 27 Socket API Interface The interface between an application program and the communication protocols in an operating system is known as the Application.
Sockets Socket = abstraction of the port concept: –Application programs request that the operating system create a socket when one is needed –O.S. returns.
Socket Programming Introduction. Socket Definition A network socket is one endpoint in a two-way communication flow between two programs running over.
Programming with UDP – II Covered Subjects: Creating UDP sockets Client Server Sending data Receiving data Connected mode.
Review: – Why layer architecture? – peer entities – Protocol and service interface – Connection-oriented/connectionless service – Reliable/unreliable service.
CSCI 330 UNIX and Network Programming Unit XIV: User Datagram Protocol.
UNIX Sockets Outline UNIX sockets CS 640.
©The McGraw-Hill Companies, Inc., 2000© Adapted for use at JMU by Mohamed Aboutabl, 2003Mohamed Aboutabl1 1 Chapter 16 Socket Interface.
Chapter 11 Advanced Name and Address Conversion. Introduction gethostbyname, gethostbyaddr: protocol dependent getaddrinfo: –a function providing protocol.
Lecture 3 TCP and UDP Sockets CPE 401 / 601 Computer Network Systems slides are modified from Dave Hollinger.
Socket Programming in C CS587x Lecture 3 Department of Computer Science Iowa State University.
1 UDP Sockets Programming Creating UDP sockets.Creating UDP sockets. –Client –Server Sending data.Sending data. Receiving data.Receiving data. Connected.
CSE 333 – SECTION 8 Client-Side Network Programming.
SOCKET PROGRAMMING Presented By : Divya Sharma.
Read: Chapters 1,2, 3, 4 Communications Client Server Ex: TCP/IP
CS 1652 Jack Lange University of Pittsburgh
Internet Address Routines
Network Programming CSC- 341
Network Programming with Sockets
Socket Interface 1 Introduction 11 Socket address formats 2 API 12 13
Review: TCP Client-Server Interaction
Imam Ahmad Trinugroho, ST., MMSI
CHAPTER 8 ELEMENTARY UDP SOCKETS
Name and Address Conversions Part I
Transport layer API: Socket Programming
Introduction to Network Programming Speaker: Jae Chung
Things that are nice to know when you’re doing this project
UDP Sockets Programming
Socket Abstraction and Interprocess Communication
Chapter 16 Socket Interface.
Advanced Network Programming spring 2007
Chapter 11 Name and Address Conversions (Part II)
Chapter 06. UDP Server/Client.
Refs: Chapter 10, Appendix A
Today’s topic: Basic TCP API
IPv4 and IPv6 Interoperability
Presentation transcript:

Chapter 10 IPv4 and IPv6 Interoperability

contents Introduction IPv4 Client, IPv6 Server IPv6 Address Testing Macros IPV6_ADDRFORM Socket Option Source Code Portability

Introduction Server and client combination IPv4 <=> IPv4(most server and client) IPv4 <=> IPv6 IPv6 <=> IPv4 IPv6 <=> IPv6 How IPv4 application and IPv6 application can communicate with each other. Host are running dual stacks, both an IPv4 protocol stack and IPv6 protocol stack

IPv4 Client , IPv6 Server IPv6 dual stack server can handle both IPv4 and IPv6 clients. This is done using IPv4-mapped IPv6 address server create an IPv6 listening socket that is bound to the IPv6 wildcard address

IPv6 server IPv6 client IPv4 client TCP TCP TCP IPv6 IPv4 IPv4 IPv6 IPv6 listening socket, bound to 0::0, port 8888 TCP TCP TCP IPv6 address IPv4 mapped IPv6 address IPv6 IPv4 IPv4 IPv6 206.62.226.42 5flb:df00:ce3e:e200:20:800:2b37:6426 Data link Data link Data link Enet hdr IPv4 hdr TCP hdr TCP data Type0800 Dport 8888 TCP hdr TCP data Enet hdr IPv4 hdr Type0800 Dport 8888

IPv4 sockets IPv6 sockets AF_INET SOCK_DGRAM sockaddr_in AF_INET SOCK_STREAM sockaddr_in IPv4 sockets AF_INET6 SOCK_DGRAM sockaddr_in6 AF_INET6 SOCK_DGRAM sockaddr_in6 IPv6 sockets UDP TCP IPv4 mapped IPv4 IPv6 Address returned by accept or recvfrom IPv4 IPv6 IPv4 datagram IPv6 datagram

IPv6 client, IPv4 server IPv4 server start on an IPv4 only host and create an IPv4 listening socket IPv6 client start, call gethostbyname. IPv4 mapped IPv6 address is returned. Using IPv4 datagram

IPv4 sockets IPv6 sockets AF_INET SOCK_DGRAM sockaddr_in AF_INET SOCK_STREAM sockaddr_in IPv4 sockets AF_INET6 SOCK_DGRAM sockaddr_in6 AF_INET6 SOCK_DGRAM sockaddr_in6 IPv6 sockets UDP TCP IPv6 IPv4 mapped IPv4 IPv6 Address for connect or sendto IPv4 IPv6 IPv4 datagram IPv6 datagram

IPv6 Address Testing Macros There are small class of IPv6 application that must know whether they are talking to an IPv4 peer. These application need to know if the peer’s address is an IPv4-mapped IPv6 address. Twelve macro defined(참조 page 267)

IPV6_ADDRFORM Socket Option Can change a socket from one type to another, following restriction. An IPv4 socket can always be changed to an IPv6. Any IPv4 address already associated with the socket are converted to IPv4- mapped IPv6 address. An IPv6 socket can changed to an IPv4 socket only if any address already associated with the socket are IPv4-mapped IPv6 address.

Converting an IPv4 to IPv6 Int af; socklen_t clilen; struct sockaddr_int6 cli; /* IPv6 struct */ struct hostent *ptr; af = AF_INT6; Setsockopt(STDIN_FILENO, IPPROTO_IPV6, IPV6_ADDRFORM, &af, sizeof(af)); clilen = sizeof(cli); Getpeername(0, &cli, &clilen); ptr = gethostbyaddr(&cli.sin6_addr, 16, AF_INET);

getpeername =>return an IPv4-mapped IPv6 address setsockopt => change the Address format of socket from IPv4 to IPv6. Return value is AF_INET or AF_INET6 getpeername =>return an IPv4-mapped IPv6 address

Source Code Portability #ifdefs => hard to maintain, littered … use getaddrinfo and getnameinfo