• No results found

User Datagram Protocol

In document [eBook] Microsoft TCP IP Book pdf (Page 92-96)

TCP is a connection- or session-oriented protocol that requires hosts to establish a session, which is maintained for the duration of a transfer, after which the session is closed. The overhead required to maintain connections is justified when reliability is required but often proves to be misspent effort.

User Datagram Protocol provides an alternative transport for processes that do not require reliable delivery. UDP is a datagram protocol that does not guarantee data delivery or duplicate protection. As a datagram protocol, UDP need not be con- cerned with receiving streams of data and developing segments suitable for IP. Consequently, UDP is an uncomplicated protocol that functions with far less over- head than TCP.

In the following several situations, UDP might be preferred over TCP as a host-to-host protocol:

Messages that require no acknowledgment. Network overhead can be

reduced by using UDP. Simple Network Management Protocol (SNMP) alerts fall into this category. On a large network, considerable SNMP alerts are generated because every SNMP device transmits status updates. Seldom, however, is loss of an SNMP message critical. Running SNMP over UDP, therefore, reduces network overhead.

Messages between hosts are sporadic. SNMP again serves as a good

example. SNMP messages are sent at irregular intervals. The overhead required to open and close a TCP connection for each message would delay messages and bog down performance.

Reliability is implemented at the process level. Network File System

(NFS) is an example of a process that performs its own reliability function and runs over UDP to enhance network performance.

Summary

In this chapter, you have looked at the Transport layer. This layer handles TCP sessions and both connection-oriented (or session-oriented) transmissions and connectionless (with no session) transfers. You have seen that all the work at this layer is done by either TCP or UDP. The next chapter examines the Internet layer, which services both these protocols.

Test Yourself

1. What is the purpose of the Transport layer?

2. What two pieces are added to the data at the Transport layer? 3. What is the purpose of the TCP header?

4. What is the purpose of the pseudo header? 5. What are the three main functions of TCP?

6. How is a TCP session established? What control bit is involved? 7. What control bit is used to end a TCP session?

8. What does byte stream communications provide? 9. What is used to ensure that the sent data is received?

10. What is a TCP sliding windows? When is the size of the window set? 11. Where would UDP be used?

Test Yourself Answers

1. The Application layer is used to communicate with the Transport layer on the remote host. It receives instructions from the Application layer, which it packages with instructions for the remote system’s Transport layer. The packages created at this layer are passed as data to the IP layer.

2. The Transport layer adds both a header and a pseudo header.

3. The header adds control and error checking information to the information being sent.

4. The pseudo header is used much like the NCB is at the TDI layer. It tells the underlying protocol what to do with the information being passed to it.

5. The three main functions of TCP are session establishment and termination, byte stream communications, and Sliding Windows.

6. TCP creates a session with the remote host by way of a three-way handshake. The host that initiates the communications starts by sending a packet that contains information about itself, and in which the SYN flag is raised. The other host receives the packet, and acknowledges it. In the acknowledgment, the SYN flag (control bit) is raised, and data about that host is included. Finally, the initiating host sends an acknowledgment back to the target host, and a session now exists between the two hosts.

7. Ending a TCP session is identical to creating one with one important difference: the FIN control is raised rather than the SYN control bit.

8. Byte stream communications provide a seamless transfer mechanism that treats all the data from the upper layers as one long stream of information. This means that there are message boundaries or protocols that the upper-layer applications need to understand. This means that data transfer across the network is the same to the application as sending data to the local hard disk.

9. TCP sends a Sequence number with every packet of information that it sets. This number represents the position of the first byte of data in the packet within the entire stream being sent. Each of the packets sent requires an acknowledgment of that number. As well, every packet includes a checksum value that ensures that data sent is the same as that received.

10. On each system that uses TCP, there is a receive and transmit window. The transmit window is set to the size of the other host’s receive window during the TCP three-way handshake. The transmit window is now placed over the data stream to be sent, and the information in the window is sent. The window remains over that information until the receiver acknowledges receipt of the information, at which time, the window slides past that information and sends the next.

11. Typically, UDP is used in cases where the sender does not require a confirmation of the transmission. This might include server announcements, SNMP packets, and name query broadcasts. UDP can also be used if the upper layers are ensuring the delivery, such as NFS does.

5

C H A P T E R

B

oth TCP and UDP pass information to the IP layer. This layer is responsible for actually moving the data from one machine on the network (or internetwork) to another. The IP layer handles a number of different tasks required for communications to exist. The IP layer, however, does not guarantee delivery—as you have seen, this is done by TCP.

Some of the functions handled at this layer include the following:

◆ Routing of datagrams

◆ Resolution of IP addresses to MAC addresses

◆ Fragmentation and re-assembly of datagrams

◆ Error detection and reporting

This chapter discusses each of these topics. This is the important part of the TCP/IP stack. Because this is where routing takes place, this chapter first covers the basics of routing. Then it examines resolution of addresses. You will learn to never send information to a TCP/IP address, but always to a MAC address.

In document [eBook] Microsoft TCP IP Book pdf (Page 92-96)

Related documents