April 08, 2018

TCP, UDP header

TCP header
<TCP header>

FieldDescription
Source port
Destination port
The port number.
SEQ(Sequence number)
ACK(Acknowledgement number)
The value for arranging the segments. It implements reliable data transmission.
* First SEQ = arbitrary value.
* SEQ = received ACK
* ACK = received SEQ + received data size(If data is 0, +1)
Header lengthHeader length divided by 4.
* Generally 5.
TCP flagsThe property of a segment.
* N(NS. Nonce Sume) : The flag to protect CWR, ECE field from concealment.
* C(CWR. Congestion Window Reduced) : The flag notify that the sender has received an ECE flag. It reduce the window size of the sender.
* E(ECE. ECN-Echo) : (SYN=0)The flag to request reducing the window size of sender due to network congestion. (SYN=1)The flag to notify the fact that the receiver use ECN.
* U(URG) : The flag to notify urgent Data.
* A(ACK) : The flag to notify data reception.
* P(PSH) : The flag notify that transmission data will be transmitted immediately without storing in the buffer.
* R(RST) : The flags requesting connection re-establishment.
* S(SYN) : The flag to notify connection establishment.
* F(FIN) : The flag to notify disconnection.
Window sizeThe buffer size that the system can send/receive. It is related to flow control congestion control.
* Flow control : control considering the buffer size notified by the sender.
* Congestion control : control considering network congestion.
ChecksumThe checksum value for checking error of TCP header and the payload.
Urgent pointerThe value that indicates the starting point of the emergency data.
* The urgent pointer is needed, because the emergency data is mixed with ordinary data.




UDP header
<UDP header>

FieldDescription
Source port
Destination port
The port number.
LengthWhole segment size. UDP header size + Payload size.
ChecksumThe checksum value for checking error of UDP header and the payload.