SlideShare a Scribd company logo
Chapter 3
Transport Layer
Computer Networking:
A Top Down Approach,

4th edition.
Jim Kurose, Keith Ross
Addison-Wesley
Chapter 3: Transport Layer
Our goals:
 Understand principles
behind transport layer
services:





Multiplexing/De-multiplexing
Reliable data transfer
Congestion control
Flow Control

 Learn about transport

layer protocols in the
Internet:







UDP: connectionless
transport
TCP: connection-oriented
transport
TCP Reliability
TCP congestion control
TCP Flow Control
Transport Services and Protocols
 Transport layer protocols provide

logical communication between app

processes running on different hosts
 From application’s perspective as
if the host running the process
are directly connected
 Transport protocols run in end
systems
 Not in routers
 Sender side: Breaks app
messages into segments, passes
to network layer
 Receiver side: Reassembles
segments into messages, passes
to application layer
 More than one transport protocol
available to applications
 Internet: TCP and UDP

application
transport
network
data link
physical

application
transport
network
data link
physical
Transport vs. Network layer
Network layer: logical communication between hosts
 Transport layer: logical communication between


processes

Household Analogy:


12 kids sending letters to 12 kids

 processes = kids
 app messages = letters in envelopes
 hosts = houses
 transport protocol = Ann and Bill

 network-layer protocol = postal service
 Transport layer relies on Network layer
Internet Transport Layer Protocols
 Internet Protocol (IP)

Best effort delivery service
 No guarantees for segment delivery
 No guarantees for orderly delivery of data
 IP is unreliable service
Extending Host-to-Host delivery to process-to-process delivery.
 Transport layer Multiplexing and De-multiplexing
UDP and TCP also provide integrity checking by including error
detection field in their segment headers.
UDP services

Process to process data delivery

Error checking
TCP Reliable data Transfer
 Congestion Control, sequence numbers, acknowledgements and
timers







Multiplexing/De-Multiplexing
 Every process has a socket which allows

Data to pass from the network to the process

Data to pass from the process to the network
 Receiving host directs an incoming transport layer

segment to appropriate socket.


Uses set of fields in the transport layer segments

 Delivering data in the transport layer segment to the

correct socket is called de-multiplexing.
 Gathering data chunks at the source host from
different sockets ,appending header information and
passing to the network layer is called multiplexing
 Household analogy
Multiplexing/De-multiplexing
Demultiplexing at rcv host:
delivering received segments
to correct socket
= socket

= process

application P3

P1
P1
application

transport

transport

network

network

link

physical

P4

application

link

physical

Multiplexing at send host:
gathering data from multiple
sockets, enveloping data with
header (later used for
demultiplexing)

host 1

P2

transport
network
link
physical

host 2

host 3
How De-multiplexing works
 Sockets have unique

identifier
 Each segment has special
field that indicate the socket
to which the segment is to be
delivered
 Source port number
 Destination port number
 Port is a 16 bit number
0 to 65535
0 to 1023 are well
known port numbers
and are reserved

32 bits
Source Port #

Dest Port #

Other Header Fields

Application
Data
(message)
Transport Layer Segment Format
Connectionless Transport:UDP








Internet transport protocol RFC 768
UDP does just about as little as a transport layer protocol can
do
Multiplexing/De-multiplexing
Error checking
“Best Effort” service, UDP segments may be:
 lost
 delivered out of order to applications

Connectionless:



No handshaking between UDP sender, receiver
Each UDP segment handled independently of others
Connectionless Transport:UDP
Why is there a UDP?
 No connection establishment



TCP uses a three way handshake
UDP has no delay to establish a connection
 DNS uses UDP

 No connection state at sender, receiver




TCP maintains connection state
 Congestion control parameters, sequence numbers etc.
UDP maintains no connection state
 Server can support many more active clients with UDP than over TCP

 Small segment header




20 bytes of header in TCP
Only 8 bytes of header in UDP

 No congestion control


UDP can blast away as fast as desired
UDP: Segment Structure
 The application data

occupies the data field of
the UDP segment.
 UDP header has four fields
 Each of two bytes
 Checksum
 Used by receiving host
to check for errors in
the segment
 Length
 Length of the UDP
segment

Length, in
bytes of
UDP
segment,
including
header

source port #

dest port #

length

checksum

Application
data
(message)
UDP segment format
Connectionless (UDP) De-multiplexing

P2

SP: 6428

SP: 6428
DP: 9157

client
IP: A

P1
P1

P3

SP: 9157
DP: 6428

DP: 5775

server
IP: C
SP provides “return address”

SP: 5775
DP: 6428

Client
IP:B
UDP Checksum
Checksum is used to determine whether bits within the UDP
segment have been altered e.g. noise in the link.

Sender:
 Treat segment contents

as sequence of 16-bit
word
 Checksum: 1’s complement
