Before a Receiving Host Can Even Examine the Tcp or Udp Header, Which of the Following Must Happen?

Henrik Frystyk, July 1994

WWW Icon The Internet Protocol Stack


As mentioned in the Internet Department the Cyberspace is an brainchild from the underlying network technologies and physical accost resolution. This section introduces the basic components of the Internet protocol stack and relates the stack to the ISO OSI reference protocol stack model. The model of the Internet protocol stack is illustrated in the figure below.

This documents describes the various parts presented in this diagram. The upper layer protocols, due east.g., FTP, Telnet, TFTP etc. are described in the Presentation Layer Protocol section. This leaves the following topics as sections in this document:

  1. Internet Protocol (IP)
  2. User Datagram Protocol (UDP)
  3. Transmission Control Protocol (TCP)
  4. Transactional Transmission Control Protocol (T/TCP)
  5. TCP/IP and OSI/RM

Internet Protocol (IP)

As seen in the figure in a higher place, the Net protocol stack provides a connection oriented reliable branch (TCP) and an connectionless unreliable branch (UDP) both build on acme of the Internet Protocol.

The Internet Protocol layer in the TCP/IP protocol stack is the showtime layer that introduces the virtual network abstraction that is the basic principle of the Net model. All concrete implementation details (ideally fifty-fifty though this is not quite true) are hidden below the IP layer. The IP layer provides an unreliable, connectionless delivery arrangement. The reason why it is unreliable stem from the fact the protocol does not provide any functionality for error recovering for datagrams that are either duplicated, lost or arrive to the remote host in another order than they are send. If no such errors occur in the physical layer, the IP protocol guarantees that the transmission is terminated successfully.

The basic unit of data exchange in the IP layer is the Internet Datagram. The format of an IP datagram and a short description of the most of import fields are included below:

LEN
The number of 32 bit-segments in the IP header. Without whatever OPTIONS, this value is v
TYPE OF SERVICE
Each IP datagram can be given a precedence value ranging from 0-7 showing the importance of the datagram. This is to let out-of-band data to be routed faster than normal data. This is very of import as Internet Control Bulletin Protocol (ICMP) letters travels as the data function of an IP datagram. Even though an ICMP bulletin is encapsulated in a IP datagram, the ICMP protocol is unremarkably idea of equally a integral part of the IP layer and not the UDP or TCP layer. Furthermore, the Type OF SERVICE field allows a nomenclature of the datagram in club to specify is the service desired requires short delay time, high reliability or loftier throughput. Notwithstanding, in order for this to have any event, the gateways must know more than i route to the remote host and every bit described in the Introduction, this is not the case.
IDENT, FLAGS, and FRAGMENT OFFSET
These fields are used to describe fragmentation of a datagram. The bodily length of an IP datagram is in principle contained of the length of the physical frames being transferred on the network, referred to as the network's Maximum Transfer Unit of measurement (MTU). If a datagram is longer than the MTU then it is divided in to a set of fragments having nigh the aforementioned header as the original datagram but only the amount of data that fits into a concrete frame. The IDENT flag is used to place segments belonging to the same datagram, and the FRAGMENT OFFSET is the relative position of the fragment within the original datagram. Once a datagram is fragmented it stays like that until it receives the final destination. If one or more segments are lost or erroneous the whole datagram is discarded.

However, the underlying network technology is not completely hidden beneath the IP layer in spite of the fragmentation functionality. The reason is that the MTU tin vary from 128 or less to several thousands of bytes dependent of the physical network (Ethernet has a MTU of 1500 bytes). Information technology is hence question of efficiency when choosing the right datagram size so that fragmentation is minimized. It is recommended that gateways are capable of handling datagrams of at least 576 bytes without having to employ fragmentation.

TIME
This is the remaining Time To Live (TTL) for a datagram when it travels on the Internet. The Routing Information Protocol (RIP) specifies that at most 15 hops are allowed.
SOURCE IP-ADDRESS and DESTINATION IP-Accost
Both the source and destination accost is indicated in the datagram header so that the recipient can ship an reply back to the transmitting host. Notwithstanding, notation that only the host address is specified - non the port number. This is because the IP protocol is an IMP-to-IMP protocol - it is not an end-to-end protocol. A layer more is needed to really specify which two processes on the transmitting host and the final destination that should receive the datagrams.
Note that the IP-datagram merely leaves space for the original source IP-address and the original destination IP-addrss. Equally mentioned in the department Gateways and Routing the next hop address is specified by encapsulation. The Net Layer passes the IP-addres of the adjacent hop address to the Network Layer. This IP-address is spring to a physical address and a new frame is formed with this address. The residuum of the original frame is then encapsulated in the new frame before it is send over the communication aqueduct.

User Datagram Protocol (UDP)

