Tcpip 1

31
1 Features of TCP (Part-1)

description

This ppt explains the TCP/IP Protocol

Transcript of Tcpip 1

Page 1: Tcpip 1

1

Features of TCP (Part-1)

Page 2: Tcpip 1

Recap

In the previous class, you have learnt about

• Different layers of TCP/IP

2

Page 3: Tcpip 1

3

Objectives

On completion of this period, you would be able to know about

• Understand the features of TCP

• Structure of the TCP Header

• Importance of primitives used and transport entities

Page 4: Tcpip 1

44

What is the role of a Transport Layer ?

• It is designed to allow peer entities on the source and

destination hosts to carry on a conversation

• It acts as an interface between the lower layers and the

upper layers

Page 5: Tcpip 1

5

Transport Layer contd…

• Transport layer is the heart of the TCP/IP Network architecture

• Its task is to provide reliable data transport from the source machine to the destination machine

• It is done independent of the networks currently used

• It provides certain services to the upper layers

Page 6: Tcpip 1

6

Transport

entity

Application

(or session) layer

Network layer

Transport

entity

Application

(or session) layer

Network layer

Transport

protocol

TPDU

Application/transport

interface

Transport

address

Transport/ Application

interfaceNetwork

address

HOST 1 HOST 2

Fig .1

Transport Layer contd…

Page 7: Tcpip 1

77

• The hardware and software within the transport layer is called transport entity

• Transport entity can be located in the operating system kernel

• Transport entity can be located in a separate user process, in a library package or on the network interface card

• The previous figure explains the relationship of the network, transport and application layers

• The transport protocol carries TPDU between transport entity of host1 to host2

Transport Layer contd…

Page 8: Tcpip 1

8

Transport Layer contd…

• The layers below the transport layer are concerned with packaging, addressing, routing and delivery of data

• The physical layer handles the bits

• The data link layer deals with local networks

• Network layer handles routing between networks

• The transport layer depends on the lower layers to handle the process of moving data between systems

• The transport layer acts as a interface between the applications at the higher layers and the functions of the lower layers

Page 9: Tcpip 1

9

Transport Layer contd…

• The modern computers are multi tasking and may have several applications trying to send and receive data

• The transport layer should provide a means by which these applications can send or receive data

• The transport layer is responsible for end-to-end or host-to-host transport

• In the TCP/IP model it is called host-to-host transport layer

Page 10: Tcpip 1

10

Types of Transport Services

There are two types of transport services

• The connection oriented transport service

• Connectionless oriented transport service

They both have three phases

• Establishment of connection

• Data transfer using the connection

• Releasing the connection

Page 11: Tcpip 1

11

Transport Protocol

• The transport service is implemented by a transport protocol used between two transport entities

• Transport protocols have to deal with error control, sequencing and flow control

• At the data link layer two routers communicate directly via physical channel

Page 12: Tcpip 1

12

The TCP Segment Header

Page 13: Tcpip 1

13

• In the previous figure we have seen the TCP Header Layout. Let us see its details

• Every Segment begins with a fixed format, 20-byte header

• The fixed header may be followed by header options

• After the options, if any, up to 65,535 – 20 = 65,515 the 20 bytes subtracted belong to the IP header

The TCP Segment Header

Page 14: Tcpip 1

14

• 65.515 – 20 = 65,495 now the 20 bytes subtracted belong to the TCP header

• A maximum of 65,495 data bytes can be the Payload i.e. data to be transferred

• If there is no data also TCP header can be send but commonly used for acknowledgements and control messages

The TCP Segment Header

Page 15: Tcpip 1

15

• Let us study the TCP header field by field

• The Source port and Destination port fields identify the local end points of the connection

• The well-known ports are defined at www.iana.org each host can allocate the port address as he wishes

• A port plus its host’s IP address forms a 48-bit unique end point

• The source and destination end points together identify the connection

The TCP Segment Headercontd….

Page 16: Tcpip 1

16

• The Sequence number and Acknowledgement number

fields perform their usual functions

• Note that the latter specifies the next byte expected, not

the last byte correctly received

