Lecture 5 Slides
Lecture 5 Slides
Introduction to Networks
Hisham Othman
Basma Mohamed Afifi
Nadeen Hamza
flow control
unreliable, unordered network
data link
physicalnetwork
delivery: UDP data link
physical
no-frills extension of “best- network
data link
application
effort” IP physical network transport
data link network
services not available: physical data link
physical
delay guarantees
bandwidth guarantees
Best Effort vs. Reliable
Both TCP and UDP use the IP protocol for data delivery
IP is a best-effort delivery protocol
No guarantees for segment delivery
No guarantees for ordered delivery
No guarantees for data integrity
Both TCP & UDP extend host-to-host delivery to process-to-
process delivery through multiplexing & demultiplexing
Both TCP and UDP provide data integrity through checksums
TCP extends IP delivery service and makes it reliable
Uses flow control, handshaking (acknowledgement), sequencing, and
timing for reliable and ordered segment delivery
Also uses congestion control for balanced use of network resources
UDP doesn’t care about reliable delivery
Multiplexing/demultiplexing
Examples of Transport-layer Protocols
used by Applications
Application
Layer
rdt_send() deliver_data()
Transport
Layer
Reliable Channel
udt_send() rdt_rcv()
Network
Layer
Unreliable Channel
Provided Service Service Implementation
TCP: Overview
TCP: Features
point-to-point: Receiver feedback
one sender, one receiver acknowledgements
reliable, in-order byte full duplex data:
stream: bi-directional data flow in
no “message boundaries” same connection
connection-oriented: MSS: maximum segment size
handshaking (exchange of flow controlled:
control msgs) initializes sender sender will not overwhelm
& receiver state before data receiver
exchange
pipelined:
application application
socket
door
writes data reads data
socket TCP congestion and flow
door
TCP
send buffer
TCP
receive buffer
control set window size
send & receive buffers
segment
TCP Connection Management
Three-way handshake:
Step 1: client host sends TCP SYN
segment to server
specifies initial seq. #
no data
timed wait
sends FIN
closed
TCP Connection Management (cont.)
closed
TCP segment structure
32 bits
URG: urgent data
source port # dest port # counting
(generally not used)
by bytes
sequence number of data
ACK: ACK # (not segments!)
valid acknowledgement number
head not Receive window
PSH: push data now UA P R S F
len used
(generally not used) # bytes
checksum Urg data pointer rcvr willing
to accept
RST, SYN, FIN: Options (variable length)
connection estab
(setup, teardown
commands)
application
data
Internet (variable length)
checksum
(as in UDP)
Receiver Feedback – ACKs
Pipelined protocols
3 ∗ 𝐿/𝑅 𝐿/𝑅
𝑈𝑠𝑒𝑛𝑑𝑒𝑟 = 𝑈𝑠𝑒𝑛𝑑𝑒𝑟 =
𝑅𝑇𝑇 + 𝐿/𝑅 𝑅𝑇𝑇 + 𝐿/𝑅
𝑈𝑠𝑒𝑛𝑑𝑒𝑟 = 0.00081 𝑈𝑠𝑒𝑛𝑑𝑒𝑟 = 0.00027
TCP sender events:
data rcvd from app: timeout:
create segment with seq # retransmit segment that
Host A Host B
timeout
X
loss
time
Cumulative ACK scenario
TCP: retransmission scenarios
Seq=92 timeout
timeout
X
loss
Seq=92 timeout
premature timeout
time time
lost ACK scenario
TCP sender events:
Segment 1 Segment 2 Segment 3 Segment 4 Segment 5
… 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 …
Host A Host B
Cumulative ACK
timeout
X buffer
loss
Cumulative ACK
Cumulative ACK
X
timeout
Duplicate ACK
time
TCP Round Trip Time, Timeout
Transport-layer services
Multiplexing and demultiplexing