Distance Vector Routing
Distance Vector Routing
• Recall that
– a process sends messages into a network through a socket and
relies on a
• transport infrastructure on the other side of the socket to
deliver/receive messages
Transport Layer - Why
• Networks (the network layer) is
– under the control of a network operator and the network service
users have no control over it
• if something goes wrong, a user can do nothing
• The transport service is
– what designers can add at the user side to improve the reliability
of the service provided by the network
Motivating Questions
• In a packet switched network, packets
– are addressed to a host
– can be
• delayed
• Dropped
• reordered
• Questions
– how to decide which application gets which packets
– how should hosts send packets into the network?
• too fast may overwhelm the network
• too slow is not efficient (low throughput)
– how should senders avoid over-run of receivers
Transport Layer
• Fundamental principles
1. extends the network layer’s delivery service between two end systems
to a delivery service between two application-layer processes
– multiplexing/demultiplexing
2. guarantees that two entities can communicate reliably over a medium
that may lose and corrupt data
– reliable data transfer
3. control the transmission rate of transport-layer entities
– congestion control
Transport-Layer
• provide logical communication
between app processes running
on different hosts
• Application processes use the
– Logical communication provided
by the transport layer to
• send messages to each
other, free from the worry of
the details of the physical
infrastructure used to carry
these messages
• more than one transport protocol
available to apps
– Internet: TCP and UDP
Transport-Layer Services
• two basic types of transport-layer services are possible
– connection-oriented service
– connectionless service
Connection-Oriented Service
• Connection-oriented service
– requires a pair of processes to
establish connection (handshaking)
before sending data
• establish connection
• transfer data
• terminate connection
– Hides the imperfections of the network
service so that
• Processes can just assume the
existence of error-free bit stream
– reliable and provides in-order
delivery
handshake
Connectionless Service
• Requires no establishment of connection (handshaking)
before sending data
– the sender simply starts sending packets
• unreliable
• does not deliver data in order
Internet transport-layer protocols
• Transmission Control Protocol (TCP)
– connection –oriented service
• Ensures that data is delivered from sending process to receiving
correctly and in order (reliable data transfer)
• congestion control
• flow control
– Thus converts IP’s
• Unreliable service between end-systems into a reliable data
transfer service between processes
Internet transport-layer protocols
• User Datagram Protocol (UDP)
– Connectionless service
• Two minimal services
1. process to process data delivery
» does not guarantee that data sent by one process will arrive at
the destination
• unreliable, unordered delivery
2. error checking
–
Demultiplexing
• Connectionless
– UDP socket identified by two-tuple:
• destination IP address
• destination port number
– When a host receives UDP segment:
• checks destination port number in segment
– directs UDP segment to socket with that port number
– If 2 UDP segments have different source IP addresses and/or
source port numbers but have
• the same destination IP and destination port numbers
– the 2 segments will be directed to the same socket
Connectionless Demultiplexing
P2 P1
P1
P3
Sender: Receiver:
• treat segment contents as • compute checksum of received
sequence of 16-bit integers segment
• checksum: addition (1’s • check if computed checksum
complement sum) of equals checksum field value:
segment contents – NO - error detected
• sender puts checksum – YES - no error detected.
value into UDP checksum But maybe errors
field nonetheless? More later ….
UDP checksum
UDP checksum
• At the receiver side
– The three 16-bit words including the checksum are added
• If no errors are introduced to the packet
– The sum at the receiver will be
• 1111111111111111