Political Background
- Main Idea:
- Multivendor, interoperable hardware and software systems
- Hence Open Systems, meaning...
- Adherence to internationally recognised and publicly available
standards
- The players:
- International Organisation For Standardisation (ISO), creators
of the Open Systems Interconnection Reference Model (OSIRM) -
representing the de jure standards process
- Internet Architecture Board (IAB) and Internet Engineering
Task Force (IETF), developers of what has become known as the
TCP/IP protocol suite - a de facto standard in Open
Systems networking
- The history:
- ISO/CCITT problems with procedures, exponential growth in
required standards, etc. Importance rapidly fading.
- ARPAnet -> Internet, narrow focus, engineering-based,
evolutionary, and now dominant. Most topics in this unit are based
on Internet technology.
Processes and Interprocess Communications
There are many definitions of the term process in the
context of a general-purpose computing system (or host). The
following are typical:
- A program which is in execution, including:
- the instantaneous value of all of its variables (in memory
and registers)
- the "current" value of its program counter , etc
- A "window" on a simple desktop system (Mac, MS-Windows, etc)
What is interprocess communications? It occurs when a process
sends to and receives information from another process, whether
running on the same system or connected by a network.
Typical examples of interprocess communications mechanisms include
files (limited to shared filesystems), pipes (only useful where
processes share a common parent process), shared memory, named
pipes, message passing, and sockets.
The socket abstraction is the usual method of performing
network-based interprocess communications in UNIX and many other
systems, providing the interface to the transport layer, TCP.
The TCP Protocol
The dominant transport protocol in the world is the
Transmission Control Protocol (TCP) used in the
Internet.
TCP is always implemented in conjunction with IP, the Internet
Protocol[1] which provides the necessary
network service. It is important to note that IP provides an
"unreliable" packet delivery service, and may fail to deliver some
packets. Furthermore, it may accidentally duplicate packets, and
may even deliver them out of order.
The function of the TCP protocol, then, is to provide a:
- reliable
- all data is delivered correctly
- connection-oriented
- the protocol provides procedures for establishing interprocess
connections.
- byte stream
- ie, no visible packetisation so far as the application
processes are concerned
- end-to-end
...interprocess communications service.
[1] See Later
TCP Operation
In order to provide reliable, connection oriented service, TCP
breaks the incoming application byte stream into
segments.
The last byte in each segment is identified with a byte count
field in the segment header.
- When a segment is received correct and intact, a special
acknowledgement segment is returned to the sender
containing the byte count of the last byte correctly received.
- The network service can fail to deliver a segment. If the
sender waits for too long[2] for an
acknowledgment, it times out and resends the segment, on the
assumption that the datagram has been lost.
- The network can potentially deliver duplicated segments, and
can deliver segments out of order. TCP buffers or discards out of
order or duplicated segments appropriately, using the byte count
for identification.
[2] The TCP timeout algorithm uses
observed round trip times, and measures of their variability, to
calculate a continuously updated best estimate of when to resend.
Format of a TCP Segment
TCP transmits data in segments. A segment contains a
header and some data, thus:

Note:
- Port numbers define the process from which this segment was
sent, and the destination process - see next slide.
- Sequence Numbers identify last byte of data sent and received.
TCP Port Numbers
TCP provides an interprocess delivery system, so it needs to
identify processes in the two "end systems" which it connects.
To do this, it defines an abstract address called a
port number.
Two processes can communicate by agreeing on the port numbers they
will use for communications. Port numbers are the addresses of
the TCP protocol Ð each segment contains port numbers for each of
the sending and receiving processes[3].
In order to set up a TCP connection, a process notifies the TCP
software that it is waiting for connections "at" a certain port
number. By definition, such a process is called a server.
A
client process which needs to connect to the server asks
its local
TCP software to allocate an unused port number and establish the
connection. Once the connection is established, the two processes
can communicate.
In order to manage TCP connections, a group of port numbers (0 to
1023) have been defined to be used by processes providing well
known services. Most UNIX systems provide server processes
corresponding to all the well-known services.
[3]* In the second lecture they were referred to
as
Service Access Points (SAPs)
TCP Servers and Clients
Initially:

Note that the port number is used to name processes.
Because the client establishes communication, it does not need a
well-known port number, and so an unused one (> 1023) is
randomly
allocated by the TCP software, eg:

TCP Connection Establishment
The connection phase in TCP uses a 3-way handshake of
control segments:

The 3-way handshake is necessary because TCP is layered on the
unreliable datagram service provided by IP, so that these control
segments can be lost, duplicated or delivered out of order.
This could lead to trouble if original or retransmitted segments
arrive while the connection is being established - the handshake
used overcomes this problem.
A TCP connection is closed using another (modified) handshake
sequence involving the use of FIN control segments. An interesting
consequence of the full-duplex nature of TCP, and the concept of
graceful close is that a TCP connection can be half-open if one
side closes the connection and the other does not.
This lecture is also available in PostScript format.
The tutorial for this lecture is Tutorial #02.
Phil Scott