The User Datagram Protocol (UDP) is a very thin protocol build on height of the Internet Protocol. The basic unit of data is a User datagram and the UDP protocol provides the same unreliable, connectionless service transferring user datagrams as the IP protocol does transferring its datagrams. The principal difference is that the UDP protocol is an stop-to-end protocol. That is, information technology contains enough information to transfer a user datagram from i process on the transmitting host to some other procedure on the receiving host. The format of a user datagram is illustrated below:

The LENGTH field is the length of the user datagram including the header, that is the minimum value of LENGTH is eight bytes. The SOURCE PORT and DESTINATION PORT are the connection between a IP-accost and a procedure running on a host. A network port is normally identified by an integer. Still, the user datagram does not contain any IP-address so how does the UDP protocol know when the final destination is reached?

When calculating the CHECKSUM header, the UDP protocol appends a 12-byte pseudo header consisting of the SOURCE IP-ADDRESS, the DESTINATION IP-Address and some additional fields. When a host receives a UDP datagram information technology takes the UDP header and creates a new pseudo header using its own IP-address as the DESTINATION IP-Address and the SOURCE IP-ADDRESS extracted from the IP datagram. And so it calculates a checksum and if it equals the UDP checksum, and so the datagram has received the final destination.

As indicated in the Net Protocol Stack Figure the UDP protocol is frequently used as the basic protocol in customer-server application protocols such as TFTP, DNS etc. where the overhead of making a reliable, connection oriented transmission is considerable. This problem will be considered farther in the next two sections.

Manual Control Protocol (TCP)

The Transmission Control Protocol provides a full duplex, reliable, connection oriented service to the application layer every bit indicated in the Net Protocol Stack Figure. This section described the bones principle of the TCP protocol and how it provides a reliable service to the awarding layer protocols.

The TCP protocol is a stream oriented protocol. It is designed to provide the application layer software with a service to transfer large amount of data in a reliable way. It establishes a full duplex virtual circuit betwixt the two transmitting hosts and then that both host simultaneously can put data out on the Net without specifying the destination host one time the connexion is established. In the Transactional Transmission Command Protocol (T/TCP) section an client-server based extension to the TCP protocol is presented as an alternative to the stream compages.

TCP Segment Format

A segment is the basic data unit in the TCP protocol. As much of the post-obit sections are based on this data unit, the format is presented here:

SOURCE PORT, DESTINATION PORT
The TCP protocol uses the same trick of using a pseudo header instead of transmitting the source IP-address and the destination IP-address as is already included in the IP-datagram. Therefore merely the port numbers are required to uniquely define the communicating hosts.
Code
This field is used to indicate the content of the segment and if a specific activeness has to be taken such as if the sender has reached EOF in the stream.
OPTIONS
The TCP protocol uses the OPTIONS field to exchange information similar maximum segment size accustomed between the TCP layers on the two hosts. The flags currently defined are
  • URG Urgent pointer field is valid
  • ACK Acknowledgement field is valid
  • PSH This segment requests a push
  • RST Reset the connexion
  • SYN Synchronize sequence numbers
  • FIN Sender has reached finish of its byte stream
OFFSET
This integer indicates the offset of the user data within the segment. This field is simply required as the number of bits used in the OPTIONS field can vary
URGENT POINTER
This field tin exist initialized to point to a identify in the user data where urgent information such as escape codes etc. are placed. So the receiving host tin can process this function immediately when it receives the segment.

Reliable Transmission

At the IP-protocol layer packets tin get discarded due to network congestion, noise gateway failure etc. In order to provide a reliable service, the TCP must recover from information that is damaged, lost, duplicated, or delivered out of order by the Internet advice system. This is achieved by assigning a SEQUENCE NUMBER to each byte transmitted, and requiring a positive acknowledgment (ACK) from the receiving host. If the ACK is not received within a timeout interval, the information is retransmitted. At the receiver, the sequence numbers are used to correctly gild segments that may be received out of guild and to eliminate duplicates. Damage is handled by calculation a checksum to each segment transmitted, checking it at the receiver, and discarding damaged segments. The principle is illustrated in the effigy beneath:

Host A is transmitting a packet of data to Host B, merely the packet gets lost earlier it reaches its destination. However, Host A has prepare upwards a timer when to wait the ACK from Host B so when this timer runs out, the bundle is retransmitted. The difficult office of the method is to observe a value of the fourth dimension out flow as a TCP segment tin travel through unlike speed networks with unlike loads. This means that the Round trip Time (RTT) can vary from segment to segment. A simple way of calculating the RTT is by using a recursive mean value with an exponential window to decrease the importance of old values.

Equally mentioned in the introduction to the TCP section, the protocol is a stream oriented protocol. Information technology uses unstructured streams with no method of indexing the user information, east.1000. equally records etc. Furthermore, the length of a TCP segment tin can vary as is the case for the IP-datagram and the UDP user datagram. Therefore the acknowledgement tin not be based on the segment number but must be based on bytes successfully transferred.

