0% found this document useful (0 votes)
39 views36 pages

TCP and UDP

TCP provides reliable, in-order byte stream delivery between two endpoints using a connection-oriented protocol. It uses three-way handshake for connection establishment, sliding window flow and congestion control for reliable data transfer, and four-way handshake for connection termination. UDP provides simpler connectionless and unreliable datagram delivery with no handshaking or windowing but has less processing overhead.

Uploaded by

Lo Li
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views36 pages

TCP and UDP

TCP provides reliable, in-order byte stream delivery between two endpoints using a connection-oriented protocol. It uses three-way handshake for connection establishment, sliding window flow and congestion control for reliable data transfer, and four-way handshake for connection termination. UDP provides simpler connectionless and unreliable datagram delivery with no handshaking or windowing but has less processing overhead.

Uploaded by

Lo Li
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 36

TCP and UDP

Networks and Telecommunications


Dr. Tran Quang Anh
Faculty of Information Technology
Hanoi University
March 31, 2010
Acknowledgement

 This slides were originally created by Ali


Sajjad (ali@niit.edu.pk)
Position of Transport Layer
Process-Process Delivery
 The transport layer is responsible for process-to-process
delivery
Services Provided by Transport
Layer
 Reliable connection-oriented service

 Unreliable connectionless service


Addressing
 For addressing, we use “transport addresses”
on which processes can listen for connection
requests
Sockets
Port Assignment
 How does a user process on a host knows
on which destination port a server is
running?
1. Well-known Ports assigned by IANA (Internet
Assigned Numbers Authority)

http://www.ports-services.com/
Some well-known ports
 HTTP 80
 HTTPS 443
 SMTP 25
 DNS 53
 POP3 110
 POP3S 995
 SSH 22
 TELNET23
 FTP 21
TCP – Transmission Control
Protocol
 RFCs 793, 1122, 1323, 2018, 2581

 Point-to-Point
 one sender, one receiver
 Reliable, in-order byte steam
 no “message boundaries”
 Pipelined
 Send & Receive buffers/windows
a p p lic a t io n a p p lic a t io n
w r it e s d a t a re a d s d a ta
socket socket
door door
TC P TC P
s e n d b u ffe r r e c e iv e b u f f e r
segm ent
TCP – Transmission Control
Protocol
 Full duplex
 bi-directional data flow in same connection
 Connection-oriented
 Exchange of control messages initiates sender,
receiver state before data exchange
 Flow control and Congestion Control
 sender will not overwhelm receiver or the network
TCP Connections

 TCP connections have three phases-

1. Connection establishment
2. Data transfer
3. Connection termination
Connection Establishment
Three-way Handshake
 Passive Open
 Before a client attempts to connect with a server,
the server must first bind to a port to open it up for
connections
 Active Open
 Once the passive open is established, a client
may initiate an active open
 To establish a connection, the three-way (or
3-step) handshake occurs
Three-way Handshake
1. The active open is performed by sending a SYN to the
server
2. In response, the server replies with a SYN-ACK
3. Finally the client sends an ACK (usually called SYN-ACK-
ACK) back to the server

Three-way Handshake
SYN Flood Attack
Connection Release
Connection Release
Intrusion Prevention System

 Intrusion Detection System


 Detect malicious network connection
 Intrusion Prevention System
 Detect malicious network connection
 Interrupt malicious network connection
 Send a TCP FIN packet
Half-Close Connections
Host A Host B
 One end can stop FIN

sending data while of FIN


ACK
continuing to receive Data
data
ACK
of Da
ta

FIN

ACK o
fF IN
TCP Connection Management Modeling

The states used in the TCP connection management finite state


machine
Data Transfer
Data Transfer in TCP

 In-Order data transfer


 Retransmission of lost packets
 Discarding duplicate packets
 Error Control
 Flow Control
 Congestion Control
The TCP Segment Header
TCP Flow and Congestion
Control
Sliding Window
Very strongly
discouraged –
Receiver revokes
Congestion
window, eligibility of
window
defined in some bytes
the segment

New bytes
Bytes have
 Operations on the window
been
can be
added
acknowledged
 Opened, Closed or Shrunk
 Executed as per the information from the receiver
Example scenario for Sliding
Window
Example scenario for Sliding
Window
The server receives a packet with an acknowledgment value of
202 and an rwnd of 9. The host has already sent bytes 203, 204,
and 205. The value of cwnd is still 20. Show the new window
Window Shutdown

 rwnd = 0
 When receiver does not wants to receive data for
some time
 Sender stops sending data until the new
advertisement arrives from receiver
 If there is no data, receiver still sends an ACK with new
rwnd value
Summary of Flow Control
UDP – User Datagram Protocol
 Simplicity itself
 No connection setup is needed in advance
 No release at the end
 No flow control
 No retransmissions
 Error Control is optional
 Length
 Length of the entire UDP datagram (Header +

Payload)
 Checksum
 Checksum of (Pseudo-header + Header + Payload)

 Checksum field is optional in UDP

 If it is not used, it is set to a value of all zeroes

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy