65890396 internet programming tools

Upload: udhayakurinji

Post on 04-Apr-2018

222 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/30/2019 65890396 Internet Programming Tools

    1/21

    Internet Programming ToolsWhat Is the Internet?

    A network of networks, joining many government, university and private computers

    together and providing an infrastructure for the use of E-mail, bulletin boards, file archives,

    hypertext documents, databases and other computational resources

    The vast collection of computer networks which form and act as a single huge network for

    transport of data and messages across distances which can be anywhere from the sameoffice to anywhere in the world.

    What is the Internet?

    1. The largest network of networks in the world.

    2. Uses TCP/IP protocols and packet switching .

    3. Runs on any communications substrate.

    Brief History of the Internet

    1968 - DARPA (Defense Advanced Research Projects Agency) contracts with BBN (Bolt,

    Beranek & Newman) to create ARPAnet. The funds were provided by the Department of

    Defense(DoD) in 1969.

    1970 - First five nodes:

    a. UCLA

    b. Stanfordc. UC Santa Barbara

    d. U of Utah, and

    e. BBN

    1974 - TCP specification by Vint Cerf

    1984 On January 1, the Internet with its 1000 hosts converts en masse to using TCP/IP

    for its messaging

    Internet Growth Trends

    i. 1977: 111 hosts on Internet

    ii. 1981: 213 hosts

    iii. 1983: 562 hosts

    iv. 1984: 1,000 hostsv. 1986: 5,000 hosts

    vi. 1987: 10,000 hosts

    vii. 1989: 100,000 hostsviii. 1992: 1,000,000 hosts

    ix. 2001: 150 175 million hosts

    x. 2002: over 200 million hostsxi. By 2010, about 80% of the planet will be on the Internet

  • 7/30/2019 65890396 Internet Programming Tools

    2/21

    Internet Addressing

    i. Addresses provide information on how to locate something, e.g., what route to take fromhere to there.

    ii. Internet addresses combine

    a. a routing portion, known as the network partb. a name portion known as the host part

    iii. How to split an Internet address into the network part and the host part has changed over

    timeiv. Back when the TCP/IP protocols were first being designed, there was a big argument

    between fixed length and variable length addresses

    a. Fixed length will always be limited

    i. But if you make it big enough, no one will noticeb. Variable length will always take more cycles to process

    i. But there are tricks you can play to minimize the difference

    v. The decision was made for fixed, 32 bit addresses

    IP Address

    a. An IP address is a 32-bit sequence of 1s and 0s.b. To make the IP address easier to use, the address is usually written as four decimal

    numbers separated by periods.

    c. This way of writing the address is called the dotted decimal format.

    d.

    e.

    Every IP address has two parts:

    Network

    IP addresses are divided intoclasses A,B and C to definelarge, medium, and smallnetworks.

    Host

    The Class D address class

    was created to enable

    multicasting.

    IETFreserves Class E

    addresses for its own

    research.

  • 7/30/2019 65890396 Internet Programming Tools

    3/21

    Reserved IP Addresses

    a. Certain host addresses are reserved and cannot be assigned to devices on a network.b. An IP address that has binary 0s in all host bit positions is reserved for the network

    address.

    c. An IP address that has binary 1s in all host bit positions is reserved for the broadcast

    address.

    Obtaining an Internet Network Address

    a. IP network addresses must be unique, or the Internet will not be stable

    b. The Internet Network Information Centre (InterNIC) was originally responsible for

    issuing Internet network addressesc. Today, the Internet Assigned Number Authority (IANA) issues network addresses to

    Information Service Providers (ISPs)

    d. ISPs split networks up into subnets and sell them on to their customers

    Text Internet Addressing

    i. In text Internet addresses, the text strings are referred to as Domainsii. Every internet mail address has two parts, they are separated by @ sign.

    a. Username

    b. Name of the Internet Provider

  • 7/30/2019 65890396 Internet Programming Tools

    4/21

    iii. The domain for the providers ends with the zone. Some of the Zones are

    iv.

    v. jstewar [email protected]&l.com.uk

    a. Th

    etop

    level domain shows which country the computer is located in,b. The second level domain indicates the type of organization.

    c. Between Second and user name there might be several intermediate domains that

    locate an organization.

    OSI Model

    OSI Layers

    .com Commercial Organization

    .edu Educational Institutions

    .net Networking Organizations

    .gov US Government Sites

    .mil Military sites

    .org Other Organizations

  • 7/30/2019 65890396 Internet Programming Tools

    5/21

    Physical layers - The physical layer is responsible for the movement of individual bits from onehop (node) to the next.

  • 7/30/2019 65890396 Internet Programming Tools

    6/21

    Data Link layer - The data link layer is responsible for moving frames from one hop (node) tothe next.

  • 7/30/2019 65890396 Internet Programming Tools

    7/21

    HOP TO HOP DELIVERY

    Network Layer - The network layer is responsible for the delivery of individual packets fromthe source host to the destination host

    Source to Destination Delivery

  • 7/30/2019 65890396 Internet Programming Tools

    8/21

    Transport layer - The transport layer is responsible for the delivery of a message from oneprocess to another.

    Reliable process-to-process delivery of a message

    Session Layer

    Presentation Layer

  • 7/30/2019 65890396 Internet Programming Tools

    9/21

    Application Layer

    Summary of Layers

    TCP/IP Protocol Suite

    The TCP/IP protocol suite is made of five layers: physical, data link, network, transport, andapplication. The first four layers provide physical standards, network interface,

    internetworking, and transport functions that correspond to the first four layers of the OSI

  • 7/30/2019 65890396 Internet Programming Tools

    10/21

    model. The three topmost layers in the OSI model, however, are represented in TCP/IP by

    a single layer called the application layer.

    Addressing

    Three different levels of addresses are used in an internet using the TCP/IP protocols: physical

    (link) address, logical (IP) address, and

    port address.

    Addresses in TCP?IP Relationship of Layers

  • 7/30/2019 65890396 Internet Programming Tools

    11/21

    DNS Overview

    What is DNS? Distributed Directory Service

    Maps names to values resource records

    Highly resilient to attack* Major backbone of the internet

    Makes networks human friendly

    Defined (primarily) in RFC1034 and 1035

    *if implemented properly

    DNS vs File System

    What is a domain?

    A domain is a sub tree of a larger tree identified by a domain name

    Contains resource records and sub-domains Some resource records point to authoritative server for sub-domains / zones

    eg. the root contains pointers to .au

    google.com.au is a domain

    com net au info biz

    com net

    org

    org

    Other

    ccTLDs

    id

    internal prosrs

    google yahoo theagemicrosoftausregistry

    c o m n e ta u

    c o m n e to r g id

    g o o g le y a h o om ic ro s o f t

    C :

    P ro gra m

    F ile sT e m pW i n d o w s

    S y s te m 3 2 F o n tsC a c h e M e d ia

    d l lc a c h e s p o o ld riv e rs

    c o m n e t a u in fo b iz

    c o m n e t

    o rg

    o rg

    O th e r

    c c T L D s

    id

    in te rn a l p ro s rs

    g o o g l e y a h o o t h e a g em ic ro so fta u s re g is tr y

  • 7/30/2019 65890396 Internet Programming Tools

    12/21

    What is a resource record?

    A domain contains resource records

    Resource records are analogous to files Classified into types

    Some of the important types are SOA, NS, A, CNAME and MX

    Normally defines in zone files

    Type Meaning Value

    SOA Start of Authority Parameters for this zone

    A IP address of a host 32bit integer

    MX Mail Exchange Priority, domainwilling to accept email

    CNAME Canonical Name Domain Name

    PTR Pointer Alias for an IP address

    HINFO Host Description CPU and OS in ASCII(security risk rarely used)

    TXT Text Uninterpreted ASCII text

    Domain Names vs. URLs

    The A Record

    The Address record

    One or more normally defines a host

    Contains an IPv4 Address (the address computers use to uniquely identify each other onthe internet)

    Eg. The record:

    www A 203.18.56.31In the ausregistry.com.au domain, defines the host uniquely identifiable as

    www.ausregistry.com.au to be reachable at the IPv4 Address 203.18.56.31

    The CNAME Record

    A CNAME defines an alias

    The alias will then be resolved, if another CNAME is encountered then the process

    continues until an A record is found

    Eg. The record:search CNAME www.google.com.

    In the ausregistry.com.au domain, defines the name uniquely identifiable as

    search.ausregistry.com.au to be and alias to www.google.com

    The MX Record

    An MX record defines the mail servers for a particular domain Mail eXchange records hold the name of hosts, and their priorities, able to deliver mail

    for the domain.

    Eg. The record:

    ausregistry.com.au MX 10 mail

    http://www.google.com/http://www.google.com/
  • 7/30/2019 65890396 Internet Programming Tools

    13/21

    In the ausregistry.com.au domain, defines the host mail to be the priority 10 mail server for the

    ausregistry.com.au domain

    The NS Record

    An NS record defines the authoritative Name servers for the domain.

    The Name Server records also define the name servers of children domains Eg. The record:

    internal NS ns1.hosting.com.au.

    In the ausregistry.com.au domain, defines the host ns1.hosting.com.au to be a name severfor the internal.ausregistry.com.au sub-domain

    What is a Delegation?

    Delegation refers to the act of putting NS records in a domain name delegating controlof a sub-domain to another entity

    This entity then has the ability to control the resource records in this sub-domain and

    delegate further children domains to other entities.

    Eg. IANA delegating control of a country code domain to the country.

    What is a zone?

    Its records are held in a database (zonefile) and served from an authoritative name

    server

    Zone refers to all the resource records in a domain but not its sub domains, the com.au zonecontains delegations records for ausregistry.com.au, but not the resource records for

    ausregistry.com.au, however all of these records are part of the com.au domain

    What is a Name Sever?

    Server responsible for answering DNS queries

    Exists at all levels of hierarchy

    Authoritative name servers hold part of the DNS database One name server can serve more then one zone

    Many name servers should serve the same zone

    Some name servers are authoritative for certain zones

    Iterative vs Recursive Name Servers

    Serve two very different functions

    Shouldnt mix the two Generally the DNS your computer points to is recursive

    Zones are hosted in iterative name servers

    Iterative servers can only answer information they know or have cachedRecursive know how to ask others for information

    Who runs what?

    ICANN/IANA have been granted the power by the US department of commerce to run

    the root zone.

    Root zone is split into all the ISO ccTLD and some other TLDs eg. .com, .net, .info

    Domain name Registries are appointed to operate the major zones.

  • 7/30/2019 65890396 Internet Programming Tools

    14/21

    Each country elects a delegate whom controls their ccTLD eg in Australia the delegate is

    auDA.

    Modify TLD and ccTLD resource records on behalf of registrants through a system of registrarseg. MelbourneIT.

    So what does all this mean to you? Domain names make large networks such as the internet human friendly

    IPv4 address difficult to remember and offer no hint as to whom they belong to.

    Problem gets worse when you consider IPv6Allow intelligent systems (eg Mail (SMTP)) to preform tasks automaticall

    Accessing a web page

    Step 1: Your PC sends a resolution

    request to its configured DNS

    Server, typically at your ISP.

    Your PC

    ISP Recursive DNS server

    Tell methe Address of

    www.google.com

    ISP Recursive DNSserverRoot Servers

    Step 2: Your ISPs recursive name

    server starts by asking one of the

    root servers predefined in its hints

    file.Tell methe Addressofwww.google.com

    I dont knowthe address but I

    knowwhos authoritative for the

    com domain askthem

    ISPRecursive DNSservercom DNSservers

    Step 3: Your ISPs recursive name

    server then asks one of the comname servers as directed.Tell me the Addressof

    www.google.com

    I dont knowthe addressbut Iknowwhos authoritativefor thegoogle.com domainaskthem

    ISP Re cursive DNS server google.com DNS server

    Step 4: Your ISPs recursive name

    server then asks one of thegoogle.com name servers as

    directed.Tell me theAddressofwww.google.com

    The Address of www.google.com

    is216.239.53.99

    Step 5: ISP DNS server then send

    the answer back to your PC. TheDNS server will remember the

    answer for a period of time.

    Your PC

    ISPRecursive DNSserver

    The Addressof www.google.comis 216.239.53.99

    Step 6: Your PC can then make the

    actual HTTP request to the webserver.

    Your PC

    www.google.comweb server

    Here it is!

    Sendmethe www.google.com.auwebpage

  • 7/30/2019 65890396 Internet Programming Tools

    15/21

    Summary

    ISP Recursive DNS server com DNS servers

    root DNS servers

    google.com DNS server

    3

    2

    4

    Your PC

    5

    1

    google.com.au

    Web Server

    WEB (HTTP)

    Request

    DNSr equests

    6

    The actual

    web requestDNS

    Sending an Email

    DNS is not just used in HTTP protocol (web pages)

    DNS is involved in almost every protocol in use on the internet Next example is how DNS facilitates the transfer of electronic mail.

    Step 1: Your PC sends the e -mail

    to its configured outbound mail

    server. ADNS request similar to the

    previous example is required to find

    the address of the mail server.

    Your PC

    Outbound Mail (SMTP) Server

    Pleasesend thismessage to

    [email protected]

    Outbound Mail serverDNSservers

    Step 2: Your mail server follows

    the same intensive process to find

    the authoritative servers for

    example.com.Tell me the name servers for

    example.com

    Here are the name servers for

    example.com

    Outbound Mail Server example.com DNS server

    Step 3: Ask the example.com

    name server for the list of Mail

    eXchangers (MX) for that domain.

    Tell me the MXsfor

    example.com

    The MXsare mx10.example.com

    and mx20.backmail.com

    Outbound Mail Server example.com Mail server

    Step 4: Select a Mail server anddeliver the mail.

    Here issome mail for theexample.comdomain

    Mail acceptedfor delivery

    Summary

    DNS is integral part in most protocols used on the internet Makes the internet human friendly for us all

    Is the world largest distributed database system

    Fits the international model perfectlyIn simple terms is a mapping between names and IP addresses

    What is E-mail?

    E-mail is a text-based mail sent via the computer from one person to another.

  • 7/30/2019 65890396 Internet Programming Tools

    16/21

    E-mail is an ideal method for sending documents already on your computer usingattachments.

    In computer terms, email is short for electronic mail. It is a more up to date method oftransmitting data, text files, and digital photos and ... from one computer to another over the

    Internet. This phenomenon did not become popular until 1990 and now it is a major business and

    personal communications.

    Email users create and send messages from individual computers using Mail-User Agents

    (MUAs).

    If the user were to send the message to more than one recipient, it is called broadcasting.

    An E-mail account may looks like below:

    [email protected] [email protected]

    user@computername [email protected]

    Two Important Mail Protocols

    Two important protocols

    Mail Process

    POP3: Is useful when e-mail is checked from only one computer.

    POP3 works by reviewing the inbox on the mail server, and downloading the newmessages to your computer so your mail is stored on your PC.

    IMAP is the better choice when you would like to check your mails from multiple

    computers at work and home.

    IMAP downloads the headers of the new messages on the server, then retrieves the

    message you want to read when you click on it.

    When using IMAP, the mail is stored on the mail server. Unless you copy a message to a

    "Local Folder" the messages are never copied to your PC.

    Scenarios of Use

    POP3:

    You only check e-mail from one computer.

    You want to remove your e-mail from the mail server.

  • 7/30/2019 65890396 Internet Programming Tools

    17/21

    IMAP:

    You check e-mail from multiple locations.

    You use Webmail.

    Mail process:

    MUA: Mail User Agent

    Program used for reading and writing mail. For example:

    Pine , Netscape, Eudora

    Mailbox access methods used by MUAs:

    POP , IMAP

    MTA: Mail Transport Agent

    Program used for transporting mail from one host to another like:

    Sendmail, Exchange, qmail, Exim, Postfix

    Protocol between MTAs: SMTP

    MDA: Mail Delivery Agent

    MDA delivers the mail to the users mailbox

    MUA MTA MDA communication

  • 7/30/2019 65890396 Internet Programming Tools

    18/21

    Scenario1: When the sender and the receiver of an email are on the same system, we needonly two user agents.

    Scenario 2: When the sender and the receiver of an email are on different systems, we need two

    UAs and a pair of MTAs (client and server)

    Scenario 3:When the sender is connected to the mail server via a LAN or a WAN, we

    need two UAs and two pairs of MTAs (client and server).

  • 7/30/2019 65890396 Internet Programming Tools

    19/21

    Scenario 4:

    Push Vs Pull

  • 7/30/2019 65890396 Internet Programming Tools

    20/21

    When both sender and receiver are connected to the mail server via a LAN or a WAN, we

    need two UAs, two pairs of MTAs (client and server), and a pair of MAAs (client and server).

    This is the most common situation today.

    The user agent (UA) provides service to the user to make the process of sending and receiving

    a message easier.

    Some examples of command-driven user agents are mail, pine, and elm

    Hypertext Transfer Protocol (HTTP)

    i. HTTP is the protocol used to access resources on the World Wide Webii. A browser application is used to send a request to the WWW server for a resource, e.g. a

    web page, graphics file, audio file, etc.iii. The server responds by sending the resource (a file) to the client and closing the connection

    Benefits of E-Mail

    Inexpensive communications medium

    Generates additional revenue opportunities

    Builds relationships

    Results are measurable

    Quick response cycles

    Drives web-site traffic

    Popular Medium - 45% US population 119 million

    Complements other communication channels

    Cost Savings due to E-Mail Usageamong U.S. Companies

    Newsgroups

    protocol

    NNTP (Network News

    Transfer Protocol)

    client

    Email client Newsgroups: Protocol

    NNTP

    newsgroups stored on

    NNTP news servers

    server usually providedby ISP

    should carry a widerange of newsgroups

    public servers carry

    limited ranges of

    newsgroups

    port 119

    Newsgroups: Quality of

    Service

    communication

    bandwidth

    news servers

    client application usually an email

    client also

  • 7/30/2019 65890396 Internet Programming Tools

    21/21

    File Transfer Protocol (FTP)

    Protocol for copying files between client and an FTP server

    Uses a TCP connection for reliable transfer of files with error-checking

    Most browsers support FTP, or you can use a dedicated FTP client program, e.g WS_FTP

    Trivial File Transfer Protocol (TFTP) is a lightweight version for small memory devices

    Telnet Telnet allows a user to run commands and programs remotely on another computer

    across the Internet

    The user runs a Telnet client program on the local host

    A Telnet server process must be running on the remote host

    The user must have the necessary permissions and password to access the remote host

    Some Port Assignments

    21 FTP 25 smtp (mail) 79 finger

    23 Telnet 70 gopher 80 HTTP