140 likes | 313 Views
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
E N D
CS4550 Computer Networks IITCP/UDPRef: Feit Chap 9Tanenbaum 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
Application, session, presentation layers Application, session, presentation layers Transport entity Transport entity Network layer Network layer Transport Layer Service function Application Port # Transport protocol Transport Id
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
Address locations 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)
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
TCP Flow Control Sliding Window -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 Receive Window Send window Byte sequence numbers Ack
Three way handshake How do the window sizes get initialized? S E R V E R SYN Seq # 1000 Window 8760 Max seg 1460 C L I E N T SYN Seq # 3000 ACK #1001 Window 5840 Max seg 1460 ACK Seq # 1001 Ack #3001
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) TCP Segment Header
TCP Congestion Control How 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
Internet Congestion control Slow 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.
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
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
Time out Calculation T = 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