CS 330 Architecture Class 9 - PowerPoint PPT Presentation

1 / 19
About This Presentation
Title:

CS 330 Architecture Class 9

Description:

(Wikepedia) Review: Where Are We? Layer 1: Physical ... transmits them from one local interface to another on the same physical network ... – PowerPoint PPT presentation

Number of Views:52
Avg rating:3.0/5.0
Slides: 20
Provided by: kla143
Category:

less

Transcript and Presenter's Notes

Title: CS 330 Architecture Class 9


1
CS 330 Architecture Class 9
  • Plan for today TCP/ UDP, Loshin Ch 9, 10


2
(Wikepedia)
3
Review Where Are We?
  • Layer 1 Physical
  • transmits changes in voltage, light waves, etc
  • Layer 2 Data Link
  • organizes interprets layer 1 signals
  • transmits them from one local interface to
    another on the same physical network
  • Layer 3 Network
  • transmits data across networks from one host to
    another host
  • no attempt at end-to-end reliability
  • Layer 4 Transport
  • transmits data from a service on a host to a
    service on another to provide a reliable
    connection between the two (end-to-end)

4
Transport Layer Protocols
  • UDP and TCP
  • end-to-end connectivity between hosts
  • the ability to address processes on the
    communicating hosts (not just between whole
    computers as in internet layer).
  • TCP
  • a mechanism for creating reliability in a
    connection
  • a virtual circuit that applications on the
  • layer above it can rely on as if the
  • hosts were hard-wired

(source)
5
Function 1 Addressing Processes
  • As in all layers, addressing is a key function
  • Network layer provides a way to address a host
  • (i.e. a computer as a whole)
  • Transport layer provides a way to addressing
    specific processes running on the host
  • (telnet, FTP, HTTP sessions)
  • As usual, addresses include both recipient and
    sender

6
Ports
  • Each process on a computer is given an address
    (port)
  • (a process is an instance of an application)
  • Some ports are well-known
  • 80 (HTTP)
  • 23 (telnet)
  • 21 (FTP)
  • 53 (DNS).
  • A Web connection to www.wells.edu is really to
    http//www.wells.edu80.
  • Try http//calendar.wells.edu591

7
Sockets
  • The combination of host IP address and port
    number a socket
  • The sending computer creates a port number on the
    fly
  • ephemeral port

Connections /Virtual Circuits
  • The combination of the destination and sending
    host sockets forms a connection (virtual circuit)
    for tracking traffic between services on the two
    machines
  • This connection will always be unique
  • even if the same client opens two telnet sessions
    with the same host
  • even if two clients open sessions with the same
    port on a server
  • why?

8
Function Two Reliability
  • What does reliability mean in the context of
    networking?
  • assurance that all packets are received
  • assurance that they can be put back together in
    the right order
  • IP is unreliable by design
  • a best effort protocol
  • hosts send out packets in the right direction,
    but dont know whether they actually arrive
  • Reliability pushed up the stack to a higher layer

9
Costs of Reliability
  • Always involves a process for acknowledge and
    confirm
  • when one host sends a packet, the other must send
    a packet back to acknowledge receipt
  • A mechanism for retransmitting lost packets
  • A mechanism for ordering packets
  • In principle can double the amount of traffic
  • Can also slow the rate of transmission
  • And traffic must always flow both ways
  • cf. the problems of TCP/IP for cable TV or
    satellite

10
http//www.skullbox.net/tcpudp.php
11
UDP
  • UDP (User Datagram Protocol) raises the question
    again when is unreliable better than reliable?
  • Economizes on resources by pushing
    responsibility for reliability up the stack to
    the application layer
  • Used for simple applications and applications
    where getting most packets through quickly is
    more important than getting all packets through
    slowly
  • DNS send a single packet request, receive a
    single packet reply. No response try somewhere
    else. No cost to set up a circuit
  • TFTP Trivial FTP for devices that are not full
    computers (e.g. switches, firewalls, traffic
    shapers)
  • Real-time applications e.g. audio, video speed
    more important than perfection

12
UDP
  • Simpler than TCP
  • Does not track each packet sent
  • Faster
  • Used for data that does not necessarily have to
    be reliable
  • Supports broadcast and multicast
  • Format (pink is optional)

(source)
13
UDP used for DNS Protocol
  • DNS protocol query and reply messages, both
    with same message format
  • DNS message header
  • Identification 16 bit for query, reply to
    query uses same
  • Flags
  • Query or reply
  • Recursion desired
  • Recursion available
  • Reply is authoritative
  • (plus UDP header on prev slide)
  • Example name server queries sent as a UDP message

recursivenameserver can process requests for
which it is not authoritative
14
TCP
  • Transmission Control Protocol
  • The protocol that provides reliability in TCP/IP
  • Creates a virtual circuit from the point of view
    of the application that sits on top of it
  • The application sees a hard-wired connection to
    the application on the other host
  • Bytes are organized into segments which are sent
    down to IP
  • Responsibilities guarantee that
  • all segments are delivered
  • all segments can be restored to their proper
    order, no matter when they arrive
  • both hosts are notified of which segments have
    been sent and which have been received

15
How does TCP work? (1)
  • Negotiation the processes on the two hosts must
    agree to communicate using particular ports and
    particular options
  • Start with a three-way handshake
  • Host A requests a connection, including a
    randomly-generated sequence number
  • Host B sends an ACK confirming it has received
    the request, and also sends its own arbitrary
    sequence number
  • Host A sends an ACK confirming it has received
    the sequence number of host B
  • Once started each host acknowledges every
    segment received and each acknowledges the
    acknowledgements
  • If the sending host doesnt get an ACK for a
    particular segment within a stated time, it
    resends it

16
How does TCP work? (2)
  • The TCP header includes sending and receiving
    port number, its own
  • sequence number (incremented by one) the ACK
    number acknowledging
  • receipt of the other hosts sequence number
    other fields, including options

(source)
17
How does TCP work? (3)
  • A host doesnt wait for an ACK before sending the
    next segment
  • Instead, a sliding window
  • a host can send a number of segments in the
    expectation that they will be acknowledged within
    a certain time
  • if they are not, it resends them and reduces the
    window size
  • Flow control
  • if segments are not being acknowledged properly,
    the link slows down
  • Slow start
  • imagine a fast host on a fast network sending to
    a slow host
  • slowly increase window size to the point of
    failure, then back off

18
How does TCP work? (4)
  • Sounds inefficient
  • The requirement for bi-directional
    acknowledgements led many to believe TCP/IP
    unusable for real-time audio/video
  • Not quite so bad
  • the TCP header contains both the new segment
    number and the acknowledgement of the last
    segment (as well as data, except at very
    beginning and end)
  • elaborate timing algorithms to attempt to send as
    many packets as possible, but not so many that
    packets have to be resent
  • Why does physical proximity of a server means
    faster communication?
  • Nice summary

19
UDP Header
TCP Header
Write a Comment
User Comments (0)
About PowerShow.com