TCP and Udp
TCP and Udp
Prepared by:
1) 140370107072- Kruti Niranjan
2) 140370107089- Nayana Modhawadiya
Introduction
TCP- Transmission Control Protocol
• TCP is a connection oriented services ,widely used
transport layer protocol
• TCP provides process to process, full duplex .
URG - It indicates that Urgent Pointer field has significant data and
should be processed.
ACK - It indicates that Acknowledgement field has significance. If ACK
is cleared to 0, it indicates that packet does not contain acknowledgement.
PSH - When set, it is a request to the receiving station to PUSH data (as
soon as it comes) to the receiving application without buffering it.
RST - It is used to restart a connection.
SYN - This flag is used to set up a connection between hosts.
FIN - This flag is used to release a connection and no more data is
exchanged thereafter. Because packets with SYN and FIN flags have
sequence numbers, they are processed in correct order.
8. Windows Size - This field is used for flow control between two stations
and indicates the amount of buffer (in bytes) the receiver has allocated for
a segment, i.e. how much data is the receiver expecting.
9. Checksum - This field contains the checksum of Header, Data and Pseudo
Headers.
10. Urgent Pointer - It points to the urgent data byte if URG flag
is set to 1.
11. Options - It facilitates additional options which are not covered by the
regular header. Option field is always described in 32-bit words. If this
field contains data less than 32-bit, padding is used to cover the remaining
bits to reach 32-bit boundary.
UDP-User Datagram Protocol
• Transport Layer protocol
• Connectionless
• Unreliable i.e. Best Effort service
• no handshaking between UDP sender, receiver
• each UDP segment handled independently of others
• UDP segments may be:
– lost
– delivered out of order
Proc Proc
UDP UDP
IP IP IP
IP
IP
UDP Header format
Description of field
1. Source Port - This 16 bits information is used to identify the
source port of the packet.
2. Destination Port - This 16 bits information, is used identify
application level service on destination machine.
3. Length - Length field specifies the entire length of UDP packet
(including header). It is 16-bits field and minimum value is 8-
byte, i.e. the size of UDP header itself
4. Checksum - This field stores the checksum value generated by
the sender before sending. IPv4 has this field as optional so
when checksum field does not contain any value it is made 0
and all its bits are set to zero.
TCP Vs. UDP
No. TCP UDP