Total members 11893 |It is currently Tue Nov 05, 2024 8:59 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





TCP stands Transmission Control Protocol. TCP is one of the transport layer protocols in IP networks. TCP protocol is a connection-oriented protocol which provides end-to-end reliability. When we say TCP is connection-oriented, we mean that before two network nodes start sending and receiving data packets using TCP, they must first create connections using three handshaking protocols. TCP contain techniques for control flow and error detection. This is on reason we say that TCP provide end to end reliability.

TCP establishes a full duplex connection between two end nodes. Each node is defined by an IP address and a TCP port number. The byte stream is transferred in segments. The window size determines the number of bytes of data that can be sent before an acknowledgment from the receiver is necessary. The length of TCP packet is 32 bits.

the packet is like this :
Code:
MAC Header | IP Header |TCP Header | Data

Attachment:
File comment: TCP Header
untitled.JPG
untitled.JPG [ 36.49 KiB | Viewed 5284 times ]


Source Port. 16 bits.

Destination Port. 16 bits.

Sequence Number. 32 bits.
The sequence number of the first data byte in this segment. If the SYN bit is set, the sequence number is the initial sequence number and the first data byte is initial sequence number + 1.

Acknowledgment Number. 32 bits.
If the ACK 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 length of the TCP header is always a multiple of 32 bits.

reserved. 3 bits.
Must be cleared to zero.

ECN, Explicit Congestion Notification. 3 bits.
Added in RFC 3168.
Code:
    00   01   02
    N     C      E


N, NS, Nonce Sum. 1 bit.
Added in RFC 3540. This is an optional field added to ECN intended to protect against accidental or malicious concealment of marked packets from the TCP sender.

C, CWR. 1 bit.

E, ECE, ECN-Echo. 1 bit.

Control Bits. 6 bits.

Code:
    00   01   02   03   04   05
    U    A    P    R    S    F


U, URG. 1 bit.
Urgent pointer valid flag.

A, ACK. 1 bit.
Acknowledgment number valid flag.

P, PSH. 1 bit.
Push flag.

R, RST. 1 bit.
Reset connection flag.

S, SYN. 1 bit.
Synchronize sequence numbers flag.

F, FIN. 1 bit.
End of data flag.

Window. 16 bits, unsigned.
The number of data bytes beginning with the one indicated in the acknowledgment field which the sender of this segment is willing to accept.

Checksum. 16 bits.
This is computed as the 16-bit one's complement of the one's complement sum of a pseudo header of information from the IP header, the TCP header, and the data, padded as needed with zero bytes at the end to make a multiple of two bytes. The pseudo header contains the following fields:



_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : TCP Transmission Control Protocol
 Chat with Video Transmission in Java     -  
 protocol     -  
 Source Code for protocol     -  
 User Datagram Protocol or UDP     -  
 VOIP Voice-Over-Internet Protocol     -  
 Java Code for DTN routing protocol NECTAR for evalutaion     -  
 Java code for DTN Protocol NECTAR evaluation-one simulator     -  
 Client-Server-Data-datagram socket UDP protocol     -  
 Parse URL in java get Protocol,File,Reference,Host and Port     -  
 PC control by mobile Project     -  









Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com