CSE 124 January 12, Winter 2016, UCSD Prof. George Porter

Similar documents
CSE 124 January 18, Winter 2017, UCSD Prof. George Porter

CSE 124 January 27, Winter 2017, UCSD Prof. George Porter

DNS and Modern Network Services. Amin Vahdat CSE 123b April 27, 2006

Server-side Programming

Server-side Programming

IP ADDRESSES, NAMING, AND DNS

CSE 124 Discussion Section Sockets Programming 10/10/17

Communications Software. CSE 123b. CSE 123b. Spring Lecture 11: Domain Name System (DNS) Stefan Savage. Some pictures courtesy David Wetherall

CSE 123b Communications Software. Overview for today. Names and Addresses. Goals for a naming system. Internet Hostnames

UNIX Sockets. Developed for the Azera Group By: Joseph D. Fournier B.Sc.E.E., M.Sc.E.E.

ECE 650 Systems Programming & Engineering. Spring 2018

CSE 333 Lecture server sockets

Socket Programming. #In the name of Allah. Computer Engineering Department Sharif University of Technology CE443- Computer Networks

CSE 333 SECTION 8. Sockets, Network Programming

Sockets 15H2. Inshik Song

CSE 124: IP ADDRESSES, NAMING, AND DNS. George Porter Oct 4, 2017

UNIX Sockets. COS 461 Precept 1

Domain Name System.

CSE 333 Lecture server sockets

Development of the Domain Name System

CLIENT-SIDE PROGRAMMING

Lecture 2. Outline. Layering and Protocols. Network Architecture. Layering and Protocols. Layering and Protocols. Chapter 1 - Foundation

Review. Preview. Closing a TCP Connection. Closing a TCP Connection. Port Numbers 11/27/2017. Packet Exchange for TCP Connection

DNS. DNS is an example of a large scale client-server application.

Systems software design NETWORK COMMUNICATIONS & RPC SYSTEMS

0 0& Basic Background. Now let s get into how things really work!

CSMC 412. Computer Networks Prof. Ashok K Agrawala Ashok Agrawala Set 2. September 15 CMSC417 Set 2 1

Networked Applications: Sockets. Goals of Todayʼs Lecture. End System: Computer on the ʻNet. Client-server paradigm End systems Clients and servers

sottotitolo Socket Programming Milano, XX mese 20XX A.A. 2016/17 Federico Reghenzani

UNIX System Programming Lecture 19: IP Sockets

Processes communicating. Network Communication. Sockets. Addressing processes 4/15/2013

ECE 435 Network Engineering Lecture 2

CSE 333 SECTION 6. Networking and sockets

STUDY OF SOCKET PROGRAMMING

Protocol Classification

Computer Networks Prof. Ashok K. Agrawala

Network Communication

CS155b: E-Commerce. Lecture 3: Jan 16, How Does the Internet Work? Acknowledgements: S. Bradner and R. Wang

S Computer Networks - Spring What and why? Structure of DNS Management of Domain Names Name Service in Practice

Networked Applications: Sockets. End System: Computer on the Net

The Application Layer: Sockets, DNS

EECS 122: Introduction to Computer Networks DNS and WWW. Internet Names & Addresses

Socket Programming TCP UDP

A Socket Example. Haris Andrianakis & Angelos Stavrou George Mason University

Overview General network terminology. Chapter 9.1: DNS

Client Server Concepts, DNS, DHCP

CSE 333 Section 8 - Client-Side Networking

A DNS Tutorial

ECE 435 Network Engineering Lecture 2

CSE 333 Section 3. Thursday 12 April Thursday, April 12, 12

CSE 333 SECTION 7. Client-Side Network Programming

CSE 333 SECTION 7. C++ Virtual Functions and Client-Side Network Programming

Tutorial on Socket Programming

DNS & Iodine. Christian Grothoff.

CSC209H Lecture 9. Dan Zingaro. March 11, 2015

Computer Network Programming

Socket Programming for TCP and UDP

EEC-484/584 Computer Networks

UNIT IV- SOCKETS Part A

CSE 333 Lecture network programming intro

Client-side Networking

Lecture 4: Basic Internet Operations

CS321: Computer Networks Introduction to Application Layer

Introduction to Computer Networks

DNS Basics BUPT/QMUL

Networking Applications

CS321: Computer Networks Socket Programming

CSE561 Naming and DNS. David Wetherall

UDP. Networked Systems (H) Lecture 15

Ports under 1024 are often considered special, and usually require special OS privileges to use.

Introduction to Socket Programming

CSCE 463/612 Networks and Distributed Processing Spring 2018

Dependent Types in the Idris Programming Language

Hybrid of client-server and P2P. Pure P2P Architecture. App-layer Protocols. Communicating Processes. Transport Service Requirements

Distributed Systems. Distributed Systems Within the Internet Nov. 9, 2011

Networking: Application Layer

CSE 333 Lecture 16 - network programming intro

CS 43: Computer Networks. 05: Socket Programming September 12-14, 2018

CS519: Computer Networks. Lecture 6: Apr 5, 2004 Naming and DNS

CS 3640: Introduction to Networks and Their Applications

