1/21
Looks like no tags are added yet.
Transport services
provide logcal communication between application processes running on different hosts

Transport protocols
2 transport protocols available to internet applications: TCP, UDP
transport protocols actions in end systems:
sender: breaks application messages into segments, passes to network layer
receiver: reassembles segments into messages, passes to application layer
Transport layer vs network layer
Transport layer: communication between processes
relies on, enhances, network layer services
Network layer: communication between hosts
Transport Layer Actions: Sender
Sender:
is passed an application-layer message
determines segment header fields values
creates segment
passes segment to IP

Transport Layer Actions: Receiver
Receiver:
receives segment from IP
checks header values
extracts application-layer message
demultiplexes message up to application via socket

TCP: Transmission Control Protocol
reliable, in-order delivery
congestion control
flow control
connection setup
not available: delay guarantees, bandwidth guarantees
UDP: User Datagram Protocol
unreliable, unordered delivery
no-frills extension of “best-effort” IP
services not available: delay guarantees, bandwidth guarantees
Multiplexing (as sender)
handle data from multiple sockets, add transport header (later used for demultiplexing)

Demultiplexing (as receiver)
use header info to deliver received segments to correct socket

How demultiplexing works
host receives IP datagrams
each datagram has source IP address, destination IP address
each datagram carries one transport-layer segment
each segment has source, destination port number
host uses IP addresses & port numbers to direct segment to appropriate socket

Connectionless demultiplexing
Recall:
when creating socket, must specify host-local port #
when creating datagram to send into UDP socket, must specify:
destination IP address
destination port #
When receiving host receives UDP segment:
checks destination port # in segment, directs UDP segment to socket with that port #
IP/UDP datagrams with same dest. port #, but different source IP addresses and/or source port numbers, will be directed to the same socket at receiving host

UDP: User Datagram Protocol
“no frills”, “bare bones” Internet transport protocol
“best effort service”, UDP segments may be lost, delivered out-of-order to app
connectionless: no handshaking between UDP sender, receiver
each UDP segment handled independently of others
Why do we have UDP at all?
no connection establishment (which can add RTT - Round trip time delay)
simple: no connection state at sender, receiver
small header size
no congestion control
UDP can blast away as fast as desired!
can function in the face of congestion
UDP is used in:
streaming multimedia apps (loss tolerant, rate sensitive)
DNS
SNMP
HTTP/3
If reliability + reliable transfer needed over UDP, then you need to:
add needed reliability at application layer
add congestion control at application layer
Basically you need to add control at the application layer:
for example, Youtube, if it used TCP it would have head-blocking, in case the first packet was lost
however with UDP, if the first packet is lost and the others make it, Youtube can still load the other packets, while packet 1 is retransmitted
allows for smooth streaming
Transport Layer: UDP sender actions
is passed an application-layer message
determines UDP segment header fields values
creates UDP segment
passes segment to IP

Transport Layer: UDP receiver actions
receies segment from IP
checks UDP checksum header value
extracts application-layer message
demultiplexes message up to application via socket

UDP segment header
each field is 16-bits (source port #, dest port #, length, checksum, etc.)
Checksum: the first thing that is checked at the receiving end, bit flipping checks for errors in transmission
basically anything can cause a bitflip, eg. electromagnetic noise, congestion, physics, etc.
UDP doesn’t provide much but still has this for error-checking; not 100% reliable but it is something
length: allows reader to know how much to look for in a network stream

UDP checksum
added sum based on the bits in transmitted segment; goal is to detect errors (ie. flipped bits)

How checksum works with sender and receiver?
sender:
treat contents of UDP segment (including UDP header fields and IP addresses) as sequence of 16-bit integers
checksum: addition (one’s complement sum) of segment content
check sum value put into UDP checksum field
receiver:
compute checksum of received segment
check if computed checksum equals checksum field value:
not equal - error detected
equal - no error detected (but actually, errors could have still occurred!)
Internet checksum: weak protection!
very slight chance of this happening
