Multiplexing Using TCP Port Numbers

TCP provides a lot of features to applications, at the expense of requiring slightly more processing and overhead, as compared to UDP. However, TCP and UDP both use a concept called multiplexing. So, this section begins with an explanation of multiplexing with TCP and UDP. Afterward, the unique features of TCP and UDP are explored.

Multiplexing by TCP and UDP involves the process of how a computer thinks when receiving data. The computer might be running many applications, such as a web browser, an e-mail package, or an FTP client. TCP and UDP multiplexing enables the receiving computer to know which application to give the data to.

Some examples will help make the need for multiplexing obvious. The sample network consists of two PCs, labeled Hannah and Jessie. Hannah uses an application that she wrote to send advertisements that display on Jessie's screen. The application sends a new ad to Jessie every 10 seconds. Hannah uses a second application, a wire-transfer application, to send Jessie some money. Finally, Hannah uses a web browser to access the web server that runs on Jessie's PC. The ad application and wire-transfer application are imaginary, just for this example. The web application works just like it would in real life.

Figure 6-2 shows a figure of the example network, with Jessie running three applications:

■ A UDP-based ad application

■ A TCP-based wire-transfer application

■ A TCP web server application

Figure 6-2 Hannah Sending Packets to Jessie, with Three Applications Hannah

Web Server

-' Ad Application

Wire Application

Jessie [

Jessie [

I Received Three Packets, Each from the Same MAC and IP Address. What Application Should Get the Data in Each Packet?

Eth

IP

UDP

Ad Data

Wire

Eth

IP

TCP

Transfer Data

Eth

Eth

IP

TCP

Web Page Data

Eth

Jessie needs to know which application to give the data to, but all three packets are from the same Ethernet and IP address. You might think that Jessie could look at whether the packet contains a UDP or a TCP header, but, as you see in the figure, two applications (wire transfer and web) both are using TCP.

TCP and UDP solve this problem by using a port number field in the TCP or UDP header, respectively. Each of Hannah's TCP and UDP segments uses a different destination port number so that Jessie knows which application to give the data to. Figure 6-3 shows an example.

Multiplexing relies on the use of a concept called a socket. A socket consists of three things: an IP address, a transport protocol, and a port number. So, for a web server application on Jessie, the socket would be (10.1.1.2, TCP, port 80) because, by default, web servers use the well-known port 80. When Hannah's web browser connected to the web server, Hannah used a socket as well—possibly one like this: (10.1.1.1, TCP, 1030). Why 1030? Well, Hannah just needs a port number that is unique on Hannah, so Hannah saw that port 1030 was available and used it. In fact, hosts typically allocate dynamic port numbers starting at 1024 because the ports below 1024 are reserved for well-known applications, such as web services.

Figure 6-3 Hannah Sending Packets to Jessie, with Three Applications Using Port Numbers to Multiplex

Hannah

Hannah

Port 80 Web Server Port 800 Ad Server Port 20,100 Wire Application

Port 80 Web Server Port 800 Ad Server Port 20,100 Wire Application

Jessie f fifi

I'll Look in the UDP or TCP Destination Port to Identify the Application!

Eth

IP

UDP

Ad Data

Eth

Destination Port 800

Wire

Eth

IP

TCP

Transfer Data

Eth

Destination Port 20,100

Eth

IP

TCP

Web Page Data

Eth

Destination Port 80

Destination Port 80

In Figure 6-3, Hannah and Jessie used three applications at the same time—hence, there were three socket connections open. Because a socket on a single computer should be unique, a connection between two sockets should identify a unique connection between two computers. The fact that each connection between two sockets is unique means that you can use multiple applications at the same time, talking to applications running on the same or different computers; multiplexing, based on sockets, ensures that the data is delivered to the correct applications. Figure 6-4 shows the three socket connections between Hannah and Jessie.

Figure 6-4 Connections Between Sockets

Hannah

Jessie

Jessie

Cvc Port Port

Port numbers are a vital part of the socket concept. Well-known port numbers are used by servers; other port numbers are used by clients. Applications that provide a service, such as FTP, Telnet, and web servers, open a socket using a well-known port and listen for connection requests. Because these connection requests from clients are required to include both the source and the destination port numbers, the port numbers used by the servers must be well known. Therefore, each server has a hard-coded, well-known port number, as defined in the well-known numbers RFC.

On client machines, where the requests originate, any unused port number can be allocated. The result is that each client on the same host uses a different port number, but a server uses the same port number for all connections. For example, 100 Telnet clients on the same host computer would each use a different port number, but the Telnet server with 100 clients connected to it would have only 1 socket and, therefore, only 1 port number. The combination of source and destination sockets allows all participating hosts to distinguish between the source and destination of the data. (Look to www.rfc-editor.org to find RFCs such as the well-known numbers RFC 1700.)

NOTE You can find all RFCs online at www.isi.edu/in-notes/rfcxxxx.txt, where xxxx is the number of the RFC. If you do not know the number of the RFC, you can try searching by topic at www.rfc-editor.org/cgi-bin/rfcsearch.html.

Popular TCP/IP Applications

Throughout your preparation for the CCNA INTRO and ICND exams, you will come across a variety of TCP/IP applications. You should at least be aware of some of the applications that can be used to help manage and control a network.

The World Wide Web (WWW) application exists through web browsers accessing the content available on web servers, as mentioned earlier. While often thought of as an end-user application, you can actually use WWW to manage a router or switch by enabling a web server function in the router or switch, and using a browser to access the router or switch.

The Domain Name System (DNS) allows users to use names to refer to computers, with DNS being used to find the corresponding IP addresses. DNS also uses a client/server model, with DNS servers being controlled by networking personnel, and DNS client functions being part of most any device that uses TCP/IP today. The client simply asks the DNS server to supply the IP address that corresponds to a given name.

Simple Network Management Protocol (SNMP) is an application layer protocol used specifically for network device management. For instance, the Cisco Works network management software product can be used to query, compile, store, and display information about the operation of a network. In order to query the network devices, Cisco Works uses SNMP protocols.

Traditionally, in order to move files to and from a router or switch, Cisco used Trivial File Transfer Protocol (TFTP). TFTP defines a protocol for basic file transfer - hence the word "trivial" to start the name of the application. Alternately, routers and switches can use File Transfer Protocol (FTP), which is a much more functional protocol, for transferring files. Both work well for moving files into and out of Cisco devices. FTP allows many more features, making it a good choice for the general end-user population, whereas TFTP client and server applications are very simple, making them good tools as imbedded parts of networking devices.

Some of these applications use TCP, and some use UDP. As you will read later, TCP performs error recovery, whereas UDP does not. For instance, Simple Mail Transport Protocol (SMTP) and Post Office Protocol version 3 (POP3), both used for transferring mail, require guaranteed delivery, so they use TCP. Regardless of which transport layer protocol is used, applications use a well-known port number, so that clients know to which port to attempt to connect. Table 6-3 lists several popular applications and their well-known port numbers.

Readers' Questions

  • johanna
    Which of the following are valid port numbers in tcp/ip?
    7 months ago
    1. 21
    2. 80
    3. 443
    4. 1024
    5. 49152
    6. 65535All of the above are valid port numbers in TCP/IP.
    • Nob
      What two applications are an example of a mail server and a mail client application, respectively?
      7 months ago
    • Mail Server: Microsoft Exchange, Postfix Mail Client: Outlook, Thunderbird
      • abdullah nuguse
        What wellknown tcp port is utilized by the smtp service?
        7 months ago
      • TCP port 25 is typically used for SMTP.
        • pamphila
          What are the two standard ports used by ftp along with their function?
          7 months ago
        • The two standard ports used by FTP are Port 20 and Port 21. Port 20 (Data Port): This port is used for FTP data transfers. Port 21 (Control Port): This port is used for FTP control commands. It is used to establish a connection between the server and the client.
          • jennifer miller
            What is the packet called where a web browser sends a request to the web server for web page data?
            7 months ago
          • The packet is called an HTTP request.
            • Marco
              Which of the following is most similar to a tcp port number?
              7 months ago
            • An UDP port number
              • jan
                Which of the following port number is allocated for pop3?
                8 months ago
              • The port number for POP3 is port 110.
                • callisto
                  What is a characteristic of a tcp server process?
                  8 months ago
                • A characteristic of a TCP server process is that it constantly listens for incoming connections from clients on a port, and when a connection is established, it reads from and writes to the client.
                  • Demsas Goytiom
                    What are multiplexer ports?
                    1 year ago
                  • A multiplexer port is a port that has multiple inputs and multiple outputs and is used to combine multiple signals simultaneously. It is a device that combines one or more digital or analog signals into one signal. The output of the multiplexer is usually a single, composite signal. Multiplexers are commonly used to switch between several data streams in a single system.
                    • shona douglas
                      How multiplexing is used in tcp function?
                      1 year ago
                    • Multiplexing is the process of combining multiple data flows into a single data flow. In TCP, multiplexing is used to create multiple connections from a single port by assigning each connection a different application layer (layer 4) port number. This allows multiple network applications or services to use the same transport layer protocol simultaneously. For example, a web server can use multiple ports to handle incoming HTTP requests from multiple clients.
                      • FELIX
                        How to connected the port in multiplexer?
                        1 year ago
                      • To connect a port to a multiplexer, you need to first determine which type of multiplexer you are using and the type of input/output ports. Then you need to connect the input/output ports to the appropriate inputs/outputs on the multiplexer. Depending on your specific multiplexer type, you may need to use an adapter, such as an 8P8C modular connector, RJ45 connector, or a terminal block. Once the ports and multiplexer are connected, you can configure the multiplexer to route data between the connected ports.
                        • nicla romano
                          What is the use of multiplexing in ports?
                          1 year ago
                        • Multiplexing is a method of combining multiple signals into a single signal for transmission. This allows for the efficient use of a single port to send and receive multiple signals, such as Ethernet, serial, and digital audio. Instead of having multiple ports to send different types of information, multiplexing allows a single port to carry multiple signals at the same time. This allows for more efficient use of network bandwidth and reduces the cost of hardware needed for a network.

                          Disclosure: Some of the links above are affiliate links. This means that, at zero cost to you, I will earn an affiliate commission if you click through the link and finalize a purchase.

                          Table 6-3 Popular Applications and Their Well-Known Port Numbers

                          Port Number

                          Protocol

                          Application

                          20

                          TCP

                          FTP data

                          21

                          TCP

                          FTP control

                          23

                          TCP

                          Telnet

                          25

                          TCP

                          SMTP

                          53

                          UDP, TCP

                          DNS

                          67, 68

                          UDP

                          DHCP

                          69

                          UDP

                          TFTP

                          80

                          TCP

                          HTTP (WWW)

                          110

                          TCP

                          POP3

                          161

                          UDP

                          SNMP

                          Continue reading here: Error Recovery Reliability

                          Was this article helpful?

                          +8 -5