IPv6 Intro & Demo Yuxin Ouyang Yuhui Feng. Why IPv6 Space allowed by IPv4 is saturating IPv4 is not secure by itself Data prioritization in IPv4 is not.

Slides:



Advertisements
Similar presentations
Computer Net Lab/Praktikum Datenverarbeitung 2 1 Overview Sockets Sockets in C Sockets in Delphi.
Advertisements

Netprog: IPv61 IPv6 Refs: Chapter 10, Appendix A.
1 IPv6. 2 Problem: 32-bit address space will be completely allocated by Solution: Design a new IP with a larger address space, called the IP version.
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.
Programming with UDP – I Covered Subjects: IPv4 Socket Address Structure Byte Ordering Functions Address Access/Conversion Functions Functions: 1.socket()
Today’s topic: Basic TCP API –Socket –Bind –Listen –Connect –Accept –Read –Write –Close.
Elementary TCP Sockets Computer Networks Computer Networks Term B10 UNIX Network Programming Vol. 1, Second Ed. Stevens Chapter 4.
Networks: TCP/IP Socket Calls1 Elementary TCP Sockets Chapter 4 UNIX Network Programming Vol. 1, Second Ed. Stevens.
תקשורת באינטרנט Tutorial 8. 2 n Socket programming u What is socket ? u Sockets architecture u Types of Sockets u The Socket system calls u Data Transfer.
Sockets Programming Introduction © Dr. Ayman Abdel-Hamid, CS4254 Spring CS4254 Computer Network Architecture and Programming Dr. Ayman A. Abdel-Hamid.
LANMAR for IPv6 Jason Chen Teresa Breyer Yeng-Zhong Lee.
Tutorial 8 Socket Programming
#include DatatypeDescription int8_t uint8_t int16_t uint16_t int32_t uint32_t Signed 8-bit integer Unsigned 8-bit integer Signed 16-bit integer Unsigned.
Client Server Model The client machine (or the client process) makes the request for some resource or service, and the server machine (the server process)
1 Version Traffic Class Flow Label Payload Length Next Header Hop Limit Source Address Destination Address IPv6 Header.
1 IPv6 Refs: Chapter 10, Appendix A. 2 IPv6 availability Generally not part of O.S. Available in beta for many operating systems. 6-Bone is experimental.
TCP Socket Programming. r An abstract interface provided to the application programmer  File descriptor, allows apps to read/write to the network r Allows.
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.
TCP/IP Protocol Stack IP Device Drivers TCPUDP Application Sockets (Gate to network) TCP: –Establish connection –Maintain connection during the communication.
Network Programming Tutorial #9 CPSC 261. A socket is one end of a virtual communication channel Provides network connectivity to any other socket anywhere.
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.
Week 13 - Monday.  What did we talk about last time?  Low level file I/O practice  File systems.
Sirak Kaewjamnong Computer Network Systems
Technical Details for sockaddr_in Structure Department of Computer Science Southern Illinois University Edwardsville Fall, 2015 Dr. Hiroshi Fujinoki
CCNP Network Route IPV-6 Part-I IPV6 Addressing: IPV-4 is 32-BIT, IPV-6 is 128-BIT IPV-6 are divided into 8 groups. Each is 4 Hex characters. Each group.
Lab 5 Sockets. Useful Sockets Links (courtesy of Stanford University) Programming UNIX Sockets in C - Frequently Asked Questions
Networking Tutorial Special Interest Group for Software Engineering Luke Rajlich.
CPSC 441 TUTORIAL – FEB 13, 2012 TA: RUITNG ZHOU UDP REVIEW.
Introduction to Socket
Socket Programming Tutorial Department of Computer Science Southern Illinois University Edwardsville Fall, 2015 Dr. Hiroshi Fujinoki
Socket Programming Lab 1 1CS Computer Networks.
1 Sockets Programming Socket to me!. 2 Network Application Programming Interface (API) The services provided by the operating system that provide the.
Sockets Socket = abstraction of the port concept: –Application programs request that the operating system create a socket when one is needed –O.S. returns.
CSCI 330 UNIX and Network Programming Unit XV: Transmission Control Protocol.
S OCKET P ROGRAMMING IN C Professor: Dr. Shu-Ching Chen TA: HsinYu Ha.
Intro to Socket Programming CS 360. Page 2 CS 360, WSU Vancouver Two views: Server vs. Client Servers LISTEN for a connection and respond when one is.
Sockets Introduction Socket address structures Value-result arguments
Socket Programming(2/2) 1. Outline  1. Introduction to Network Programming  2. Network Architecture – Client/Server Model  3. TCP Socket Programming.
S OCKET P ROGRAMMING IN C Professor: Dr. Shu-Ching Chen TA: Hsin-Yu Ha.
2: Application Layer 1 Socket Programming UNIX Network Programming, Socket Programming Tutorial:
CSCI 330 UNIX and Network Programming Unit XIV: User Datagram Protocol.
1 Spring Semester 2008, Dept. of Computer Science, Technion Internet Networking recitation #7 Socket Programming.
CS 447 Networks and Data Communication Server-Process Organization IP address and SockAddr_In Data Structure Department of Computer Science Southern Illinois.
Lecture 15 Socket Programming CPE 401 / 601 Computer Network Systems slides are modified from Dave Hollinger.
Socket programming in C. Socket programming with TCP Client must contact server server process must first be running server must have created socket (door)
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.
CSE 333 – SECTION 8 Client-Side Network Programming.
Jim Fawcett CSE 681 – Software Modeling & Analysis Fall 2002
Socket Programming (Cont.)
CS 105 “Tour of the Black Holes of Computing”
Network Programming CSC- 341
Socket Programming in C
Network Programming with Sockets
Chapter 3 Sockets Introduction
תקשורת ומחשוב תרגול 3-5 סוקטים ב-C.
Network Programming CSC- 341
TCP Sockets Programming
Chapter 06. UDP Server/Client.
Server-side Programming CSE 333 Summer 2018
Chapter 3 Socket API © Bobby Hoggard, Department of Computer Science, East Carolina University These slides may not be used or duplicated without permission.
Refs: Chapter 10, Appendix A
Socket Programming(1/2)
Sockets Programming Socket to me!.
Sockets Programming Socket to me!.
Chapter 04. TCP Server/Client.
Internet Networking recitation #8
Presentation transcript:

