Vous êtes sur la page 1sur 20

Transport Layer

Hong, Marc Wesley C.


What is the Transport Layer?

Responsible for message processing between client and server


Secures that packets sent are received
Error and flow control during delivery from the source to its destination
Enables software communication when creating virtual channels
What is the Transport Layer?

Also provides connection control which may be:


1. Connection-less where each segment is considered an
independent packet and is delivered at the
destination machines transport layer
2. Connection-oriented where transport layer connects to
destination machines transport layer first
before packet delivery
Process, Host, and Node

Transport Layer = process to process delivery


Network Layer = host to host delivery
Data-link Layer = node to node delivery
Process, Host, and Node

Process to Process Delivery a process is a computer application program


used to send and receive messages
Host to Host Delivery source to destination; packet sending from one
network to the other
Node to Node Delivery inter link delivery; communication between PCs or
devices from the same network
Why is it important?

Key functions:
1. Transport layer provides reliability;
meaning applications want to know when data has reached
its destination without loss or error
2. Also automatic checking of congestion and traffic
in data flow
3. Retransmission in case the packet was not received,
or received but with loss or error
Why is it important?

Two protocols created:


1. User Datagram Protocol (UDP)
- connectionless and unreliable
- used for fast, cheap, and simple process to process
communication
- best effort service
2. Transmission Control Protocol (TCP)
- connection-oriented, reliable
- virtual connection between two TCPs
- flow and error control done in connection
User Datagram Protocol (UDP)

PDU = datagram, 8bytes


No acknowledgments
Manual retransmission/ application based retransmission
No flow control, error control limited to checksum
High speed, simple
Small size data sending
Ideal for multimedia applications, apps where reliability and
control are not required
User Datagram Protocol (UDP)

Multimedia applications like video or audio streaming


does not require fullness of the file. Instead, what is preferred
is for the file to continue on streaming and buffer quickly
DNS and DHCP on the other hand only require a simple
request/reply messaging system
UDP also used for broadcast and multicast communication
User Datagram Protocol (UDP)

UDP message format:


1. Source port, 2bytes
2. Destination port, 2bytes
3. Length, 2bytes
4. Checksum, 2bytes
5. Data, variable size
Transmission Control Protocol (TCP)

PDU = segment, 20bytes


All data is acknowledged
Automatic retransmission
Flow control algorithms for decongestion
With more specifications, TCP slower than UDP
Can send up to Gigabytes amount of data
Ideal for secure communication, FTP, telnet, HTTP, DNS*
Transmission Control Protocol (TCP)

In file transfer, the file must be complete for it to open or work


Websites must be able to show the whole page and its content, otherwise
they are useless and unreadable
Same for e-mail, the message sent must be complete for it to be understood
by the reader
All these require the segments to be full and error free
DNS may use TCP for longer messaging and replies
Transmission Control Protocol (TCP)

TCP segment format:


1. Source port, 2bytes
2. Destination port, 2bytes 7. Control bits, 6bits

3. Sequence number, 4bytes 8. Window, 2bytes

9. Checksum, 2bytes
4. Acknowledgment number, 4bytes 10. Urgent pointer, 2bytes

5. Data offset, 4bits 11. Options, variable size

12. Padding, variable size


6. Reserved bits, 6bits 13. Data, variable size
Transmission Control Protocol (TCP)

Data segmentation
The sending process delivers data as a stream of bytes
Allows receiving process to obtain data as a stream of bytes
TCP create pipes for the stream to travel across the Internet
Buffers are used by the sending and receiving processes because of their
difference in read and write speed.
Transmission Control Protocol (TCP)

Communication Process
establish a full duplex connection between client and server
three way hand-shaking
1. Synchronize
2. Synchronize + acknowledge of request of passive open
3. Acknowledge of request of active open
. bidirectional data transfer can be done
Addressing

Address in transport layer = port number


Initially obtain an IP address from a pool of servers, then
Chooses among the processes of the destination host
Destination port number for delivery
Source port number for reply
Addressing

Socket Address combination of IP address and port number


A pair of socket address are needed, one for client and the other for the
server
Total of 4 addresses, 2 IP addresses, 2 port numbers
Socket an endpoint in a network communication of 2 processes
Automatic Repeat Request (ARQ)

1. Stop-and-wait
. Send window and receive window
. Sender sends initial message
. Stops sending and waits
. Destination acknowledges the received message
. Source sends next batch of message
Automatic Repeat Request (ARQ)

2. Go-back-N
. Multiple messages can be sent at a time
. Then wait for acknowledge
. Copies of the messages are kept until acknowledge arrives
. The copies contain sequence numbers to keep track of the order
. N number of frames are resent when not acknowledged
. m = number of sequence numbers
. Send window size, less than 2^m
Automatic Repeat Request (ARQ)

3. Selective repeat
. Maximum send window size = 2^(m-1) or 0.5*(2^m)
. Receive window size = Send window size

Vous aimerez peut-être aussi