Advanced UNIX programming Fall 2002 Instructor: Ashok Srinivasan Lecture 25 Acknowledgements: The syllabus and power point presentations are modified versions.

Slides:



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

Topics: –DNS system –Gathering machine information How to find out the machines ip address, name, OS, version, etc.
Sergei Komarov. DNS  Mechanism for IP hostname resolution  Globally distributed database  Hierarchical structure  Comprised of three components.
Sockets: Network IPC Internet Socket UNIX Domain Socket.
I/O Models Satish Krishnan. I/O Models Blocking I/O Non-blocking I/O I/O Multiplexing Signal driven I/O Asynchronous I/O.
Today’s topic: Basic TCP API –Socket –Bind –Listen –Connect –Accept –Read –Write –Close.
Sockets Programming CS144 Review Session 1 April 4, 2008 Ben Nham.
Lecture 10 Doman Name System CPE 401 / 601 Computer Network Systems slides are modified from Dave Hollinger and Kurose & Ross.
Name and Address Conversions© Dr. Ayman Abdel-Hamid, CS4254 Spring CS4254 Computer Network Architecture and Programming Dr. Ayman A. Abdel-Hamid.
CMPE 150 – Winter 2009 Lecture 18 March 10, 2009 P.E. Mantey.
Client Design. Issues Server Identification Setting up a socket on client side TCP –Reading and writing with a socket –Closing a socket UDP –Reading and.
20101 The Application Layer Domain Name System Chapter 7.
CS 311 – Lecture 19 Outline Internet Sockets – gethostname utility – struct hostent – inet_addr – Machine byte to Network byte order translation and vice.
Domain Name System (DNS) Network Information Center (NIC) : HOSTS.TXT.
SOCKETS Lecture #3. The Socket Interface Funded by ARPA (Advanced Research Projects Agency) in Developed at UC Berkeley Objective: to transport.
Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 Domain Name System (DNS) Shivkumar Kalyanaraman Rensselaer Polytechnic Institute
CPSC 441: DNS1 Instructor: Anirban Mahanti Office: ICT Class Location: ICT 121 Lectures: MWF 12:00 – 12:50 Notes derived.
Chabot College ELEC Name Resolution.
CS640: Computer Networks Aditya Akella Lecture 17 Naming and the DNS.
Babak Esfandiari (based on slides by Qusay Mahmoud)
TCP/IP Protocol Stack IP Device Drivers TCPUDP Application Sockets (Gate to network) TCP: –Establish connection –Maintain connection during the communication.
Netprog: DNS and name lookups1 Address Conversion Functions and The Domain Name System Refs: Chapter 9 RFC 1034 RFC 1035.
TELE 301 Lecture 11: DNS 1 Overview Last Lecture –Scheduled tasks and log management This Lecture –DNS Next Lecture –Address assignment (DHCP)
Lecture on DHCP, DNS & SNMPDebashis Saha Thursday, May 17, DHCP, DNS, SNMP Debashis Saha MIS Group, IIM Calcutta
Computer Networks Mozafar Bag-Mohammadi Lecture 5 Naming and the DNS.
Socket Programming. Introduction Sockets are a protocol independent method of creating a connection between processes. Sockets can be either – Connection.
Elementary Name and Address Conversions
Distributed Systems Within the Internet Nov. 9, 2011 Topics Domain Name System Finding IP address Content Delivery Networks Caching content within the.
Chapter 17 Domain Name System
1 Computer Communication & Networks Lecture 26 Application Layer: Domain Name System Waleed Ejaz.
Chapter 29 Domain Name System (DNS) Allows users to reference computer names via symbolic names translates symbolic host names into associated IP addresses.
CSTP FS01CS423 (cotter)1 Protocols 2 References: RFC’s 791, 793, 768, 826.
1 CMPT 471 Networking II Transport Layer Network Programming © Janice Regan, 2013.
Deploying a Web Application Presented By: Muhammad Naveed Date:
CSS432: Applications 1 CSS432 Domain Name System Textbook Instructor: Joe McCarthy (based on Prof. Fukuda’s slides)
Netprog: DNS and name lookups1 Address Conversion Functions and The Domain Name System Refs: Chapter 9 RFC 1034 RFC 1035.
The Application Layer Application Services (Telnet, FTP, , WWW) Reliable Stream Transport (TCP) Connectionless Packet Delivery Service (IP) Unreliable.
1 Kyung Hee University Chapter 18 Domain Name System.
Domain Name System Refs: Chapter 9 RFC 1034 RFC 1035.
Configuring Name Resolution and Additional Services Lesson 12.
Elementary Name and Address Conversions
Name and Address Conversions Chap 11. Domain Name System  A lookup mechanism for translating objects into other objects  A globally distributed, loosely.
TELE202 Lecture 15 Socket programming 1 Lecturer Dr Z. Huang Overview ¥Last Lecture »TCP/UDP (2) »Source: chapter 17 ¥This Lecture »Socket programming.
TELE 402 Lecture 6: Name and address conversions 1 Overview Last Lecture –Socket Options and elementary UDP sockets This Lecture –Name and address conversions.
Sockets Socket = abstraction of the port concept: –Application programs request that the operating system create a socket when one is needed –O.S. returns.
DNS DNS overview DNS operation DNS zones. DNS Overview Name to IP address lookup service based on Domain Names Some DNS servers hold name and address.
2: Application Layer1 Chapter 2: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail  SMTP,
Advanced UNIX programming Fall 2002, lecture 16 Instructor: Ashok Srinivasan Acknowledgements: The syllabus and power point presentations are modified.
Linux Operations and Administration
Socket address structures Byte ordering IP address conversion
1 Network Programming. 2 Background Important guidelines –Use conductor.tamucc.edu or any LINUX machine to develop your network applications –Do not use.
Domain Name System (DNS) Joe Abley AfNOG Workshop, AIS 2014, Djibouti Session-1: Fundamentals.
Advanced UNIX programming Fall 2002 Instructor: Ashok Srinivasan Lecture 28 Acknowledgements: The syllabus and power point presentations are modified versions.
Advanced UNIX programming Fall 2002 Instructor: Ashok Srinivasan Lecture 17 Acknowledgements: The syllabus and power point presentations are modified versions.
Chapter 11 Advanced Name and Address Conversion. Introduction gethostbyname, gethostbyaddr: protocol dependent getaddrinfo: –a function providing protocol.
Internet Naming Service: DNS* Chapter 5. The Name Space The name space is the structure of the DNS database –An inverted tree with the root node at the.
4343 X2 – The Application Layer Tanenbaum Chapter 7.
Domain Name System DPNM Lab. Seongho Cho
Domain Name System (DNS)
Networking Applications
Name and Address Conversions
Chapter 9: Domain Name Servers
Name/Address conversion:
CpSc 360: Distributed and Network Programming
Net 323 D: Networks Protocols
Name and Address Conversions Part I
Advanced UNIX programming
Today’s topic: Basic TCP API
Advanced UNIX programming
Advanced UNIX programming
Presentation transcript:

Advanced UNIX programming Fall 2002 Instructor: Ashok Srinivasan Lecture 25 Acknowledgements: The syllabus and power point presentations are modified versions of those by T. Baker and X. Yuan

Announcements Reading assignment –Chapter 9 Sections 9.1 to 9.9 –Midterm Monday –Clarifications on project and HW3 –Midterm review

Week 9 Topics Socket options –getsockopt, setsockopt –fcntl –ioctl Introduction to UDP –TCP vs UDP –UDP interface

Week 9 Topics... continued Name and address conversionsName and address conversions –Domain name system –gethostbyname –gethostbyaddr –uname –gethostname –getservbyname –getservbyport

Names are easier to use –Names add a layer of indirection Numeric addresses can be changed without modifying the name A program can be more portable by using a name –The mapping between hostnames and IP addresses is done by the domain name system (DNS) Name and address conversions

Mapping between names and addresses xi.cs.fsu.edu References –See dns.html for information on dns.html DNS organization Why they should be the sole authority! Domain name system

Hierarchical naming scheme –Name space partitioned into subdomains –Top level of domains.com,.edu,.gov,.org,.us,.ca,.in, etc –Each domain can have subdomains Distributed delegation of naming authority –Each domain has the authority to allow names within that domain –Naming follows organization boundary not physical network boundary Domain name system... continued

Each server keeps resource records (RRs) –Information IP address, record type, name, etc Some relevant RR types –A : Maps a hostname to an IPv4 address –AAAA: Maps a hostname to an IPv6 address –PTR: Pointer records, map IP addresses to hostnames –MX: Mail exchanger for a host –CNAME: Canonical name Used to assign CNAME records for common services Resource records

Name server –When a name server receives a DNS request, if the server is the authority for the name, it finds the resource record and replies –Otherwise it recursively asks the next level Example: gethostbyname(“ xi.cs.fsu.edu ---> cs.fsu.edu --> edu --> yale.edu -->cs.yale.edu -->yale.edu-->edu -->cs.fsu.edu-->xi.cs.fsu.edu –Optimizations Replication and caching Name servers

#include struct hostent *gethostbyname(const char *hostname) struct hostent { char *h_name; char **h_aliases; int h_addrtype; int h_length; char **h_addr_list; }; This function queries A or AAAA records gethostbyname

#include struct hostent *gethostbyaddr(const char *addr, size_t len, int family) –addr is a pointer to an in_addr structure –len = 4 for IPv4 and 16 for IPv6 –This function queries PTR records See example1.c and example2.c –These two system calls incur significant communication overhead You can observe this in example1a.c gethostbyaddr

Information on name, os, and hardware #include int uname (struct utsname *name) struct utsname { char sysname[_UTS_NAMESIZE]; char nodename[_UTS_NODESIZE]; char release[_UTS_NAMESIZE]; char version[_UTS_NAMESIZE]; char machine[_UTS_NAMESIZE]; } –See example2.c –gethostbyname can be used to get host name uname and gethostbyname

Get service information –Not querying the DNS, but a system specific file, for example /etc/services #include struct servent *getservbyname(const char *servname, const char *protoname); struct servent *getservbyport(int port, const char*protoname); struct servent { char *s_name; char** s_aliases; int s_port; char *s_proto; } See example3.c and example4.c getservbyname and getservbyport