tcp_header Struct Reference
[Transmission Control Protocol (TCP) Service]

Transmission datagram header. More...

#include <tcp_header.h>

Data Fields

uint16_t source_port
 The source port number.
uint16_t destination_port
 The destination port number.
uint32_t sequence_number
 The sequence number of the first data octet in this segment (except when SYN is present).
uint32_t acknowledgement_number
 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.
uint8_t reserved1:4
 Four bits reserved for future use.
uint8_t header_length:4
 The number of 32~bit words in the TCP Header.
uint8_t finalize:1
 No more data from the sender.
uint8_t synchronize:1
 Synchronize the sequence numbers.
uint8_t reset:1
 Reset the connection.
uint8_t push:1
 Push function.
uint8_t acknowledge:1
 Acknowledgment field significant.
uint8_t urgent:1
 Urgent Pointer field significant.
uint8_t reserved2:2
 Two bits reserved for future use.
uint16_t window
 The number of data octets beginning with the one indicated in the acknowledgment field which the sender of this segment is willing to accept.
uint16_t checksum
 The checksum field is the 16~bit one's complement of the one's complement sum of all 16~bit words in the header and text.
uint16_t urgent_pointer
 This field communicates the current value of the urgent pointer as a~positive offset from the sequence number in this segment.

Detailed Description

Transmission datagram header.


Field Documentation

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.

See also:
acknowledge

Referenced by tcp_process_acknowledgement(), and tcp_send_prepare_packet().

The checksum field is the 16~bit one's complement of the one's complement sum of all 16~bit words in the header and text.

If a~segment contains an odd number of header and text octets to be checksummed, the last octet is padded on the right with zeros to form a~16~bit word for checksum purposes. The pad is not transmitted as part of the segment. While computing the checksum, the checksum field itself is replaced with zeros. The checksum also coves a~pseudo header conceptually. The pseudo header conceptually prefixed to the TCP header contains the source address, the destination address, the protocol, and the TCP length. This information gives protection against misrouted datagrams. If the computed checksum is zero, it is transmitted as all ones (the equivalent in one's complement arithmetic).

Referenced by tcp_process_packet(), and tcp_send_prepare_packet().

The destination port number.

Referenced by tcp_process_packet(), and tcp_queue_prepare_packet().

No more data from the sender.

Referenced by tcp_prepare_operation_header(), tcp_process_established(), and tcp_queue_prepare_packet().

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.

Referenced by tcp_prepare_operation_header().

Push function.

Four bits reserved for future use.

Must be zero.

Two bits reserved for future use.

Must be zero.

Reset the connection.

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.

Referenced by tcp_process_established(), tcp_process_listen(), tcp_process_syn_received(), tcp_process_syn_sent(), tcp_queue_prepare_packet(), and tcp_send_prepare_packet().

Synchronize the sequence numbers.

Referenced by tcp_prepare_operation_header(), tcp_process_listen(), and tcp_process_syn_sent().

Urgent Pointer field significant.

See also:
tcp_header:urgent_pointer

This field communicates the current value of the urgent pointer as a~positive offset from the sequence number in this segment.

The urgent pointer points to the sequence number of the octet following the urgent data. This field is only be interpreted in segments with the URG control bit set.

See also:
tcp_header:urgent

The number of data octets beginning with the one indicated in the acknowledgment field which the sender of this segment is willing to accept.

See also:
tcp_header:acknowledge

Referenced by tcp_process_acknowledgement(), tcp_process_listen(), and tcp_send_prepare_packet().


The documentation for this struct was generated from the following file:

Generated on Thu Mar 11 20:48:30 2010 for Networking and TCP/IP stack for HelenOS system by  doxygen 1.6.1