12-8-2003 CS422

 

DNS – Domain Name System

-         humans prefer host names instead of IP addresses

o       www.yahoo.com à 204.71.200.68

-         DNS does this mapping

-         Pre DNS there was a file, /etc/hosts, with the host-to-IP mapping

-         This file was maintained manually.  It was ok to do it this way when internet was small, but impractical with 1000’s of computers.

-         DNS uses a hirearchy of servers that handle the domains of the name.  (Each domain of the name can correspond to a different name server.)

o       Hostnames are divided in to domains

o       EX: ector.cs.purdue.edu

§         edu      – domain 0

§         purdue – domain 1

§         cs        -- domain 2

§         ector    -- host name

-         One registers a desired name with a central authority and it is placed in a top level domain.

-         Within the “organization” (pets.com) you can:

o       Subdivide the domain

§         dog.pets.com

§         cat.pets.com

o       arbitrary levels are allowed

o       these arbitrary levels are not standardized

o       these arbitrary levels are controlled by the local organization

-         Name resolution is hirearchical: (DNS Server)

(edu)

/   |   \

                      *    *   (purdue)   * == some other universities for example

                                 /     |     \

                             (cc) (ecn) (cs)

                                            “/”

                                       “(xinu)”

-         Domain servers correspond to naming hirearchy

-         Individual groups witihn an organization can choose their own hirearchy

 

DNS Name Server Resolution (lookup)

-         DNS uses client/server paradigm

-         Client known as “resolver”

-         Multiple DNS servers maybe used during a resolution

-         Each DNS server corresponds to a contiguous part of the naming hirearchy

-         All domain servers ore linked together and they know the IP address of their neighbors.

-         DNS lookup can be done using either TCP or UDP

-         An application that needs to get a IP ddress from a host name will become a client (resolver).

-         There are 2 kinds of resolutions;

1. RECURSIVE

§         if the client chooses recursive resolution, the host asks the immediate DNS server to resolve the hostname.

§         If the immediate DNS server does not have an answer (can’t find the host on its list), this DNS server asks its parent

§         This goes ‘up’ the hirearchy until a DNS server has an answer

o       2. ITERATIVE

§         Green – Do You know who “UCB” is

§         Red    – No, but I know a DNS server that might

§         Blue   – Yes I know “UCB”

§         if the host asks the immediate DNS server and it cannot answer it will return the address of a DNS server that may know the answer, and so on.

-         To reduce DNS traffic, the name to IP address mappings are cached

-         The time they are cached depends on the entry and this info is stored in the DNS servers

 

Nslookup

-         A DNS client useful for debugging

-         A DNS query may return more than one IP address if the host has multiple interfaces

-         Also you specify the type of host in the DNS query:

o       Type:

§         any

§         mx, mail exchange

§         etc.

-         Example of nslookup use

o       > /usr/bin/nslookup

o       > set querytype=A (any host)

o       > yahoo.com

o             Name: yahoo.com

o             Address: 216.115.108.245  216.115.108.243

o       > set querytype=MX (mail exchange)

o       > yahoo.com

o            Name: yahoo.com

o            mail exchanger=mx2_mail.yahoo.com (might not be ‘2’)

o       > set querytype=CNAME (the DNS server)

o       > yahoo.com

o          ns0.corp.yahoo.com

-         DNS cacheing is important otherwise the internet would be flooded with DNS requests

 

12-10-2003 CS422

-         announcement, professor is to be 15+ min. late

 

The Evolution of Programming Network Applications

-         Sockets is the ‘hard way’ to do network programming

-         Sockets:

o       Equivalent to programming in assembly language

o       You have to take care of every single byte that goes through the network

o       With sockets your program uses the network channel as if it where writing to a file or pipe

-         RPC – remote procedure calls

o       A server exports procedures to the clients

o       The client server interaction if modeled as a procedure call

o       The programmer writes in a special language called IDL (interface definition language) the header definitions of the procedures that the server will export

o       This interface description is preprocessed by a special IDL pre-processor and generates code for the client and server that does the entire communication

o       The programmer doen’t need to write any networking code.  To program the server it will add code to code already generated, to implement the procedures

o       The client will use the prcedures in the server as if they where local

 

Interface in IDL

void addStudent(string name,

                            string major,

                            int      age);

int getStudent(string name,

                        string &major,

                        int      &age);

 

[Interface in IDL] à preprocessor à server stubs (in C, for example)

                                                             client stubs (in C, for example)

 

Client                                 Server

[client stubs]----------------[server stubs]

            |           (network)                     |                                            

            |                                   addStudent(string name,

            |                                                      string major,

            |                                                      int      age){

            |                                                           ……

            |                                                       }// implementation in server

