Saturday, February 9, 2008

Internet Protocol

Internet Protocol (IP) is a protocol of package net ; according to classification ISO/IT DARES is of level net (3).

The version running used of protocol IP is said also IPv4 in order to distinguish it from the most recent IPv6, been born from the requirement to manage the crescent better number than connected computers to Internet.

IP is a protocol of interconnection of nets (Inter-Networking Protocol), been born in order to interconnect heterogenous nets for technology, performances, management.

The transport protocols use you on IP are above all TCP and UDP.

User Datagram Protocol

User Datagram Protocol (UDP) is one of the main protocols of the Suite of Internet protocols. UDP is a protocol of transport to package. It is used of usual in combination with protocol IP.

To difference of the TCP, it does not manage the riordinamento of the packages neither the rebroadcast of those lost. The UDP has like characteristic of being a protocol of inaffidabile net, protocol connectionless, but in compensation much efficient express and for the applications "to read" or Time-sensitive. In fact, it is often used for the transmission of information audio or video. Since the applications in real time often demand the minimal shipment rhythm, they do not want to delay excessive the transmission of the packages and can tolerate some loss of data, the model of service TCP can particularly not be adapted to the requirements of these applications. The UDP supplies only the basic services of the level of transport, that is:

* multiplazione of the logons, obtained through the mechanism of the doors
* verification of the errors by means of a checksum, inserted in a field of the heading of the package.

while TCP guarantees also the reliable transfer of the data, the control of flow and the control of the congestion.

UDP is a protocol stateless that is lacking in state: it does not maintain the state of the logon therefore regarding TCP it has information in less memorizzare. A serveur dedicated to a particular application that it chooses UDP as transport protocol can support many client more active ones.

Server and Client

The two processes that communicate through a logon TCP have various roles:

* The process that starts one new logon TCP is said client, and sendes one demanded of logon towards one determined door.
* So that the logon comes established, on that door must is to us a serveur process "in listens", than chip ax to establish one logon TCP.

The known and recorded doors therefore are used from the serveur processes, and conventionally are associated to particular services, so that a client it knows which door to connect itself in order to catch up a determined serveur.

The serveur process, that it is in I listen on a sure door, remains blocked in attended that a client it is connected. The process client demands to establish one logon towards a determined serveur on one determined door. Normally the door source used from the client comes allotted dynamically from the operating system of the client. When the TCP establishes the logon, to both processes it comes assigned a socket through which they they can communicate between they. Typically the serveur process carries out a fork, entrusts to the son the task to communicate with the new one client and it recovers in I listen. From this point in then, client and serveur they have symmetrical roles, and they use the same instruments in order to communicate through the socket.

Multiplazione and doors

Every active logon TCP is associated to a socket opened from a process (the socket is the instrument offered from the operating system to the applications in order to use the functionalities of the net). TCP is taken care to shunt the data between the active logons and the relati to you processes. For this, to ciascuna logon between two host it comes associated a door number on everyone of the two hosts, that bit (1-65535 is an entire one without sign to 16), contained in the appropriate field of the header.

A logon TCP therefore will be identified from IP addresses of the two hosts and from the doors used on the two hosts.

In this way, a serveur can accept logons from more client at the same time through or more doors, a client it can establish more logons towards more destinations, and is also possible that a client it at the same time establishes more independent logons towards the same door of the same serveur.

Opening of one logon - Three-way handshake

The used procedure in order to establish in reliable way a logon TCP between two host is called three-way handshake (grip of hand to 3 ways), indicating the necessity to exchange 3 messages between host sender and receiving host so that the logon is created correctly. We consider as an example that the host To means to open one logon TCP with the B host; the steps to follow therefore are:

1. To it sendes a segment SYN to B - flag the SYN is set up to 1 and the Sequence field number contains value x that specific the Initial Sequence Number of To;
2. B sendes a segment SYN/ACK to To - flag SYN and ACK are set up you to 1, the Sequence field number contains the value y that specific the Initial Sequence Number di B and the Acknowledgment field number contain the value x+1 confirming the reception of the ISN of To;
3. To it sendes a segment ACK to B - the Acknowledgment field number contains the value y+1 confirming the reception of the ISN of B.

