You are on page 1of 19

‫ هذه الدورة من إعداد المدرب عبد الرحمن العلوش‬, ‫ على موقع يودمي‬CCNA 200-301 ‫رابط دورة المدخل الى

شبكات سيسكو‬

Transmission Control Protocol (TCP)

➢ The Transmission Control Protocol (TCP) is one of the


main protocols of the Internet protocol suite, It
complements the Internet Protocol (IP). Therefore,
the entire suite is commonly referred to as TCP/IP.

➢ TCP provides error recovery (reliability) and flow


control using windowing between applications Data
running on hosts communicating via an IP network. 5. Application
HTTP, FTP,…

4. Transport Segment
➢ TCP is connection-oriented, and a connection TCP
between client and server is established before data
can be sent. 3. Network Packet
IPv4
IPv6
2. Data Link Frame
➢ Major internet applications such as the World Wide
Ethernet
Web, email, remote administration, and file transfer
rely on TCP.
1. Physical bit
Bit transmission

www.everestacademy.in
‫ هذه الدورة من إعداد المدرب عبد الرحمن العلوش‬, ‫ على موقع يودمي‬CCNA 200-301 ‫رابط دورة المدخل الى شبكات سيسكو‬

TCP Segment

➢ A TCP Segment is composed of a header and payload. The header consists of fixed and optional
fields. The payload appears immediately after the header. A TCP Segment is often carried as the
payload inside an IP packet.

16 + 16 + 32 + 32 + 4 + 6 + 6 + 16 + 16 + 16 = 160 bits = 20 Bytes or Octets

Source Port (16 bits ) Destination Port (16 bits )

Sequence Number (32 bits )


Source Destination
Acknowledgment Number ( 32 bits )

HL (4 bits) Reserved ( 6 bits ) Control Bits(6 bits) Window (16 bits )

Checksum (16 bits ) Urgent pointer (16 bits )

Options + Padding

DATA ( Payload : HTTP, FTP,…. )

www.everestacademy.in
‫ هذه الدورة من إعداد المدرب عبد الرحمن العلوش‬, ‫ على موقع يودمي‬CCNA 200-301 ‫رابط دورة المدخل الى شبكات سيسكو‬

TCP Segment

Source Port (16 bits ) The TCP Source Port is the port number used by the computer sending the TCP segment

Destination Port (16 bits ) The TCP Destination Port is the port number used by the computer receiving the TCP segment

Sequence Number (32 bits ) The sequence number of the first data Byte in this segment.

Acknowledgment Number ( 32 bits ) The acknowledgement number is the sequence number of the next byte the receiver expects to receive.

Header Length (4 bits) It indicates the number of bytes in the TCP header and allows the receiver to jump directly to the data.

Reserved ( 6 bits ) Reserved ( 6 bits )

URG : Urgent Pointer field, ACK : Acknowledgment field, PSH : Push Function,
Control Bits (6 bits )
RST : Reset the connection, SYN : Synchronize sequence numbers, FIN : No more data from sender

Window (16 bits ) It specifies the number of Bytes the receiver is willing to receive

Checksum (16 bits ) It is used for integrity checks TCP segment

Urgent pointer (16 bits ) It indicates the end of urgent data.

www.everestacademy.in
‫ هذه الدورة من إعداد المدرب عبد الرحمن العلوش‬, ‫ على موقع يودمي‬CCNA 200-301 ‫رابط دورة المدخل الى شبكات سيسكو‬

Maximum Segment Size ( MSS )


Source
Destination
➢ The maximum segment size (MSS) is a parameter of the
options field of the TCP header that specifies the largest
amount of data, specified in bytes, that a computer or
communications device can receive in a single TCP segment. 192.168.1.10 192.168.1.1

TCP Header Segment-Payload

<- 20 Bytes --> <-TCP MSS = 1460 Bytes -->


Transport Layer <----------------- 1480 Bytes ------------------->

Network Layer IPv4 Packet Header Packet-Payload

<-------- 20 Bytes -------->

IPv4 MTU size = 1500 Bytes


Data Link Layer
Ethernet II Header

<---------- 14 Bytes ---------->


Ethernet II MTU size = 1514 Bytes

www.everestacademy.in
‫ هذه الدورة من إعداد المدرب عبد الرحمن العلوش‬, ‫ على موقع يودمي‬CCNA 200-301 ‫رابط دورة المدخل الى شبكات سيسكو‬

Port Numbers and Multiplexing

Client Router

HTTP Port = 49716


Destination IP
Source IP
192.168.1.1
192.168.1.10

49716 80 HTTP Service =80

Multiplexing

49720 23 TELNET Service=23

TELNET Port = 49720

www.everestacademy.in
‫ هذه الدورة من إعداد المدرب عبد الرحمن العلوش‬, ‫ على موقع يودمي‬CCNA 200-301 ‫رابط دورة المدخل الى شبكات سيسكو‬

Ranges of Port Numbers (Transport Layer )

