INTRODUCTION to the TRANSMISSION CONTROL PROTOCOL How Does TCP and UDP Impact Control Networks? by George Thomas, Contemporary Controls

INTRODUCTION to the TRANSMISSION CONTROL PROTOCOL How Does TCP and UDP Impact Control Networks? by George Thomas, Contemporary Controls

Volume 1 • Issue 5 March–April 2000 Introduction to Industrial Ethernet, Part 3. Part 2 was featured in Issue 4, the Winter 1999. If you would like a copy, please send your request to EXTENSION [email protected] A Technical Supplement to control NETWORK INTRODUCTION TO THE TRANSMISSION CONTROL PROTOCOL How does TCP and UDP impact control networks? By George Thomas, Contemporary Controls INTRODUCTION USER DATAGRAM The UDP header is short and PROTOCOL simple. Only eight bytes are In the last EXTENSION issue required in the header. Source and (Volume 1 Issue 4) we discussed UDP provides a connectionless destination ports are each 16-bits the impact of the Internet Protocol and unreliable transport service long and, therefore, require four (IP) on control networks. IP since it does not issue bytes. The message length of 16- resides at the network layer of the acknowledgements to the sender bits indicates the length of the OSI communications model and upon receipt of data nor does it header and attached data. A 16-bit provides the basic unit of data inform the sender that data was checksum is used to check the transfer, which includes addressing, lost. Data integrity can suffer by validity of the header and data. routing, and fragmentation. The dropped packets, missequenced The UDP header and attached transport layer of this same model packets or by the receipt of data, which comes from the resides above the network layer duplicate packets. Any of these application layer, are encapsulated and provides station-to-station situations can occur without the into the IP data field. An IP communication and a common knowledge of the sender. It header, which provides station interface to the application layer. appears that UDP is no better than addressing, precedes the UDP This implies reliable the IP protocol but there is one datagram and the complete IP communication, which is either big difference. UDP introduces the datagram is encapsulated into the accomplished at the transport layer concept of port numbers, which frame of the data link layer or at the application layer. With are used by the application layer technology used, such as Ethernet, control networks this is usually that resides above UDP. Port and sent to the desired station accomplished at the application numbers have significance in where the complete process is layer since many control networks terms of actions requested by the reversed. Notice that the only were designed before the application itself that require a contribution UDP provided was popularity of TCP/IP took hold. particular response by the the assignment of port numbers Still there are some control receiving station. network protocols, such as MODBUS/TCP, which do rely upon Source port Destination port the guaranteed delivery mechanism Message Length Checksum of TCP and there may be more in the future. Actually, at the transport Data layer of the TCP/IP stack there are Data two transport protocols, each of which find service in control networks. The User Datagram Type IP SADA UDP Header and Data CRC Protocol (UDP) and the 0800 Header Transmission Control Protocol (TCP) will both be discussed in Figure 1. The UDP header is quite short and, along with its data, this article. it is encapsulated into an IP datagram. 1 for use by the application layer. If quickly making it attractive for insert a 69 (a well-known port UDP is to be used, the application control networks. assignment indicating TFTP layer must worry about services) into its destination port. acknowledging message receipt, A dynamic (random but non- correctly ordering received packets PORT NUMBERS conflicting) number will be put in into meaningful messages, UDP introduces the port number its source port and the request will discarding duplicate packets and concept. When a station receives a be sent to station B. Station B requesting retransmission of faulty UDP datagram, it serves up the would receive the request and packets since UDP does not port number to the application recognize it is a TFTP request from provide this service. However, if layer, which then allocates a buffer station A since port number 69 the application layer was originally area for the attached data. The was used. Station B would then designed to provide this reliability port number has significance begin executing the process. But it of service there is no reason to since it identifies a particular would insert a 69 in its source have the transport layer duplicate application. Since there are many port, and the dynamic number that effort so UDP makes sense. UDP port number possibilities, several was generated by station A in its has low overhead and executes different applications can be destination port, and send the simultaneously supported on response to station A. Station B the same station. knows how to handle this particular application since it Port Number Assignments recognizes both the source and Port numbers are 16-bits long and destination port numbers. The use are classified as being assigned, Both UDP and TCP use port numbers and, of port numbers along with the IP registered or dynamic. Assigned if possible, the same assignment is used address creates what is called a port numbers in the range of zero socket, which can be represented for both. The 16-bit numbers are to 1023 have been defined by the as <netid, hostid, portid>. As long classified as either assigned (well- Internet Assigned Numbers as there is structure to the known), registered or dynamic (private). Authority (IANA) for various assignment of ports, the socket Port number assignments are maintained applications that are considered assignment becomes a unique part of the TCP/IP protocol suite. by the Internet Assigned Numbers representation of a particular These applications include Authority (IANA) and the complete list application on the complete IP TELNET, FTP, and other popular network. can be found at ftp://ftp.isi.edu/in- Internet applications. These port notes/iana/ under port numbers. numbers are termed “well known” Numbers in the range of zero to 1023 and cannot be used by other TRANSMISSION CONTROL are classified as well-known and are applications. The remainder of the PROTOCOL port assignments is classified as used by common processes. However, The second transport layer being either registered or dynamic. individual organizations can register protocol is TCP which provides for Registered means that an a connection-based reliable numbers in the range of 1024 to 49151 organization wants to define some message delivery service for for proprietary purposes and will not be level of functionality and has processes. This relieves the used by other organizations. Looking at registered a unique port number application layer the responsibility the list, we find some companies in our with the IANA. Other organizations of guaranteed message delivery. are to respect this assignment and industry. Opto22 has registered 22000 Besides reliable connections, TCP not use either assigned or and 22001 for their SNAP I/O and Opto provides flow control to ensure registered port numbers. Finally, stations are not flooded with data. Control products. The BACnet building the dynamic port numbers are automation protocol has registered used in a random manner by a 47808. DeviceNet and ControlNet requesting station to signify the Data transmitted between stations intend to use 44818. Interestingly, the source port of an application is sent as a series of packets. request. These packets are reassembled at MODBUS/TCP specification calls for port the receiving end in the proper 502, which is in the well-known port order to recreate the data stream group. Port numbers 49152 to 65535 For example, if station A requests that was transmitted. Along the are considered as either private or a trivial file transfer protocol way packets can be corrupted, (TFTP) service (TFTP happens to dynamic and can be used by anyone. lost, duplicated or received out of use UDP) from station B, it would 2 order. In order to make sense of scheme described above. Instead to station A’s request for data, that all this, sequence numbers are of sequencing each packet, TCP data can be sent along with an applied to each packet sequences each byte in the packet. acknowledgement of station A’s transmission. A sequence number Assigning a sequence number to requesting message. This speeds is assigned to the first packet of a indicate the first byte in a multi- up processing. message. It does not matter what byte packet does this. The second is the initial value of the sequence packet will have a sequence number only that the second number equal to the first sequence TCP’s header is larger than that of packet has been assigned the number plus the number of bytes UDP but uses the same port initial sequence number plus one. in the first packet. The receiver assignment scheme as UDP does. The rule is that successive packets expects the same. The receiver Unlike UDP, a 32-bit sequence of a data stream have ascending acknowledges receipt of good number and acknowledgement sequence numbers each packets by transmitting an number are included in the header incremented by one. After all the acknowledgement that includes as well as several flag bits. Only a packets are received, sequence the value of the next expected few of the flag bits will be numbers are used to order the sequence number. In this case, it discussed here. Since the TCP packets. Missing sequence is the sequence number of the last header can be of varying length numbers indicate the packet was byte in the last received packet depending upon the content of the lost. Duplicate packet numbers plus one. Upon receipt of this options field, a data offset field indicate duplicate packets were acknowledgement, the sender can has been provided in order to received allowing them to be assume that previous bytes up determine the actual beginning of discarded.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    4 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us