IPv6 Intro & Demo Yuxin Ouyang Yuhui Feng

Why IPv6 Space allowed by IPv4 is saturating IPv4 is not secure by itself Data prioritization in IPv4 is not up to date Does not provide a mechanism to have a globally unique IP address

Features Larger address space Simplified Header End-to-end Connectivity and more…

IPv6 - Addressing Modes Unicast Multicast And…Anycast

IPv6 - Anycast When a host wishes to communicate with a host equipped with an Anycast IP address, it sends a Unicast message. With the help of complex routing mechanism, that Unicast message is delivered to the host closest to the Sender in terms of Routing cost.

IPv6 - Anycast

IPv6 Subnetting The second half of the address (least significant 64 bits) is always used for hosts only. Therefore, there is no compromise if we subnet the network. /48 prefix can be allocated to an organization providing it the benefit of ha-v ing up to /64 subnet prefixes 16 bits of subnet is equivalent to IPv4’s Class B Network. Using these sub- net bits, an organization can have another 65 thousands of subnets which i s by far, more than enough.

IPv6 Subnetting

IPv6 - Header Version (4-bits) Traffic Class (8-bits) Flow Label (20-bits) Payload Length (16-bits) Next Header (8-bits) Hop Limit (8-bits) Source Address (128-bits) Destination Address (128-bits)

IPv6 – Mobility (connected to home link)

IPv6 – Mobility (connected to foreign link)

