Wednesday, February 27, 2013

TCP and UDP

TCP and UDP

The two most common transport layer protocols of the TCP/IP protocol suite are Transmission Control Protocol (TCP) and User Datagram Protocol (UDP). Both protocols manage the communication of multiple applications. The differences between the two are the specific functions that each protocol implements.

User Datagram Protocol (UDP)

UDP is a simple, connectionless protocol, described in RFC 768. It has the advantage of providing low-overhead data delivery. The segments of communication in UDP are called datagrams. UDP sends datagrams as “best effort.”



Applications that use UDP include

■ Domain Name System (DNS)
■ Video streaming
■ Voice over IP (VoIP)

The Protocols & Port numbers that are using UDP

Trivial File Transfer Protocol (TFTP) : 69
Simple Network Management Protocol (SNMP) : 161 / 162
Dynamic Host Configuration Protocol (DHCP) : 67 / 68
Domain Name Syetem (DNS) : 53










Transmission Control Protocol (TCP)

TCP is a connection-oriented protocol, described in RFC 793. TCP incurs additional overhead to gain functions. Additional functions specified by TCP are same-order delivery, reliable delivery, and flow control. Each TCP segment has 20 bytes of overhead in the header encapsulating the application layer data, whereas each UDP segment has only 8 bytes of overhead.

The following applications use TCP

■ Web browsers
■ E-mail
■ File transfers

The Protocols & Port numbers that are using TCP

File Transfer Protocol (FTP) : 21
Hypertext Transfer Protocol  (HTTP) : 80
Simple Mail Transfer Protocol (SMTP) : 25 / 26
Telnet : 23


















Port Addressing Types and Tools
The Internet Assigned Numbers Authority (IANA) assigns port numbers. IANA is a standards body that is responsible for assigning various addressing standards. The different types of port numbers are :

■ Well-known ports (numbers 0 to 1023)
■ Registered ports (numbers 1024 to 49151)
■ Dynamic or private ports (numbers 49152 to 65535)


The following sections describe the three types of port numbers and examples of when both TCP and UDP might use the same port number. You also learn about the netstat network utility.


Well-Known Ports - 

Well-known ports (numbers 0 to 1023) are reserved for services and applications. They are commonly used for applications such as HTTP (web server), POP3/SMTP (e-mail server), and Telnet. By defining these well-known ports for server applications, client applications can be programmed to request a connection to that specific port and its associated service. Table 4-1 lists some well-known ports for TCP and UDP.


















Registered Ports -
Registered ports (numbers 1024 to 49151) are assigned to user processes or applications. These processes are primarily individual applications that a user has chosen to install rather than common applications that would receive a well-known port. When not used for a server resource, a client can dynamically select a registered port as its source port. Table 4-2 lists registered ports for TCP and UDP.














Dynamic or Private Ports -
Dynamic or private ports (numbers 49152 to 65535), also known as ephemeral ports, are usually assigned dynamically to client applications when initiating a connection. It is not common for a client to connect to a service using dynamic or private ports (although some peer-to-peer file-sharing programs do).

Using Both TCP and UDP - 
Some applications can use both TCP and UDP. For example, the low overhead of UDP enables DNS to serve many client requests very quickly. Sometimes, however, sending the requested information can require the reliability of TCP. In this case, both protocols use the well-known port number of 53 with this service.

Registered and Well-known TCP and UDP common ports 









No comments:

Post a Comment

Google

Back To Top