TCP - IP Presentation

25
Transport Layer Protocol: Transmission Control Protocol - Introduction to TCP - Operation of TCP - Characteristics of TCP - TCP three-way handshake process - Application of TCP - Relationship between TCP and IP - Standard TCP/IP services - Port numbers and socket address

Transcript of TCP - IP Presentation

Transport Layer Protocol:

Transmission Control Protocol

- Introduction to TCP

- Operation of TCP

- Characteristics of TCP

- TCP three-way handshake process

- Application of TCP

- Relationship between TCP and IP

- Standard TCP/IP services

- Port numbers and socket address

Introduction: Transport Layer Protocol

• The Transport layer is where sessions are established and data packetsare exchanged between hosts. Two core protocols are found at thislayer are, TCP, UDP

• A transport layer provides end-to-end or host-to-host communicationservices.

• The transport layer provides services such as connection-oriented datastream support, reliability, flow control, and multiplexing.

Introduction: TCP (Transmission Control Protocol)

• Second transport layer protocol, TCP.

• Connection oriented and reliable protocol.

• Creates virtual connection between two TCPs to send data.

• TCP uses flow control and error control mechanisms at the transport level.

• Heavy weight protocol, ensure that packet is delivered or not, if not TCPresends that packet and packet must be delivered sequentially.

TCP Operations

• OPEN to open a connection

• CLOSE to close a connection

• SEND to send data to an open connection

• RECEIVE to receive data from an open connection

• STATUS to find information about a connection

TCP Message Format

0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9

0 1 2 3

0 1

Source Port Destination Port

Sequence Number

Acknowledgement Number

Data

OffsetReserved

U

R

G

A

C

K

P

S

H

R

S

T

S

Y

N

F

I

N

Window

Checksum Urgent Pointer

Options Padding

data

Source port: 16 bits The source port number

Destination port: 16 bits The destination port number

Sequence Number

(SEQ):

32 bits The sequence number of the first data octet in this segment (except when SYN is present) If

SYN is present the sequence number is the initial sequence number (ISN) and the first data

octet is ISN+1

Acknowledgement

Number (ACQ):

32 bits If the ACK control bit is set this field contains the value of the next sequence number the

sender of the segment is expecting to receive. Once a connection is established this is always

sent.

Data Offset: 4 bits The number of 32 bit words in the TCP header. This indicates where the data begins. The TCP

header (even one including options) is an integral number of 32 bits long.

Reserved: 6 bits Reserved for future use. Must be zero.

Control bits: 6 bits (from left to

right)

URG: Urgent Pointer field significant

ACK: Acknowledgement

PSH: Push function

RST: Reset the connection

SYN: Synchronize sequence numbers

FIN: No more data from sender

Window: 16 bits The number of data octets beginning with the one indicated in the acknowledgement field

which the sender of this segment is willing to accept.

Checksum: 16 bits Checksum field is calculated to verify the data correctness.

Characteristics of TCP

• Basic Data Transfer: Continuous transfer of octets in each direction

• Reliability: Must have to recover from data that is damaged, lost, duplicated or delivered or not.

• Flow Control: How much to send and how much to receive. (Acknowledgement)

• Multiplexing: Uses different ports and addresses to do simultaneously communication. (ManyProcesses)

• Connection: Reliability and Flow Control mechanism requires TCPs initialize or connection status.

• Security: The users of TCP may indicate the security and precedence of their communication

TCP three-way handshake process

• It is usually a process that takes place when a computer is about to communicatewith a foreign device to establish rules for communication.

• To establish a connection, each device must send a SYN and receive an ACK for itfrom the other device. Thus, conceptually, we need to have four control messagespass between the devices. However, it's inefficient to send a SYN and an ACK inseparate messages when one could communicate both simultaneously. Thus, in thenormal sequence of events in connection establishment, one of the SYNs and oneof the ACKs is sent together by setting both of the relevant bits (a messagesometimes called a SYN+ACK). This makes a total of three messages, and for thisreason the connection procedure is called a three-way handshake.

• E.g. : SYN: The active open is performed by the client sending a SYNto the server. The client sets the segment's sequence number to arandom value A.