Naming Computer Networking. Overview. DNS: Domain Name System. Obvious Solutions (1) Obvious Solutions (2)

Socket Programming. Sungkyunkwan University. Hyunseung Choo Copyright Networking Laboratory

Lecture 3: The Domain Name System and Sockets

What s an API? Do we need standardization?

DOWNLOAD OR READ : TCP IP SOCKETS IN C PRACTICAL GUIDE FOR PROGRAMMERS TCP IP SOCKETS IN C BUNDLE PDF EBOOK EPUB MOBI

Client Server Concepts, DNS, Telnet, FTP

Internet applications

CSE 333 Lecture server sockets

Elementary TCP Sockets

DNS Review Quiz. Match the term to the description: A. Transfer of authority for/to a subdomain. Domain name DNS zone Delegation C B A

IP Addresses, DNS. CSE 333 Spring Instructor: Justin Hsia

Group-A Assignment No. 6

Name Services and DNS

Midterm Results Computer Networking. Outline. Midterm Distribution. Average Std.Dev. 13.9!!! Max 97 Min 40.

DNS and HTTP. A High-Level Overview of how the Internet works

Advanced Networking. Domain Name System

Advanced Networking. Domain Name System. Purpose of DNS servers. Purpose of DNS servers. Purpose of DNS servers

ECE 435 Network Engineering Lecture 7

Configuring DNS. Finding Feature Information

Manual Configuration Stateful Address Configuration (i.e. from servers) Stateless Autoconfiguration : IPv6

Transcription:

CSE 124 January 12, 2016 Winter 2016, UCSD Prof. George Porter

Announcements HW 2 due on Thursday Project 1 has been posted Today s plan: Finish discussing server sockets DNS: the Domain Name System API to using DNS Thursday s plan: Framing/encoding In-class exercise (Bring a laptop if you ve got one)

Part 1: Server sockets review

Recall: Server overview Steps 1. Handle command line arguments 2. Create network socket 3. Bind socket to an interface 4. Tell the socket to listen for incoming connec9ons 5. Accept an incoming connec9on: Read/write to the socket 6. Close the socket Socket API used 1. n/a 2. socket() 3. bind() 4. listen() 5. accept() 6. send/recv() 7. close()

Step 3: bind We need to tell the socket what IP address and port to listen for incoming connecyons int bind(int sockfd, const struct sockaddr *addr, socklen_t len); We don t care which IP address to bind to servaddr.sin_addr.s_addr = htonl(inaddr_any); We do care about the listening port servaddr.sin_port = htons(servport);

Step 4: listen Tells the OS that this socket is going to be a server socket E.g., that it should listen for incoming commands int listen(int sockfd, int backlog); backlog specifies how many pending connecyons can exist before addiyonal ones are refused

Step 5: AccepYng new connecyons A listening socket isn t actually used to send/ receive data Otherwise e.g., a web server could only handle one client at a Yme Because port 80 (www) would be used up by a single client Instead, listening socket used to accept a new connecyon, which spawns a new per-connec(on client socket

Server socket vs. Client socket

recv() call

Server sockets: Q & A

Part 2: Domain Name System

Overview www.cs.ucsd.edu à 132.239.8.67 1982: single hosts.txt file stored and distributed from a central site Contained all hostname to IP address mappings Centralized control did not fit with distributed management Number of hosts changed from number of timesharing systems to number of workstations Organizations to users Exponential resource usage for distributing the file

Domain Name System Hierarchical namespace with typed data Control delegated in hierarchical fashion Convince node above you to delegate control Designed to be extensible w/support for new data types 1985: some hosts solely utilize DNS

Hierarchical Design root org mil edu com uk ca gwu ncsu ucsd unc mit ece cs blink hobo www ctrl

Domain Name System (DNS) Translate human understandable names to machine understandable names E.g., www.cs.ucsd.eduè132.239.8.67 Hierarchical structure Every DNS server knows where the root is The root can tell you how to get to.edu.edu server can tell you how to find ucsd.edu ucsd.edu tells you about cs.ucsd.edu cs.ucsd.edu translates www.cs.ucsd.eduà132.239.8.67 Caching along the way to improve performance

Root name servers

Query Processing Query local name server Authoritative/cached answers Support both recursive and iterative queries If not cached locally, locate server lowest in the hierarchy with entry in local DB In the worst case, contact root (.) Cache locally with TTL

Zones and Caching Mechanisms for data distribution Zones Provide local autonomy Any contiguous set of nodes in the tree Can be grown to arbitrary size Each domain should provide redundant servers Caching Time to live (TTL) associated with each name low value => higher consistency high value => better performance (less traffic)

DNS Lookup Example client www.cs.ucsd.edu local DNS proxy cs.ucsd.edu ucsd=ipaddr cs=ipaddr edu DNS server ucsd DNS server cs DNS server

Part 3: an API to DNS

Mapping names to addresses

Linked list of addrinfo structs Q: Why a linked list? Q: Which of the mulyple results should you use?

Hints Can provide hints as to what you re looking for: Server socket (hints.ai_flags = AI_PASSIVE) Client socket (otherwise) IPv4 vs. IPv6 TCP vs. UDP

Demo: Chapter 3