TCP/IP or TCP IP model
This is the most common model used over internet. This protocol suite is used for setup a connection oriented communication over different machines , reachable to each other over network layer (e.g IP). The web servers and web clients uses tcp ip to communicate each other. While sending a http request from browser , first a tcp ip connection is established from web browser to web server then the HTTP data is transferred over TCP IP connection. HTTP layer is the user of TCP layer while IP layer is the service provider for TCP layer.
TCP vs UDP
- TCP is a connection oriented protocol, while udp is connectionless protocol. In tcp a connections is established before sending any data to remote node. A tcp ip connection is identified by a pair of tcp end points. A tcp ip end point is identified by an ip address and tcp port.
- In TCP the ordered delivery is confirmed while in UDP there is no confirmation for ordered delivery.
- In TCP a lost packet is recovered while in UDP its not.
- UDP is fast as compared to TCP.
- TCP is a stream oriented while UDP is packet oriented protocol.
TCP : It's called Transmission Control Protocol, this is a transport layer protocol in OSI model, TCP protocols provides following services to its user.
TCP/IP model have four layers:
- Physical layer
- Data Link Layer
- Network Layer
- Transport Layer
TCP Is A Transport Layer
TCP is an implementation of transport layer in OSI model. The functionality of a transport layer is to deliver full messages from source to destination in sequence and error free. This layer breaks the breaks the messages into packets of size those full fill the MTU or Maximum transfer unit requirements.
Transport Layer(TCP) have following functionalities
- Error Control: TCP assures an error free delivery of message from source to destination. This may happen that one segment of a message has been corrupted or missed. In this case TCP re transmits the missing segment.
- Segmentation and Reassembling: A message is divided into segments; each segment contains sequence number, which enables this layer in reassembling the message. Message is reassembled correctly upon arrival at the destination and replaces packets which were lost in transmission.
- Flow Control: Flow control is used in case where received is slow and sender is fast. In this case TCP uses congestion control mechanism for flow control. TCP uses receives and indication while sending data that no more free buffers are there.
- Connection Less and Connection Oriented Data Transmission: For connection oriented delivery TCP setup a connection before delivering and data to the remote end. While in connection less delivery TCP send data to network layer without setting a connection with peer node.
TCP Connection Setup:
The TCP connection is setup by three way handshake.
- TCP client Sends SYN packet to TCP server.
- TCP Server responds with SYN-ACK to client.
- Client sends ACK to server .
TCP Connection Tear down
Any node (client or server) can initiate a connection close.
Any node can send FIN to other and FIN-ACK is responded by the receiver.
No comments:
Post a Comment