Week-3
Week-3
INTERNET PROTOCOLS
SOUMYA K GHOSH SANDIP CHAKRABORTY
COMPUTER SCIENCE AND ENGINEERING, COMPUTER SCIENCE AND ENGINEERING,
IIT KHARAGPUR IIT KHARAGPUR
1
Transport Layer - I (Services)
Application Application
Transport Transport
Network Network Network
Data Link Data Link Data Link Data Link Data Link
Physical Physical Physical Physical Physical
Protocol Stack Implementation in a Host
Application
Transport
Software, Kernel
Network
Data Link
Firmware, Device Driver
Physical
Hardware
How Application Data Passes Through Different Layers
HTTP
HTTP Data
Application Header
TCP
Transport Layer Data
Transport Header
IP
Network Header
Network Layer Data
Flow and
End to end Connection Reliable Data Ordered Packet
Congestion
packet delivery Establishment Delivery Delivery
Control
Network
6
COMPUTER NETWORKS AND
INTERNET PROTOCOLS
SOUMYA K GHOSH SANDIP CHAKRABORTY
COMPUTER SCIENCE AND ENGINEERING, COMPUTER SCIENCE AND ENGINEERING,
IIT KHARAGPUR IIT KHARAGPUR
1
Transport Layer - II (Connection I)
Application Application
Connection
Transport Transport
Network Network Network
Data Link Data Link Data Link Data Link Data Link
Physical Physical Physical Physical Physical
Connection Establishment
Serve
Client
r
CONNECT LISTEN
• Consider retransmission for ensuring reliability – every packet uses different paths
to reach the destination
• Packets may be delayed and got struck in the network congestion, after the
timeout, the sender assumes that the packets have been dropped, and
retransmits the packets
Connection Establishment
Serve
Client
r
CONNECT LISTEN
It may happen that the
server has crashed and
reinitiated the
connection. So
distinguishing between
these two is essential
• The period T and the rate of packets per second determine the size of
the sequence number – at most one packet with a given sequence
number may be outstanding at any given time
Sequence Number Adjustment
• Two important requirements (Tomlinson 1975, Selecting Sequence
Numbers)
Sequence Numbers
Conn 1
crashed Connection 2
Connection 1
Time
Packet Lifetime T
• A Delayed duplicate packet of connection 1 can create a confusion for
connection 2
What We Ideally Want? Either …
Conn 2
Sequence Numbers
Conn 1 initialized
crashed
Connection 2
Connection 1
Time
Packet Lifetime T
What We Ideally Want? Or …
Conn 2
initialized
Connection 2
Sequence Numbers
Conn 1
crashed
Connection 1
Time
Packet Lifetime T
18
COMPUTER NETWORKS AND
INTERNET PROTOCOLS
SOUMYA K GHOSH SANDIP CHAKRABORTY
COMPUTER SCIENCE AND ENGINEERING, COMPUTER SCIENCE AND ENGINEERING,
IIT KHARAGPUR IIT KHARAGPUR
1
Transport Layer - III (Connection II)
Application Application
Connection
Transport Transport
Network Network Network
Data Link Data Link Data Link Data Link Data Link
Physical Physical Physical Physical Physical
Initial Sequence Number during Connection Establishment
Conn 2
initialized
Sequence Numbers
Conn 1
crashed Connection 2
Connection 1
Time
Packet Lifetime T
• A Delayed duplicate packet of connection 1 can create a confusion for
connection 2
What We Ideally Want? Either …
Conn 2
Sequence Numbers
Conn 1 initialized
crashed
Connection 2
Connection 1
Time
Packet Lifetime T
What We Ideally Want? Or …
Conn 2
initialized
Connection 2
Sequence Numbers
Conn 1
crashed
Connection 1
Time
Packet Lifetime T
Connection Establishment – Handling Delayed Duplicates
• Receiver receives two segments having the
same sequence number within a duration T
– One packet must be the duplicate
– The receiver discards the duplicate
packets.
Source: Computer
Networks (5th Edition) by
Tanenbaum, Wetherell
CONNECTION REQUEST and ACK both are Delayed Duplicates
Source: Computer
Networks (5th Edition) by
Tanenbaum, Wetherell
Connection Release – Symmetric Release
• Treats the connection as two separate unidirectional connections and requires
each one to be released separately
• Does the job when each process has a fixed amount of data to send and clearly
knows when it has sent it.
1
Transport Layer - III (Connection II)
Application Application
Connection
Transport Transport
Network Network Network
Data Link Data Link Data Link Data Link Data Link
Physical Physical Physical Physical Physical
Initial Sequence Number during Connection Establishment
Conn 2
initialized
Sequence Numbers
Conn 1
crashed Connection 2
Connection 1
Time
Packet Lifetime T
• A Delayed duplicate packet of connection 1 can create a confusion for
connection 2
What We Ideally Want? Either …
Conn 2
Sequence Numbers
Conn 1 initialized
crashed
Connection 2
Connection 1
Time
Packet Lifetime T
What We Ideally Want? Or …
Conn 2
initialized
Connection 2
Sequence Numbers
Conn 1
crashed
Connection 1
Time
Packet Lifetime T
Connection Establishment – Handling Delayed Duplicates
• Receiver receives two segments having the
same sequence number within a duration T
– One packet must be the duplicate
– The receiver discards the duplicate
packets.
Source: Computer
Networks (5th Edition) by
Tanenbaum, Wetherell
CONNECTION REQUEST and ACK both are Delayed Duplicates
Source: Computer
Networks (5th Edition) by
Tanenbaum, Wetherell
Connection Release – Symmetric Release
• Treats the connection as two separate unidirectional connections and requires
each one to be released separately
• Does the job when each process has a fixed amount of data to send and clearly
knows when it has sent it.
1
Transport Layer - V (Sliding Window Protocols)
Application Application
Flow Control & Reliable Data Delivery
Transport Transport
Network Network Network
Data Link Data Link Data Link Data Link Data Link
Physical Physical Physical Physical Physical
Stop and Wait versus Sliding Window (Pipelined)
Source:
http://ironbark.xtelco.com.au/subjects/DC/
lectures/13/
Sliding Window for a 3 bit Sequence Number
• How does the flow and error control protocol handle a timeout?
• Go Back N ARQ: If segment N is lost, all the segments from segment 0 (start of
the sliding window) to segment N are retransmitted
• Selective Repeat (SR) ARQ: Only the lost packets are selectively retransmitted
– Negative Acknowledgement (NAK) or Selective Acknowledgements
(SACK): Informs the sender about which packets need to be retransmitted
(not received by the receiver)
Go Back N ARQ – Sender Window Control
Source
https://www.tutorialspoint.com/data_co
mmunication_computer_network/data_li
nk_control_and_protocols.htm
Go Back N ARQ – Sender
0 1 2 3 0 1
0 1 2 3 0
0 1 2 3 0 2
0 1 2 3 0
3
0 1 2 3 0 0 1 2 3 0
0 1 2 3 0 0
0 1 2 3 0
Timeout
Go Back N ARQ (MAX_SEQ = 3, Window Size = 3)
0
0 1 2 3 0 0 1 2 3 0
0 1 2 3 0 1
0 1 2 3 0
0 1 2 3 0 2
0 1 2 3 0
Timeout
0
0 1 2 3 0 0 1 2 3 0
0 1 2 3 0 1
0 1 2 3 0 1 2
0 1 2 3 0 2
0 1 2 3 0 1 2
Timeout
0
0 1 2 3 0 0 1 2 3 0 1 2
Selective Repeat (MAX_SEQ = 3, Window Size = 3)
0
0 1 2 3 0 0 1 2 3 0 1 2
0 1 2 3 0 1
0 1 2 3 0 1 2
Timeout
0 1 2 3 0 0
0 1 2 3 0 1 2