An Introduction to Computer Networks, Study notes of Computer Networks

An Introduction to Computer Networks Release 1.8.15 Peter L Dordal

Typology: Study notes

2018/2019

Uploaded on 08/05/2019

rabin-gautam-1
rabin-gautam-1 🇳🇵

4

(1)

1 document

1 / 691

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
An Introduction to Computer Networks
Release 1.8.15
Peter L Dordal
December 03, 2015
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Partial preview of the text

Download An Introduction to Computer Networks and more Study notes Computer Networks in PDF only on Docsity!

An Introduction to Computer Networks

Release 1.8.

Peter L Dordal

December 03, 2015

viii

An Introduction to Computer Networks, Release 1.8.

Peter L Dordal

Department of Computer Science Loyola University Chicago

Contents:

CONTENTS 1

0 PREFACE

“No man but a blockhead ever wrote, except for money.” - Samuel Johnson

The textbook world is changing. On the one hand, open source software and creative-commons licensing have been great successes; on the other hand, unauthorized PDFs of popular textbooks are widely available, and it is time to consider flowing with rather than fighting the tide. Hence this open textbook, released for free under the Creative Commons license described below. Mene, mene, tekel pharsin.

Perhaps the last straw, for me, was patent 8195571 for a roundabout method to force students to purchase textbooks. (A simpler strategy might be to include the price of the book in the course.) At some point, faculty have to be advocates for their students rather than, well, Hirudinea.

This is not to say that I have anything against for-profit publishing. It is just that this particular book does not – and will not – belong to that category; the online edition will always be free. In this it is in good company: there is Wikipedia, there is Gnu/Linux, and there is an increasing number of other free online textbooks out there. The market inefficiencies of traditional publishing are sobering: the return to authors of advanced textbooks is at best modest, and costs to users are quite high. (None of this is meant to imply there will never be a print edition; when I started this project it seemed inconceivable that a print publisher would ever agree to having the online edition remain free, but times are changing.)

The official book website (potentially subject to change) is intronetworks.cs.luc.edu. The book is available there as online html, as a zipped archive of html files, in .pdf format, and in other formats as may prove useful.

0.1 Licensing

This text is released under the Creative Commons license Attribution-NonCommercial-NoDerivs. This text is like a conventional book, in other words, except that it is free. You may copy the work and distribute it to others for any noncommercial use, but all reuse requires attribution. Creation of derivative works – eg modifying chapters or creating additional chapters and distributing them as part of this work – also requires permission.

The work may not be used for commercial purposes without permission. Permission is likely to be granted for use and distribution of all or part of the work in for-profit and commercial training programs, provided there is no direct charge to recipients for the work and provided the free nature of the work is made clear to recipients (eg by including this preface). However, such permission must always be requested. Alternatively, participants in commercial programs may be instructed to download the work individually.

The Creative Commons license does not precisely spell out what constitutes “noncommercial” use. The author considers any sale of this book, even by a non-profit organization and even if the price just covers expenses, to be commercial use.

An Introduction to Computer Networks, Release 1.8.

0.2 Classroom Use

This book is meant as a serious and more-or-less thorough text for an introductory college or graduate course in computer networks, carefully researched, with consistent notation and style, and complete with diagrams and exercises. My intent is to create a text that covers to a reasonable extent why the Internet is the way it is, to avoid the endless dreary focus on TLA’s (Three-Letter Acronyms), and to remain not too mathematical. For the last, I have avoided calculus, linear algebra, and, for that matter, quadratic terms (though some inequalities do sneak in at times). That said, the book includes a large number of back-of-the-envelope calculations – in settings as concrete as I could make them – illustrating various networking concepts.

Overall, I tried to find a happy medium between practical matters and underlying principles. My goal has been to create a book that is useful to a broad audience, including those interested in network management, in high-performance networking, in software development, or just in how the Internet is put together.

One of the best ways to gain insight into why a certain design choice was made is to look at a few alterna- tive implementations. To that end, this book includes coverage of some topics one may never encounter in practice, but which may be useful as points of comparision. These topics arguably include ATM (3.5 Asyn- chronous Transfer Mode: ATM), SCTP (12.21.2 SCTP) and even 10 Mbps Ethernet (2.1 10-Mbps Classic Ethernet).