➢ The Internet Assigned Numbers Authority (IANA) subdivides the port number ranges into three main ranges.

FTP data = 20 FTP Control = 21 SSH = 22 Telnet = 23 DNS = 53 HTTP = 80 POP3 = 110 SSL = 443

0 Well Known Ports 1023

They are used by system processes that provide widely used types of network services

Cisco HSRP = 1985 Cisco SCCP = 2000

1024 Registered Ports 49151


They are assigned by IANA for specific service upon application by a requesting entity

49152 Dynamic or Private Ports 65535

This range is used for private or customized services, for temporary purposes, and for automatic allocation of ports.

www.everestacademy.in
‫ هذه الدورة من إعداد المدرب عبد الرحمن العلوش‬, ‫ على موقع يودمي‬CCNA 200-301 ‫رابط دورة المدخل الى شبكات سيسكو‬

TCP 3-Way Handshake

Client
192.168.1.10 Router
192.168.1.1

Port = 19792 Port = 23

Can You Hear Me ?


Yes, Can You Hear Me ?
Yes.

Segment with SYN

Control Bits (6 bits ) Segment with SYN and ACK

Segment with ACK


URG

ACK

PSH

SYN
RST

FIN

Connection Established

www.everestacademy.in
‫ هذه الدورة من إعداد المدرب عبد الرحمن العلوش‬, ‫ على موقع يودمي‬CCNA 200-301 ‫رابط دورة المدخل الى شبكات سيسكو‬

TCP Connection Termination

Client
192.168.1.10 Router
192.168.1.1

Port = 19792 Port = 23

I want to close the Connection, Go Ahead


Okay

I want to close the Connection, Go Ahead

Okay

Segment with FIN and ACK

Control Bits (6 bits )


Segment with ACK
URG

ACK

PSH

SYN
RST

FIN
Segment with FIN and ACK

Segment with ACK

www.everestacademy.in
‫ هذه الدورة من إعداد المدرب عبد الرحمن العلوش‬, ‫ على موقع يودمي‬CCNA 200-301 ‫رابط دورة المدخل الى شبكات سيسكو‬

TCP Sequence Numbers and Acknowledgments

Client Server

Sequence Number Next Sequence Number Acknowledgment Number Data

Sequence Number Next Sequence Number Acknowledgment Number Data

Sequence Number Next Sequence Number Acknowledgment Number Data

Sequence Number Next Sequence Number Acknowledgment Number Data

www.everestacademy.in
‫ هذه الدورة من إعداد المدرب عبد الرحمن العلوش‬, ‫ على موقع يودمي‬CCNA 200-301 ‫رابط دورة المدخل الى شبكات سيسكو‬

TCP Sequence Numbers and Acknowledgments

Client Server

Sequence Next Sequence Acknowledgment


Length
Number Number Number

0 0

0 1

1 1

100 + 1 = 101 1

200 + 1 = 201 101

50 + 101 = 151 201

1000 + 201 = 1201 151

www.everestacademy.in
‫ هذه الدورة من إعداد المدرب عبد الرحمن العلوش‬, ‫ على موقع يودمي‬CCNA 200-301 ‫رابط دورة المدخل الى شبكات سيسكو‬

TCP Flow Control Using Windowing


Client Server

Receive 1 Send 1 Receive 1 Send 1


Receive 2 Send 2 Receive 2 Send 2
Receive 3 Send 3 Receive 3 X Send 3
ACK 4 ACK 3

Receive 4 Send 4 Receive 3 Send 3


Receive 5 Send 5 Receive 4 Send 4
Receive 6 Send 6 Receive 5 X Send 5
ACK 7 ACK 5

Receive 7 Send 7 Receive 5 Send 5


Receive 8 Send 8 Receive 6 Send 6
Receive 9 Send 9 ACK 7
ACK 10

www.everestacademy.in
‫ هذه الدورة من إعداد المدرب عبد الرحمن العلوش‬, ‫ على موقع يودمي‬CCNA 200-301 ‫رابط دورة المدخل الى شبكات سيسكو‬

TCP Flow Control Using Windowing

Client Server

Sequence Next Sequence Acknowledgment


Length
Number Number Number
100 + 1 = 101 1
100 + 101 = 201 1
0 + 1 = 1 201
100 + 201 = 301 1
100 + 301 = 401 1
0 + 1 = 1 401

www.everestacademy.in
‫ هذه الدورة من إعداد المدرب عبد الرحمن العلوش‬, ‫ على موقع يودمي‬CCNA 200-301 ‫رابط دورة المدخل الى شبكات سيسكو‬

TCP Flow Control Using Windowing

Client Server

Sequence Next Sequence Acknowledgment


Length
Number Number Number
1432 + 4228287 = 4229719 1544
52.216.165.243
1432 + 4229719 = 4231151 1544
192.168.1.10 0 + 1544 = 1544 4231151
1432 + 4231151 = 4232583 1544
52.216.165.243
1432 + 4232583 = 4234015 1544
192.168.1.10 0 + 1544 = 1544 4234015

