Question

In: Computer Science

Q10. Compare the header of TCP, UDP, and IP packets and explain why are there more...

Q10. Compare the header of TCP, UDP, and IP packets and explain why are there more fields in TCP header than UDP and IP? (10 points)

Solutions

Expert Solution

Hey! My answer is given below...to appreciate my work please give Positive Feedback.............

Introduction :--

TCP :-     

  • The Transmission Control Protocol (TCP) works on the third layer of this protocol model which is the transport layer.
  • TCP is a connection-oriented protocol suite that ensures the delivery of data packet to the next node or destination node by employing a sequence number in each datagram and acknowledgment sessions with each of the communication sessions.
  • This system also ensures secure transmission on each layer for the data packets and thereby provisions the retransmission of data packets unless it reaches a timeout situation or it receives the proper acknowledgment message from the receiver.

UDP :--

  • User Datagram Protocol (UDP) is a Transport Layer protocol. UDP is a part of the Internet Protocol suite, referred to as UDP/IP suite. Unlike TCP, it is an unreliable and connectionless protocol. So, there is no need to establish a connection prior to data transfer.
  • Though Transmission Control Protocol (TCP) is the dominant transport layer protocol used with most of the Internet services; provides assured delivery, reliability, and much more but all these services cost us with additional overhead and latency.
  • Here, UDP comes into the picture. For realtime services like computer gaming, voice or video communication, live conferences; we need UDP. Since high performance is needed, UDP permits packets to be dropped instead of processing delayed packets. There is no error checking in UDP, so it also saves bandwidth.
  • User Datagram Protocol (UDP) is more efficient in terms of both latency and bandwidth.
  • User Datagram Protocol (UDP) works on the transport layer which is the third layer of the TCP/IP protocol suite. In contrast to the TCP protocol, it is a connectionless protocol as it does not establish a connection before sending the data over the network for communication.

IP :--

  • Internet Protocol being a layer-3 protocol (OSI) takes data Segments from layer-4 (Transport) and divides it into packets. IP packet encapsulates data unit received from above layer and add to its own header information.
  • The encapsulated data is referred to as IP Payload. IP header contains all the necessary information to deliver the packet at the other end.
  • IP protocol is one of the main protocols in the TCP/IP stack.
  • It is in the form of IP datagrams that all the TCP, UDP, ICMP and IGMP data travels over the network.
  • IP is connection less and unreliable protocol. It is connection less in the sense that no state related to IP datagrams is maintained either on source or destination side and it is unreliable in the sense that it not guaranteed that an IP datagram will get delivered to the destination or not.
  • If an IP datagram encounters some error at the destination or at some intermediate host (while traveling from source to destination) then the IP datagram is generally discarded and an ICMP error message is sent back to the source.

TCP Header formate:-

The header of a TCP segment can range from 20-60 bytes. 40 bytes are for options. If there are no options, header is of 20 bytes else it can be of upmost 60 bytes.

TCP Header fields:

  • Source Port Address – 16 bit field that holds the port address of the application that is sending the data segment.
  • Destination Port Address – 16 bit field that holds the port address of the application in the host that is receiving the data segment.
  • Sequence Number – 32 bit field that holds the sequence number, i.e, the byte number of the first byte that is sent in that particular segment. It is used to reassemble the message at the receiving end if the segments are received out of order.
  • Acknowledgement Number – 32 bit field that holds the acknowledgement number, i.e, the byte number that the receiver expects to receive next. It is an acknowledgment for the previous bytes being received successfully.
  • Header Length (HLEN) – This is a 4 bit field that indicates the length of the TCP header by number of 4-byte words in the header, i.e, if the header is of 20 bytes(min length of TCP header), then this field will hold 5 (because 5 x 4 = 20) and the maximum length: 60 bytes, then it’ll hold the value 15(because 15 x 4 = 60). Hence, the value of this field is always between 5 and 15.
  • Control flags –These are 6 bit long ,1-bit control bits that control connection establishment, connection termination, connection abortion, flow control, mode of transfer etc. Their function is:
  1. URG: Urgent pointer is valid
  2. ACK: Acknowledgement number is valid( used in case of cumulative acknowledgement)
  3. PSH: Request for push
  4. RST: Reset the connection
  5. SYN: Synchronize sequence numbers
  6. FIN: Terminate the connection
  • Window size – This field tells the window size of the sending TCP in bytes.
  • Checksum – This field holds the checksum for error control. It is mandatory in TCP as opposed to UDP.
  • Urgent pointer – This field (valid only if the URG control flag is set) is used to point to data that is urgently required that needs to reach the receiving process at the earliest.
  • Options:-- This is a variable field. This can be set at the start of any of the octet edge.