However, the PAR principle is very inefficient as the sending host must await the acknowledgement before it can send the next segment. This means that the the minimum fourth dimension between two segments is ane RTT plus the time required to serve the segments at both ends. The TCP protocol solves this past using sliding windows at both ends.

This method permits the transmitting host to send every bit many bytes as can be stored in the sending window then wait for acknowledgements as the remote host receives the segments and sends data in the other management. The acknowledgement ship back is cumulative so that it at all times shows the next byte that the receiving host expects to see. An example with a big window size and selective retransmission is shown in the figure:

Byte number 1 is lost and so Host B never sends dorsum a positive acknowledgement. When Host A times out on byte 1 it retransmit it. However, as the rest of the bytes from 2-5 are transmitted successfully the side by side acknowledgement can immediately spring to 6 which is the side by side expected byte. Byte 2 is also retransmitted equally Host A does not know exactly how many bytes are erroneous. Host B only discards byte 2 as information technology already is downloaded.

The window technique can also be used to provide a congestion control mechanism. As indicated in the TCP Segment Format Effigy every segment has a WINDOW field that specifies how much information a host is willing to receive. If the host is heavyly loaded, it can decrease the WINDOW parameter and hence the transmission speed drops.

Withal, as the TCP protocol is an finish-to-end protocol information technology can non see if a congestion problem has occurred in an intermediate Interface Message Processor (IMP) (oftentimes called a packet switched node) and hence, it has no means to control it by adjusting the window size. TCP solves this trouble by using the Net Control Message Protocol (ICMP) source quench messages.

Connection Establishment

When a TCP connexion is to be opened a iii-way handshake (3WHS) is used in order to establish the virtual circuit that exists until the connection is closed at the end of the data transfer. The 3WHS is described in the following as it is an important part of the TCP protocol but besides shows some inefficiencies in the protocol. The principle of a 3WHS is illustrated in the figure below:

The blocks in the heart symbolizes the relevant office of the TCP segment, that is the SEQUENCE NUMBER, the ACKNOWLEDGEMENT NUMBER and the Code. The active Host A sends a segment indicating that it starts its SEQUENCE NUMBER from x. Host B replies with an ACK and indicates that it starts with SEQUENCE NUMBER y. On the tertiary segment both hosts agree on the sequence numbers and that they are fix to transmit data.

In the figure only Host A does an active open. Really the two hosts can practice a simultaneously open in which example both hosts perform a SYN-RECEIVED then synchronize accordingly. The principle reason for the 3WHS is to prevent sometime duplicate connection initiations from causing confusion.

