Chapter 10 IPv4 and IPv6 Interoperability. contents Introduction IPv4 Client, IPv6 Server IPv6 Client, IPv4 Server IPv6 Address Testing Macros IPV6_ADDRFORM.

Slides:



Advertisements
Similar presentations
Echo server The client reads a line of text from its standard input and writes the line to the server The server reads the line from its network input.
Advertisements

Florida State UniversityCOP Advanced Unix Programming Raw Sockets Datalink Access Chapters 25, 26.
Socket Programming 101 Vivek Ramachandran.
Introduction to Sockets Jan Why do we need sockets? Provides an abstraction for interprocess communication.
Socket Programming CS3320 Fall 2010.
CS 4700 / CS 5700 Network Fundamentals
Computer Net Lab/Praktikum Datenverarbeitung 2 1 Overview Sockets Sockets in C Sockets in Delphi.
IPv4 and IPv6 Interoperability
IPv6 Technologies and Advanced Services page 1 Porting applications to IPv6 OpenH323 and IPv6 support K. Stamos Computer Engineer, University of Patras.
Ipv4 Socket Address Structure struct in_addr { in_addr_t s_addr; /* 32-bit IPv4 address */ /* network byte ordered */ }; struct sockaddr_in { uint8_t sin_len;
Socket Programming with IPv6. Why IPv6? Addressing and routing scalability Address space exhaustion Host autoconfiguration QoS of flow using flowlabel.
CSE 333 – SECTION 8 Networking and sockets. Overview Network Sockets IP addresses and IP address structures in C/C++ DNS – Resolving DNS names Demos.
Taekyung Kim 0x410 ~ 0x International Standards Organization (ISO) is a multinational body dedicated to worldwide agreement on international.
Programming with UDP – I Covered Subjects: IPv4 Socket Address Structure Byte Ordering Functions Address Access/Conversion Functions Functions: 1.socket()
CS252: Systems Programming Ninghui Li Based on slides by Prof. Gustavo Rodriguez-Rivera Topic 16: Socket Programming & Project 5.
1 Pertemuan 6 Elementary UDP Sockets Matakuliah: H0483 / Network Programming Tahun: 2005 Versi: 1.0.
Today’s topic: Basic TCP API –Socket –Bind –Listen –Connect –Accept –Read –Write –Close.
UDP and Multi-thread Socket Programming
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.
Sockets Basics Conectionless Protocol. Today IPC Sockets Basic functions Handed code Q & A.
Tutorial 8 Socket Programming
Introduction to Project 1 Web Client and Server Jan 2006.
Introduction to Linux Network 劉德懿
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.
Network Programming Tutorial #9 CPSC 261. A socket is one end of a virtual communication channel Provides network connectivity to any other socket anywhere.
Elementary TCP Sockets
Socket Programming. Introduction Sockets are a protocol independent method of creating a connection between processes. Sockets can be either – Connection.
9/12/2015B.R1 Socket Abstraction and Interprocess Communication B.Ramamurthy CSE421.
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.
Chapter 2 Applications and Layered Architectures Sockets.
The Socket Interface Chapter 22. Introduction This chapter reviews one example of an Application Program Interface (API) which is the interface between.
CS 158A1 1.4 Implementing Network Software Phenomenal success of the Internet: – Computer # connected doubled every year since 1981, now approaching 200.
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.
Socket Programming Introduction. Socket Definition A network socket is one endpoint in a two-way communication flow between two programs running over.
Socket Programming.
Programming with UDP – II Covered Subjects: Creating UDP sockets Client Server Sending data Receiving data Connected mode.
Advanced UNIX programming Fall 2002, lecture 16 Instructor: Ashok Srinivasan Acknowledgements: The syllabus and power point presentations are modified.
CSCI 330 UNIX and Network Programming Unit XIV: User Datagram Protocol.
©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.
EECS340 Recitation 1: Very helpful to your project Hongyu Gao 1.
Socket Programming in C CS587x Lecture 3 Department of Computer Science Iowa State University.
Socket Programming(1/2). Outline  1. Introduction to Network Programming  2. Network Architecture – Client/Server Model  3. TCP Socket Programming.
Sockets Intro to Network Programming. Before the internet... Early computers were entirely isolated No Internet No network No model No external communications.
UDP. User Datagram Protocol (UDP)  Unreliable and unordered datagram service  Adds multiplexing  No flow control  Endpoints identified by ports 
Socket Abstraction and Interprocess Communication
Chapter 10 IPv4 and IPv6 Interoperability
CS 1652 Jack Lange University of Pittsburgh
Chapter4 Elementary TCP Socket
Network Programming with Sockets
CHAPTER 8 ELEMENTARY UDP SOCKETS
Name and Address Conversions Part I
Network Programming CSC- 341
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.
Socket Abstraction and Interprocess Communication
IPv4 and IPv6 Interoperability
Presentation transcript:

Chapter 10 IPv4 and IPv6 Interoperability

contents Introduction IPv4 Client, IPv6 Server IPv6 Client, IPv4 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 client IPv6 server TCP IPv6 Data link Data link IPv4 TCP IPv4 client TCP IPv4IPv6 Data link Enet hdr IPv4 hdr TCP hdr TCP data Enet hdr IPv4 hdr TCP hdr TCP data Type0800 Dport IPv4 mapped IPv6 address IPv6 listening socket, bound to 0::0, port 8888 IPv6 address 5flb:df00:ce3 e:e200:20:80 0:2b37:6426

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

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 datagramIPv6 datagram AF_INET SOCK_STREAM sockaddr_in AF_INET SOCK_DGRAM sockaddr_in AF_INET6 SOCK_DGRAM sockaddr_in6 AF_INET6 SOCK_DGRAM sockaddr_in6 TCP IPv4 IPv6 UDP IPv4 sockets IPv6 sockets Address for connect or sendto IPv6 IPv4 IPv4 mapped IPv6

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.

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); Converting an IPv4 to IPv6

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