4. tcp header.ppt

377 views 30 slides Feb 09, 2024
Slide 1
Slide 1 of 30
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30

About This Presentation

5 TH SEM


Slide Content

Transmission
Control
Protocol
(TCP)
1
Unit-4
Internet & Web Technology
Subject Code –1618503
By-Asst. Prof. A.K. Singh

2
TCP
•TCPliesbetweentheapplicationlayerandthenetworklayer,and
servesastheintermediarybetweentheapplicationprogramsandthe
networkoperations.
•TCPprovidefunctionssuchasthreewayhandshakeprocess,
connectionoriented,sequencing,acknowledgment,errorrecovery,
flowcontrolandwindowing
•TCPisafeaturesrichprotocol.Itprovidesguaranteeddatadelivery.It
ensuresthateachbit,sentfromthesourcehost,reachesatthe
destinationhost.
•TCPisaconnectionorientedprotocol.Differencebetweena
connection-orientedprotocolandaconnection-lessprotocolisthata
connection-orientedprotocoldoesnotsendanydatauntilaproper
connectionisestablished.

3
Features of TCP
•Connectionoriented:Anapplicationrequestsa“connection”to
destinationandusesconnectiontotransferdata
•Point-to-point:ATCPconnectionhastwoendpoints(no
broadcast/multicast)
•Reliability:TCPguaranteesthatdatawillbedeliveredwithoutloss,
duplicationortransmissionerrors
•Fullduplex:Endpointscanexchangedatainbothdirections
simultaneously
•Reliableconnectionstartup:TCPguaranteesreliable,synchronized
startupbetweenendpoints(using“three-wayhandshake”)
•Gracefullyconnectionshutdown:TCPguaranteesdeliveryofalldata
afterendpointshutdown

4

5
TCP Header

6
Source port address
•Source Port is a 16 bit field.
•It identifies the port of the sending application.

7
Destination port address
•Destination Port is a 16 bit field.
•It identifies the port of the receiving application.

8
Sequence Number
•Sequence number is a 32 bit field.
•TCP assigns a unique sequence number to each byte of data
contained in the TCP segment.
•This field contains the sequence number of the first data
byte.

9
Acknowledgment Number
•Acknowledgment number is a 32 bit field.
•It contains sequence number of the data byte that receiver
expects to receive next from the sender.
•It is always sequence number of the last received data byte
incremented by 1.

10
Header length
•Header length is a 4 bit field.
•It contains the length of TCP header.
•It helps in knowing from where the actual data begins.

11
Reserved bit
•The 6 bits are reserved.
•These bits are not used.

12
Flag

13
Window size
•Window size is a 16 bit field.
•It contains the size of the receiving window of the sender.
•It advertises how much data (in bytes) the sender can
receive without acknowledgement.
•Thus, window size is used for Flow Control.

14
Checksum
•Checksum is a 16 bit field usedfor error control.
•It verifies the integrity of data in the TCP payload.
•Sender adds CRC checksum to the checksum field before
sending the data.
•Receiver rejects the data that fails the CRC check.

15
Urgent pointer
•Urgent pointer is a 16 bit field.
•It indicates how much data in the current segment counting
from the first data byte is urgent.
•Urgent pointer added to the sequence number indicates the
end of urgent data byte.
•This field is considered valid and evaluated only if the URG
bit is set to 1.

16
Urgent pointer
•Options field is used for several purposes.
•The size of options field vary from 0 bytes to 40 bytes.
•Options field is generally used for the following purposes-
•Time stamp
•Window size extension
•Parameter negotiation
•Padding

17
3 Way Handshake
•A three-way handshake is a method used in a TCP/IP
network to create a connection between a local host/client
and server. It is a three-step method that requires both the
client and server to exchange SYN and ACK
(acknowledgment) packets before actual data
communication begins.
•A three-way handshake is also known as a TCP handshake.

18
Step-01: SYN-
For establishing a connection,
•Client sends a request segment to the server.
•Request segment consists only of TCP Header with an empty payload.
•Then, it waits for a reply segment from the server.
Request segment contains the following information in TCP header-
•1.Initial sequence number
•2.SYN bit set to 1
•3.Maximum segment size
•4.Receiving window size

19
1. Initial Sequence Number-
•Client sends the initial sequence number to the server.
•It is contained in the sequence number field.
•It is a randomly chosen 32 bit value.
2. SYN Bit Set To 1-
•Client sets SYN bit to 1 which indicates the server-
•This segment contains the initial sequence number used by the client.
•It has been sent for synchronizing the sequence numbers.
3. Maximum Segment Size (MSS)-
•Client sends its MSS to the server.
•It dictates the size of the largest data chunk that client can send and receive from the
server.
•It is contained in the Options field.
4. Receiving Window Size-
•Client sends its receiving window size to the server.
•It dictates the limit of unacknowledged data that can be sent to the client.
•It is contained in the window size field.

