1CMPE 150- Introduction to Computer Networks
CMPE 150
Fall 2005Lecture 26
Introduction to Computer Networks
2CMPE 150- Introduction to Computer Networks
Announcements
• Homework 5 posted.– Due, Mon, 12.05.
• There will be a lab this week.– Wed session will be looonger!
• Final exam: December 7th. 4-7pm– In class.– Closed books/notes.
• Course evaluation.– Last day of class.
• CE 151 will be offered in Winter 06!
3CMPE 150- Introduction to Computer Networks
Today
• Transport Layer!– Chapter 6 of Tanenbaum.
4CMPE 150- Introduction to Computer Networks
The Transport Layer
• End-to-end.– Communication from source to destination host.
– Only hosts run transport-level protocols.
– Under user’s control as opposed to network layer which is controlled/owned by carrier.
5CMPE 150- Introduction to Computer Networks
The Transport Service
• Service provided to application layer.
• Transport entity: process that implements the transport protocol running on a host.– Typically at OS kernel, or user-level process.
6CMPE 150- Introduction to Computer Networks
The Transport Layer
TransportEntity
ApplicationLayer
Network Layer
Transportaddress
NetworkAddress
Transport/networkinterface
Application/transportinterface Transport
Entity
ApplicationLayer
Network Layer
TPDU
Source host Destination host
TPDU = Transport Protocol Data Unit
7CMPE 150- Introduction to Computer Networks
Types of Transport Services
• Connection-less versus connection-oriented.
• Connection-less service: no logical connections, no flow or error control.
• Connection-oriented: – Based on logical connections: connection setup, data
transfer, connection teardown.
– Flow and error control.
8CMPE 150- Introduction to Computer Networks
Transport Protocol Issues: Addressing
• Address of the transport-level entity.
• TSAP: transport service access point (analogous to NSAP).– Internet TSAP: (IP address, local port).
– Internet NSAP: IP address.
– There may be multiple TSAPs on one host.
– Typically, only one NSAP.
9CMPE 150- Introduction to Computer Networks
Addressing: Example
• TSAPs, NSAPs and transport connections.
10CMPE 150- Introduction to Computer Networks
Finding Services
• Well-known TSAP.– Time-of-day server has been using TSAP 1522
forever so every users know it.
11CMPE 150- Introduction to Computer Networks
Finding Services Alternative
• Name or directory service.– Name server listens to well-known TSAP.
– User sends service name and name server responds with service’s TSAP.
– New services need to register with name server.
12CMPE 150- Introduction to Computer Networks
The Internet Transport Layer
• Two main protocols:– TCP: Transmission Control Protocol.
– UDP: User Datagram Protocol.
13CMPE 150- Introduction to Computer Networks
UDP
14CMPE 150- Introduction to Computer Networks
UDP
• RFC 768.• No connection establishment.• No reliability.• No ordering.• No flow- or congestion control.
15CMPE 150- Introduction to Computer Networks
The UDP Header
• 8 bytes.• Optional checksum.
16CMPE 150- Introduction to Computer Networks
TCP
17CMPE 150- Introduction to Computer Networks
Transmission Control Protocol• RFCs 793, 1122, and 1323.
• Reliable end-to-end.
• Expects unreliable network.
18CMPE 150- Introduction to Computer Networks
The TCP Service Model
• Ports below 1024 are reserved.• Some assigned ports (for more look at
www.iana.org).
Port Protocol Use21 FTP File transfer23 Telnet Remote login25 SMTP E-mail69 TFTP Trivial File Transfer Protocol79 Finger Lookup info about a user80 HTTP World Wide Web
110 POP-3 Remote e-mail access119 NNTP USENET news
19CMPE 150- Introduction to Computer Networks
TCP Connections
• Point-to-point.• Full duplex.• Byte stream.
20CMPE 150- Introduction to Computer Networks
The TCP Service Model (2)
• (a) Four 512-byte segments sent as separate IP datagrams.
• (b) The 2048 bytes of data delivered to the application in a single READ CALL.
21CMPE 150- Introduction to Computer Networks
TCP Segment
• Header:– 20 bytes mandatory.
– Options.
• Payload:– Up to (64 Kbytes – 20 -20) of data.
22CMPE 150- Introduction to Computer Networks
The TCP Header
23CMPE 150- Introduction to Computer Networks
Connection Establishment
24CMPE 150- Introduction to Computer Networks
Three-Way Handshake
• Solves the problem of getting 2 sides to agree on initial sequence number.
CR (seq=x)
ACK(seq=y,ACK=x)
DATA(seq=x, ACK=y)
CR: connectionrequest.
1 2
25CMPE 150- Introduction to Computer Networks
Delayed Duplicates
. Old duplicate CR.
. The ACK from host 2 triesto verify if host 1 was trying to open a new connection with seq=x.. Host 1 rejects host 2’s attempt to establish.Host 2 realizes it was a duplicateCR and aborts connection.
CR(seq=x)*
ACK(seq=y, ACK=x)
REJECT(ACK=y)
1 2
26CMPE 150- Introduction to Computer Networks
Delayed Duplicates
. Old duplicate CR and ACKto connection accepted.
CR(seq=x)*
ACK(seq=y, ACK=x)
REJECT(ACK=y)
1 2
DATA(seq=x,ACK=z)
27CMPE 150- Introduction to Computer Networks
TCP Connection Establishment
6-31
28CMPE 150- Introduction to Computer Networks
Sequence Numbers versus Time 1
Seq.#’s
Time
. Linear relation between timeand initial sequence number.
29CMPE 150- Introduction to Computer Networks
Connection Release
• Asymmetric release: telephone system.– When one party hangs up, connection breaks.
– May cause data loss.
• Symmetric release: – Treats connection as 2 separate unidirectional
connections.
– Requires each to be released separately.
30CMPE 150- Introduction to Computer Networks
Symmetric Release• How to determine when all data has been sent and connection could be released?• 2-army problem:
Blue army 1
White army
Blue army 2
. White army largerthan either blue armies.. Blue army together is larger.. If each blue army attacks, it’ll be defeated. They win if attack together.
31CMPE 150- Introduction to Computer Networks
2-Army Problem
• To synchronize attack, they must use messengers that need to cross valley: unreliable.
• Is there a protocol that allows blue army to win? No.– Blue army 1 sends message to blue army 2.– Blue army 2 sends ACK back.– Blue army 2 is not sure whether ACK was
received.
32CMPE 150- Introduction to Computer Networks
2-Army Problem (Cont’d)
• Use 2-way handshake.– Blue army 1 ACKs back but it’ll never know if the ACK
was received.
• Applying to connection release:– Neither side is prepared to disconnect until convinced
other side is prepared to disconnect.
– In practice, hosts are willing to take risks.
33CMPE 150- Introduction to Computer Networks
Connection Release Protocol
DR
DR
ACK
DR: disconnectionrequest.
Send DR+start timer
Send DR+start timerRelease
connection
Send ACK Release
connection
34CMPE 150- Introduction to Computer Networks
Connection Release: Scenario 1
DR
DR
ACK
DR: disconnectionrequest.
Send DR+start timer
Send DR+start timerRelease
connection
Send ACK Timeout:
Release connection
35CMPE 150- Introduction to Computer Networks
Connection Release: Scenario 2
DR
DR
DR: disconnectionrequest.
Send DR+start timer
Send DR+start timerTimeout:
send DR+start timer
Release connection
DR
Send DR+start timerDR
ACK
36CMPE 150- Introduction to Computer Networks
TCP Connection Release
• Each side released independently.– TCP segment with FIN bit set.
– Means that side has no more data to send.
• When both sides have shutdown, connection is released,
37CMPE 150- Introduction to Computer Networks
TCP Connection Release
FIN
FIN ACK
FIN
FIN ACK
Timers to avoid 2-army problem.
Top Related