Skip to content

Commit

Permalink
update for 2021 pdf version
Browse files Browse the repository at this point in the history
  • Loading branch information
obonaventure committed Jan 5, 2021
1 parent feb750f commit d465b9b
Show file tree
Hide file tree
Showing 32 changed files with 98 additions and 91 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ pkt/*png
python/*
# tmp files during builds
tmp/*
# venv for python build
venv/*
6 changes: 3 additions & 3 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
# The short X.Y version.
version = '3'
# The full version, including alpha/beta/rc tags.
release = 'alpha'
release = '2021'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand All @@ -97,11 +97,11 @@

# List of directories, relative to source directory, that shouldn't be searched
# for source files.
exclude_trees = ['_build']
exclude_trees = ['_build', 'venv', 'python', 'tmp']

# List of files that should not be automatically compiled by sphynx because they are included

exclude_patterns = [ '*#*', "python/*" , "principles/dv.rst", "principles/linkstate.rst", '\._*rst']
exclude_patterns = [ '*#*', "python/*" , "principles/dv.rst", "principles/linkstate.rst", '\._*rst', "venv/*", "tmp/*"]

# epilog add to all included files
#rst_epilog = """
Expand Down
1 change: 0 additions & 1 deletion exercises/routing-protocols.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1206,7 +1206,6 @@ d. What are the BGP messages that will be exchanged when the link between ``AS3`
\node[as, right=of AS4] (AS5) {AS5};
\node[as, right=of AS5] (AS7) {AS7};
\node[as, right=of AS6] (AS8) {AS8};
\node[as, right=of AS7] (AS8) {AS8};
\node[as, right=of AS8] (AS1) {AS1};
\node[as, right=of AS7] (AS9) {AS9};

Expand Down
20 changes: 5 additions & 15 deletions glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Glossary
.. glossary::
:sorted:

ascii
ASCII
The American Standard Code for Information Interchange (ASCII) is a character-encoding scheme that defines a binary representation for characters. The ASCII table contains both printable characters and control characters. ASCII characters were encoded in 7 bits and only contained the characters required to write text in English. Other character sets such as Unicode have been developed later to support all written languages.

anycast
Expand Down Expand Up @@ -52,9 +52,6 @@ Glossary
PBL
Problem-based learning is a teaching approach that relies on problems.

DNS
The Domain Name System is a distributed database that allows to map names on IP addresses.

packet
a packet is the unit of information transfer in the network layer

Expand Down Expand Up @@ -190,16 +187,11 @@ Glossary
SMTP
The Simple Mail Transfer Protocol is defined in :rfc:`821`

POP
The Post Office Protocol is defined in :rfc:`1939`

IMAP
The Internet Message Access Protocol is defined in :rfc:`3501`

FTP
The File Transfer Protocol is defined in :rfc:`959`

SSH
ssh
The Secure Shell (SSH) Transport Layer Protocol is defined in :rfc:`4253`

telnet
Expand All @@ -210,7 +202,7 @@ Glossary


DNS
The Domain Name System is defined in :rfc:`1035`
The Domain Name System is a distributed database that allows to map names on IP addresses. It is defined in :rfc:`1035`

RPC
Several types of remote procedure calls have been defined. The RPC mechanism defined in :rfc:`5531` is used by applications such as NFS
Expand Down Expand Up @@ -269,9 +261,7 @@ Glossary
ARP
The Address Resolution Protocol is a protocol used by IPv4 devices to obtain the datalink layer address that corresponds to an IPv4 address on the local area network. ARP is defined in :rfc:`826`

ISO
The International Standardization Organization

minicomputer
A minicomputer is a multi-user system that was typically used in the 1960s/1970s to serve departments. See the corresponding Wikipedia article for additional information : https://en.wikipedia.org/wiki/Minicomputer

Expand All @@ -290,7 +280,7 @@ Glossary
ISO-3166
An :term:`ISO` standard that defines codes to represent countries and their subdivisions. See http://www.iso.org/iso/country_codes.htm

vnc
VNC
A networked application that allows to remotely access a computer's Graphical User Interface. See https://en.wikipedia.org/wiki/Virtual_Network_Computing

ISP
Expand Down
10 changes: 7 additions & 3 deletions index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ Computer Networking : Principles, Protocols and Practice, third edition

The development of this edition of the textbook is carried out on `https://github.com/CNP3/ebook <https://github.com/CNP3/ebook>`_

The source code of the entire textbook is written in `reStructuredText <http://docutils.sourceforge.net/rst.html>`_ and uses several `sphinx <http://sphinx.pocoo.org>`_ features. You can browse these sources from `github <https://github.com/CNP3/ebook/tree/master>`_
The source code of the entire textbook is written in `reStructuredText <http://docutils.sourceforge.net/rst.html>`_ and uses several `sphinx <http://sphinx.pocoo.org>`_ features. You can browse these sources from `github <https://github.com/CNP3/ebook/tree/master>`_ You can download a pdf version from :download:`tmp/latex/CNP3.pdf`

You can access a demo version of the e-book from `http://beta.computer-networking.info <http://beta.computer-networking.info>`_
The online version of the e-book at `http://beta.computer-networking.info <http://beta.computer-networking.info>`_ contains online exercises.



.. _toc:

.. toctree::
Expand Down Expand Up @@ -104,7 +106,9 @@ Part 3: Practice
exercises/routing-protocols
exercises/lan

.. exercises/ex-app

.. old
.. exercises/ex-app
.. exercises/netkit-app
.. exercises/netkit-tcp
.. exercises/packetdrill
Expand Down
8 changes: 4 additions & 4 deletions principles/dv.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ To understand the operation of a distance vector protocol, let us consider the n

.. figure:: /principles/figures/dv-1.png
:align: center
:scale: 100
:scale: 120

Operation of distance vector routing in a simple network

Expand All @@ -80,7 +80,7 @@ At this point, all routers can reach all other routers in the network thanks to

.. figure:: /principles/figures/dv-full.png
:align: center
:scale: 100
:scale: 120

Routing tables computed by distance vector in a simple network

Expand All @@ -104,7 +104,7 @@ At this point, all routers have a routing table allowing them to reach all other

.. figure:: /principles/figures/dv-failure-2.png
:align: center
:scale: 100
:scale: 120

Routing tables computed by distance vector after a failure

Expand Down Expand Up @@ -160,7 +160,7 @@ Unfortunately, split-horizon, is not sufficient to avoid all count to infinity p

.. figure:: /principles/figures/dv-infinity.png
:align: center
:scale: 100
:scale: 120

Count to infinity problem

Expand Down
Binary file added principles/figures/gbn-rec2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added principles/figures/gbn-sender2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added principles/figures/gbnex2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added principles/figures/piggyback2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added principles/figures/selrepeatwin2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added principles/figures/slidingwin2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions principles/linkstate.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ When a link-state router boots, it first needs to discover to which routers it i

.. figure:: /principles/figures/ls-hello.png
:align: center
:scale: 100
:scale: 70

The exchange of HELLO messages

Expand Down Expand Up @@ -90,7 +90,7 @@ To ensure that all routers receive all LSPs, even when there are transmissions e

.. figure:: /principles/figures/ls-lsdb.png
:align: center
:scale: 100
:scale: 120

Link state databases received by all routers

Expand All @@ -106,7 +106,7 @@ When a link fails, the two routers attached to the link detect the failure by th

.. figure:: /principles/figures/ls-twoway.png
:align: center
:scale: 100
:scale: 120

The two-way connectivity check

Expand All @@ -119,7 +119,7 @@ To compute its forwarding table, each router computes the spanning tree rooted a

.. figure:: /principles/figures/ls-computation.png
:align: center
:scale: 100
:scale: 120

Computation of the forwarding table

Expand Down
10 changes: 5 additions & 5 deletions principles/referencemodels.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ An important point to note about the Physical layer is the service that it provi

.. figure:: /principles/figures/ref-model-phys.png
:align: center
:scale: 80
:scale: 100

The Physical layer

Expand Down Expand Up @@ -75,7 +75,7 @@ The `Datalink layer` allows directly connected hosts to exchange information, bu

.. figure:: /principles/figures/ref-model-net.png
:align: center
:scale: 80
:scale: 100

The network layer

Expand All @@ -91,7 +91,7 @@ There are different types of transport layers. The most widely used transport la

.. figure:: /principles/figures/ref-model-transport.png
:align: center
:scale: 80
:scale: 100

The transport layer

Expand All @@ -104,7 +104,7 @@ The upper layer of our architecture is the `Application layer`. This layer inclu

.. figure:: /principles/figures/ref-model-app.png
:align: center
:scale: 50
:scale: 100

The Application layer

Expand Down Expand Up @@ -153,7 +153,7 @@ Compared to the five layers reference model explained above, the :term:`OSI` ref

.. figure:: /principles/figures/ref-model-osi.png
:align: center
:scale: 80
:scale: 100

The seven layers of the OSI reference model

Expand Down
30 changes: 15 additions & 15 deletions principles/reliability.rst
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ Many other types of encodings have been defined to transmit information over an

.. figure:: figures/manchester.png
:align: center
:scale: 70
:scale: 50

Manchester encoding

Expand All @@ -173,7 +173,7 @@ Many other types of encodings have been defined to transmit information over an

.. figure:: figures/physical-layer.png
:align: center
:scale: 80
:scale: 100

The Physical layer

Expand Down Expand Up @@ -559,7 +559,7 @@ The Alternating Bit Protocol uses a single bit to encode the sequence number. It

.. figure:: figures/abp-sender-fsm.png
:align: center
:scale: 80
:scale: 60

Alternating bit protocol : Sender FSM

Expand All @@ -571,7 +571,7 @@ The receiver first waits for `D(0,...)`. If the frame contains a correct `CRC`,

.. figure:: figures/abp-receiver-fsm.png
:align: center
:scale: 70
:scale: 60

Alternating bit protocol : Receiver FSM

Expand Down Expand Up @@ -686,7 +686,7 @@ Go-back-n and selective repeat

To overcome the performance limitations of the alternating bit protocol, reliable protocols rely on `pipelining`. This technique allows a sender to transmit several consecutive frames without being forced to wait for an acknowledgment after each frame. Each data frame contains a sequence number encoded in an `n` bits field.

.. figure:: figures/pipelining.png
.. figure:: figures/pipelining2.png
:align: center
:scale: 70

Expand All @@ -696,9 +696,9 @@ To overcome the performance limitations of the alternating bit protocol, reliabl

This is implemented by using a `sliding window`. The sliding window is the set of consecutive sequence numbers that the sender can use when transmitting frames without being forced to wait for an acknowledgment. The figure below shows a sliding window containing five segments (`6,7,8,9` and `10`). Two of these sequence numbers (`6` and `7`) have been used to send frames and only three sequence numbers (`8`, `9` and `10`) remain in the sliding window. The sliding window is said to be closed once all sequence numbers contained in the sliding window have been used.

.. figure:: figures/slidingwin.png
.. figure:: figures/slidingwin2.png
:align: center
:scale: 70
:scale: 100

The sliding window

Expand All @@ -707,7 +707,7 @@ The figure below illustrates the operation of the sliding window. It uses a slid

.. figure:: figures/gbnwin.png
:align: center
:scale: 70
:scale: 60

Sliding window example

Expand All @@ -717,7 +717,7 @@ In practice, as the frame header includes an `n` bits field to encode the sequen

.. figure:: figures/gbnwinex.png
:align: center
:scale: 70
:scale: 60

Utilisation of the sliding window with modulo arithmetic

Expand All @@ -737,7 +737,7 @@ The simplest sliding window protocol uses the `go-back-n` recovery. Intuitively,
The figure below shows the FSM of a simple `go-back-n` receiver. This receiver uses two variables : `lastack` and `next`. `next` is the next expected sequence number and `lastack` the sequence number of the last data frame that has been acknowledged. The receiver only accepts the frame that are received in sequence. `maxseq` is the number of different sequence numbers (:math:`2^n`).


.. figure:: figures/gbn-rec.png
.. figure:: figures/gbn-rec2.png
:align: center
:scale: 70

Expand All @@ -747,16 +747,16 @@ The figure below shows the FSM of a simple `go-back-n` receiver. This receiver u
A `go-back-n` sender is also very simple. It uses a sending buffer that can store an entire sliding window of frames [#fsizesliding]_ . The frames are sent with increasing sequence numbers (modulo `maxseq`). The sender must wait for an acknowledgment once its sending buffer is full. When a `go-back-n` sender receives an acknowledgment, it removes from the sending buffer all the acknowledged frames and uses a retransmission timer to detect frame losses. A simple `go-back-n` sender maintains one retransmission timer per connection. This timer is started when the first frame is sent. When the `go-back-n sender` receives an acknowledgment, it restarts the retransmission timer only if there are still unacknowledged frames in its sending buffer. When the retransmission timer expires, the `go-back-n` sender assumes that all the unacknowledged frames currently stored in its sending buffer have been lost. It thus retransmits all the unacknowledged frames in the buffer and restarts its retransmission timer.


.. figure:: figures/gbn-sender.png
.. figure:: figures/gbn-sender2.png
:align: center
:scale: 70
:scale: 60

Go-back-n : sender FSM


The operation of `go-back-n` is illustrated in the figure below. In this figure, note that upon reception of the out-of-sequence frame `D(2,c)`, the receiver returns a cumulative acknowledgment `C(OK,0)` that acknowledges all the frames that have been received in sequence. The lost frame is retransmitted upon the expiration of the retransmission timer.

.. figure:: figures/gbnex.png
.. figure:: figures/gbnex2.png
:align: center
:scale: 70

Expand All @@ -777,7 +777,7 @@ The main advantage of `go-back-n` is that it can be easily implemented, and it c

A `selective repeat` receiver maintains a sliding window of `W` frames and stores in a buffer the out-of-sequence frames that it receives. The figure below shows a five-frame receive window on a receiver that has already received frames `7` and `9`.

.. figure:: figures/selrepeatwin.png
.. figure:: figures/selrepeatwin2.png
:align: center
:scale: 70

Expand Down Expand Up @@ -862,7 +862,7 @@ In the figure above, when the sender receives `C(OK,0,[2])`, it knows that all f

Reliable protocols often need to send data in both directions. To reduce the overhead caused by the acknowledgments, most reliable protocols use `piggybacking`. Thanks to this technique, a datalink entity can place the acknowledgments and the receive window that it advertises for the opposite direction of the data flow inside the header of the data frames that it sends. The main advantage of piggybacking is that it reduces the overhead as it is not necessary to send a complete frame to carry an acknowledgment. This is illustrated in the figure below where the acknowledgment number is underlined in the data frames. Piggybacking is only used when data flows in both directions. A receiver will generate a pure acknowledgment when it does not send data in the opposite direction as shown in the bottom of the figure.

.. figure:: figures/piggyback.png
.. figure:: figures/piggyback2.png
:align: center
:scale: 70

Expand Down
Loading

0 comments on commit d465b9b

Please sign in to comment.