You are on page 1of 23

The presentation layer has three primary functions:

 Format of data
 Compression & decompression of data
 Encoding & decoding of data
 negotiates data transfer syntax for application layer

2018
Session Layer

 The session layer creates and maintains dialogs between


source and destination applications.
 Set a logical connection ( session) between different
application
 The session layer handles the exchange of information to
initiate dialogs, keep them active, and to restart sessions
that are disrupted or idle for a long period of time.
 Establishes , manages and terminates session between
applications
 Specifies communication mode
( simple - Half duplex – full duplex )
Transport layer

 Session
multiplexing
 Segmentation
 Flow control
(when
required)
 Connection-
oriented
(when
required)
 Reliability
(when
required)
Flow control
Buffer
Fixed Windowing
Windowing

Sender Window size = 3


Send 1
Receiver
Window size = 3
Send 2
Window size = 3
Send 3
ACK 3 Packet3 is
Window size = 2 dropped
Window size = 2
Send 3
Window size = 2
Send 4
ACK 5
Window size = 2
Establishing a Connection
TCP Three Way Handshake/Open Connection

Host A Host B

Send SYN
1 (seq=100 ctl=SYN)
SYN received

Send SYN, ACK 2


SYN received (seq=300 ack=101
ctl=syn,ack)
Established
3 (seq=101 ack=301
ctl=ack)

CTL = Which control bits in the TCP header are set to 1


TCP Simple Acknowledgment

Sender Window size = 1 Receiver


Send 1
Receive 1
Send ACK 2
Receive ACK 2

Send 2
Receive 2
Send ACK 3
Receive ACK 3
Send 3
Receive 3

Receive ACK 4 Send ACK 4


TCP Sequence and Acknowledgment Numbers

Source Dest. Sequence Acknowledgement …


Port Port # #

I just
sent #10.
.

1028 23 10 1
TCP Sequence and Acknowledgment Numbers

Source Dest. Sequence Acknowledgement



Port Port # #

I just
sent #10. I just got #10,
now I need #11

Source
1028 23 10 1
Source Dest. Seq. Ack.
23 1028 1 11
TCP Sequence and Acknowledgment Numbers

Source Dest. Sequence Acknowledgement



Port Port # #

I just
sent #11. I just got #10,
now I need #11

Source Dest. Seq. Ack.


1028 23 10 1
Source Dest. Seq. Ack.
23 1028 1 11
Source Dest. Seq. Ack.
1028 23 11 2
TCP Sequence and Acknowledgment Numbers
Source Dest. Sequence Acknowledgement

Port Port # #

I just
sent #11. I just got #11,
now I need #12

Source Dest. Seq. Ack.


1028 23 10 1
Source Dest. Seq. Ack.
23 1028 1 11
Source Dest. Seq. Ack.
1028 23 11 2
Source Dest. Seq. Ack.
23 1028 2 12
Transport Layer Overview

Transmission Control
Application Protocol (TCP)

Transport User Datagram


Protocol (UDP)
Internet

Data Link

Physical
 Type of protocol at transport layer
TCP (connection oriented protocol)
It must establish session before transmit the data ,
make recovery & control
UDP connectionless protocol
no session , no recovery & no control
TCP Characteristics

 Transport layer of the TCP/IP stack


 Access to the network layer for applications
 Connection-oriented protocol
 Full-duplex mode operation
 Error checking
 Sequencing of data packets
 Acknowledgement of receipt
 Data-recovery features
TCP Segment Format
Bit 0 Bit 15 Bit 16 Bit 31

Source port (16) Destination port (16)

Sequence number (32)

Acknowledgement number (32) 20


Byte
Header
length (4) Reserved (6) Code bits (6) Window (16)

Checksum (16) Urgent (16)

Options (0 or 32 if any)

Data (varies)
UDP Characteristics

 Operates at transport layer of OSI and TCP/IP models


 Provides applications with access to the network layer
without the overhead of reliability mechanisms
 Is a connectionless protocol
 Provides limited error checking
 Provides best-effort delivery
 Has no data-recovery features
UDP Segment Format

Bit 0 Bit 15 Bit 16 Bit 31

Source port (16) Destination port (16)

Length (16) Checksum (16)


8
Byte
Data (if any)

No sequence or acknowledgment fields


Port Numbers

F T S D T S R
Application T E M N F N I
Layer P L T S T M P
N P P P
E
T

21 23 25 53 69 161 520 Port


Transport Numbers
Layer TCP UDP
TCP Port Numbers

Source Dest.

Port Port

Telnet Z
Host A Host Z

SP DP Dest. port = 23.


Send packet to my
1028 23 …
Telnet
application.
 Describe the role of port numbers in establishing TCP
sessions and directing segments to server process
 Trace the steps as the UDP protocol and port numbers
are utilized in client-server communication.

You might also like