The third segment would not be, ideally, necessary for the opening of the logon in how much already after the reception from part of To of according to segment, both the hosts has expressed their availability R-all'.apertura of the logon. However it turns out necessary to the aim to allow also to the B host an esteem of the timeout begins them, like time elapsed between the shipment of a segment and the reception of correspondent ACK.

Flag the SYN turns out useful in the practical implementazione of the protocol, and in its analysis from part of the firewalls: in traffic TCP segments SYN establish new logons, while those with the flag not active belong already to established logons.

The segments use you during the handshake are usually ' single header', that is phase of synchronization between the two hosts and not of exchange of data has the Given field empty being this one.

Timer of rebroadcast

Like described over, the timer of rebroadcast it serves to verify that every transmitted segment comes found.

The corrected formulation of this timer is difficult but a lot important, in how much a timer too much short it involves useless rebroadcasts (the timer releases while the reply or the package is still in travel), while a timer too much along it involves waits in case of loss of packages.

TCP continuously fixes the timer of rebroadcast being based on a mobile esteem to average of the Round Trip Time.

Sequence number and Acknowledgment number

The Sequence number, or sequence number, serves to posizionare the payload of segment TCP to the inside of the data traffic.

TCP expects to receive the successive segment to the last segment received in order, that is that one whose number of sequence is equal to the number of sequence of the last segment received in order more the dimension of the payload of the same segment (that is of its Given field).

In reception, TCP it controls if the received number of sequence is that waited for one and in affirmative case it can directly send the payload to the process of applicativo level and to free the own ones buffer.

If instead it receives a number of greater sequence of that attending, deduces that or more previous segments to it have gone lost or delays to you from the level of below net. Therefore, memorizza temporary in buffer a payload of the segment for being able to deliver it to the applicativo process after to have received and delivered also to all those previous ones. From the applicativo process point of view, therefore, the data will arrive in order even if the net has altered per.qualsiasiasi.motivo this order, realizing therefore requirement of the tidy delivery of the data.

If finally the received number of sequence is inferior to that attending, the segment comes considered a duplicate of one already received and already sended to the applicativo layer, and therefore discarded. This allows to realizethe elimination of duplicates you of net.

In every segment moreover, it comes sended a Acknowledgment Number, or number of reply. The number of present reply in a segment regards the data traffic in the opposite direction. In particular, the number of sended reply gives To to B is equal to the attended number of sequence gives To and, therefore, it regards the data traffic from B to To.

Protocol TCP adopts politics of cumulative Confirmation, that means simply that the arrival of reply number indicates to receiving that the sender has received and correctly forwarded to just the applicativo process, the having segment number of equal sequence to the number of indicated reply (-1) and also all the precendenti segments to it. Therefore, in transmission, TCP temporary maintains a copy of all the data sendes to you but not still it finds to you. When it receives a number of reply for a segment, it deduces some that all the data previous to that number have been receipts correctly and therefore free just buffer from these data.

For every sended segment, TCP starts a timer, said timer of rebroadcast RTO (Retransmission Time Out). If the segment does not receive a ACK before that the timer it expires, TCP assumes that all the transmitted segments beginning from that one have gone lost and therefore ritrasmette them.

You notice yourself that, in TCP, the mechanism of the reply numbers it does not allow the receiver to communicate to the emitter that a segment has been lost, but some of the successes have been receipts (mechanism to Acknowledgment Number denied to you), therefore it is possible that for a single package lost some many must ritrasmessi. This not optimal behavior is compensated from the semplicità of the protocol. This technique is said Go-Back-N; the alternative, that is to plan the protocol of transport so that only the packages effectively lost come ritrasmessi, is said Selective Repeat (selective repetition); I use but of some optional fields I affixed allows to you I use it of the selective repetition.

The numbers of reply and the relati ones timer allow to you therefore to realize the reliable delivery, that is to guarantee that all the data send to you are delivered even if some packages they come lost from the net.