of the sum of all the 16bit words.
 Sender puts checksum
value into UDP checksum
field

Receiver:
 All segments are added and

than sum is added with
sender's checksum.
 If no errors are introduced
into the packet, then clearly
the sum at the receiver will
be all 1’s.
 If receiver side checksum
contains any 0 then, error is
detected and the packet is
discarded.
Checksum Example
(16 bits segment) 0110011001100110
0101010101010101
0000111100001111
The sum of first of these 16-bits integer is:
0110011001100110
0101010101010101
1011101110111011
Adding the third one to the above sum gives
1011101110111011
0000111100001111
1100101011001010 (sum of all segments)
The checksum at sender side is : 0011010100110101 (1’s
complement).
 Now at the receiver side, again all segments are added and
sum is added with sender's checksum.
 If no error than check of receiver would be :
1111111111111111
Checksum Example
 Note


When adding numbers, a carryout from the
most significant bit needs to be added to the
result

 Example: Add two 16-bit words

1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0
1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
wraparound 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1
sum 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 0 0
checksum 1 0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 1
Home Assignment

 Difference between UDP and UDP Lite?
Principles of Reliable Data Transfer
• Important in application, transport, link layers
• Top-10 list of important networking topics!
Principles of Reliable Data Transfer (rdt)
• Important in application, transport, link layers
• Top-10 list of important networking topics!
Principles of Reliable Data Transfer
• Important in application, transport, link layers
• Top-10 list of important networking topics!
Reliable Data Transfer: Getting Started
rdt_send(): called from
above, (e.g., by app.). Passed data to
deliver to receiver upper layer

send
side

udt_send(): called by rdt
protocol, to transfer packet over
unreliable channel to receiver

deliver_data(): called by rdt
to deliver data to upper layer

receive
side

rdt_rcv(): called when packet
arrives on rcv-side of channel
Reliable Data Transfer: Getting Started
We’ll:
• Incrementally develop sender, receiver sides of
reliable data transfer protocol (rdt)
• Consider only unidirectional data transfer
– but control info will flow on both directions!

• Use Finite State Machines (FSM) to specify sender,
receiver
event causing state transition
actions taken on state transition
state: When in this “state”
next state uniquely
determined by next
event

state
1

event
actions

state
2
Rdt1.0: Reliable Data Transfer over a Perfectly
Reliable Channel
• Underlying channel perfectly reliable
– no bit errors
– no loss of packets

• Separate FSMs for sender, receiver:
– sender sends data into underlying channel
– receiver read data from underlying channel

• The initial state of the FSM is indicated by the dashed line
Wait for
call from
above

rdt_send(data)
packet =make_pkt(data)
udt_send(packet)

Sender

Wait for
call from
below

rdt_rcv(packet)
extract (packet,data)
deliver_data(data)

Receiver

Note:Perfectly reliable channel no need for feedback
Rdt2.0: Channel with Bit Errors
• More realistic model
– Underlying channel may flip bits in packet

• How people deal with such a situation
– OK (positive acknowledgment)
– Please repeat that (negative acknowledgements)
– Acknowledgements (ACKs): Receiver explicitly tells sender that pkt
received OK
– Negative acknowledgements (NAKs): Receiver explicitly tells sender
that pkt had errors
– Sender retransmits pkt on receipt of NAK

• These control messages let the receiver know
– What has been received in error and requires repetition

• Automatic Repeat reQuest (ARQ) protocols.
Rdt2.0: Channel with Bit Errors
Three capabilities are required in ARQ to handle the presence of bit
errors.
• Error Detection:
– Needed to allow the receiver to detect bit errors
– Checksum field in the header
• Receiver Feed Back
– Receiver provided explicit feedback
– ACK
– NAK
• Retransmission
– A packet that is received in error will be retransmitted
• New mechanisms in rdt2.0 (beyond rdt1.0):
– Error detection
– Receiver feedback: Control msgs (ACK,NAK) Rcvr->Sender
Rdt2.0: FSM Specification
rdt_send(data)
snkpkt = make_pkt(data, checksum)
udt_send(sndpkt)
rdt_rcv(rcvpkt) &&
isNAK(rcvpkt)
Wait for
call from
above

Wait for
ACK or
NAK

udt_send(sndpkt)

rdt_rcv(rcvpkt) && isACK(rcvpkt)

receiver
rdt_rcv(rcvpkt) &&
corrupt(rcvpkt)
udt_send(NAK)
Wait for call
from below

sender
rdt_rcv(rcvpkt) &&
notcorrupt(rcvpkt)
extract(rcvpkt,data)
deliver_data(data)
udt_send(ACK)
Rdt2.0: Operation with No Errors
rdt_send(data)
snkpkt = make_pkt(data, checksum)
udt_send(sndpkt)
rdt_rcv(rcvpkt) &&
isNAK(rcvpkt)

