TCP – Programmerbay https://programmerbay.com A Tech Bay for Tech Savvy Sun, 25 Apr 2021 06:25:46 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.5 https://programmerbay.com/wp-content/uploads/2019/09/cropped-without-transparent-32x32.jpg TCP – Programmerbay https://programmerbay.com 32 32 Difference Between TCP and UDP in Tabular form https://programmerbay.com/difference-between-tcp-and-udp-in-tabular-form/ https://programmerbay.com/difference-between-tcp-and-udp-in-tabular-form/#respond Tue, 31 Mar 2020 15:46:26 +0000 https://www.programmerbay.com/?p=2655 Both UDP and TCP are transport layer protocols. The main difference between TCP and UDP is, TCP is a connection-oriented protocol, whereas UDP is connection-less. In other words, TCP needs to establish a connection prior to data transfer whereas UDP doesn’t.

Difference between TCP and UDP

What is Transport Layer?

TCP and UDP both are the protocols used in Transport layer that facilitates data exchange between source and destination host.

Transport layer enables multiple applications to use single dedicated network connections simultaneously and responsible for transmitting messages over the network .

It generates ports in order to allow applications running on the system to use them to connect themselves.

How does Transport Layer work?

When an application sitting at application layer sends a message to other host on the network, the message is handed over to transport layer where that particular message or data wrap inside a segment which consists additional information such as source and destination. After a segment is created, it is passed on to the network layer for further processing.

At the receiver end, the segment is accepted by the network layer and further delivered to the transport layer.

In the Transport layer, the actual message is unpacked and passed to respective application port specified in the segment.

Difference between TCP and UDP in Tabular form:

BasisTCPUDP
DefinitionIt establishes and maintain a dedicated connection before data transmission between hostsit doesn't require to establish and maintain any dedicated connection prior to data transmission between hosts
Full formTransmission Control ProtocolUser Datagram Protocol
Connection typeConnection-oriented protocolConnection-less protocol
Header Size20 Bytes8 Bytes
Congestion controlIt delays the data transmission when the network is congested which minimises the packet lossDon't support congestion control
OverheadInvolves high overhead such as acknowledgement, data retransmission and moreInvolves low overhead
Delivery acknowledgementWhen data packet is sent to destination host, it response back with an acknowledgement that is, it has received that dataNo such feature is exist in this protocol
Packet retansmissionWhen no acknowledgement is received within a specific time period, it assumes packets are lost and resend them againNo such feature is exist in this protocol
Conceptually Known asSteam-orientedmessage-oriented
OrderingSegment are numbered as a result it is received at destination in same sequence in which they are sentMessage sequence is not maintained
SpeedSlow Fast
ReliabilityIt is reliableIt is not reliable
Connection EstablishmentConnection must be established. It uses 3 way Handshake to achieve thisData is sent without connection establishment
Also refer toHeavy-weight protocolLight-weight protocol
Packet drop rateVery LowHigh
Error Control MechanismChecksum, Acknowledgement, RetransmissionChecksum . However, it is not mandatory
Flow controlSliding window is used for flow controlNo such feature is exist in this protocol
Used byHTTP,SMTP and FTP are some examplesDNS and VoIP are some examples
Suitable forApplications that require high reliability, and transmission time can be compromisedApplications that require timely data transmission and reliability or packet drops can be compromised

TCP (Transmission Control Protocol )

Transmission Control Protocol is more reliable than UDP. It is a connection-oriented protocol that means it establishes and maintains a dedicated connection before data transmission.

This process is called 3-way handshake.
-> Makes a request to a server for connection setup
-> Server responses back to the client and when the client receives the response
-> Client sends the packet to server that acknowledges that connection has been established.

For closing the connection, it follows a similar procedure.

TCP is steam-oriented which means that an application sends data in a continuous flow of data and it doesn’t have control on data splitting. for example, Phone calls.

Segment enclosing the data are numbered, therefore, TCP assures the sequence of messages or data must be delivered in the correct order to the destination host.

TCP supports several features. Some of these are :

Delivery acknowledgement:- When a data packet is sent to the destination host, it responds back with an acknowledgement that is, it has received that data.

Packet retransmission: When a sender doesn’t receive a delivery acknowledgement within a certain amount of time, it assumes that the packet is lost and send the packets again.

Congestion control: It delays the data transmission when the network is congested which minimises the packet loss.

Drawbacks of using TCP

  • It uses a bigger header of 20 bytes
  • It doesn’t send out immediately which delays the transmission
  • It involves high overhead such as acknowledgement, data retransmission and more.

UDP( User Datagram Protocol )

UDP has a smaller packet size than the TCP, having header size 8 bytes.It is a connection-less protocol which means it doesn’t require to establish and maintain any dedicated connection prior to data transmission.

It provides more control over the way in which data should be sent.

However, data corruption is common on a network, UDP uses a primitive form of error detection which is backed with checksum but this technique is not reliable. Therefore, it is difficult to recover data even after error detection.

It sends data once only and therefore, any loss of data is not counted. It also doesn’t guarantee in which order packed would be delivered, meaning it is not necessary to receive data in the same order as it sent from the source.

There is also no congestion control in UDP, meaning no matter how busy the network is, it would send data continuously, that triggers packet drops.

UDP is lightweight but not reliable. It is message-oriented which means application send their data on distinct chunks, such as email.

Key Differences:

  1. TCP stands for Transmission Control Protocol, whereas; UDP stands for User Datagram Protocol.
  2. TCP is connection-oriented, whereas; UDP is a kind of type of protocol which is connection-less or datagram oriented.
  3. In TCP, there is a primary requirement for setting up the connection between the sender and the receiver and then only the transmission of data is proceeded, while, in UDP protocol, a broadcast mechanism is used for transmitting information, result in the requirement of establishing the connection between the sender and receiver is not needed.
  4. In TCP protocol when it comes to reliability, the TCP protocol gives cent percent guarantee of delivering the data to its respective destination, whereas; in UDP protocol as there is no connection maintained.
  5. In TCP protocol when it comes to error checking, the TCP protocol provides a full-fledged set of advanced error checking methods and mechanisms, whereas; in UDP protocol the error checking is very nominal and reduced to a minimum and basic error checking methods and mechanisms.
  6. TCP protocol transmits the data in the proper order, whereas; in UDP protocol the data is not sequenced.
  7. The TCP protocol is feature loaded and very secure which makes it very heavyweight, whereas, the UDP protocol has minimal features which make it very lightweight.
  8. In TCP protocol, there is a header size of about 20 bytes, whereas; in UDP protocol, there is a header size of about 8 bytes.

]]>
https://programmerbay.com/difference-between-tcp-and-udp-in-tabular-form/feed/ 0
Difference Between TCP/IP And OSI Model in Tabular form https://programmerbay.com/difference-between-tcp-ip-and-osi-model/ https://programmerbay.com/difference-between-tcp-ip-and-osi-model/#respond Sat, 08 Feb 2020 16:57:54 +0000 https://www.programmerbay.com/?p=2528 Both TCP/IP Model and OSI Reference Model have layered architecture and also their functionality almost look similar.

The main difference between them is, OSI reference model provides clear distinction between services,interface and protocols, whereas, TCP/IP doesn’t able to differentiate between them.

Difference between TCP/IP And OSI Reference Model in Tabular form

BasisTCP/IP ModelOSI Reference Model
Full formStands for Transmission Control Protocol/Internet ProtocolOpen Systems Interconnection Reference Model
DefinitionIt defines standardised rules that enables network communication between computer as the internetIt facilitates open communication systems to communicate using Standard Protocols
Number of LayersTCP/IP model has 4 layers, namely: Application layer Transport layer Internet layer Network access layerOSI model has 7 layers, namely: Application layer Presentation layer m,Session layer, Transport layer, Network layer, Data link layer, Physical layer
Developed byTCP/IP model was developed by DoD (Department of Defence)OSI model was developed by ISO (International Standard Organisation)
Approach followHorizontal approachVertical approach
Transport layerBoth Connection-oriented and Connection-less Connection-oriented
DifferentiationDoesn't differentiate between services,interface and protocolsDifferentiates between services,interface and protocols
Upper Layer definitionApplication Layer is corresponds to Application, Presentation and Session Layer of OSI ModelIt is separately defined
ReliabilityMoreLess
Packet delivery by Transport LayerDoesn't guarantee data packet delivery Guarantees data packet delivery
UsageUse in computer networkNo longer in use
Routing protocols and standards definitionInternet LayerNetwork Layer
Stability and RestrictionsDon't have strict boundaries and is more stableStrict boundaries and is less stable

TCP/IP Model

TCP/IP model is older than OSI model and consists 4 layer initially ,later on one more layer were added.

It defines standardised rules that enables network communication between computer as the internet.

These are the layers :-

tcp ip

  • Application Layer

It corresponds to Application, Presentation and Session Layer of OSI Model. It contains all the high-level protocols. It provides various services to perform user activities ranging from file transfer to internet surfing.

It consists of HTTP, SMTP, FTP protocols and more.

  • Transport Layer

It ensures reliable transmission of data that is sent between hosts in the form of datagrams. It supports flow control and error control to make sure data is received at destination host reliably and correctly.

TCP(Transmission Control Protocol) and UDP(User Datagram Protocol) are protocols used in this layer.

  • Internet Layer

It is responsible for transmitting data packets between hosts on a network. It routes independent data packets to correct host. It uses IP(Internet Protocol), ICMP (Internet Control Message Protocol) and ARP ( Address Resolution) protocol to achieve its function.

  • Link Layer

It is a combination of the Data Link layer and Physical layer of OSI Model. It acts as an interface between transmission links and hosts. It uses a physical address to find hosts and send data.

OSI Reference Model

OSI Model stands for Open System Interconnection reference model which was developed by ISO. It facilitates open communication systems to communicate using Standard Protocols.

It is not a network architecture as it only states what a layer should do, but not describes the exact services and protocol to be used in each layer.

It follows certain principles on the basis of which it came to the decision of having 7 layers. Each and every layer has its own separate functionality.

These are the following 7 layers in OSI model :-

OSI Model

  • Application Layer

It is the only layer that communicates with users for data directly. Network applications such as Skype, Chrome and other applications work in this layer.

They use application layer protocols such as HTTP, SMTP, FTP, POP3 to function. Application layer provides various services to perform user activities ranging from file transfer to internet surfing.

  • Presentation Layer

It accepts data from the application layer in the form of a sequence of numbers or characters and transforms it into a machine-understandable form which is binary data (10101010).

After that, data compression is used to reduce the size of the data before handing it over to the next layer. It accelerates the data transmission speed and therefore, it helps in case of video calls.

Lastly, data encryption is used to encrypt data in order to maximise the integrity and security. It secures the transmitting data from intruders.

SSL protocol is one of the protocols used in this layer

Objective Highlights

    • Data Translation
    • Data Compression
    • Data Encryption
  • Session layers

It establishes, maintains, manages, and terminates connection or sessions between hosts. It uses various APIs (Application Programming Interface) to connect computers.

When a client requests for connection setup, the server uses authentication and authorisation before allowing the client to use its resources. Authentication can be defined as a process of identifying a user.

The authorisation is a process of identifying the access rights of a user, deciding what resources are allowed to access. Session layer also keeps track of which data packets belong to which file.

Objective Highlights

    • Session Establishment
    • Session Management
    • Session Termination
  • Transport Layer

It ensures communication reliability by performing segmentation, error control and flow control.

It accepts data from the session layer and divides it into various segments and each segment consists of the information of the source, destination port number and sequence number. This is known as segmentation.

Port number is used to deliver the data to correct application, whereas the sequence number is used to put the data into the correct sequence.

Further, flow control handles the amount or size of data to be transmitted. Error control comes handy when a data packets are dropped in between transmission & not reached to the destination, then using various techniques, it retransmits data again. It also uses a checksum to identify the received corrupted segment.

TCP (Transmission Control Protocol) and UDP (User Datagram Protocol) are the protocols used in this layer.

Objective Highlights

    • Data Segmentation
    • Error Control
    • Flow Control
  • Network Layer

This layer is responsible for transmitting received data segments from source host to destination host over a network.

It performs functions like logical addressing, routing and path determination. In this, each data unit is referred as data packets.

IP addressing done in this layer is called logical addressing. Each computer has an IP address to get uniquely identified on a network.

It assigns sender’s and receiver’s address to each segment, so, that they can reach at correct destination. Furthermore,
routing is also used to find an efficient and effective path from source to destination.

Lastly, path determination can be defined as a technique to select the best path for data delivery. OSPF, BGP, IS-IS are some protocols used in this layer.

Objective Highlights

    • Logical Addressing
    • Routing
    • Path Determination
  • Data Link Layer

It accepts data from the network layer. It performs physical addressing that is used to assign MAC address of sender and receiver host to received data packets to form a frame.

It also ensures the data transmission from one node to other must be error-free. It also takes care of the problem of controlling access to the shared channel using a sublayer called medium access control.

  • Physical Layer

It converts data received from the data link layer to bitstream and is responsible for actual connectivity between the devices.

It involves physical equipment ranging from cables to switches for data transfer.

]]>
https://programmerbay.com/difference-between-tcp-ip-and-osi-model/feed/ 0