Week 3 Lec 1-Bit

download Week 3 Lec 1-Bit

of 34

Transcript of Week 3 Lec 1-Bit

  • 7/29/2019 Week 3 Lec 1-Bit

    1/34

    Chapter 1:IntroductionComputer Networking:A Top Down Approach ,

    4th edition.Jim Kurose, Keith Ross

    Computer Networks

  • 7/29/2019 Week 3 Lec 1-Bit

    2/34

    Last Lecture

    Queuing Delay

    TCP/IP Protocol Stack

  • 7/29/2019 Week 3 Lec 1-Bit

    3/34

    Todays Lecture

    TCP/IP Protocol Stack

    Encapsulation

    Chapter 2

    Application Layer

  • 7/29/2019 Week 3 Lec 1-Bit

    4/34

    InternetProtocolStack To provide structure to design of

    network protocols, networkdesigners organize protocols inlayers

    Service says what a layer doesProtocol says how the service is

    implementedAdvantagesDrawbacksWhen taken together the

    protocols of various layers are

    called the Protocol Stack.Internet Protocol Stack consistsof Five layers

    Physical, Link, Network,Transport and Application layers .

    Organization of Book

  • 7/29/2019 Week 3 Lec 1-Bit

    5/34

    Internet Protocol Stack

    Application Layer:

    Network applications and their application layer protocolsreside.

    Provides user interfaces and support for services such as e-mail, file transfer etc.

    Hyper Text Transfer Protocol (HTTP)

    File Transfer Protocol (FTP)

    Session Initiation Protocol (SIP)

    An application layer protocol is distributed over multiple endsystems

    The packets of information at the application layer is calledas a message.

  • 7/29/2019 Week 3 Lec 1-Bit

    6/34

    Internet Protocol Stack Transport Layer:

    Transports application-layer messages between applicationend points.

    Transport layer packet is called as a segment

    Breaks long messages into shorter segments

    There are two Transport Layer Protocols Transmission Control Protocol (TCP)

    Connection Oriented service

    Guaranteed delivery of application layer messages

    Flow control

    Congestion Control

    User Datagram Protocol (UDP)Connectionless service

    No reliability, flow control and congestion control

  • 7/29/2019 Week 3 Lec 1-Bit

    7/34

    Internet Protocol Stack Network Layer:

    Responsible for moving network layer packetsknown as datagrams from one host to another.

    Transport layer passes a transport layer

    segment and a destination address to thenetwork layer.

    Network layer includes IP Protocol

    Defines the fields in the datagram as well as

    how end systems and routers act on thesefields

    Different routing protocols.

    Determine the route that datagrams take

    between sources and destinations

  • 7/29/2019 Week 3 Lec 1-Bit

    8/34

    Internet Protocol Stack Link Layer:

    Moves a packet from one node (host or router)to the next node in the route.

    Divide the stream of bits received from the

    network layer into manageable data units calledframes.

    Transforms a raw transmission facility to areliable link.

    Mechanism to detect and retransmit damagedor lost frames

    Example of link layer protocols include WiFi,Ethernet etc.

  • 7/29/2019 Week 3 Lec 1-Bit

    9/34

    Internet Protocol Stack Physical Layer:

    The job of this layer is to move the individual bits with in framesfrom one node to next.

    Representation of bits

    Physical Layer data consists of a stream of bits (0 or 1)

    To be transmitted bits must be encoded into signals. Thephysical layer defines the type of encoding.

    The protocol in this layer depend on the actual transmissionmedium of the link.

  • 7/29/2019 Week 3 Lec 1-Bit

    10/34

    Internet Protocol Stack Application:Provides user interfaces and

    support for services such as e-mail, filetransfer etc. FTP, HTTP

    Transport:Transports application-layermessages between application end points.

    Segmentation and reassembly TCP, UDP

    Network:Routing of Datagrams fromsource to destination IP, routing protocols

    Link:Move a packet from one node (host orrouter) to the next node in the route.

    Ethernet, WiFi

    Physical:Move the individual bits with in

    frames from one node to next

    Application

    Transport

    Network

    Link

    Physical

  • 7/29/2019 Week 3 Lec 1-Bit

    11/34

    OSI Reference Model

    In 1970 International Organization forStandardization proposed a seven layeredmodel called Open SystemsInterconnection (OSI) model.

    Presentation Layer: Provide services such

    as data encryption, compression. Session Layer: Synchronization points

    (checkpointing) and recovery of dataexchange.

    Internet stack missing these layers! these services, if needed, must be

    implemented in the application by theapplication developer.

  • 7/29/2019 Week 3 Lec 1-Bit

    12/34

    source

    applicationtransport

    networklinkphysical

    segment

    datagram

    destination

    applicationtransportnetwork

    linkphysical

    router

    switch

    Encapsulationmessage

    HtHn M

    Ht

    HtHnHl M

    HtHn M

    Ht MM

    network

    linkphysical

    linkphysical

    Ht

    Hn

    Hl

    M

    HtHn M HtHn M

    HtHnHl M

    M

    Ht M

    Hnframe

  • 7/29/2019 Week 3 Lec 1-Bit

    13/34

    Chapter 2Application LayerComputer Networking: A

    Top Down Approach,

    4th edition.

    Jim Kurose, Keith Ross

    Addison-Wesley, July

    2007.

  • 7/29/2019 Week 3 Lec 1-Bit

    14/34

    Chapter 2: Application layer

    2.1 Principles of network applications

    2.2 Web and HTTP

    2.3 FTP2.4 Electronic Mail

    SMTP, POP3, IMAP

    2.5 DNS2.6 P2P applications

  • 7/29/2019 Week 3 Lec 1-Bit

    15/34

    Chapter 2: Application Layer

    Our goals: conceptual,

    implementationaspects of networkapplicationprotocols

    client-server

    paradigmpeer-to-peer

    paradigm

    learn about protocolsby examining popularapplication-levelprotocols

    HTTP

    FTP

    SMTP / POP3 /

    IMAPDNS

  • 7/29/2019 Week 3 Lec 1-Bit

    16/34

    Some Network Applications

    E-mail

    Web

    Instant messaging

    Remote login P2P file sharing

    Multi-user network games

    Streaming stored video clips

    Voice over IP Real-time video conferencing

    Many more interesting applications

  • 7/29/2019 Week 3 Lec 1-Bit

    17/34

    Creating a Network Application

    write programs that run on (different) end systems

    communicate over network

    e.g., web server softwarecommunicates with browser

    softwareNo need to write software fornetwork-core devices

    Network-core devices do not runuser applications

    Function at lower layers

    Basic design is to confineapplication software to the endsystems

    Facilitate rapid networkapplication development and

    deployment

    application

    transport

    network

    data link

    physical

    application

    transport

    network

    data linkphysical

    application

    transport

    network

    data link

    physical

  • 7/29/2019 Week 3 Lec 1-Bit

    18/34

    Application Architectures

    Application Architecture isDesigned by the application developer

    Dictates how the application isstructured over various end systems

    Two architectures used in modern dayNetwork Applications:Client-Server Architecture

    Peer-to-Peer (P2P) Architecture

  • 7/29/2019 Week 3 Lec 1-Bit

    19/34

    Client-Server ArchitectureServer:

    Always-on host

    permanent well defined IPaddress

    A single server is incapable ofkeeping up with all the requestsof the clients.

    A cluster of hosts referred asserver farm is often used.

    Clients:

    Communicate with server

    May have dynamic IP addresses

    Do not communicate directly witheach other

    Client/Server architecture isinfrastructure intensive

    Require service providers toinstall and maintain servers.

    Client/Server

  • 7/29/2019 Week 3 Lec 1-Bit

    20/34

    P2P Architecture

    Direct communicationbetween pairs ofintermittently connectedhosts called peers

    Peers are not owned by anyservice provider

    P2P Peers communicate without

    passing through anydedicated server

    e.g. Bit Torrent, eMule, Skype

    Security issues Highly Distributive

    Cost Effective

    Detailed study later on in the

    chapter

    peer-peer

    h d

  • 7/29/2019 Week 3 Lec 1-Bit

    21/34

    What Transport Service does anApplication need?

    Data Loss

    Loss Tolerant Applications Some apps (e.g., audio, VoIP)

    can tolerate some loss 2% tolerable for VoIP

    Other apps (e.g., file transfer,

    email) require 100% reliabledata transfer

    Timing Application may require

    timing guarantee

    Tight timing constraints multiplayer games, VoIP,teleconferencing.

    In Non-real time lower delaysare preferred but no tightconstraint on end-to-enddelays.

    Throughput

    Bandwidth sensitiveapplications (e.g., multimedia)require minimum amount ofthroughput

    Other apps (elastic apps)

    make use of whateverthroughput they get e.g .Email, file transferSecurity Encryption and decryption

  • 7/29/2019 Week 3 Lec 1-Bit

    22/34

    Transport Service Requirements of CommonApplications

    Application

    file transfer

    e-mail

    Web documentsreal-time audio/video

    stored audio/video

    interactive games

    Data loss

    no loss

    no loss

    no lossloss-tolerant

    loss-tolerant

    loss-tolerant

    Throughput

    elastic

    elastic

    elasticaudio: 5kbps-1Mbps

    video:10kbps-5Mbps

    same as above

    few kbps -10kbps

    Time Sensitive

    no

    no

    noyes, 100s msec

    yes, few secs

    yes, 100s msec

  • 7/29/2019 Week 3 Lec 1-Bit

    23/34

    Internet transport protocols services

    TCP service: connection-oriented:setup

    required between client andserver processes

    reliable transportbetweensending and receiving process

    flow control:sender wontoverwhelm receiver

    congestion control:throttle

    sender when networkoverloaded

    does not provide:timing,minimum throughputguarantees, security

    UDP service: unreliable data transfer

    between sending andreceiving process

    does not provide:connection setup,reliability, flow control,security

    Throughput and timing

    guarantee not provided

  • 7/29/2019 Week 3 Lec 1-Bit

    24/34

    Internet Applications: application, transportprotocols

    Application

    e-mail

    remote terminal access

    Webfile transfer

    streaming multimedia

    Internet telephony

    Applicationlayer protocol

    SMTP [RFC 2821]

    Telnet [RFC 854]

    HTTP [RFC 2616]FTP [RFC 959]

    RTP [RFC 1889]

    SIP, Skype

    Underlyingtransport protocol

    TCP

    TCP

    TCPTCP

    UDP

    UDP

  • 7/29/2019 Week 3 Lec 1-Bit

    25/34

    Application -layer Protocol Defines

    Types of messagesexchanged, e.g., request, response

    Message syntax: what fields in messages

    Message semantics meaning of information in

    fields

    Rules for when and howprocesses send &respond to messages

    Public-domain protocols:

    defined in RFCs

    allows for

    interoperability e.g., HTTP, SMTP

    Proprietary protocols:

    e.g., Skype

  • 7/29/2019 Week 3 Lec 1-Bit

    26/34

    Addressing processes

    To receive messages,

    process must haveidentifier

    host device has unique 32-bit IP address

    Q:does IP address of hoston which process runssuffice for identifying theprocess?

    A:No, manyprocessescan be running on samehost

    To identify the receiving process

    two pieces of information need tobe specified:

    IP address of the host

    Port number

    Identifier that specifies the

    receiving process in thedestination host

    Popular applications have beenassigned a specific port number.

    Example port numbers:

    HTTP server: 80 Mail server: 25

    www.iana.org (well known portnumbers for all protocols)

    More in chapter 3

  • 7/29/2019 Week 3 Lec 1-Bit

    27/34

    Hyper Text Transfer Protocol (HTTP) HTTP defined in RFC 1945 and RFC 2616

    HTTP implemented on both client and server sides

    HTTP definesstructure of messages exchanged between client and

    server.

    How the client and server exchange the messages

    Web browsers implement the client side of HTTP

    Web Servers implement the server side of HTTP Host web objects each addressable by a URL

    Web page consists of objects Object can be HTML file, JPEG image, audio file

    Web pages consist of base HTML file and severalreferenced objects

    Each object is addressable by a URL

  • 7/29/2019 Week 3 Lec 1-Bit

    28/34

    HTTP overview

    HTTP: hypertexttransfer protocol

    Webs application layerprotocol

    client/server model client:browser that

    requests, receives,displays Web objects

    server:Web server

    sends objects inresponse to requests

    PC running

    Explorer

    Server

    running

    Apache Web

    server

    Linux running

    Firefox

  • 7/29/2019 Week 3 Lec 1-Bit

    29/34

    HTTP overview (continued)Uses TCP:

    Client initiates TCP connection to server, port 80 Server accepts TCP connection from client

    HTTP messages (application-layer protocolmessages) exchanged between browser (HTTP

    client) and Web server (HTTP server) Advantage of Layered architecture

    HTTP does not worry about lost data or how TCPrecovers from loss

    HTTP is stateless Server maintains no information about past client

    requests

  • 7/29/2019 Week 3 Lec 1-Bit

    30/34

    HTTP connections

    Nonpersistent HTTP

    At most one object issent over a TCPconnection.

    Persistent HTTP

    Multiple objects canbe sent over singleTCP connectionbetween client andserver.

  • 7/29/2019 Week 3 Lec 1-Bit

    31/34

    Nonpersistent HTTPSuppose user enters URL

    www.someSchool.edu/someDepartment/home.index

    1a. HTTP client initiates TCPconnection to HTTP server(process) atwww.someSchool.edu on port

    80

    2. HTTP client sends HTTPrequest message (containing

    URL) into TCP connection

    socket. Message indicates thatclient wants object

    someDepartment/home.index

    1b. HTTP server at hostwww.someSchool.edu waiting

    for TCP connection at port 80.accepts connection, notifying

    client

    3. HTTP server receives request

    message, forms responsemessage containing requested

    object, and sends message to

    the client

    time

    (contains text,

    references to 10

    jpeg images)

  • 7/29/2019 Week 3 Lec 1-Bit

    32/34

    Nonpersistent HTTP (cont.)

    5. HTTP client receives responsemessage containing html file,displays html. Parsing htmlfile, finds 10 referenced jpegobjects

    6.Steps 1-4 repeated for eachof 10 jpeg objects

    4. HTTP server closes TCPconnection.

    time

    When the user requests the webpage 11 TCP connectionsare generated

  • 7/29/2019 Week 3 Lec 1-Bit

    33/34

    Non-Persistent HTTP: Response time

    Definition of RTT: time fora packet to travel fromclient to server and back.

    Response time:

    one RTT to initiate TCPconnection

    one RTT for HTTPrequest response

    total = 2RTT+transmittime

    time to

    transmit

    file

    initiate TCP

    connection

    RTT

    request

    file

    RTT

    file

    received

    time time

  • 7/29/2019 Week 3 Lec 1-Bit

    34/34

    Persistent HTTP

    Nonpersistent HTTPissues:

    Requires 2 RTTs perobject

    Maintain TCP buffers inboth client and server

    Burden on the WebServer

    High overhead

    Persistent HTTP Server leaves TCP

    connection open aftersending response

    Subsequent HTTPmessages betweensame client/serversent over open

    connection Default mode is

    Persistent withpipelining