CMPE 150 – Winter 2009 Lecture 15 February 26, 2009 P.E. Mantey.

35
CMPE 150 – Winter 2009 Lecture 15 February 26, 2009 P.E. Mantey
  • date post

    22-Dec-2015
  • Category

    Documents

  • view

    215
  • download

    1

Transcript of CMPE 150 – Winter 2009 Lecture 15 February 26, 2009 P.E. Mantey.

Page 1: CMPE 150 – Winter 2009 Lecture 15 February 26, 2009 P.E. Mantey.

CMPE 150 – Winter 2009

Lecture 15

February 26, 2009

P.E. Mantey

Page 2: CMPE 150 – Winter 2009 Lecture 15 February 26, 2009 P.E. Mantey.

CMPE 150 -- Introduction to Computer Networks

Instructor: Patrick Mantey [email protected] http://www.soe.ucsc.edu/~mantey/

Office: Engr. 2 Room 595J Office hours: Tues 3-5 PM, Mon 5-6 PM* TA: Anselm Kia [email protected] Web site:

http://www.soe.ucsc.edu/classes/cmpe150/Winter09/

Text: Tannenbaum: Computer Networks (4th edition – available in bookstore, etc. )

Page 3: CMPE 150 – Winter 2009 Lecture 15 February 26, 2009 P.E. Mantey.

Syllabus

Page 4: CMPE 150 – Winter 2009 Lecture 15 February 26, 2009 P.E. Mantey.

Problem Assignment #6

On class web page this afternoon

Due Tuesday, March 3

Page 5: CMPE 150 – Winter 2009 Lecture 15 February 26, 2009 P.E. Mantey.

Today’s Agenda Intro to Transport Layer

Connections Berkeley Sockets QOS

Addressing / TSAP (of TPDU) Flow Control / Buffering Protocols

UDP RTP TCP

Congestion management Timers / RTT estimates Exponential backoff

Page 6: CMPE 150 – Winter 2009 Lecture 15 February 26, 2009 P.E. Mantey.

Text Readings

Today: Chapter 6, Sections 6.1.1-6.1.3, 6.2.1-6,

6.3-6.5 (TCP)

Tuesday Chapter 6, Section 6.6 (TCP Performance)

Page 7: CMPE 150 – Winter 2009 Lecture 15 February 26, 2009 P.E. Mantey.

Internet Layering Level 5 -- Application Layer

(rlogin, ftp, SMTP, POP3, IMAP, HTTP..)

Level 4 -- Transport Layer(a.k.a Host-to-Host)(TCP, UDP)

Level 3 -- Network Layer (a.k.a. Internet) (IP, ICMP, ARP)

Level 2 -- (Data) Link Layer / MAC sub-layer (a.k.a. Network Interface or

Network Access Layer)Level 1 -- Physical Layer

Page 8: CMPE 150 – Winter 2009 Lecture 15 February 26, 2009 P.E. Mantey.

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 9: CMPE 150 – Winter 2009 Lecture 15 February 26, 2009 P.E. Mantey.

Quality of Service

• User may specify QoS parameters at the transport layer.– At connection setup time, user may define

preferred, acceptable, and minimum values for various service parameters.

– Transport layer determines whether it’s possible to provide required service based on available network service(s).

Page 10: CMPE 150 – Winter 2009 Lecture 15 February 26, 2009 P.E. Mantey.

Transport-Layer QoS Parameters 1

• Connection establishment delay: time to establish connection.

• Connection establishment failure probability: probability connection is not established within maximum establishment time.

• Throughput: bytes transferred per second measured over a time interval.

Page 11: CMPE 150 – Winter 2009 Lecture 15 February 26, 2009 P.E. Mantey.

Transport-Layer QoS Parameters 2

• Transit delay: time between sending a message and receiving it on the other side (measured by the transport entities).

• Residual error ratio: ratio of messages in error to total messages sent.

• Priority: way for user to indicate that some connections are more important.

• Resilience: probability connection is terminated due to congestion, etc.