The book can also be used as a networks supplement or companion to other resources for a variety of other courses that overlap to some greater or lesser degree with networking. At Loyola, earlier versions of this material have been used – coupled with a second textbook – in courses in computer security, network management, telecommunications, and even introduction-to-computing courses for non-majors. Another possibility is an alternative or nontraditional presentation of networking itself. It is when used in concert with other works, in particular, that this book’s being free is of marked advantage.

Finally, I hope the book may also be useful as a reference work. To this end, I have attempted to ensure that the indexing and cross-referencing is sufficient to support the drop-in reader. Similarly, obscure notation is kept to a minimum.

Much is sometimes made, in the world of networking textbooks, about top-down versus bottom-up se- quencing. This book is not really either, although the chapters are mostly numbered in bottom-up fashion. Instead, the first chapter provides a relatively complete overview of the LAN, IP and transport network layers (along with a few other things), allowing subsequent chapters to refer to all network layers without forward reference, and, more importantly, allowing the chapters to be covered in a variety of different orders. As a practical matter, when I use this text to teach Loyola’s Introduction to Computer Networks course, I cover the IP/routing and TCP material more or less in parallel.

A distinctive feature of the book is the extensive coverage of TCP: TCP dynamics, newer versions of TCP such as TCP Cubic, and a chapter on using the ns-2 simulator to explore actual TCP behavior. This has its roots in a longstanding goal to find better ways to present competition and congestion in the classroom. Another feature is the detailed chapter on queuing disciplines.

One thing this book makes little attempt to cover in detail is the application layer; the token example in- cluded is SNMP. While SNMP actually makes a pretty good example of a self-contained application, my recommendation to instructors who wish to cover more familiar examples is to combine this text with the appropriate application documentation.

For those interested in using the book for a “traditional” networks course, I with some trepidation offer the following set of core material. In solidarity with those who prefer alternatives to a bottom-up ordering, I

4 0 Preface

An Introduction to Computer Networks, Release 1.8.

0.4 Technical considerations

The book was prepared in reStructuredText using the linux Sphinx package, which can produce multiple formats from the same source. That said, the primary format is html. The table-of-contents sidebar and the text sidebars work best there. The html version also provides a “Quick search” box, though it only works for all-alphabetic strings; strings with hyphens such as “wi-fi” and “Diffie-Hellman” fail. The index is an effective alternative.

This book uses a modest set of unicode special characters. Unfortunately, some of these characters are not universally available in all browsers. The comma-separated characters in the first line, below, appear to have the most limited support.

x,y,»,𝛼,𝛽,𝛾,𝜆,𝜑,𝜏 ,𝜚,∆,",ÝÑ,ÐÝ,ÐÑ (,),«,𝛼,𝛽,𝛾,𝜆,𝜑,𝜏 ,𝜌,∆,^, Ñ,Ð ,ÐÑ μ,?, 8 ,ď,ě,ˆ,˜,˘,–,‰,Ñ,Ð, , , , , , , , , , ,

The characters above should look roughly as they do in the following image:

If they do not, there are two options for browser-based viewing. If the second and third rows above display successfully, there is a unicode-safer version of the book (both online and zipped) available at intronet- works.cs.luc.edu that has the characters in the first row above replaced by those in the second row.

The other alternative is to add an appropriate font. Generally Firefox and Internet Explorer display the necessary characters out of the box, but Chrome does not. The Chrome situation can usually be fixed by adding a font and then tweaking the Chrome font settings. I have had good luck with Symbola (at shapecatcher.com/unicodefonts.html and other places). To install the font, extract the .ttf file and double- click on it. Then to adjust Chrome, go to Settings Ñ Show advanced settings Ñ Customize fonts (button), and change at a minimum the default Sans-serif font to Symbola. Then restart Chrome.

If no available browser properly displays the symbols above, I recommend the pdf or epub formats. The unicode-safer version, however, should work on most systems.

The diagrams in the body of the text are now all in bitmap .png format, although a few diagrams rendered with line-drawing characters still appear in the exercises. I would prefer to use the vector-graphics .svg format, but as of January 2014 most browsers do not appear to support zooming in on .svg images, which is really the whole point.

0.5 Recent Changes

Dec 3, 2015 (ver 1.8.15): Technical corrections to some exercises.

6 0 Preface

An Introduction to Computer Networks, Release 1.8.

Nov 24, 2015 (ver 1.8.14): Multiple small updates and clarifications, including to several exercises. Oct 18, 2015 (ver 1.8.13): Extensive revisions to 8 IP version 6.

Oct 14, 2015 (ver 1.8.12): Minor fixes and clarifications of some exercises. Oct 11, 2015 (ver 1.8.11): Solutions to a few of the exercises (those marked with ♢) are now provided, in 23 Selected Solutions. Hopefully this section will continue to expand. There is a correction to 10.6.7.1 BGP No-Valley Theorem and a reorganization of the exposition; there are also several minor changes to 8 IP version 6.

Sep 9, 2015 (ver 1.8.10): Miscellaneous clarifications; a paragraph on classless routing in 1.10 IP - Internet Protocol.

Aug 16, 2015 (ver 1.8.09): Sections on 4.2.3 Optical Transport Network and 11.1.3 netcat; miscellaneous updates.

Jul 23, 2015 (ver 1.8.08): Multiple changes to 2 Ethernet and 3.7 Wi-Fi; other changes as well. Jun 16, 2015 (ver 1.8.07): Corrections to 6.3.4 Simple Packet-Based Sliding-Windows Implementation and additions to 7.10 Internet Control Message Protocol and 8.9 ICMPv6. May 29, 2015 (ver 1.8.06): Section on RSA factoring (21.8.1.1 Factoring RSA Keys), fixed typos in 1.6 Routing Loops and 11.2 Fundamental Transport Issues.

May 24, 2015 (ver 1.8.05): Added discussion of the Logjam attack (21.7 Diffie-Hellman-Merkle Exchange).

May 22, 2015 (ver 1.8.04): Several additions to the wireless sections, including MIMO antennas (3.7.3 Multiple Spatial Streams) and LTE (3.8 WiMAX and LTE). Wireless LANs are now moved to the end of the chapter 3 Other LANs. May 1, 2015 (ver 1.8.03): This book is now available via IPv6! See 8.11 Using IPv6 and IPv4 Together. Also, corrections to exactly-once semantics in 11.4 Remote Procedure Call (RPC).

Apr 26, 2015 (ver 1.8.02): Numerous corrections and clarifications, and new sections on 12.21.1 MPTCP and 12.21.2 SCTP.

Mar 19, 2015: Added unicode-safer version (above), to support reading on most Android devices. Mar 14, 2015: Expanded and revised chapter 8 IP version 6, now including tunnel-broker IPv connections. Mar 3, 2015: New section on 7.7 DNS.

Feb 23, 2015: certificate pinning, sidebar on Superfish in 21.9.2.1 Certificate Authorities.

Feb 15, 2015: New material on IPv6, in particular 8.11 Using IPv6 and IPv4 Together. Jan, 2015: The chapter 21 Security is largely finished (eventually something on IPsec will be added).

0.6 Future Plans

addition of IPSEC

0.6 Future Plans 7

1 AN OVERVIEW OF NETWORKS

Somewhere there might be a field of interest in which the order of presentation of topics is well agreed upon.

Computer networking is not it.

There are many interconnections in the field of networking, as in most technical fields, and it is difficult to find an order of presentation that does not involve endless “forward references” to future chapters; this is true even if – as is done here – a largely bottom-up ordering is followed. I have therefore taken here a different approach: this first chapter is a summary of the essentials – LANs, IP and TCP – across the board, and later chapters expand on the material here.

Local Area Networks, or LANs, are the “physical” networks that provide the connection between machines within, say, a home, school or corporation. LANs are, as the name says, “local”; it is the IP, or Internet Protocol, layer that provides an abstraction for connecting multiple LANs into, well, the Internet. Finally, TCP deals with transport and connections and actually sending user data.

