0% found this document useful (0 votes)
15 views

Distance Vector Routing

Computer networks
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

Distance Vector Routing

Computer networks
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 27

COE 475: Computer Networking

Lecture3: Transport Layer


Lecture Objectives
• to understand the
– principles behind the transport layer service
• to learn about
– transport layer protocols in the Internet
• TCP
• UDP
Transport Layer
• Function:
– provides a logical communication service between
• two application-layer processes running on different end systems

• 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

• services not available by both:


– delay guarantees
– bandwidth guarantees
• Application developer must
– specify one of these two transport layer protocols
Popular Internet Applications
• Popular Internet applications and their underlying transport protocol
Transport layer addressing
• When an application process wishes to
– Setup a communication to a remote application process
• It must specify which process to connect to
• Define transport addresses (port numbers) to which
– processes can listen for connection request
• Each port number is a
– 16-bit number ranging from 0 to 65535
• the port numbers ranging from 0 to 1023 well-known port numbers
and are restricted or reserved for well-known application protocols
Transport layer addressing
• Anytime a socket is created
– the transport layer automatically assigns a port number to the
socket from the range
• 1024 to 65535
– unless the application developer has chosen to bind the
application to a specific port
• For a server side implemetation of a well-known
protocol, a well-known port is chosen
– Example port numbers:
• HTTP server: 80
– Server process listens on port # 80 for connection requests
• Mail server: 25
Multiplexing & Demultiplexing
• Extending the host-to-host delivery service provided by
the network layer to a
– process-to-process delivery service for applications running on
the hosts is called
• transport layer multiplexing and demultiplexing
• Note
– A process can have one or more sockets
Multiplexing
• At the sender side (multiplexing)
– the transport layer has the responsibility of
• gathering data chunks from different sockets, encapsulate each data
chunk with header information to create a
– segment and pass the segments to the network layer
» this is called multiplexing
Demultiplexing
• At the destination host (demultiplexing)
– the transport layer receives segments from the network layer
and has the responsibility of
• delivering the data in these segments to appropriate application
processes
– The transport layer in the receiving host does NOT actually
deliver data directly to the process but to an intermediary
socket
• the job of delivering the data in a transport layer segment to the
correct socket is called
– Demultiplexing
Demultiplexing
• Transport layer demultiplexing requires that
1. sockets have unique identifier
2. each segment has fields that indicate the socket to which the
segment is to be delivered
• source and destination port number fields

TCP/UDP segment format


Demultiplexing
• host receives IP datagram
– each datagram has the following identifiers
• source IP address
• destination IP address
• source port number
• destination port number
– each datagram carries
• 1 transport-layer segment
• The number of
– identifiers used depends on whether the socket is
• Connectionless (UDP)
• Connection-oriented (TCP)


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

SP: 6428 SP: 6428


DP: 9157 DP: 5775

SP: 9157 SP: 5775


client DP: 6428 DP: 6428 Client
server
IP: A DestIP:C DestIP:C IP:B
IP: C

SP provides “return address”


Connection-Oriented Demultiplexing

• TCP socket identified by • Server host may support


4-tuple: many simultaneous TCP
– source IP address sockets:
– source port number – each socket identified by its
– dest IP address own 4-tuple
– dest port number • Two arriving TCP segments
• recv host uses all four with different
values to direct segment – Source IP address or
to appropriate socket – Source port number
• will be directed to two different
sockets
Connection-Oriented Demultiplexing
UDP checksum
Goal: detect “errors” (e.g., flipped bits) in transmitted segment

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

You might also like