26.10.2012 Views

Internet Security - Dang Thanh Binh's Page

Internet Security - Dang Thanh Binh's Page

Internet Security - Dang Thanh Binh's Page

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Bits<br />

IP<br />

header<br />

TCP/IP SUITE AND INTERNET STACK PROTOCOLS 43<br />

TCP<br />

header<br />

20 bytes 20 bytes<br />

IP datagram<br />

TCP segment<br />

TCP<br />

data<br />

Figure 2.10 Encapsulation of TCP data in an IP datagram.<br />

0 4 10 16 24<br />

31<br />

Header<br />

length<br />

(4 bits)<br />

Source port number (16 bits)<br />

Reserved<br />

(6 bits)<br />

Checksum (16 bits)<br />

Sequence number (32 bits)<br />

Acknowledgement number (32 bits)<br />

Code bits<br />

(6 bits)<br />

TCP option (24 bits)<br />

Data<br />

Figure 2.11 TCP packet format.<br />

Destination port number (16 bits)<br />

Window size (16 bits)<br />

Urgent pointer(16 bits)<br />

Padding (8 bits)<br />

sending and receiving application. These two port numbers, along with the source<br />

and destination IP addresses in the IP header, uniquely identify each connection. The<br />

combination of an IP address and a port number is sometimes called a socket. The<br />

socket pair, consisting of the client IP address and port number and the server IP<br />

address and port number, specifies two end points that uniquely identify each TCP<br />

connection in the <strong>Internet</strong>.<br />

• Sequence number (32 bits): This 32-bit sequence field defines the sequence number<br />

assigned to the first byte of data stream contained in this segment. To ensure connectivity,<br />

each byte to be transmitted is numbered. This sequence number identifies the<br />

byte in the data stream from the sending TCP to the receiving TCP. Considering the<br />

stream of bytes following in one direction between two applications, TCP will number<br />

each byte with a sequence number. During connection establishment, each party uses<br />

a random number generator to create an initial sequence number (ISN) that is usually<br />

Header

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!