37
1 CMPE 150- Introduction to Computer Networks CMPE 150 Fall 2005 Lecture 26 Introduction to Computer Networks

CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 26 Introduction to Computer Networks

  • View
    213

  • Download
    0

Embed Size (px)

Citation preview

Page 1: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 26 Introduction to Computer Networks

1CMPE 150- Introduction to Computer Networks

CMPE 150

Fall 2005Lecture 26

Introduction to Computer Networks

Page 2: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 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!

Page 3: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 26 Introduction to Computer Networks

3CMPE 150- Introduction to Computer Networks

Today

• Transport Layer!– Chapter 6 of Tanenbaum.

Page 4: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 26 Introduction to Computer Networks

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.

Page 5: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 26 Introduction to Computer Networks

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.

Page 6: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 26 Introduction to Computer Networks

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

Page 7: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 26 Introduction to Computer Networks

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.

Page 8: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 26 Introduction to Computer Networks

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.

Page 9: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 26 Introduction to Computer Networks

9CMPE 150- Introduction to Computer Networks

Addressing: Example

• TSAPs, NSAPs and transport connections.

Page 10: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 26 Introduction to Computer Networks

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.

Page 11: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 26 Introduction to Computer Networks

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.

Page 12: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 26 Introduction to Computer Networks

12CMPE 150- Introduction to Computer Networks

The Internet Transport Layer

• Two main protocols:– TCP: Transmission Control Protocol.

– UDP: User Datagram Protocol.

Page 13: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 26 Introduction to Computer Networks

13CMPE 150- Introduction to Computer Networks

UDP

Page 14: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 26 Introduction to Computer Networks

14CMPE 150- Introduction to Computer Networks

UDP

• RFC 768.• No connection establishment.• No reliability.• No ordering.• No flow- or congestion control.

Page 15: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 26 Introduction to Computer Networks

15CMPE 150- Introduction to Computer Networks

The UDP Header

• 8 bytes.• Optional checksum.

Page 16: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 26 Introduction to Computer Networks

16CMPE 150- Introduction to Computer Networks

TCP

Page 17: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 26 Introduction to Computer Networks

17CMPE 150- Introduction to Computer Networks

Transmission Control Protocol• RFCs 793, 1122, and 1323.

• Reliable end-to-end.

• Expects unreliable network.

Page 18: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 26 Introduction to Computer Networks

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

Page 19: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 26 Introduction to Computer Networks

19CMPE 150- Introduction to Computer Networks

TCP Connections

• Point-to-point.• Full duplex.• Byte stream.

Page 20: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 26 Introduction to Computer Networks

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.

Page 21: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 26 Introduction to Computer Networks

21CMPE 150- Introduction to Computer Networks

TCP Segment

• Header:– 20 bytes mandatory.

– Options.

• Payload:– Up to (64 Kbytes – 20 -20) of data.

Page 22: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 26 Introduction to Computer Networks

22CMPE 150- Introduction to Computer Networks

The TCP Header

Page 23: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 26 Introduction to Computer Networks

23CMPE 150- Introduction to Computer Networks

Connection Establishment

Page 24: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 26 Introduction to Computer Networks

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

Page 25: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 26 Introduction to Computer Networks

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

Page 26: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 26 Introduction to Computer Networks

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)

Page 27: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 26 Introduction to Computer Networks

27CMPE 150- Introduction to Computer Networks

TCP Connection Establishment

6-31

Page 28: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 26 Introduction to Computer Networks

28CMPE 150- Introduction to Computer Networks

Sequence Numbers versus Time 1

Seq.#’s

Time

. Linear relation between timeand initial sequence number.

Page 29: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 26 Introduction to Computer Networks

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.

Page 30: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 26 Introduction to Computer Networks

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.

Page 31: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 26 Introduction to Computer Networks

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.

Page 32: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 26 Introduction to Computer Networks

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.

Page 33: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 26 Introduction to Computer Networks

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

Page 34: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 26 Introduction to Computer Networks

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

Page 35: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 26 Introduction to Computer Networks

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

Page 36: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 26 Introduction to Computer Networks

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,

Page 37: CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 26 Introduction to Computer Networks

37CMPE 150- Introduction to Computer Networks

TCP Connection Release

FIN

FIN ACK

FIN

FIN ACK

Timers to avoid 2-army problem.