Wait for call
from above

Wait for
ACK or
NAK

udt_send(sndpkt)

rdt_rcv(rcvpkt) && isACK(rcvpkt)

rdt_rcv(rcvpkt) &&
corrupt(rcvpkt)
udt_send(NAK)
Wait for call
from below

rdt_rcv(rcvpkt) &&
notcorrupt(rcvpkt)
extract(rcvpkt,data)
deliver_data(data)
udt_send(ACK)
Rdt2.0: error scenario
rdt_send(data)
snkpkt = make_pkt(data, checksum)
udt_send(sndpkt)
rdt_rcv(rcvpkt) &&
isNAK(rcvpkt)
Wait for

Wait for call
from above

ACK or
NAK

udt_send(sndpkt)

rdt_rcv(rcvpkt) && isACK(rcvpkt)

rdt_rcv(rcvpkt) &&
corrupt(rcvpkt)
udt_send(NAK)
Wait for call
from below

rdt_rcv(rcvpkt) &&
notcorrupt(rcvpkt)
extract(rcvpkt,data)
deliver_data(data)
udt_send(ACK)
Rdt2.0
• rdt2.0 is a stop and wait protocol
– Sender sends one packet, then
waits for receiver response

• rdt2.0 has a fatal flaw
• What happens if ACK/NAK get
corrupted?
–

•

Add checksum bits to ACK/NAK

How the protocol should recover from
errors in ACK/NAK?
– Retransmission on receipt of a
corrupt ACK/NAK
– Retransmission causes duplicates

– Receiver does not know whether
ACK or NAK it sent was received
correctly
– Receiver does not know a priori
whether an arriving packet
contains new data or is a
retransmission

Handling Duplicates:
• Sender retransmits current
packet if ACK/NAK garbled
• Sender adds sequence number
to each packet
• Receiver discards (doesn’t
deliver up) duplicate packet

More Related Content

What's hot

Transport layer services
Transport layer servicesTransport layer services
Transport layer services
Melvin Cabatuan
 
Transportlayer tanenbaum
Transportlayer tanenbaumTransportlayer tanenbaum
Transportlayer tanenbaum
Mahesh Kumar Chelimilla
 
TCP - IP Presentation
TCP - IP PresentationTCP - IP Presentation
TCP - IP Presentation
Harish Chand
 
Transport layer (computer networks)
Transport layer (computer networks)Transport layer (computer networks)
Transport layer (computer networks)
Fatbardh Hysa
 
TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)
TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)
TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)
Kruti Niranjan
 
A day in the life of a Web Request
A day in the life of a Web RequestA day in the life of a Web Request
A day in the life of a Web Request
MD.ANISUR RAHMAN
 
Week9 lec1
Week9 lec1Week9 lec1
Week9 lec1
syedhaiderraza
 
TCP/IP 3-way Handshake
TCP/IP 3-way Handshake TCP/IP 3-way Handshake
TCP/IP 3-way Handshake
Alok Tripathi
 
User datagram protocol
User datagram protocolUser datagram protocol
User datagram protocol
Ishtdeep Hora
 
Cs556 section3
Cs556 section3Cs556 section3
Cs556 section3
farshad33
 
Transport Layer Part 1
Transport Layer Part 1Transport Layer Part 1
Transport Layer Part 1Tutun Juhana
 
TCP- Transmission Control Protocol
TCP-  Transmission Control Protocol TCP-  Transmission Control Protocol
TCP- Transmission Control Protocol
Akhil .B
 
Transport Protocols
Transport ProtocolsTransport Protocols
Transport Protocols
Peter R. Egli
 
transport layer
transport layer transport layer
transport layer
usman19
 
Transport Layer Description By Varun Tiwari
Transport Layer Description By Varun TiwariTransport Layer Description By Varun Tiwari
transport layer protocols
transport layer protocolstransport layer protocols
transport layer protocols
BE Smârt
 

What's hot (20)

TCP Vs UDP
TCP Vs UDP TCP Vs UDP
TCP Vs UDP
 
Transport layer services
Transport layer servicesTransport layer services
Transport layer services
 
Transportlayer tanenbaum
Transportlayer tanenbaumTransportlayer tanenbaum
Transportlayer tanenbaum
 
Tcp Udp
Tcp UdpTcp Udp
Tcp Udp
 
TCP - IP Presentation
TCP - IP PresentationTCP - IP Presentation
TCP - IP Presentation
 
Transport layer (computer networks)
Transport layer (computer networks)Transport layer (computer networks)
Transport layer (computer networks)
 
TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)
TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)
TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)
 
A day in the life of a Web Request
A day in the life of a Web RequestA day in the life of a Web Request
A day in the life of a Web Request
 
Week9 lec1
Week9 lec1Week9 lec1
Week9 lec1
 