Page 12: CMPE 150 – Winter 2009 Lecture 15 February 26, 2009 P.E. Mantey.

Transport Layer QoS

• Only few transport protocols provide QoS parameters.

• Most just try to minimize residual error rate.• QoS parameters specified by transport user

when connection is setup.– Desired and minimum acceptable values can

be specified. – Service negotiation.

Page 13: CMPE 150 – Winter 2009 Lecture 15 February 26, 2009 P.E. Mantey.

Transport Service Primitives

• Allow transport users (e.g., application programs) to access transport service.

• Example: connection-oriented transport service primitives.PRIMITIVE TPDU Sent MeaningLISTEN (none) listen for connectionCONNECT Connection Req. try to establish connection

SEND DATA send dataRECEIVE (none) waits for dataDISCONNECT Disc. Req. try to release connection

Page 14: CMPE 150 – Winter 2009 Lecture 15 February 26, 2009 P.E. Mantey.

TPDU• Transport protocol data unit.• Messages sent between transport entities.• TPDUs are contained in network-layer packets, which in turn are contained in DLL frames.

Frameheader

Packetheader

TPDUheader TPDU payload

Page 15: CMPE 150 – Winter 2009 Lecture 15 February 26, 2009 P.E. Mantey.

Transport Service Primitives (3)

A state diagram for a simple connection management scheme. Transitions labeled in italics are caused by packet arrivals. The solid lines show the client's state sequence. The dashed lines show the server's state sequence.

Page 16: CMPE 150 – Winter 2009 Lecture 15 February 26, 2009 P.E. Mantey.

Berkeley Sockets 1• Set of transport-level primitives made available by

Berkeley UNIX. • Server side:

• SOCKET: create new communication end point.• BIND: attach local address to socket (once server

binds address, clients can connect to it).• LISTEN: listen for connection (non-blocking).• ACCEPT: accept new connection.• SEND, RECEIVE: send and receive data.• CLOSE: release connection.

Page 17: CMPE 150 – Winter 2009 Lecture 15 February 26, 2009 P.E. Mantey.

Berkeley Sockets 2• Client side:

• SOCKET: create socket.• CONNECT: try to establish connection.• SEND, RECEIVE: send and receive data.• CLOSE: release connection (symmetric release).

Page 18: CMPE 150 – Winter 2009 Lecture 15 February 26, 2009 P.E. Mantey.
Page 19: CMPE 150 – Winter 2009 Lecture 15 February 26, 2009 P.E. Mantey.

Transport Layer Addressing

• Transport Layer Address – Port (TSAP)

• Network Layer Address– IP address (NSAP)

Page 20: CMPE 150 – Winter 2009 Lecture 15 February 26, 2009 P.E. Mantey.

Addressing

TSAPs, NSAPs and transport connections.

Page 21: CMPE 150 – Winter 2009 Lecture 15 February 26, 2009 P.E. Mantey.

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.

_______________________________________Transport Service Access Point / Network Service Access Point

Page 22: CMPE 150 – Winter 2009 Lecture 15 February 26, 2009 P.E. Mantey.

Example 1

• Finding the time of day from a time-of-day server.– Time-of-day server process on host 2 attaches itself

to TSAP 122 and waits for requests (e.g., through LISTEN).

– Application process (TSAP 6) on host 1 wants to find out the time-of-day; issues CONNECT specifying TSAP 6 as source and TSAP 122 as destination.

Page 23: CMPE 150 – Winter 2009 Lecture 15 February 26, 2009 P.E. Mantey.

Example 2

– Transport entity on host 1 tries to establish transport connection between its TSAP 6 and the TSAP 122 on host 2.

– Transport entity on host 2 contacts process on TSAP 122; if it agrees, transport connection established.

Page 24: CMPE 150 – Winter 2009 Lecture 15 February 26, 2009 P.E. Mantey.

Finding Services 1

• Well-known TSAP.– Time-of-day server has been using TSAP 122 forever

so every users know it.

• Initial connection protocol: special process server that proxies for less well-known services.– Process server listens to set of ports at the same time.– Users CONNECT to a TSAP, and if there are no servers,

process server is likely to be listening. It them spawns requested server.

Page 25: CMPE 150 – Winter 2009 Lecture 15 February 26, 2009 P.E. Mantey.

Finding Services 2

• 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.

• Finding the server’s network address.– Hierarchical addresses solve this problem, i.e.,

the NSAP is part of the TSAP.

Page 26: CMPE 150 – Winter 2009 Lecture 15 February 26, 2009 P.E. Mantey.

Connection Establishment• CONNECTION REQUEST and

CONNECTION ACCEPTED TPDUs.• Problem: delayed duplicates.

– Duplicates can re-appear and be taken as the real messages.

• Solution: messages age and are discarded after some time; need to discard ack’s.– Maximum hop count.– Timestamp.

Page 27: CMPE 150 – Winter 2009 Lecture 15 February 26, 2009 P.E. Mantey.

Avoiding Duplicates 1• Solution by Tomlinson (1975) + Sunshine

and Dalal (1978).• 2 identically numbered TPDUs are never

outstanding at the same time.• Bounded packet lifetime.• Each host has its clock.

– Clock as a counter that increments itself.– #bits(counter)>= #bits(sequence number).– Clocks don’t “crash”.

Page 28: CMPE 150 – Winter 2009 Lecture 15 February 26, 2009 P.E. Mantey.

Avoiding Duplicates 2

• When connection setup, low-order k bits of clock used as initial sequence number.

• Each connection starts numbering its TPDUs with different sequence number.

• Sequence number space need to be such that by the time sequence numbers wrap around, old TPDUs with same sequence numbers have aged.

Page 29: CMPE 150 – Winter 2009 Lecture 15 February 26, 2009 P.E. Mantey.

Sequence Numbers versus Time 1

Seq.#’s

Time

. Linear relation between timeand initial sequence number.

Page 30: CMPE 150 – Winter 2009 Lecture 15 February 26, 2009 P.E. Mantey.

Sequence Numbers versus Time 2

Seq.#’s

Time

. Host crash: when it comes up, it doesn’t know where it were in the sequence # space.

T

Forbiddenregion

. Example: T=60 sec and clock ticks once per second.. At t=30s, TPDU on connection5 gets seq.# 80.

. Host crashes and comes up.

. At t=60s, reopens connections 0~4.

. At t=70s, reopens connection 5 and at t=80s, sends TPDU 80.

. Old TPDU 80 still valid, and one would look like a duplicate.

. To prevent this, check if it’s in the “forbidden region” and delay sequence number.

30

80

80

Page 31: CMPE 150 – Winter 2009 Lecture 15 February 26, 2009 P.E. Mantey.

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 32: CMPE 150 – Winter 2009 Lecture 15 February 26, 2009 P.E. Mantey.

3-Way Handshake: Delayed Duplicates 1

. 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 33: CMPE 150 – Winter 2009 Lecture 15 February 26, 2009 P.E. Mantey.

3-Way Handshake: Duplicates 2

. 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 34: CMPE 150 – Winter 2009 Lecture 15 February 26, 2009 P.E. Mantey.

Campus and CENIC Networks

Mark Boolootian, Network Engineer, Information Technology Services

– Campus network overview: “Hub and spokes”, 1 Gbps links, redundant architecture.

– QoS – now for telephone call setup– Routing, performance monitoring– External connections: ISP, CENIC (DC, HPR),

peering • costs / cost avoidance

Page 35: CMPE 150 – Winter 2009 Lecture 15 February 26, 2009 P.E. Mantey.

Campus /CENIC web pages

• UCSC http://newnoc.ucsc.edu/

• CENIC http://calren2.ucsc.edu/nrg/– http://www.cenic.net/operations/maps/

• Boolootian et al. on “Traffic Management”http://calren2.cenic.org/ASN/reports/bactac_files/frame.htm

• http://www.cenic.net/operations/maps/