Computer Networking : Principles, Protocols and Practice Release Olivier Bonaventure May 30, 2014 Contents 1 Table of Contents 3 1.1 Connecting two hosts .4 The transport layer .5 Naming and addressing .7 The reference models .1 The application layer .2 The Domain Name System .4 The HyperText Transfer Protocol .5 Remote Procedure Calls .6 Internet transport protocols .7 The User Datagram Protocol .8 The Transmission Control Protocol .9 The Stream Control Transmission Protocol .11 The network layer .12 The IPv6 subnet .13 Routing in IP networks .16 Datalink layer technologies .6 Configuring DNS and HTTP servers .7 Experimenting with Internet transport protocols .8 Experimenting with Internet congestion control .10 IP Address Assignment Methods and Intradomain Routing .11 Inter-domain routing and BGP .12 Local Area Networks: The Spanning Tree Protocol and Virtual LANs .3 Indices and tables. 293 Bibliography 295 Index 309 ii Computer Networking : Principles, Protocols and Practice, Release Contents 1 Computer Networking : Principles, Protocols and Practice, Release 2 Contents CHAPTER 1 Table of Contents 1.1 Preface This is the current draft of the second edition of the Computer Networking : Principles, Protocols and Practice. The document is updated every week. The first edition of this ebook has been written by Olivier Bonaventure.
Laurent Vanbever, Virginie Van den Schriek, Damien Saucez and Mickael Hoerdt have contributed to exercises. Pierre Reinbold designed the icons used to represent switches and Nipaul Long has redrawn many figures in the SVG format. Stephane Bortzmeyer sent many suggestions and corrections to the text. Additional information about the textbook is available at http://inl.be/CNP3 Note: Computer Networking : Principles, Protocols and Practice, (c) 2011, Olivier Bonaventure, Universite catholique de Louvain (Belgium) and the collaborators listed above, used under a Creative Commons Attribution (CC BY) license made possible by funding from The Saylor Foudnation’s Open Textbook Challenge in order to be incorporated into Saylor.org’ collection of open courses available at http://www.
Full license terms may be viewed at : http://creativecommons.org/licenses/by/3.1 About the author Olivier Bonaventure is currently professor at Universite catholique de Louvain (Belgium) where he leads the IP Networking Lab and is vice-president of the ICTEAM institute. His research has been focused on Internet protocols for more than twenty years. Together with his Ph. students, he has developed traffic engineering techniques, performed various types of Internet measurements, improved the performance of routing protocols such as BGP and IS-IS and participated to the development of new Internet protocols including shim6, LISP and Multipath TCP.
He frequently contributes to standardisation within the IETF. He was on the editorial board of IEEE/ACM Transactions on Networking and is Education Director of ACM SIGCOMM. 3 Computer Networking : Principles, Protocols and Practice, Release 4 Chapter 1. Table of Contents CHAPTER 2 Part 1: Principles 2.1 Connecting two hosts Warning: This is an unpolished draft of the second edition of this ebook.
If you find any error or have sugges- tions to improve the text, please create an issue via https://github.com/obonaventure/cnp3/issues?milestone=1 The first step when building a network, even a worldwide network such as the Internet, is to connect two hosts together. This is illustrated in the figure below.1: Connecting two hosts together To enable the two hosts to exchange information, they need to be linked together by some kind of physical media. Computer networks have used various types of physical media to exchange information, notably : • electrical cable. Information can be transmitted over different types of electrical cables.
The most common ones are the twisted pairs (that are used in the telephone network, but also in enterprise networks) and the coaxial cables (that are still used in cable TV networks, but are no longer used in enterprise networks). Some networking technologies operate over the classical electrical cable. Optical fibers are frequently used in public and enterprise networks when the distance be- tween the communication devices is larger than one kilometer. There are two main types of optical fibers : multimode and monomode.
Multimode is much cheaper than monomode fiber because a LED can be used to send a signal over a multimode fiber while a monomode fiber must be driven by a laser. Due to the different modes of propagation of light, monomode fibers are limited to distances of a few kilometers while multimode fibers can be used over distances greater than several tens of kilometers. In both cases, repeaters can be used to regenerate the optical signal at one endpoint of a fiber to send it over another fiber. In this case, a radio signal is used to encode the information exchanged between the communi- cating devices.
Many types of modulation techniques are used to send information over a wireless channel and there is lot of innovation in this field with new techniques appearing every year. While most wireless networks rely on radio signals, some use a laser that sends light pulses to a remote detector. These optical 5 Computer Networking : Principles, Protocols and Practice, Release techniques allow to create point-to-point links while radio-based techniques, depending on the directionality of the antennas, can be used to build networks containing devices spread over a small geographical area.1 The physical layer These physical media can be used to exchange information once this information has been converted into a suitable electrical signal. Entire telecommunication courses and textbooks are devoted to the problem of converting analog or digital information into an electrical signal so that it can be transmitted over a given physical link.
In this book, we only consider two very simple schemes that allow to transmit information over an electrical cable. This enables us to highlight the key problems when transmitting information over a physical link. We are only interested in techniques that allow to transmit digital information through the wire and will focus on the transmission of bits, i. Note: Bit rate In computer networks, the bit rate of the physical layer is always expressed in bits per second.
One Mbps is one million bits per second and one Gbps is one billion bits per second. This is in contrast with memory specifica- tions that are usually expressed in bytes (8 bits), KiloBytes ( 1024 bytes) or MegaBytes (1048576 bytes). Thus transferring one MByte through a 1 Mbps link lasts 8. Bit rate Bits per second 1 Kbps 103 1 Mbps 106 1 Gbps 109 1 Tbps 1012 To understand some of the principles behind the physical transmission of information, let us consider the simple case of an electrical wire that is used to transmit bits.
Assume that the two communicating hosts want to transmit one thousand bits per second. To transmit these bits, the two hosts can agree on the following rules : • On the sender side : – set the voltage on the electrical wire at +5V during one millisecond to transmit a bit set to 1 – set the voltage on the electrical wire at -5V during one millisecond to transmit a bit set to 0 • On the receiver side : – every millisecond, record the voltage applied on the electrical wire. If the voltage is set to +5V, record the reception of bit 1. Otherwise, record the reception of bit 0 This transmission scheme has been used in some early networks.
We use it as a basis to understand how hosts com- municate. From a Computer Science viewpoint, dealing with voltages is unusual. Computer scientists frequently rely on models that enable them to reason about the issues that they face without having to consider all implemen- tation details. The physical transmission scheme described above can be represented by using a time-sequence diagram.
A time-sequence diagram describes the interactions between communicating hosts. By convention, the communi- cating hosts are represented in the left and right parts of the diagram while the electrical link occupies the middle of the diagram. In such a time-sequence diagram, time flows from the top to the bottom of the diagram. The trans- mission of one bit of information is represented by three arrows.
Starting from the left, the first horizontal arrow represents the request to transmit one bit of information. This request is represented by using a primitive which can be considered as a kind of procedure call. This primitive has one parameter (the bit being transmitted) and a name (DATA.request in this example). By convention, all primitives that are named something.request correspond to a request to transmit some information.
The dashed arrow indicates the transmission of the corresponding electrical signal on the wire. Electrical and optical signals do not travel instantaneously. The diagonal dashed arrow indi- cates that it takes some time for the electrical signal to be transmitted from Host A to Host B. Upon reception of the electrical signal, the electronics on Host B‘s network interface detects the voltage and converts it into a bit.
This bit is delivered as a DATA. All primitives that are named something.indication correspond to the reception of some information. The dashed lines also represents the relationship between two (or more) primitives. Such a time-sequence diagram provides information about the ordering of the different primitives, but the distance between two primitives does not represent a precise amount of time.
Part 1: Principles Computer Networking : Principles, Protocols and Practice, Release Host A Physical link Host B DATA.ind(0) Time-sequence diagrams are usual when trying to understand the characteristics of a given communication scheme. When considering the above transmission scheme, is it useful to evaluate whether this scheme allows the two communicating hosts to reliably exchange information ? A digital transmission will be considered as reliable when a sequence of bits that is transmitted by a host is received correctly at the other end of the wire. In practice, achieving perfect reliability when transmitting information using the above scheme is difficult. Several problems can occur with such a transmission scheme.
The first problem is that electrical transmission can be affected by electromagnetic interferences. These inter- ferences can have various sources including natural phenomenons like thunderstorms, variations of the magnetic field, but also can be caused by interference with other electrical signals such as interference from neighboring cables, interferences from neighboring antennas,. Due to all these interferences, there is unfortunately no guar- antee that when a host transmit one bit on a wire, the same bit is received at the other end. This is illustrated in the figure below where a DATA.request(0) on the left host leads to a Data.indication(1) on the right host.
Host A Physical link Host B DATA.ind(1) With the above transmission scheme, a bit is transmitted by setting the voltage on the electrical cable to a specific value during some period of time. We have seen that due to electromagnetic interferences, the voltage measured by the receiver can differ from the voltage set by the transmitter. This is the main cause of transmission errors. However, this is not the only type of problem that can occur.
Besides defining the voltages for bits 0 and 1, the above transmission scheme also specifies the duration of each bit. If one million bits are sent every second, then each bit lasts 1 microsecond. On each host, the transmission (resp. the reception) of each bit is triggered by a local clock having a 1 MHz frequency.
These clocks are the second source of problems when transmitting bits over a wire. Although the two clocks have the same specification, they run on different hosts, possibly at a different temperature and with a different source of energy. In practice, it is possible that the two clocks do not operate at exactly the same frequency. Assume that the clock of the transmitting host operates at exactly 1000000 Hz while the receiving clock operates at 999999 Hz.
This is a very small difference between the two clocks. However, when using the clock to transmit bits, this difference is important. With its 1000000 Hz clock, the transmitting host will generate one million bits during a period of one second.