TCP/IP 3-way Handshake
TCP/IP 3-way Handshake TCP/IP 3-way Handshake
TCP/IP 3-way Handshake
 
Transport layer
Transport layerTransport layer
Transport layer
 
User datagram protocol
User datagram protocolUser datagram protocol
User datagram protocol
 
Cs556 section3
Cs556 section3Cs556 section3
Cs556 section3
 
Transport Layer Part 1
Transport Layer Part 1Transport Layer Part 1
Transport Layer Part 1
 
TCP- Transmission Control Protocol
TCP-  Transmission Control Protocol TCP-  Transmission Control Protocol
TCP- Transmission Control Protocol
 
Transport Protocols
Transport ProtocolsTransport Protocols
Transport Protocols
 
Tcp
TcpTcp
Tcp
 
transport layer
transport layer transport layer
transport layer
 
Transport Layer Description By Varun Tiwari
Transport Layer Description By Varun TiwariTransport Layer Description By Varun Tiwari
Transport Layer Description By Varun Tiwari
 
transport layer protocols
transport layer protocolstransport layer protocols
transport layer protocols
 

Viewers also liked

Multiplexer & de multiplexer
Multiplexer & de multiplexerMultiplexer & de multiplexer
Multiplexer & de multiplexer
vishalgohel12195
 
Multiplexing
MultiplexingMultiplexing
Multiplexing
Devang Bhatti
 
multiplexer and d-multiplexer
multiplexer and d-multiplexermultiplexer and d-multiplexer
multiplexer and d-multiplexer
malikwaqar75033149
 
User datagram protocol
User datagram protocolUser datagram protocol
User datagram protocolMohd Arif
 
Multiplexers & Demultiplexers
Multiplexers & DemultiplexersMultiplexers & Demultiplexers
Multiplexers & Demultiplexers
Jayanshu Gundaniya
 

Viewers also liked (8)

Multiplexer
MultiplexerMultiplexer
Multiplexer
 
7 multiplexing
7 multiplexing7 multiplexing
7 multiplexing
 
Multiplexing
MultiplexingMultiplexing
Multiplexing
 
Multiplexer & de multiplexer
Multiplexer & de multiplexerMultiplexer & de multiplexer
Multiplexer & de multiplexer
 
Multiplexing
MultiplexingMultiplexing
Multiplexing
 
multiplexer and d-multiplexer
multiplexer and d-multiplexermultiplexer and d-multiplexer
multiplexer and d-multiplexer
 
User datagram protocol
User datagram protocolUser datagram protocol
User datagram protocol
 
Multiplexers & Demultiplexers
Multiplexers & DemultiplexersMultiplexers & Demultiplexers
Multiplexers & Demultiplexers
 

Similar to Week4 lec1-bscs1

COE332-Ch03d.pptx
COE332-Ch03d.pptxCOE332-Ch03d.pptx
COE332-Ch03d.pptx
MemMem25
 
Lec6
Lec6Lec6
Lec6
amrnaser3
 
CNS_Module-2-ppt.pptx
CNS_Module-2-ppt.pptxCNS_Module-2-ppt.pptx
CNS_Module-2-ppt.pptx
HIMANKMISHRA2
 
Chapter3 transport layer
Chapter3 transport layerChapter3 transport layer
Chapter3 transport layerKhánh Ghẻ
 
Chapter_3_V6.01.ppt
Chapter_3_V6.01.pptChapter_3_V6.01.ppt
Chapter_3_V6.01.ppt
HarisAli552157
 
Computer network transport layer MODUL 2.pptx
Computer network transport layer MODUL 2.pptxComputer network transport layer MODUL 2.pptx
Computer network transport layer MODUL 2.pptx
pallavir61
 
Jaimin chp-6 - transport layer- 2011 batch
Jaimin   chp-6 - transport layer- 2011 batchJaimin   chp-6 - transport layer- 2011 batch
Jaimin chp-6 - transport layer- 2011 batch
Jaimin Jani
 
Computer networks Module 3 Transport layer
Computer networks Module 3 Transport layerComputer networks Module 3 Transport layer
Computer networks Module 3 Transport layer
claudle200415
 
5-LEC- 5.pptxTransport Layer. Transport Layer Protocols
5-LEC- 5.pptxTransport Layer.  Transport Layer Protocols5-LEC- 5.pptxTransport Layer.  Transport Layer Protocols
5-LEC- 5.pptxTransport Layer. Transport Layer Protocols
ZahouAmel1
 
lecturer3.pptx
lecturer3.pptxlecturer3.pptx
lecturer3.pptx
MdFarabiHasan
 
Transport Layer Services : Multiplexing And Demultiplexing
Transport Layer Services : Multiplexing And DemultiplexingTransport Layer Services : Multiplexing And Demultiplexing
Transport Layer Services : Multiplexing And Demultiplexing
Keyur Vadodariya
 
