CS422: Computer Networks

Notes for Dec 8th – Dec 12th

By Melroy Saldanha

 

 

DNS (Domain Name System):

  • Humans prefer host names instead of IP addresses

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 hierarchy of servers that handle the domains of the name. Each domain of the name can correspond to a different name server.
  • Hostnames are divided in to domains
    • e.g. 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:
    • Subdivide the domain: dog.pets.com; cat.pets.com
    • arbitrary levels are allowed
    • these arbitrary levels are not standardized
    • these arbitrary levels are controlled by the local organization
  •  Name resolution is hierarchical: (DNS Server)

 

  • Domain servers correspond to naming hierarchy
  • Individual groups within an organization can choose their own hierarchy

 

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 hierarchy
  • All domain servers are 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 address from a host name will become a client.
  • There are 2 kinds of resolutions:
    • 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 hierarchy until a DNS server has an answer
    • 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:
    • Type:
      • any 
      • mx, mail exchange
  • Example of nslookup use
    • > /usr/bin/nslookup
    • > set querytype=A (any host)
    • > yahoo.com
      • Name: yahoo.com
      • Address: 216.115.108.245  216.115.108.243
    • set querytype=MX (mail exchange)
    • > yahoo.com
      • Name: yahoo.com
      • mail exchanger=mx2_mail.yahoo.com (might not be ‘2’)
    • > set querytype = CNAME (the DNS server)
    • > yahoo.com
      • ns0.corp.yahoo.com
  • DNS caching is important otherwise the internet would be flooded with DNS requests

 

The Evolution of Programming Network Applications

  • Sockets is the ‘hard way’ to do network programming
  • Sockets:
    • Equivalent to programming in assembly language
    • You have to take care of every single byte that goes through the network
    • With sockets your program uses the network channel as if it where writing to a file or pipe
  • RPC (Remote Procedure Calls)
    • A server exports procedures to the clients
    • The client server interaction if modeled as a procedure call
    • The programmer writes in a special language called IDL (interface definition language) the header definitions of the procedures that the server will export
    • This interface description is preprocessed by a special IDL pre-processor and generates code for the client and server that does the entire communication
    • The programmer doesn’t need to write any networking code.  To program the server it will add code to code already generated, to implement the procedures
    • The client will use the procedures in the server as if they where local

    • 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 Representation. 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 server and waits for the answer
      • When the answer comes back from the server, it translates 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
    • The Server Stubs:
      • Wait for an RPC invocation
      • It deserializes the arguments
      • It invokes the procedure indicated by the client
      • It serializes the results and sends the results back to the client
    • The programmer doesn’t need to know about sockets
  • Implementations of RPC - Sun RPC

 

Evolution of Programming Networked Apps

  • Networking Tools
    • Sockets
    • RPCs (Remote Procedure Calls)
    • RMI (Remote Method/Object Invocation)
  • Programming Language equivalents to Networking tools
    • Assembly Language like Network Sockets
    • Procedural Languages (e.g. C, Pascal) like RPC
    • Object Oriented Languages (e.g. JAVA, C++) 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

     

Summary 2nd half of semester

  • Protocols/layering
    • ISO-7 layer reference model
    • Internet Reference Model
  • Internet
    • What is the Internet?
    • Why the internet is necessary
    • Routers and Hosts
    • IP (Internet Protocol)
      • IP addresses (4 bytes in length)
        • 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
        • All fields *TTL, SRC, DST
      • IP Routing
      • IP routing table and default router
      • IP semantics
        • IP is connectionless
        • IP packets can be delayed, come out of order, or even be lost
        • Best Effort Delivery
    • ARP (Address Resolution Protocol)
      • Translates IP addresses to local hardware addresses
      • ARP look-up algorithm
      • ARP cache mechanics
  • IP fragmentation and reassembly
    • Why fragmentation is necessary
    • MTU – maximum transfer unit
    • How Fragmentation works
    • Fields used for reassembly (source IP, ID, offset, more fragment bit)
    • Reassembly timeout
  • ICMP (Internet Control Message Protocol)
    • ICMP types: Source quench, time exceeded, destination unreachable, echo reply (ping)
    • Uses (applications discussed): Traceroute, path MTU
  • Transport protocols (UDP, TCP)
    • Characteristics
    • Advantages/disadvantages of both
  • TCP
    • Characteristics:
      • Reliable
      • Connection oriented (app-2-app)
      • Full duplex
      • How the reliability is achieved
        • Retransmission
        • Acknowledge (positive ACK when packet received)
    • 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)
    • Translates host names to IP addresses
    • Domain Names
    • Domain Name Server hierarchy
    • DNS lookup (resolution)
      • Recursive
      • Iterative
    • DNS caching
    • DNS types
  • Evolution of Network Programming
    • Sockets
    • RPC
    • RMI
  • Final on Friday December 19th 3:20 pm in WTHR 200