CH 6-The Transport Layer
CH 6-The Transport Layer
1.
2.
3.
4.
No storage capacity
5.
No additional delays
Transport layer
1.
2.
3.
4.
5.
Normal
Operation
Three way
Handshaking
Technique
Host 1 chooses sequence no.x
and sends the connection
request segment containing it
to host2
Host 2 replies with the
connection accept segment to
acknowledge x nd to announce
its own Seq no.
Host 1 sends CK to host2 and
sends the first data segment.
Three
way
Handshaking
Abnormal Operation
Technique
st
The 1 segment is delayed
duplicate CR from old
connection and hoast1 doesnt
know about it.
Host 2 Rxes this segment and
sends ACK to host2 as
connection accepted
But host1 is not trying for any
connection thus it sends REJECT
along ACK=y
Host 2 releases as its fooled by
delayed duplicate=> aborts the
connection.
connection release
Connection Management
windows management
Congestion Control
Timer management
TCP- Introduction
TCP (Transmission Control Protocol) was specifically
designed to provide a reliable end-to-end byte stream
over an unreliable internetwork.
An internetwork differs from a single network because
different parts may have quite different topologies,
bandwidth, delays, packet sizes, and other parameters.
TCP was designed to dynamically adapt to properties of
the internetwork and to be robust in the face of many
kinds of failures.
TCP- Introduction
Since connection oriented service it is reliable.
Services-stream data transmission, stability, flow control, full duplex
operations and multiplexing
Due to reliable channel the data chopping does not take place simply
the segments are formed and passed them to IP for delivery
Blocks not ACKed in specified time period(timer mechanism) are only
retransmitted
Reliability in TCP deals with lost, delayed or duplicate or misread
packets.
Full duplex operation- TCP can send and receive at same time.
Multiplexing-numerous simultaneous upper layer conversations can be
multiplexed over a single connections.
TCP-Service Model
For obtaining the TCP services both sender and receiver necessarily has to
create end points called sockets, where in each socket has a socket number
and a socket address.
A Port is a TCP name in order to obtain the TCP service, it is necessary to
establish a socket between the sending and receiving machine.
Socket calls
TCP-Service Model
A TCP connection is byte stream, not a message stream.
Message boundaries are not preserved end to end.
For example, if the sending process does four 512-byte
writes to a TCP stream, these data may be delivered to
the receiving process as four 512-byte chunks, or two
1024-byte chunks, or one 2048-byte chunk, or some
other way.
When an application passes data to TCP, TCP may send
it immediately or buffer it (in order to collect a larger
amount to send at once), at its discretion.
TCP-Service Model
Urgent Data
Its is a flag in TCP
If there is a data to sent with some control information
the sending entity puts it with an URGENT flag.
Then TCP stops accumulating data and transmits
everything it has for the connection immediately
When the data reaches Rxer. the receiving application is
interrupted application is interrupted and the urgent
data stream is processed by it.
TCP-Service Model
Well known ports:
Port no 1024-well known ports reserved for servers
All TCP connections are point-point(has endpoints) and full duplex
(means bidirectional).
No multicasting and broad casting
Push flag and buffering:
When message boundaries are not preserved the TCP may send it
immediately or may collect the data for some time and sent it at
once(buffering)
For immediate data transmission TCP can use PUSH flag which
forces TCP send the data without any delays
TCP-Service Model
Port
21
23
25
69
79
80
110
119
Protocol
FTP
Telnet
SMTP
TFTP
Finger
HTTP
POP-3
NNTP
Use
File transfer
Remote login
E-mail
Trivial File Transfer Protocol
Lookup info about a user
World Wide Web
Remote e-mail access
USENET news
Segment Size:
Each segment with TCP header has 65535 byte IP payload
Each network has MTU(Maximum Transfer Unit), each segment must fit MTU which is
few thousands of bytes, it defines the maximum upper limit to segment size
Fragmentation:
If segment is too large it is divided in to fragments
Each new fragment get a new IP header so fragmentation increases the payload
Timer:
TCPs basic protocol is sliding window protocol where in the retransmissions are only
done if time delays are violated.
Window management in
UDP-Header
A UDP segment consists of an 8-byte header followed by the data.
UDP only provides TSAPs (ports) for applications to bind to. UDP does
not provide reliable or ordered service. The checksum is optional.
UDP-Header
The two ports serve the same function as they do in TCP: to identify the end points
within the source and destination machines.
The UDP length field includes the 8-byte header and the data.
The UDP checksum is used to verify the size of header and data.
Sender:
treat segment contents as sequence of 16-bit integers
checksum: addition (1s complement sum) of segment contents
sender puts checksum value into UDP checksum field
Receiver:
compute checksum of received segment
check if computed checksum equals checksum field value:
NO - error detected
YES - no error detected. But maybe errors nonetheless? More later .
UDP pseudoheader
0
16
31
Source IP Address
Destination IP Address
00000000
UDP Length
UDP Operations
Connectionless services :
each datagram sent by UDP is n independent datagram even though they are
coming from the same source
These datagrams are not numbered. No connection establishment or
connection release is necessary, each datagram can follow different path
Queues in UDP
Queues in UDP
Client requests for the port no. from the OS. Incoming and outgoing queues are
created for each process
One port for each process thus it results in to only one queue per process
Client sends the messages on its output line using output port address
UDP Removes the queue messages one by one by adding the UDP header and
delivers them to IP
If queue over flows then OS tells Client to wait before sending next messages
While client receiving the messages, UDP checks if incoming port has queue or
not, if yes then UDP sends received datagrams to the end of the queue
If incoming messages overflows then UDP simply discards the datagram and
prepares to notify sender of port unavailability.
In case of server queuing the port address is a well known port address rest all
steps of queuing are the same
Applications of UDP
It is suitable for application that have following
requirements
A simple response to simple request made
Flow control & Error control is not essential
Bulk data is not be sent
UDP
1.
1.
2.
2.
Connectionless protocol
3.
3.
4.
Reliable transmissions
4.
Unreliable transmissions
5.
High overhead
5.
Low overheads
6.
6.
7.
Retransmissions
7.
No retransmissions occurs
8.
8.
END
Chapter 6