transport layer
transport layertransport layer
transport layer
BishalWosti1
 
Chapter Five - Transport Layer.pptx
Chapter Five - Transport Layer.pptxChapter Five - Transport Layer.pptx
Chapter Five - Transport Layer.pptx
GirT2
 
TCP/IP Basics
TCP/IP BasicsTCP/IP Basics
TCP/IP Basics
sanjoysanyal
 
transport.pptx
transport.pptxtransport.pptx
transport.pptx
jatinder42
 
Osi model
Osi modelOsi model
Osi model
Anuj Kumar
 
Unit 5.Transport Layer.pptx
Unit 5.Transport Layer.pptxUnit 5.Transport Layer.pptx
Unit 5.Transport Layer.pptx
1136NayanSonawane
 

Similar to Week4 lec1-bscs1 (20)

Chapter3 transport
Chapter3 transportChapter3 transport
Chapter3 transport
 
COE332-Ch03d.pptx
COE332-Ch03d.pptxCOE332-Ch03d.pptx
COE332-Ch03d.pptx
 
Lec6
Lec6Lec6
Lec6
 
CNS_Module-2-ppt.pptx
CNS_Module-2-ppt.pptxCNS_Module-2-ppt.pptx
CNS_Module-2-ppt.pptx
 
Chapter3 transport layer
Chapter3 transport layerChapter3 transport layer
Chapter3 transport layer
 
Chapter_3_V6.01.ppt
Chapter_3_V6.01.pptChapter_3_V6.01.ppt
Chapter_3_V6.01.ppt
 
Computer network transport layer MODUL 2.pptx
Computer network transport layer MODUL 2.pptxComputer network transport layer MODUL 2.pptx
Computer network transport layer MODUL 2.pptx
 
Jaimin chp-6 - transport layer- 2011 batch
Jaimin   chp-6 - transport layer- 2011 batchJaimin   chp-6 - transport layer- 2011 batch
Jaimin chp-6 - transport layer- 2011 batch
 
Computer networks Module 3 Transport layer
Computer networks Module 3 Transport layerComputer networks Module 3 Transport layer
Computer networks Module 3 Transport layer
 
5-LEC- 5.pptxTransport Layer. Transport Layer Protocols
5-LEC- 5.pptxTransport Layer.  Transport Layer Protocols5-LEC- 5.pptxTransport Layer.  Transport Layer Protocols
5-LEC- 5.pptxTransport Layer. Transport Layer Protocols
 
lecturer3.pptx
lecturer3.pptxlecturer3.pptx
lecturer3.pptx
 
Transport Layer Services : Multiplexing And Demultiplexing
Transport Layer Services : Multiplexing And DemultiplexingTransport Layer Services : Multiplexing And Demultiplexing
Transport Layer Services : Multiplexing And Demultiplexing
 
transport layer
transport layertransport layer
transport layer
 
Chapter 3 v6.01
Chapter 3 v6.01Chapter 3 v6.01
Chapter 3 v6.01
 
Chapter Five - Transport Layer.pptx
Chapter Five - Transport Layer.pptxChapter Five - Transport Layer.pptx
Chapter Five - Transport Layer.pptx
 
TCP/IP Basics
TCP/IP BasicsTCP/IP Basics
TCP/IP Basics
 
transport.pptx
transport.pptxtransport.pptx
transport.pptx
 
Mod4
Mod4Mod4
Mod4
 
Osi model
Osi modelOsi model
Osi model
 
Unit 5.Transport Layer.pptx
Unit 5.Transport Layer.pptxUnit 5.Transport Layer.pptx
Unit 5.Transport Layer.pptx
 

More from syedhaiderraza

Week16 lec1
Week16 lec1Week16 lec1
Week16 lec1
syedhaiderraza
 
Week15 lec1
Week15 lec1Week15 lec1
Week15 lec1
syedhaiderraza
 
Week14 lec2
Week14 lec2Week14 lec2
Week14 lec2
syedhaiderraza
 
Week14 lec1
Week14 lec1Week14 lec1
Week14 lec1
syedhaiderraza
 
Week13 lec2
Week13 lec2Week13 lec2
Week13 lec2
syedhaiderraza
 
Week13 lec1
Week13 lec1Week13 lec1
Week13 lec1
syedhaiderraza
 
Week11 lec2
Week11 lec2Week11 lec2
Week11 lec2
syedhaiderraza
 
Week11 lec1
Week11 lec1Week11 lec1
Week11 lec1
syedhaiderraza
 
Week10 lec1
Week10 lec1Week10 lec1
Week10 lec1
syedhaiderraza
 
Week8 lec2-bscs1
Week8 lec2-bscs1Week8 lec2-bscs1
Week8 lec2-bscs1
syedhaiderraza
 