• SYN-ACK: In response, the server replies with a SYN-ACK. Theacknowledgment number is set to one more than the received sequencenumber i.e. A+1, and the sequence number that the server chooses forthe packet is another random number, B.

• ACK: Finally, the client sends an ACK back to the server. Thesequence number is set to the received acknowledgement value i.e.A+1, and the acknowledgement number is set to one more than thereceived sequence number i.e. B+1.

Host A sends a TCP SYNchronize packet to Host B

Host B receives A's SYN

Host B sends a SYNchronize-ACKnowledgement

Host A receives B's SYN-ACK

Host A sends ACKnowledge

Host B receives ACK.

TCP socket connection is ESTABLISHED

Applications of TCP

• Used to send large number of files.

• Used for traffic that you need all the data for. i.e. HTML,pictures, etc.

• Reliable for use.

• In TCP the data will not be corrupted.

• TCP has a mechanism to control the errors.

• It is a connection oriented protocol, It establishes a path, or a virtualconnection all the way through switches routers proxies etc. and thenstarts any communication.

• Used for security purposes.

E.g.: TCP is mailing a letter with a return receipt at the post office,except that the post master will organize the letters in-order-of mailingand only deliver them in-order.

Relationship between TCP and IP

• The Internet Protocol Suite (commonly known as TCP/IP) is the setof communications protocols used for the Internet and other similarnetworks.

• It is named from two of the most important protocols in it:

• the Transmission Control Protocol (TCP) and

• the Internet Protocol (IP), which were the first two networkingprotocols defined in this standard.

Transmission Control Protocol (TCP)

• Transmission Control Protocol (TCP) is the core protocol of the InternetProtocol Suite.

• TCP provides the delivery of a stream of bytes from a program fromone computer to another computer.

• TCP provides reliable, ordered, and error-checked delivery of a stream ofoctets between applications running on hosts communicating over an IPnetwork.

• TCP is the connection-oriented protocol.

Internet Protocol (IP)

• IP has the task of delivering packets from the source host to thedestination host solely based on the IP addresses in the packet headers.

• Internet Protocol is connectionless protocol.

Summary

• Both TCP and IP are the connection protocols from Internet Protocol Suite orTCP/IP model.

• TCP is a core operating on a relatively high level; IP operates at a lower level.

• TCP is the protocol from Transport Layer whereas IP is the primary protocol in theInternet Layer.

• TCP provides communication services at an intermediate level between anapplication program and the IP; IP encapsulates all data, and is connectionless.

Standard TCP/IP services

• Telnet

• FTP/Anonymous FTP

• TFTP

Source: http://docs.oracle.com/

Telnet:

- Telnet is a user command and an underlying TCP/IP protocol foraccessing remote computers.

- The Telnet protocol enables terminals and terminal-orientedprocesses to communicate on a network running TCP/IP.

- Telnet provides a user interface through which two hosts cancommunicate on a character-by-character or line-by-line basis.

- 23 is the port number.

Anonymous / File Transfer Protocol (FTP)

- The File Transfer Protocol (FTP) is a standard network protocol usedto transfer computer files from one host to another host over a TCP-based network, such as the Internet.

- Anonymous FTP is a common way to get access to a server in orderto view or download files that are publicly available.

- 20/21 is the port number.

Trivial File Transfer Protocol (TFTP)

• Trivial File Transfer Protocol (TFTP) is a simple, lock-step, File TransferProtocol which allows a client to get from or put a file onto a remote host.

• Trivial File Transfer Protocol (TFTP) is an Internet software utility fortransferring files that is simpler to use than the File Transfer Protocol (FTP)but less capable.

• It is used where user authentication and directory visibility are not required.

• 69 is the port number.

Port Numbers

• A port number is a way to identify a specific process to which anInternet or other network message is to be forwarded when it arrives ata server.

• For the Transmission Control Protocol, a port number is a 16-bitinteger that is put in the header appended to a message unit.

Socket Address

• A socket address is the combination of an IP address and a portnumber, much like one end of a telephone connection is thecombination of a phone number and a particular extension.

• Based on this address, internet sockets deliver incoming data packetsto the appropriate application process or thread.

THANK U!!