This chapter also contains some important other material. The section on datagram forwarding, central to packet-based switching and routing, is essential. This chapter also discusses packets generally, conges- tion, and sliding windows, but those topics are revisited in later chapters. Firewalls and network address translation are also covered here and not elsewhere.

1.1 Layers

These three topics – LANs, IP and TCP – are often called layers; they constitute the Link layer, the Internet- work layer, and the Transport layer respectively. Together with the Application layer (the software you use), these form the “four-layer model” for networks. A layer, in this context, corresponds strongly to the idea of a programming interface or library (though some of the layers are not accessible to ordinary users): an application hands off a chunk of data to the TCP library, which in turn makes calls to the IP library, which in turn calls the LAN layer for actual delivery.

The LAN layer is in charge of actual delivery of packets, using LAN-layer-supplied addresses. It is often conceptually subdivided into the “physical layer” dealing with, eg, the analog electrical, optical or radio signaling mechanisms involved, and above that an abstracted “logical” LAN layer that describes all the digital – that is, non-analog – operations on packets; see 2.1.4 The LAN Layer. The physical layer is generally of direct concern only to those designing LAN hardware; the kernel software interface to the LAN corresponds to the logical LAN layer. This LAN physical/logical division gives us the Internet five-layer model. This is less a formal hierarchy as an ad hoc classification method. We will return to this below in 1.16 IETF and OSI.

1.2 Bandwidth and Throughput

Any one network connection – eg at the LAN layer – has a data rate: the rate at which bits are transmitted. In some LANs (eg Wi-Fi) the data rate can vary with time. Throughput refers to the overall effective

An Introduction to Computer Networks, Release 1.8.

transmission rate, taking into account things like transmission overhead, protocol inefficiencies and perhaps even competing traffic. It is generally measured at a higher network layer than the data rate.

The term bandwidth can be used to refer to either of these, though we here try to use it mostly as a synonym for data rate. The term comes from radio transmission, where the width of the frequency band available is proportional, all else being equal, to the data rate that can be achieved.

In discussions about TCP, the term goodput is sometimes used to refer to what might also be called “application-layer throughput”: the amount of usable data delivered to the receiving application. Specif- ically, retransmitted data is counted only once when calculating goodput but might be counted twice under some interpretations of “throughput”.

Data rates are generally measured in kilobits per second (Kbps) or megabits per second (Mbps); in the context of data rates, a kilobit is 10^3 bits (not 2^10 ) and a megabit is 10^6 bits. The use of the lower-case “b” means bits; data rates expressed in terms of bytes often use an upper-case “B”.

1.3 Packets

Packets are modest-sized buffers of data, transmitted as a unit through some shared set of links. Of necessity, packets need to be prefixed with a header containing delivery information. In the common case known as datagram forwarding, the header contains a destination address; headers in networks using so-called virtual-circuit forwarding contain instead an identifier for the connection. Almost all networking today (and for the past 50 years) is packet-based, although we will later look briefly at some “circuit-switched” options for voice telephony.

At the LAN layer, packets can be viewed as the imposition of a buffer (and addressing) structure on top of low-level serial lines; additional layers then impose additional structure. Informally, packets are often referred to as frames at the LAN layer, and as segments at the Transport layer.

The maximum packet size supported by a given LAN (eg Ethernet, Token Ring or ATM) is an intrinsic attribute of that LAN. Ethernet allows a maximum of 1500 bytes of data. By comparison, TCP/IP packets originally often held only 512 bytes of data, while early Token Ring packets could contain up to 4KB of data. While there are proponents of very large packet sizes, larger even than 64KB, at the other extreme the ATM (Asynchronous Transfer Mode) protocol uses 48 bytes of data per packet, and there are good reasons for believing in modest packet sizes.

One potential issue is how to forward packets from a large-packet LAN to (or through) a small-packet LAN; in later chapters we will look at how the IP (or Internet Protocol) layer addresses this.

10 1 An Overview of Networks