Sunteți pe pagina 1din 8

Transport layer

TCP/IP

Application.->Data
Transport. -> Segment, Porturile
Internet. -> IP-urile
Net acc. -> Frame. MAC și CRC

PROPRIETATI
Its primary responsibilities are:
 Tracking the individual communication between applications on the source
and destination hosts
 Segmenting data and managing each piece
 Reassembling the segments into streams of application data
 Identifying the different applications

1. FUNCTII
2. ADRESARE PE PORT
3. HEADER
4. THERE WAY HANDSHAKE

1. FUNCTII
 Segmentarea datelor in fct de protocolul folosit
 Asamblare date la destinatie in fct de informatiile din header
 Indetificarea aplicatiilor de la capetele comunicarii

TCP mai lent dar mai sigur pentru pachete. Pentru http,fileshare,ftp,mail
UDP (User Datagram Protocol)mai rapid dar nu conteaza ordinea , jocuri online,
Some protocols at the Transport layer provide:
 Connection-oriented conversations
 Reliable delivery
 Ordered data reconstruction
 Same order delivery
 Flow control
 Connection oriented

Same order delivery.rearanjarea datelor in ordinea in care au fost trimise, se face o


numerotare in header pentru a realiza asamblarea.
Reliable delivery. Asteapta confirmare ca informatia a ajuns, daca o bucata lipseste,
cere retransmiterea ei.
Identifica mai multe streamuri de date.
Foloseste IP + port adica socket și tine pasul cu fiecare transfer client-server
Flow control (windowing), limitarea dimensiunii unui grup de segmente pe care
hostul le transmite, ajuta la decongestionarea retelei

At the Transport layer the three basic operations of reliability are:


 tracking transmitted data
 acknowledging received data
 retransmitting any unacknowledged data

2.ADRESARE PE PORT
Pentru a transmite informatia la aplicatiia ce o cere, transport layer trebuie sa
identifice aplicatia destinatie, el atribuie un identificator, TCP/IP numinu-l
port. Toate aplicatiile ce au nevoie de acces la internet primesc cate un port.
Date de IANA( internet addressing and numbering authority)
 0->1023 well known- servicii și procese, POP3,HTTP etc
 1024-49151 registred- folosite de
aplicatiile/procesele userului ce necesita un port fix
 49152-65535 dynamic/private
(Ephemeral Ports)- orice aplicatie ce nu are
unul din cele de mai sus, de obicei clientul
nu se conecteaza la un serviciu pe un
asemenea port

3. HEADER
HEADER TCP
Source port number- sesiune TCP de pe sursa ce a creat o conexiune, o valoare
random peste 1023
Destination port number-identifica aplicatia catre care se trimite data
Sequence number- specifica ultimul octet din segment
Acknowledgement number- specifica urmatorul octet ce trebuie primit
Header lenght- specifica lungimea hederului din segment in bytes
Reserved:spatiul in viitor in caz ca protocolul se modifica(setat 0)
Flags/code bits: sunt 6 : urgent , syn,ack,push,reset și finalize
Window Size: nr max de segmente ce pot fi trimide pana la confirmarea primirii
TCP Checksum- folosit la corecarea erorilor pentru header & data
Urgent pointer- folosit doar cu flag URG
Application Layer Data: are dimensiune variabila in functie layerul de mai sus

Functions:
 same order delivery,
 reliable delivery
 flow control
Applications that use TCP are:
 Web Browsers
 E-mail
 File Transfers

HEADER UDP

Proprietati :
 Connectionless
 Best effort
 Low overhead data delivery
 The pieces of communication in UDP are called datagrams
 UDP is said to be transaction-based. In other words, when an application has
data to send, it simply sends the data.

Applications that use UDP are:


 Domain Name System (DNS)
 Video Streaming
 Voice over IP (VoIP)
 Simple Network Management Protocol (SNMP)
 Dynamic Host Configuration Protocol (DHCP)
 Routing Information Protocol (RIP)
 Trivial File Transfer Protocol (TFTP)
 Online games