include struct sockaddr_in6 { u_int16_tsin6_family; // address family, AF_INET6 u_int16_tsin6_port; // port number, Network Byte Order u_int32_tsin6_flowinfo; // IPv6 flow information struct in6_addrsin6_addr; // IPv6 address u_int32_t sin6_scope_id; // Scope ID }; struct in6_addr { unsigned chars6_addr[16];// load with inet_pton() }; IPv6 socket programming

// General socket address holding structure, big enough to hold either // struct sockaddr_in or struct sockaddr_in6 data: struct sockaddr_storage { sa_family_t ss_family; // address family char __ss_pad1[_SS_PAD1SIZE]; int64_t __ss_align; char __ss_pad2[_SS_PAD2SIZE]; }; IPv6 socket programming

IPv4IPv6 FamilyAF_INETAF_INET6 IP address Structuresockaddr_insockaddr_in6 Wildcard addressINADDR_ANYin6addr_any string->IP addressinet_aton( )inet_pton( ) IP address-> stringinet_ntoa( )inet_ntop( ) Get IP address by host name gethostbyname( )getaddrinfo( ) Get host name by IP address gethostbyaddr( )getnameinfo( )

IPv6 socket programming AF_xxx Versus PF_xxx The “AF_” prefix stands for “address family” and the "PF_" prefix stands for "protocol family.” Historically, the intent was that a single protocol family might support multipl e address families and that the PF_ value was used to create the socket an d the AF_ value was used in socket address structures. But in actuality, a protocol family supporting multiple address families has n ever been supported and the header defines the PF_ value for a given protocol to be equal to the AF_ value for that protocol. While the re is no guarantee that this equality between the two will always be true, sh ould anyone change this for existing protocols, lots of existing code would b reak. The PF_ value is mainly used in calls to socket.

int main(int argc, const char * argv[]) { unsigned int client_s; //Connection socket descriptor struct sockaddr_in6 server_addr; //Server Internet address char out_buf[BUFSIZE]; //Output buffer char in_buf[BUFSIZE]; //Input buffer const char *ip_num="::1"; const char *port_num="10501"; const char *file_name="1.jpg"; int port=atoi(port_num); server_addr.sin6_family =AF_INET6; server_addr.sin6_port =htons(port); inet_pton(AF_INET6, ip_num, &server_addr.sin6_addr); //Socket client_s=socket(AF_INET6,SOCK_STREAM,0); //Connection connect(client_s,(struct sockaddr *)&server_addr,sizeof(server_addr)); //Start file and find the size of it FILE *fp=fopen(file_name,"r"); //Send the file name to server bzero(out_buf,BUFSIZE); strncpy(out_buf,file_name,strlen(file_name)); send(client_s,out_buf,(strlen(out_buf)+1),0); //Start to transfer the file data long int send_length=0; bzero(out_buf,BUFSIZE); while ((send_length=fread(out_buf,sizeof(char),BUFSIZE,fp))>0){ if (send(client_s,out_buf,send_length,0)<0){ perror("File send failed."); exit(1); } bzero(out_buf,BUFSIZE); } fclose(fp); close(client_s); return 0; } Client TCP

int main(int argc, const char * argv[]) { unsigned int server_s; //Server socket descriptor and bind indicator struct sockaddr_in6 server_addr, client_addr; //Server and Client internet address unsigned int connect_s; //Connection socket descriptor unsigned int addr_len; //Internet address length char out_buf[BUFSIZE]; //Output buffer for data char in_buf[BUFSIZE]; //Input buffer for data char file_name[FILENAME_SIZE+1]; //File name for transferred onst char *port_num="10501"; long int port=atoi(port_num); server_addr.sin6_family =AF_INET6; server_addr.sin6_port =htons(port); server_addr.sin6_addr =in6addr_any; //Socket server_s=socket(AF_INET6,SOCK_STREAM,0); //Bind bind(server_s,(struct sockaddr *)&server_addr,sizeof(server_addr)); //Listen listen(server_s,SERVER_QUEUE); //Accept conncection addr_len=sizeof(client_addr); connect_s=accept(server_s,(struct sockaddr *)&client_addr,&addr_len); //Receive the file name from client bzero(in_buf,BUFSIZE); bzero(file_name,FILENAME_SIZE+1); recv(connect_s,in_buf,sizeof(in_buf),0); strncpy(file_name,in_buf,FILENAME_SIZE); //Create a file to write the data; FILE *fp=fopen(file_name,"w"); Server TCP

//Receive data from client to buffer and write them into the file long int recv_length; bzero(in_buf,BUFSIZE); while ((recv_length=recv(connect_s,in_buf,sizeof(in_buf),0))>0){ if(fwrite(in_buf,sizeof(char),recv_length,fp)<recv_length){ perror("File write filed.\n"); exit(1); } bzero(in_buf,BUFSIZE); } char str[40]; //IPv6 address in string inet_ntop(AF_INET6, &(client_addr.sin6_addr), str, 40); printf("File '%s' recieved successful!(From IP= '%s' port ='%d')\n", file_name, str, ntohs(client_addr.sin6_port)); fclose(fp); close(connect_s); close(server_s); return 0; }

Tutorialspoint Wikipedia IPv6 kaddr_inman.htmlhttp://beej.us/guide/bgnet/output/html/multipage/soc kaddr_inman.html Beej's Guide to Network Programming Reference