[Lecture Notes by Prof Yuen and possibly others 2000-2001] Network Protocols ----------------- "Computing people are very sociable; they do lots of networking, protocols and handshaking..." - from the resident SOC humorist There are two main reasons why people become so protocol conscious when computing meets comunications: path sharing and error prevention. Communication lines are expensive to install and are always shared among a large number of users, and like a group of people trying to get through the same door, you need a protocol to manage the traffic, as well as to sort out problems. A communicatin line, whether a pair of copper wires, a coaxial cable, an optical fibre, a pair of wireless antennae, or a satellite relay path, receives a series of electric pulses at one end and reproduces them at the other end, and each user's information is carried by one section of these pulses. The question is how you can "grab" a particular set and make them what you want them to be. When the users have fairly constant traffic demands, you can just allocate each person a different set of time slots: A - t to t+dt, B - t+dt to t+2dt, etc. This is called time division multiplexing, with each user starting to transmit and stopping at pre-designated moments. Unfortunately, for general communication situations, we do not have such nicely prepared schedules, but want to be able to start sending information any time, maybe with just a bit of wait if the line is busy; the amount of transmission we might want to do is also unpredictable and highly variable. So the commonly used protocol for computers to connect together using a single communication line, is Carrier Sense Multiple Access with Collision Detection or CSMA/CD: if you want to transmit, you first detect whether there is transmission going on already on the line; if there is, you wait for an amount of time before trying again; if there is not, then you start transmitting, expecting that others would see your transmission and therefore not start while you are still doing it; it could happen however, that two parties start transmitting at the same time, since at the time they tried to see if the line is free, neither has started and there was no signal on the line; this causes a collision, with neither party getting signals through correctly, and both would detect this by noticing that the signals on the line are different from what they sent; hence, both stop transmitting, and each waits for a different amount of time before trying again. A random number generator is used to make sure that everyone's wait interval is different so that two parties do not retry at the same time and cause a new collision. When there is transmission on the line, any of the non-transmitting parties could be the intended recipient; the identification for the recipient has to be shown in the transmission so that you can see whether the message is intended for you or not; so there has to be a fixed message design so that when you notice there are some pulses on the line, you know which pulses are the recipient's ID and can compare it with your own ID; if the two match, you channel the signals to your message storage are to be processed; you have to be able to tell where the message starts and where it ends, which too are taken care of by the message design, to ensure that random noise on the line would not be mistaken as a message By connecting computers together in a small neighbourhood like a single floor or building, we build a local area network; these networks are then interconnected with gateways, a machine on multiple lines that does not have its own messages to send or receive: if the recipient ID does not correspond to any of the computers on this network, then the gateway picks it up and tries to see if the ID corresponds to a machine on another network to which it has a connection; it then puts the message on the line for the other network using the same protocol described earlier. The machine can however, be some distance away, maybe halfway around the globe, and the gateway has to send it over a communication line to another gateway on the opposite side; more often, the message is handed to a gateway of a public carrier like Singtel, which has transmission lines to all parts of the world which it shares with public carriers of other countries There system may have a number of point to point connections that support large amounts of traffic between these particular points, and hubs where less important destinations can communicate with each other by connecting to a single hub rather than have many connections with each other, and routers are designed to have optimized strategies that cause the best hub traffic re-directions even with changing traffic patterns When you make a phone call, a connection is established between your phone and the other phone for the duration of your conversation. This is called line switching, with a connection reserved for a user for a period of time. Your signals are not stored nor (noticeably) delayed. In computer communication, messages are usually stored until it is convenient to send them, allowing more flexible sharing of a common line since you can juggle the line use between different messages; further, a message may be broken up into standard size packets, each sent when the system judges convenient and so subject to different delays; at the receive end, the packets need to be stored until they are complete and the original message could be re-assembled, and since packets for different messages arrive all jumbled up, each packet has to be clearly identified to show which message it belongs to and in what order, to allow the re-assembling to occur correctly. Further, it is easy for transmissions to be affected by various malfunctions and interference, so that additional information about information in a message/packet is added to the message/packet so that if part of the information is lost or corrupted, the recipient can correct it or at least detect the occurrence of error and ask for a retransmission; similarly, correctly received messages/packets need to be acknowledged so that the sender can throw away the already sent information and free the space used to keep the messages. So you see why computing people are so sociable: they need clearly defined protocols for computers to share lines and for sender/recipients to maintain the correct information flow. Protocols of the world: Unify!