Week8 lec1-bscs1
Week8 lec1-bscs1Week8 lec1-bscs1
Week8 lec1-bscs1
syedhaiderraza
 
Week5 lec3-bscs1
Week5 lec3-bscs1Week5 lec3-bscs1
Week5 lec3-bscs1
syedhaiderraza
 
Week5 lec2-bscs1
Week5 lec2-bscs1Week5 lec2-bscs1
Week5 lec2-bscs1
syedhaiderraza
 
Week5 lec1-bscs1
Week5 lec1-bscs1Week5 lec1-bscs1
Week5 lec1-bscs1
syedhaiderraza
 
Week4 lec2-bscs1
Week4 lec2-bscs1Week4 lec2-bscs1
Week4 lec2-bscs1
syedhaiderraza
 
Week3 lec3-bscs1
Week3 lec3-bscs1Week3 lec3-bscs1
Week3 lec3-bscs1
syedhaiderraza
 
Week3 lec 2
Week3 lec 2Week3 lec 2
Week3 lec 2
syedhaiderraza
 
Week3 lec 1
Week3 lec 1Week3 lec 1
Week3 lec 1
syedhaiderraza
 
Week2 lec3-bscs1
Week2 lec3-bscs1Week2 lec3-bscs1
Week2 lec3-bscs1
syedhaiderraza
 
Week2 lec2-bscs1
Week2 lec2-bscs1Week2 lec2-bscs1
Week2 lec2-bscs1
syedhaiderraza
 

More from syedhaiderraza (20)

Week16 lec1
Week16 lec1Week16 lec1
Week16 lec1
 
Week15 lec1
Week15 lec1Week15 lec1
Week15 lec1
 
Week14 lec2
Week14 lec2Week14 lec2
Week14 lec2
 
Week14 lec1
Week14 lec1Week14 lec1
Week14 lec1
 
Week13 lec2
Week13 lec2Week13 lec2
Week13 lec2
 
Week13 lec1
Week13 lec1Week13 lec1
Week13 lec1
 
Week11 lec2
Week11 lec2Week11 lec2
Week11 lec2
 
Week11 lec1
Week11 lec1Week11 lec1
Week11 lec1
 
Week10 lec1
Week10 lec1Week10 lec1
Week10 lec1
 
Week8 lec2-bscs1
Week8 lec2-bscs1Week8 lec2-bscs1
Week8 lec2-bscs1
 
Week8 lec1-bscs1
Week8 lec1-bscs1Week8 lec1-bscs1
Week8 lec1-bscs1
 
Week5 lec3-bscs1
Week5 lec3-bscs1Week5 lec3-bscs1
Week5 lec3-bscs1
 
Week5 lec2-bscs1
Week5 lec2-bscs1Week5 lec2-bscs1
Week5 lec2-bscs1
 
Week5 lec1-bscs1
Week5 lec1-bscs1Week5 lec1-bscs1
Week5 lec1-bscs1
 
Week4 lec2-bscs1
Week4 lec2-bscs1Week4 lec2-bscs1
Week4 lec2-bscs1
 
Week3 lec3-bscs1
Week3 lec3-bscs1Week3 lec3-bscs1
Week3 lec3-bscs1
 
Week3 lec 2
Week3 lec 2Week3 lec 2
Week3 lec 2
 
Week3 lec 1
Week3 lec 1Week3 lec 1
Week3 lec 1
 
Week2 lec3-bscs1
Week2 lec3-bscs1Week2 lec3-bscs1
Week2 lec3-bscs1
 
Week2 lec2-bscs1
Week2 lec2-bscs1Week2 lec2-bscs1
Week2 lec2-bscs1
 

Recently uploaded

Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 

Recently uploaded (20)

Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 