Realizarea transferurilor de date


TCP
Transport layer initiaza un proces pentru a porni o conexiune cu destinatia, aceasta
va ajuta la monitorizarea sesiunii sau la comunicarea dintre hosturi, aceasta
garanteaza ca cele 2 sunt pregatite de a realiza schimb de date.
O comunicare completa TCP necesita stabilirea unei sesiuni intre hosturi.
Dupa ce aceasta se realizeaza, hostul destinatie trimite acknowledgement catre sursa
pentru segmentul primit, cand hostul sursa primeste acknowledgement de la
destinatie stie ca hostul destinatia a primit pachetul si ca nu mai e nevoie de a urmari
pachetul. Daca hostul sursa nu primeste acknowledgement intr-o perioada stabilita
de timp, el va retrimite pachetul catre hostul destinatie.

4. THREE-WAY HANDSHAKE
The three-way handshake:
 Establishes that the destination device is present on the network
 Verifies that the destination device has an active service and is accepting
requests on the destination port number that the initiating client intends to
use for the session
 Informs the destination device that the source client intends to establish a
communication session on that port number
 Creata inainte ca datele sa fie schimbate

Clientul initiaza conexiunea. ETAPE


1. El trimite initial la server un flag control->synchronized
Trimite un initial sequence number aleatoriu sa zicem SEQ=100
2. Serverul ii raspunde cu flag control->synchronized CTL=SYN și ACK și ii
trimite si el un SEQ number personal 300 și un flag ACK=100+1
3. Clentrul ii retrimite un CTL=ACK plus un ACK=301și SEQ=100+1.
Acum conexiunea e established

In headerul segmentului TCP avem 6 campuri de cate 1bit ce contin informatii de


control ce sunt utilizate in managementul conexiunii TCP:
URG - Urgent pointer field significant
ACK - Acknowledgement field significant
PSH - Push function
RST - Reset the connection
SYN - Synchronize sequence numbers
FIN - No more data from sender

FOR WAY HANDSHAKE


Utilizat la finalizaa conexiuneii
Dupa ce se stabileste conexiunea si se face transferul de date
Clientul nu mai are date de transmis și ii spune TCP ului
1.Hostul trimite serverului FIN
2.Serverul trimite inspoi un msj cu flag ACK
3.Serverul mai trimite un mesaj cu flag FIN
4.Hostu raspunde cu flag ACK

Reasamblarea TCP
Cand datele ajung in ordine aleatoare, TCP le ordoneaza.
Se introduce in initial sequence number (ISN). This initial sequence number
represents the starting value for the bytes for this session that will be transmitted to
the receiving application
As data is transmitted during the session, the sequence number is
incremented by the number of bytes that have been transmitted. This tracking of
data byte enables each segment to be uniquely identified and acknowledged. Missing
segments can be identified.
Segment sequence numbers enable reliability by indicating how to
reassemble and reorder received segments
The receiving TCP process places the data from a segment into a receiving
buffer.
Segments are placed in the proper sequence number order and passed to the
Application layer when reassembled

Flow control
Assists the reliability of TCP transmission by adjusting the effective rate of data flow
between the two services in the session.
When the source is informed that the specified amount of data in the segments is
received, it can continue sending more data for this session.
This Window Size field in the TCP header specifies the amount of data that can be
transmitted before an acknowledgement must be received. The initial window
size is determined during the session startup via the three-way handshake.
Windowing->trimiterea unor grupuri de segmente fara a face ACK la fiecare
segment ci la finalul grupuluI
Grupurile se numesc WINDOW
Dynamic window sizes- cresterea numarului de pachete treptat fara a da ACK

Reasamblarea UDP
UDP does not keep track of sequence numbers the way TCP does. UDP has no way to
reorder the datagrams into their transmission order.
La fel ca si TCP are porturi well known sau registred
As soon as the data is ready to be sent and the ports identified, UDP can form the
datagram and pass it to the Network layer to be addressed and sent on the network.
ALTELE