20
1. Initial Sequence Number-
•Client sends the initial sequence number to the server.
•It is contained in the sequence number field.
•It is a randomly chosen 32 bit value.
2. SYN Bit Set To 1-
•Client sets SYN bit to 1 which indicates the server-
•This segment contains the initial sequence number used by the client.
•It has been sent for synchronizing the sequence numbers.
3. Maximum Segment Size (MSS)-
•Client sends its MSS to the server.
•It dictates the size of the largest data chunk that client can send and receive from the
server.
•It is contained in the Options field.
4. Receiving Window Size-
•Client sends its receiving window size to the server.
•It dictates the limit of unacknowledged data that can be sent to the client.
•It is contained in the window size field.

21
Step-02: SYN + ACK-
After receiving the request segment,
•Server responds to the client by sending the reply segment.
•It informs the client of the parameters at the server side.
Reply segment contains the following information in TCP header-
1. Initial sequence number
2. SYN bit set to 1
3. Maximum segment size
4. Receiving window size
5. Acknowledgment number
6. ACK bit set to 1

22
1. Initial Sequence Number-
Server sends the initial sequence number to the client.
It is contained in the sequence number field.
It is a randomly chosen 32 bit value.
2. SYN Bit Set To 1-
Server sets SYN bit to 1 which indicates the client-
This segment contains the initial sequence number used by the server.
It has been sent for synchronizing the sequence numbers.
3. Maximum Segment Size (MSS)-
Server sends its MSS to the client.
It dictates the size of the largest data chunk that server can send and receive from
the client.
It is contained in the Options field.

23
4. Receiving Window Size-
Server sends its receiving window size to the client.
It dictates the limit of unacknowledged data that can be sent to the server.
It is contained in the window size field.
5. Acknowledgement Number-
Server sends the initial sequence number incremented by 1 as an
acknowledgement number.
It dictates the sequence number of the next data byte that server expects to
receive from the client.
6. ACK Bit Set To 1-
Server sets ACK bit to 1.
It indicates the client that the acknowledgement number field in the current
segment is valid.

24
Step-03: ACK-
After receiving the reply segment,
•Client acknowledges the response of server.
•It acknowledges the server by sending a pure acknowledgement.
With these, a Full Duplex connection is established.

25
Important Points-
Point-01:
In step-01 and step-02-
•The connection parameters are established for the first side.
•They are acknowledged by the second side.
In step-02 and step-03-
•The connection parameters are established for the second side.
•They are acknowledged by the first side.
Point-02:
Connection establishment phase consume 1 sequence number of both the sides.
•Request segment consumes 1 sequence number of the requester.
•Reply segment consumes 1 sequence number of the respondent.
•Pure acknowledgements do not consume any sequence number.

26
Point-03:
Pure acknowledgement for the reply segment is not necessary.
This is because-
•If client sends the data packet immediately, then it will be considered as an
acknowledgement.
•It means that in the first two steps only, the full duplex connection is established.
Point-04:
For all the segments except the request segment, ACK bit is always set to 1.
This is because-
•For the request segment, acknowledgement number field will always be invalid.
•For all other segments, acknowledgement number field will always be valid.

27
Point-05:
Certain parameters are negotiated during connection establishment.
The negotiation can be on setting the values of following parameters-
•Window size
•Maximum segment size
•Timer values
Point-06:
•In any TCP segment,
•If SYN bit = 1 and ACK bit = 0, then it must be the request segment.
•If SYN bit = 1 and ACK bit = 1, then it must be the reply segment.
•If SYN bit = 0 and ACK bit = 1, then it can be the pure ACK or segment meant
for data transfer.
•If SYN bit = 0 and ACK bit = 0, then this combination is not possible.

28
Point-07:
•The combination SYN bit = 0 and ACK bit = 0 is not possible.
•It is because SYN bit = 0 signifies it is not the request segment and reply segment.
•For all other segments, ACK bit is always set to 1.
Point-08:
•Consider sender sends the segments of size greater than MSS of receiver.
•Then, they are first fragmented first at the receiver side.
•It causes an extra overhead.
Point-09:
•There is no dedicated field for sending MSS in TCP header.
•This is because MSS has to informed only once.
•So, if dedicated field would be present, then sending it each time would not be required.
•For this reason, MSS is informed once using Options field.

29
Congestion in network
Congestionreferstoanetworkstatewhere-
•Themessagetrafficbecomessoheavythatitslowsdownthenetwork
responsetime.
•CongestionisanimportantissuethatcanariseinPacketSwitched
Network.
•Congestionleadstothelossofpacketsintransit.
•So,itisnecessarytocontrolthecongestioninnetwork.
•Itisnotpossibletocompletelyavoidthecongestion.

30
TCP Congestion control
Congestion control refers to techniques and mechanisms that can-
•Either prevent congestion before it happens
•Or remove congestion after it has happened
•Network congestion may occur when a sender overflows the network
with too many packets. At the time of congestion, the network cannot
handle this traffic properly, which results in a degraded quality of service
(QoS). The typical symptoms of a congestion are: excessive packet
delay, packet loss and retransmission.
•Insufficient link bandwidth, legacy network devices, greedy network
applications or poorly designed or configured network infrastructure are
among the common causes of congestion.
Tags