0% found this document useful (0 votes)
13 views

Module 4 - New

This document discusses a computer networks course that covers TCP and UDP protocols. It includes 3 sections: 1. An introduction to TCP which provides reliable data transfer and UDP which provides best-effort delivery. 2. Details on how TCP establishes connections using a 3-way handshake and ports to identify applications. It also describes the TCP segment header fields. 3. TCP congestion control which dynamically adjusts the transmission window size to avoid overwhelming the network during periods of heavy traffic or congestion using slow start and congestion avoidance.

Uploaded by

geles73631
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Module 4 - New

This document discusses a computer networks course that covers TCP and UDP protocols. It includes 3 sections: 1. An introduction to TCP which provides reliable data transfer and UDP which provides best-effort delivery. 2. Details on how TCP establishes connections using a 3-way handshake and ports to identify applications. It also describes the TCP segment header fields. 3. TCP congestion control which dynamically adjusts the transmission window size to avoid overwhelming the network during periods of heavy traffic or congestion using slow start and congestion avoidance.

Uploaded by

geles73631
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 33

Course Name

Presentation Material
Department of Computer Science & Engineering
Semester
Course Code: 19CS3602 VI
:
Course Title: Computer Networks Year: 3rd
Faculty Name:

Computer Networks - 19CS3602 Department of Computer Science & Engineering 1


MODULE 4
The Internet Transport Protocols: Introduction to TCP and
UDP, The TCP Service Model, The TCP Segment Header, The
Connection Establishment, The TCP Connection Release, The
TCP Connection Management Modeling, The TCP Sliding
Window, The TCP Congestion Control, The future of TCP.

Computer Networks - 19CS3602 Department of Computer Science & Engineering 2


Introduction to TCP
• TCP (Transmission Control Protocol) was specifically designed to
provide a reliable end-toend byte stream over an unreliable
internetwork.
• An internetwork differs from a single network because different parts
may have wildly different topologies, bandwidths, delays, packet sizes,
and other parameters.
• TCP was designed to dynamically adapt the properties of
internetwork and to be robust in the face of many kinds of failures.

COMPUTER NETWORKS - 19CS3602 3


Introduction to UDP
• UDP (User Datagram Protocol)
• Unlike TCP, it is an unreliable and connectionless protocol. So, there
is no need to establish a connection prior to data transfer.
• For real-time services like computer gaming, voice or video
communication, live conferences; we need UDP
• There is no error checking in UDP, so it also saves bandwidth
• User Datagram Protocol (UDP) is more efficient in terms of both
latency and bandwidth
.

COMPUTER NETWORKS - 19CS3602 4


The TCP Service Model
• TCP service is obtained by both the sender and receiver creating end points, called
sockets
• Each socket has a socket number (address) consisting of the IP address of the host
and a 16-bit number local to that host, called a port
• Port numbers below 1024 are called well-known ports and are reserved for standard
services.

COMPUTER NETWORKS - 19CS3602 5


COMPUTER NETWORKS - 19CS3602 6
The TCP Segment Header

COMPUTER NETWORKS - 19CS3602 7


• A 16-bit field that holds the port address of the application that is
sending the data segment
• A 16-bit field that holds the port address of the application in the
host that is receiving the data segment
• Sequence Number –
A 32-bit field that holds the sequence number, i.e, the byte number
of the first byte that is sent in that particular segment. It is used to
reassemble the message at the receiving end of the segments that
are received out of order

8
• Acknowledgement Number –
A 32-bit field that holds the acknowledgement number, i.e, the byte
number that the receiver expects to receive next. It is an
acknowledgement for the previous bytes being received
successfully.
• Header Length (HLEN) –
This is a 4-bit field that indicates the length of the TCP header by a
number of 4-byte words in the header

