Lecture-8-Transport Layer-Part-1
Lecture-8-Transport Layer-Part-1
Transport Layer
Transport layer 1
Transport Layer
Chapter goals: Chapter Overview:
understand principles transport layer services
behind transport layer multiplexing/demultiplexing
services: connectionless transport: UDP
multiplexing/demultiplexing
principles of reliable data transfer
reliable data transfer
flow control connection-oriented transport:
congestion control
TCP
reliable transfer
flow control
instantiation and
implementation in the connection management
Internet principles of congestion control
TCP congestion control
Transport layer 2
4
Each layer solves a subset
of Ethernet Frame • Link layer: shares a physical
MAC addresses, CRC, etc. channel among several
transmitters/receivers
IP Packet
Ethernetproblems
IP addresses, TTL, etc. • Network layer: routes from
payload source to destination, along
TCP Segment many hops.
IP #, ack
Port #, sequence
payload • Transport layer:
HTTP#,Response
etc. • Creates connections/sockets
TCP
status code, used by apps.
payload etc.
content-type, • Multiplexing (>1 connection
per machine)
<html><body><h1 • Ordering, •
taerg yM> Acknowledgement, •Pacing
Transport services and protocols
provide logical communication application
transport
between app’ processes network
running on different hosts data link network
physical data link
network
implemented in end systems, data link
physical
• Constrained by service
model of Network-layer Let’s look at a simple
protocol
analogy to see their
subtle differences
Transport layer 4
Transport Layer vs. Network Layer
Transport layer 5
Transport Layer vs. Network Layer
Their services are constrained by the
possible services that the postal service
provides
Transport layer 7
Logical Communication
sending receiving
Transport layer 10
Multiplexing / demultiplexing
Multiplexing:
gathering data from multiple 32 bits
app processes, enveloping
data with header (later used source port # dest port #
for demultiplexing)
other header fields
multiplexing/demultiplexing:
based on sender, receiver
port numbers, IP addresses
application
source, dest port #s in
data
each segment (message)
recall: well-known port
numbers for specific
applications TCP/UDP segment format
source port:23
dest. port: x
Source IP: C Source IP: C
Dest IP: B Dest IP: B
source port: y source port: x
port use: simple telnet app dest. port: 80 dest. port: 80
Source IP: A
Dest IP: B
source port: x
Web
Web client dest. port: 80 server B
host A
port use: Web server
Transport layer 14
UDP checksum
Sender: Receiver:
treat segment contents as compute checksum of received
sequence of 16-bit integers segment
checksum: addition (1’s check if computed checksum
complement sum) of segment equals checksum field value:
contents NO - error detected
sender puts checksum value YES - no error detected.
into UDP checksum field But maybe errors
nonetheless? More later ….
Transport layer 15
UDP checksum example:
Three packets of 16 bits The 1’s complement of
each ‘r’ is:
0110011001100110 0011010100110101
0101010101010101 at destination, the sum
0000111100001111 of four packets should
adding the three, calling be:
it ‘r’: 1111111111111111
1100101011001010 If the packet is
Send the four packets, damaged:
the original three and 1111101111111111
1’s complement of ‘r’ to (zeros!!)
destination
1 1 0 1 1 1 0 1 1 1 0 1 1 1 01 1
1 0 1 1 1 0 1 1 1 0 1 1 1 10 0
0 1 0 0 0 1 0 0 0 1 0 0 0 0 1layer 1
Transport 17
Reliable Transport
Protocols
Transport layer 18
TCP provides streamingconnections to apps
1
0
Transport layer 22
Rdt2.0: channel with bit errors
Occurs during transmission, propagation and buffering
Transport layer 26
rdt3.0 sender
Transport layer 31
1
Performance of stop and wait 5
• Eg., An ISP’s fiber link from New Jersey to San Jose, CA:
1 Gbps link, 15 ms propagation delay, 1 kByte packet size:
illustration
send receiv
first packet bit er er
transmitted, t = 0 last
packet bit transmitted, t = L
/R
All this first packet bit arrives
time is RT last packet bit arrives,
idle and T send ACK
wasted.
ACK arrives,
send next
packet, t = RTT
+L/R
Pipelined protocols
Pipelining: sender allows multiple, “in-flight”, yet-to-
be-acknowledged packets
range of sequence numbers must be defined
buffering at sender and/or receiver
Transport layer 35
Go-Back-N
Transport layer 36
Go-Back-N
Sender is allowed to transmit up to N unACKed
packets
Sender:
base
Sequence
Number Space
Defined in packet
header, with k-bit
sequence #
nextseqnum
nextseqnum
nextseqnum
nextseqnum
nextseqnum
nextseqnum
nextseqnum
nextseqnum Transport layer 37
Go-Back-N in action
Transport layer 38
Go-Back-N in action
N=4
Transport layer 39
Selective Repeat
Sender Window:
N consecutive Seq #’s
again limits seq #s of sent, unACKed pkts
Transport layer 40
Selective Repeat: sender, receiver windows
Transport layer 41
Selective repeat in action
Transport layer 42
Selective repeat in action