Transcript EEC 682/782
EEC-484/584
Computer Networks
Lecture 12
Wenbing Zhao
[email protected]
(Part of the slides are based on Drs. Kurose &
Ross’s slides for their Computer Networking book)
2
Outline
• Reminder:
– Nov. 14 (Wed): CSU IS&T data center tour
– Nov. 12 (Mon): no class, in honor of the Veterans Day
•
•
•
•
•
Quiz#3 results
Introduction to transport layer
Multiplexing/demultiplexing
Reliable data transfer mechanisms
Sliding window protocols (part I)
Fall Semester 2007
EEC-484/584: Computer Networks
Wenbing Zhao
3
EEC 484 Quiz#3 Results
• High: 98, low: 75, average: 89.3
• Q1: 46.7/50, Q2: 18.5/20, Q3: 9.2/10, Q4: 15/20
Number of Students
EEC484 Quiz#3 Score Distribution
4.5
4
3.5
3
2.5
2
1.5
1
0.5
0
65-74
75-84
85-89
90-100
Score Range
Fall Semester 2007
EEC-484/584: Computer Networks
Wenbing Zhao
4
EEC 584 Quiz#3 Results
• High: 100, low: 75, average: 84.4
• Q1: 40.7/50, Q2: 19/20, Q3: 8.5/10, Q4: 16.2/20
EEC584 Quiz#3 Score Distribution
Number of Students
8
7
6
5
4
3
2
1
0
50-59
60-64
65-74
75-84
85-89
90-100
Score Range
Fall Semester 2007
EEC-484/584: Computer Networks
Wenbing Zhao
5
Transport Layer
Our goals:
• Understand
principles behind
transport layer
services:
– multiplexing/demult
iplexing
– reliable data
transfer
– flow control
– congestion control
Fall Semester 2007
• Learn about transport
layer protocols in the
Internet:
– UDP: connectionless
transport
– TCP: connectionoriented transport
– TCP congestion control
EEC-484/584: Computer Networks
Wenbing Zhao
6
Transport vs. Data Link Layer
• Similarities: deal with error control, sequencing,
flow control
• Difference: operating environments
Environment of the data link layer
Fall Semester 2007
Environment of the transport layer
EEC-484/584: Computer Networks
Wenbing Zhao
7
Transport vs. Network Layer
• Network layer: logical communication between
hosts
• Transport layer: logical communication
between processes
– Relies on, enhances, network layer services
Fall Semester 2007
EEC-484/584: Computer Networks
Wenbing Zhao
Internet Transport-Layer Protocols
• Reliable, in-order
delivery (TCP)
application
transport
network
data link
physical
– congestion control
– flow control
– connection setup
• Unreliable, unordered
delivery: UDP
– no-frills extension of “besteffort” IP
• Services not available:
– delay guarantees
– bandwidth guarantees
Fall Semester 2007
EEC-484/584: Computer Networks
network
data link
physical
network
data link
physical
network
data link
physical
network
data link
physical
network
data link
physical
application
transport
network
data link
physical
Wenbing Zhao
8
9
Multiplexing/Demultiplexing
Multiplexing at send host:
gathering data from multiple
sockets, enveloping data with
header (later used for
demultiplexing)
Demultiplexing at rcv host:
delivering received segments
to correct socket
= socket
application
transport
network
link
= process
P3
P1
P1
application
P2
transport
network
P4
application
transport
network
link
link
physical
host 1
Fall Semester 2007
physical
host 2
EEC-484/584: Computer Networks
physical
host 3
Wenbing Zhao
10
How Demultiplexing Works
• Host receives IP datagrams
– Each datagram has source
IP address, destination IP
address
– Each datagram carries 1
transport-layer segment
– Each segment has source,
destination port number
• Host uses IP addresses & port
numbers to direct segment to
appropriate socket
Fall Semester 2007
32 bits
source port #
dest port #
other header fields
application
data
(message)
TCP/UDP segment format
EEC-484/584: Computer Networks
Wenbing Zhao
11
Reliable Data Transfer
characteristics of unreliable channel will determine
complexity of reliable data transfer protocol (rdt)
Fall Semester 2007
EEC-484/584: Computer Networks
Wenbing Zhao
12
Reliable Data Transfer
• Basic reliable data transfer mechanisms
– Acknowledgement
– Retransmission
– Sequence numbers
Fall Semester 2007
EEC-484/584: Computer Networks
Wenbing Zhao
13
Sliding Window Protocols
• Full-duplex: Use same connection for data in
both directions (AB and BA)
• Interleave data and ack packets
– B piggybacks its ack for A’s packet onto B’s next
packet
– Savings of header in separate ack packet
• If B sends data infrequently, use timeout to
determine when B should send ack in separate
ack packet
Fall Semester 2007
EEC-484/584: Computer Networks
Wenbing Zhao
14
Sliding Window Protocols
• Each packet contains sequence number in ranges
0..2n-1 (for n-bit sequence numbers)
• Sending window – list of consecutive sequence
numbers of packets that sender is permitted to send
1st outstanding Last packet
packet
sent
0
0
1
2
3
4
5
6
1
1
2
3
4
5
6
3
4
5
6
7
4
5
6
7
7
A new packet sent
(if send window allows)
0
2
0
7
1
ack
3
2
3
Sent window shrinks when the ack corresponding
Sent window enlarges when more packet is sent
to the 1st outstanding packet Is received
Fall Semester 2007
EEC-484/584: Computer Networks
Wenbing Zhao
15
Sliding Window Protocols
• When new packet arrives from application layer, it is
given next highest sequence number, and upper edge of
window is incremented
• When ack arrives from receiver, lower edge of window is
incremented
• Within sending window, packets sent but not acked
– Sender must keep those packets for possible retransmission
– If max window size = w, need w buffers
Fall Semester 2007
EEC-484/584: Computer Networks
Wenbing Zhao
16
Sliding Window Protocols
• Receiving window – list of consecutive sequence
numbers of packets that receiver is permitted to accept
• When packet with (seq num = lower edge of window) arrives
– Packet is passed to higher layer
– Ack is generated
– Window slid down by 1 (remains same size as was initially)
3
Fall Semester 2007
0
1
2
3
4
5
6
7
0
1
2
3
4
5
6
7
EEC-484/584: Computer Networks
Wenbing Zhao