Week 5 Lec 2-Bit

  • Upload
    mni007

  • View
    221

  • Download
    0

Embed Size (px)

Citation preview

  • 7/29/2019 Week 5 Lec 2-Bit

    1/22

    Chapter 2Application LayerComputer Networking:A Top Down Approach,4th edition.Jim Kurose, Keith RossAddison-Wesley, July2007.

  • 7/29/2019 Week 5 Lec 2-Bit

    2/22

    Last Lecture

    DNSSMTP

  • 7/29/2019 Week 5 Lec 2-Bit

    3/22

    Todays Lecture

    P2P

  • 7/29/2019 Week 5 Lec 2-Bit

    4/22

    Electronic Mail

    Asynchronous CommunicationMedium

    Three major components: User Agents Mail Servers Simple Mail Transfer Protocol:

    SMTP

    User Agent a.k.a. mail reader composing, editing, reading

    mail messages e.g., Eudora, Outlook, Mozilla

    Thunderbird Sends message to the mail

    server

    user mailboxoutgoing

    message queue

    mail

    server

    user

    agent

    user

    agent

    user

    agentmailserver

    user

    agentuser

    agent

    mail

    server

    user

    agent

    SMTP

    SMTPSMTP

  • 7/29/2019 Week 5 Lec 2-Bit

    5/22

    Electronic Mail

    Mail Servers

    Each recipient has a mailboxlocated in one of the mail servers

    Mailbox manages and maintains themessages that have been sent tohim.

    Messagequeue of outgoing (to besent) mail messages

    Simple Mail Transfer Protocol(SMTP) between mail servers tosend email messages

    Client and Server Both client and sever sides of

    SMTP run on every mail server.

    Runs on TCP at port 25.

    RFC 5321

    mailserver

    useragent

    useragent

    user

    agentmail

    serveruseragent

    useragent

    mailserver

    useragent

    SMTP

    SMTPSMTP

  • 7/29/2019 Week 5 Lec 2-Bit

    6/22

    Sample SMTP InteractionClient SMTP establishes a TCP connection with ServerSMTPApplication Layer handshaking to introduce themselves

    Sample SMTP InteractionS: 220 hamburger.edu (Service Ready)C: HELO crepes.frS: 250 Hello crepes.fr, pleased to meet you

    C: MAIL FROM: S: 250 [email protected]... Sender okC: RCPT TO: S: 250 [email protected] ... Recipient okC: DATA (All lines after DATA command are treated as the

    mail message)S: 354 Enter mail, end with "." on a line by itselfC: Do you like ketchup?C: How about pickles?C: .S: 250 Message accepted for deliveryC: QUITS: 221 hamburger.edu closing connection

  • 7/29/2019 Week 5 Lec 2-Bit

    7/22

    Mail Access Protocols

    SMTP: delivery/storage to receivers server

    Mail access protocol: retrieval from server

    POP: Post Office Protocol [RFC 1939]

    IMAP: Internet Mail Access Protocol [RFC 1730]

    HTTP: Gmail, Hotmail, Yahoo! Mail, etc. User agent is ordinary web browser

    HTTP to send email to web server

    HTTP to access mail box

    useragent

    senders mailserver

    useragent

    SMTP SMTP accessprotocol

    receivers mailserver

  • 7/29/2019 Week 5 Lec 2-Bit

    8/22

    Root DNS Servers

    com DNS servers org DNS servers edu DNS servers

    poly.edu

    DNS servers

    umass.edu

    DNS serversyahoo.com

    DNS serversamazon.com

    DNS servers

    pbs.org

    DNS servers

    Distributed, Hierarchical Database

    Client wants IP for www.amazon.com:

    Client first queries a root server

    The root server returns the IP addresses for TLD servers forthe top level domain com

    The client then contacts one of the TLD servers which returnsthe IP address of an authoritative server for amazon.com

    The authoritative server then returns the IP address for the

    host name www.amazon.com

  • 7/29/2019 Week 5 Lec 2-Bit

    9/22

    requesting hostcis.poly.edu

    gaia.cs.umass.edu

    root DNS server

    local DNS serverdns.poly.edu

    1

    2 345

    6

    authoritative DNS serverdns.cs.umass.edu

    78

    TLD DNS server

    DNS nameresolution example

    Host at cis.poly.eduwants IP address forgaia.cs.umass.edu

    Iterated query: Contacted server

    replies with name ofserver to contact

    I dont know this

    name, but ask thisserver

  • 7/29/2019 Week 5 Lec 2-Bit

    10/22

    requesting hostcis.poly.edu

    gaia.cs.umass.edu

    root DNS server

    local DNS serverdns.poly.edu

    1

    2

    45

    6

    authoritative DNS serverdns.cs.umass.edu

    7

    8

    TLD DNS server

    3Recursive Query: Puts burden of name

    resolution on otherserver

    DNS Caching Extensively used Cache entries timeout

    (disappear) after sometime

    TLD servers typicallycached in local nameservers Thus root name

    servers not oftenvisited

    DNS nameresolution example

  • 7/29/2019 Week 5 Lec 2-Bit

    11/22

    Pure P2P Architecture

    noalways-on server

    Arbitrary end systemsdirectly communicate

    Peers are intermittentlyconnected and change IPaddresses

    P2P is a class of applicationsthat takes advantage of

    resources e.g. storage, content,human presence, available at theedges of the Internet

    peer-peer

  • 7/29/2019 Week 5 Lec 2-Bit

    12/22

    Examples of P2P Technologies

    File sharing Programs:

    Gnutella ,Napster ,LimeWire, Kazaaetc.

    Instant messaging:

    ICQ, Jabber etc

    ConferencingNetmeeting, Voice over IP (VoIP) etc

  • 7/29/2019 Week 5 Lec 2-Bit

    13/22

    P2P File Sharing

    Alice runs P2P clientapplication on her

    notebook computer

    Intermittently

    connects to Internet;

    gets new IP address

    for each connection

    Registers her content

    in P2P system

    Asks for some music fileApplication displays other peersthat have copy of that file. Alice chooses one of the peers,Bob.File is copied from Bobs PC toAlices notebook: P2P While Alice downloads, otherusers uploading from Alice.

    How a peer determines which peers have the desired contentThree approaches for organizing and searching for contentsDifferent approaches are used by different P2P file sharingsystems.

  • 7/29/2019 Week 5 Lec 2-Bit

    14/22

    P2P: Centralized Indexoriginal Napster design

    When peer connects, it informscentral server:

    IP address

    Content that it is makingavailable

    Central Server collects info frompeers that becomes active

    Creates a centralized dynamicdatabase that maps each objectname to a set of IP addresses

    Hybrid of P2P and client-server

    File distribution is P2P

    Search is client-server

    centralizeddirectory server

    peers

    Alice

    Bob

    1

    1

    1

    12

    3

  • 7/29/2019 Week 5 Lec 2-Bit

    15/22

    www.napster.com

    Main ServerFile List:UserC song.mp3

    UserD another.mp3

    ..

    User A

    2. User A

    searches forsong.mp3

    User C(Song.mp3)

    1. Construct Database

    Users connect to Napster Server

    Server builds up a list of available

    songs and locations

    User D(Another.mp3)

    User B

    3. Server searchesdatabase. Finds song

    on User Cs machine

    4. Server informsUser A of the location

    of song.mp3

    5. User A connects to

    User C and downloadssong.mp3

    File Sharing with Napster

    http://www.napster.com/http://www.napster.com/
  • 7/29/2019 Week 5 Lec 2-Bit

    16/22

    P2P: Problems with Centralized Directory

    Single Point of Failure If directory server crashes, the

    entire P2P application crashes.

    Performance Bottleneck Thousands of connected users

    Server must maintain a hugedatabase and must respond tothousands of queries per second

    Copyright Infringement Easy to obtain copyrighted

    material for free Heavy metal rock group Metallica

    sued Napster for copyrightinfringement in April 2000.

    file transfer isdecentralized, but

    locating content ishighly centralized

    D l d D

  • 7/29/2019 Week 5 Lec 2-Bit

    17/22

    Decentralized Directory

    Query Flooding

    Directory/Index isfully distributed overthe community ofpeers No central server

    Used by Gnutella Each peer indexes the

    files it makes availablefor sharing (and no

    other files)

    Overlay Network:

    Peers form an abstract,logical network called anoverlay network

    Edge between peer X and Yif theres a TCP connection

    All active peers and edgesform overlay network

    edge: virtual (notphysical)link

    Overlay network may have

    thousands of participatingpeers but

    Given peer typicallyconnected with < 10overlay neighbors

  • 7/29/2019 Week 5 Lec 2-Bit

    18/22

    Query Flooding

    Query

    Query Hit

    Query

    QueryHit

    File transfer Query messagesent over existingTCP connections Peers forwardQuery message Query-Hit

    message sent overreverse path

    Non-scalable

    Significant amount oftraffic among the peersin the underlyingnetwork connecting thepeers

  • 7/29/2019 Week 5 Lec 2-Bit

    19/22

    Limited Query Flooding

    Apeer-countfield in the message is set to specificlimit (say, 7).

    Each time the query message reaches a new peer,the peer decrements thepeer-countfield beforeforwarding the query to its overlay neighbor.

    Stops forwarding the query whenpeer-countfieldset to zero

    Flooding is localized to a region of the overlaynetwork

    Reduces the query traffic Peer seeking the content may not be able to locate

    that content.

  • 7/29/2019 Week 5 Lec 2-Bit

    20/22

    Gnutella: Peer Joining

    1. Joining peer X must find another peer in the overlaynetwork Maintain a list of peers (IP addresses ) that are often up

    in the overlay network Peer X can also contact a tracker site that maintains such

    a list

    2. Peer X sequentially attempts TCP connections withcandidate peers until connection setup with some peer Y.3. Peer X sends Pingmessage to Peer Y that forwards this

    message to his overlay neighbors (who then forward totheir neighbors.)

    4. Peer Z on receiving Pingmessage respond to Peer X withPongmessage (IP address)

    5. Peer X receives many Pong messages, and can then setupadditional TCP connections Creating multiple edges from itself into the overlay

    network

  • 7/29/2019 Week 5 Lec 2-Bit

    21/22

    Hierarchical Overlay Between centralized index and query

    flooding approaches

    No dedicated server for indexing files

    Super Peers: Peers with high bandwidthconnections into internet and highavailability.

    Ordinary peer is assigned as a childto super peer.

    A new peer Establishes a TCP connection with one of

    super peers

    Informs all the files it is sharing Super peer maintains an index of IP

    addresses of children holding differentfiles.

    Significant more peers can be checked

    for a match without creating anexcessive quantity of query traffic

    ordinary peer

    group-leader peer

    neighoring relationships

    in overlay network

  • 7/29/2019 Week 5 Lec 2-Bit

    22/22

    Home Assignment

    Bit Torrent ProtocolSee your text book and paper on LMS

    Anti-Snubbing, Pipelining, Endgamemode, Peer Churn?

    Home Assignment