TCP Header & UDP Header
TCP Header & UDP Header
TCP Header
Transmission Control Protocol
Its protocol number is 6
Reliable and connection oriented
Source Port Source field is a 16 bit filed. It is identifies the port of the sending Application
ports. Port Number from services request sent.
Destination port Destination Port is a 16 bit filed. It is identified the port of the receiving
application. Port number which is used to identify service requested by user.
Sequence Number It is not only used to rearrange the data in correct order but also carry
the size of data inside the segments. It is also used for retransmission if any segment is lost.
R1 R2
10.0.0.1 10.0.0.2
SYN (Seq=0) +ACK (Seq=1) (MSS = 1460, WIN= 4128, LEN=0) ---------
---------ACK (Seq =1) (WIN= 4128, LEN=0)
Last Seq=1
ACK = (Seq) 1
Last Seq =1
Next Seq= 13
Last seq = 13
Last seq = 16
Acknowledgement Number
a) Acknowledgement num is 32 bit field.
b) It tells the sender to send the next data with this sequence number.
c) It is always sequence number of the last received data bytes increment by 1.
Reserved Bits
b) ACK bit
i) If bit is 1the packet is an acknowledgement packet.
ii) If bit is 0the packet is not acknowledge packet.
d) RST Bit
RST bit is used to reset the TCP Connection
Denying a connection
o When Destination port for which service is required is not
available.
Aborting a connection
o Due to abnormal situation
Terminating a connection
o Idle
When RST bit is set to 1.
For these cases flag will be 1(set)
Otherwise flag will be ZERO
When URG flag is set (1). It indicate that URGENT data has to send immediately to wire from
sender side and on receiving and the urgent data has to be sent immediately to application.
Urgent Pointer in TCP segment is used to indicate that amount of urgent data present in TCP
segment.
Multiplexing
o Many to One
De-multiplexing
o One too many
Option
o 0 to 40 bytes
o NOP = No operation
o EOP = End of operation
o MSS = Maximum segment Size
Size in option field is 4 bytes
Kind ( 1 bytes) = which tcp option is being used
Length ( 1 bytes) = length of this field
MSS ( 2 bytes)
Maximum amount of data that can be encapsulated with TCP header.
Maximum size of segment = 1460 bytes ( data)
R2(config-if)#ip tcp adjust-mss
o <500-1460> Maximum segment size in bytes
R2(config)#ip tcp mss
o <68-10000> MSS
If any device will not negotiate mss each other they will use default mss 536
bytes.
o Window scaling
3 bytes
o Time stamp
10 bytes
o S ACK
2 bytes
o S Ack permitted
UDP
TCP UDP
Reliable Protocol Unreliable Protocol
Connection Oriented Connection less Protocol
Flow control is supported No flow control is supported
Only unicast transmission is supported It support multicast , unicast and broadcast
Http , HTTPS , telnet , SSH , FTP Tftp , dns , dhcp