Computer Networks Prof.
Hema A Murthy
SWS, RWS, Max Sequence Number
≤
• SWS ? MaxSeqNum – 1
• Why ? Suppose MaxSeqNum = 7
• Frames sent: 0, 1, 2, 3, 4, 5, 6, 7
• Suppose acks losts
– Frames resent
• receiver expects 0, 1, 2, 3, .., 7
– second batch but get duplicate avoid
• 0, 1, 2, 3, 4, 5, 6, 0, 1, 2, 3
Indian Institute of Technology Madras
Computer Networks Prof. Hema A Murthy
SWS, RWS, Max Sequence Number
• receiver knows there is a problem when
RWS = 1
• what if RWS = SWS = 7
• Sender sends 0,1, 2, …, 6 successfully
received – acks lost
Indian Institute of Technology Madras
Computer Networks Prof. Hema A Murthy
SWS and RWS, Max Sequence
Number
• Receiver expects 7, 0, …, 5
• Sender timeout – sends 0, ..., 6
• Receiver expects second batch
• Sender sends first batch 0, 1, 2, 3
• SWS ≤ (MaxSeqNum +1) / 2
• 0, 1, 2, 3 successfully received.
• Next sender sends 4, 5, 6, 7
• What is the rule for RWS < SWS in general?
Indian Institute of Technology Madras
Computer Networks Prof. Hema A Murthy
FSM: Sliding Window Protocol:
Sender Process Tout >
Max
LLC r etri
Send es
Tx
Idle No
ReTxAll
Yes
Fail
. Tout
N
Active LLC Send
Y / Success empty?
.
ack
Y/
Slide Window no s
pac
. Window full?
e
No
Indian Institute of Technology Madras
Tx
Computer Networks Prof. Hema A Murthy
FSM: Sliding Window Protocol:
Receiver process:
LLC Recv
Start Tx
LLC Recv
Idle Time Start Rx
o ut
Fail
Y
Su
cc
es
s
.
Empty ? N
In seq
? N Active
Ack
M
Y
. Y
N
Buffer
slide ax seq, x
Within en d R
window?
Indian Institute of Technology Madras N / discard
Computer Networks Prof. Hema A Murthy
SWP – Timing Diagram
Sdr
0 Rcv
1
Time 2
2
ack
Indian Institute of Technology Madras
Computer Networks Prof. Hema A Murthy
Sliding Window efficiency:
frame 1
t0
A B
frame a frame 2 frame 1
A B
t0+a
frame a+1 frame 2
A B
t0+a+1
ack 1 Start ack 1
frame N
A B
t0+2a+1
Indian Institute of Technology Madras
Computer Networks Prof. Hema A Murthy
SWP: Efficiency
• Case 1: N > 2a+1
• A transmits continuously without pause
• U=1
• Case 2: N < 2a+1
• U = N / 2a+1
Indian Institute of Technology Madras
Computer Networks Prof. Hema A Murthy
SWP: Transmission with errors
• Nr = E [ number of transmitted frames to
∞
successfully transmit onei −frame]
N r = ∑ f (i ) P (1 − P)
1
i =1
f (i ) = 1 + (i − 1)k
1 − P + kP
=
1− P
k is the number of retransmission of a frame
Indian Institute of Technology Madras
Computer Networks Prof. Hema A Murthy
Approximation for k
k = 2 a + 1, when N > 2 a + 1
k = N , when N < 2 a + 1
1− P
U= , N > 2a + 1
1 + 2 aP
N (1 − P )
U = , N < 2a + 1
( 2 a + 1)(1 − P + NP )
Indian Institute of Technology Madras
Computer Networks Prof. Hema A Murthy
Utilisation for different protocols
(Stallings) P = 10−3
1.0 N = 127 selective
reject
0.8
N = 7 goback
N = 7 selective reject
0.6 N = 127 goback N
0.4 Sliding
window
0.2
0.1 1 10 100 1000
a
Indian Institute of Technology Madras
Computer Networks Prof. Hema A Murthy
DLL and the Internet
• p-p-p link
000
000
000
000
router
Indian Institute of Technology Madras
Computer Networks Prof. Hema A Murthy
DLL and the Internet
• home PC calls ISP
– home PC simple – character oriented terminal
– shell account on hosts - time sharing machine
– graphics based – PC acts as Internet hosts
– all Internet services including graphics
available.
Indian Institute of Technology Madras
Computer Networks Prof. Hema A Murthy
DLL and the Internet
• How Home PC connects to the Internet:
– PC calls ISP’s router via modem.
– After modem answers, establish a physical connection.
– PC sends router a series of LCP packets in the payload
of a PPP frame -
– used to select PPP parameters & responses
– NCP packets are sent to configure NWL options
– PC wants to run TCP / IP stack
• needs IP addresses
• NCP for dynamic address allocation
Indian Institute of Technology Madras
Computer Networks Prof. Hema A Murthy
DLL and the Internet
• NCP – Network Control Protocol
– negotiate NWL options
– independent of NWL protocol
– separate for each type of NWL protocol
Indian Institute of Technology Madras
Computer Networks Prof. Hema A Murthy
P-P-P
• Framing – fixed frame format
• Link Control Protocol
– bring up lines, testing negotiation options, bring down
lines
– User sends ISP host IP packets & receives IP packets.
– User finishes, NCP tears down connection, face IP
address.
– LCP shuts down DLL connection
– Finally computer tells modem to hang up – release
physical connection
Indian Institute of Technology Madras
Computer Networks Prof. Hema A Murthy
HDLC- A P-P Protocol
flag byte 1 byte 2 bytes variable flag byte
Check
1111111 control protocol payload sum
address 1 byte
When byte of kbs in the payload
Information, supervisory
Indian Institute of Technology Madras