Download presentation
Presentation is loading. Please wait.
Published byAbigale Bridewell Modified over 10 years ago
2
April 5, 2004 Prof. Paul Lin 1 CPET 355 Data Communications & Networking 6. The Transport Layer (Transmission Control Protocol) Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology Purdue University, Fort Wayne Campus
3
April 5, 2004 Prof. Paul Lin 2 Transmission Control Protocol (TCP) Request For Comment Standard Request For Comment Standard RFC 793 – originalRFC 793 – original RFC 1122 – revisedRFC 1122 – revised RFC 1323 – extensionRFC 1323 – extension Connection-oriented service Connection-oriented service Accepts user data stream from local process (running program)Accepts user data stream from local process (running program) Break the up into pieces (< 64 KB, often 1460 bytes) as IP datagramBreak the up into pieces (< 64 KB, often 1460 bytes) as IP datagram Using specific portUsing specific port
4
April 5, 2004 Prof. Paul Lin 3 Transmission Control Protocol (TCP) TCP/IP Connections TCP/IP Connections Full-duplexFull-duplex Point-to-pointPoint-to-point TCP/IP Suites TCP/IP Suites FTP – file transfer (control port 21, data port 20)FTP – file transfer (control port 21, data port 20) Telnet – remote login terminal service (port 23)Telnet – remote login terminal service (port 23) SMTP – E-mail (port 25)SMTP – E-mail (port 25) HTTP – HyperText Transfer Protocol (port 80)HTTP – HyperText Transfer Protocol (port 80)
5
April 5, 2004 Prof. Paul Lin 4 Transmission Control Protocol (TCP) Transport layer duties: Transport layer duties: End-to-end delivery (treat individual packets independently)End-to-end delivery (treat individual packets independently) Addressing (many-to-many entities called service points)Addressing (many-to-many entities called service points) Reliable delivery (error control, sequence control, loss control, and duplication control)Reliable delivery (error control, sequence control, loss control, and duplication control) Flow controlFlow control MultiplexingMultiplexing
6
April 5, 2004 Prof. Paul Lin 5 The TCP Header From Figure 6-29, Page 537, Computer Networks, 4 th Ed, Andrew Tanenbaum, Prentice Hall
7
April 5, 2004 Prof. Paul Lin 6 The TCP Segment Header Max Data Bytes Max Data Bytes 20-byte header20-byte header 65,495 bytes data = 65535 – 20 bytes (TCP header) – 20 bytes (IP header)65,495 bytes data = 65535 – 20 bytes (TCP header) – 20 bytes (IP header)
8
April 5, 2004 Prof. Paul Lin 7 The TCP Segment Header Source Port (16-bit) Source Port (16-bit) Destination Port (16-bit) Destination Port (16-bit) Sequence Number (32-bit) - specify the sequence position of first data byte in the segment Sequence Number (32-bit) - specify the sequence position of first data byte in the segment Ack Number (32-bit) - specify the next sequence number expected by the sender of the segment Ack Number (32-bit) - specify the next sequence number expected by the sender of the segment TCP Header Length (4-bit) TCP Header Length (4-bit)
9
April 5, 2004 Prof. Paul Lin 8 The TCP Segment Header (continue) Reserved (6-bit) Reserved (6-bit) 6 Flags 6 Flags URG – urgent pointerURG – urgent pointer ACK – ack is valid or notACK – ack is valid or not PSH – push data for efficiencyPSH – push data for efficiency RST – reset connection, reject, refuseRST – reset connection, reject, refuse SYN – establish connectionSYN – establish connection FIN – release connectionFIN – release connection
10
April 5, 2004 Prof. Paul Lin 9 TCP Segment Format (continue) Window Size (16-bit): Buffer space allocated for the connection Window Size (16-bit): Buffer space allocated for the connection Checksum (16-bit): On header and data Checksum (16-bit): On header and data Urgent Pointer (16-bit): Points to the end of data in the data field that is considered as urgent and required immediate attention Urgent Pointer (16-bit): Points to the end of data in the data field that is considered as urgent and required immediate attention Options: Variable length, Maximum Segment Size (MMS) could be sent Options: Variable length, Maximum Segment Size (MMS) could be sent Padding: Padding on a 32-bit boundary, so that the data offset may correctly point to it Padding: Padding on a 32-bit boundary, so that the data offset may correctly point to it
11
April 5, 2004 Prof. Paul Lin 10 The Main Functions of TCP Session establishment Session establishment Byte stream communications Byte stream communications Sliding windows Sliding windows
12
April 5, 2004 Prof. Paul Lin 11 The Main Functions of TCP Session Establishment A TCP Three-way Handshake A TCP Three-way Handshake HOST1 SYN. Data HOST2 ACK, SYN. Data ACK ACK
13
April 5, 2004 Prof. Paul Lin 12 TCP Byte Stream Communications Segment sequence number of the first byte in the data field Segment sequence number of the first byte in the data field ACK number for each segment ACK number for each segment When TCP sends a segment, it retains a copy of the segment in a queue (transmit window) until an ACK is received When TCP sends a segment, it retains a copy of the segment in a queue (transmit window) until an ACK is received Segments not acknowledged are retransmitted Segments not acknowledged are retransmitted
14
April 5, 2004 Prof. Paul Lin 13 TCP Sliding Windows A Sliding Window = buffer A Sliding Window = buffer The size of sliding window can be adjusted The size of sliding window can be adjusted Segments sent may take different routes due to failed or busy links Segments sent may take different routes due to failed or busy links Data must be buffered on the sending host until remote host has acknowledged it Data must be buffered on the sending host until remote host has acknowledged it
15
April 5, 2004 Prof. Paul Lin 14 TCP/IP Troubleshooting Utilities Ping (Packet Internet Groper) command Ping (Packet Internet Groper) command The ping command is design for troubleshooting and tracking a single-point hardware or software failure in the Internet.The ping command is design for troubleshooting and tracking a single-point hardware or software failure in the Internet. Verifies whether a remote host can be reachedVerifies whether a remote host can be reached Shows statistic about packet loss and delivery time.Shows statistic about packet loss and delivery time.
16
April 5, 2004 Prof. Paul Lin 15 TCP/IP Utilities and Troubleshooting Ping (Packet Internet Groper) Ping (Packet Internet Groper) When called, the ping command sends one datagram per secondWhen called, the ping command sends one datagram per second Listens for ECHO_RESPONSE returnedListens for ECHO_RESPONSE returned Sends 4 transmissions of 32-byte each to verify the network connection by defaultSends 4 transmissions of 32-byte each to verify the network connection by default Similar to the function of ICMP (Internet Control Messaging Protocol) on the IP layerSimilar to the function of ICMP (Internet Control Messaging Protocol) on the IP layer
17
April 5, 2004 Prof. Paul Lin 16 Using Ping – A Linux Example [plin@LinMysql plin]$ ping 149.164.36.5 PING 149.164.36.5 (149.164.36.5) from 149.164.36.5 : 56(84) bytes of data. 64 bytes from 149.164.36.5: icmp_seq=1 ttl=64 time=0.214 ms 64 bytes from 149.164.36.5: icmp_seq=2 ttl=64 time=0.059 ms 64 bytes from 149.164.36.5: icmp_seq=3 ttl=64 time=0.050 ms 64 bytes from 149.164.36.5: icmp_seq=4 ttl=64 time=0.055 ms
18
April 5, 2004 Prof. Paul Lin 17 Using Ping – Another Linux Example [plin@LinMysql plin]$ ping -c 10 www.iu.edu PING www.iu.edu (129.79.78.4) from 149.164.36.129 : 56(84) bytes of data. 64 bytes from lux.ucs.indiana.edu (129.79.78.4): icmp_seq=1 ttl=57 time=13.1 ms 64 bytes from lux.ucs.indiana.edu (129.79.78.4): icmp_seq=2 ttl=57 time=12.6 ms 64 bytes from lux.ucs.indiana.edu (129.79.78.4): icmp_seq=3 ttl=57 time=9.65 ms 64 bytes from lux.ucs.indiana.edu (129.79.78.4): icmp_seq=4 ttl=57 time=9.91 ms 64 bytes from lux.ucs.indiana.edu (129.79.78.4): icmp_seq=5 ttl=57 time=9.90 ms
19
April 5, 2004 Prof. Paul Lin 18 Using Ping – A MS Windows Example C:\>ping 149.164.36.5 Pinging 149.164.36.5 with 32 bytes of data: Reply from 149.164.36.5: bytes=32 time<10ms TTL=63 Ping statistics for 149.164.36.5: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms Minimum = 0ms, Maximum = 0ms, Average = 0ms
20
April 5, 2004 Prof. Paul Lin 19 Using Ping – A MS Windows Example Ping Command C:\>ping /? Usage: ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS] [-r count] [-s count] [[-j host-list] | [-k host-list]] [-r count] [-s count] [[-j host-list] | [-k host-list]] [-w timeout] destination-list [-w timeout] destination-listOptions: -t Ping the specified host until stopped. -t Ping the specified host until stopped. To see statistics and continue - type Control-Break; To see statistics and continue - type Control-Break; To stop - type Control-C. To stop - type Control-C. -a Resolve addresses to hostnames. -a Resolve addresses to hostnames.
21
April 5, 2004 Prof. Paul Lin 20 Using Ping – A MS Windows Example (continue) Options: -n count Number of echo requests to send. -l size Send buffer size. -l size Send buffer size. -f Set Don't Fragment flag in packet. -f Set Don't Fragment flag in packet. -i TTL Time To Live. -i TTL Time To Live.
22
April 5, 2004 Prof. Paul Lin 21 Using Ping – A MS Windows Example (continue) Options: -v TOS Type Of Service. -r count Record route for count hops. -r count Record route for count hops. -s count Timestamp for count hops. -s count Timestamp for count hops. -j host-list Loose source route along host-list. -j host-list Loose source route along host-list. -k host-list Strict source route along host-list. -k host-list Strict source route along host-list. -w timeout Timeout in milliseconds to wait for each reply. -w timeout Timeout in milliseconds to wait for each reply.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.