Sei sulla pagina 1di 8

CS 283 Computer Networks

Spring 2012
Instructor: Yuan Xue

A special acknowledge goes to J.F Kurose


and K.W. Ross
Some of the slides used in this lecture are
adapted from their original slides that
accompany the book “Computer Networking,
A Top-Down Approach”
All material copyright 1996-2009
J.F Kurose and K.W. Ross, All Rights Reserved

@Yuan Xue (yuan.xue@vanderbilt.edu)


Transport Layer Outline
Overview
 3.1 Transport-layer services

 3.2 Multiplexing and demultiplexing

3.3 UDP: Connectionless transport


3.4 Principles of reliable data transfer
3.5 Connection-oriented transport: TCP
 segment structure

 reliable data transfer

 flow control

 connection management

Congestion control
 3.6 Principles of congestion control

 3.7 TCP congestion control

@Yuan Xue (yuan.xue@vanderbilt.edu)


UDP: User Datagram Protocol [RFC 768]
“bare bones” Internet
transport protocol Why is there a UDP?
“best effort” service, UDP no connection establishment
segments may be: (which can add delay)
 lost
simple: no connection state
 delivered out of order to at sender, receiver
app small segment header
connectionless: no congestion control: UDP
 no handshaking between can blast away as fast as
UDP sender, receiver desired
 each UDP segment
handled independently of
others

@Yuan Xue (yuan.xue@vanderbilt.edu)


UDP: more
often used for streaming
32 bits
multimedia apps
 loss tolerant Length, in source port # dest port #
 rate sensitive bytes of UDP length checksum
segment,
other UDP uses including
 DNS header
 SNMP

reliable transfer over UDP: Application


add reliability at application data
layer (message)
 application-specific error
recovery!
UDP segment format

@Yuan Xue (yuan.xue@vanderbilt.edu)


DNS over UDP: A Demo
Query

Reply

Information to pay attention to:


1. UDP format
2. Port numbers in the UDP segments

@Yuan Xue (yuan.xue@vanderbilt.edu)


UDP checksum
Goal: detect “errors” (e.g., flipped bits) in transmitted
segment

Sender: Receiver:
treat segment contents as compute checksum of received
sequence of 16-bit integers segment
checksum: addition (1’s check if computed checksum
complement sum) of equals checksum field value:
segment contents  NO - error detected

sender puts checksum  Discard the damaged


value into UDP checksum segment or pass to the
application with a warning, no
field recovery is performed
 YES - no error detected.

@Yuan Xue (yuan.xue@vanderbilt.edu)


Internet Checksum Example
Checksum is the 16-bit one's complement of the one's complement
sum of a pseudo header of information from the IP header, the UDP
header, and the data, padded with zero octets at the end (if necessary)
to make a multiple of two octets.
Note
 When adding numbers, a carryout from the most significant bit

needs to be added to the result


Example: add two 16-bit integers

1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0
1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

wraparound 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1

sum 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 0 0
checksum 1 0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 1

@Yuan Xue (yuan.xue@vanderbilt.edu)


End-to-End Principle
Link layer has error detection.. Why UDP does error
detection again at transport layer?
End-to-end guarantee

@Yuan Xue (yuan.xue@vanderbilt.edu)

Potrebbero piacerti anche