name and address conversions n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Name and Address Conversions PowerPoint Presentation
Download Presentation
Name and Address Conversions

Loading in 2 Seconds...

play fullscreen
1 / 22

Name and Address Conversions - PowerPoint PPT Presentation


  • 252 Views
  • Uploaded on

Name and Address Conversions. Chap 11. Domain Name System. A lookup mechanism for translating objects into other objects A globally distributed, loosely coherent, scalable, reliable, dynamic database Comprised of three components Name space Servers making that name space available

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Name and Address Conversions' - tyler


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
domain name system
Domain Name System
  • A lookup mechanism for translating objects into other objects
  • A globally distributed, loosely coherent, scalable, reliable, dynamic database
  • Comprised of three components
    • Name space
    • Servers making that name space available
    • Resolvers (clients) which query the servers about the name space
domain name space
Domain Name Space
  • DNS's distributed database is indexed by domain names.
  • Each domain name is essentially just a path in a large inverted tree, called the domain name space.
name server architecture

Name Server Process

Zone

data

file

Authoritative Data

(primary master and

slave zones)

Master

server

Cache Data

(responses from

other name servers)

Agent

(looks up queries

on behalf of resolvers)

Name Server Architecture

From

disk

Zone transfer

authoritative data

Name Server Process

Authoritative Data

(primary master and

slave zones)

Cache Data

(responses from

other name servers)

Agent

(looks up queries

on behalf of resolvers)

Resolver

Authoritative Data

Response

Query

using other name servers

Name Server Process

Authoritative Data

(primary master and

slave zones)

Cache Data

(responses from

other name servers)

Arbitrary

name

server

Agent

(looks up queries

on behalf of resolvers)

Resolver

Using Other Name Servers

Response

Response

Query

Query

cached data

Name Server Process

Authoritative Data

(primary master and

slave zones)

Cache Data

(responses from

other name servers)

Agent

(looks up queries

on behalf of resolvers)

Resolver

Cached Data

Response

Query

name resolution

Header

Question

: the question for the name server

Answer

: RRs answering the question

Authority

: RRs pointing toward an authority

Additional

: RRs holding additional information

Name Resolution
  • A DNS query has three parameters:
    • A domain name (e.g., ice.hufs.ac.kr),
      • Remember, every node has a domain name!
    • A class (e.g., IN), and
    • A type (e.g., A)
  • DNS message format
resource records
주요 RRs

SOA Record (Start Of Authority): 해당 도메인에 대해 네임서버가 인증(authoritative)된 자료를 갖고 있음을 의미

NS(Name Server) Record: 해당 도메인에 대한 delegation하는 네임서버를 지시

A Record: 도메인에 IPv4 주소를 mapping

AAAA Record: 도메인에 IPv6 주소를 mapping

CNAME Record: 도메인에 대한 또 다른 이름 설정

MX(Mail eXchanger) Record: 해당 호스트의 메일 라우팅 경로를 조정

PTR(Pointer) Record: IP 주소를 domain name으로 reverse mapping해 주며, Reverse Zone 파일에서 사용

Resource Records
name and address conversion functions
Name and Address Conversion Functions
  • Domain name  IPv4 address
  • IPv4 address  domain name
  • gethostbyname/gethostbyaddr are not reentrant !!
  • static struct hostent host; /* result stored here */
  • struct hostent *
  • gethostbyname(const char *hostname)
  • {
  • /* call DNS functions for A or AAAA query */
  • /* fill in host structure */
  • return(&host);
  • }
service name conversion functions
Service Name Conversion Functions
  • Service name  port ( See /etc/services )
  • Port  service name
example name daytimetcpcli1 c
Example: name/daytimetcpcli1.c

Network-related information

new name address conversion function 1
hostname: hostname or address string

service: service name or decimal port number string

result: addrinfo data structure is dynamically allocated

Re-entrant, thread-safe, and protocol independent functions (support IPv4, IPv6)

New Name/Address Conversion Function (1)
new name address conversion function 2
New Name/Address Conversion Function (2)
  • hints: NULL or pointer to addrinfo data structure
    • The following member can be set by caller
      • ai_flag /* AI_PASSIVE for server, AI_CANNONNAME */
      • ai_family /* AF_xxx */
      • ai_socktype /* SOCK_xxx */
      • ai_protocol /* 0 or IPPROTO_xxx for IPv4 and IPv6 */
    • Example
unp library functions
UNP Library Functions

#include “unp.h”

struct addrinfo *host_serv(const char *hostname, const char *service, int family, int socktype);

Returns: pointer to addrinfo structure if OK, NULL on error

int tcp_connect(const char *hostname, const char *service);

int tcp_listen(const char *hostname, const char *service, socklen_t *lenptr);

Both returns: connected socket descriptor if OK, no return on error

int udp_client(const char *hostname, const char *service, void **saptr, socklen_t *lenp);

Returns: unconnected socket descriptor if OK, no return on error

saptr: address of a pointer to a socket address structure that stores destination IP addr/port # for future calls to sendto

int udp_connect(const char *hostname, const char *service);

Returns: connected socket descriptor if OK, no return on error

int udp_server(const char *hostname, const char *service, socklen_t *lenptr);

Rerurns: unconnected socket descriptor if OK, no return on error

protocol indep daytime tcp client server
Protocol-indep Daytime TCP Client/Server

names/daytimetcpcli.c

names/daytimetcpsrv1.c

protocol indep daytime udp client server
Protocol-indep Daytime UDP Client/Server

names/daytimeudpcli1.c

names/daytimeudpsrv2.c