************************************* * * * DB/C Newsletter * * September 1994 * * * ************************************* Editor's Notes The UNIX, MSDOS, Macintosh and OS/2 versions of DB/C 9.0 will contain support for TCP/IP. This month's article explains some of the details of TCP/IP. We will discuss the actual DB/C programming interface to TCP/IP in a future newsletter. There is nothing new to report about the status of the PL/B Standard. We are still waiting for final approval by ANSI. don.wills@swc.com TCP/IP - The Details TCP/IP is the primary protocol used on many networks around the world. It is used on both Local Area Networks (LANs) and Wide Area Networks (WANs). The most well known WAN is the Internet. Another protocol, UDP/IP, is also used on these networks. TCP/IP stands for Transmission Control Protocol/Internet Protocol. UDP/IP stands for User Datagram Protocol/Internet Protocol. As their names suggest, they both contain the Internet Protocol, also known as IP. IP is the base level protocol for packets moved around on the network. IP packets are moved from a starting point to one or more ending points. When a packet is being moved to only one ending point, it is known as a point-to-point transmission. When a packet is destined for multiple ending points, it is known as a broadcast. The transmission path may include one or more routers, which do just what their name suggests - they route the packets so that they will end up at the correct destination. Several different protocols exist for routers to communicate with one another, so that each router knows what it is connected to and what to do with packets. These protocols have names like ICMP, GGP, RIP and BGP. We won't discuss these protocols - we will just assume that routers know how to forward packets so that they reach their intended destination. Each packet consists of a header containing several fields, followed by the actual data. The source address and destination address are the fields that we will be concerned with. Each address is 32 bits long. Whenever an IP address is printed in text each of the 4 bytes that make up the 32 bits is converted to a decimal value and a period is placed between each of these values. An example of an IP address is "192.36.238.44". Note that each of the values can be from 0 to 255. Theoretically, there could be 2 to the 32nd power addresses on one IP network. This is about 4,000,000,000 addresses. Because of practical considerations, the number is much less than this. On the Internet, a block of addresses is assigned to an organization. Each organization manages its own block of addresses. Large organizations are given a large group of addresses, and smaller organizations are given smaller groups. Here is how it works: 1.xxx.xxx.xxx through 126.xxx.xxx.xxx are Class A addresses. 128.xxx.xxx.xxx through 191.xxx.xxx.xxx are Class B addresses. 192.xxx.xxx.xxx through 223.xxx.xxx.xxx are Class C addresses. 224.xxx.xxx.xxx through 239.xxx.xxx.xxx are Class D addresses. 240.xxx.xxx.xxx through 254.xxx.xxx.xxx are Class E addresses. Class A addresses are for large organizations. The first byte is the organization number. The last three bytes are values that are assigned by that organization. Therefore, there are only 126 Class A organizations, but each one can assign 16 million addresses. Class B addresses are for middle sized organizations. The Class B organization number is the first two bytes. Therefore, there are 16,000 Class B organizations, each with 64,000 addresses. Class C addresses are for small organizations. The Class C organization number is the first three bytes. Therefore, there are 2,000,000 Class C organizations, each with 256 addresses. Class D addresses are reserved for multicast. On the Internet, an audio/video distribution method called the MBONE uses these addresses. Class E addresses, addresses with 0 as the first byte, and addresses with 255 as the last byte are reserved for special and future use. Classless Inter Domain Routing (CIDR) is a new standard for assigning IP addresses. With CIDR, blocks of addresses are assigned to network providers who then assign them to their customers. The purpose of CIDR is to make routing of packets easier. It is being used for some new IP address assignments. All of this is good for the routers to transmit packets, but having to remember 4 decimal values for every node of an IP network is not exactly user-friendly. Fortunately, a method for assigning names to IP addresses was invented. Before we discuss name organization and lookup, let's look at UDP and TCP. UDP is a connectionless, datagram protocol. Each packet is sent to a destination without a logical connection having previously been created. The sender can not ascertain whether or not the packet was successfully received, or was just lost. UDP is a low-level protocol. It only differs from IP in the fact that a socket number is associated with each UDP message. A program at the receiving end must be listening for messages with the same socket number that the sender put into the UDP message being transmitted. TCP is a connection-oriented, guaranteed arrival protocol. Before a TCP message is sent, a connection is established. Either end (or both) may initiate the connection. Once the connection is established, either end may send messages. When a message is received, the sender is informed of the success. If a message is not received, the send is informed of the failure and the connection is abnormally terminated. Either end may terminate a connection. As with UDP, a socket number is associated with each TCP connection. Socket numbers below 1024 are assigned for specific uses. For example, to initiate an FTP session, connect with socket 21 on the target machine. The FTP data session is then established on socket 20. The TELNET socket number is 23. The Simple Mail Transfer Protocol (SMTP) socket number is 25. The FINGER socket number is 79. The Domain Name System (DNS) is the system that is used to manage the names that are used instead of IP addresses. Some real names on the Internet are: swc.com www.swc.com info.cern.ch oslonett.no apple.com athena.mit.edu ftp.uspto.gov www.ncsa.uiuc.edu Names are hierarchical and separated by periods, similar to IP addresses. The difference is that the highest level of the hierarchy is at the end. Here is a list of the some highest level names: .com for-profit companies, primarily US based .edu educational institutions, US based .org non-profit organizations, US based .gov US government organizations .net network providers For most organizations outside of the US, the highest level is a country specifier. Here is a short list: .ca Canada .no Norway .ch Switzerland .uk United Kingdom .au Australia .nz New Zealand In the US, a group called the InterNIC registration service is responsible for assigning names below the highest level. In other countries, there is one organization responsible for assigning names below the country code. After being assigned swc.com, Subject, Wills & Company (SWC) is allowed to create names below swc.com. For example, the name of the computer receiving mail (via SMTP) at SWC is fountain.swc.com. The name swc.com is associated with the same IP address so that mail can just be addressed to swc.com. At some time in the future, we may move the mail server to a different machine, but we will then change swc.com to be associated with the new IP address. The address to name translation table for SWC is maintained in a name database at SWC. (Currently, it is also on fountain, but it could be moved to any other machine. fountain is a 486 running UNIX.) There is a task running on fountain that will respond to requests for translation of names to IP addresses. All of this is fine if you know the IP address of fountain, but it is useless to anybody else. The trick is to get the name server software to talk to other name servers and communicate information between them. This is what occurs. All you have to know is the IP address of one name server and you can query it to translate any name to an IP address. If your specific name server doesn't know the name, it queries other name servers and then responds back to you either positively or negatively in a short period of time. Negative responses take less than a minute on the current Internet. Queries to a name server are sent via a UDP message on socket 53. Messages are ASCII and fairly easy to understand. Names servers also support TCP. Name servers communicate with each other via UDP and TCP. TCP/IP is the language of the global data highway. Hopefully, this article has given you a better understanding of it. DB/C Class Schedule The next DB/C class is scheduled for September 26-29, 1994. The class is held in the Oak Brook, Illinois office of Subject, Wills and Company. For more information, contact Judi Tamkevic at dbc@swc.com or at (708) 572-0240.