Week4 lec1-bscs1

  • 1. Chapter 3 Transport Layer Computer Networking: A Top Down Approach, 4th edition. Jim Kurose, Keith Ross Addison-Wesley
  • 2. Chapter 3: Transport Layer Our goals:  Understand principles behind transport layer services:     Multiplexing/De-multiplexing Reliable data transfer Congestion control Flow Control  Learn about transport layer protocols in the Internet:      UDP: connectionless transport TCP: connection-oriented transport TCP Reliability TCP congestion control TCP Flow Control
  • 3. Transport Services and Protocols  Transport layer protocols provide logical communication between app processes running on different hosts  From application’s perspective as if the host running the process are directly connected  Transport protocols run in end systems  Not in routers  Sender side: Breaks app messages into segments, passes to network layer  Receiver side: Reassembles segments into messages, passes to application layer  More than one transport protocol available to applications  Internet: TCP and UDP application transport network data link physical application transport network data link physical
  • 4. Transport vs. Network layer Network layer: logical communication between hosts  Transport layer: logical communication between  processes Household Analogy:  12 kids sending letters to 12 kids  processes = kids  app messages = letters in envelopes  hosts = houses  transport protocol = Ann and Bill  network-layer protocol = postal service  Transport layer relies on Network layer
  • 5. Internet Transport Layer Protocols  Internet Protocol (IP) Best effort delivery service  No guarantees for segment delivery  No guarantees for orderly delivery of data  IP is unreliable service Extending Host-to-Host delivery to process-to-process delivery.  Transport layer Multiplexing and De-multiplexing UDP and TCP also provide integrity checking by including error detection field in their segment headers. UDP services  Process to process data delivery  Error checking TCP Reliable data Transfer  Congestion Control, sequence numbers, acknowledgements and timers     
  • 6. Multiplexing/De-Multiplexing  Every process has a socket which allows  Data to pass from the network to the process  Data to pass from the process to the network  Receiving host directs an incoming transport layer segment to appropriate socket.  Uses set of fields in the transport layer segments  Delivering data in the transport layer segment to the correct socket is called de-multiplexing.  Gathering data chunks at the source host from different sockets ,appending header information and passing to the network layer is called multiplexing  Household analogy
  • 7. Multiplexing/De-multiplexing Demultiplexing at rcv host: delivering received segments to correct socket = socket = process application P3 P1 P1 application transport transport network network link physical P4 application link physical Multiplexing at send host: gathering data from multiple sockets, enveloping data with header (later used for demultiplexing) host 1 P2 transport network link physical host 2 host 3
  • 8. How De-multiplexing works  Sockets have unique identifier  Each segment has special field that indicate the socket to which the segment is to be delivered  Source port number  Destination port number  Port is a 16 bit number 0 to 65535 0 to 1023 are well known port numbers and are reserved 32 bits Source Port # Dest Port # Other Header Fields Application Data (message) Transport Layer Segment Format
  • 9. Connectionless Transport:UDP       Internet transport protocol RFC 768 UDP does just about as little as a transport layer protocol can do Multiplexing/De-multiplexing Error checking “Best Effort” service, UDP segments may be:  lost  delivered out of order to applications Connectionless:   No handshaking between UDP sender, receiver Each UDP segment handled independently of others
  • 10. Connectionless Transport:UDP Why is there a UDP?  No connection establishment   TCP uses a three way handshake UDP has no delay to establish a connection  DNS uses UDP  No connection state at sender, receiver   TCP maintains connection state  Congestion control parameters, sequence numbers etc. UDP maintains no connection state  Server can support many more active clients with UDP than over TCP  Small segment header   20 bytes of header in TCP Only 8 bytes of header in UDP  No congestion control  UDP can blast away as fast as desired
  • 11. UDP: Segment Structure  The application data occupies the data field of the UDP segment.  UDP header has four fields  Each of two bytes  Checksum  Used by receiving host to check for errors in the segment  Length  Length of the UDP segment Length, in bytes of UDP segment, including header source port # dest port # length checksum Application data (message) UDP segment format
  • 12. Connectionless (UDP) De-multiplexing P2 SP: 6428 SP: 6428 DP: 9157 client IP: A P1 P1 P3 SP: 9157 DP: 6428 DP: 5775 server IP: C SP provides “return address” SP: 5775 DP: 6428 Client IP:B
  • 13. UDP Checksum Checksum is used to determine whether bits within the UDP segment have been altered e.g. noise in the link. Sender:  Treat segment contents as sequence of 16-bit word  Checksum: 1’s complement of the sum of all the 16bit words.  Sender puts checksum value into UDP checksum field Receiver:  All segments are added and than sum is added with sender's checksum.  If no errors are introduced into the packet, then clearly the sum at the receiver will be all 1’s.  If receiver side checksum contains any 0 then, error is detected and the packet is discarded.
  • 14. Checksum Example (16 bits segment) 0110011001100110 0101010101010101 0000111100001111 The sum of first of these 16-bits integer is: 0110011001100110 0101010101010101 1011101110111011 Adding the third one to the above sum gives 1011101110111011 0000111100001111 1100101011001010 (sum of all segments) The checksum at sender side is : 0011010100110101 (1’s complement).  Now at the receiver side, again all segments are added and sum is added with sender's checksum.  If no error than check of receiver would be : 1111111111111111
  • 15. Checksum Example  Note  When adding numbers, a carryout from the most significant bit needs to be added to the result  Example: Add two 16-bit words 1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 wraparound 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 sum 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 0 0 checksum 1 0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 1
  • 16. Home Assignment  Difference between UDP and UDP Lite?
  • 17. Principles of Reliable Data Transfer • Important in application, transport, link layers • Top-10 list of important networking topics!
  • 18. Principles of Reliable Data Transfer (rdt) • Important in application, transport, link layers • Top-10 list of important networking topics!
  • 19. Principles of Reliable Data Transfer • Important in application, transport, link layers • Top-10 list of important networking topics!
  • 20. Reliable Data Transfer: Getting Started rdt_send(): called from above, (e.g., by app.). Passed data to deliver to receiver upper layer send side udt_send(): called by rdt protocol, to transfer packet over unreliable channel to receiver deliver_data(): called by rdt to deliver data to upper layer receive side rdt_rcv(): called when packet arrives on rcv-side of channel
  • 21. Reliable Data Transfer: Getting Started We’ll: • Incrementally develop sender, receiver sides of reliable data transfer protocol (rdt) • Consider only unidirectional data transfer – but control info will flow on both directions! • Use Finite State Machines (FSM) to specify sender, receiver event causing state transition actions taken on state transition state: When in this “state” next state uniquely determined by next event state 1 event actions state 2
  • 22. Rdt1.0: Reliable Data Transfer over a Perfectly Reliable Channel • Underlying channel perfectly reliable – no bit errors – no loss of packets • Separate FSMs for sender, receiver: – sender sends data into underlying channel – receiver read data from underlying channel • The initial state of the FSM is indicated by the dashed line Wait for call from above rdt_send(data) packet =make_pkt(data) udt_send(packet) Sender Wait for call from below rdt_rcv(packet) extract (packet,data) deliver_data(data) Receiver Note:Perfectly reliable channel no need for feedback
  • 23. Rdt2.0: Channel with Bit Errors • More realistic model – Underlying channel may flip bits in packet • How people deal with such a situation – OK (positive acknowledgment) – Please repeat that (negative acknowledgements) – Acknowledgements (ACKs): Receiver explicitly tells sender that pkt received OK – Negative acknowledgements (NAKs): Receiver explicitly tells sender that pkt had errors – Sender retransmits pkt on receipt of NAK • These control messages let the receiver know – What has been received in error and requires repetition • Automatic Repeat reQuest (ARQ) protocols.
  • 24. Rdt2.0: Channel with Bit Errors Three capabilities are required in ARQ to handle the presence of bit errors. • Error Detection: – Needed to allow the receiver to detect bit errors – Checksum field in the header • Receiver Feed Back – Receiver provided explicit feedback – ACK – NAK • Retransmission – A packet that is received in error will be retransmitted • New mechanisms in rdt2.0 (beyond rdt1.0): – Error detection – Receiver feedback: Control msgs (ACK,NAK) Rcvr->Sender
  • 25. Rdt2.0: FSM Specification rdt_send(data) snkpkt = make_pkt(data, checksum) udt_send(sndpkt) rdt_rcv(rcvpkt) && isNAK(rcvpkt) Wait for call from above Wait for ACK or NAK udt_send(sndpkt) rdt_rcv(rcvpkt) && isACK(rcvpkt) receiver rdt_rcv(rcvpkt) && corrupt(rcvpkt) udt_send(NAK) Wait for call from below sender rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) extract(rcvpkt,data) deliver_data(data) udt_send(ACK)
  • 26. Rdt2.0: Operation with No Errors rdt_send(data) snkpkt = make_pkt(data, checksum) udt_send(sndpkt) rdt_rcv(rcvpkt) && isNAK(rcvpkt) Wait for call from above Wait for ACK or NAK udt_send(sndpkt) rdt_rcv(rcvpkt) && isACK(rcvpkt) rdt_rcv(rcvpkt) && corrupt(rcvpkt) udt_send(NAK) Wait for call from below rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) extract(rcvpkt,data) deliver_data(data) udt_send(ACK)
  • 27. Rdt2.0: error scenario rdt_send(data) snkpkt = make_pkt(data, checksum) udt_send(sndpkt) rdt_rcv(rcvpkt) && isNAK(rcvpkt) Wait for Wait for call from above ACK or NAK udt_send(sndpkt) rdt_rcv(rcvpkt) && isACK(rcvpkt) rdt_rcv(rcvpkt) && corrupt(rcvpkt) udt_send(NAK) Wait for call from below rdt_rcv(rcvpkt) && notcorrupt(rcvpkt) extract(rcvpkt,data) deliver_data(data) udt_send(ACK)
  • 28. Rdt2.0 • rdt2.0 is a stop and wait protocol – Sender sends one packet, then waits for receiver response • rdt2.0 has a fatal flaw • What happens if ACK/NAK get corrupted? – • Add checksum bits to ACK/NAK How the protocol should recover from errors in ACK/NAK? – Retransmission on receipt of a corrupt ACK/NAK – Retransmission causes duplicates – Receiver does not know whether ACK or NAK it sent was received correctly – Receiver does not know a priori whether an arriving packet contains new data or is a retransmission Handling Duplicates: • Sender retransmits current packet if ACK/NAK garbled • Sender adds sequence number to each packet • Receiver discards (doesn’t deliver up) duplicate packet