Presentation is loading. Please wait.

Presentation is loading. Please wait.

Intermediate TCP/IP TCP Operation.

Similar presentations

Presentation on theme: "Intermediate TCP/IP TCP Operation."— Presentation transcript:

1 Intermediate TCP/IP TCP Operation

2 TCP/IP Transport Layer
The primary duties of the transport layer: Segmentation of upper-layer application data Establishment of end-to-end operations Transport of segments from one end host to another end host Flow control provided by sliding windows Reliability with sequence numbers and acknowledgments

3 Layer 4 – TCP and UDP TCP Connection-oriented Reliable
Divides outgoing messages into segments Reassembles messages at the destination station Re-sends anything not received Reassembles messages from incoming segments UDP Connectionless Unreliable Transmits messages (called user datagrams) Provides no software checking for message delivery (unreliable) Does not reassemble incoming messages Uses no acknowledgments Provides no flow control

4 TCP Segment Format Number of the calling port
Number of the called port Used to ensure correct sequencing of the arriving data Next expected TCP octet Number of 32-bit words in the header Number of octets sender is willing to accept Control setup and termination of session set to zero Indicates the end of the urgent data Upper layer protocol data

5 UDP Segment Format UDP is the connectionless transport protocol
UDP uses no windowing and no acknowledgments Error processing and retransmission must be handled by other protocols (application layer) Protocols that use UDP include: TFTP SNMP DHCP DNS

6 Session Maintanance - Flow Control and Windowing
Window size determines the amount of data that you can transmit before receiving an acknowledgment. Expectational acknowledgment means that the acknowledgment number refers to the octet that is next expected. Sliding window refers to the fact that the window size is negotiated dynamically during the TCP session. If the source receives no acknowledgment, it knows to retransmit at a slower rate.

7 TCP Operation IP provides best-effort delivery.
The transport layer (TCP) is responsible for reliability and flow control from source to destination. This is accomplished using: Sliding windows (flow control) Sequencing numbers and acknowledgments (reliability) Synchronization (establish a virtual circuit)

8 TCP or UDP Identification
The IP Packet has a Protocol field that specifies whether the segment is TCP or UDP. Connection-oriented Connectionless

9 TCP Reliability TCP re-sends anything that is not received and supplies a virtual circuit between end-user applications. The advantage of TCP is that it provides guaranteed delivery of the segments.

10 Synchronization: 3-Way Handshake
TCP Header For a connection to be established, the two end stations must synchronize on each other's initial TCP sequence numbers (ISNs). Sequence numbers are used to track the order of packets and to ensure that no packets are lost in transmission. The initial sequence number is the starting number used when a TCP connection is established. Exchanging beginning sequence numbers during the connection sequence ensures that lost data can be recovered.

11 Only part of the TCP headers are displayed.
Packet 1: source: dest: TCP: TCP header ----- TCP: Source port = 1026 TCP: Destination port = 524 TCP: Initial sequence number = 12952 TCP: Next expected Seq number= 12953 TCP: = SYN TCP: Window = 8192 TCP: Checksum = 1303 (correct) TCP: Maximum segment size = 1460 (TCP Option) Packet 2: source: dest: TCP: TCP header ----- TCP: Source port = 524 TCP: Destination port = 1026 TCP: Initial sequence number = TCP: Next expected Seq number= TCP: Acknowledgment number = 12953 TCP: = SYN TCP: Window = 32768 TCP: Checksum = D3B7 (correct) TCP: Maximum segment size = 1460 (TCP Option) Packet 3: source: dest: TCP: TCP header ----- TCP: Source port = 1026 TCP: Destination port = 524 TCP: Sequence number = 12953 TCP: Next expected Seq number= 12953 TCP: Acknowledgment number = TCP: = Acknowledgment TCP: Window = 8760 TCP: Checksum = 493D (correct) TCP: No TCP options Only part of the TCP headers are displayed.

12 TCP Three-Way Handshake
The client sends a SYN message to the server, indicating the client wishes to communicate with the server. Continued…

13 TCP Three-Way Handshake
The server responds to the client with an ACK message, and a SYN message. Here, the server places the client into the server’s half-open queue, where it waits for the three-way handshake to complete. Continued…

14 TCP Three-Way Handshake
The client responds with an ACK message, completing the handshake. Now, the server moves the client from the half-open queue, freeing resources for new incoming connections to the server.

