1
1
Introduction to the Transport Layer
CSC 249 Feb 13, 2018
2
Transport Layer Overview
q Tasks performed by the transport layer
v Services provided to the application layer v Services expected from the network layer
Introduction to the Transport Layer CSC 249 Feb 13, 2018 1 - - PDF document
Introduction to the Transport Layer CSC 249 Feb 13, 2018 1 Transport Layer Overview q Tasks performed by the transport layer v Services provided to the application layer v Services expected from the network layer q Multiplexing and
1
2
v Services provided to the application layer v Services expected from the network layer
3
v Bit errors
v Lossy channel (with bit errors)
v Out-of-order packets v Noticeable delay
4
v Connection management v Reliable data transfer v Multiplexing/demultiplexing v Some error checking v Flow control & Congestion control
v delay guarantees v bandwidth guarantees v security
v UDP: Connectionless transport v TCP: Connection-oriented transport & Reliability
7
vSelects input from one of many input
vMany sockets to one network connection
vDirect a single input to one of many
vSingle network connection to many
8
process socket v use header info to deliver
received segments to correct socket
v handle data from multiple sockets v add transport header (later used
for demultiplexing)
transport application physical link network
transport application physical link network
transport application physical link network
9
DatagramSocket serverSocket = new DatagramSocket(6428);
transport application physical link network
transport application physical link network
transport application physical link network
DatagramSocket mySocket1 = new DatagramSocket(5775); DatagramSocket mySocket2 = new DatagramSocket(9157);
source port: 9157 dest port: 6428 source port: 6428 dest port: 9157 source port: ? dest port: ? source port: ? dest port: ?
10
q recall: when creating datagram to send into a UDP
v destination IP address v destination port #
1) check destination port #
2) direct UDP segment to
11
v lost v delivered out of order
v no connection establishment (can add delay) v small segment header v no congestion control: UDP can blast away as fast as
desired
12
transport application physical link network
transport application physical link
transport application physical link network
source IP,port: A,9157 dest IP, port: B, 80 source IP,port: B, 80 dest IP,port: A,9157
host: IP address A host: IP address C
network
source IP,port: C, 5775 dest IP,port: B, 80 source IP,port: C, 9157 dest IP,port: B, 80 Three segments all destined to IP address: B, dest port: 80 are demultiplexed to different sockets
server: IP address B
13
v source IP address v source port number v dest IP address v dest port number
v each socket identified by
v non-persistent HTTP will
14
v each socket identified by its own 4-tuple
16
q treat segment contents
as sequence of 16-bit integers
q checksum: 1’s complement
segment contents
q sender puts checksum
value into UDP checksum field
q compute checksum of
received segment – including the sender’s checksum 16-bit word in the sum
q If receiver’s sum is all ‘1’s
then there were no errors (probably)
v If a bit is 0 then the
packet has errors
17
q Note
v When adding numbers, a carryout from the
q Example: add two 16-bit integers 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 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 0 0 1 0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 1 wraparound sum checksum
v Desired services v Actual protocol services v What can go wrong?
v Transport layer provides end-to-end error
18