1 / 99

CSC 600 Internetworking with TCP/IP

CSC 600 Internetworking with TCP/IP. Unit 3: Transport Layer (Ch. 13, 12) Dr. Cheer-Sun Yang Spring 2001. Introduction. Transmission Control Protocol provides connection-oriented reliable transport services.

kimberly
Download Presentation

CSC 600 Internetworking with TCP/IP

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSC 600Internetworking with TCP/IP Unit 3: Transport Layer (Ch. 13, 12) Dr. Cheer-Sun Yang Spring 2001

  2. Introduction • Transmission Control Protocol provides connection-oriented reliable transport services. • User Datagram Protocol (UDP) provides connectionless unreliable transport services.

  3. TCP & UDP • Transmission Control Protocol • Connection oriented • RFC 793 • User Datagram Protocol (UDP) • Connectionless • RFC 768

  4. Reliable vs. Unreliable • Reliable transport service handles error recovery at the transport level. • Unreliable transport service does not provide error recovery at at the transport level.

  5. Connection-oriented vs.Connection-less • Connection-oriented service must establish connection between the source and the destination first. • Connection-less service does not establish connection first. It simply does store-and-forward.

  6. Properties of the Reliable Delivery Service • Stream orientation - ordered delivery • Virtual circuit connection – connection establishment is must prior to segment delivery • Buffered transfer – data buffering is needed • Unstructured stream – TCP segments may not be as big as a record in a payroll application. • Full duplex connection – Connections provided by the TCP/IP stream service allow concurrent transfer in both direction.

  7. Properties of the Reliable Delivery Service • TCP provides reliable transport service using sliding window protocol as defined in the Data Link Layer Protocol.

  8. TCP is a communication protocol, not a piece of software. Transmission Control Protocol

  9. TCP vs. the Implementation • TCP is the communication protocol. • TCP is implemented by many venders in software as part of the Operating System. • The difference between a protocol and the software that implements it is analogous to the difference between the definition of a programming language and a compiler.

  10. What does TCP Specify? • Data segment format • Timing • Meanings of header fields • Functions of TCP – also referred to as services provided by TCP

  11. What does TCP not specify? • The user interface is not specified. • The underlying communication system can be a dialup telephone line, a local area network, a high speed fiber optical network, or a lower speed long haul network.

  12. TCP Services • Reliable communication between pairs of processes • Across variety of reliable and unreliable networks and internets • Two labeling facilities • Data stream push • TCP user can require transmission of all data up to push flag • Receiver will deliver in same manner • Avoids waiting for full buffers • Urgent data signal • Indicates urgent data is upcoming in stream • User decides how to handle it

  13. TCP Header

  14. Items Passed to IP • TCP passes some parameters down to IP • Precedence • Normal delay/low delay • Normal throughput/high throughput • Normal reliability/high reliability • Security

  15. TCP Header Field • Port Number • source and destination port numbers (why source port number?) • why not IP addresses? • Identifies an application • Together with IP address to form an end point

  16. TCP Header Field • Sequence Number • 32 bits long • the range of sequence number is 0 <= seq <= 2 32 -1 • Each sequence number identifies the byte in the stream of data from the sending TCP to the receiving TCP where the first byte of data is located in the segment • Initial Sequence Number (ISN) of a connection is set during connection management 1 200 201 400 401 600 segment 1 segment 2 segment 3 (seq = 1) (seq = 201) (seq = 401)

  17. TCP Header Field • Acknowledgement Nubmer • Acknowledgements are piggybacked if there is a segment ready to be sent from the receiver to the sender • The acknowledgement segment consists of the next sequence number expected

  18. TCP Header Field • Header Length • Why is this needed ?

  19. TCP Header Field

  20. TCP Header Field • Flags • URG - if the URG =1, the following bytes contain an urgent message: seq <= urgent message <= seq + urgent pointer • ACK: acknowledgement number is valid • PSH: • notification from sender to receiver to force the TCP on the receiver side to pass all data received to the application layer • Normally sent by the sender when the sender’s buffer is empty so the sender does not wait for more data • RST: Reset the connection • SYN: synchronization request for the sequence number • FIN: Finish flag

  21. TCP Header Field • Options: • End of options: 1 byte • NOP: 1 byte • Maximum segment size: 4 bytes • Window scale factor: 3 bytes • increases the TCP window size from 16 bits to 32 bits • 1-byte shift count is between 0 and 14 • used in the connection establishment for window size negotiation • Timestamp: 10 bytes • sender places a timestamp in a segment • receiver places an echo reply • this allows the sender to calculate the Round-Trip Time per window

  22. TCP Header Field(Options) 0 End of options NOP 1 2 4 MSS Window scale factor 3 3 S S: shift count 8 10 timestamp timestamp echo reply Timestamp

  23. Transport Layer Issues • Addressing • Connection establishment • Connection termination • Flow Control • Timeout and retransmission • Congestion Control • Multiplexing • Duplication detection • Crash recovery

  24. TCP Mechanisms • Connection establishment • Data transfer • Send policy • Deliver policy • Accept policy: in-order, in-window • Retransmission policy: first-only, batch, individual • Acknowledgement Policy

  25. Addressing • Target user specified by: • User identification • Usually host, port • Called a socket in TCP • Port represents a particular transport service (TS) user • Transport entity identification • Generally only one per host • If more than one, then usually one of each type • Specify transport protocol (TCP, UDP) • Host address • An attached network device • In an internet, a global internet address • Network number

  26. Finding Addresses • Four methods • Know address ahead of time • e.g. collection of network device stats • Well known addresses • Name server • Sending process request to well known address

  27. Ports, Connections, and Endpoints • TCP uses the connection, not the protocol port, as its fundamental abstraction; connections are identified by a pair of endpoints, i.e., (18.26.0.36, 1069) and (128.10.2.3, 25). • An endpoint is a pair of integers = (host, port). • Because TCP identifies a connection by a pair of endpoints, a given TCP port number can be shared by multiple connections on the same machine.

  28. Connection Establishment • Connection establishment • Three way handshake • Between pairs of ports • One port can connect to multiple destinations

  29. Passive and Active Opens • A client requests for a connection – an active open request. • A server must be waiting for the request for connection – a passive open.

  30. Connection Establishment • Two way handshake • A send SYN, B replies with SYN • Lost SYN handled by re-transmission • Can lead to duplicate SYNs • Ignore duplicate SYNs once connected • Lost or delayed data segments can cause connection problems • Segment from old connections • Start segment numbers fare removed from previous connection • Use SYN i • Need ACK to include i • Three Way Handshake

  31. Two Way Handshake:Obsolete Data Segment

  32. Two Way Handshake:Obsolete SYN Segment

  33. Three WayHandshake:Examples

  34. Connection Establishment

  35. Three Way Handshake:State Diagram

  36. Initial Sequence Number • When a new connection is being established, the SYN flag is turned on. The sequence number field contains the ISN chosen by the host for this connection. • The sequence number of the first byte of data sent by the host will be the ISN plus one because the SYN flag consumes a sequence number.

  37. Connection Termination • Entity in CLOSE WAIT state sends last data segment, followed by FIN • FIN arrives before last data segment • Receiver accepts FIN • Closes connection • Loses last data segment • Associate sequence number with FIN • Receiver waits for all segments before FIN sequence number • Loss of segments and obsolete segments • Must explicitly ACK FIN

  38. Data Transfer • Data transfer • Logical stream of octets • Octets numbered modulo 223 • Flow control by credit allocation of number of octets • Data buffered at transmitter and receiver

  39. Send Policy • If no push or close TCP entity transmits at its own convenience • Data buffered at transmit buffer • May construct segment per data batch • May wait for certain amount of data

  40. Deliver Policy • In absence of push, deliver data at own convenience • May deliver as each in order segment received • May buffer data from more than one segment

  41. Accept Policy • Segments may arrive out of order • In order • Only accept segments in order • Discard out of order segments • In windows • Accept all segments within receive window

  42. Not Listening • Reject with RST (Reset) • Queue request until matching open issued • Signal TS user to notify of pending request • May replace passive open with accept

  43. Connection Termination • Connection termination • Graceful close • TCP users issues CLOSE primitive • Transport entity sets FIN flag on last segment sent • Abrupt termination by ABORT primitive • Entity abandons all attempts to send or receive data • RST segment transmitted

  44. Termination • Either or both sides • By mutual agreement • Abrupt termination • Or graceful termination • Close wait state must accept incoming data until FIN received

More Related