1 cs4550 computer networks ii tcp/udp ref: feit chap 9 tanenbaum chap 6

14
1 CS4550 Computer Networks II TCP/UDP Ref: Feit Chap 9 Tanenbaum Chap 6

Upload: claude-hancock

Post on 01-Jan-2016

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 CS4550 Computer Networks II TCP/UDP Ref: Feit Chap 9 Tanenbaum Chap 6

1

CS4550 Computer Networks II

TCP/UDP

Ref: Feit Chap 9Tanenbaum Chap 6

Page 2: 1 CS4550 Computer Networks II TCP/UDP Ref: Feit Chap 9 Tanenbaum Chap 6

Transport Layer Functions

* Provide end to end communication function

* Connect applications with the network layer

optional:

* Packet assembly, disassembly, sequencing

* end to end acknowledgment

* High level flow/ congestion control

* Error checking

Page 3: 1 CS4550 Computer Networks II TCP/UDP Ref: Feit Chap 9 Tanenbaum Chap 6

Transport Layer Service function

Transport protocol

Application, session,

presentation layers

Transport entity

Network

layer

Application, session,

presentation layers

Transport entity

Network

layer

ApplicationPort #

Transport Id

Page 4: 1 CS4550 Computer Networks II TCP/UDP Ref: Feit Chap 9 Tanenbaum Chap 6

Common Transport Interfaces

TCP - Transmission Control Protocol - 6

UDP- User Datagram Protocol - 17

NetBEUI - Microsoft network

IPX/SPX - Novell Internet Protocol

Appletalk- Apple network protocol

DECnet - Dec protocol stack

Page 5: 1 CS4550 Computer Networks II TCP/UDP Ref: Feit Chap 9 Tanenbaum Chap 6

TPDU Payload

Application port # (telnet = 23)

Protocol (TCP=6,UDP=17)IP address ( 131.120.6.4 )

MAC address (8:0:20:74:4:79)

Address locations

Page 6: 1 CS4550 Computer Networks II TCP/UDP Ref: Feit Chap 9 Tanenbaum Chap 6

Common Port Numbers

TCP

FTP 20

telnet 23

SMTP 25

http 80

ref: feit table 9.2

UDP

DNS 53

Echo 7

SNMP 161

ref: feit table 9.1

User defined port numbers > 1024

see /etc/protocols for unix

\WINNT\system32\drivers\etc\protocols for NT

Page 7: 1 CS4550 Computer Networks II TCP/UDP Ref: Feit Chap 9 Tanenbaum Chap 6

TCP Flow ControlSliding Window

Receive Window

Send window

Byte sequence numbers

Ack

-number of bytes which can be received

-number of bytes which can be sent

-byte number of the first byte in the transmitted segment

-byte number of the next byte expected

Page 8: 1 CS4550 Computer Networks II TCP/UDP Ref: Feit Chap 9 Tanenbaum Chap 6

Three way handshakeHow do the window sizes get initialized?

SYNSeq # 1000Window 8760Max seg 1460

SYNSeq # 3000ACK #1001Window 5840Max seg 1460

ACKSeq # 1001Ack #3001

C

L

I

E

N

T

S

E

R

V

E

R

Page 9: 1 CS4550 Computer Networks II TCP/UDP Ref: Feit Chap 9 Tanenbaum Chap 6

TCP Segment Header

Source port Destination Port

Sequence Number

Acknowledgement Number

Hlen Reserved Flags Window

Checksum Urgent Pointer

Option(s)(0 0r more 32 bit words)

DATA(optional)

Page 10: 1 CS4550 Computer Networks II TCP/UDP Ref: Feit Chap 9 Tanenbaum Chap 6

TCP Congestion ControlHow big a segment of data can Sender send?

- receive window size

-congestion window size

- threshold

How often Sender send?

-Time out

- received ACK

MSS - maximum Segment size , default 536 or set by option kind =2

Page 11: 1 CS4550 Computer Networks II TCP/UDP Ref: Feit Chap 9 Tanenbaum Chap 6

Internet Congestion controlSlow start algorithm

1) set congestion window to MSS

2) Send the less of congestion window or receive window

3) if all ACK’d double congestion window and go to 2)

4) else if TO , see congestion algorithm

This algorithm doubles the unacknowledged burst size until the receive window size is reached

Actually if individual segment ack’s are received in step 3 one MSS is added to the congestion window. This doubles the burst.

Page 12: 1 CS4550 Computer Networks II TCP/UDP Ref: Feit Chap 9 Tanenbaum Chap 6

Internet Congestion control

Internet congestion Algorithm

1) threshold = 1/2 MIN(congestion Window,receive window)

2) set congestion window to MSS

3) Send the less of congestion window or receive window

4) if all ACK’d double congestion window up to the threshold add one MSS after threshold is reached

and go to 3)

5) else if TO , go to 1

Ref: tanenbaum fig 6-32, Feit fig 9.25

Page 13: 1 CS4550 Computer Networks II TCP/UDP Ref: Feit Chap 9 Tanenbaum Chap 6

Time out and Network performance

* timout value is critical to network performance

*what happens if timeout to low

*what happens if timeout too high

* develop simple formula for average data rate

from a transmitting node

* rule of thumb

Retransmission Timeout = SRTT + 2 *SDEV

Page 14: 1 CS4550 Computer Networks II TCP/UDP Ref: Feit Chap 9 Tanenbaum Chap 6

Time out CalculationT = Retransmission Timeout = SRTT + 2 *SDEV

DEV = | SRTT - latest round trip time |

SRTT = (7/8 )* SRTT + (1/8)* latest round trip time

SDEV= (3/4)*SDEV + (1/4) *DEV

initialized to:

T= 3 sec SRTT = 0 SDEV = 1.5sec