9
• Control flags –
These are 6 1-bit control bits that control connection establishment,
connection termination, connection abortion, flow control, mode of transfer
etc. Their function is:
• URG: Urgent pointer is valid
• ACK: Acknowledgement number is valid( used in case of cumulative acknowledgement)
• PSH: Request for push
• RST: Reset the connection
• SYN: Synchronize sequence numbers
• FIN: Terminate the connection
• Window size –
This field tells the window size of the sending TCP in bytes.
10
• Checksum –
This field holds the checksum for error control. It is mandatory in
TCP as opposed to UDP
• Urgent pointer –
This field (valid only if the URG control flag is set) is used to point to
data that is urgently required that needs to reach the receiving
process at the earliest. The value of this field is added to the
sequence number to get the byte number of the last urgent byte.

11
TCP Connection Establishment
• Connections are established in TCP by means of the three-way
handshake
• To establish a connection, one side, say, the server, passively waits
for an incoming connection by executing the LISTEN and ACCEPT
primitives
• The other side, say, the client, executes a CONNECT primitive,
specifying the IP address and port to which it wants to connect
• The CONNECT primitive sends a TCP segment with the SYN bit on
and ACK bit off and waits for a response

12
13
14
TCP Connection Release
• One way to avoid data loss is to use symmetric release, in which each
direction is released independently of the other one.
• One can envision a protocol in which host 1 says: I am done. Are you
done too? If host 2 responds: I am done too. Goodbye, the
connection can be safely released.
• Unfortunately, this protocol does not always work.

COMPUTER NETWORKS - 19CS3602 15


16
COMPUTER NETWORKS - 19CS3602 17
COMPUTER NETWORKS - 19CS3602 18
Connection Release

COMPUTER NETWORKS - 19CS3602 19


Connection Release

COMPUTER NETWORKS - 19CS3602 20


TCP connection management modeling
• The steps of a establishing and releasing a TCP connection can be
represented as a finite state machine with 11 states.

COMPUTER NETWORKS - 19CS3602 21


TCP Sliding Window

22
23
24
25
26
TCP Congestion Control
• When the load offered to any networks is more than it can handle,
congestion builds up. The Internet is no exception.
• Algorithms have been developed over the past decade to deal with
congestion.
• Although the network layer also tries to manage congestion, most of
the heavy lifting is done by TCP because the real solution to
congestion is to slow down the data rate.

COMPUTER NETWORKS - 19CS3602 27


• In theory congestion can be dealt with by employing a principle
borrowed from physics: the law of conservation of packets. The idea
is not to inject a new packet into the network until an old one leaves
(i.e. is delivered). TCP attempts to achieve this goal by dynamically
manipulating the Window size.
• The first step in managing congestion is detecting it.
• A timeout caused by a lost packet could have been caused either
a. Noise on a transmission line
b. Packet discarded at a congested router

COMPUTER NETWORKS - 19CS3602 28


(a) A fast network feeding a low capacity receiver
(b) A slow network feeding a high capacity receiver

COMPUTER NETWORKS - 19CS3602 29


• The internet solution is to realize that potential problem
exist
a. Sender capacity
b. Receiver capacity
• Each sender maintains two windows: the window the
receiver has granted and a second one is congestion
window each reflects the number of bytes that sender may
transmit

COMPUTER NETWORKS - 19CS3602 30


• When a connection is established, the sender initializes the
congestion window to the size of the maximum segment in use of the
connection. It then sends one maximum segment
• If this segment is acknowledged before the timer goes off, it adds one
more segment’s worth of bytes to the congestion window to make it
two acknowledged
• The congestion window keeps growing exponentially until either a
timeout occurs or the receiver’s window is reached. This algorithm is
called slow start but it is not slow at all (Jacobsan, 1988). It is
exponential.

COMPUTER NETWORKS - 19CS3602 31


• In internet congestion control algorithm, it uses a third parameter, the
threshold.
• When a timeout occurs, the threshold is set to half of the current
congestion window, and the congestion is reset to one maximum
segment.
• Successful transmissions grow the congestion window linearly (by one
maximum segment for each burst) instead of one per segment

COMPUTER NETWORKS - 19CS3602 32


COMPUTER NETWORKS - 19CS3602 33

You might also like