addStudent(“jim”, “CS”, 21);// client programmer just invokes a procedure

 

o       The Client Stubs:

§         provide a function with the name of the Remote Procedure Call

§         they put the arguments into a network packet(s).  This is called serialization, or marshalling.  The format of the data in the network can be

·        XDR – External Data Representaion.  It was created by SUN to represent data in the network

·        XML – textual representation of data that may also include semantics

§         The client sends the data arguments to the serverand waits for the answer

§         When the answer comes back from the server, it transilates back the results from the network representation to the machine representation.  This process is called deserialization or unmarshalling

§         Then the results are returned to the caller

§         This process is transparent to the program

o       The Server Stubs:

§         Wait for an RPC invocation

§         It deserializes the arguments

§         It invikes the procedure indicated by the client

§         It serializes the results and sends the results back to the client

o       The programmer doesn’t need to lnow about sockets

-         Implementations of RPC:

o       Sun RPC

§         Used to implement NFS

§         mountd

§         rusers

 

   

12-12-03 CS422

 

Evolution of Programming Networked Apps

-         Networking Tools

o       Sockets

o       RPCs (Remote Procedure Calls)

o       RMI (Remote Method/Object Invocation)

-         Programming Langauge equivilents to Networking tools

o       Assembly Language – like Network Sockets

o       Procedural Languages (C, Pascal, etc) – like RPC

o       Object Oriented Languages (JAVA, C++, etc) – Like RMI

 

-         RMI (Remote Method/Object Invocation)

o       The client server interaction is modeled as a object method invocation.

o       The stub or proxy is a local representation of the remote object

o       The proxy forwards the call to the remote object

o       The client program interacts with the remote object as if it where local

o       The proxy code and the code in the server that exports the remote object is generated by a special preprocessor from the description on a interface description language

o       RMI Implementations

§         Name                Language              Generates

§         CORBA             IDL                       C++                                                              
(common Object Request Broker)

§         Java RMI           JAVA                    JAVA

§         DCOM               IDL                       C++, C#, VB                                             
(Microsoft Distributed Common Object)

-         Summary 2nd half of semester

o       Protocols/layering

§         ISO-7 layer reference model

§         Internet Reference Model

o       Internet

§         What is the Internet?

§         Why the internet is necessary

§         Routers and Hosts

§         IP (Internet Protocol)

·        IP addresses (4 bytes in length)

o       Network/Host portions of the address

·        Classes of IP addresses (A, B, C, D, E)

·        Dotted decimal notation

·        Special addresses (all 0’s, all 1’s, loopback, etc.)

·        IP packet format

o       All fields *TTL, SRC, DST

·        IP Routing

·        IP routing table and default router

·        IP semantics

o       IP is connectionless

o       IP packets can be delayed, come out of order, or even be lost

o       Best Effort Delivery

o       ARP (Address Resolution Protocol)

§         Transilates IP addresses to local hardware addresses

§         ARP look-up algorithm

§         ARP cache machanics

-         IP fragmentation and reassembly

o       Why fragmentation is necessary

o       MTU – maximum transfer unit

o       How Fragmentation works

o       Fields used for reassembly (source IP, ID, offset, more fragment bit)

o       Reassembly timeout

-         ICMP (Internet Control Message Protocol)

o       ICMP types:

§         Soirce quench, time exceeded, destination unreachable, echo reply (ping)

o       Uses (applications discussed):

§         Traceroute, path MTU discovery

-         Transport protocols (UDP, TCP)

o       Characteristics

o       Advantages/disadvantages of both

-         TCP

o       Characteristics:

§         Reliable

§         Connection oriented (app-2-app)

§         Full duplex

§         How the reliability is achieved

·        Retransmission

·        ACKnowledge (positive ACK when packet received)

o       Features:*

§         Adaptive retransmission

§         Flow control (window size)

·        Slow down the sender if buffer space is not available)

§         Cumulative ACK

§         Congestion Control

·        Slow Start

§         Reliable connection start/shut-down

·        3-way handshake

§         TCP header fields *

-         DNS (domain name service)

o       Transilates host names to IP addresses

o       Domain Names

o       Domain Name Server hirearchy

o       DNS lookup (resolution)

§         Recursive

§         Iterative

o       DNS caching

o       DNS types

-         Evelution of Netwrok Programming

o       Sockets

o       RPC

o       RMI

 

-         Final Exam Fri. Dec. 19 3:20pm in WTHR200

o       Cumulative

o       1st half of semester 20%

o       2nd half of semester 80%

o       No specific programming projects,

§         Concepts, “Why do you use JitterBuffer?”, “What are notifications for?”

§         Also study some socket programming (maybe?)