Winsock Programmer's FAQ: Glossary
<<

Winsock Programmer's FAQ
Section 9: Glossary

There's not much to say about this section, except that I frequently refer you to corresponding and related entries in an online copy of The New Hacker's Dictionary (known online as The Jargon File), an excellent resource for understanding some of the culture and jargon of the original Internet. I link you there when I think that the TNHD reference clarifies or enhances the more straightforward definition I provide.

asynchronous - In Winsock terms, an asynchronous call is one that returns before performing the requested function. (You make a socket asynchronous by calling the WSAAsyncSelect() function on it.) This allows your program to go about its business until Winsock manages to complete the requested function. Once Winsock completes the request, it notifies your program with a window message. This is a Good Thing, because networks are so slow and unreliable, compared to the internals of a computer. Asynchronous calls allow you to decouple the rest of your program from the network portions, so that a network fault or delay does not unduly impact your program's performance. See also blocking and non-blocking.

blocking - A function is said to "block" when it waits until it completes the requested operation (or fails trying) before returning. (Sockets are blocking by default under Winsock.) The main use for blocking calls in a Winsock program are when your program's only job in life is to communicate with the network, because while a call blocks, your program can do nothing else. This mode of operation is also called "synchronous." See also asynchronous and non-blocking.

bridge - A bridge is a multi-homed host that operates at layers 1 and 2 of the OSI model. Bridges connect two networks, usually of the same type. A bridge is somewhat smarter than a simple repeater, in that it can make decisions about moving data from one network to the other. Some bridges even reach up into layers 3 and 4 (traditional router and gateway territory) to add even more intelligence; these smarter devices are often called "brouters."

BSD Unix - The Berkeley Software Distribution of Unix took an early lead over originator AT&T's offerings by providing extra features and functionality that didn't appear in AT&T Unix (also called System V) until later. One of these features was the "sockets" system for communicating over TCP/IP networks. Between that and its adoption by Sun Microsystems, Digital Equipment Corporation and others, BSD Unix was the most popular choice for Internet hosts from the mid 80's through the early 90's. The early 90's saw AT&T sue the Computer Software Research Group, the University of California at Berkeley organization that created BSD. The early 90's also saw System V adopt many traditional BSD features (including sockets). For those reasons, all commercial Unixes eventually switched to System V. BSD is still available, however, in several lineal descendants: FreeBSD, NetBSD, OpenBSD and BSD/OS. See also the BSD and Unix entries in TNHD.

client - A program that initiates a network connection. By extension, a client program usually has some kind of user interface, often a GUI. In a typical client/server protocol, the client is the active participant, in that it makes requests and the server responds.

datagram protocol - A datagram protocol, such as IP or UDP, delivers data in packets the same size as those that were sent. For example, if one host sends another two 50-byte datagrams, that host will receive two discrete 50-byte datagrams. Compare stream protocol.

DNS - The Domain Name Service is one of the core Internet protocols and mechanisms. DNS is what translates human-readable names (e.g. "www.cyberport.com") into the binary IP addresses that are actually used to move data packets around on the Internet. Winsock accesses the DNS when you give the gethostbyname() and gethostbyaddr() calls.

domain name - Domain names are the human-readable addresses used on the Internet (e.g., "www.cyberport.com"). The Domain Name Service translates these names into IP addresses which TCP/IP programs use directly. Compare dotted quad.

dotted quad - An string representation of an IPv4 address, in the form "172.16.3.52" -- that is, four decimal numbers separated by dots. Note that the future IPv6 addresses are commonly written as a series of 8 colon-separated 16-bit values in hexadecimal notation, with zeroes suppressed: "AC01:987C:::A39D::FF52:CC4C". Contrast this with the IP address and domain name entries.

gateway - A multi-homed network host that operates at layer 4 of the OSI model. A gateway understands the transport layer protocols at the least (TCP, UDP, etc.) and sometimes understands elements from layer 5 (e.g. the FTP protocol). A gateway uses this information to filter data -- for example, it can reject disallowed operations, for example; and to translate items in the data stream -- for example, it can translate the network addresses from an internal format to an external format. Related terms include "packet filter" and "firewall:" a packet filter can be part of a gateway, and a gateway is one component of a firewall.

Also note that looser definitions exist, such as for a mail gateway, which lets people using one email system to send mail to people using another system.

IP address - A binary value used by the IP protocol to deliver packets to their destination hosts. See the entry dotted-quad for a common representation of these addresses.

IPv4 - The Internet Protocol version 4. This is the current version, and it is distinguished with addresses that are 32 bits wide. Compare IPv6.

IPv6 - The Internet Protocol version 6. This is still-experimental version of IP that is destined to replace version 4 over the next few years. It is distinguished with many improvements and features, including a much larger address space, at 128 bits per address. This protocol is also sometimes called "IPng", for "IP next generation". Compare IPv4.

MTU - The Maximum Transmission Unit is the largest packet that a given network medium can carry. Ethernet, for example, has a fixed MTU of 1500 bytes, ATM has a fixed MTU of 48 bytes, and PPP has a negotiated MTU that is usually between 500 and 2000 bytes.

