The Internet


Several protocols are used on the Internet, and these are often referred to as the Internet protocol suite. It's helpful to think of this collection of protocols as a stack, and each layer of the stack is responsible for certain activities. From the REALbasic perspective, there are three layers that are important (there's actually a formal network protocol stack model called the OSI model, which divides up the network stack into seven layers, but that's far too formal for our purposes). At the very bottom of the stack is the Network Layer. Above that is the Transport Layer, and at the very top is the Application Layer.

Network Layer

When referring to the underlying protocol that supports the Internet, people often refer to two protocols in tandem: TCP/IP. TCP is the Transmission Control Protocol, which I'll talk about momentarily, and IP is the Internet Protocol, which is the protocol that sits on the Network Layer. The Network Layer manages network addresses and decides how to package and route data from one computer to the next. The Internet Protocol does this using IP addresses, URLs, and packets.

Every computer has a physical address, which is known as the IP address. The default IP address of your own local computer is 127.0.0.1. There are also logical addresseswhich is really one way of saying that there are names that get mapped to IP addresses because they are easier for human beings to remember. In the Internet world, this refers to host and domain names and URLs. On your local machine is a default hostname called Localhost. If you are on a computer that has a web server running, you should be able to type in either of the following URLs to get to the home page:

http://localhost/ http://127.0.0.1/


Both addresses refer to the same location on the Internet, and it is the Internet Protocol that manages this process. Normally, you use the name, such as http://realsoftware.com/, to refer to a location on the Internet. The IP takes that name, looks up the IP address, and uses the address to route the request to the appropriate computer. The lookup is done by checking with a domain name server, which is like a dictionary that maps domain names to IP addresses.

After the Internet Protocol has managed to find the actual address of the computer, it needs to send the request to it. The Internet Protocol breaks up the request into smaller pieces of data called packets and identifies the route the packets will take. At this point, the next layer of the Internet Protocol stack takes over.

Transport Layer

The TCP in TCP/IP stands for Transmission Control Protocol; it is one of the protocols used in the transport layer. The other is called UDP, which stands for User Datagram Protocol. The Transport Layer is responsible for actually transferring the data between computers. REALbasic provides classes for both TCP and UDP sockets.

It is easiest to understand what is happening on the Transport Layer by comparing TCP to UDP. It's called the Transport Layer because it deals with how data is moved from one computer to the next. TCP is a very robust protocol that includes a lot of error checking, which ensures that all the data sent by one computer is received by the other computer in the proper order. Because of all this error checking, it can be a little slow for some applications. UDP is the protocol designed for use in those situations; it emphasizes speed rather than robustness. Therefore, it sends a lot of data, but it doesn't check to ensure that the data has arrived as expected. This means that some data gets lost in transmission. In many cases, this loss of data is considered an acceptable trade-off to get enhanced speed. Things such as streaming video and audio make use of UDP.

Application Layer

The Application Layer sits at the top of the stack. This is the protocol that handles application tasks. Examples of Application Layer protocols are HTTP, SMTP (Simple Mail Transfer Protocol), and POP3 (Post Office Protocol, version 3). These protocols are used in common Internet applications, such as web browsers and email clients. REALbasic provides classes for these protocols as well.




REALbasic Cross-Platform Application Development
REALbasic Cross-Platform Application Development
ISBN: 0672328135
EAN: 2147483647
Year: 2004
Pages: 149

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net