Self Organization: Hebbian Learning CS/CMPE 333 – Neural Networks.
CMPE 252A: Computer Networks SET 5:
description
Transcript of CMPE 252A: Computer Networks SET 5:
1
CMPE 252A: Computer Networks
SET 5:
Link Control Protocols
2
Internet Example
R
P
HOST
link-level frames exchanged among link interfaces
3
Logical Link Control
MAC protocol provides best effort service.
LLC bridges the gap between service expected by network layer and service provided by MAC layer.
LLC uses the header information in MAC frames if LLC runs over a multiple access link.
4
Functions at The Link Layer:Point-to-Point Link
Framing and synchronization Distinguish each frame
Error checking Detect or correct errors incurred over link
Retransmission strategy Link management
Deciding when a link exists or does not Flow control
Pace the sender to avoid congestion at receiver No need to name sender and receiver
5
Functions at The Link Layer:Multiple Access Link
MAC: Framing and synchronization Error checking Naming within LANs (with MAC addresses) Sharing of medium Flow control (in some cases)
LLC: Retransmission strategy Link management (deciding when a link exists or does not) Flow control (in some cases)
6
Types of Service LLC Can Provide
Unacknowledged connectionless service: Datagram transmission, no connection exists, no error checking, framing is the only service provided (e.g., SLIP).
Acknowledged connectionless service: No connections, each frame is ACKed individually. This service can be provided as part of the MAC itself
(e.g., IEEE 802.11) Connection-Oriented Service: Data exchanged
within a connection, provides net layer with a virtual reliable packet stream (e.g., HDLC, PPP)
7
Framing of Bits Physical layer provides raw stream of bits to the link
layer. The objective is for the receiver to understand the
packets (frames) sent by the sender when bits may get corrupted over the channel.
Some approaches: Character count, not used because it does not
work well with transmission errors. Character- or byte-oriented framing (e.g., BISYNC,
IMP-IMP, SLIP, and PPP) Bit-oriented framing: HDLC Physical-layer coding violations: Used when
encoding on the PHY contains redundancy. Example: Data 1 = 10, and Data 0 = 01; then frame
control can be a sequence of “11 and 00”
8
Character-Oriented Framing A frame starts and ends with a predefined sequence of control
bytes or characters, and the occurrence of such sequence in the packet payload is avoided by byte stuffing.
Consider the ARPANET IMP-IMP protocol:
SY
N
DLE
STX packet payload (header and data)
CR
C
CR
C
CR
C
ETX
DLE
SY
N
SYN = synchronizationDLE = data link escapeSTX = packet start
Character stuffing:If DLE occurs in packet data, sender substitutes DLE with DLE DLEReceiver substitutes DLE DLE in packet payload with DLE In PPP, flag is 01111110 and such pattern in payload is preceded by 01111101
9
Bit-Oriented Framing The same procedure is used with bits, bits are stuffed to break the occurrence of control flags. Bit stuffing consists of adding a bit after the occurrence of a bit pattern equal to the control flag used to frame the packet. Assume the control flag is 01111110 If flag pattern occurs in payload, sender must transmit something different and receiver must be able to get original data. HOW?...Sender inserts a 0 after 5 1’s, and receiver deletes any 0 received after five 1’s in a bit sequence, and the frame is
ended if after 5 1’s “10” is detected.
01111110 01111110
flag flag
…..101101010011111010 110001011111010011….
payload with bit stuffing
Receiver then deletes stuffed 0 in any sequence ...1111101 and obtains original data: …..1011010100111111011000101111110011….
…..1011010100111111011000101111110011….Original data:
10
Error Control
Majority of protocols use error detection coding because it requires fewer overhead bits than error correction coding.
However, error detection is effective only if the bandwidth-delay product of the link is small, i.e., if feedback regarding errors in received packets can be given quickly to the sender, before it sends too many bits.
Error detection code used by almost all networks is the cyclic redundancy code (CRC)
11
CRC CRC codes detect errors by adding a few bits (redundancy bits
or CRC bits) to each packet. The attractive features of CRC are that only a few redundancy
bits are needed to protect many bits of information, and it can be implemented with very simple hardware.
A message of m bits is transmitted with r redundancy bits as a transmitted string T = M.R
With the message bits being the most significant bits transmitted, and given that R occupies r bit positions, we have
RMT r +⋅≡ 2 M R
r+m-1 r r-1 0 bits
12
CRC The procedure to choose R to protect M is
remarkably simple. A string G of r+1 bits called the generator is agreed
upon. R is chosen so that T = A xG for some A => If the received string T’ is not a multiple
of G, then an error has been detected! T’ equals the (modulo 2) addition of T and an
error pattern E, such that a 0 in the pattern indicates no error in that bit position.
Now we have:
ER2'
2
e, therefor;2
++⋅≡
+×=⋅
×=+⋅≡
r
r
r
MTalso
RGAM
GARMTR is the remainder of dividing by G theshifted M
13
CRC Therefore, to protect M, the sender:
Computes R by dividing M (shifted r bit positions) by G
Transmits M followed by R When the receiver obtains T’ :
It divides T’ by G Decides that there is an error if the remainder
of the division is not 0 The trick is then choosing a G for which the
likelihood that T’ contains an error string E that is divisible by G is very small.
14
CRC The choice of G is done such that:
First and last bit of G are 1: This ensures that all single bit errors are detected.
G is a factor of (x+1): To detect any odd number of errors.
G has a factor with at least three terms: To detect double-bit errors.
Code detects all burst of errors with fewer than r bits and most other burst errors.
e.g., Ethernet uses “CRC-32”
15
Functions at The Link Layer MAC:
Framing Error checking Naming within LANs (with MAC addresses) Sharing of medium Flow control (in some cases)
LLC: Retransmission strategy Link management (deciding when a link exists or does not) Flow control (in some cases)
16
Retransmission Strategies Called Automatic Repeat Request (ARQ)
algorithms or protocols. Design Issues:
How does a receiver ask for a retransmission? How does the sender know when to retransmit? How are packets associated with requests for
retransmissions? Performance and correctness. We will assume point-to-point links for
simplicity.
17
ARQ Assumptions
The protocol operates at the link layer.
One sender and one receiver. Links and nodes behave in FIFO order. Nodes execute ARQ protocol correctly. Session between sender and receiver
is already initialized and is permanent. All errors are detected correctly and
framing is done perfectly.
18
Generic ARQ Scheme in FIFO Channels
SENDER INITIATED
SENDER RECEIVERSEQ. # CRC
PACKET
ACK
TIMEOUT
retransmitif no ACK
acknowledge packetif no errors
time time
19
Generic ARQ SchemeRECEIVER INITIATED
SENDER RECEIVER
SEQ. # CRC
PACKET
ACK/POLL
TIMEOUT
retransmitif asked
acknowledge packet if no errors; poll
time time
POLL
20
Requirements in ARQ Sender labels each packet it sends using a
linear sequence-number space. Receiver ACKs each packet it receives
without errors and numbers each ACK with the sequence number of the corresponding packet.
Sender times out after not receiving an ACK for the packet within some finite amount of time, and retransmits the packet then.
Sender sends up to a certain number on un-ACKed packets.
21
Stop-and-Wait ARQ Sender transmits packets labeled 1, 2,….. Receiver ACKs every packet received
correctly and ACK specified the packet being acknowledged (or next expected packet).
Receiver passes copy of packet correctly received to the network layer and drops packets with errors.
Sender retransmits copy of packet if no ACK arrives within a timeout interval.
Sender and receiver are initialized to start sending and receiving packet 1.
22
Stop-and-Wait Protocol (SWP)
Sender’s algorithm:1. Initialize packet number (PN) to 0 [or1 for
example].2. Wait until packet is received from network layer;
assign PN to packet.3. Transmit (or retransmit) packet in frame with PN
as its sequence number.4. Start timeout timer and wait for ACK from receiver.5. If error-free ACK specifying PN is received within
timeout interval then set PN = PN+1 and repeat Step 2.
else repeat Step 3
23
Stop-and-Wait Protocol
Receiver’s algorithm:1. Initialize next packet (NP) to 0 [or 1 for example]
and repeat Step 2 forever2. If ( packet is received ) then
if (error in packet) then discard packet else do
if ( PN=NP ) then give packet to network layer and
set NP = NP+1 send ACK containing PN (or NP)
24
Efficiency of SWP
Consider the case in which no errors occur.
timeSENDER
RECEIVER
PACKET
P
τ Q
ACK
A τ
S=minimum time between successive packet transmissions
Q
Processing delay
25
Efficiency of SWP
From the diagram we have: )(2 τ+++= QAPSHowever, packets and ACKs may be lost or corrupted in the channel and it takes much longer to send a packet successfully.
timeSENDER
RECEIVER
X = total time to transmit a packet and its ACK correctly
x
timeout timeout
ACK
X
processing ACKprocessing
processing
S
26
Efficiency of SWP Let p be the probability that a packet or its ACK is
not sent correctly over the link. This implicitly assumes that each attempt to
succeed sending a packet is independent of others. We have again the geometric random variable! The number of transmissions needed for success is
of course 1/(1-p). All the failed transmissions incur one timeout of
time, and all of these occur with probability p. The last transmission incurs S seconds and occurs
with probability 1-p.
27
Efficiency of SWP We can apply a simple graphical method.
start end
no transmission error
S, 1-p
errorT, p
T = timeoutS = P+A+2Q+2τ
p
pTSXE
XETpSpXE
−+=
++−=
1}{
}){()1(}{
€
Efficiency = η =packet time
E{X}=
P
E{X} pTSp
Pp
+−−
=)1(
)1(η
0 ;)2)(1(
)1(=
+++−−
≈ QpTAPp
Ppτ
ηToo much overhead over noisy links or links with large b-d products!
28
Selective Repeat ARQ Motivation: SWP leaves sender idle for long periods of
time waiting for ACKs. Solution: Allow sender to transmit multiple packets while
waiting for the ACK of a given packet. Requirements:
Sender and receiver can buffer a number (W ) of packets Sender labels packets using consecutive numbers 1, 2,…. Receiver buffers packets received without error, ACKs them, and
delivers packets to network layer in the correct order(e.g., if packet P1 is in error and P2 and P3 are received correctly, the receiver buffers them until it receives P1 correctly)
Sender buffers copies of transmitted packet until it receives the corresponding ACK.
Sender retransmits a packet when its timeout expires with no ACK. ACK refers to the sequence number of the packet it acknowledges.
29
4
How Many Packets Allowed in Sender’s Buffer?
Assume we allow a maximum of W=4 in buffer
time
S
R
1
timeout
X1
1
2
1
2
3
2 2
3
3
1
2
3
4
2
3
4
4
3
4
1
3
4
1
X1
3
4
1
5
2
3
5
4
5
6
4
1
5
3
2
3
6
4
56 overflows buffer!
6
1
5
and sender cankeep transmittingnew packets!
30
Solution To Buffer Overflow Sender can transmit a new packet if the difference in
smallest and largest seq. # in buffer is smaller than W!
4time
S
R
1
timeout
X1
1
2
1
2
3
2 2
3
3
1
2
3
4
2
3
4
4
3
4
1
3
4
1
X
1
4
1
3
1
timeout
1
5
transmit 1 until ACK is received
2
3
4
1
1
timeout
1
5
ASSUME W=4
2 2
31
Efficiency of SRP Consider the case in which no errors occur.
SPWwith
AQPS
<×+++=
)(2 τ
timeSENDER
RECEIVER
PACKET
P
τQ
ACK
A
€
τ
S = minimum time for packet to be ACKed
PACKET PACKET PACKET
W P
ACK ACK ACK
ACKQ
Note the implicit full duplex operation!
32
Efficiency of SRP
Efficiency of SRP:⎭⎬⎫
⎩⎨⎧= 1,minS
WPSRPη
PACKET
P
PACKET PACKET PACKET
W P
S
With no errors,sender never stops with S < WP
Assume infinite W and T > S, so that sender never retransmits if there are no errors.p =P{ transmission error in packet or its ACK} Y= number of times packet is transmitted
pYE
−=11
)(Y is the Geometric r.v.; therefore,
33
Efficiency of SRP We can also use the graphical method, of course… We focus on the number of transmissions, because all
transmissions last the same time.
start end
no transmission error
1, 1-p
error1, p
expected! as ,1
1}{
}){1()1(}{
pYE
YEppYE
−=
++−=
€
Efficiency = ηSRP =packet time
E{X}=
P
E{X}
∞=−=−
= WppP
PSRP for 1
)1/(η
Let E(X ) be the average time taken to transmit a packet, then E(X)=P E(Y)
Very high efficiency as long as window is longer than S !
34
Correctness of SRP What to prove:
Finite sequence number space: What is the minimum sequence number space we can use so that sender and receiver never get confused with sequence numbers in ACKs and packets.
Safety: Receiver passes packets to the network layer in sequence, without gaps or replicas.
Liveness: Deadlocks never occur.
35
Sequence Numbering in SRPAssume W=4 and sequence numbers are 0 to 4.
time S
R
PKT 1 PKT 2 PKT 3 PKT 4 PKT 5 PKT 6 PKT 7 PKT 8
ACK ACK ACK ACKACK ACK ACK ACK
0 1 2 3
0 1 2 3
sender waits for ACK to pkt 1
4 0 1 2
4 0 1 2
4 0 1 2
S# 0 1 2 3
receiver associates 0 with packet 6… should it?
all packets are passed
to network layer
36
Sequence Numbering in SRPHowever, not all packets are successful
time S
R
PKT 1 PKT 2 PKT 3 PKT 4
0 1 2 3
sender waits for ACK to pkt 1
PKT 1
0
0
S# 0 1 2 3
0
ACK
receiver should associate0 to pkt 1 and NOT pass it to networklayer (sending ACK)
timeout for packet 1
all packets are passed
to network layer
ACK ACK ACK ACK
0 1 2 3
37
Sequence Numbering in SRP…and many cases are possible!
time S
R
PKT 1 PKT 2 PKT 3 PKT 4
0 1 2 3
sender waits for ACK to pkt 1
S# 0 1 2 3
0
ACK
receiver should associate 0 to packet 6!Store it in buffer and sendACK
timeout for packet 1
all packets are passed
to network layerNote that S could have sent packets 5 and 6!
PKT 5 PKT 6
4 0
0
4
ACK ACK ACK ACK
0 1 2 3
38
Sequence Numbering in SRP
time S
R
PKT 1 PKT 2 PKT 3 PKT 4
0 1 2 3
sender waits for ACK to pkt 1
S# 0 1 2 3
0
ACK
What should the receiver do?Association of packet to a seq. number is compromised.
timeout for packet 1
all packets are passed
to network layerWhich case took place?
PKT 5 PKT 6
4 0
0
4
ACK ACK ACK ACK
0 1 2 3PKT 1
0
0
39
Sequence Numbering in SRPHowever, receiver can get confused!
time S
R
PKT 1 PKT 2 PKT 3 PKT 4
0 1 2 3
sender waits for ACK to pkt 1
PKT 1
0
0
S# 0 1 2 3
0
ACK
receiver does notknow if 0 correspondsto replica of packet 1 or packet 6!PASS TO NETWORK LAYER???
timeout for packet 1
all packets are passed
to network layerNote that S could have sent packets 5 and 6!
PKT 5 PKT 6
4 0
0
X4
40
Sequence Numbering in SRP Is modulo 2W sufficient to identify any packet on the fly
or stored? Assume that window is W and packets are numbered modulo
2W (from 0 to 2W -1) Assume that, at time T, packet labeled n is passed to network
layer at the receiver, and is the packet with the highest number that can be passed to net layer!
time
T
R
n
=> n+1 has not been received!(o.w., it would have been sent to network layer)=> ACK(n+1) has not been sent to sender
sender sent packet n <==> sender received all ACKs up to ACK(n-W), because window is W
=> Largest sequence number sent by sender is n+W
=> Smallest sequence number pending an ACK at the sender is n-W+1
Given n, the possible range of sequence numbers of packets at the sender is {n-W+1, n+W} and using modulo 2W sequence number space works correctly
41
Sequence Numbering in SRP The same type of argument can be
made for the receiver, assuming that the sender receives the ACK for packet n for the first time at time T.
HW: Left to the student to show that using a
sequence number space modulo 2W does not confuse the receiver!
Show the same for SWP! W = 1
42
Safety Proof for SRP By induction on sequence number PN of a packet. Prove for the first packet:
S and R are initialized with PN =NP = 0. First packet sent by S is numbered 0. S must retransmit packet with PN = 0, until it receives an
ACK with NP > 0 or NP = 0 from R. While packet numbered 0 is not ACKed, S can only send
packets numbered up to PN = W - 1 to R due to window-size.
Due to buffering policy, R must have buffer space to receive packet 0 and passes it to network layer in sequence when it is received correctly for the first time.
R does not pass packet 0 to the network layer a second time.
Therefore, SRP is safe for packet 0!
43
Safety Proof for SRP Assume that SRP is safe for PN = n-1 and
prove for PN = n: Because R has received packet n - 1, it has set NP = n R can only accept a packet with PN =NP to be passed
to the network layer, which can be done together with a set of other packets whose sequence numbers are in sequence.
When the first error-free copy of packet with PN = n arrives, R passes it to network layer in sequence and increases NP. No replica of the same packet is given to the network layer and no missing packets exist from 0 to n; therefore, SRP is safe.
Q.E.D.
44
Liveness Proof for SRP The trick is to identify key events in time ensuring that the protocol never deadlocks. In an ARQ protocol, the key events can be stated with respect to a given packet numbered n:
The first transmission from S of packet with PN = n occurs at time t1 The first time that R receives an error-free transmission of a packet with any PN < or = n that makes
the packet with PN = n be in sequence occurs at t2 S receives an error-free transmission of an ACK reporting NP = or > n+1 at t3
45
Liveness Proof of SRP
timeSENDER
RECEIVER
PN=i
Set of packets in sequence includingpacket with PN = i is passed to networklayer
t1
ACK
PN ≤ i
NP > or = i +1
t2
t3
NP > i
ACK
∞<] ,[ IF DEADLOCKS NO 31 tt
HSNi SSN
missing missing
46
Liveness of SRPBy definition of SRP, NP(t) and PN(t) are non-decreasing functions of t
Because the channel has a finite propagation delay and t1 is the first time when S releases a packet with PN = i, given that SRP is safe, it is impossible for R to release a packet with PN = i before or at t1; therefore, t2 > t1
Because the probability that any packet and its ACK goes through the channel correctly is > 0, it follows that [t1, t2] is finite.
Because R releases the first ACK with NP ≥ i at time t2 and because the channel has a positive propagation delay, it must be true that t3 > t2
Because the probability of receiving an ACK with an NP covering a packet with PN < NP is non-zero, it follows that [t2, t3] is finite.
Q.E.D.
47
Go-Back-N (GBN) ARQ SRP requires sender and receiver to have a buffer,
which is not an issue today. With GBN, the receiver discards any packet it receives
out of order; therefore, it does not need a buffer. Receiver accepts only those packets received in order. Receiver ACKs a packet received correctly with the
sequence number of the last packet received in sequence.
The sender starts a timer for each packet it transmits, and after the timeout of a packet expires, it retransmits the packet and all the packets sent after that packet.
Sender can have up to W packets waiting for ACKs.
48
GBN ARQ Example 1
time S
R
P
PKT 1
Timeout for pkt 1 (T )
τ
PKT 2 PKT 3 PKT 4
ACK
1
PKT 5
Packet 1 is received correctly; receiver sends ACK
ACK to pkt 1 arrives before its timeout expires; sender can send packet 5.
Sender is able to transmit four packets before timeout for pkt 1 expires
49
GBN ARQ Example 1
time S
R
PKT 1
timeout for pkt 2 (T )
τ
PKT 2 PKT 3 PKT 4
ACK
1
PKT 5
Packets 2 to 4 arrive in order at the receiver; receiver sends ACKs for them (asking for packet 5)
ACK to pkt 2 arrives before its timeout expires; sender can send packet 6.
ACK ACK ACK
2
PKT 6
50
GBN ARQ Example 1
time S
R
PKT 1
timeout for pkt 3 (T )
τ
PKT 2 PKT 3 PKT 4
ACK
1
PKT 5
ACK to pkt 3 arrives before its timeout expires; sender can send packet 7.
ACK ACK ACK
2
PKT 6
3
PKT 7
51
GBN ARQ Example 1
time S
R
PKT 1
timeout for pkt 4 (T )
τ
PKT 2 PKT 3 PKT 4
ACK
1
PKT 5
ACK to packet 4 arrives before its timeout expires; sender can send packet 8, etc.
ACK ACK ACK
2
PKT 6
3
PKT 7
4
PKT 8
52
GBN ARQ Example 2
time S
R
P
PKT 1
timeout (T )
τ
PKT 2 PKT 3 PKT 4
ACK ACK ACKACK
X
all packets are delivered to
network layer but sender does not
know!
PKT 1 PKT 2 PKT 3 PKT 4
packets 1 to W-1 must be retransmitted
2 3 4
ACK to packet 2 arrives after timeout;sender schedules packets 1 to 4 for
retransmission!
53
GBN ARQ Example 2
time S
R
P
PKT 1
timeout (T )
τ
PKT 2 PKT 3 PKT 4
ACK ACK ACK ACK
X
all packets are delivered to
network layer but sender does not
know!
PKT 1 PKT 2 PKT 3 PKT 4
packets 1 to W-1 must be retransmitted
ACK ACK ACK ACK
all packets are discarded
(out of order)
4 4 4 4
PKT 5
Sender can finally send packet 5
S
Note that receiverkeeps sending
a 4 as the last packetreceived in sequence
54
GBN ARQ Example 3
time S
R
P
PKT 1
timeout (T )
τ
PKT 2 PKT 3 PKT 4
ACK ACK ACK
X
No packet can be delivered to network
layer! They are discarded.
Receiver keeps asking for packet 1
PKT 1 PKT 2 PKT 3 PKT 4
packets 1 to W-1 must be retransmitted
1 1 1
ACK to packet 2 arrives after timeout;sender already scheduled packets 1 to 4
for retransmission!
55
GBN ARQ Example 3
time S
R
P
PKT 1
timeout (T )
τ
PKT 2 PKT 3 PKT 4
ACK ACK ACK
X
No packet can be delivered to network layer!
They are discarded. Receiver keeps asking for
packet 1
PKT 1 PKT 2 PKT 3 PKT 4
packets 1 to W-1 must be retransmitted
1 1 1
ACK ACK ACK ACK
all packets are received in order
and passed to network layer.
2 3 4 5
Receiver states the last packet
received in sequence
PKT 5
Sender can finally send packet 5
56
Efficiency of GBN A packet that is not ACKed wastes a timeout (T ) To simplify our analysis, assume T= S = W x P We compute the average time needed for the sender to get
the ACK to a given packet n and advance window to n+1
n n+1
no transmission error
P, 1-p
errorT, p
⎟⎟⎠
⎞⎜⎜⎝
⎛−
+=−
+=
++−=
p
pWP
p
pTPXE
XETpPpXE
11
1}{
}){()1(}{
}{}{
XE
P
XE
timepacketEfficiency ==
11
1
⎟⎟⎠
⎞⎜⎜⎝
⎛−
+=
ppWGBNη
57
Effect of Negative ACKs We have assumed that packets are
retransmitted after a timeout. Using negative acknowledgments (NACKs), the
receiver tells the sender about missing packets and the sender can retransmit after receiving the NACK. This increases throughput.
NACKs and ACKs can be combined in windows of ACKs:
last pkt in sequence … 0 1 0 1 1
58
SRP with NACKs
time S
R
P
PKT 1
timeout (T.O. ) for packet 1
1
2,-
ACK
X
2
PKT 2
X
PKT 3
3
ACK
3,-
PKT 4
4
S knows R has received up to packet 2
59
SRP with NACKs
time S
R
PKT 1
T.O. for packet 3
1
2,-
ACK
X
2
PKT 2
X
PKT 3
3
ACK
3,-
PKT 4
4
ACK
3, (1)
S receives NACK for packet 3 before T.O. expires.
60
SRP with NACKs
time S
R
PKT 1
T.O. for packet 5
1
2,-
ACK
X
2
PKT 2
X
PKT 3
3
ACK
3,-
PKT 4
4
ACK
3, (1)
5
X
PKT 5
S receives NACK for packet 3 before T.O. expires.
PKT 6
6
PKT 3
3
T.O. for packet 3
61
SRP with NACKs
time S
R
PKT 1
T.O. for packet 5
1
2,-
ACK
X
2
PKT 2
X
PKT 3
3
ACK
3,-
PKT 4
4
ACK
3, (1)
5
X
PKT 5 PKT 6
6
PKT 3
3
ACK
3, (101)
PKT 7
7
ACK
5,(1)
PKT 5
5
T.O. for packet 3
S receives NACK for packet 5 before T.O. expires; should not assume a NACK for packet 3!
A bit vector set for packet k in the ACK packet should not be interpreted as a NACK to packet k if the ACK packet is received during the next packet time after packet k is (re)transmitted.no retransmit after NACK if “S” for packet has not elapsed!
62
SRP with NACKs
time S
R
PKT 3
3
T.O. for packet 3
“S” for packet 3
Cannot retransmit before it elapses!Must retransmit after it elapses!
NACK
Potential time saved with NACK
63
SRP with NACKs
time S
R
PKT 1
T.O. for packet 5
1
2,-
ACK
X
2
PKT 2
X
PKT 3
3
ACK
3,-
PKT 4
4
ACK
3, (1)
5
X
PKT 5 PKT 6
6
PKT 3
3
ACK
3, (101)
S receives second NACK for packet 5 before T.O. expires.
PKT 7
7
ACK
5,(1)
PKT 5
5
ACK
5,(11)X
ACK
8,-
PKT 8
64
GBN with NACKs
time S
R
PKT 1
T.O. for packet 1
1
1
ACK
X
2
PKT 2
X
PKT 3
3
ACK
2
to net layer
to net layer
65
GBN with NACKs
time S
R
PKT 1
T.O. for packet 3
1
1
ACK
X
2
PKT 2
X
PKT 3
3
ACK
2
PKT 4
4
ACK
No 3
5
X
PKT 5
to net layer
to net layer
drop
X
66
GBN with NACKs
t S
R
PKT 1
T.O. for packet 3
1
1
ACK
X2
PKT 2
X
PKT 3
3
ACK
2
PKT 4
4
ACK
No 3
5
X
PKT 5
to net layer
to net layer
drop
X
PKT 6
6
drop
X
ACK
No 3
PKT 5 PKT 3 PKT 4 PKT 6
3 4 5 6
to net layer
to net layer
to net layer
to net layer
ACK
3
ACK
4
ACK
5
ACK
6
Not much is gained with NACKs; it all depends on T.O. and S.NACKs must be evaluated at the end of a GBN transmission
67
Initializing a Link Operation of initialization protocol leads to up
and down periods of the link S and R can have different views of the state
of the link S and R should not accept packets from prior
incarnations of the link. We can have a master-slave or peer-to-peer
protocol, which consists of two M-S protocols. Master sends two types of packets: INIT and
DISC, and must stop for ACKs This is the same as the SWP (ABP) protocol!
68
Initializing a Link
time S
R
initializing link up
ACKI
INIT DISC
ACKD
disconnecting link down
link up link down
69
Initialization of ARQ The basic problem is that an initialization protocol
between two parties requires feedback. The simplest scheme is a link-up packet and its
ACK used to set up a link, followed by a link-down packet and its ACK to tear down the link.
This, however, is just the SWP (ABP), which needs to be initialized!
Ad hoc approach: Node starts assuming that link is down, and must wait a
long time period after coming up before it accepts or sends an INIT packet to the link.
In e-t-e protocols (e.g., TCP) the connection is assigned an ID randomly.
70
Link Control over Non-FIFO Channels
Logical link control is often applied over virtual links running above the link layer (e.g., TCP).
The assumptions we have made about fixed RTTs (or retransmission time outs) and the FIFO operation of the link no longer apply when packets must be sent over networks and take different routes from source to receiver.
A virtual link may be able to store up to a finite number of packets in transit.
71
RTT Estimation over Non-FIFO Link
SENDER RECEIVERSEQ. # CRC
PACKET
ACK
time time
RTT
ACK specifies seq # of packet
72
RTT Estimation over Non-FIFO Link
SENDER RECEIVERSEQ. # CRC
PACKET
ACK
time time
RTOX
RTT
73
RTT Estimation over Non-FIFO Link
SENDER RECEIVERSEQ. # CRC
PACKET
ACK
time time
RTO
RTT?
74
RTT Estimation over Non-FIFO Link
SENDER RECEIVERSEQ. # CRC
PACKET
ACK
time time
RTO
XRTT
RTT computationis not safe witha single sequencenumber!
75
RTT Estimation over Non-FIFO Link
SENDER RECEIVERSEQ. # CRC
PACKET
time time
RTOX
RTT
ret #
SEQ. # CRCret #ACK
Because of storage in the channel, the ACK must be bound to a specificpacket transmission, not just the packet sequence number.