multi-homed - A host with more than one network adapter. Sometimes a host is multi-homed to link two networks (as with a router). More commonly, a multi-homed host is simply connected to two networks, such as a machine on a LAN which also has a modem for connecting to an ISP.

Nagle algorithm - The Nagle algorithm delays sending small packets over the network on the theory that further packets might follow soon. If so, those packets can be transmitted as a single unit, thus reducing the impact of protocol overhead.

An example might help to show why this is important. First, the most basic TCP/IP protocol header is 40 bytes, and it can be larger if optional fields are used. Now, consider a program that sends many small, two-byte packets. Without the Nagle algorithm, each of these packets would be transmitted separately, with at least 20 bytes of overhead for every byte of data. Obviously, this is quite wasteful. The Nagle algorithm counteracts this effect by delaying the transmission of small packets for some short time, such as 200 milliseconds. A packet is sent when this Nagle timer times out, or when a full MTU is accumulated.

This option is on by default in Winsock, but it can be turned off with the TCP_NODELAY option of setsockopt(). This option should not be turned off except in a very few situations.

non-blocking - This mode of operation is a sort of hybrid between blocking and asynchronous modes. Like calls on an asynchronous socket, non-blocking calls return immediately. Unlike asynchronous sockets, Winsock does not tell you when that operation completes, or when it is safe to try another similar operation. Instead, you have to either use a "spin loop" to repeatedly re-try a function until it succeeds (a Very Bad Thing), or use select() which will block until the socket(s) you pass to it are ready to do something. (You make a socket non-blocking in Winsock by calling the ioctlsocket() function with the FIONBIO option.)

OSI model - Of all the standards to come out of the Open Systems Interconnect specifications, the OSI network model is the most common and enduring. The OSI model is a seven-layer view of looking at the network. It is presented below, with rough analogues from TCP/IP and Winsock.

    Layer 7 Application (e.g. an FTP or email client)
    Layer 6 Presentation (formats data, such as encrypting or compressing it)
    Layer 5 Session (manages the logical client/server connection; e.g. the FTP protocol)
    Layer 4 Transport (understands low-level client/server association; e.g. UDP or TCP)
    Layer 3 Network (routable packet level of the protocol; e.g. IP)
    Layer 2 Data Link (e.g. packet driver)
    Layer 1 Physical (e.g. Ethernet hardware)

Layers 1 through 4 are the hardware and network stack (including the Winsock layer). Layers 5 through 7 are all under the application's control.

RFC - Request for Comments. RFCs are the Internet's standards mechanism; they document most of the "open" aspects of the Internet. See also the entry in TNHD.

router - A router is a multi-homed host that operates at OSI layer 3. A router moves packets between two or more networks, usually based on configurable rules, based on the contents of layer 3 (e.g. the IP addresses in a packet). Most modern network hosts have at least some rudimentary routing capability. A simplistic example: Consider a PC on a LAN that also has a modem for connecting to the Internet. It might have a "LAN route" so that all traffic destined for the LAN goes out the LAN adapter, and a "default route" so that all other traffic goes out the modem. Try the "route" and "netstat -r" commands on a Windows 95 or Windows NT machine.

server - A program that passively waits for network connections on a well-known port. A typical server program has no user interface, and it usually can handle multiple network connections at once. In a typical client/server protocol, the server is passive: it usually only sends data as a result of data sent by the client.

stack - In network parlance, a stack is a set of layered programs, each of which talks to the ones above and below it. Below is an illustration of the most common kind of network stack, showing how an application program talks through the stack to the low-level network:

    Winsock application
    Winsock API
    Proprietary Winsock DLL (WINSOCK.DLL, WSOCK32.DLL, WS2-32.DLL)
    Protocol stack API
    Protocol stack (TCP/IP, IPX/SPX, DECnet, etc.)
    Hardware driver API (packet driver, NDIS, ODI, etc.)
    Hardware driver
    Hardware API (specific to the networking hardware)
    Networking hardware (network interface card, modem, CSU/DSU)
    The network (Ethernet, DEC LAT, serial line)

You might have noticed that there is a stack within the stack: the protocol stack. Just like the network stack, the protocol stack is a layered architecture, where higher-level components talk to lower-level components, and vice versa. In TCP/IP, for example, TCP is the high-level network transport that most applications use, while IP is the lower-level packet protocol that TCP uses.

stream protocol - A stream protocol, such as TCP, delivers data in variable-length packets whose size have no necessary relationship with the size of the packets that were sent. For example, if one host sends two 50-byte packets to the other host, that host may receive them as 100 single-byte packets, as a single 100-byte packet, or as a handful of smaller packets. Compare datagram protocol.


<< Unix Network Programming
Last modified on 29 April 2000 at 15:52 UTC-7 Please send corrections to tangent@cyberport.com.
< Go to the main FAQ page
<< Go to my Programming pages
<<< Go to my Home Page