UDP Header formate:-


Size of the header is 20 to 60 bytes.

  • UDP header is an 8-bytes fixed and simple header, while for TCP it may vary from 20 bytes to 60 bytes.
  • The first 8 Bytes contains all necessary header information and the remaining part consist of data.
  • UDP port number fields are each 16 bits long, therefore range for port numbers defined from 0 to 65535; port number 0 is reserved. Port numbers help to distinguish different user requests or process.
  1. Source port: This is 16 bits of length. It contains the value of the source port employed by the source end for transferring the data packet. The range lies between 0 to 65535.
  2. Destination port: The size of this field is 16 bits. It contains the port number which the destination host is expecting for receiving data.
  3. Length: This field size is 16 bits. It consists of the length size of the user datagram, header, and data.
  4. Checksum: This is also of 16 bit in size, but this is an optional field. It is used for the computation of the errors in the datagram. If it is set to zero, then checksum is not computed and if set to one then it will be computed.

IP Header formate(IPv4) :-

  1. VERSION: Version of the IP protocol (4 bits), which is 4 for IPv4
  2. HLEN: IP header length (4 bits), which is the number of 32 bit words in the header. The minimum value for this field is 5 and the maximum is 15.
  3. Type of service: Low Delay, High Throughput, Reliability (8 bits)
  4. Total Length: Length of header + Data (16 bits), which has a minimum value 20 bytes and the maximum is 65,535 bytes.
  5. Identification: Unique Packet Id for identifying the group of fragments of a single IP datagram (16 bits)
  6. Flags: 3 flags of 1 bit each : reserved bit (must be zero), do not fragment flag, more fragments flag (same order)
  7. Fragment Offset: Represents the number of Data Bytes ahead of the particular fragment in the particular Datagram. Specified in terms of number of 8 bytes, which has the maximum value of 65,528 bytes.
  8. Time to live: Datagram’s lifetime (8 bits), It prevents the datagram to loop through the network by restricting the number of Hops taken by a Packet before delivering to the Destination.
  9. Protocol: Name of the protocol to which the data is to be passed (8 bits)
  10. Header Checksum: 16 bits header checksum for checking errors in the datagram header
  11. Source IP address: 32 bits IP address of the sender
  12. Destination IP address: 32 bits IP address of the receiver
  13. Option: Optional information such as source route, record route. Used by the Network administrator to check whether a path is working or not.

COMPARISION BETWEEN TCP,IP and UDP Header:-

TCP

UDP

IP

It has header Size is 20 bytes long.

UDP header size is 8 bytes long

Size of the header is 20 to 60 bytes.   
TCP work on transport layer so it has source and destination port of 16 bits long UDP also has source and destination port of 16 bit long because it work on transport layer. IP works on the network layer so it has IP source and destination address. which is virtual address use by network layer.
TCP has 16 fields in header formate. UDP has only 4 field , that make it easy to understand. IP has 13 fields include optional field (option)
TCP provides reliable and connection-oriented data transfer between the source and destination. it has fields such as: sequence no, Acknolegement no, window size and control flag fields. it has no such fields . it provide run unreliable and connectionless data transfer between the source and destination. IP is connection less and unreliable protocol. It is connection less in the sense that no state related to IP datagrams is maintained either on source or destination side and it is unreliable in the sense that it not guaranteed that an IP datagram will get delivered to the destination or not.
it has HLEN field . it has Length field . it has 2 length field HLEN(header) and TOTAL Length(Total length of datagram).
it provide flow control and error correction using checksum field. it is mandatory filed. it doesn't provide flow control and error detection using the checksum field. it is optional filed. it has Header Checksum

it use IP for reliable and connection-oriented data transfer between the source and destination.

it does not use IP packet for data transfer it transfer the data in datagram formate IP use transport protocol such as TCP and UDP for data transfer, for it it has type of service and protocol field.
  • TCP and UDP are both transport layer protocols. TCP is a connection orientated protocol and provides reliable message transfer. UDP is a connection less protocol and does not guarantee message delivery. and
  • IP is connection less and unreliable protocol. It is connection less in the sense that no state related to IP datagrams is maintained either on source or destination side and it is unreliable in the sense that it not guaranteed that an IP datagram will get delivered to the destination or not.
  • so, TCP is a connection orientated protocol with built in error recovery and re transmission.

    You can liken a TCP connection to a telephone connection.

    With a telephone connection you first need to setup the connection by dialing the number, and once the calling party answers you have a both way communications channel.

    You then proceed to speak and once done you hang up the connection.

    With TCP you set up the connection using the 3 way handshake .

  • so, that TCP has more Fields than UDP and IP.

​​​​​​​thanks...........


Related Solutions

Research on TCP, UDP, and IP. And Define TCP, UDP, and IP Compare the header of...
Research on TCP, UDP, and IP. And Define TCP, UDP, and IP Compare the header of TCP, UDP, and IP packets. Why are there more fields in PCP header than UDP and IP?
Compare and contrast TCP and UDP.
Compare and contrast TCP and UDP.
WHAT ARE THE DIFFERENCES BETWEEN TCP/IP AND UDP IN TERMS OF OSI LAYERS AND DEFINITION ITSELF?...
WHAT ARE THE DIFFERENCES BETWEEN TCP/IP AND UDP IN TERMS OF OSI LAYERS AND DEFINITION ITSELF? PLEASE GIVE BREIFE EXPLANATIONS WITH PICTURES AND EXAMPLES WITH EASY ENOUGH TO MEMORIZE AND UNDERSTAND
why the OSI model is important? and compare between TCP/IP and OSI model?
why the OSI model is important? and compare between TCP/IP and OSI model?
List three applications that use UDP and three applications that use TCP and explain why those...
List three applications that use UDP and three applications that use TCP and explain why those applications use the selected Transport layer protocol.
Why is UDP/IP used to transmit and receive packetized voice signals over and IP network and...
Why is UDP/IP used to transmit and receive packetized voice signals over and IP network and not TCP/IP used in VoIP?
1. Explain one aspect of UDP that makes it better than TCP. 2. Explain what is...
1. Explain one aspect of UDP that makes it better than TCP. 2. Explain what is a socket. 3. Explain the difference in demultiplexing between UDP and TCP. 4. Illustrate a system of your choice with Finite State Machine.
In IP, the checksum covers only the header and not the data. Why do you suppose...
In IP, the checksum covers only the header and not the data. Why do you suppose this design was chosen?
1) a) Describe the design principles of the TCP/IP protocol that explain the decentralised nature of...
1) a) Describe the design principles of the TCP/IP protocol that explain the decentralised nature of the Internet and Web. How does the TCP/IP protocol promote decentralisation? b) Explain how individual machines and end users are empowered by the TCP/IP and HTTP protocols. Give illustrations to support your answers.
b) UDP does not provide end to end flow control, but TCP does. Explain how this...
b) UDP does not provide end to end flow control, but TCP does. Explain how this is achieved using sequence numbers. Give an example where a packetized message sent using UDP is received incorrectly, but when using TCP it is received correctly under same circumstances without channel errors.                                                                     
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT