Subscribe by Email


Showing posts with label TCP. Show all posts
Showing posts with label TCP. Show all posts

Monday, July 1, 2013

What is the difference between TCP and UDP?

TCP (transmission control protocol) and UDP (user datagram protocol) are two very important protocols. These two protocols are transportation protocol.  These two protocols are counted in the core protocols of the IP suite. 
These two protocols operate at the 4th layer i.e., the transport layer of the TCP/ IP model but the usage of the both the protocols is used very differently.

1. Reliability: 
- UDP is a connection-less protocol whereas TCP is a protocol that is connection  oriented. 
- Whenever a message is sent, it will not get delivered if there is a connection failure. 
- If during the delivery of the message the connection gets lost, the server will send a request to get the lost part. 
- During the transfer of a message, there is no corruption. 
- The reliability of the UDP is less and if a message is sent, there is no guarantee that it will get delivered, it may get lost on the way. 
- The message might get corrupted during transfer.

2. Ordered: 
- If at the same time two messages are sent along the same connection, one after the other, it is sure that the message which is the first in the line will get delivered there first. 
- The data is therefore delivered always in the same order. 
- You do not have to worry about the order of the arriving data. 
- In the case of UDP, the order of the arrival of data is not sure. 
- The second one can arrive there first before the first one. 

3. Heavyweight: 
- When the order of arrival of the low level parts of the transmission stream is wrong, the requests have to be sent again and again. 
- All the lost parts of the message have to be put together in a proper sequence. 
- So it takes some time for putting back the parts together. 
- On the other hand, UDP is lightweight.
- After sending the message, the user cannot think about tracking connections or ordering of the messages etc. 
- This indeed makes it lot quicker and therefore there is very less work for the network or the OS card for translating the data obtained from the data packets.

4. Streaming: 
- In TCP, the data is read in form of a stream.
- There is nothing that distinguishes one data from another. 
- Per read call there can be a number of packets. 
- In UDP each of the data packets is sent individually and if they arrive, they do so in whole form. 
- Here per read call, only one packet is sent.

5. Some examples of the TCP are FTP or file transfer protocol, World Wide Web (such as Apache TCP port 80), secure shell such as open SSH port 22 and so on. Examples of UDP are TFTP (trivial file transfer protocol), VoIP (voice over IP), IPTV, online multiplayer games, domain name system (such as DNS UDP port 53) etc.

6. Error-checking: 
- The TCP protocol offers extensive error checking mechanisms for the acknowledgement of the data, flow control and so on. 


In TCP, a connection is a must to be established in order to transfer data. Datagram mode is the mode in which the user data gram protocol operates. You can choose between the two protocols depending up on the requirements. If the guaranteed delivery of data is required, then the transmission control protocol must be chosen. The user data gram protocol comes only with the basic error checking mechanism. It checks the data by the means of the check sums. 


Sunday, March 21, 2010

FTP - File Transfer Protocol

- File Transfer Protocol (FTP), a standard Internet protocol, is the simplest way to exchange files between computers on the Internet.
- FTP is an application protocol that uses the Internets TCP/IP protocols.
- FTP is commonly used to transfer Web page files from their creator to the computer that acts as their server for everyone on the Internet.
- FTP is also commonly used to download programs and other files to your computer from other servers.
- Web browser can also make FTP requests to download programs you select from a Web page.
- FTP can also be used to update (delete, rename, move, and copy) files at a server.
- FTP can be run in active mode or passive mode, which control how the second connection is opened.
- In active mode the client sends the server, the IP address port number, that the client will use for the data connection, and the server opens the connection.
- Passive mode was devised for use where the client is behind a firewall and unable to accept incoming TCP connections.

The objectives of FTP are :
- to promote sharing of files (computer programs and/or data),
- to encourage indirect or implicit (via programs) use of remote computers,
- to shield a user from variations in file storage systems among hosts, and
- to transfer data reliably and efficiently.

Anonymous FTP


Thousands of hosts on the Internet run ftp servers that permit guests to login. Such servers usually contain data and software of interest to the general public. They are often called anonymous ftp servers because the guest login name is anonymous. To login to an anonymous ftp server, enter the name anonymous when prompted for a username or userid. When prompted for a password, enter your full e-mail address, unless the on-screen instructions specify an alternative guest password.


Wednesday, March 10, 2010

The Transport Layer - Layer 4 of OSI model

The Transport Layer of the OSI model is responsible for delivering messages between networked hosts. The Transport Layer should be responsible for fragmentation and reassembly.

- This layer converts the data received from the upper layers into segments and prepares them for transport.
- The Transport layer is responsible for end-to-end (source-to-destination) delivery of entire messages.
- It allows data to be transferred reliably and uses sequencing to make sure that the order of packets is maintained.
- It also provides services such as error checking and flow control.
- In case IP, lost packets arriving out of order must be reordered.
- The size and complexity of a transport protocol depends on the type of service it can get from the network layer.
- The transport layer can accept relatively large messages, but there are strict message size limits imposed by the network (or lower) layer.
- Two transport protocols, Transmission Control Protocol (TCP) and User Datagram Protocol (UDP), sits at the transport layer.
- TCP establishes connections between two hosts on the network through 'sockets' which are determined by the IP address and port number. It keeps a track of the packet delivery order and the packets that must be resent.
- UDP provides a low overhead transmission service, but with less error checking.
- The Transport layer protocols are either connectionless or connection-oriented.
- Connection-oriented means that a connection (a virtual link) must be established before any actual data can be exchanged. e.g. TCP.
- In Connectionless, the sender does not establish a connection before it sends data, it just sends it without guaranteeing delivery. e.g. UDP.

Data Segmentation


Data segmentation is the process by which the transport layer uniquely handles all data passed to and from different upper-level applications. For example, if a user is browsing the web and checking email at the same time, each program would be passing data and waiting for a reply on a unique port number. The Transport layer ensures that data is passed to the correct application.


Wednesday, July 1, 2009

WWW - The Server Side

For all the incoming connectionts from different clients, every website is associated with a server process listening to TCP port 80. The client sends a request after the connection is made and the server sends the reply and then the connection is released. The protocol that is responsible for requests and replies is called HTTP.

The steps that occur between the user clicking and a page being displayed are:
- The browser determines the URL.
- The browser asks DNS for IP address.
- DNS replies.
- Browser makes a TCP connection to the port.
- It then sendsthe GET command.
- The server sends the file.
- The TCP connection is released.
- The browser displays the text of the file.
- The browser fetchesand displays all images of the file.

Not all servers speak HTTP, Old servers use FTP, Gopher or other protocols. Given the number of different protocols, it was thought impractical to make browser understand different protocols. However, since there is a need to make information available (where the server talks in protocols other than HTTP), a solution was required. This solution is something called a proxy server. A proxy server takes a HTTP request from the browser and translates these requests into the FTP/Gopher/other protocols. The proxy server is a separate logical server.
A proxy server also serves to provide an important function called caching. Through caching, a proxy server keeps a local copy of the pages that pass through it. If a user requests for a page, if the page is present on the cache of the proxy server, it serves the page to the user. this way it serves to reduce load on final server.


Facebook activity