<?xml version="1.0" encoding="UTF-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.1" version="1.1">
  <file original="NoName" source-language="en" datatype="plaintext" target-language="cs">
    <body>
      <trans-unit xml:space="preserve" id="edb36438cc06fead">
        <source>This is an unpolished draft of the third edition of this e-book. If you find any error or have suggestions to improve the text, please create an issue via https://github.com/CNP3/ebook/issues?milestone=3 or help us by providing pull requests to close the existing issues.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">7</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="5ee108cebb050297">
        <source>Applications</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">10</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="70f28bb71a24752b">
        <source>Networked applications do not exchange random messages. In order to ensure that the server is able to understand the queries sent by a client, and also that the client is able to understand the responses sent by the server, they must both agree on a set of syntactical and semantic rules. These rules define the format of the messages exchanged as well as their ordering. This set of rules is called an application-level `protocol`.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">25</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="6f3da8a8fd262b4c">
        <source>An `application-level protocol` is similar to a structured conversation between humans. Assume that Alice wants to know the current time but does not have a watch. If Bob passes close by, the following conversation could take place :</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">27</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="4a31d37d5747d49e">
        <source>Alice : `Hello`</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">29</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="6cff97a96dfaf0e4">
        <source>Bob : `Hello`</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">30</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="8300857ea2427f4a">
        <source>Alice : `What time is it ?`</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">31</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="c2755313e8e98695">
        <source>Bob : `11:55`</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">32</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="b7d7cc3d82029d42">
        <source>Alice : `Thank you`</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">33</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="dde25f8af9f722bc">
        <source>Bob : `You're welcome`</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">34</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="dae0d739e2f6c655">
        <source>Such a conversation succeeds if both Alice and Bob speak the same language. If Alice meets Tchang who only speaks Chinese, she won't be able to ask him the current time. A conversation between humans can be more complex. For example, assume that Bob is a security guard whose duty is to only allow trusted secret agents to enter a meeting room. If all agents know a secret password, the conversation between Bob and Trudy could be as follows :</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">41</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="f480daadd4ffb716">
        <source>Bob : `What is the secret password ?`</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">43</context>
        </context-group>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">49</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="d8a68b4da991859c">
        <source>Trudy : `1234`</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">44</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="ab48e4345d34f275">
        <source>Bob : `This is the correct password, you're welcome`</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">45</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="2f5076789b77ee5b">
        <source>If Alice wants to enter the meeting room but does not know the password, her conversation could be as follows :</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">47</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="493f780eb3a6987f">
        <source>Alice : `3.1415`</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">50</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="8e8b64bc09ae044d">
        <source>Bob : `This is not the correct password.`</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">51</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="d86cb7f312e71c53">
        <source>Let us first discuss the syntactical rules. We will later explain how the information flow can be organized by analyzing real networked applications.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">58</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="8d7a360b974dac06">
        <source>Application-layer protocols exchange two types of messages. Some protocols such as those used to support electronic mail exchange messages expressed as strings or lines of characters. As the transport layer allows hosts to exchange bytes, they need to agree on a common representation of the characters. The first and simplest method to encode characters is to use the :term:`ASCII` table. :rfc:`20` provides the ASCII table that is used by many protocols on the Internet. For example, the table defines the following binary representations :</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">60</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="b39741787036e401">
        <source>`A` : `1000011b`</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">62</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="e108ddb368651cf9">
        <source>`0` : `0110000b`</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">63</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="7f4ddc4b99f96ea9">
        <source>`z` : `1111010b`</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">64</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="90d896c2ae06fce9">
        <source>`@` : `1000000b`</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">65</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="fa502a70340959ed">
        <source>`space` : `0100000b`</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">66</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="06e4340b15651091">
        <source>In addition, the :term:`ASCII` table also defines several non-printable or control characters. These characters were designed to allow an application to control a printer or a terminal. These control characters include `CR` and `LF`, that are used to terminate a line, and the `Bell` character which causes the terminal to emit a sound.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">68</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="eadd4e95fd3d5e1f">
        <source>`carriage return` (`CR`) : `0001101b`</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">70</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="0b177a9df6b4cc1c">
        <source>`line feed` (`LF`) : `0001010b`</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">71</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="4e0b872815440175">
        <source>`Bell`: `0000111b`</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">72</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="235de64c29c76ed7">
        <source>The :term:`ASCII` characters are encoded as a seven bits field, but transmitted as an eight-bits byte whose high order bit is usually set to `0`. Bytes are always transmitted starting from the high order or most significant bit.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">74</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="4e05a92a8a3f67cb">
        <source>Most applications exchange strings that are composed of fixed or variable numbers of characters. A common solution to define the character strings that are acceptable is to define them as a grammar using a Backus-Naur Form (:term:`BNF`) such as the Augmented BNF defined in :rfc:`5234`. A BNF is a set of production rules that generate all valid character strings. For example, consider a networked application that uses two commands, where the user can supply a username and a password. The BNF for this application could be defined as shown in the figure below.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">76</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="d4d8f7cc86e3d656">
        <source>A simple BNF specification</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">82</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="b8cfaec21be68d58" weblate-flags="python-format">
        <source>The example above defines several terminals and two commands : `usercommand` and `passwordcommand`. The `ALPHA` terminal contains all letters in upper and lower case. In the `ALPHA` rule, `%x41` corresponds to ASCII character code 41 in hexadecimal, i.e. capital `A`.  The `CR` and `LF` terminals correspond to the carriage return and linefeed control characters. The `CRLF` rule concatenates these two terminals to match the standard end of line termination. The `DIGIT` terminal contains all digits. The `SP` terminal corresponds to the white space characters. The `usercommand` is composed of two strings separated by white space. In the ABNF rules that define the messages used by Internet applications, the commands are case-insensitive. The rule `"user"` corresponds to all possible cases of the letters that compose the word between brackets, e.g. `user`, `uSeR`, `USER`, `usER`, ... A `username` contains at least one letter and up to 8 letters. User names are case-sensitive as they are not defined as a string between brackets. The `password` rule indicates that a password starts with a letter and can contain any number of letters or digits. The white space and the control characters cannot appear in a `password` defined by the above rule.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">84</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="4a75b8c23510b4b2">
        <source>Besides character strings, some applications also need to exchange 16 bits and 32 bits fields such as integers. A naive solution would have been to send the 16- or 32-bits field as it is encoded in the host's memory. Unfortunately, there are different methods to store 16- or 32-bits fields in memory. Some CPUs store the most significant byte of a 16-bits field in the first address of the field while others store the least significant byte at this location. When networked applications running on different CPUs exchange 16 bits fields, there are two possibilities to transfer them over the transport service :</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">86</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="9fdb15f53e21d8a2">
        <source>send the most significant byte followed by the least significant byte</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">88</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="aad38db36c1ba7a7">
        <source>send the least significant byte followed by the most significant byte</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">89</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="538694314486c122">
        <source>The first possibility was named  `big-endian` in a note written by Cohen [Cohen1980]_ while the second was named `little-endian`. Vendors of CPUs that used `big-endian` in memory insisted on using `big-endian` encoding in networked applications while vendors of CPUs that used `little-endian` recommended the opposite. Several studies were written on the relative merits of each type of encoding, but the discussion became almost a religious issue [Cohen1980]_. Eventually, the Internet chose the `big-endian` encoding, i.e. multi-byte fields are always transmitted by sending the most significant byte first, :rfc:`791` refers to this encoding as the :term:`network-byte order`. Most libraries [#fhtonl]_ used to write networked applications contain functions to convert multi-byte fields from memory to the network byte order and the reverse.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">91</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="8075c4f87ad9450b">
        <source>Besides 16 and 32 bit words, some applications need to exchange data structures containing bit fields of various lengths. For example, a message may be composed of a 16 bits field followed by eight, one bit flags, a 24 bits field and two 8 bits bytes. Internet protocol specifications will define such a message by using a representation such as the one below. In this representation, each line corresponds to 32 bits and the vertical lines are used to delineate fields. The numbers above the lines indicate the bit positions in the 32-bits word, with the high order bit at position `0`.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">93</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="fe731472fbfd92c3">
        <source>Message format</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">99</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="4b8bf19a4231e8b1">
        <source>The message mentioned above will be transmitted starting from the upper 32-bits word in network byte order. The first field is encoded in 16 bits. It is followed by eight one bit flags (`A-H`), a 24 bits field whose high order byte is shown in the first line and the two low order bytes appear in the second line followed by two one byte fields. This ASCII representation is frequently used when defining binary protocols. We will use it for all the binary protocols that are discussed in this book.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">101</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="80b71d1dbba8e64b">
        <source>The peer-to-peer model emerged during the last ten years as another possible architecture for networked applications. In the traditional client-server model, hosts act either as servers or as clients and a server serves a large number of clients. In the peer-to-peer model, all hosts act as both servers and clients and they play both roles. The peer-to-peer model has been used to develop various networked applications, ranging from Internet telephony to file sharing or Internet-wide filesystems. A detailed description of peer-to-peer applications may be found in [BYL2008]_. Surveys of peer-to-peer protocols and applications may be found in [AS2004]_ and [LCP2005]_.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">105</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="f61b55e08b59c13c">
        <source>The transport layer</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">109</context>
        </context-group>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">122</context>
        </context-group>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">213</context>
        </context-group>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">526</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="a0ecf1fb376c0d2c">
        <source>The network layer ensures the delivery of packets on a hop-by-hop basis through intermediate nodes. As such, it provides a service to the upper layer. In practice, this layer is usually the `transport layer` that improves the service provided by the `network layer` to make it usable by applications.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">115</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="30e05f3af5b82c1d">
        <source>Most networks use a datagram organization and provide a simple service which is called the `connectionless service`.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">125</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="bdeaf54486877176">
        <source>The figure below provides a representation of the connectionless service as a `time-sequence diagram`. The user on the left, having address `S`, issues a `Data.request` primitive containing Service Data Unit (SDU) `M` that must be delivered by the service provider to destination `D`. The dashed line between the two primitives indicates that the `Data.indication` primitive that is delivered to the user on the right corresponds to the `Data.request` primitive sent by the user on the left.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">127</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="b4945d11f7f00661">
        <source>There are several possible implementations of the connectionless service. Before studying these realizations, it is useful to discuss the possible characteristics of the connectionless service. A `reliable connectionless service` is a service where the service provider guarantees that all SDUs submitted in `Data.requests` by a user will eventually be delivered to their destination. Such a service would be very useful for users, but guaranteeing perfect delivery is difficult in practice. For this reason, network layers usually support an `unreliable connectionless service`.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">146</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="b8a92dd88a5f6a6e">
        <source>An `unreliable connectionless` service may suffer from various types of problems compared to a `reliable connectionless service`. First of all, an `unreliable connectionless service` does not guarantee the delivery of all SDUs. This can be expressed graphically by using the time-sequence diagram below.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">148</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="3436b105688c7bfe">
        <source>In practice, an `unreliable connectionless service` will usually deliver a large fraction of the SDUs. However, since the delivery of SDUs is not guaranteed, the user must be able to recover from the loss of any SDU.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">165</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="f3d546bbaea0546b">
        <source>A second imperfection that may affect an `unreliable connectionless service` is that it may duplicate SDUs. Some packets may be duplicated in a network and be delivered twice to their destination. This is illustrated by the time-sequence diagram below.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">167</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="6e8e757483519aec">
        <source>Finally, some unreliable connectionless service providers may deliver to a destination a different SDU than the one that was supplied in the `Data.request`. This is illustrated in the figure below.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">185</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="e25c0a3fc022c216">
        <source>As the transport layer is built on top of the network layer, it is important to know the key features of the network layer service. In this book, we only consider the `connectionless network layer service` which is the most widespread. Its main characteristics are :</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">201</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="38383378dc2f5d9e">
        <source>the `connectionless network layer service` can only transfer SDUs of *limited size*</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">203</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="cbde6d4f1a8e4573">
        <source>the `connectionless network layer service` may discard SDUs</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">204</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="582ad13d2e228060">
        <source>the `connectionless network layer service` may corrupt SDUs</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">205</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="b998b073660f203f">
        <source>the `connectionless network layer service` may delay, reorder or even duplicate SDUs</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">206</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="a0045e95c12e73bd">
        <source>Transport layer services</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">219</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="9bdf85f63acf54ca">
        <source>When two applications need to communicate, they need to structure their exchange of information. Structuring this exchange of information requires solving two different problems. The first problem is how to represent the information being exchanged knowing that the two applications may be running on hosts that use different operating systems, different processors and have different conventions to store information. This requires a common syntax to transfer the information between the two applications. For this chapter, let us assume that this syntax exists and that the two applications simply need to exchange bytes. We will discuss later how more complex data can be encoded as sequences of bytes to be exchanged. The second problem is how to organize the interactions between the application and the underlying network. From the application's viewpoint, the `network` will appear as the `transport layer` service. This `transport layer` can provide three types of services to the applications :</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">222</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="c4c45192c4625b38">
        <source>the `connectionless service`</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">224</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="d4f425ebec43eae4">
        <source>the `connection oriented service`</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">225</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="4e32a5cebc5c9048">
        <source>the `request-response service`</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">226</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="344a73b73d52c775">
        <source>The connectionless service</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">229</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="7b89c395b7afd046">
        <source>The `connectionless service` that we have described earlier is frequently used by users who need to exchange small SDUs. It can be easily built on top of the connectionless network layer service that we have described earlier. Users needing to either send or receive several different and potentially large SDUs, or who need structured exchanges often prefer the `connection-oriented service`.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">231</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="13ef4cdeb557e40e">
        <source>The connection-oriented service</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">234</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="afaa4d332cae5b3e">
        <source>The establishment of a connection can be modeled by using four primitives : `Connect.request`, `Connect.indication`, `Connect.response` and `Connect.confirm`. The `Connect.request` primitive is used to request the establishment of a connection. The main parameter of this primitive is the `address` of the destination user. The service provider delivers a `Connect.indication` primitive to inform the destination user of the connection attempt. If it accepts to establish a connection, it responds with a `Connect.response` primitive. At this point, the connection is considered to be established and the destination user can start sending SDUs over the connection. The service provider processes the `Connect.response` and will deliver a `Connect.confirm` to the user who initiated the connection. The delivery of this primitive terminates the connection establishment phase. At this point, the connection is considered to be open and both users can send SDUs. A successful connection establishment is illustrated below.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">241</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="e6d9256e2f93fe67">
        <source>The example above shows a successful connection establishment. However, in practice not all connections are successfully established. One reason is that the destination user may not agree, for policy or performance reasons, to establish a connection with the initiating user at this time. In this case, the destination user responds to the `Connect.indication` primitive by a `Disconnect.request` primitive that contains a parameter to indicate why the connection has been refused. The service provider will then deliver a `Disconnect.indication` primitive to inform the initiating user.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">262</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="a20b5166365ca782">
        <source>A second reason is when the service provider is unable to reach the destination user. This might happen because the destination user is not currently attached to the network or due to congestion. In these cases, the service provider responds to the `Connect.request` with a `Disconnect.indication` primitive whose `reason` parameter contains additional information about the failure of the connection.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">283</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="13ce66241ff003f3">
        <source>Once the connection has been established, the service provider supplies two data streams to the communicating users. The first data stream can be used by the initiating user to send SDUs. The second data stream allows the responding user to send SDUs to the initiating user. The data streams can be organized in different ways. A first organization is the `message-mode` transfer. With the `message-mode` transfer, the service provider guarantees that one and only one `Data.indication` will be delivered to the endpoint of the data stream for each `Data.request` primitive issued by the other endpoint. The `message-mode` transfer is illustrated in the figure below. The main advantage of the `message-transfer` mode is that the recipient receives exactly the SDUs that were sent by the other user. If each SDU contains a command, the receiving user can process each command as soon as it receives a SDU.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">303</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="87d2e1134a040f00">
        <source>Unfortunately, the `message-mode` transfer is not widely used on the Internet. On the Internet, the most popular connection-oriented service transfers SDUs in `stream-mode`. With the `stream-mode`, the service provider supplies a byte stream that links the two communicating users. The sending user sends bytes by using `Data.request` primitives that contain sequences of bytes as SDUs. The service provider delivers SDUs containing consecutive bytes to the receiving user by using `Data.indication` primitives. The service provider ensures that all the bytes sent at one end of the stream are delivered correctly in the same order at the other endpoint. However, the service provider does not attempt to preserve the boundaries of the SDUs. There is no relation enforced by the service provider between the number of `Data.request` and the number of `Data.indication` primitives. The `stream-mode` is illustrated in the figure below. In practice, a consequence of the utilization of the `stream-mode` is that if the users want to exchange structured SDUs, they will need to provide the mechanisms that allow the receiving user to separate successive SDUs in the byte stream that it receives. Application layer protocols often use specific delimiters such as the end of line character to delineate SDUs in a bytestream.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">338</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="6b1a6cdb9d91f025">
        <source>An abrupt connection release can also be triggered by one of the users. If a user needs, for any reason, to terminate a connection quickly, it can issue a `Disconnect.request` primitive and to request an abrupt release. The service provider will process the request, stop the two data streams and deliver the `Disconnect.indication` primitive to the remote user as soon as possible. As illustrated in the figure below, this abrupt connection release may cause losses of SDUs.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">409</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="01f5e9acfda3b1dc">
        <source>To ensure a reliable delivery of the SDUs sent by each user over a connection, we need to consider the two streams that compose a connection as independent. A user should be able to release the stream that it uses to send SDUs once it has sent all the SDUs that it planned to send over this connection, but still continue to receive SDUs over the opposite stream. This `graceful` connection release is usually performed as shown in the figure below. One user issues a `Disconnect.request` primitive to its provider once it has issued all its `Data.request` primitives. The service provider will wait until all `Data.indication` primitives have been delivered to the receiving user before issuing the `Disconnnect.indication` primitive. This primitive informs the receiving user that it will no longer receive SDUs over this connection, but it is still able to issue `Data.request` primitives on the stream in the opposite direction. Once the user has issued all of its `Data.request` primitives, it issues a `Disconnnect.request` primitive to request the termination of the remaining stream. The service provider will process the request and deliver the corresponding `Disconnect.indication` to the other user once it has delivered all the pending `Data.indication` primitives. At this point, all data has been delivered, the two streams have been released successfully and the connection is completely closed.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">447</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="d30f504120e1fd17">
        <source>Reliability of the connection-oriented service</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">487</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="4aa917fa943f2c2d">
        <source>The request-response service</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">494</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="2698b5dcf5daab43">
        <source>The `request-response service` is a compromise between the `connectionless service` and the `connection-oriented service`. Many applications need to send a small amount of data and receive a small amount of information back. This is similar to procedure calls in programming languages. A call to a procedure takes a few arguments and returns a simple answer. In a network, it is sometimes useful to execute a procedure on a different host and receive the result of the computation. Executing a procedure on another host is often called Remote Procedure Call. It is possible to use the `connectionless service` for this application. However, since this service is usually unreliable, this would force the application to deal with any type of error that could occur. Using the `connection oriented service` is another alternative. This service ensures the reliable delivery of the data, but a connection must be created before the beginning of the data transfer. This overhead can be important for applications that only exchange a small amount of data.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">498</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="60458a45f20d36af">
        <source>The `request-response service` allows to efficiently exchange small amounts of information in a request and associate it with the corresponding response. This service can be depicted by using the time-sequence diagram below.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">500</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="68e4717abf6508dd">
        <source>Services and layers</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">519</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="4d1b238f8a445dae">
        <source>In the previous sections, we have described services that are provided by the transport layer. However, it is important to note that the notion of service is more general than in the transport layer. As explained earlier, the network layer also provides a service, which in most networks is an unreliable connectionless service. There are network layers that provide a connection-oriented service. Similarly, the datalink layer also provides services. Some datalink layers will provide a connectionless service. This will be the case in Local Area Networks for examples. Other datalink layers, e.g. in public networks, provide a connection oriented service.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">521</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="366c4d0da2fe1051">
        <source>To deal with these issues, the transport layer includes several mechanisms that depend on the service that it provides. It interacts with both the applications and the underlying network layer.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">536</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="5988144e8d0f06f2">
        <source>Interactions between the transport layer, its user, and its network layer provider</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">542</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="67e221487272356c">
        <source>We have already described in the datalink layers mechanisms to deal with data losses and transmission errors. These techniques are also used in the transport layer.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">544</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="f1993385e237646a">
        <source>Connectionless transport</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">548</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="4280258ad3ee8ef2">
        <source>The simplest service that can be provided in the transport layer is the connectionless transport service. Compared to the connectionless network layer service, this transport service includes two additional features :</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">550</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="a9c36cf6a693567b">
        <source>a `multiplexing technique` that enables several applications running on one host to exchange information with another host</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">553</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="8a9bc6cd91911a27">
        <source>To exchange data, the transport protocol encapsulates the SDU produced by its user inside a `segment`. The `segment` is the unit of transfer of information in the transport layer. Transport layer entities always exchange segments. When a transport layer entity creates a segment, this segment is encapsulated by the network layer into a packet which contains the segment as its payload and a network header. The packet is then encapsulated in a frame to be transmitted in the datalink layer.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">557</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="2b7e95e22760165c">
        <source>A `segment` also contains control information, usually stored inside a `header` and the payload that comes from the application. To detect transmission errors, transport protocols rely on checksums or CRCs like the datalink layer protocols.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">559</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="4c58a19f9732fc7b">
        <source>The figure below shows a typical usage of port numbers. The client process uses port number `1234` while the server process uses port number `5678`. When the client sends a request, it is identified as originating from port number `1234` on the client host and destined to port number `5678` on the server host. When the server process replies to this request, the server's transport layer returns the reply as originating from port  `5678` on the server host and destined to port `1234` on the client host.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">563</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="8bb8b563e08faa1c">
        <source>To support the connection-oriented service, the transport layer needs to include several mechanisms to enrich the connectionless network-layer service. We discuss these mechanisms in the following sections.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">571</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="2e9e5804b8bc092c">
        <source>Connection establishment</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">575</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="1f509ee4130e196e">
        <source>An important difference between the connectionless service and the connection-oriented one is that the transport entities in the latter maintain some state during lifetime of the connection. This state is created when a connection is established and is removed when it is released.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">579</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="9561e1687c6b144c">
        <source>Unfortunately, this scheme is not sufficient to ensure the reliability of the transport service. Consider for example a short-lived transport connection where a single, but important transfer (e.g. money transfer from a bank account) is sent. Such a short-lived connection starts with a `CR` segment acknowledged by a `CA` segment, then the data segment is sent, acknowledged and the connection terminates. Unfortunately, as the network layer service is unreliable, delays combined to retransmissions may lead to the situation depicted in the figure below, where a delayed `CR` and data segments from a former connection are accepted by the receiving entity as valid segments, and the corresponding data is delivered to the user. Duplicating SDUs is not acceptable, and the transport protocol must solve this problem.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">608</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="cb78b752b2666027">
        <source>To avoid these duplicates, transport protocols require the network layer to bound the `Maximum Segment Lifetime (MSL)`. The organization of the network must guarantee that no segment remains in the network for longer than `MSL` seconds. For example, on today's Internet, `MSL` is expected to be 2 minutes. To avoid duplicate transport connections, transport protocol entities must be able to safely distinguish between a duplicate `CR` segment and a new `CR` segment, without forcing each transport entity to remember all the transport connections that it has established in the past.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">648</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="2f34b033bbe8ebb1">
        <source>A classical solution to avoid remembering the previous transport connections to detect duplicates is to use a clock inside each transport entity. This `transport clock` has the following characteristics :</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">650</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="3ed8f2c68496b6e5">
        <source>the `transport clock` is implemented as a `k` bits counter and its clock cycle is such that :math:`2^k \times cycle &gt;&gt; MSL`. Furthermore, the `transport clock` counter is incremented every clock cycle and after each connection establishment. This clock is illustrated in the figure below.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">652</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="176d03678748d04c">
        <source>the `transport clock` must continue to be incremented even if the transport entity stops or reboots</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">653</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="a0d689573fc1a4a4">
        <source>Transport clock</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">659</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="4a8c92cf64abf398">
        <source>It should be noted that `transport clocks` do not need and usually are not synchronized to the real-time clock. Precisely synchronizing real-time clocks is an interesting problem, but it is outside the scope of this document. See [Mills2006]_ for a detailed discussion on synchronizing the real-time clock.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">662</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="a6a65b761d0d2056">
        <source>This `transport clock` can now be combined with an exchange of three segments, called the `three way handshake`, to detect duplicates. This `three way handshake` occurs as follows :</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">664</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="ac8036665ac45803">
        <source>The initiating transport entity sends a `CR` segment. This segment requests the establishment of a transport connection. It contains a port number (not shown in the figure) and a sequence number (`seq=x` in the figure below) whose value is extracted from the `transport clock`. The transmission of the `CR` segment is protected by a retransmission timer.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">666</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="b6a5daa21a0dfe53">
        <source>The remote transport entity processes the `CR` segment and creates state for the connection attempt. At this stage, the remote entity does not yet know whether this is a new connection attempt or a duplicate segment. It returns a `CA` segment that contains an acknowledgment number to confirm the reception of the `CR` segment (`ack=x` in the figure below) and a sequence number (`seq=y` in the figure below) whose value is extracted from its transport clock. At this stage, the connection is not yet established.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">668</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="61650340142dbccb">
        <source>The initiating entity receives the `CA` segment. The acknowledgment number of this segment confirms that the remote entity has correctly received the `CR` segment. The transport connection is considered to be established by the initiating entity and the numbering of the data segments starts at sequence number `x`. Before sending data segments, the initiating entity must acknowledge the received `CA` segments by sending another `CA` segment.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">670</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="ff9fb5bfcaf05d26">
        <source>The remote entity considers the transport connection to be established after having received the segment that acknowledges its `CA` segment. The numbering of the data segments sent by the remote entity starts at sequence number `y`.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">672</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="54a68525e1f7de7f">
        <source>The three way handshake is illustrated in the figure below.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">674</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="a02196afd924d26a">
        <source>Three-way handshake</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">680</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="5d0eb815f1669059">
        <source>Thanks to the three way handshake, transport entities avoid duplicate transport connections. This is illustrated by considering the three scenarios below.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">682</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="8b41a61dd2115ac8">
        <source>The first scenario is when the remote entity receives an old `CR` segment. It considers this `CR` segment as a connection establishment attempt and replies by sending a `CA` segment. However, the initiating host cannot match the received `CA` segment with a previous connection attempt. It sends a control segment (`REJECT` in the figure below) to cancel the spurious connection attempt. The remote entity cancels the connection attempt upon reception of this control segment.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">684</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="431c303c934c8c9c">
        <source>Three-way handshake : recovery from a duplicate `CR`</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">690</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="b2f2b08276e98930">
        <source>A second scenario is when the initiating entity sends a `CR` segment that does not reach the remote entity and receives a duplicate `CA` segment from a previous connection attempt. This duplicate `CA` segment cannot contain a valid acknowledgment for the `CR` segment as the sequence number of the `CR` segment was extracted from the transport clock of the initiating entity. The `CA` segment is thus rejected and the `CR` segment is retransmitted upon expiration of the retransmission timer.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">692</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="3587080ecc1e9c20">
        <source>Three-way handshake : recovery from a duplicate `CA`</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">699</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="c45f0a9d3b21737f">
        <source>Three-way handshake : recovery from duplicates `CR` and `CA`</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">707</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="15cd77899370a833">
        <source>Data transfer</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">711</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="d6a00e1524c5921d">
        <source>Now that the transport connection has been established, it can be used to transfer data. To ensure a reliable delivery of the data, the transport protocol will include sliding windows, retransmission timers and `go-back-n` or `selective repeat`. However, we cannot simply reuse the techniques from the datalink because a transport protocol needs to deal with more types of errors than a reliable protocol in datalink layer. The first difference between the two layers is the transport layer must face with more variable delays. In the datalink layer, when two hosts are connected by a link, the transmission delay or the round-trip-time over the link is almost fixed. In a network that can span the globe, the delays and the round-trip-times can vary significantly on a per packet basis. This variability can be caused by two factors. First, packets sent through a network do not necessarily follow the same path to reach their destination. Second, some packets may be queued in the buffers of routers when the load is high and these queuing delays can lead to increased end-to-end delays. A second difference between the datalink layer and the transport layer is that a network does not always deliver packets in sequence. This implies that packets may be reordered by the network. Furthermore, the network may sometimes duplicate packets. The last issue that needs to be dealt with in the transport layer is the transmission of large SDUs. In the datalink layer, reliable protocols transmit small frames. Applications could generate SDUs that are much larger than the maximum size of a packet in the network layer. The transport layer needs to include mechanisms to fragment and reassemble these large SDUs.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">713</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="3fb600b4b11ba0e2">
        <source>To deal with all these characteristics of the network layer, we need to adapt the techniques that we have introduced in the datalink layer.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">715</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="57e87dbaab8e0f62">
        <source>Using sequence numbers to count bytes has also one advantage when the transport layer needs to fragment SDUs in several segments. The figure below shows the fragmentation of a large SDU in two segments. Upon reception of the segments, the receiver will use the sequence numbers to correctly reorder the data.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">738</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="3885c64a29cde145">
        <source>`Go-back-n` and `selective repeat` can be used in the transport layer as in the datalink layer. Since the network layer does not guarantee an in-order delivery of the packets, a transport entity should always store the segments that it receives out-of-sequence. For this reason, most transport protocols will opt for some form of selective repeat mechanism.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">757</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="69cbfd1475fc0280">
        <source>In the datalink layer, the sliding window has usually a fixed size which depends on the amount of buffers allocated to the datalink layer entity. Such a datalink layer entity usually serves one or a few network layer entities. In the transport layer, the situation is different. A single transport layer entity serves a large and varying number of application processes. Each transport layer entity manages a pool of buffers that needs to be shared between all these processes. Transport entity are usually implemented inside the operating system kernel and shares memory with other parts of the system. Furthermore, a transport layer entity must support several (possibly hundreds or thousands) of transport connections at the same time. This implies that the memory which can be used to support the sending or the receiving buffer of a transport connection may change during the lifetime of the connection [#fautotune]_ . Thus, a transport protocol must allow the sender and the receiver to adjust their window sizes.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">759</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="3e86b7825e4ed46c">
        <source>To deal with this issue, transport protocols allow the receiver to advertise the current size of its receiving window in all the acknowledgments that it sends. The receiving window advertised by the receiver bounds the size of the sending buffer used by the sender. In practice, the sender maintains two state variables : `swin`, the size of its sending window (that may be adjusted by the system) and `rwin`, the size of the receiving window advertised by the receiver. At any time, the number of unacknowledged segments cannot be larger than :math:`\min(swin,rwin)` [#facklost]_ . The utilization of dynamic windows is illustrated in the figure below.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">761</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="562028e6bf3ee12d">
        <source>Dynamic receiving window</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">767</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="ae74c50f9fe0ad51">
        <source>The receiver may adjust its advertised receive window based on its current memory consumption, but also to limit the bandwidth used by the sender. In practice, the receive buffer can also shrink as the application may not able to process the received data quickly enough. In this case, the receive buffer may be completely full and the advertised receive window may shrink to `0`. When the sender receives an acknowledgment with a receive window set to `0`, it is blocked until it receives an acknowledgment with a positive receive window. Unfortunately, as shown in the figure below, the loss of this acknowledgment could cause a deadlock as the sender waits for an acknowledgment while the receiver is waiting for a data segment.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">769</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="17b4da4c52a6c7d7">
        <source>Risk of deadlock with dynamic windows</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">775</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="e00feb6a3b73b6fa">
        <source>To solve this problem, transport protocols rely on a special timer : the `persistence timer`. This timer is started by the sender whenever it receives an acknowledgment advertising a receive window set to `0`. When the timer expires, the sender retransmits an old segment in order to force the receiver to send a new acknowledgment, and hence send the current receive window size.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">780</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="4783961f12ab5b80">
        <source>To conclude our description of the basic mechanisms found in transport protocols, we still need to discuss the impact of segments arriving in the wrong order. If two consecutive segments are reordered, the receiver relies on their sequence numbers to reorder them in its receive buffer. Unfortunately, as transport protocols reuse the same sequence number for different segments, if a segment is delayed for a prolonged period of time, it might still be accepted by the receiver. This is illustrated in the figure below where segment `D(1,b)` is delayed.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">782</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="1c2affd8cade7645">
        <source>Ambiguities caused by excessive delays</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">789</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="71fcce189c811807">
        <source>To deal with this problem, transport protocols combine two solutions. First, they use 32 bits or more to encode the sequence number in the segment header. This increases the overhead, but also increases the delay between the transmission of two different segments having the same sequence number. Second, transport protocols require the network layer to enforce a `Maximum Segment Lifetime (MSL)`. The network layer must ensure that no packet remains in the network for more than MSL seconds. In the Internet the MSL is assumed [#fmsl]_ to be 2 minutes :rfc:`793`. Note that this limits the maximum bandwidth of a transport protocol. If it uses `n` bits to encode its sequence numbers, then it cannot send more than :math:`2^n` segments every MSL seconds.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">793</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="66a2c90b751d376e">
        <source>Connection release</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">797</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="b809832a0b530cca">
        <source>When we discussed the connection-oriented service, we mentioned that there are two types of connection releases : `abrupt release` and `graceful release`.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">801</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="c8db135c113f235f">
        <source>Abrupt connection release</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">810</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="5719f9a775a3ed01">
        <source>As the entity that sends the `DR` segment cannot know whether the other entity has already sent all its data on the connection, SDUs can be lost during such an `abrupt connection release`.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">812</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="e180e71d041e1754">
        <source>The second method to release a transport connection is to release independently the two directions of data transfer. Once a user of the transport service has sent all its SDUs, it performs a `DISCONNECT.req` for its direction of data transfer. The transport entity sends a control segment to request the release of the connection *after* the delivery of all previous SDUs to the remote user. This is usually done by placing in the `DR` the next sequence number and by delivering the `DISCONNECT.ind` only after all previous `DATA.ind`. The remote entity confirms the reception of the `DR` segment and the release of the corresponding direction of data transfer by returning an acknowledgment. This is illustrated in the figure below.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">816</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="78278d8b1e809aa5">
        <source>Graceful connection release</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">822</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="c463aea6549199a2">
        <source>Footnotes</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">827</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="d08c348785a78bf4">
        <source>For example, the :manpage:`htonl(3)` (resp. :manpage:`ntohl(3)`) function the standard C library converts a 32-bits unsigned integer from the byte order used by the CPU to the network byte order (resp. from the network byte order to the CPU byte order). Similar functions exist in other programming languages.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">828</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="3ddb41cd29529650">
        <source>In the application layer, most servers are implemented as processes. The network and transport layer on the other hand are usually implemented inside the operating system and the amount of memory that they can use is limited by the amount of memory allocated to the entire kernel.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">830</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="37b854899436afe7">
        <source>For a discussion on how the sending buffer can change, see e.g. [SMM1998]_</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">834</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="b7f900f1c97f8800">
        <source>Note that if the receive window shrinks, it might happen that the sender has already sent a segment that is not anymore inside its window. This segment will be discarded by the receiver and the sender will retransmit it later.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">836</context>
        </context-group>
      </trans-unit>
      <trans-unit xml:space="preserve" id="d1c3a4569ac0335f">
        <source>In reality, the Internet does not strictly enforce this MSL. However, it is reasonable to expect that most packets on the Internet will not remain in the network during more than 2 minutes. There are a few exceptions to this rule, such as :rfc:`1149` whose implementation is described in http://www.blug.linux.no/rfc1149/ but there are few real links supporting :rfc:`1149` in the Internet.</source>
        <target></target>
        <context-group name="" purpose="location">
          <context context-type="sourcefile">../../principles/transport.rst</context>
          <context context-type="linenumber">838</context>
        </context-group>
      </trans-unit>
    </body>
  </file>
</xliff>