The TCP Segment Header Continued

Page 17: Tcpip 1

17

• Both are 32 bits long because every byte of data is numbered in a TCP stream

• The TCP header length tells how many 32-bit words are contained in the TCP header

• This information is needed because the Options field is of variable length, so is the header

The TCP Segment Header Continued

Page 18: Tcpip 1

18

• This field has been used for the last 25 years which tells us that it has been perfectly structured

• It has six 1-bit flags

• URG is set to 1 if the Urgent pointer is in use

• The Urgent pointer is used to indicate a byte offset from the current sequence number at which urgent data are to be found

UR G

ACK FINSYNRSTPSH

6-bit field

The TCP Segment Header Continued

Page 19: Tcpip 1

19

• The ACK bit is set to 1 to indicate that Acknowledgement number is valid

• If ACK is 0, the segment does not contain an acknowledgement so that the Acknowledgement number field is ignored

• The PSH bit indicates PUSHED data. The receiver is hereby kindly requested to deliver the data to the application upon arrival

The TCP Segment Header Continued

Page 20: Tcpip 1

20

• It should not buffer it until a full buffer has been received

• The RST bit is used to reset a connection that has become confused due to a host crash or some other reason

• It is also used to reject an invalid segment or refuse an attempt to open a connection

• In general, if you get a segment with RST bit ON, you have a problem on your hands

The TCP Segment Header Continued

Page 21: Tcpip 1

21

• The SYN bit is used to establish connections. The connection request has SYN=1 and ACK=0 it means acknowledgement field is not in use

• If the connection reply does bear an acknowledgement, it has SYN=1 and ACK=1

• In essence the SYN bit is used to denote CONNECTION REQUEST and CONNECTION ACCEPTED, with the ACK bit used to distinguish between those two possibilities

The TCP Segment Header Continued

Page 22: Tcpip 1

22

• The FIN bit is used to release a connection

• It specifies that the sender has no more data to transmit

• However, after closing a connection, the closing process may continue to receive data indefinitely

• Both SYN and FIN segments have sequence numbers and are thus guaranteed to be processed in the correct order 

The TCP Segment Header Continued

Page 23: Tcpip 1

23

• Flow control in TCP is handled using a variable-sized sliding window

• The Window size field tell how many bytes may be sent starting at the byte acknowledged

• A window size field of 0 is legal and says that the bytes up to and including Acknowledgement number-1 have been received

Window Size

The TCP Segment Header Continued

Page 24: Tcpip 1

24

• A Checksum is also provided for extra reliability

• It Checksums the header and data

• The Checksum is added which can be used for error detection

• When the header, data bytes are added along with the 16-bit checksum at the receiving system

• If the result obtained is zero then there is no error

• If the result is not zero the receiving system asks for a retransmission of frame

Checksum

The TCP Segment Header Continued

Page 25: Tcpip 1

25

Summary

In this class, you have learnt about

• Functions of Transport layer of TCP/IP

• Structure of the TCP Header and its description

• Importance of primitives used and transport entities

Page 26: Tcpip 1

26

Quiz

1) The protocol used in the transport layer

a) IP

b) Telnet

c) TCP

d) None

Page 27: Tcpip 1

2. The size of the TCP Header or IP header is

a) 40 bytes

b) 20 bytes

c) 65,535

d) 65,495

27

Quiz

27

Page 28: Tcpip 1

28

3) How many 1 bit field is present in the TCP header

a) 5

b) 6

c) 7

d) 8

Quiz

Page 29: Tcpip 1

4) If the data bytes = 0 in a TCP header it is a

a) acknowledgement frame

b) control frame

c) data frame

d) none of the above

29

Quiz

29

Page 30: Tcpip 1

30

Frequently Asked Questions

Short Questions

1. Draw the structure of the TCP Header?

2. What are the various primitives used in the transport layer ?

3. Briefly describe the data transfer between two transport entities

Page 31: Tcpip 1

Essay Questions

1. Explain the various functions of the transport layer in TCP?

2. Draw the structure of TCP Header and describe it in detail?

3131

Frequently Asked Questions