C SC 481.20 Lecture 6: Introduction and Connectionless Transport
major resource: Computer Networking (4th Edition), Kurose and Ross, Addison Wesley, 2008

[ previous | schedule | next ]

Basic Transport Services

Transport layer provides, minimally, process-to-process (e.g. client application-to-server application) communication.

For Internet communication, this involves:
(a) getting the packet from the sender’s machine to the receiver’s machine. IP, the network layer, does this.
(b) once packet arrives at receiver, delivering it to the correct process – TCP and UDP both do this.

Service: Reliable Delivery

Service: Deliver to correct process once datagram arrives

Transport Header contains two 16-bit fields (both TCP and UDP contain these, at byte 0 and byte 2):
(a) source port #
(b) destination port #

Scenario 1: simple exchange between client and server.

  1. server is up and running and listening on port X.
  2. client initiates contact, sends segment with destination port X, source port Y (selected automatically from pool of unused ports)
  3. segment arrives at server machine, destination port is read, and delivered to the process running on port X (the server process).
  4. server formulates response, sends segment with destination port Y, source port X.
  5. segment arrives at client machine, destination port is read, and delivered to the process running on port Y (the client process).
  6. client formulates response, sends segment with destination port X, source port Y.
  7. etc.

Scenario 2: two clients on same machine to same server (e.g. two browser windows).

  1. server is up and running and listening on port X.
  2. client1 initiates contact, sends segment with destination port X, source port Y1 (selected automatically from pool of unused ports).
  3. client2 initiates contact, sends segment with destination port X, source port Y2 (selected automatically from pool of unused ports).
  4. segment arrives at server machine, destination port is read, and delivered to the process running on port X (the server process). Segment could be from either client1 or client2.
  5. server formulates response, sends segment with destination port Y1 or Y2 (depending on source port of incoming segment), source port X.
  6. segment arrives at client machine, destination port is read, and delivered to the process running on whichever port is specified in source port field.
  7. etc.

Scenario 3: two clients on different machines to same server.

  1. server is up and running and listening on port X.
  2. client1 initiates contact, sends segment with destination port X, source port Y (selected automatically from pool of unused ports).
  3. client2 initiates contact, sends segment with destination port X, source port Y (selects same port number as client1!).
  4. segment arrives at server machine, destination port is read, and delivered to the process running on port X (the server process). Segment could be from either client1 or client2. Q: How does server know which one, since both have source port Y? A: looks at IP address.
  5. server formulates response, sends segment with destination port Y, source port X.
  6. etc.

The lesson for delivering to correct process: Combination of destination and source port #s will be unique, except if two clients connect to same server from different IP addresses through same source port#. In this case, differentiate based on IP address.

UDP – User Datagram Protocol

Datagram service. Used by DNS, SNMP (Simple Network Management Protocol), some A/V protocols, and a few others.

Motivation: if best-effort ("I'll try my best, but make no guarantees.") delivery is good enough, then UDP is fast (no connection setup) and cheap. Also helps if sender and receiver operate at similar rates (to avoid flooding).

Segment Structure:

  1. source port (16 bits)
  2. destination port(16 bits)
  3. segment length(16 bits)
  4. checksum(16 bits)
  5. payload (variable length)

Comments about the segment structure


[ C SC 481 | Peter Sanderson | Math Sciences server  | Math Sciences home page | Otterbein ]

Last updated:
Peter Sanderson (PSanderson@otterbein.edu)