www.everestacademy.in
‫رابط دورة المدخل الى شبكات سيسكو ‪ CCNA 200-301‬على موقع يودمي ‪ ,‬هذه الدورة من إعداد المدرب عبد الرحمن العلوش‬

‫‪TCP Flow Control Using Windowing‬‬


‫‪Server‬‬
‫‪Client‬‬

‫‪1432‬‬

‫‪1432‬‬

‫‪1432‬‬

‫‪1432‬‬

‫‪www.everestacademy.in‬‬
‫ هذه الدورة من إعداد المدرب عبد الرحمن العلوش‬, ‫ على موقع يودمي‬CCNA 200-301 ‫رابط دورة المدخل الى شبكات سيسكو‬

TCP Connection States


Server
Client

Wait 30 seconds Client initiates a Receive ACK, Server creates a


CLOSED TCP connection CLOSED listen socket
Send nothing

Send SYN

TIME_WAIT SYN_SENT LAST_ACK LISTEN

Receive FIN, Receive SYN & Send FIN Receive SYN ,


send ACK ACK, send ACK send SYN & ACK

FIN_WAIT_2 ESTABLISHED CLOSE_WAIT SYN_RCVD

Send FIN

Receive ACK, Receive FIN, Receive ACK,


FIN_WAIT_1 Client initiates ESTABLISHED
send nothing Send ACK Send nothing
close connection

www.everestacademy.in
‫ هذه الدورة من إعداد المدرب عبد الرحمن العلوش‬, ‫ على موقع يودمي‬CCNA 200-301 ‫رابط دورة المدخل الى شبكات سيسكو‬

User Datagram Protocol (UDP)

➢ User Datagram Protocol (UDP) is a communication


protocol used across the Internet for especially time-
sensitive transmissions such as video playback or DNS
lookups.

➢ UDP doesn’t have the error checking and ordering


5. Application Data
functionality of TCP and is best utilized when error
checking is not needed and speed is important. HTTP, FTP,…

4. Transport Segment
UDP
➢ UDP doesn’t have 3-way handshake to establish a
connection between the client and the server as TCP 3. Network Packet
does and hence it is unreliable protocol.
IPv4,
IPv6
2. Data Link Frame
➢ Voice and video traffic are sent using UDP because Etherne
they are both time-sensitive. t
1. Physical bit
Bit transmission

www.everestacademy.in
‫ هذه الدورة من إعداد المدرب عبد الرحمن العلوش‬, ‫ على موقع يودمي‬CCNA 200-301 ‫رابط دورة المدخل الى شبكات سيسكو‬

UDP Segment

➢ A UDP Segment is composed of a header and payload. The payload appears immediately after the
header. A UDP Segment is often carried as the payload inside an IP packet.

16 + 16 + 16 + 16 = 64 bits = 8 Bytes or Octets

Source Port (16 bits ) Destination Port (16 bits )

Length (16 bits ) Checksum ( 16 bits )

DATA ( Payload : DNS,…. )

UDP Header Segment-Payload

<- 8 Bytes -->


<------------------------------------------------------->
Length (16 bits )

www.everestacademy.in
‫ هذه الدورة من إعداد المدرب عبد الرحمن العلوش‬, ‫ على موقع يودمي‬CCNA 200-301 ‫رابط دورة المدخل الى شبكات سيسكو‬

UDP Segment

➢ A UDP Segment is composed of a header and payload. The payload appears immediately after the
header. A UDP Segment is often carried as the payload inside an IP packet.

UDP Header Segment-Payload

<- 8 Bytes --> <----------1472 Bytes --------->


Transport Layer <----------------- 1480 Bytes ------------------->

Network Layer IPv4 Packet Header Packet-Payload

<-------- 20 Bytes -------->

IPv4 MTU size = 1500 Bytes


Data Link Layer
Ethernet II Header

<---------- 14 Bytes ---------->


Ethernet II MTU size = 1514 Bytes

www.everestacademy.in
‫ هذه الدورة من إعداد المدرب عبد الرحمن العلوش‬, ‫ على موقع يودمي‬CCNA 200-301 ‫رابط دورة المدخل الى شبكات سيسكو‬

Differences Between TCP and UDP

TCP
Server
SYN TCP UDP
Client
SYN ACK 20 Bytes Header 8 Bytes Header

ACK Connection-Oriented Connectionless


Data Flow
Flow Control No Flow Control

Error Checking No Error Checking


.
UDP Use Acknowledgment No Acknowledgement
Server
Client Request Three-way Handshake No Three-way Handshake

Response Use Sequent Numbers No Sequent Numbers

Response Used By Critical Applications Used By Real-time Applications


Response
HTTP, HTTPs, FTP, Telnet, …. DNS, DHCP, TFTP, VOIP,…..

www.everestacademy.in 19

You might also like