Note that the SEQUENCE NUMBER of segment 3 and 4 is the same because the ACK does not occupy sequence number space (if it did, the protocol would current of air up ACKing ACK's!).

Nevertheless, the TCP connection establishment is somewhat long cumbersome in many applications, especially in the client-server applications such every bit the Earth-Wide Web. In the next section an alternative having a lighter connection establishment is presented.

Transactional Manual Control Protocol (T/TCP)

The TCP protocol is a highly symmetric protocol in that both hosts tin can transmit and receive information simultaneously. However, not all applications are symmetrical by nature. A typical example is a customer-server protocol such equally the Domain Name Service. The Transactional Transmission Control Protocol (T/TCP) that is a very new protocol (July 1994) offers an alternative to TCP when loftier performance is required in customer-server applications. Some of the requirements of an high functioning transaction oriented protocol are listed below:
  • The interaction between the client and the server is based on a request followed by a response, that is a stateless approach.
  • The protocol must guarantee that a transaction is carried out at nearly one fourth dimension and any indistinguishable packets received past the server should be discarded.
  • No explicit open up or close procedure of the connection. This is opposite to TCP and the 3WHS every bit described above.
  • The minimum transaction latency for a client should be Round Trip Time (RTT) + Server Processing Fourth dimension (SPT). That is basically the same requirement as no explicit open or close procedure.
  • The protocol should exist able to handle a reliable minimum transaction of exactly 1 segment in both directions.
This department describes how the TTCP protocol deals with these requirements and also that might impact the World-Broad Web model with respect to performance.

Implicit Connection Institution

The T/TCP protocol is as indicated by the name based on the TCP protocol and T/TCP is backwards compatible with TCP. However, one of the features of the T/TCP protocol is that it can bypass the 3WHS described in the previous section simply in case of failure tin can resolve to the 3WHS process.

The 3HWS has been introduced in order to forestall old indistinguishable connectedness initiations from causing confusion. However, T/TCP provides an alternative to this by introducing three new parameters in the OPTION field in the TCP Segment:

CONNECTION COUNT (CC)
This is a 32-bit incarnation number where a singled-out value is assigned to all segments transport from Host A to Host B and some other distinct number the other way. The kernel on both hosts keeps a enshroud of all the CC numbers currently used by connections to remote hosts. On every new connectedness the client CC number is monotonically incremented by 1 so that a segment belonging to a new connection tin be separated from old duplicates from previous connections.
CONNECTION COUNT NEW (CC.NEW)
In some situations, the principle of a monotonically increasing value of CC can exist violated, either due to a host crash or that the maximum number, that is 4G, is reached and the counter returns to 0. This is possible in practice considering the same CC number is global to all connections. In this situation a CC.NEW is transport and the the remote host resets its cache and returns to a normal 3WHS TCP connexion establishment. This indicate will always exist transport from the client and to the server.
CONNECTION COUNT ECHO (CC.ECHO)
In the server response the CC.ECHO field contains the CC value ship by the customer so that the customer can validate the response as belonging to a specific transaction.
The featherbed of the 3WHS is illustrated in the following effigy:

In the example, two segments are send in both directions. The connection is established when the first segment reaches the server. The customer is left in a Fourth dimension-Await country which is explained in the next section.

Connection Shotdown

Every TCP or UDP connection between 2 hosts are uniquely identified by the post-obit five-tuple:
  • Protocol (UDP, TCP)
  • IP-address of Host A
  • Port number of Host A
  • IP-address of Host B
  • Port number of Host B
Whenever a TCP connection has been airtight, the clan described by the 5-tuple enters a expect state to assure that both hosts have received the final acknowledgement from the closing procedure. The fourth dimension of the await state is called TIME-WAIT and is by default 2*MSL (120 seconds) where MSL is the Maximum Segment LifeTime. That is, 2 hosts can not perform an new transaction using the aforementioned 5-tuple until at least 120 seconds later on the previous connection has been terminated. One way to circumvent this problem is to select some other five-tuple just as mentioned in Extending TCP for Transactions -- Concepts this does not scale due to the excessive amount of kernel space occupied past terminated TCP connections hanging around.

Still, the T/RCP CC numbers gives a unique identification of each transaction so the T/TCP protocol is capable of truncating the WAIT-Country past comparing the CC numbers. This principle can exist looked at equally expanding the land machine of one transaction to also include data on previous and future transactions using the same 5-tuple.

TTCP and the World-Broad Web

Equally will be shown in the description of World-Wide Spider web of this thesis, the principle of the Earth-Wide Web is a transaction oriented substitution of data object. This is the reason why the T/TCP protocol is very interesting in this prospective.

TCP/IP and OSI/RM

International Standards Organisation (ISO) has designed the second dominating protocol layering scheme, called ISO Open System Interconnection Reference Model (OSI/RM). This section presents the OSI reference model and compares it to the TCP/IP protocol stack as illustrated in the effigy.

Physical Layer
Specifies the physical connection between the host computers and IMPs and how bits are transferred over a communication channel.
Information Link Layer
This layer specifies how data travels between IMPs using frames. Its maintask is to alter the service from the physical layer into a packet oriented error-free transmission.
Network Layer
The frames from the Information Link Layer are organized into packets and directed through the network. The advice is still between IMPs.
Ship Layer
The first layer that provides an end-to-terminate transport service. It ensures that the transferred data arrive correctly at the other end.
Session Layer
This layer specifies how two hosts tin found sessions where data can be transferred in both directions on a virtual connectedness between the two hosts.
Presentation Layer
The Presentation layer introduces a set of syntax and semantics of the information transmitted through the lower protocol layers.
Awarding Layer
This layer defines a platform independent virtual network terminal so that application programs can commutation information regardless of the internal data representation used.
Even though OSI/RM and TCP/IP tin exist compared like this, there still exist several significant differences between OSI/RM and the TCP/IP protocol stack but on the the about cardinal is that OSI/RM is a standardized model for how the functionality of a protocol stack tin can exist organized. It doesn't specify the exact services and protocols to exist used in each layer whereas the TCP/IP is an result of experimental research. In spite of this, the OSI/RM model has been the ground of several protocol stack implementation such as X.25, discussed in A Critique of X.25

Another deviation is where the intelligence is placed in the layering. OSR/RM introduces a reliable service on the Information Link Layer whereas the TCP/IP but has intelligence in the Transport Layer. Both solutions have advantages and disadvantages. When a reliable data transfer service is placed in the lower layers the clients using the network for communication can be kept very uncomplicated every bit they do not have to handle complicated error situations. The disadvantage is that performance decreases due to an excessive corporeality of control information transferred and processed in every host.


Henrik Frystyk, frystyk@info.cern.ch, July 1994

guerrerowhany1976.blogspot.com

Source: https://www.w3.org/People/Frystyk/thesis/TcpIp.html

0 Response to "Before a Receiving Host Can Even Examine the Tcp or Udp Header, Which of the Following Must Happen?"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel