JavaScript Editor Source code editor     Website development 



Main Page

Previous Section Next Section

Transport Layer Concepts

Before moving to a more detailed discussion of TCP and UDP, it is worth pausing for a moment to focus on a few of the important concepts:

  • Connection-oriented and connectionless protocols

  • Ports and sockets

  • Multiplexing

These important concepts are essential to understanding the design of the Transport layer. You'll learn about these concepts in the following sections.

Connection-Oriented and Connectionless Protocols

To provide the appropriate level of quality assurance for any given situation, developers have come up with two alternative network protocol archetypes:

  • A connection-oriented protocol establishes and maintains a connection between communicating computers and monitors the state of that connection over the course of the transmission. In other words, each package of data sent across the network receives an acknowledgment, and the sending machine records status information to ensure that each package is received without errors, retransmitting the data if necessary. At the end of the transmission, the sending and receiving computers gracefully close the connection.

  • A connectionless protocol sends a one-way datagram to the destination and doesn't worry about officially notifying the destination machine that data is on the way. The destination machine receives the data and doesn't worry about returning status information to the source computer.

Figure 6.1 shows two people demonstrating connection-oriented communication. Of course, they are not intended to show the true complexity of digital communications but simply to illustrate the concept of a connection-oriented protocol.

Figure 6.1. A connection-oriented protocol.

graphics/06fig01.gif

Figure 6.2 shows how the same data would be sent using a connectionless protocol.

Figure 6.2. A connectionless protocol.

graphics/06fig02.gif

Ports and Sockets

The Transport layer serves as an interface between network applications and the network and provides a method for addressing network data to particular applications. In the TCP/IP system, applications can address data through either the TCP or UDP protocol module using port numbers. A port is a predefined internal address that serves as a pathway from the application to the Transport layer or from the Transport layer to the application (see Figure 6.3). For instance, a client computer typically contacts a server's FTP application through TCP port 21.

Figure 6.3. A port address targets data to a particular application.

graphics/06fig03.gif

A closer look at the Transport layer's application-specific addressing scheme reveals that TCP and UDP data is actually addressed to what is called a socket. A socket is an address formed by concatenating the IP address and the port number. For instance, the socket number 111.121.131.141.21 refers to port 21 on the computer with the IP address 111.121.131.141.

Figure 6.4 shows how computers using TCP exchange socket information when they form a connection.

Figure 6.4. Exchanging the source and destination socket numbers.

graphics/06fig04.gif

The following is an example of how a computer accesses an application on a destination machine through a socket:

  1. Computer A initiates a connection to an application on Computer B through a well-known port. A well-known port is a port number that is assigned to a specific application by ICANN. See Tables 6.1 and 6.2 for lists of some well-known TCP and UDP ports. Combined with the IP address, the well-known port becomes the destination socket address for Computer A. The request includes a data field telling Computer B which socket number to use when sending back information to Computer A. This is Computer A's source socket address.

  2. Computer B receives the request from Computer A through the well-known port and directs a response to the socket listed as Computer A's source address. This socket becomes the destination address for messages sent from the application on Computer B to the application on Computer A.

You'll learn more about how to initiate a TCP connection later in this hour.

Table 6.1. Well-Known TCP Ports

Service

TCP Port Number

Brief Description

tcpmux

1

TCP port service multiplexor

compressnet

2

Management utility

compressnet

3

Compression utility

echo

7

Echo

discard

9

Discard or null

systat

11

Users

daytime

13

Daytime

netstat

15

Network status

qotd

17

Quote of the Day

chargen

19

Character generator

ftp-data

20

File Transfer Protocol data

ftp

21

File Transfer Protocol control

telnet

23

Terminal network connection

smtp

25

Simple Mail Transport Protocol

nsw-fe

27

NSW user system

time

37

Time server

name

42

Host name server

domain

53

Domain name server (DNS)

nameserver

53

Domain name server (DNS)

DHCP

67

Dynamic Host Configuration Protocol

gopher

70

Gopher service

rje

77

Remote job entry

finger

79

Finger

http

80

WWW service

link

87

TTY link

supdup

95

SUPDUP protocol

hostnames

101

sri-nic host name server

iso-tsap

102

ISO-TSAP

x400

103

X.400 mail service

x400-snd

104

X.400 mail send

pop

109

Post Office Protocol

pop2

109

Post Office Protocol 2

pop3

110

Post Office Protocol 3

portmap

111

 

sunrpc

111

SUN RPC service

auth

113

Authentication service

sftp

115

Secure FTP

path

117

UUCP path service

uucp-path

117

UUCP path service

nntp

119

Usenet Network News Transfer Protocol

nbsession

139

NetBIOS session service

NeWS

144

News

tcprepo

158

TCP repository

Table 6.2. Well-Known UDP Ports

Service

UDP Port Number

Description

echo

7

Echo

discard

9

Discard or null

systat

11

Users

daytime

13

Daytime

netstat

15

Network status

qotd

17

Quote of the Day

chargen

19

Character generator

time

37

Time server

name

42

Host Name server

domain

53

Domain name server (DNS)

nameserver

53

Domain name server (DNS)

bootps

67

Bootstrap protocol service/DHCP

bootpc

68

Bootstrap protocol client/DHCP

tftp

69

Trivial File Transfer Protocol

portmap

111

 

sunrpc

111

SUN RPC service

ntp

123

Network Time Protocol

nbname

137

NetBIOS name

nbdatagram

148

NetBIOS datagram

sgmp

153

 

snmp

161

Simple Network Management Protocol

snmp-trap

162

Simple Network Management Protocol trap

Multiplexing/Demultiplexing

The socket addressing system enables TCP and UDP to perform another important Transport layer task: multiplexing and demultiplexing. As described earlier, multiplexing is the act of braiding input from several sources into a single output, and demultiplexing is the act of receiving input from a single source and delivering it to multiple outputs (see Figure 6.5).

Figure 6.5. Multiplexing and demultiplexing.

graphics/06fig05.gif

Multiplexing/demultiplexing enables the lower levels of the TCP/IP stack to process data without regard to which application initiated that data. All associations with the originating application are settled at the Transport layer, and data passes to and from the Internet layer in a single, application-independent pipeline.

The key to multiplexing and demultiplexing is the socket address. Because the socket address combines the IP number with the port number, it provides a unique identifier for a specific application on a specific machine. See the Telnet server depicted in Figure 6.6. All client machines use the well-known port address TCP 23 to contact the Telnet server, but the destination socket for each of the connecting PCs is unique. Likewise, all network applications running on the Telnet server use the server's IP address, but only the Telnet service uses the socket address, consisting of the server's IP address plus TCP port 23.

Figure 6.6. The socket address uniquely identifies an application on a particular server.

graphics/06fig06.gif

    Previous Section Next Section


    JavaScript Editor Source code editor     Website development