15 Simple Windowing (1) TCP Header
TCP is responsible for breaking data into segments. With a window size of 1, each segment carries only one byte of data and must be acknowledged before another segment is transmitted. This results in inefficient host use of bandwidth. The purpose of windowing is to improve flow control and reliability. Unfortunately, with a window size of 1, you see a very inefficient use of bandwidth.

16 Simple Windowing (2) TCP uses a window size, number of bytes, that the receiver is willing to accept, and is usually controlled by the receiving process. TCP uses expectational acknowledgments The acknowledgment number refers to the next byte that the sender of the acknowledgement expects to receive. A larger window size allows more data to be transmitted pending acknowledgment. The sequence number being sent identifies the first byte of data in that segment.

17 Simple Windowing (3) TCP provides full-duplex service, which means data can be flowing in each direction, independent of the other direction. Window sizes, sequence numbers and acknowledgment numbers are independent of each other’s data flow. Receiver sends acceptable window size to sender during each segment transmission (flow control) If too much data being sent, acceptable window size is reduced If more data can be handled, acceptable window size is increased This is known as a Stop-and-Wait windowing protocol.

18 Sequencing Numbers The data segments being transmitted must be reassembled once all the data is received. No guarantee that the data will arrive in the order it was transmitted TCP applies sequence numbers to the data segments. Sequencing numbers indicate to the destination device the correct order in which to put the bytes when they are received. These sequencing numbers also act as reference numbers so that the receiver will know if it has received all of the data. They also identify the missing data pieces to the sender so it can retransmit the missing data.

19 Positive Acknowledgment and Retransmission (PAR)
PAR: The source sends a packet, starts a timer, and waits for an acknowledgment before sending the next packet. If the timer expires before the source receives an acknowledgment, the source retransmits the packet and starts the timer over again. TCP uses expectational acknowledgments in which the acknowledgment number refers to the next octet that is expected.

20 UDP Operation UDP does not use windowing or acknowledgments so application layer protocols must provide error detection. The Source Port field is an optional field used only if information needs to return to the sending host.

21 UDP Segments

22 Port Numbers (TCP and UDP)

23 Port Numbers Port nos. are used to keep track of different conversations that cross the network at the same time. Port nos. allow for multiplexing of upper-layer conversations. Port nos. are used as source and destination addresses in the TCP segment. Port nos. below 1024 are considered well-known. Port nos. above 1024 are dynamically assigned. Registered port nos. are for vendor-specific applications (Most are above 1024)

24 Port Numbers TCP Header Application software developers have agreed to use the well-known port numbers that are defined in RFC 1700. For example, any conversation bound for an Telnet application uses the standard port number 23.

25 Standard Port Numbers Conversations that do not involve an application with a well-known port number are, instead, assigned port numbers that are randomly selected from within a specific range. These port numbers are used as source and destination addresses in the TCP segment. Some ports are reserved in both TCP and UDP, although applications might not be written to support them.

26 The Dynamic and/or Private Ports are those from 49,152 through 65,535
Standard Port Numbers The Well-Known Ports are assigned by the IANA and on most systems can only be used by system (or root) processes or by programs executed by privileged users. Ports 0 – 1,023 The Registered Ports are listed by the IANA and on most systems can be used by ordinary user processes or programs executed by ordinary users. The IANA registers uses of these ports as a convenience to the community. Ports 1,024 – 49,151 The Dynamic and/or Private Ports are those from 49,152 through 65,535

27 Port Numbers TCP Header End systems use port numbers to select the proper application. Originating source port numbers, usually a value larger than 1023, are dynamically assigned by the source host.

28 TCP Header Notice the difference in how source and destination port numbers are used with clients and servers: Client: Destination Port = 23 (telnet) Source Port = 1028 (dynamically assigned) Server: Destination Port = 1028 (source port of client) Source Port = 23 (telnet)

29 Second http session from the between the same client and server
Second http session from the between the same client and server. Same destination port, but different source port to uniquely identify this web session. Dest. Port = 80 Send packets to web server application http to Dest. Port = 80 Send packets to web server application http to 1030 80 1031 80 This example shows two separate browser windows to the same URL. TCP/IP uses source port numbers to know which information goes to which window.

30 What makes each connection unique?
Connection defined by the pair of numbers: Source IP address, source port Destination IP address, destination port Different connections can use the same destination port on server host as long as the source ports or source IP addresses are different.

Download ppt "Intermediate TCP/IP TCP Operation."

Similar presentations

Ads by Google